A method and system for testing vehicle-mounted network security communication, electronic equipment, and storage medium

By configuring communication keys and testing the sending and receiving of secure messages in different scenarios, and using diagnostic fault codes to determine whether the test has passed or failed, the problem of integrated verification of secure communication in the vehicle network is solved and the security of vehicle communication is improved.

CN115576302BActive Publication Date: 2024-09-24CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211216124.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2024-09-24
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

Existing technology cannot effectively test whether vehicle-mounted network security communications are successfully integrated into each component, cannot verify whether vehicle-mounted security communications can communicate normally, and there are risks of message forgery and command replay.

Method used

By obtaining the communication key configuration of the components under test and allowing them to communicate with each other, test whether the sender and receiver can correctly send and receive safety messages in different scenarios, and use the fault diagnosis code to determine whether the test has passed or failed, including test sending Cycle, reset scenarios, bus shutdown, power-off recovery, FBL upgrade, continuous operation and tampering scenarios.

Benefits of technology

It verified whether the vehicle bus safety communication was successfully integrated into each component, which improved the communication security of the vehicle and ensured that components can communicate normally under different circumstances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115576302B
    Figure CN115576302B
Patent Text Reader

Abstract

The present invention provides a method for testing vehicle-mounted network security communication, comprising learning communication keys of components to be tested, making the communication keys of various components to be tested consistent, and calculating relevant encryption keys for SECOC encryption; testing whether a sending-end component of the component to be tested can correctly send a security message in different test scenarios, if the security message can be correctly sent, the test passes, otherwise the relevant fault diagnosis code is read; testing whether a receiving-end component of the component to be tested can correctly receive the security message, if the security message can be correctly received, the test passes, otherwise the relevant fault diagnosis code is read; the method can verify whether the vehicle-mounted bus security communication of the whole vehicle is successfully integrated into various components, thereby improving the communication security of the whole vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle-mounted communication technology, and in particular to a testing method and system for vehicle-mounted network security communication, an electronic device, and a storage medium. Background Art

[0002] As the level of automobile intelligence increases, the demand for data transmission of various controllers increases accordingly. LIN, CAN, CANFD, vehicle Ethernet, Flex Ray, etc. have also been successively applied to vehicle communications. Among them, the CAN protocol is widely used in the internal communication of various automobile controllers because of its built-in CRC check (cyclic redundancy check). However, due to its plain text transmission and broadcast characteristics, there is a risk of message forgery and command replay.

[0003] In response to the communication security issues between components in the vehicle, AUTOSAR (Automotive Open System Architecture) proposed SECOC (Security Onboard Community) to solve the problems of message replay, message content verification, and message timing verification, thereby improving the communication security of the entire vehicle. However, it also brought about the problem of insufficient testing and verification of vehicle network security communications. Generally, components implement related security functions by integrating the SDK (Software Development Kit) of SECOC (Security Onboard Community).

[0004] Patent CN104767618A discloses a broadcast-based CAN bus authentication method and system. The patent proposes a CAN bus authentication method and system, but does not disclose a test method for vehicle-mounted bus safety communication and a communication system verification method. Patent 114629742A discloses a vehicle data communication simulation test platform and method for new energy electric vehicles. It is necessary to establish a vehicle simulation model and perform a transmission parameter test of network data on the established simulation model. The purpose is to quickly verify the vehicle's network architecture, rather than verifying whether the vehicle-mounted safety communication of the entire vehicle is successfully integrated into each component. It is impossible to test whether the vehicle-mounted safety communication can communicate normally. Summary of the invention

[0005] In view of the above-mentioned shortcomings of the prior art, the present invention provides a method and system for testing vehicle-mounted network security communication, an electronic device, and a storage medium to solve the above-mentioned technical problems.

[0006] A method for testing vehicle-mounted network security communication, characterized in that the method comprises:

[0007] Obtain the communication keys of the components to be tested and configure them so that the components to be tested can communicate with each other;

