基于状态机的HTTP Chunked流并发解析  被引量:2

HTTP Chunked Stream Concurrence Analysis Based on State Machine

在线阅读下载全文

作  者:李明哲[1,2] 陈君[1] 王劲林[1] 陈晓[1] 

机构地区:[1]中国科学院声学研究所国家网络新媒体工程技术研究中心,北京100190 [2]中国科学院大学,北京100190

出  处:《计算机工程》2015年第1期256-260,共5页Computer Engineering

基  金:国家"863"计划基金资助项目(2011AA01A102);中国科学院战略性先导科技专项课题基金资助项目(XDA06010302)

摘  要:某些流媒体服务器需要对HTTP Chunked编码数据流进行并发解析,朴素静态解析算法难以应用于高效灵活的事件驱动并发模型,且会造成长延迟和多次数据拷贝,导致内存和计算资源开销都较高。针对上述问题,提出一种基于有限状态机的解析策略。将一次接收和一次解析操作构成一个任务片,从而适应事件驱动模型,对收到的数据包进行即时处理和释放,不需要缓存整个HTTP报文,减少一次内存拷贝开销。在数据处理过程中,通过有限状态机保存解析状态,能够在任务片退出后恢复之前的解析状态,从而解决事件驱动模型下的字段断裂问题。实验结果表明,相比于静态解析算法,该策略能够明显地降低解析过程的处理时间和占用的内存。In some streaming media applications,a server needs to parse HTTP Chunked encoding messages concurrently. The naive static parsing algorithm does not fit in the efficient event-driven concurrency paradigm,and incurs long delay and several memory copies,leads to high memory and computing overhead. To tackle this problem,a finite state machine based parsing algorithm is presented. One receiving and its following parsing operations are combined into a task slice so that the event-driven model can be applied. Data packets are parsed immediately without caching the whole HTTP message,and therefore one memory copy is reduced. Parsing status is saved into state machines to that the context can be restored after the task slice is over,which solves the broken-field problem. Test results show that this method can significantly reduce memory and computation overhead compared with static parsing.

关 键 词:流媒体 HTTP Chunked编码 并发解析 事件驱动模型 有限状态机 内存拷贝 

分 类 号:TP37[自动化与计算机技术—计算机系统结构]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象