计算机技术与发展
計算機技術與髮展
계산궤기술여발전
COMPUTER TECHNOLOGY AND DEVELOPMENT
2015年
4期
130-133,138
,共5页
能耗数据采集%协议帧%协议描述%协议解析
能耗數據採集%協議幀%協議描述%協議解析
능모수거채집%협의정%협의묘술%협의해석
energy consumption data acquisition%protocol frame%protocol description%data parser
针对能耗计量仪表通信协议多标准并存的问题,分析了常用协议的特征,依据程序与数据分离的原则,提出应用三层树形结构来表示协议。采用XML文档作为协议描述文件,通过对描述文件中元素和属性的定义完成了协议描述文件的设计,并应用协议帧某些字段的属性建立协议特征库,最后给出了通用协议帧生成与解析的实现方法。测试结果表明,该方法能很好地应用于能耗监管领域DL/T645-1997、DL/T645-2007、CJ/T188协议的描述以及数据采集协议帧的生成与能耗数据的初步解析,具有一定的通用性,避免了重复开发。
針對能耗計量儀錶通信協議多標準併存的問題,分析瞭常用協議的特徵,依據程序與數據分離的原則,提齣應用三層樹形結構來錶示協議。採用XML文檔作為協議描述文件,通過對描述文件中元素和屬性的定義完成瞭協議描述文件的設計,併應用協議幀某些字段的屬性建立協議特徵庫,最後給齣瞭通用協議幀生成與解析的實現方法。測試結果錶明,該方法能很好地應用于能耗鑑管領域DL/T645-1997、DL/T645-2007、CJ/T188協議的描述以及數據採集協議幀的生成與能耗數據的初步解析,具有一定的通用性,避免瞭重複開髮。
침대능모계량의표통신협의다표준병존적문제,분석료상용협의적특정,의거정서여수거분리적원칙,제출응용삼층수형결구래표시협의。채용XML문당작위협의묘술문건,통과대묘술문건중원소화속성적정의완성료협의묘술문건적설계,병응용협의정모사자단적속성건립협의특정고,최후급출료통용협의정생성여해석적실현방법。측시결과표명,해방법능흔호지응용우능모감관영역DL/T645-1997、DL/T645-2007、CJ/T188협의적묘술이급수거채집협의정적생성여능모수거적초보해석,구유일정적통용성,피면료중복개발。
Aiming at the problem of multi-standard coexisting of energy consumption meters communication protocol,the feature of com-monly used protocol is analyzed. According to the principle of separation of program and data,a method of using three layer tree structure to represent protocol datagram is proposed in this paper. The XML document is used as protocol description file. The protocol description file is designed by the definition of elements and attributes in description file. Then the protocol feature library is established by using some attributes of some parts of protocol datagram. At last,a general method to realize protocol datagram parsing and generating is put forward. The test results show that this method can be good for describing the protocol of DL/T645-1997,DL/T645-2007 and CJ/T188 in energy consumption regulation area as same as the protocol datagram parsing and generating. This approach has good generality and can reduce the repeated development.