Test method, system, device and equipment for key learning and readable storage medium

By simulating the ADAS and BMS communication process on a hardware-in-the-loop (HIL) device and employing automated testing tools, the problem of low accuracy in key learning algorithms was solved, achieving efficient and secure key learning testing.

CN116566627BActive Publication Date: 2025-11-25BEIJING ELECTRIC VEHICLE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310769256.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-27
Publication Date
2025-11-25
Estimated Expiration
2043-06-27

AI Technical Summary

Technical Problem

The accuracy of existing test key learning algorithms is low, resulting in insufficient communication security in autonomous vehicles.

Method used

The system simulates the message transmission logic of the Advanced Driver Assistance System (ADAS) based on a host computer, generates an environment model file, and performs key learning tests through a hardware-in-the-loop (HIL) device, using automated scripts to achieve automated testing.

Benefits of technology

It improves the accuracy and efficiency of key learning and testing, ensures the security of bus communication, and reduces human error and costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116566627B_ABST
    Figure CN116566627B_ABST
Patent Text Reader

Abstract

The application provides a key learning test method, system, device, equipment and readable storage medium. It relates to the technical field of testing and aims to solve the problem of low accuracy of testing key learning algorithm. The method comprises the following steps: based on the message simulation of the sending logic of the auxiliary driving system ADAS by the upper computer, an environment model file for key learning test is obtained, the environment model file comprises a key SKC and a security code SC; based on the upper computer, the environment model file is compiled in a hardware-in-loop HIL device; based on the upper computer, an executable file is generated according to the environment model file; based on the upper computer, the executable file is sent to the HIL device; based on the HIL device, the key learning test of the battery management system BMS is performed by using the executable file. The application can improve the accuracy of testing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of testing, in particular to a key learning test method, system, device, equipment and readable storage medium. BACKGROUND

[0002] In an autonomous vehicle, in order to ensure the safety of communication, the Advanced Driving Assistance System (ADAS) needs to perform key learning when communicating with other controllers, and therefore it is necessary to test the accuracy and reliability of the key learning algorithm of the battery management system (BMS). However, the prior art often uses a manual testing method, which results in low accuracy of testing the key learning algorithm. SUMMARY

[0003] The embodiments of the present application provide a key learning test method, system, device, equipment and readable storage medium, which can solve the problem of low accuracy of testing the key learning algorithm in the actual application.

[0004] To solve the above problems, the embodiments of the present application adopt the following technical solutions:

[0005] In a first aspect, the embodiments of the present application provide a key learning test method, comprising:

[0006] Based on the message simulation of the sending logic of the host computer to the ADAS, an environment model file for key learning test is obtained, and the environment model file includes a key SKC and a security code SC;

[0007] Based on the host computer, the environment model file is compiled in the HIL device;

[0008] Based on the host computer, an executable file is generated according to the environment model file;

[0009] Based on the host computer, the executable file is sent to the HIL device;

[0010] Based on the HIL device, the key learning test of the BMS is performed by using the executable file.

[0011] In a second aspect, the embodiments of the present application provide a key learning test system, which comprises a host computer and a HIL device;

[0012] The host computer simulates the message of the sending logic of the ADAS to obtain an environment model file for key learning test, and the environment model file includes a key SKC and a security code SC;

[0013] The host computer compiles the environment model file in the HIL device;

[0014] The host computer generates an executable file according to the environment model file;

[0015] The host computer sends the executable file to the HIL device;

[0016] The HIL device performs key learning testing on the battery management system BMS using the executable file.

[0017] In a third aspect, an embodiment of the present application provides a testing device for key learning, comprising:

[0018] An emulation module is configured to emulate messages based on the sending logic of the host computer to the ADAS to obtain an environment model file for key learning testing, wherein the environment model file comprises a key SKC and a security code SC;

[0019] A compiling module is configured to compile the environment model file in the HIL device based on the host computer;

[0020] A generating module is configured to generate an executable file according to the environment model file based on the host computer;

