本文已被:浏览 2702次 下载 5001次
Received:August 18, 2015 Revised:November 02, 2015
Received:August 18, 2015 Revised:November 02, 2015
中文摘要: 传统Web通信系统多采用轮询拉取方式,此种方式存在实时性低、网络资源消耗大、扩展性差等缺点.针对上述问题,本文研究了WebSocket中的长连接技术,结合MQTT协议,提出了基于pub/sub模型的Web端即时通信解决方案,以推送取代传统拉取方式.文中重点阐述了IM与通知类消息格式设计,并针对通知类消息提出了agent代理模型,同时为了进一步减少网络资源消耗,提出了预订阅模式.最后将该解决方案与现流行的bosh+xmpp方式在时延、带宽消耗方面做了对比分析,以验证该方案的性能优势.
Abstract:Polling pull strategy, which is widely used in traditional web communication system, has some problems, such as low real-time, heavy consumption of network resource and poor scalability. To solve these problems, much research about long connection technology in WebSocket has been done in the paper. Combining WebSocket with MQTT protocol, a new web instant messaging solution based on pub/sub model was proposed to replace polling strategy with push strategy. The formation design of IM and notification message was described in detail. And agent model was proposed for notification message. Meanwhile, a pre-subscription scheme was put forward to decrease net resource consumption further. Moreover, a comparative analysis on delay, bandwidth consumption between the solution and a current popular way bosh+xmpp was done to verify the advantages of the solution.
keywords: B/S real-time communication WebSocket MQTT Pub/Sub
文章编号: 中图分类号: 文献标志码:
基金项目:
引用文本:
刘峰,陈朴,贾军营.WebSocket与MQTT在Web即时通信系统中的应用.计算机系统应用,2016,25(5):28-33
LIU Feng,CHEN Pu,JIA Jun-Ying.Application of WebSocket and MQTT in Web Real-Time Communication System.COMPUTER SYSTEMS APPLICATIONS,2016,25(5):28-33
刘峰,陈朴,贾军营.WebSocket与MQTT在Web即时通信系统中的应用.计算机系统应用,2016,25(5):28-33
LIU Feng,CHEN Pu,JIA Jun-Ying.Application of WebSocket and MQTT in Web Real-Time Communication System.COMPUTER SYSTEMS APPLICATIONS,2016,25(5):28-33