电能质量数据交换格式文件通用解析方案
A General Parsing Scheme for Power Quality Data Interchange Format Files
-
摘要: 针对国内电能质量领域各厂家以及各省规范对电能质量数据交换格式(PQDIF)文件定义差异所造成的解析程序兼容性问题,提出并实现了一种PQDIF文件通用解析方案。通过总结已知PQDIF文件标签组合及其对应测量指标类型,进而构造可扩展标记语言(XML)格式存储的通道序列定义表;利用哈希表将待解析文件的标签组合在表中快速匹配对应的测量指标类型,并对未知标签组合进行差异匹配得到最相近组合。在无需修改解析程序源代码的前提下,不但可以实现对已知不同定义结构PQDIF文件的正确快速解析,而且只需用户进行简单配置,即可顺利解析包含未知标签组合的PQDIF文件。在某省电能质量一体化数据平台中的成功应用证明了此方案的可靠性和实用性。Abstract: To solve the parsing program’s compatibility issues caused by the different definitions of power quality data interchange format(PQDIF) between the manufacturers and provincial standards in the field of domestic power quality,a general parsing scheme for PQDIF files is proposed and implemented.By summarizing tag groups of the known PQDIF files and their corresponding power quality measurement types,the scheme structures a channel series definition table stored in the extensible markup language(XML) format.When parsing a PQDIF file,the Hash table is applied to quickly match the tag groups with the known groups and corresponding measurement types in the channel series definition table,and at the same time differently match the unknown tag groups with the most similar groups.Without modifying the source code of the parsing program,not only the known PQDIF files which have different definition structures could be parsed quickly and correctly,but also the PQDIF files with unknown tag groups could be parsed through simple configurations made by users.The reliability and practicality of the parsing scheme are proved through applications in Sichuan power quality integrated data platform.