[0021] A sending module is configured to send the executable file to the HIL device based on the host computer;

[0022] A testing module is configured to perform key learning testing on the BMS using the executable file based on the HIL device.

[0023] In a third aspect, an embodiment of the present application provides a testing device for key learning, comprising a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor; the processor is configured to read the program in the memory to implement the steps in the method of the first aspect.

[0024] In a fourth aspect, an embodiment of the present application provides a readable storage medium, wherein the readable storage medium stores a program or instructions, and the program or instructions are executable on a processor to implement the steps in the method of the first aspect.

[0025] In the embodiment of the present application, the testing method for key learning can simulate the communication process of the ADAS and the BMS on the HIL testing environment, so that the BMS bus communication security algorithm becomes a testable item in the HIL environment, ensuring the security of the bus communication, and through writing use cases and automation scripts, the method realizes automatic testing, so that the accuracy of the testing is higher. BRIEF DESCRIPTION OF DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0027] Figure 1 is one of the flowcharts of the test method for ADAS and BMS key learning provided by the embodiments of the present application;

[0028] Figure 2 is the second flowchart of the test method for ADAS and BMS key learning provided by the embodiments of the present application;

[0029] Figure 3 is the third flowchart of the test method for ADAS and BMS key learning provided by the embodiments of the present application;

[0030] Figure 4 is the flowchart of the ADAS and BMS key learning process provided by the embodiments of the present application;

[0031] Figure 5 is the flowchart of the ADAS and BMS key clearing process provided by the embodiments of the present application;

[0032] Figure 6 is the flowchart of the ADAS learning flow message simulation provided by the embodiments of the present application;

[0033] Figure 7 is the schematic diagram of the test system for key learning provided by the embodiments of the present application;

[0034] Figure 8 is the schematic diagram of the test device for key learning provided by the embodiments of the present application;

[0035] Figure 9 is the schematic diagram of the test equipment for key learning provided by the embodiments of the present application. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.

[0037] Unless otherwise defined, technical terms or scientific terms used in the present application shall have the ordinary meanings to those skilled in the art to which the present application pertains. The terms "first", "second" and similar terms used in the present application do not denote any order, quantity or importance, but are used to distinguish different components. "Up", "down", "left", "right" and the like are used only to indicate relative positional relationships, and when the absolute positions of the described objects are changed, the relative positional relationships are also changed accordingly.

[0038] Please refer to Figure 1 , Figure 1 is one of the flowcharts of the ADAS and BMS key learning test method provided by the embodiments of the present application, as shown in Figure 1 , the method comprises:

[0039] Step 101, based on the message simulation of the sending logic of the host computer to the ADAS, the environment model file of the key learning test is obtained, and the environment model file includes the SKC and the SC.

[0040] Specifically, based on the message simulation of the sending logic of the host computer to the ADAS, the sending logic of the SKC, the SC, the random number and the like after the ADAS sends a request to learn the state in the environment model can be simulated, which can be realized in MATLAB / SIMULINK2018, and the implementation logic is explained. The host computer can be a computer or a single-chip microcomputer that directly sends operation instructions. Generally, it provides a user operation interactive interface and shows feedback data to the user. The ADAS can be an advanced driving assistance system (ADAS). The environment model file can be an environment model obtained after simulating the ADAS. The SKC can be a secret key code (SKC). The SC can be a safe code (SC). The SKC and the SC can be generated by a vehicle identification number (VIN) and have uniqueness, and are composed of 16 bytes and 3 bytes respectively.

[0041] Step 102, based on the host computer, the environment model file is compiled in the HIL device.

[0042] Specifically, the HIL device can be a hardware-in-the-loop (HIL) device. Hardware-in-the-loop is a development and testing technology for complex device controllers.

[0043] Step 103, the host computer generates an executable file according to the environment model file.