[0008] Test whether the sending end of the tested component can correctly send the security message in different test scenarios. If the security message can be sent correctly, the test passes;

[0009] If the safety message cannot be sent correctly, read the fault diagnosis code currently generated by the sending end to test whether the receiving end of the component to be tested can correctly receive the safety message.

[0010] If the safety message can be received correctly, the test passes, otherwise, the fault diagnostic code currently generated by the receiving end is read and the test is determined to fail.

[0011] In one embodiment of the present invention, the components to be tested include a Bluetooth module, an ADAS controller, a gateway, and a body controller;

[0012] The test scenario includes testing the sending cycle of the safety message, checking whether the sending end of the tested component sends the safety message according to the preset cycle, if so, the test passes, otherwise, reading the fault diagnosis code generated by the current sending end;

[0013] Calculate the MAC value using the information of the security message, and compare the calculated MAC value with the MAC value of the security message. If they are consistent, the test passes. Otherwise, read the corresponding fault diagnostic code.

[0014] Whether the receiving end of the component to be tested can correctly receive the safety message, if it can, the test passes, otherwise, read the fault diagnostic code generated by the current receiving end and determine that the test fails.

[0015] In one embodiment of the present invention, the test scenario includes a reset scenario test, in which a reset command is sent to each component to be tested via the CAN bus to test whether the sending end of the component to be tested can correctly send a safety message. If so, the test passes; otherwise, the fault diagnostic code generated by the current sending end is read;

[0016] Test whether the receiving end of the component to be tested can correctly receive the safety message. If so, the test passes. Otherwise, read the fault diagnostic code generated by the current receiving end.

[0017] Test whether the freshness value increases according to the specification. If so, the test passes. Otherwise, read the corresponding fault diagnostic code and determine that the test fails.

[0018] In one embodiment of the present invention, the test scenario includes shutting down the CAN bus for a preset time and then restoring it, testing whether the sending end of the component to be tested can correctly send a safety message, if it can, the test passes, otherwise, reading the fault diagnosis code generated by the current sending end, testing whether the receiving end of the component to be tested can correctly receive the safety message, if it can, the test passes, otherwise, reading the fault diagnosis code generated by the current receiving end and determining that the test fails;

[0019] The test scenario also includes restoring power to the component under test after powering off multiple times, testing whether the sending end of the component under test can correctly send a safety message. If so, the test passes; otherwise, the fault diagnostic code generated by the current sending end is read and the test fails.

[0020] In one embodiment of the present invention, the test scenario includes upgrading and flashing the FBL of the component to be tested, powering on and off again after the flashing is successful, testing whether the sending end of the component to be tested can correctly send a safety message, if so, the test passes, otherwise the fault diagnostic code generated by the current sending end is read, and testing whether the receiving end of the component to be tested can correctly receive the safety message, if so, the test passes, otherwise the fault diagnostic code generated by the current receiving end is read and the test fails;

[0021] The test scenario also includes allowing the component to be tested to run continuously for a preset time, testing whether the sending end of the component to be tested can correctly send a security message. If so, the test passes, otherwise the fault diagnostic code generated by the current sending end is read and the test is determined to have failed.

[0022] In one embodiment of the present invention, the test scenario includes replaying a safety message to a receiving end component via a CAN bus, reading whether a corresponding fault diagnostic code appears at the receiving end of the component to be tested, and then testing whether the receiving end can clear the fault diagnostic code after receiving the correct safety message. If so, the test passes, otherwise, the fault diagnostic code generated by the current receiving end is read and the test is determined to fail;

[0023] The test scenario also includes tampering with the MAC value and freshness value of the security message, replaying the tampered security message to the receiving end of the component to be tested through the CAN bus, reading whether the corresponding fault diagnostic code appears on the receiving end, and then testing whether the fault diagnostic code can be cleared after the receiving end receives the correct security message. If so, the test passes, otherwise, the fault diagnostic code generated by the current receiving end is read and the test is determined to have failed.

