兰州理工大学学报 ›› 2024, Vol. 50 ›› Issue (1): 104-109.

• 自动化技术与计算机技术 • 上一篇    下一篇

面向充电机通信协议一致性测试的用例自动生成方法

何雪枫*1, 贾俊国2, 李旭玲1   

  1. 1.国网电力科学研究院有限公司, 江苏 南京 211106;
    2.国网电动汽车服务有限公司, 北京 100053
  • 收稿日期:2021-12-20 出版日期:2024-02-28 发布日期:2024-03-04
  • 通讯作者: 何雪枫(1983-),女,广西桂林人,高级工程师. Email:hexuefeng_nanrui@163.com
  • 基金资助:
    国家战略性国际科技创新合作重点专项(2018YFE0208100)

Research on automatic generation method of test cases for charging device communication protocol conformance test

HE Xue-feng1, JIA Jun-guo2, LI Xu-ling1   

  1. 1. State Grid Electric Power Research Institute, Nanjing 211106, China;
    2. State Grid Electric Vehicle Service Company Ltd., Beijing 100053, China
  • Received:2021-12-20 Online:2024-02-28 Published:2024-03-04

摘要: 现有的充电机和新能源汽车电源管理系统(BMS)之间的通信协议一致性测试方法主要由专家经验设计测试用例,这种方法缺乏理论支撑,导致测试覆盖性弱,测试结果缺乏说服力,较难形成行业标准.为了解决上述问题,提出一种基于有限状态机(FSM)的充电机与BMS通信协议一致性测试方法.首先,通过对GB/T 27930—2015协议的详细解读,分析充电机和BMS之间的通信过程,使用FSM形式化语言描述充电机和BMS之间的充电过程,保证协议的不同实体之间的通信一致性.其次,在FSM的基础上利用唯一输入输出(UIO)序列计算测试序列,进而得到最终的测试用例.在生成测试用例时,采用递归算法考虑前置用例,让每一个测试用例都有完整的输入输出.最后,生成的用例结果表明,基于FSM的一致性测试方法不仅使得充电机与BMS间的通信协议一致性测试过程有了理论支撑,而且相较于基于专家经验的手工设计测试用例方法具有更强的复用能力.

关键词: 有限状态机, 充电机, 电池管理系统, 一致性测试

Abstract: Current communication protocol consistency test methods between the charger and battery management system (BMS) is mainly designed according to expert experience, which lacks theoretical support, resulting in weak test coverage and unconvincing test results. To effectively solve the above problem, a communication protocol consistency test method was designed here based on a finite state machine (FSM). First, through a detailed interpretation of Protocol GB/T 27930—2015, the communication process between the charger and BMS was analyzed using the proposed method to ensure the consistency of communication between different entities of the protocol. Secondly, the unique input/output (UIO) was exploited on FSM to get the test sequence and the final test case set. The recursive algorithm was adopted to consider the pre-test cases so that each test case had complete input and output. The results show that the consistency testing method based on FSM not only provides theoretical support for the communication protocol consistency testing process between charger and BMS, but also has strong reuse ability compared to the experience-based method.

Key words: finite state machine, charger, battery manage system, consistency test

中图分类号: