Test device, system and method for vehicle-mounted encryption network simulation test

By designing an on-board encrypted network simulation test device and simulating Secoc verification, the problem of ECU refusing to receive CAN messages is solved, and the normal function activation and efficient simulation test of the ECU are realized.

CN115776690BActive Publication Date: 2025-08-22ZHIJI AUTOMOTIVE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211602759.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2025-08-22
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

In HIL test, CAN communication is directly simulated without Secoc cracking, resulting in the ECU refusing to receive CAN messages, resulting in the problem that the function to be tested cannot be activated.

Method used

A vehicle-mounted encryption network simulation test device is designed, including an ECU power up and down monitoring module, a synchronization message test module and an encryption algorithm module. Secoc verification is simulated through the CAN network interface, and encrypted synchronization and security messages are generated and sent to ensure that the ECU performs Secoc verification smoothly.

Benefits of technology

It realizes smooth Secoc verification of the ECU in HIL test, improves simulation testing efficiency, and is simple and cost-effective to ensure normal function activation of the ECU.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115776690B_ABST
    Figure CN115776690B_ABST
Patent Text Reader

Abstract

The present invention relates to a test device, system, and method for vehicle-mounted encryption network simulation testing. The test device includes a test front-end module, which is electrically connected to the ECU under test via a CAN network interface module; an ECU power-up and power-down monitoring module, which includes an ECU power monitoring interface, which is electrically connected to the ECU power supply interface; the ECU power-up and power-down monitoring module detects and obtains the ECU power-up and power-down status via the ECU power monitoring interface; a synchronization message test module calls an encryption algorithm module to generate a synchronization message based on the ECU power-up and power-down status; and the synchronization message test module sends the synchronization message via the CAN network interface module. The present application can simulate the SECOC check of CAN communication, so that during the HIL test process, the ECU can smoothly perform the SECOC check and will not refuse to receive CAN messages, thereby ensuring that the HIL test process can proceed smoothly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of vehicle-mounted encrypted network testing, and in particular relates to a testing device, system, and method for vehicle-mounted encrypted network simulation testing. Background Art

[0002] Glossary:

[0003] CAN: It is the abbreviation of "Controller Area Network" in English, which means "controller local area network" in Chinese; it is an in-vehicle network communication method;

[0004] ECU: is the abbreviation of "Electronic Control Unit" in English, which means "electronic control unit" in Chinese;

[0005] HIL: is the abbreviation of "Hardware-in-the-Loop (HIL)" in English; HIL test: is the abbreviation of "Hardware in Loop Test" in English, which means "Hardware in the Loop Test" in Chinese; it is a vehicle electronic control test method;

[0006] Secoc: is the abbreviation of "Security Onboard Communication" in English, which means "board-side communication encryption" in Chinese;

[0007] FV: is the abbreviation of "Freshness Value" in English, which means freshness value in Chinese;

[0008] MAC: It is the abbreviation of "Message Authentication Code" in English, and its Chinese meaning is "Message Authentication Code";

[0009] ECU power-on / off times TripCnt: A trip counter that records the number of times the ECU is powered on and off during the entire vehicle life cycle.

[0010] Number of synchronization messages sent ResetCnt: resets the counter and records the number of synchronizations after power-on.

[0011] Number of security messages sent MsgCnt: Message counter, records the number of security messages sent within a synchronization cycle.

[0012] RestFlag, the low bit of the number of synchronization message transmissions: reset flag, which is the low bit of ResetCnt, the number of synchronization message transmissions.

[0013] The Controller Area Network (CAN) bus is a serial communication protocol bus designed for real-time applications. It uses twisted-pair wiring for signal transmission and is one of the most widely used fieldbuses in the world. The CAN protocol is used for communication between various components in automobiles, replacing expensive and bulky distribution wiring harnesses. The robustness of the protocol has extended its use to other automation and industrial applications. Features of the CAN protocol include complete serial data communication, real-time support, transmission rates up to 1 Mb / s, 11-bit addressing, and error detection.

[0014] To enhance the security of CAN communications, the AUTOSAR organization has supplemented CAN communications with the Secoc component, introducing a set of encryption and authentication standards for the CAN communication bus. During HIL testing, CAN communications must be simulated and sent to the ECU to meet the ECU's signal input requirements. For Secoc-encrypted CAN communications, the ECU performs a Secoc check on the data after receiving it. If the check fails, the ECU rejects the data. Therefore, if traditional methods are used to directly simulate CAN communications and send them to the ECU without Secoc cracking, the ECU will reject the CAN messages, preventing the function under test from being activated.

[0015] Therefore, there is an urgent need to provide a vehicle-mounted CAN network Secoc encryption simulation method for HIL testing, which can simulate the Secoc check of CAN communication, so that during the HIL test process, the ECU can smoothly perform Secoc check, thereby not refusing to receive CAN messages, and allowing the HIL test process to proceed smoothly. Summary of the Invention