[0024] In one embodiment of the present invention, the test scenario includes repeatedly performing sleep and wake-up operations on the component to be tested, testing whether the sending end of the component to be tested can correctly send a security message. If so, the test passes; otherwise, the fault diagnostic code generated by the current sending end is read; and testing whether the receiving end of the component to be tested can correctly receive the security message. If so, the test passes; otherwise, the fault diagnostic code generated by the current receiving end is read and the test is determined to fail.

[0025] In a second aspect, the present invention further provides a vehicle-mounted network security communication testing system, the system comprising:

[0026] Test computer, bus simulation and analysis equipment, diagnostic instrument composed of host computer, communication system composed of components to be tested or vehicle to be tested;

[0027] The test computer, the diagnostic instrument, the communication system or the vehicle to be tested are respectively connected to the bus simulation and analysis equipment;

[0028] The diagnostic instrument is used to learn the communication keys of the components to be tested so that the communication keys of the components to be tested remain consistent;

[0029] The test computer is used to calculate the relevant encryption key of SECOC encryption;

[0030] By testing the computer in different test scenarios, it is tested whether the sending-end component of the tested component can correctly send the security message. If it can send the security message correctly, the test passes, otherwise the relevant fault diagnostic code is read. It is also tested whether the receiving-end component of the tested component can correctly receive the security message. If it can receive the security message correctly, the test passes, otherwise the relevant fault diagnostic code is read.

[0031] In a third aspect, the present invention further provides an electronic device, comprising:

[0032] one or more processors;

[0033] A storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the electronic device implements the test method for in-vehicle network security communication as described in any one of the above items.

[0034] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, enables the computer to execute any of the above-mentioned methods for testing vehicle-mounted network security communications.

[0035] Beneficial effects of the present invention: The present invention tests whether each component to be tested can correctly send security messages and correctly receive security messages in different test scenarios, and simulates whether the components to be tested can communicate normally under different circumstances in actual application scenarios, thereby verifying whether the vehicle-mounted bus security communication of the entire vehicle is successfully integrated into each component, thereby improving the communication security of the entire vehicle.

[0036] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0038] Figure 1 It is a test system for in-vehicle network security communication shown in an exemplary embodiment of the present application;

[0039] Figure 2 is a flow chart of a method for testing vehicle-mounted network security communication shown in an exemplary embodiment of the present application;

[0040] Figure 3 is a test step flow chart showing an exemplary embodiment of the present application;

[0041] Figure 4 An electronic device is shown as an exemplary embodiment. DETAILED DESCRIPTION

[0042] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0043] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0044] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0045] With the rapid development of intelligent connected vehicles, the functions of the Internet of Vehicles are becoming more and more common. In this context, the information security protection mechanism of the vehicle communication network is becoming more and more important. As the demand for network information of vehicles increases, the vehicle CAN network gradually opens up interfaces, resulting in external information security attacks that can intervene in the vehicle's CAN bus network through wireless networks (Bluetooth, wireless) or online diagnostic interfaces, resulting in illegal monitoring of CAN messages, malicious modification of CAN messages and rebroadcasting, and other serious consequences.

[0046] The SECOC module is an independent module of AUTOSAR. Its purpose is to provide a resource-efficient and practical authentication mechanism for PDUs-level data interaction. The SECOC module can provide identity authentication for data transmitted on the CAN bus, thereby effectively detecting attacks such as data playback, deception, and tampering. Therefore, it is crucial to test whether the SECOC module has been fully integrated into all components involved in the CAN bus.

[0047] See also Figure 1 , Figure 1 The invention relates to a vehicle-mounted network security communication testing system, which comprises: a testing computer 101, a bus simulation and analysis device 102, a diagnostic instrument 103 composed of a host computer, and a communication system 104 composed of components to be tested, wherein the bus simulation and analysis device 102 has an independent power supply module. The separate communication system can perform communication tests during bench tests, or the communication test can be performed on the vehicle to be tested after the components to be tested have been installed on the vehicle.