[0044] Specifically, the executable file is a file that can be directly executed by an autonomous automatic test tool, which can be a test case. The test case can be designed according to the simulation logic and implementation logic description, and specific scenarios and parameters are designed to verify the function and performance of the system. For example, Table 1 below is a BMS key learning test case. As shown in Table 1, the input signal of this test case is the external interface of the environment model, and the learning flow logic is integrated inside the model. Before learning, the ADAS sends a "request learning state" signal, and the BMS feedbacks the learning state "not learned". After learning (this process is completed in the "S5" row of the test case), the "request learning state" signal is sent again, and the BMS feedbacks the learning state "has learned". The specific learning process is as shown in Figure 2 and Figure 3 , wherein the contents in the dashed box are integrated inside the environment.

[0045] Table 1 BMS key learning test case

[0046]

[0047] Table 2 below is a BMS clear learning state test case. As shown in Table 2, the input signal of this test case is the external interface of the environment model. Before clearing the learning state, it is ensured that the BMS is in the "has learned" state. After clearing the learning state, the learning state is requested again. If the BMS learning state returns "not learned", it indicates that the clearing is successful.

[0048] Table 2 BMS clear learning state test case

[0049]

[0050]

[0051] Step 104, based on the host computer, the executable file is sent to the HIL device.

[0052] Step 105, based on the HIL device, the executable file is used to perform a key learning test on the battery management system BMS.

[0053] Specifically, the battery management system BMS can be a battery management system (BMS), the key learning test includes a learning process and a clearing process, the learning processes of the BMS in the factory mode and the after-sales mode are different, in the offline learning function, the BMS writes SKC and SC into a secure storage area through a Tester device, and checks through an authentication process between ADAS and the BMS, after the checking, the offline learning function ends; in the after-sales learning process, the newly installed BMS shares the stored SKC and SC in the ADAS with the newly installed BMS through the Tester sending instructions, and checks through the authentication process between the ADAS and the BMS, after the checking, the after-sales learning process ends, wherein the Tester device in the factory learning mode refers to an offline electrical inspection device, the Tester device in the after-sales mode refers to an after-sales diagnostic instrument, and the secure storage area can be stored into a secure chip with a hardware secure chip or into a FLASH memory without the hardware secure chip.

[0054] In the embodiment of the application, the key learning test method can simulate the communication process of ADAS and BMS on the HIL test environment, so that the BMS bus communication security algorithm becomes a testable item in the HIL environment, ensuring the security of bus communication, and through writing use cases and automatic scripts, automatic testing is realized, so that the accuracy of the test is higher.

[0055] Optionally, the sending logic of the auxiliary driving system ADAS based on the host computer is packet simulated to obtain an environment model file of the key learning test, including:

[0056] The sending logic of the learning process of the auxiliary driving system ADAS based on the host computer is packet simulated to obtain a learning environment model file in the key learning test;

[0057] The sending logic of the clearing process of the auxiliary driving system ADAS based on the host computer is packet simulated to obtain a clearing environment model file in the key learning test, and the environment model file includes the learning environment model file and the clearing environment model file.

[0058] Specifically, the key learning of the ADAS and the BMS includes a key learning process and a clearing process, for example, Figure 4 is a flow chart of the key learning process of the ADAS and the BMS provided by the embodiment of the application, as Figure 4As shown, the ADAS sends a system learning activation to start the learning process, and the BMS receives the signal and feeds back its learning state. If the BMS is in the learned state, the BMS does not perform the learning process. If the BMS is in the unlearned state, the BMS starts the learning process, and the ADAS continues to send the SKC and SC, which are stored in the BMS in the safe area. Then, the BMS verifies the SKC and SC through the random number. If the authentication fails and times out, the ADAS sends an authentication failure. If the authentication is passed, the BMS stops the learning process, and the ADAS sends a learning state setting. After receiving the signal, the BMS sets its learning state to the learned state and sends its learning state.

[0059] Figure 5 FIG. 1 is a flowchart of a key learning process of an ADAS and a BMS according to an embodiment of the present application. Figure 5 As shown, when the ADAS sends a learning instruction and SC, the BMS compares the SC value with the stored value. If the values are inconsistent, the BMS does not execute the clearing command. If the values are consistent, the BMS clears the learning state.