[0016] In order to solve the problem in the prior art that CAN communication is directly simulated and sent to ECU without being cracked by Secoc, ECU refuses to receive CAN messages, and the function to be tested cannot be activated, the present invention proposes a test device, system and method for vehicle-mounted encrypted network simulation test, which can complete the Secoc verification of simulated CAN communication in the simulation test, and the hardware implementation is simple and low-cost.

[0017] The technical solution of this application to solve the above-mentioned technical problems is a test device for vehicle-mounted encrypted network simulation testing, the test device including a test front-end module; the test front-end module includes: an ECU power-on and power-off monitoring module, a synchronization message test module, an encryption algorithm module and a CAN network interface module; the test front-end module is electrically connected to the tested ECU through the CAN network interface module; the ECU power-on and power-off monitoring module includes an ECU power supply monitoring interface, and the ECU power supply monitoring interface is electrically connected to the ECU power supply interface; the ECU power-on and power-off monitoring module detects and obtains the ECU power-on and power-off status through the ECU power supply monitoring interface; the synchronization message test module calls the encryption algorithm module according to the ECU power-on and power-off status to generate a synchronization message; the synchronization message test module sends the synchronization message through the CAN network interface module.

[0018] The ECU power-on and power-off monitoring module detects that the ECU is powered on through the ECU power supply monitoring interface, and the ECU power-on and power-off monitoring module obtains the ECU power-on count TripCnt; the synchronization message control module sends a synchronization message each time, and adds 1 to the synchronization message sending count ResetCnt; after the ECU power-on and power-off monitoring module detects that the ECU is powered off, the count value of the synchronization message sending count ResetCnt is cleared; the synchronization message test module combines the ECU power-on count TripCnt and the synchronization message sending count ResetCnt to form the synchronization message freshness value FreshValue; the synchronization message test module calls the encryption algorithm of the encryption algorithm module, encrypts the message number Message ID and the synchronization message freshness value FreshValue to generate the synchronization message message authentication code MAC; the synchronization message test module uses the Message ID, the synchronization message freshness value FreshValue and the synchronization message message authentication code MAC to form a synchronization message for sending.

[0019] The test device for vehicle-mounted encryption network simulation test also includes a security message test module; the number of security message transmissions is recorded as the number of security message transmissions MsgCnt; ​​the security message sent by the security message test module between each two synchronization messages; each time a security message is sent, the number of security message transmissions MsgCnt is increased by 1; when it is detected that the ECU is powered off, the number of security message transmissions MsgCnt is set to 0; the low bit of the number of synchronization message transmissions ResetCnt is recorded as the low bit of the synchronization message number RestFlag, and the security message test module combines the ECU power-on number TripCnt, the number of synchronization message transmissions ResetCnt, the number of security message transmissions MsgCnt, and the low bit of the synchronization message number RestFlag to form a security message freshness value FreshValue; the security message test module combines the message number Message ID, the security message information payload Payload, and the security message freshness value FreshValue into security message encryption kernel information; the security message test module calls the encryption algorithm module to encrypt the encrypted kernel information to generate a security message message authentication code MAC, and the security message test module uses the message number Message The ID, security message information payload Payload, security message freshness value FreshValue and security message message authentication code MAC constitute a security message for sending.

[0020] The test front-end module includes an external control computer interface module and a test communication interface; the external control computer interface module is connected to the test computer via the test communication interface.

[0021] The technical solution of the present application to solve the above-mentioned technical problems can also be a test system for vehicle-mounted encryption network simulation testing, including the above-mentioned test device for vehicle-mounted encryption network simulation testing; also including upper and lower power monitoring connecting cables and CAN test connection signal lines; one end of the upper and lower power monitoring connecting cables is connected to the electrical signals of the ECU upper and lower power monitoring modules; the other end of the upper and lower power monitoring connecting cables is connected to the power monitoring interface of the ECU to be tested; one end of the CAN test connection signal line is connected to the CAN network interface module, and the other end of the CAN test connection signal line is connected to the CAN network electrical signal of the vehicle to be tested.

[0022] The technical solution of the present application to solve the above-mentioned technical problems can also be a test method for vehicle-mounted encrypted network simulation testing, comprising: connecting the power on and off monitoring ports of the test device used for vehicle-mounted encrypted network simulation testing with the power monitoring interface of the ECU being tested; the test device obtains the voltage value of the ECU power monitoring interface and monitors the voltage value of the ECU power monitoring interface; when the voltage value is lower than the voltage setting value, the test device monitors whether the voltage value of the ECU power monitoring interface is higher than the voltage setting value, and if it is higher than the voltage setting value, it is determined that the ECU being tested is powered on; when the voltage value is higher than the voltage setting value, the test device monitors whether the voltage value of the ECU power monitoring interface is lower than the voltage setting value, and if it is lower than the voltage setting value, it is determined that the ECU being tested is powered off; the test device obtains the ECU power-on and power-off conditions, performs ECU working status management and parameter calculation; the test device performs message encryption calculation and transmission according to the parameters obtained by the above calculation.