[0048] The test computer 101, the diagnostic instrument 102, the communication system or the vehicle to be tested are respectively connected to the bus simulation analysis device 102;

[0049] Specifically, the test computer 101 is used to execute relevant test cases, transmit relevant safety messages covering each test case through the bus simulation analysis device 102, and observe whether the function of the communication system or the vehicle under test is abnormal by reading the fault diagnostic code of each component under test, so as to determine whether the on-board network security communication plug-in is correctly integrated.

[0050] If the communication system composed of the components to be tested is tested, the communication system is connected to the bus simulation and analysis device 102 via DB9 (9-pin serial communication cable). If the whole vehicle to be tested is tested, the bus simulation and analysis device 102 is connected to the OBD interface of the vehicle to be tested via the OBD line, thereby connecting to the corresponding CAN bus.

[0051] See also Figure 2 , Figure 2 This is a flow chart of the test method for vehicle-mounted network security communication in this application. The specific method is as follows:

[0052] S210 obtains and configures the communication key of the components to be tested so that the components to be tested can communicate with each other and calculate the relevant encryption key of SECOC encryption;

[0053] Specifically, the components to be tested include a Bluetooth module, an ADAS controller, a gateway, and a body controller;

[0054] The communication keys of each component to be tested are learned through the diagnostic instrument to keep the communication keys of each component to be tested consistent, so that the components to be tested can communicate with each other, and the test computer calculates or reads the relevant encryption keys encrypted by SECOC.

[0055] S220 tests whether the sending end of the component to be tested in different test scenarios can correctly send the security message. If the security message can be sent correctly, the test passes;

[0056] If the safety message cannot be correctly sent, S230 reads the fault diagnosis code currently generated by the sending end, and tests whether the receiving end of the component to be tested can correctly receive the safety message;

[0057] If the safety message can be received correctly at S240, the test is passed; otherwise, the fault diagnosis code currently generated by the receiving end is read and the test is determined to be failed.

[0058] Specifically, the test scenarios include the following scenarios:

[0059] 1) Test the sending cycle of the safety message. Use the bus simulation software in the test computer to check whether the sending end of the tested component sends the safety message according to the preset cycle. If so, the test passes. Otherwise, read the fault diagnostic code generated by the current sending end;

[0060] Calculate the MAC value using the information of the security message, such as using the encryption key SK, the message content PAYLOAD, and the message ID through an encryption algorithm to calculate whether the MAC value is correct. In this embodiment, the AES128 algorithm is used to calculate the MAC value, and the MAC calculation value = AES128 (ID, SK, PAYLOAD). Compare the calculated MAC value with the MAC value of the security message to see if they are consistent. If they are consistent, the test passes. Otherwise, read the corresponding fault diagnostic code;

[0061] Whether the receiving end of the component to be tested can correctly receive the safety message, if it can, the test passes, otherwise, read the fault diagnostic code generated by the current receiving end and determine that the test fails.

[0062] 2) The test scenario includes a reset scenario test, in which the bus simulation software of the test computer sends a reset instruction to each component under test through the CAN bus, including hardware reset and software reset, to test whether the sending end of the component under test, such as the Bluetooth module and the ADAS controller, can correctly send the safety message. If so, the test passes. Otherwise, the fault diagnostic code generated by the current sending end is read to verify whether the relevant components can correctly send the safety message under such abnormal circumstances;

[0063] Test whether the receiving end of the tested component, such as the gateway and the body controller, can correctly receive the safety message. If so, the test passes. Otherwise, read the fault diagnosis code generated by the current receiving end and determine that the test fails.

[0064] Test whether the freshness value sent by the gateway increases according to the specification. If so, the test passes. Otherwise, read the corresponding fault diagnostic code.