[0060] In the embodiment of the present application, the test method for key learning can simulate the key learning process and the clearing process of the ADAS and the BMS, respectively, to obtain the learning environment model file and the clearing environment model file, thereby realizing automatic testing of the key learning process and the clearing process of the ADAS and the BMS.

[0061] Optionally, the learning environment model file in the key learning test is obtained by packet simulation based on the sending logic of the learning process of the auxiliary driving system ADAS.

[0062] In the case where the ADAS sends a request learning state signal to the BMS, the learning state replied by the BMS is received.

[0063] In the case where the replied learning state is unlearned, the ADAS sends a key SKC and a security code SC to the BMS every first time interval.

[0064] In the case where the SKC and SC are sent, the ADAS waits for a second time interval, and then sends a random number packet to the BMS. The second time interval is greater than the first time interval.

[0065] The ADAS compares the calculation result sent by the BMS and the random number packet to obtain an authentication result. The calculation result is obtained by the BMS according to the received random number packet, and the authentication result is used to indicate whether the BMS learns successfully.

[0066] In a case that the authentication result represents that the BMS learns successfully, the ADAS sends the authentication result to the BMS;

[0067] In a case that the authentication result is sent, the ADAS sends setting learning state information to the BMS, the setting learning state information being used for instructing the BMS to set a learning state.

[0068] Specifically, the ADAS learning flow message simulation is crucial in terms of when to send and signal values sent, for example, Figure 6 The flow chart of ADAS learning flow message simulation is as shown in Figure 6 As shown, the ADAS learning message (message 1) polls to send a request learning state, an SKC and an SC, and when the setting request learning state signal is 1, the SKC and the SC are continuously sent, the time interval is 30 ms, after the sending is completed, 100 ms is waited to trigger the sending of a random number message, the message (message 2) also polls to send a random number and an authentication result, and after the AES calculation result returned by the BMS is compared, an authentication success is output, and after the authentication success is sent, the message 1 sends setting learning state.

[0069] In the embodiment of the present application, the key learning test method can simulate the key learning process of the BMS by using an automatic test tool, verify the correctness and security of the key learning process, improve the test efficiency and quality, and reduce the errors and costs of manual operation.

[0070] Optionally, the sending logic of the clearing flow of the auxiliary driving system ADAS based on the host computer is simulated by a message to obtain a clearing environment model file in the key learning test, and the clearing environment model file comprises:

[0071] The ADAS sends a clearing learning instruction and a security code SC to the BMS, wherein the clearing learning instruction is used for instructing the BMS to clear a learning state.

[0072] In a case that the security code SC is the same as the security code stored by the BMS, the BMS executes the clearing learning instruction.

[0073] Specifically, the flow of the ADAS learning flow message simulation is that the ADAS learning message (message 3) sends a clearing instruction and an SC code to the BMS.

[0074] In the embodiment of the present application, the key learning test method can simulate the key clearing process of the BMS by using an automatic test tool, verify the correctness and security of the key clearing process, improve the test efficiency and quality, and reduce the errors and costs of manual operation.

[0075] Figure 7is a schematic diagram of a test system for key learning provided by an embodiment of the present application, as shown in Figure 7 The test system includes a host computer and a HIL device.

[0076] The host computer performs packet simulation on the sending logic of an ADAS to obtain an environment model file for key learning testing, the environment model file including a SKC and a SC.

[0077] The host computer compiles the environment model file in the HIL device.

[0078] The host computer generates an executable file based on the environment model file.

[0079] The host computer sends the executable file to the HIL device.

[0080] The HIL device performs key learning testing on a BMS using the executable file.

[0081] Figure 8 is a schematic diagram of a test device for key learning provided by an embodiment of the present application, as shown in Figure 8 The device 800 includes:

[0082] The simulation module 801 is configured to perform packet simulation on the sending logic of an ADAS based on a host computer to obtain an environment model file for key learning testing, the environment model file including a SKC and a SC.

