摘要
针对传统实时Web技术存在实时性差、吞吐量大等缺点,构建一种基于HTML5的实时Web数据监测系统,并与传统Ajax轮询方式进行了对比。该系统通过Node.js搭建WebSocket服务器,将实时数据(如温度、湿度、电压、电流等)通过WebSocket技术实时推送到客户端,客户端通过Echarts对实时数据进行直观显示。结果表明:Websocket服务器推送技术实时性更强,并有效地减少了网络吞吐量,具有很强的实用性。
Traditional real-time Web technology based on HTTP protocol has the shortcomings of big consumption and low efficien-cy.A new real-time data monitoring system based on HTML5 is built and compared with the Aj ax.The proposed system sets up a WebSocket server through the Node.j s,and pushes the real-time data (such as temperature,humidity,voltage,current)to the cli-ent via the WebSocket technology.Then the real-time data is displayed by the client through the Echarts.The simulation results show that the real-time Web technology based on WebSocket can reduce delay and network throughput.So it is practicable.
出处
《桂林电子科技大学学报》
2015年第2期136-141,共6页
Journal of Guilin University of Electronic Technology
基金
广西自然科学基金(2014GXNSFAA118393)