[0023] The voltage setting value is 9V.

[0024] The ECU working status management and parameter calculation include: the test device obtains the ECU power-on times TripCnt; the test device sends a synchronization message once, and adds 1 to the number of synchronization message sending ResetCnt; the test device tests that the ECU is powered off, and clears the count value of the number of synchronization message sending ResetCnt to zero; the test device combines the ECU power-on times TripCnt and the number of synchronization message sending ResetCnt to form a synchronization message freshness value FreshValue, and saves the ECU power-on times TripCnt value.

[0025] The message encryption calculation and sending include synchronization message encryption calculation and sending; the synchronization message encryption calculation and sending include: reading the saved values ​​of the ECU power-on times TripCnt and the synchronization message sending times ResetCnt, and calculating the synchronization message freshness value FreshValue; calculating the synchronization message message authentication code MAC, and the test device encrypts the message number Message ID and the synchronization message freshness value FreshValue to generate the synchronization message message authentication code MAC; combining the synchronization CAN message, and the test device composes the message number Message ID, the synchronization message freshness value FreshValue and the synchronization message message authentication code MAC into a synchronization message; sending the synchronization message to the ECU under test; if it is detected that the ECU is powered off, the count value of the synchronization message sending times ResetCnt is cleared.

[0026] The message encryption calculation and sending include security message encryption calculation and sending; the security message encryption calculation and sending include: reading the saved values ​​of ECU power-on times TripCnt, synchronization message sending times ResetCnt and security message sending times MsgCnt, recording the low bit of synchronization message sending times ResetCnt as the low bit of synchronization message times RestFlag; composing the security message freshness value FreshValue by combining the ECU power-on times TripCnt, synchronization message sending times ResetCnt, security message sending times MsgCnt and synchronization message times RestFlag; calculating the security message message authentication code MAC, the test device encrypts the message number Message ID and the synchronization message freshness value FreshValue to generate the security message message authentication code MAC; combining the security CAN message, the test device encrypts the message number Message The ID, the security message freshness value FreshValue and the security message authentication code MAC constitute a security message; it is sent synchronously and securely to the ECU under test; each time a security message is sent, the number of security message transmissions MsgCnt is increased by 1. If the ECU is detected to be powered off, the number of security message transmissions MsgCnt is set to 0.

[0027] The technical solution of the present application for solving the above technical problems can also be a readable storage medium, on which a computer program is stored. When the program is executed by a processor, the above-mentioned test method for vehicle-mounted encrypted network simulation test is implemented.

[0028] One of the technical effects of the above technical solution is that in the test device for vehicle-mounted encrypted network simulation test, the ECU power-on and power-off monitoring module obtains the ECU power-on and power-off status; the synchronization message test module calls the encryption algorithm module to generate a synchronization message according to the ECU power-on and power-off status; and the synchronization message test module sends the synchronization message through the CAN network interface module. The synchronization message is also encrypted by the encryption algorithm, so it can simulate the SECOC verification of the simulated CAN communication, so that during the HIL test process, the ECU can smoothly perform the SECOC verification and will not refuse to receive the CAN message, so that the HIL test process can proceed smoothly. The efficiency of the simulation test is greatly improved. It is only necessary to configure the test device for vehicle-mounted encrypted network simulation test to detect the ECU power-on and power-off status to complete the SECOC verification of the simulated CAN communication in the simulation test. The hardware implementation method is simple and low-cost.

[0029] A second technical benefit of the aforementioned solution is that the synchronization message testing module uses the Message ID, the synchronization message freshness value FreshValue, and the synchronization message authentication code MAC to compose a synchronization message for transmission. The synchronization message contains the ECU power-on count (TripCnt) and the synchronization message transmission count (ResetCnt). This effectively monitors the power-on count and synchronization message transmission count, facilitating subsequent decoding and verification.

[0030] The third technical effect of the above technical solution is that the security message test module calls the encryption algorithm module to encrypt the encrypted kernel information to generate the security message message authentication code MAC. The security message test module uses the message ID, security message information payload Payload, security message freshness value FreshValue, and security message message authentication code MAC to form a security message for transmission. The security message information not only includes the message information, but also includes the security message message authentication code MAC and the security message freshness value FreshValue, as well as rich verification information. After entering the ECU under test, this information can be identified as information encrypted by the corresponding encryption algorithm, thereby stimulating the corresponding functional module and ensuring the normal startup and operation of the corresponding function in the simulation test.

[0031] The fourth technical effect of the above technical solution is that the external control computer interface module is connected to the test computer through the test communication interface, which facilitates the management and control of the test process.