[0083] The compilation module 802 is configured to compile the environment model file in a HIL device based on the host computer.

[0084] The generation module 803 is configured to generate an executable file based on the host computer according to the environment model file.

[0085] The sending module 804 is configured to send the executable file to the HIL device based on the host computer.

[0086] The test module 805 is configured to perform key learning testing on a BMS using the executable file based on the HIL device.

[0087] Optionally, the simulation module 801 includes:

[0088] The first simulation unit is configured to perform packet simulation on the sending logic of a learning process of an ADAS based on a host computer to obtain a learning environment model file in key learning testing.

[0089] A second simulation unit is configured to simulate a message based on a sending logic of a clearing process of an auxiliary driving system (ADAS) by an upper computer, and obtain a clearing environment model file in a key learning test, wherein the environment model file comprises a learning environment model file and the clearing environment model file.

[0090] Optionally, the first simulation unit is configured to:

[0091] In a case where the ADAS sends a request learning state signal to the BMS, receiving a reply learning state of the BMS;

[0092] In a case where the reply learning state is not learned, sending a key SKC and a security code SC to the BMS by the ADAS at a first time interval;

[0093] In a case where the sending of the SKC and the SC is completed, the ADAS waits for a second time interval, and then sends a random number message to the BMS, wherein the second time interval is greater than the first time interval;

[0094] The ADAS compares a calculation result sent by the BMS and the random number message, to obtain an authentication result, wherein the calculation result is obtained by the BMS based on the received random number message, and the authentication result is used to indicate whether the BMS is successfully learned;

[0095] In a case where the authentication result indicates that the BMS is successfully learned, the ADAS sends the authentication result to the BMS;

[0096] In a case where the sending of the authentication result is completed, the ADAS sends setting learning state information to the BMS, wherein the setting learning state information is used to indicate the BMS to set a learning state.

[0097] Optionally, the second simulation unit is configured to:

[0098] The ADAS sends a clearing learning instruction and a security code SC to the BMS, wherein the clearing learning instruction is used to instruct the BMS to clear a learning state;

[0099] In a case where the security code SC is the same as a security code stored by the BMS, the BMS executes the clearing learning instruction.

[0100] Figure 9 is a schematic diagram of a key learning test device provided by an embodiment of the application, as shown in Figure 9 The device comprises a transceiver 701, a memory 702, a processor 700, and a program stored in the memory and executable on the processor.

[0101] The processor 700 is configured to simulate a message based on a sending logic of an upper computer to an ADAS, to obtain an environment model file for key learning test, and the environment model file includes a key SKC and a security code SC;

[0102] The upper computer compiles the environment model file in a HIL device;

[0103] The upper computer generates an executable file based on the environment model file, and sends the executable file to the HIL device;

[0104] The HIL device performs key learning test on a BMS based on the executable file.

[0105] In the above method, Figure 7 In the above method, the bus architecture can include any number of interconnected buses and bridges, which link various circuits together, including one or more processors represented by the processor 700 and the memory represented by the memory 702. The bus architecture can also link various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, and thus, will not be further described herein. The bus interface provides an interface. The transceiver 701 can be a plurality of elements, including a transmitter and a transceiver, which provide a unit for communicating with various other devices on a transmission medium. The processor 700 is responsible for managing the bus architecture and general processing, and the memory 702 can store data used by the processor 700 in performing operations.

[0106] Optionally, the processor 700 is further configured to:

[0107] Simulate a message based on a sending logic of an upper computer to an ADAS, to obtain a learning environment model file in key learning test;

[0108] Simulate a message based on a sending logic of an upper computer to an ADAS, to obtain a learning environment model file in key learning test;

[0109] Optionally, the processor 700 is further configured to:

[0110] In the case that the ADAS sends a request learning state signal to the BMS, receive a learning state replied by the BMS;

[0111] In the case that the replied learning state is not learned, send a key SKC and a security code SC to the BMS by the ADAS at a first time interval;

