物联网应用领域中,应用层的远程数据传输协议与通信程序往往融为一体,当数据传输协议改变时,通信程序一般需要大规模修改甚至重新编写,因而大大降低了通信程序的可重用性。针对这一问题,文中提出了一种基于XML(e Xtensible Markup Language,可扩展标记语言)结构化方式来描述数据传输协议的方案,并探讨了基于该方案的解析方法。该方案可以统一数据格式,实现异构数据的通用解析。在不修改通讯程序的情况下,通过修改数据传输协议的XML文件,即可实现通信数据的接收和解析。最后以电能表数据传输协议的某一子协议为例,对该功能进行测试,验证了方案的可行性。
In the Internet of Things,remote data transmission protocol and the communication program is closely related. When the communication protocol is changed,the communication program is also to be written,so the reusability of communication program is reduced.In order to solve the problem,based on the XML structure,the transmission protocol of data description is proposed,based on which the analytic method is put forward. The unified data format of the scheme can adapt to the data exchange between heterogeneous systems by modifying the transmission protocol text file with no modification on the program. Finally,given the functional testing,the feasibility of this scheme is verified.