[0032] The fifth technical effect of the above technical scheme is: when the voltage value is lower than the voltage setting value, the test device monitors whether the voltage value of the ECU power monitoring interface is higher than the voltage setting value. If it is higher than the voltage setting value, it is determined that the tested ECU is powered on; when the voltage value is higher than the voltage setting value, the test device monitors whether the voltage value of the ECU power monitoring interface is lower than the voltage setting value. If it is lower than the voltage setting value, it is determined that the tested ECU is powered off; the method for the test device to obtain the ECU power-on and power-off conditions is simple, and the ECU power-on and power-off conditions are obtained according to the test device, and the ECU working status management and parameter calculation are performed. The test device performs message encryption calculation and transmission according to the parameters obtained by the above calculation, so that the method can complete the corresponding verification of the simulated CAN communication in the simulation test, such as Secoc verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is one of the test system schematics for vehicle-mounted encryption network simulation testing;

[0034] Figure 2 This is the second schematic diagram of the test system used for vehicle encryption network simulation testing;

[0035] Figure 3It is a schematic block diagram of a test front-end module in a test device for vehicle-mounted encryption network simulation testing;

[0036] Figure 4 This is the third schematic diagram of the test system used for in-vehicle encryption network simulation testing. The diagram shows the connection between the ECU under test and the ECU power monitoring interface in the ECU power-up and power-down monitoring module.

[0037] Figure 5 This is the fourth schematic block diagram of a test system for vehicle-mounted encryption network simulation testing. In the figure, the test computer and the external control computer interface module are electrically connected via a test communication interface. The electrical connection can be a wired electrical connection or a wireless connection.

[0038] Figure 6 This is one of the flow diagrams of the test method for vehicle-mounted encryption network simulation test;

[0039] Figure 7 This is the second flowchart of the test method for vehicle-mounted encryption network simulation test;

[0040] Figure 8 This is a schematic diagram of the composition of the message freshness value FreshValue;

[0041] Figure 9 It is a schematic diagram of the process of forming a synchronization message;

[0042] Figure 10 It is a schematic diagram of the process of forming a security message;

[0043] Figure 11 This is a flowchart of message sending. DETAILED DESCRIPTION

[0044] The content of this application is further described in detail below with reference to the accompanying drawings.

[0045] It should be noted that the following is a description of the preferred embodiments of the present invention and does not constitute any limitation to the present invention. The description of the preferred embodiments of the present invention is merely an illustration of the general principles of the present invention. The embodiments described in this application are only some embodiments of the present invention, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative work are within the scope of protection of the present invention.

[0046] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "back," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," and the like, indicating positions or relationships, are based on the positions or relationships shown in the accompanying drawings and are intended only to facilitate the description of the present invention and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and technical features numbered with Arabic numerals 1, 2, or 3, as well as numbers such as "A" and "B," are used for descriptive purposes only and are not intended to represent a temporal or spatial order. They should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features indicated. Therefore, features designated as "first," "second," and numbered with Arabic numerals 1, 2, or 3, may explicitly or implicitly include one or more of the features. In the description of the present invention, "several" means two or more, unless otherwise specifically defined.

[0047] like Figures 1 to 2 In the embodiment shown, a vehicle-mounted encryption network simulation test system includes the above-mentioned test device for vehicle-mounted encryption network simulation test; it also includes an upper and lower power monitoring connection cable and a CAN test connection signal line; one end of the upper and lower power monitoring connection cable is connected to the electrical signal of the ECU upper and lower power monitoring module; the other end of the upper and lower power monitoring connection cable is connected to the power monitoring interface of the ECU to be tested; one end of the CAN test connection signal line is connected to the CAN network interface module, and the other end of the CAN test connection signal line is connected to the CAN network electrical signal of the vehicle to be tested.

[0048] like Figures 3 and 4 In an embodiment of a test device for in-vehicle encryption network simulation testing, the test device includes a test front-end module, which includes an ECU power-up and power-down monitoring module, a synchronization message testing module, an encryption algorithm module, and a CAN network interface module. The test front-end module is in electrical signal communication with the ECU under test via the CAN network interface module. The ECU power-up and power-down monitoring module includes an ECU power monitoring interface, which is electrically connected to the ECU power supply interface. The ECU power-up and power-down monitoring module detects and obtains ECU power-up and power-down status via the ECU power monitoring interface. The synchronization message testing module calls the encryption algorithm module to generate synchronization messages based on the ECU power-up and power-down status. The synchronization message testing module sends the synchronization messages via the CAN network interface module. The encryption algorithm includes the Secoc encryption algorithm.

[0049] like Figures 3 to 8In an embodiment of a test device for vehicle-mounted encrypted network simulation testing shown, the ECU power-on and power-off monitoring module detects that the ECU is powered on through the ECU power supply monitoring interface, and the ECU power-on and power-off monitoring module obtains the ECU power-on count TripCnt; the synchronization message control module sends a synchronization message each time, and adds 1 to the number of synchronization message sending ResetCnt; after the ECU power-on and power-off monitoring module detects that the ECU is powered off, the count value of the number of synchronization message sending ResetCnt is cleared; the synchronization message test module combines the ECU power-on count TripCnt and the number of synchronization message sending ResetCnt to form a synchronization message freshness value FreshValue; the synchronization message test module calls the encryption algorithm of the encryption algorithm module, encrypts the message number Message ID and the synchronization message freshness value FreshValue to generate a synchronization message message authentication code MAC; the synchronization message test module uses the Message ID, the synchronization message freshness value FreshValue and the synchronization message message authentication code MAC to form a synchronization message for sending.