[0065] 3) The test scenario includes performing BUSOFF on the CAN bus for a preset time and then restoring it. In this embodiment, BUSOFF is performed for 10 seconds before recovery, and 5 to 10 seconds can also be selected. The sending end of the component to be tested, such as the Bluetooth module and the ADAS controller, is tested to see whether it can correctly send a safety message. If so, the test passes. Otherwise, the fault diagnostic code generated by the current sending end is read. The receiving end of the component to be tested, such as the gateway and the body controller, is tested to see whether it can correctly receive the safety message. If so, the test passes. Otherwise, the fault diagnostic code generated by the current receiving end is read and the test fails. The communication system or the whole vehicle function is observed to see whether it is normal, thereby verifying whether the component to be tested can correctly send a safety message in this abnormal scenario.

[0066] 4) The test scenario includes powering off and restoring power to the components to be tested for multiple times. In this embodiment, the components to be tested are powered off and restored for 2 to 3 times. The sending end of the components to be tested, such as the Bluetooth module and the ADAS controller, is tested to see whether they can correctly send security messages. If so, the test passes; otherwise, the fault diagnostic code generated by the current sending end is read. The receiving end of the components to be tested, such as the gateway and the body controller, is tested to see whether they can correctly receive security messages. If so, the test passes; otherwise, the fault diagnostic code generated by the current receiving end is read, thereby verifying whether the components to be tested can correctly send security messages in this abnormal scenario.

[0067] 5) The test scenario includes upgrading and flashing the FBL of the component to be tested, powering on and off after successful flashing, testing whether the sending end of the component to be tested can correctly send security messages. If so, the test passes; otherwise, the fault diagnostic code generated by the current sending end is read; and testing whether the receiving end of the component to be tested can correctly receive the security message. If so, the test passes; otherwise, the fault diagnostic code generated by the current receiving end is read, thereby verifying whether the component to be tested can correctly send security messages in this abnormal scenario.

[0068] 6) The test scenario also includes making the components to be tested run continuously for a preset time. In this embodiment, the continuous running time of the communication system or the vehicle to be tested is set to 8 hours, which is the length of a working day, so that the testers can complete the test conveniently. The sending end of the components to be tested, such as the Bluetooth module and the ADAS controller, is tested to see whether they can correctly send safety messages. If so, the test passes; otherwise, the fault diagnostic code generated by the current sending end is read. The receiving end of the components to be tested, such as the gateway and the body controller, is tested to see whether they can correctly receive safety messages. If so, the test passes; otherwise, the fault diagnostic code generated by the current receiving end is read. This test scenario is a durability test of the communication system or the vehicle to be tested, including the reception and transmission of safety messages and synchronization messages, to ensure the stability of the entire vehicle.

[0069] 7) The test scenario includes replaying the security message from the CAN bus to the receiving end of the component to be tested through the bus simulation software of the test computer, reading whether the relevant fault diagnostic code appears at the receiving end, and then testing whether the receiving end can clear the fault diagnostic code after receiving the correct security message. If so, the test passes, otherwise, read the corresponding fault diagnostic code and observe whether the function of the communication system or the vehicle to be tested is normal. Replay is an attack scenario, so as to verify whether the component to be tested of the present application can correctly send and receive security messages in the replay scenario, and whether it can achieve no processing of erroneous messages or recording of fault diagnostic codes.

[0070] 8) The test scenario also includes tampering with the MAC value and freshness value of the security message through the bus simulation software of the test computer, replaying the tampered security message to the receiving end of the tested component through the CAN bus, reading the receiving end, such as the gateway and the body controller to see if the corresponding fault diagnostic code will appear, and then testing whether the fault diagnostic code can be cleared after the receiving end receives the correct security message. If so, the test passes, otherwise, the corresponding fault diagnostic code is read.

