A simple, flexible and universal solution using the Eclipse modeling framework (EMF) for developing systems based on the common information model (CIM) is proposed. The scheme contains three aspects. Firstly, the Java code of package, class and object relations defined in CIM are automatically generated. Secondly, the CIM extendable markup language (XML) file can be efficiently scanned through streams, objects are formed in the memory during the scanning process, the relations between objects are constructed after the scan is finished. The differences of different energy management system (EMS) suppliers and different CIM versions are shielded, so good compatibility is reached. Thirdly, the constraints of objects defined in CIM are validated. The validity of the solution is testified by test results of CIM data of several real systems.%基于Eclipse建模框架,提出了一种简洁、灵活、通用的解决方案,帮助开发者高效地开发基于公共信息模型(CIM)的系统。该方案包含3个方面内容:其一,按照CIM所定义的包、类、对象以及对象之间的关联关系自动生成Java代码,使开发者具备快速追踪最新CIM版本的能力;其二,能够以流的方式高速扫描CIM可扩展置标语言(XML)文件,扫描过程中形成CIM对象,扫描结束后建立对象间的关联关系,且能够屏蔽不同厂家、不同版本CIMXML文件之间的差异性,具有较好的兼容性;其三,能够验证对象间关联关系是否满足CIM标准规定的约束。最后,对多个实际系统的C1M数据进行了测试,实验结果验证了该方案的有效性。
展开▼