[0050] like Figures 3 to 8 In an embodiment of a test device for vehicle-mounted encryption network simulation test shown, it also includes a security message test module; the security message test module records the number of security message transmissions sent between every two synchronization messages as the number of security message transmissions MsgCnt; ​​each time a security message is sent, the number of security message transmissions MsgCnt is increased by 1; the low bit of the number of synchronization message transmissions ResetCnt is recorded as the low bit of the synchronization message number RestFlag, and the security message test module combines the ECU power-on times TripCnt, the number of synchronization message transmissions ResetCnt, the number of security message transmissions MsgCnt, and the low bit of the synchronization message number RestFlag to form a security message freshness value FreshValue; the security message test module combines the message number MessageID, the security message information payload Payload, and the security message freshness value FreshValue into security message encryption kernel information; the security message test module calls the encryption algorithm module to encrypt the encrypted kernel information to generate a security message message authentication code MAC, and the security message test module uses the message number Message A security message is composed of the ID, security message payload, security message freshness value, and security message authentication code (MAC) for transmission. Each time a security message is sent, the security message transmission count (MsgCnt) is incremented by 1. If the ECU is powered off, the security message transmission count (MsgCnt) is reset to 0. The initial values ​​of the synchronization message transmission count (ResetCnt) and the security message transmission count (MsgCnt) can be set to 1.

[0051] like Figures 5 to 8In the embodiment of the test device for vehicle-mounted encrypted network simulation test shown, the test front-end module includes an external control computer interface module and a test communication interface; the external control computer interface module is connected to an external test computer through the test communication interface.

[0052] like Figures 6 to 10 As shown, in an embodiment of a test method for vehicle-mounted encrypted network simulation test, the following steps are included: connecting the power on and off monitoring ports of the test device for vehicle-mounted encrypted network simulation test with the power monitoring interface of the ECU under test; the test device obtains the voltage value of the ECU power monitoring interface and monitors the voltage value of the ECU power monitoring interface; when the voltage value is lower than the voltage setting value, the test device monitors whether the voltage value of the ECU power monitoring interface is higher than the voltage setting value, and if it is higher than the voltage setting value, it is determined that the ECU under test is powered on; when the voltage value is higher than the voltage setting value, the test device monitors whether the voltage value of the ECU power monitoring interface is lower than the voltage setting value, and if it is lower than the voltage setting value, it is determined that the ECU under test is powered off; the test device obtains the power on and power off status of the ECU, performs ECU working status management and parameter calculation; the test device performs message encryption calculation and transmission according to the parameters obtained by the above calculation.

[0053] like Figures 6 to 10 In an embodiment of a test method for an in-vehicle encryption network simulation test, the voltage setting value is 9 V. This is applicable when the ECU power supply is 12 V. The voltage setting value can be 0.5 to 0.9 times the nominal supply voltage of the ECU power supply.

[0054] like Figures 6 to 10 As shown, in an embodiment of a test method for vehicle-mounted encrypted network simulation testing, the steps of ECU working status management and parameter calculation include: the test device obtains the ECU power-on times TripCnt, and each time the ECU is powered on, the ECU power-on times TripCnt value is increased by 1; the test device sends a synchronization message once, and increases the number of synchronization messages sent ResetCnt by 1; the test device tests that the ECU is powered off, and clears the count value of the number of synchronization messages sent ResetCnt to zero; the test device combines the ECU power-on times TripCnt and the number of synchronization messages sent ResetCnt into a synchronization message freshness value FreshValue, and saves the ECU power-on times TripCnt value.

[0055] like Figures 6 to 10As shown, in an embodiment of a test method for vehicle-mounted encrypted network simulation testing, the message encryption calculation and sending steps also include the synchronization message encryption calculation and sending steps; the synchronization message encryption calculation and sending steps include: reading the saved values ​​of the ECU power-on times TripCnt and the synchronization message sending times ResetCnt, and calculating the synchronization message freshness value FreshValue; calculating the synchronization message message authentication code MAC, the test device encrypts the message number Message ID and the synchronization message freshness value FreshValue to generate the synchronization message message authentication code MAC; combining the synchronization CAN message, the test device composes the message number Message ID, the synchronization message freshness value FreshValue and the synchronization message message authentication code MAC into a synchronization message; sending the synchronization message to the ECU under test; if it is detected that the ECU is powered off, the count value of the synchronization message sending times ResetCnt is cleared.