[0071] 9) The test scenario includes repeatedly putting the components to be tested into sleep mode and waking up the components multiple times. In this embodiment, the communication system or the vehicle to be tested is woken up 5 times after being put into sleep mode. The sending end of the components to be tested, such as the Bluetooth module and the ADAS controller, is tested to see whether they can correctly send security messages. If so, the test passes. Otherwise, the fault diagnostic code generated by the current sending end is read. The receiving end of the components to be tested, such as the gateway and the body controller, is tested to see whether they can correctly receive security messages. If so, the test passes. Otherwise, the fault diagnostic code generated by the current receiving end is read. It is observed whether the functions of the communication system or the vehicle to be tested are normal, and whether the gateway and the body controller can clear abnormal fault diagnostic codes after receiving the correct security messages, thereby verifying whether the communication system or the vehicle to be tested can correctly send and receive security messages in such an abnormal scenario.

[0072] The order of the various test scenarios described above can be changed according to actual test needs, or the required test scenarios can be selected according to actual needs. Figure 3 , Figure 3 The test steps of the above test scenario are adopted for this application.

[0073] See also Figure 4 , Figure 4 An electronic device 400 provided in this embodiment includes:

[0074] One or more processors 401, memory 402, and communication bus 403;

[0075] The communication bus 403 is used to connect the processor 401 and the memory 402;

[0076] The processor 401 is used to execute the computer program stored in the memory to implement the testing method of vehicle-mounted network security communication as described in one or more of the above embodiments.

[0077] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer is caused to execute one or more methods in the above embodiments.

[0078] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of the steps included in the embodiment 1 of the embodiment of the present application.

[0079] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0080] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0081] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0082] The flow chart and block diagram in the accompanying drawings illustrate the possible implementation architecture, function and operation of the method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0083] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A method for testing vehicle-mounted network security communication, characterized in that: The method comprises: Obtain the communication keys of the components to be tested and configure them so that the components to be tested can communicate with each other; Test whether the sending end of the tested component can correctly send the security message in different test scenarios. If the security message can be sent correctly, the test passes; If the safety message cannot be sent correctly, read the fault diagnosis code currently generated by the sending end to test whether the receiving end of the component to be tested can correctly receive the safety message. If the safety message can be received correctly, the test passes; otherwise, the fault diagnostic code generated by the current receiving end is read and the test is determined to fail; The test scenario includes replaying the safety message to the receiving end component through the CAN bus, reading whether the corresponding fault diagnostic code appears at the receiving end of the tested component, and then testing whether the receiving end can clear the fault diagnostic code after receiving the correct safety message. If so, the test passes, otherwise, the fault diagnostic code generated by the current receiving end is read and the test is determined to fail; The test scenario also includes tampering with the MAC value and freshness value of the security message, replaying the tampered security message to the receiving end of the component to be tested through the CAN bus, reading whether the corresponding fault diagnostic code appears on the receiving end, and then testing whether the fault diagnostic code can be cleared after the receiving end receives the correct security message. If so, the test passes, otherwise, the fault diagnostic code generated by the current receiving end is read and the test is determined to have failed.

2. The testing method according to claim 1, characterized in that: The components to be tested include a Bluetooth module, an ADAS controller, a gateway, and a body controller; The test scenario includes testing the sending cycle of the safety message, checking whether the sending end of the tested component sends the safety message according to the preset cycle, if so, the test passes, otherwise, reading the fault diagnosis code generated by the current sending end; Calculate the MAC value using the information of the security message, and compare the calculated MAC value with the MAC value of the security message. If they are consistent, the test passes. Otherwise, read the corresponding fault diagnostic code. Whether the receiving end of the component to be tested can correctly receive the safety message, if it can, the test passes, otherwise, read the fault diagnostic code generated by the current receiving end and determine that the test fails.

