摘要
移动互联网下的即时通信应用现今已经成为人们日常沟通必不可少的工具,然而作为其开发基础的即时通信协议却始终没有一个统一的标准,已有的即时通信协议都不能够很好的适应移动互联网网络环境不稳定,低带宽高延迟,设备计算能力差等特点.MQTT协议作为一种基于发布/订阅模型的轻量级消息传输协议,在移动平台具有节省流量和能耗,可扩展性强的优点.本文首先介绍了当前一些主流的即时通信协议,指出了它们在移动互联网环境下存在哪些缺陷;之后研究了MQTT协议的消息格式与使用方式,并与已有的即时通信协议进行了对比;最后基于MQTT协议,对即时通信应用的两项核心功能IM和Presence进行了设计和实现,并经过测试表明使用MQTT协议能够在移动互联网环境下提供比传统即时通信协议更少的带宽耗费和更良好的用户体验.
Instant communication applications in Mobile Internet have become an indispensable part for people's daily communication nowadays. The real-time communication protocol, which is the basis for the development of instant communication applications, however, has no unified standard. The existing real-time communication protocols are not able to perfectly adapt to mobile Internet, which has a constrained network environment with the characteristics of low-bandwidth, limited processing capabilities and high latency. MQTT is a publish/subscribe based, extremely simple and lightweight messaging protocol, whose design principle is to minimize the network bandwidth and device resource requirements. This article first introduces some existing mainstream instant communication protocols and points out their shortcomings in mobile Internet environment. The second part introduces MQTT protocol briefly and studies the format and interaction process of MQTT message. Finally, based on MQTT, the article puts forward an implementation of IM and Presence, which are the core functions of Instant Communication. As a conclusion, the experiment shows that using the MQTT protocol can provide less bandwidth cost and better user experience for instant communication in mobile Internet.
出处
《计算机系统应用》
2016年第3期170-176,共7页
Computer Systems & Applications