[0056] like Figures 6 to 10 As shown, in an embodiment of a test method for vehicle-mounted encryption network simulation test, the message encryption calculation and sending step also includes a security message encryption calculation and sending step; the security message encryption calculation and sending step includes: reading the saved values ​​of ECU power-on times TripCnt, the number of synchronization message sending ResetCnt and the number of security message sending MsgCnt, and recording the low bit of the number of synchronization message sending ResetCnt as the low bit of the synchronization message number RestFlag; the ECU power-on times TripCnt, the number of synchronization message sending ResetCnt, the number of security message sending MsgCnt and the low bit of the synchronization message number RestFlag are combined to form a security message freshness value FreshValue; the security message message authentication code MAC is calculated, and the test device encrypts the message number Message ID and the synchronization message freshness value FreshValue to generate a security message message authentication code MAC; the security CAN message is combined, and the test device encrypts the message number Message The ID, the security message freshness value FreshValue and the security message authentication code MAC constitute a security message; it is sent synchronously and securely to the ECU under test; each time a security message is sent, the number of security message transmissions MsgCnt is increased by 1. If the ECU is detected to be powered off, the number of security message transmissions MsgCnt is set to 0.

[0057] In one embodiment of the test method for vehicle-mounted encrypted network simulation test of the present application, the number of ECU power-on times is calculated based on whether the ECU power supply pin voltage is 12V, and is saved in the upper computer, i.e., the test computer, so as to calculate the ECU power-on times TripCnt, the number of synchronization message sending times ResetCnt, the number of security message sending times MsgCnt and the low bit RestFlag of synchronization message times, and accumulate or reset them according to the rules to generate a freshness value FreshValue; the message number Message ID, the message information payload Payload, and the freshness value FreshValue are combined, and according to the combination result of the previous step, the key and encryption algorithm link library are called to calculate the message authentication code MAC value; the message information payload Payload, the freshness value FreshValue, and the message authentication code MAC are combined into a complete CAN message; through the message number Message The ID determines whether the message requires Secoc encryption simulation; if Secoc simulation is required, the generated CAN message is sent to the controller through the CAN board, and a Simulink-based state machine model is established to realize synchronous message cycle control, thereby realizing Secoc encryption simulation of the vehicle CAN network.

[0058] In one embodiment of the test method for vehicle-mounted encryption network simulation testing of the present application, the ECU power-on count TripCnt is calculated by collecting the voltage value between the ECU's KL30 pin and the GND pin via a digital input card installed in a real-time machine. The digital input card is a test device. If the voltage value collected by the test device is > 9V, the ECU under test is powered on; otherwise, it is determined that the ECU under test is not powered on. The initial value of the power-on count is set to 0, and the value is incremented by 1 after each power-on, thereby calculating the ECU power-on count as the ECU power-on count TripCnt. In addition, the ResetCnt value of the number of synchronization messages sent is reset to 0 each time the power is turned off. To avoid data loss after the real-time machine, i.e., the test computer, is shut down, the ECU power-on count TripCnt value is saved as a txt file stored in the real-time machine, and the txt file is read each time it is called. The ECU power-on count TripCnt is counted as follows: After supplying 12V voltage to the ECU power pin, the ECU completes power-on; when the supply voltage reaches 0V, the ECU is powered off. Therefore, the voltage value of the power supply pin can be used to determine whether the ECU is powered on. Taking into account the measurement error, 9V is used as the judgment threshold.

[0059] In one embodiment of the test method for vehicle-mounted encrypted network simulation test of the present application, the values ​​of the number of synchronization message sending times ResetCnt, the number of security message sending times MsgCnt, and the low bit RestFlag of the number of synchronization message are calculated, and accumulated or reset according to the rules to generate the freshness value FreshValue. Number of synchronization message sending times ResetCnt: Since synchronization is triggered by synchronization message, a synchronization operation will be performed each time a synchronization message is sent. Therefore, the number of synchronization message sending times after each power-on is recorded as the number of synchronization message sending times ResetCnt, and the number of synchronization message sending times ResetCnt is set to 0 after power-off; Number of security message sending times MsgCnt: The number of security message sending times between every two synchronization messages is used as the number of security message sending times MsgCnt; ​​Low bit RestFlag of synchronization message: The low bit of the number of synchronization message sending times ResetCnt; Write a program to set the message number Message The ID, original message information payload, and freshness value are combined, and the key and encryption algorithm link library are called to calculate the message authentication code MAC value; the original message information payload, freshness value, and message authentication code MAC are combined into a complete CAN message; the complete CAN message is sent to the controller through the CAN board in the real-time machine. At the same time, based on the real-time function's ability to achieve real-time simulation, a state machine model based on Simulink is established, and the CAN message sending time is controlled by the transition time of different states. The state machine model based on Simulink controls the synchronous message sending time: Since the synchronous message sending period is not fixed, the synchronous message sending time cannot be controlled by the conventional method of setting the message period. Therefore, based on the characteristics of HIL test real-time simulation, a state machine model based on Simulink is established, and the synchronous message sending time is controlled by the transition time of different states.