3. The testing method according to claim 1, characterized in that: The test scenario includes a reset scenario test, which sends a reset command to each component to be tested through the CAN bus to test whether the sending end of the component to be tested can correctly send a safety message. If it can, the test passes, otherwise, the fault diagnostic code generated by the current sending end is read; Test whether the receiving end of the component to be tested can correctly receive the safety message. If so, the test passes. Otherwise, read the fault diagnostic code generated by the current receiving end. Test whether the freshness value increases according to the specification. If so, the test passes. Otherwise, read the corresponding fault diagnostic code and determine that the test fails.

4. The testing method according to claim 1, characterized in that: The test scenario includes shutting down the CAN bus for a preset time and then restoring it, testing whether the sending end of the tested component can correctly send a safety message, if so, the test passes, otherwise, reading the fault diagnosis code generated by the current sending end, testing whether the receiving end of the tested component can correctly receive the safety message, if so, the test passes, otherwise, reading the fault diagnosis code generated by the current receiving end and determining that the test fails; The test scenario also includes restoring power to the component under test after powering off multiple times, testing whether the sending end of the component under test can correctly send a safety message. If so, the test passes; otherwise, the fault diagnostic code generated by the current sending end is read and the test fails.

5. The testing method according to claim 1, characterized in that: The test scenario includes upgrading and flashing the FBL of the component to be tested, powering on and off again after the flashing is successful, testing whether the sending end of the component to be tested can correctly send the safety message, if so, the test passes, otherwise the fault diagnosis code generated by the current sending end is read, and testing whether the receiving end of the component to be tested can correctly receive the safety message, if so, the test passes, otherwise the fault diagnosis code generated by the current receiving end is read and the test fails; The test scenario also includes allowing the component to be tested to run continuously for a preset time, testing whether the sending end of the component to be tested can correctly send a security message. If so, the test passes, otherwise the fault diagnostic code generated by the current sending end is read and the test is determined to have failed.

6. The testing method according to claim 1, characterized in that: The test scenario includes repeatedly performing sleep and wake-up operations on the component to be tested, testing whether the sending end of the component to be tested can correctly send security messages. If so, the test passes; otherwise, the fault diagnostic code generated by the current sending end is read; and testing whether the receiving end of the component to be tested can correctly receive the security message. If so, the test passes; otherwise, the fault diagnostic code generated by the current receiving end is read and the test is determined to have failed.

7. A vehicle-mounted network security communication test system, characterized in that: The system includes: a test computer, a bus simulation and analysis device, a diagnostic instrument composed of a host computer, a communication system composed of components to be tested or a vehicle to be tested; The test computer, the diagnostic instrument, the communication system or the vehicle to be tested are respectively connected to the bus simulation and analysis equipment; The diagnostic instrument is used to obtain the communication key of the components to be tested and configure it so that the components to be tested can communicate with each other; The test computer is used to test whether the sending end of the component to be tested can correctly send the security message in different test scenarios. If the security message can be sent correctly, the test passes; If the safety message cannot be sent correctly, read the fault diagnosis code currently generated by the sending end to test whether the receiving end of the component to be tested can correctly receive the safety message. If the security message can be received correctly, the test passes; otherwise, the fault diagnostic code generated by the current receiving end is read and the test fails. The test scenario includes replaying the security message to the receiving end component through the CAN bus, reading whether the corresponding fault diagnostic code appears at the receiving end of the component to be tested, and then testing whether the receiving end can clear the fault diagnostic code after receiving the correct security message. If so, the test passes; otherwise, the fault diagnostic code generated by the current receiving end is read and the test fails; the test scenario also includes tampering with the MAC value and freshness value of the security message, replaying the tampered security message to the receiving end of the component to be tested through the CAN bus, reading whether the corresponding fault diagnostic code appears at the receiving end, and then testing whether the fault diagnostic code can be cleared after the receiving end receives the correct security message. If so, the test passes; otherwise, the fault diagnostic code generated by the current receiving end is read and the test fails.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the testing method for in-vehicle network security communication as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the method for testing in-vehicle network secure communication according to any one of claims 1 to 6.