[0112] In a case that the SKC and the SC are sent, the ADAS waits for a second time interval after the ADAS sends a random number message to the BMS, and the second time interval is greater than the first time interval;

[0113] The ADAS compares the calculation result sent by the BMS and the random number message to obtain an authentication result, the calculation result is obtained by the BMS according to the received random number message, and the authentication result is used to indicate whether the BMS learns successfully;

[0114] In a case that the authentication result indicates that the BMS learns successfully, the ADAS sends the authentication result to the BMS;

[0115] In a case that the authentication result is sent, the ADAS sends setting learning state information to the BMS, and the setting learning state information is used to indicate the BMS to set a learning state.

[0116] Optionally, the processor 700 is further configured to:

[0117] The ADAS sends a clear learning instruction and a security code SC to the BMS, wherein the clear learning instruction is used to instruct the BMS to clear a learning state;

[0118] In a case that the security code SC is the same as the security code stored by the BMS, the BMS executes the clear learning instruction.

[0119] The embodiment of the application further provides a readable storage medium for storing a program, the program can be executed by a processor to realize each process of the embodiment of the above method, and the implementation principle and technical effects are similar, and to avoid repetition, the embodiment will not be described here.

[0120] In the several embodiments of the application, it should be understood that the disclosed method and device can be implemented in other ways. For example, the device embodiment described above is only illustrative. For example, the division of the units is only a logical function division. In actual implementation, another division mode can be used. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0121] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically included separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software function unit.

[0122] The integrated unit realized in the form of software function unit can be stored in a computer readable storage medium. The software function unit is stored in a storage medium, and includes a plurality of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute part of steps of the transceiving method according to each embodiment of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage medium capable of storing program codes.

[0123] The above describes the preferred embodiments of the present application. It should be noted that the protection scope of the present application is not limited to this. For those skilled in the art, some improvements and refinements can be made without departing from the principles of the present application, and these improvements and refinements should also be considered as the protection scope of the present application.

Claims

1. A test method of key learning, characterized by, The application relates to a key learning test method for a battery management system (BMS) based on a hardware-in-loop (HIL) device. The application comprises the following steps: a host computer simulates a message of a sending logic of an advanced driver assistance system (ADAS) to obtain an environment model file for key learning test, wherein the environment model file comprises a secret key (SKC) and a security code (SC); the host computer compiles the environment model file on a HIL device; the host computer generates an executable file according to the environment model file, wherein the executable file is a test case, the test case is designed according to a simulation logic and an implementation logic description, and the test case is used for verifying functions and performances of the system by designing specific scenes and parameters; the host computer sends the executable file to the HIL device; the HIL device performs key learning test on the BMS by using the executable file; the host computer simulates a message of a sending logic of an advanced driver assistance system (ADAS) to obtain an environment model file for key learning test, wherein the environment model file comprises a secret key (SKC) and a security code (SC); the host computer simulates a message of a sending logic of a learning process of an advanced driver assistance system (ADAS) to obtain a learning environment model file for key learning test; the host computer simulates a message of a sending logic of a clearing process of an advanced driver assistance system (ADAS) to obtain a clearing environment model file for key learning test, wherein the environment model file comprises the learning environment model file and the clearing environment model file; the host computer simulates a message of a sending logic of a learning process of an advanced driver assistance system (ADAS) to obtain a learning environment model file for key learning test, wherein the environment model file comprises a secret key (SKC) and a security code (SC); in a case where the ADAS sends a request learning state signal to the BMS, the BMS replies a learning state; in a case where the replied learning state is not learning, the ADAS sends a secret key (SKC) and a security code (SC) to the BMS at a first time interval; in a case where the SKC and the SC are sent, the ADAS sends a random number message to the BMS after waiting for a second time interval, wherein the second time interval is greater than the first time interval; the ADAS compares a calculation result sent by the BMS and the random number message to obtain an authentication result, wherein the calculation result is obtained by the BMS according to the received random number message, and the authentication result is used for indicating whether the BMS learns successfully; in a case where the authentication result indicates that the BMS learns successfully, the ADAS sends the authentication result to the BMS; in a case where the authentication result is sent, the ADAS sends setting learning state information to the BMS, wherein the setting learning state information is used for indicating the BMS to set a learning state; the host computer simulates a message of a sending logic of a clearing process of an advanced driver assistance system (ADAS) to obtain a clearing environment model file for key learning test, wherein the environment model file comprises a secret key (SKC) and a security code (SC); the ADAS sends a clearing learning instruction and a security code (SC) to the BMS, wherein the clearing learning instruction is used for indicating the BMS to clear a learning state. In the case that the security code SC is the same as the security code stored in the BMS, the BMS executes the clear learning instruction.