[0060] like Figure 11As shown, in the ECU power-off state, if the voltage value is detected to be greater than 9V, it is determined to enter the ECU power-on state, wait for 50 milliseconds, and enter the sending first frame message state. In this state, the first frame message is sent and the ECU is monitored whether it is powered off. If the ECU is powered off, the ECU power-off state is entered. If the ECU is not powered off, the first frame message state is sent and the sending second frame message state is entered after waiting for 50 milliseconds; in the sending second frame message state, the second frame message is sent and the ECU is monitored whether it is powered off. If the ECU is powered off, the ECU power-off state is entered. If the ECU is not powered off, the second frame message state is sent and the sending third frame message state is entered; in the sending third frame message state, the third frame message is sent and the ECU is monitored whether it is powered off. If the ECU is powered off, the ECU power-off state is entered. If the ECU is not powered off, the waiting for 950 milliseconds is entered into the waiting to send state. In the waiting to send state, the ECU is monitored whether it is powered off. If the ECU is powered off, the ECU power-off state is entered. If the ECU is not powered off, the waiting for 50 milliseconds is entered into the sending first frame message state.

[0061] In the test device, system and method for vehicle-mounted encrypted network simulation test, a program is written and the encryption algorithm link library is called to calculate the freshness value FreshValue and the message authentication code MAC value; then the message information payload Payload, the freshness value FreshValue and the message authentication code MAC are combined to complete the CAN message; finally, a Simulink-based state machine model is established to realize synchronous message cycle control, thereby realizing the Secoc encryption simulation of the vehicle-mounted CAN network. After the Secoc encryption simulation, the tested ECU can receive the CAN message, the function to be tested can be activated, and the simulation test process is successfully completed.

[0062] In the test device, system, and method for vehicle-mounted encryption network simulation testing, the test front-end module is electrically connected to the tested ECU via the CAN network interface module; the ECU power-on and power-off monitoring module includes an ECU power monitoring interface, which is electrically connected to the ECU power supply interface; the ECU power-on and power-off monitoring module detects and obtains the ECU power-on and power-off status via the ECU power monitoring interface; the synchronization message test module calls the encryption algorithm module to generate a synchronization message based on the ECU power-on and power-off status; and the synchronization message test module sends the synchronization message via the CAN network interface module. This application can simulate the SECOC check of CAN communication, so that during the HIL test process, the ECU can smoothly perform the SECOC check and will not refuse to receive CAN messages, allowing the HIL test process to proceed smoothly.

[0063] Although the present invention is illustrated and described based on the preferred embodiment and several alternatives, the invention is not limited by the specific description in this specification. Other additional replacement or equivalent components can also be used to practice the present invention.

Claims

1. A test device for vehicle-mounted encryption network simulation test, characterized in that: The test device includes a test front-end module; The test front-end module includes: an ECU power-on and power-off monitoring module, a synchronization message testing module, an encryption algorithm module and a CAN network interface module; the test front-end module communicates with the tested ECU through the CAN network interface module; The ECU power on and off monitoring module includes an ECU power monitoring interface, which is electrically connected to the ECU power supply interface; The ECU power-on and power-off monitoring module detects the ECU power-on and power-off status through the ECU power monitoring interface; The synchronization message test module calls the encryption algorithm module to generate synchronization messages according to the ECU power-on and power-off conditions; The synchronization message test module sends synchronization messages through the CAN network interface module, where: The ECU power-on and power-off monitoring module detects that the ECU is powered on through the ECU power monitoring interface, and obtains the ECU power-on count TripCnt; Each time the synchronization message control module sends a synchronization message, the number of synchronization message transmission times ResetCnt is increased by 1; The synchronization message test module combines the ECU power-on times TripCnt and the synchronization message sending times ResetCnt to form the synchronization message freshness value FreshValue; The synchronization message test module calls the encryption algorithm of the encryption algorithm module to encrypt the message ID and the synchronization message freshness value FreshValue to generate the synchronization message message authentication code MAC; The synchronization message test module uses the Message ID, the synchronization message freshness value FreshValue and the synchronization message message authentication code MAC to compose a synchronization message for sending.

2. The test device for vehicle-mounted encryption network simulation test according to claim 1, characterized in that: After the ECU power-on and power-off monitoring module detects that the ECU is powered off, the count value of the number of synchronization message transmissions ResetCnt is cleared.

3. The test device for vehicle-mounted encryption network simulation test according to claim 1, characterized in that: It also includes a security message testing module; The number of times the security message is sent is recorded as the number of times the security message is sent MsgCnt; The security message test module sends a security message between every two synchronization messages; Each time a security message is sent, the number of security message transmissions MsgCnt is increased by 1; when the ECU is detected to be powered off, the number of security message transmissions MsgCnt is reset to 0; The low bit of the number of synchronization message transmissions ResetCnt is recorded as the low bit of the synchronization message transmission RestFlag. The security message test module combines the ECU power-on times TripCnt, the number of synchronization message transmissions ResetCnt, the number of security message transmissions MsgCnt, and the low bit of the synchronization message transmission RestFlag to form the security message freshness value FreshValue. The security message test module combines the message ID, security message information payload, and security message freshness value into security message encryption kernel information; The security message test module calls the encryption algorithm module to encrypt the encrypted kernel information to generate a security message authentication code MAC. The security message test module uses the message number Message ID, security message information payload Payload, security message freshness value FreshValue and security message message authentication code MAC to form a security message for sending.

