物联网系统中数据交换协议私有化的问题日益突出,异构应用系统之间缺少水平、无缝地交换数据和共享信息的方法.而现有互联网中广泛采用的XML(eXtensible Markup Language)等数据交换协议存在数据冗余和解析复杂的问题,并不适用于资源受限的物联网前端设备.因此文中提出了一种新型的水平化轻量级物联网数据交换协议EasiDEF.该协议根据环境监测类物联网的应用数据特点,将数据类型分为单次请求数据和周期连续上报数据两种常见形式.针对单次出现的数据请求采用三级压缩机制,包括:(1)一种XML文件的序列化方法.该方法基于XML标准设计,保证了数据交换的通用性和水平化.同时序列化的操作使得在低功耗设备中应用XML成为可能;(2)一种将XML文件的字符串标签转化为占用空间小的数值标签的字典映射机制,其中字典的设计面向典型的物联网应用;(3)一种基于LZW(Lempel-Ziv-Welch)的改进数据压缩算法EasiLZW,该算法基于物联网应用字典压缩数据,保证协议的轻量性.而针对周期连续上报数据类型,对连续数据传输提出了一种增量式压缩算法.在保证协议低开销的前提下,EasiDEF可有效压缩XML文件,降低数据传输量.实验结果显示EasiDEF比传统方法提升了5~10倍的压缩效果,能够在物联网的资源受限环境中支持水平化的数据交换.
Privatization of the data exchange protocol is a critical problem in the Internet of Things,so heterogeneous systems cannot exchange data and share information seamlessly.Moreover the existing standard protocol like XML is rather heavy load and complicated for the resourceconstrained devices in IoT.Therefore this paper proposes EasiDEF,a new horizontal lightweight data exchange protocol for IoT.According to the data feature of IoT application for environmental monitoring,data types are classified as single request data and periodic continuous reporting data.For the single request data,EasiDEF adopts three-phase compression mechanism,including:(1)a serialization method of XML documents.Based on XML the work ensures interoperability for heterogeneous systems.In addition the serialization operation makes it possible to apply XML in low-power devices;(2)a dictionary mapping mechanism which transfers long text string of XML documents to short binary value according to typical IoT applications;(3)a LZW-based improved data compression algorithm named EasiLZW,which uses the IoT dictionary in thesecond phase to keep lightweight.Given the periodic continuous reporting data in IoT system,the paper presents an incremental compression algorithm.Accounting for the requirement of low cost in resource-constrained devices,EasiDEF can significantly compress XML documents and reduce the amount of data transmission.Experimental results show that EasiDEF has a 5—10times promotion in the compression effect compared with conventional methods and supports seamless data exchange in resource-constrained environments.