Electric automobile battery charger-battery management system protocol conformance test method
Technical field
The present invention relates to a kind of electric automobile battery charger-battery management system protocol conformance test method, belong to test and metering field.
Background technology
Chinese society economic development faces the severe challenges such as energy supply shortage, ecological environmental pollution.The electric automobile of energy-saving and environment friendly is the main direction of China's new-energy automobile development, is having vast potential for future development.Electric automobile battery charger as electric automobile energy supply and with the key equipment of electrical network two-way interaction, be that the important foundation that electric automobile is applied supports, be also the important content in electric automobile commercialization, industrialization process.
Electric automobile battery charger-battery management system agreement has realized charging electric vehicle, coordinates to control the power stage of charger, ensures the stable operation of electrokinetic cell, receives much attention always.Current domestic electric automobile battery charger-battery management system agreement is mainly followed three kinds of standard criterions, comprises GB/T 27930-2011, NB/T 33003-2010, Q/GDW 235-2008.
In the actual use procedure of electric automobile battery charger-battery management system agreement, because producer and applying unit cause understanding differently of the standard of agreement, implementation method is different, give actual interoperability issue, how to guarantee realization and the standard consistency of electric automobile battery charger-battery management system agreement, guarantee that the interoperability of electric automobile battery charger-battery management system agreement is the emphasis of our research.
At present, in existing electric automobile battery charger-battery management system protocol test, mainly whether checking charge function is realized, as completed charging, can upload charging data, whether electric automobile battery charger-battery management system agreement of having ignored bearing function meets the requirement of standard and the negative testing to agreement.Like this, on surface, charge function is to have realized, but the consistency that may realize because of agreement when interconnected at actual and electric automobile or charger, give the interconnected difficulty of bringing, also likely in some function of the abnormal timer of protocol massages, be affected, as run into, when protocol massages is abnormal, cause the deadlock of device in reality test.Therefore, current electric automobile battery charger-battery management system protocol testing method subject matter is can not system, comprehensively examines or check the consistency that agreement realizes, and gives the interconnected band hidden danger between charger and electric automobile, has promoted electric automobile operational failure rate.
Summary of the invention
The object of the present invention is to provide a kind of electric automobile battery charger-battery management system protocol conformance test method, solve the problem of testing the realization of an authentication function in the past and ignoring agreement test itself.
Electric automobile battery charger-battery management system protocol conformance test method, comprises the following steps:
(1) tested device provides communications protocol explanation, and fills in electric automobile battery charger-battery management system protocol conformance statement table;
(2) build test platform, protocol test equipment is connected with tested device, connecting electric automobile charger and battery management system;
(3) record the communication interface of tested device;
(4) carry out physical layer communication rate test, the communication baud rate that is specially adjustment protocol test equipment is consistent with the communication baud rate of tested device, utilize protocol test equipment to send correct order, check the communication message that tested device is responded, detect and whether support this traffic rate;
(5) carry out the test of data link layer PDU/PGN form, be specially and utilize protocol test equipment to send correct communication message, comprise correct PDU form, correct PGN, correct address assignment, and the connection initialization of transport protocol capabilities, transfer of data, connection closed are followed the definition of standard transmission, check that whether the form of the response frame that can tested device correctly respond and return is correct; Utilize protocol test equipment to send the communication message of PDU format error, check whether tested device can make response extremely to this; Utilize protocol test equipment to send the communication message of PGN mistake, check whether tested device abandons this frame;
(6) carry out the test of data link layer transmission format protocol, be specially: while utilizing protocol test equipment to send 9 bytes or above data message, not according to transmission format protocol transmission, check whether tested device responds;
(7) carry out data-link layer address allocation for test, be specially: utilize the communication message of protocol test equipment transmission source/destination address mistake, the response frame that tested device is returned carries out logic judgement, check whether tested device filters this frame;
(8) charge message test, is mainly divided into charger positive test, negative testing and battery management system positive test, negative testing;
Charger positive test, comprises the following steps:
The positive test of the CRM message that 8-11) identification code is 0X00, after test platform is built, checks the CRM message response that the enough identification codes of tested device energy are 0X00;
The positive test of the CRM message that 8-12) identification code is 0XAA, protocol test equipment sends BRM message to tested device, checks that it is the CRM message response of 0XAA that tested device can correctly receive and use identification code;
8-13) the positive test of CTS and CML message, protocol test equipment sends BCP message to tested device, checks that tested device can correctly receive and use CTS and CML message response;
8-14) the positive test of CRO message, protocol test equipment sends BRO message to tested device, checks that tested device can correctly receive and use CRO message response;
8-15) the positive test of CCS message, protocol test equipment sends BCL and BCS message to tested device, checks that tested device can correctly receive and use CCS message response;
8-16) the positive test of CST message, protocol test equipment sends BST message to tested device, checks that tested device can correctly receive and use CST message response;
8-17) the positive test of CSD message, protocol test equipment sends BSD message to tested device, checks that tested device can correctly receive and use CSD message response;
Charger negative testing, comprising:
The negative testing of the CRM message that 8-21) identification code is 0X00, during CRM message response that tested device can enough identification codes is 0X00, after communication loop is untied, checks that tested device can stop the CRM message response that identification code is 0X00;
The negative testing of the CRM message that 8-22) identification code is 0XAA, protocol test equipment sends BRM invalid packet to tested device, checks the CRM message response that tested device can not be 0XAA by identification code;
8-23) the negative testing of CTS and CML message, protocol test equipment sends BCP invalid packet to tested device, and inspection tested device can not be used CTS and CML message response;
8-24) the negative testing of CRO message, protocol test equipment sends BRO invalid packet to tested device, and inspection tested device can not be used CTO message response;
8-25) the negative testing of CCS message, protocol test equipment sends BCL and BCS invalid packet to tested device, and inspection tested device can not be used CCS message response;
8-26) the negative testing of CST message, protocol test equipment sends BST invalid packet to tested device, and inspection tested device can not be used CST message response;
8-27) the negative testing of CSD message, protocol test equipment sends BSD invalid packet to tested device, and inspection tested device can not be used CSD message response;
Battery management system positive test, comprising:
8-31) the positive test of BRM message, protocol test equipment sends to tested device the CRM message that identification code is 0X00, checks that tested device can correctly receive and use BRM message response;
8-32) the positive test of BCP message, protocol test equipment sends to tested device the CRM message that identification code is 0XAA, checks that tested device can correctly receive and use BCP message response;
8-33) the positive test of BRO message, protocol test equipment sends CTS and CML message to tested device, checks that tested device can correctly receive and use BRO message response;
8-34) the positive test of BCL, BCS message, protocol test equipment sends CRO message to tested device, checks that tested device can correctly receive and use BCL and BCS message response;
8-35) the positive test of BSM, BMV, BMT and BSP message, in charging process, checks that tested device can send BSM, BMV, BMT and BSP message;
8-36) the positive test of BST message, protocol test equipment sends CST message to tested device, checks that tested device can correctly receive and use BST message response;
8-37) the positive test of BSD message, controls tested device and stops charging, checks that tested device can correctly send BST, and protocol test equipment is with after CST message response, and tested device can be used BSD message response;
Battery management system negative testing, comprising:
8-41) the negative testing of BRM message, protocol test equipment sends to tested device the CRM invalid packet that identification code is 0X00, and inspection tested device can not be used BRM message response;
8-42) the negative testing of BCP message, protocol test equipment sends to tested device the CRM invalid packet that identification code is 0XAA, and inspection tested device can not be used BCP message response;
8-43) the negative testing of BRO message, protocol test equipment sends CTS and CML invalid packet to tested device, and inspection tested device can not be used BRO message response;
8-44) the negative testing of BCL, BCS message, protocol test equipment sends CRO invalid packet to tested device, and inspection tested device can not be used BCL and BCS message response;
8-45) the negative testing of BSM, BMV, BMT and BSP message, protocol test equipment sends CCS invalid packet to tested device, and inspection tested device can not be used BSM, BMV, BMT and BSP message response;
8-46) the negative testing of BST message, protocol test equipment sends CST invalid packet to tested device, and inspection tested device can not be used BST message response;
8-47) the negative testing of BSD message, controls tested device and stops charging, checks that tested device can correctly send BST, and protocol test equipment is with after the response of CST invalid packet, and tested device can not be used BSD message response;
(9) carry out error message test, while utilizing protocol test equipment to carry out reverse message test, the tested device enough BEM of energy or CEM message response, and flag definition is correct; Utilize protocol test equipment to control message response time and surpass regulation, tested device also can enough BEM or CEM message response;
(10) carry out charging flow test, utilize protocol test equipment to adjust the order in each stage of charging process, for correct charging flow, tested device can be identified and correctly response; For incorrect charging flow, tested device can be ended charging flow;
(11) carry out retransmission mechanism test, utilize protocol test equipment delayed delivery message in test process, check that can tested device have retransmission mechanism;
(12) carry out message period measuring, utilize protocol test equipment to send message to tested device, adjust protocol test equipment transmitting time, check that can the cycle of tested device repeating transmission message meet standard-required;
(13) carry out the test of multiframe message, utilize protocol test equipment to send multiframe message to tested device, check that can tested device normal response to multiframe message; Utilize protocol test equipment to send illegal multiframe message to tested device, check that can tested device extremely to making response;
(14) carry out invalid information unit testing, utilize protocol test equipment to send message to tested device, when sending multibyte information unit, can byte invalid or reserved in the response message of tested device set to 0 xFF, and invalid or reserved potential energy is no is set to 1;
(15) carry out the test of data receiver formula, utilize protocol test equipment to send message to tested device, check that can tested device adopt low level first to send, the high-order rear transmission form sending; Check when tested device receives the message of protocol test equipment transmission, can to data, correctly resolve according to this form;
(16) carry out data area test, utilize defined byte in protocol test equipment change standard, and exceed the scope of regulation, check that can tested device make response;
(17) carry out application function test, according to the application function of tested device in protocol conformance statement table, check each application function whether can correctly complete;
(18) carry out data accuracy test, utilize test apparatus to apply electric parameters to tested device, then utilize protocol test equipment to send command frame, check that whether the data of sending in tested device are correct.
Aforesaid protocol test equipment is and to send various command frame to tested device according to the needs simulation of test, and receives the device of the response frame of tested device; On described protocol test equipment, preset various command frame and with respect to the correct response frame of command frame, protocol test equipment receives after the response frame that tested device returns and the response frame contrast prestoring, carry out logic judgement, the consistency of the response message of checking tested device.
Aforesaid tested device is electric automobile battery charger or battery management system, and as will be verified electric automobile battery charger to the response consistency of message time, by electric automobile battery charger and protocol test equipment connection, tested device is electric automobile battery charger; While verifying battery management system to the response consistency of message, by battery management system and protocol test equipment connection, tested device is battery management system.
Aforesaid test apparatus connects tested device and protocol test equipment; Described test apparatus is output voltage according to demand, the device of current electrical amount; Described test apparatus is accepted the coordination of protocol test equipment and is controlled, and to tested device, applies electric parameters.
Advantage of the present invention is:
1) content measurement is comprehensive, content measurement comprises the checking of uniformity test, application function and the data accuracy of agreement, wherein testing protocol consistency comprises the test of charging message, charging flow, error message, this method of testing has provided system of electric automobile battery charger-battery management system agreement, comprehensive content measurement and method of testing, and guarantee agreement is realized consistency and interoperability.
2) open test thought, method of testing has provided positive test and the negative testing method of charging message, can find out the degree of depth defect of measurand, has guaranteed the accordance of protocols and standards;
3) special electric automobile battery charger-battery management system protocol test equipment, is used special protocol test equipment to be more conducive to find the mistake in protocol massages;
4) be applicable to test specification and the standard of various electric automobile battery chargers and battery management system, have wider applicability;
5) mode that can be friendly is pointed out inspection test process, sent out message, is received message and test result etc. to user, has intuitively, advantage easily;
6) can provide for professional testing agency or producer method and the means of effective detection, assessment protocol conformance and function.
Accompanying drawing explanation
Fig. 1 is test platform architecture figure of the present invention.
Embodiment
Now describe the present invention in detail with embodiment by reference to the accompanying drawings.
Method of testing of the present invention has been formulated in detail comprehensively content measurement, and utilizes special protocol test equipment to complete testing protocol consistency.
Content measurement is as shown in table 1, comprises physical layer test, data link layer test and application layer test.
Wherein,
Physical layer test, mainly examines or check the traffic rate that tested device is supported.
Data link layer test, mainly examines or check transmission mode, PGN/PDU identification, and check code and link transmission state, guarantee that under or abnormal conditions normal at link layer, tested device can provide correct response, and can normally move.
Application layer test comprises:
Positive test and the negative testing of charging message, the form of main examination charging message and the requirement whether transmitting procedure meets standard, and when charging message is abnormal, whether tested device is to extremely making response;
Error message test, when main examination charging is abnormal, whether can tested device send correct timeout packet according to the requirement of standard, or can correctly respond when receive time-out message;
Charging flow test, mainly examines or check that flow process in charging process is controlled and whether redirect meets the requirement of standard, and when flow process is abnormal, whether tested device is to extremely making response;
Retransmission mechanism test, mainly examines or check in charging process, and can tested device send message according to the mode that the cycle resends;
Message sends period measuring, mainly examines or check in charging process, and can tested device send message according to the cycle of definition;
Multiframe message test, mainly investigates in charging process, whether uses transport protocol capabilities when tested device sending and receiving 9 bytes or above data;
Invalid information unit testing, mainly examines or check in charging process, the multibyte information unit of tested device sending and receiving, and whether the filling of invalid or reserved byte/position is correct;
The test of data receiver formula, mainly examines or check in charging process, the form whether tested device transmission data adopt low level first to send;
Data area test, mainly examines or check the requirement whether data area meets standard, and when charging Data Out of Range, whether tested device can be to making response extremely;
Application function test, mainly examines or check on the basis of protocol conformance, and whether tested device application function is normal;
Data accuracy test, on the basis of realizing in protocol conformance, whether the data of sending in examination tested device are accurate.
Table 1 content measurement repertory
As shown in Figure 1, electric automobile battery charger-battery management system testing protocol consistency of the present invention adopts special protocol test equipment, during test, protocol test equipment is connected with tested device, carries out testing protocol consistency; By joint test instrument between protocol test equipment and tested device, by test apparatus, to tested device, apply electric parameters, then utilize protocol test equipment to send command frame, check that whether the data of sending in tested device are correct.
Protocol test equipment of the present invention adopts and can need to send various command frame to tested device simulation according to what test, and receive the device of the response frame of tested device, on protocol test equipment, preset various command frame and with respect to the correct response frame of command frame, protocol test equipment receives after the response frame that tested device returns and the response frame contrast prestoring, carry out logic judgement, the consistency of the response message of checking tested device.
Tested device of the present invention is electric automobile battery charger or battery management system, as will be verified electric automobile battery charger to the response consistency of message time, tested device is electric automobile battery charger, while verifying battery management system to the response consistency of message, tested device is battery management system.
Test apparatus of the present invention is output voltage according to demand, the device of current electrical amount, and test apparatus is accepted the coordination of protocol test equipment and is controlled, and to tested device, applies electric parameters.
The concrete steps of protocol conformance test method are as follows:
The first step: tested device need to provide communications protocol to illustrate and fill in electric automobile battery charger-battery management system protocol conformance statement table;
Second step: build test platform according to Fig. 1, protocol test equipment is connected with tested device, connecting electric automobile charger and battery management system;
The 3rd step: the communication interface that records tested device;
The 4th step: physical layer communication rate test, the communication baud rate that is specially adjustment protocol test equipment is consistent with the communication baud rate of tested device, utilize protocol test equipment to send correct order, check the communication message that tested device is responded, detect and whether support this traffic rate;
The 5th step: data link layer PDU/PGN form test, be specially and utilize protocol test equipment to send correct communication message, comprise correct PDU form, correct PGN, correct address assignment, and the connection initialization of transport protocol capabilities, transfer of data, connection closed are followed the definition of standard transmission, check that whether the form of the response frame that can tested device correctly respond and return is correct; Utilize protocol test equipment to send the communication message of PDU format error, check whether tested device can make response extremely to this; Utilize protocol test equipment to send the communication message of PGN mistake, check whether tested device abandons this frame;
The 6th step: data link layer transmission format protocol test, is specially: while utilizing protocol test equipment to send 9 bytes or above data message, not according to transmission format protocol transmission, check whether tested device responds;
The 7th step: data-link layer address allocation for test, is specially: utilize the communication message of protocol test equipment transmission source/destination address mistake, the response frame that tested device is returned carries out logic judgement, checks whether tested device filters this frame;
The 8th step: the test of charging message, is mainly divided into charger positive test, negative testing and battery management system (BMS) positive test, negative testing;
Charger positive test, comprises the following steps:
8-1) the positive test of CRM (identification code 0X00) message, after test platform is built, checks tested device energy enough CRM (identification code 0X00) message response;
8-2) the positive test of CRM (identification code 0XAA) message, protocol test equipment sends BRM message to tested device, checks that tested device can correctly receive and use CRM (identification code 0XAA) message response;
8-3) the positive test of CTS and CML message, protocol test equipment sends BCP message to tested device, checks that tested device can correctly receive and use CTS and CML message response;
8-4) the positive test of CRO message, protocol test equipment sends BRO message to tested device, checks that tested device can correctly receive and use CRO message response;
8-5) the positive test of CCS message, protocol test equipment sends BCL and BCS message to tested device, checks that tested device can correctly receive and use CCS message response;
8-6) the positive test of CST message, protocol test equipment sends BST message to tested device, checks that tested device can correctly receive and use CST message response;
8-7) the positive test of CSD message, protocol test equipment sends BSD message to tested device, checks that tested device can correctly receive and use CSD message response;
The 9th step: charger negative testing, comprising:
9-1) the negative testing of CRM (identification code 0X00) message, during tested device energy enough CRM (identification code 0X00) message response, after communication loop is untied, checks that tested device can stop CRM (identification code 0X00) message response;
9-2) the negative testing of CRM (identification code 0XAA) message, protocol test equipment sends BRM invalid packet to tested device, and inspection tested device can not be used CRM (identification code 0XAA) message response;
9-3) the negative testing of CTS and CML message, protocol test equipment sends BCP invalid packet to tested device, and inspection tested device can not be used CTS and CML message response;
9-4) the negative testing of CRO message, protocol test equipment sends BRO invalid packet to tested device, and inspection tested device can not be used CTO message response;
9-5) the negative testing of CCS message, protocol test equipment sends BCL and BCS invalid packet to tested device, and inspection tested device can not be used CCS message response;
9-6) the negative testing of CST message, protocol test equipment sends BST invalid packet to tested device, and inspection tested device can not be used CST message response;
9-7) the negative testing of CSD message, protocol test equipment sends BSD invalid packet to tested device, and inspection tested device can not be used CSD message response;
The tenth step, battery management system (BMS) positive test, comprising:
10-1) the positive test of BRM message, protocol test equipment sends CRM (identification code 0X00) message to tested device, checks that tested device can correctly receive and use BRM message response;
10-2) the positive test of BCP message, protocol test equipment sends CRM (identification code 0XAA) message to tested device, checks that tested device can correctly receive and use BCP message response;
10-3) the positive test of BRO message, protocol test equipment sends CTS and CML message to tested device, checks that tested device can correctly receive and use BRO message response;
10-4) the positive test of BCL, BCS message, protocol test equipment sends CRO message to tested device, checks that tested device can correctly receive and use BCL and BCS message response;
10-5) the positive test of BSM, BMV, BMT and BSP message, in charging process, checks that tested device can send BSM, BMV, BMT and BSP message;
10-6) the positive test of BST message, protocol test equipment sends CST message to tested device, checks that tested device can correctly receive and use BST message response;
10-7) the positive test of BSD message, controls tested device and stops charging, checks that tested device can correctly send BST, and protocol test equipment is with after CST message response, and tested device can be used BSD message response;
The 11 step, battery management system (BMS) negative testing, comprising:
11-1) the negative testing of BRM message, protocol test equipment sends CRM (identification code 0X00) invalid packet to tested device, and inspection tested device can not be used BRM message response;
11-2) the negative testing of BCP message, protocol test equipment sends CRM (identification code 0XAA) invalid packet to tested device, and inspection tested device can not be used BCP message response;
The negative testing of BRO message, protocol test equipment sends CTS and CML invalid packet to tested device, and inspection tested device can not be used BRO message response;
11-4) the negative testing of BCL, BCS message, protocol test equipment sends CRO invalid packet to tested device, and inspection tested device can not be used BCL and BCS message response;
11-5) the negative testing of BSM, BMV, BMT and BSP message, protocol test equipment sends CCS invalid packet to tested device, and inspection tested device can not be used BSM, BMV, BMT and BSP message response;
11-6) the negative testing of BST message, protocol test equipment sends CST invalid packet to tested device, and inspection tested device can not be used BST message response;
11-7) the negative testing of BSD message, controls tested device and stops charging, checks that tested device can correctly send BST, and protocol test equipment is with after the response of CST invalid packet, and tested device can not be used BSD message response;
The 12 step: error message test, while utilizing protocol test equipment to carry out reverse message test, the tested device enough BEM of energy or CEM message response, and flag definition is correct; Utilize protocol test equipment to control message response time and surpass regulation, tested device also can enough BEM or CEM message response;
The 13 step: charging flow test, utilize protocol test equipment to adjust the order in each stage of charging process, for correct charging flow, tested device can be identified and correctly response; For incorrect charging flow, tested device can be ended charging flow;
The 14 step: retransmission mechanism test, utilize protocol test equipment delayed delivery message in test process, check that can tested device have retransmission mechanism;
The 15 step: message period measuring, utilize protocol test equipment to send message to tested device, adjust protocol test equipment transmitting time, check that can the cycle of tested device repeating transmission message meet standard-required;
The 16 step: multiframe message test, utilize protocol test equipment to send multiframe message to tested device, check that can tested device normal response to multiframe message; Utilize protocol test equipment to send illegal multiframe message to tested device, check that can tested device extremely to making response
The 17 step: invalid information unit testing, utilize protocol test equipment to send message to tested device, when sending multibyte information unit, can byte invalid or reserved in the response message of tested device set to 0 xFF, and invalid or reserved potential energy is no is set to 1;
The 18 step: the test of data receiver formula, utilize protocol test equipment to send message to tested device, check that can tested device adopt low level first to send, the high-order rear transmission form sending; Check when tested device receives the message of protocol test equipment transmission, can to data, correctly resolve according to this form;
The 19 step: data area test, utilize defined byte in protocol test equipment change standard, and exceed the scope of regulation, check that can tested device make response;
The 20 step: application function test, according to the application function of tested device in protocol conformance statement table, check each application function whether can correctly complete;
The 21 step: data accuracy test, utilize test apparatus to apply electric parameters to tested device, then utilize protocol test equipment to send command frame, check that whether the data of sending in tested device are correct.