journal6 ›› 2015, Vol. 36 ›› Issue (4): 18-22.DOI: 10.3969/j.cnki.jdxb.2015.04.005

• 信息与计算机 • 上一篇    下一篇

基于Spring4+HTML5的实时监控应用通信与显示处理

丁振凡   

  1. (华东交通大学信息工程学院,江西 南昌 330013)
  • 出版日期:2015-07-25 发布日期:2015-07-27
  • 作者简介:丁振凡(1965—),男,江西丰城人,华东交通大学信息工程学院教授,硕士生导师,主要从事云计算、语义Web、计算机辅助教学等研究.

Communication and Display Processing for the Real-Time Monitoring Application Based on Spring4+HTML5

 DING  Zhen-Fan   

  1. (School of Information Engineering,East China Jiaotong University,Nanchang 330013,China)
  • Online:2015-07-25 Published:2015-07-27

摘要:针对某企业生产线远程数据监测应用中消息推送与显示处理的问题,提出基于Sping4+HTML5的实现方案.采用WebSocket技术实现浏览器与Web服务器的双向消息通信.研究了Spring的WebSocket服务配置和实现消息推送的处理流程,描述了客户方与服务方如何建立SockJS连接,以及实现基于STOMP的消息发布/订阅处理的具体方法.将消息推送封装为REST风格的Web服务,方便调用者发布消息.系统采用HTML5的Canvas实现数据的实时显示处理,可在同一画面中显示各种颜色的曲线.Sping4+HTML5方案具有配置简单、应用灵活、运行效率高等特点,在实际应用中取得了很好的效果.

关键词: HTML5, Spring4, WebSocket, Canvas, 实时监控, SockJS

Abstract: In view of message pushing and display processing problems in the remote data monitoring application for the production line in one enterprise,this paper proposes an implementation scheme based on HTML5 and the Spring framework 4.WebSocket technology is used for the message transfer on the two way communication between the web browser and Web server.The Spring WebSocket service configuration and the processing scheme for message pushing are studied.The creation of SockJS connection between the client and server and the processing method for STOMP message publishing/subscription are described.By providing the REST style Web services with the messages pushing process,it is convenient for the caller to publish message.The system adopts Canvas in HTML5 for the real time data display processing,thus achieving the effect of displaying curves of various colors in the same screen.The Spring4+HTML5 scheme has the advantages of easy configuration,flexible application and efficient operation and can get satisfactory practical effects.

Key words: HTML5, Spring4, WebSocket, Canvas, real-time monitoring, SockJS

公众号 电子书橱 超星期刊 手机浏览 在线QQ