2. A test system for key learning, characterized by The test system comprises a host computer and a HIL device; The host computer performs packet simulation on the sending logic of the ADAS to obtain an environment model file for the key learning test, wherein the environment model file comprises a key SKC and a security code SC. The host computer compiles the environment model file in the HIL device. The host computer generates an executable file based on the environment model file; wherein the executable file is a test case designed based on the simulation logic and the implementation logic description, and is used to verify the function and performance of the system by designing specific scenes and parameters. The host computer sends the executable file to the HIL device. The HIL device performs key learning test on the BMS by using the executable file.

3. A test apparatus for key learning, characterized by, Comprise: An simulation module, configured to perform packet simulation on the sending logic of the ADAS based on the host computer to obtain an environment model file for the key learning test, wherein the environment model file comprises a key SKC and a security code SC; A compiling module, configured to compile the environment model file in the HIL device based on the host computer; A generating module, configured to generate an executable file based on the host computer according to the environment model file; A sending module, configured to send the executable file to the HIL device based on the host computer; A test module, configured to perform key learning test on the BMS by using the executable file based on the HIL device; The simulation module comprises: A first simulation unit, configured to perform packet simulation on the sending logic of the learning process of the ADAS based on the host computer to obtain a learning environment model file in the key learning test; A second simulation unit, configured to perform packet simulation on the sending logic of the clear process of the ADAS based on the host computer to obtain a clear environment model file in the key learning test, wherein the environment model file comprises the learning environment model file and the clear environment model file; The first simulation unit is configured to: In the case that the ADAS sends a request learning state signal to the BMS, receive a learning state returned by the BMS; In the case that the returned learning state is not learned, send a key SKC and a security code SC to the BMS at a first time interval based on the ADAS; In the case that the sending of the SKC and the SC is completed, the ADAS sends a random number packet to the BMS after waiting for a second time interval, wherein the second time interval is greater than the first time interval; The ADAS compares the calculation result sent by the BMS and the random number packet to obtain an authentication result, wherein the calculation result is obtained by the BMS based on the received random number packet, and the authentication result is used to indicate whether the BMS learns successfully; In the case that the authentication result indicates that the BMS learns successfully, the ADAS sends the authentication result to the BMS; In a case where the authentication result sending is completed, the ADAS sends setting learning state information to the BMS, the setting learning state information being used for instructing the BMS to set a learning state; The second simulation unit is used for: The ADAS sends a clear learning instruction and a security code SC to the BMS, wherein the clear learning instruction is used for instructing the BMS to clear a learning state; In a case where the security code SC is the same as a security code stored by the BMS, the BMS executes the clear learning instruction.

4. A test device for key learning, the device comprising: The transceiver, the memory, the processor, and a program stored on the memory and executable on the processor; characterized in that, The processor is configured to read the program in the memory to implement the steps in the method of claim 1.

5. A readable storage medium characterized by, The program or instructions are stored on the readable storage medium, and the program or instructions are executed by the processor to implement the steps in the method of claim 1.

Citation Information

Patent Citations

  • Hardware-in-loop simulation testing system and testing method for automobile

    CN104062969A

  • Secret key processing method, gateway, electric detection equipment, diagnostic apparatus and electronic control unit

    CN112653548A