4. The test device for vehicle-mounted encryption network simulation test according to claim 1, characterized in that: The test front-end module includes an external control computer interface module and a test communication interface; The external control computer interface module is connected to an external test computer via a test communication interface.

5. A test system for vehicle-mounted encryption network simulation test, characterized in that: A test device for vehicle-mounted encryption network simulation testing according to any one of claims 1 to 4; It also includes power-on and power-off monitoring connection cables and CAN test connection signal cables; One end of the power-up and power-down monitoring connection cable is in electrical signal communication with the ECU power-up and power-down monitoring module; The other end of the power-on and power-off monitoring cable is connected to the power monitoring interface of the ECU to be tested; One end of the CAN test connection signal line is connected to the CAN network interface module, and the other end of the CAN test connection signal line is connected to the CAN network electrical signal of the tested vehicle.

6. A test method for vehicle-mounted encryption network simulation test, It is characterized in that The method comprises: connecting the power monitoring port of the test device for vehicle-mounted encryption network simulation test according to any one of claims 1 to 4 to the power monitoring interface of the ECU under test; The test device obtains the voltage value of the ECU power monitoring interface and monitors the voltage value of the ECU power monitoring interface; When the voltage value is lower than the voltage setting value, the test device monitors whether the voltage value of the ECU power monitoring interface is higher than the voltage setting value. If it is higher than the voltage setting value, it is determined that the tested ECU is powered on; When the voltage value is higher than the voltage setting value, the test device monitors whether the voltage value of the ECU power monitoring interface is lower than the voltage setting value. If it is lower than the voltage setting value, it is determined that the tested ECU is powered off; The test device obtains the ECU power-on and power-off status, and performs ECU working status management and parameter calculation; The test device performs message encryption calculation and transmission based on the parameters obtained by the above calculation.

7. The test method for vehicle-mounted encryption network simulation test according to claim 6, characterized in that: The voltage setting value is 9V.

8. The test method for vehicle-mounted encryption network simulation test according to claim 6, characterized in that: The ECU working state management and parameter calculation include: The test device obtains the ECU power-on times TripCnt; The test device sends a synchronization message once, and the number of synchronization message transmission times ResetCnt is increased by 1; When the test device tests that the ECU is powered off, the ResetCnt count value of the number of synchronization messages sent is reset to zero; The test device combines the ECU power-on times TripCnt and the number of synchronization messages sent ResetCnt into the synchronization message freshness value FreshValue, and saves the ECU power-on times TripCnt value.

9. The test method for vehicle-mounted encryption network simulation test according to claim 6, characterized in that: The message encryption calculation and sending include synchronous message encryption calculation and sending; Synchronous message encryption calculation and sending include: Read the saved values ​​of TripCnt, the number of times the ECU is powered on, and ResetCnt, the number of times synchronization messages are sent, and calculate the synchronization message freshness value FreshValue; Calculate the synchronization message authentication code MAC, the test device encrypts the message ID and the synchronization message freshness value FreshValue to generate the synchronization message authentication code MAC; Combining the synchronous CAN message, the test device combines the message ID, the synchronization message freshness value FreshValue and the synchronization message message authentication code MAC into a synchronization message; Send synchronization message to the ECU under test; If it is detected that the ECU is powered off, the count value of ResetCnt for the number of synchronization messages sent is cleared.

10. The test method for vehicle-mounted encryption network simulation test according to claim 9, characterized in that: The message encryption calculation and sending includes secure message encryption calculation and sending; Secure message encryption calculation and transmission include: Read the saved values ​​of ECU power-on times TripCnt, synchronization message sending times ResetCnt, and security message sending times MsgCnt, and record the low bit of synchronization message sending times ResetCnt as the low bit of synchronization message number RestFlag; combine the ECU power-on times TripCnt, synchronization message sending times ResetCnt, security message sending times MsgCnt, and synchronization message number RestFlag to form the security message freshness value FreshValue; Calculate the secure message authentication code MAC. The test device encrypts the message ID and the synchronization message freshness value FreshValue to generate the secure message authentication code MAC. Combining the secure CAN message, the test device combines the message ID, the secure message freshness value FreshValue and the secure message authentication code MAC into a secure message; Send synchronization security to the ECU under test; Each time a security message is sent, the number of security message transmissions MsgCnt is increased by 1. When it is detected that the ECU is powered off, the number of security message transmissions MsgCnt is reset to 0.

11. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the test method for vehicle-mounted encryption network simulation test as described in any one of claims 6 to 10 is implemented.

Citation Information

Patent Citations

  • Communication method and device, electronic equipment and readable storage medium

    CN111917619A