Vehicle networking bus communication network testing method and system
By configuring the CAN bus protocol template for the fuzzy test components, automatically generating test instances and sending them to the bus network, the problem of testers in the existing technology that need to manually grab data packets is solved, and high-quality and full-coverage test results are achieved.
Patent Information
- Application Number
- CN202211016346.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-23
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2042-08-23
AI Technical Summary
The existing fuzz testing components have fewer tools for testing CAN bus protocols, and cannot achieve full-process automated testing. Testers need to master the protocol rules and manually grab data packets, resulting in low quality and limited coverage of test instances.
Provide a test method for Internet of Vehicles bus communication network. By configuring a protocol template based on CAN bus protocol for fuzzy testing components, random data and mutation logic that complies with protocol rules, automatically generate test instances, and send them to the bus network through a packetizer for Test.
The technical requirements of testers are reduced, and the generated test instances can completely cover the bus network, improve the test quality and efficiency, and avoid human errors.
Smart Images

Figure CN115550228B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of CAN bus testing, and in particular to a vehicle networking bus communication network testing method and system based on fuzzy testing. Background Art
[0002] With the continuous advancement of information and intelligent technology, modern vehicles contain more software and provide more functions, including social functions through the Internet of Vehicles. Cars generally enter the Internet of Vehicles through a bus network based on the CAN bus protocol to interact with other vehicles. For bus networks, there will inevitably be vulnerabilities, and there have been frequent information security incidents targeting cars recently. Therefore, it is imperative to find and fix security vulnerabilities before vehicles are put on the market.
[0003] In the field of network testing, technicians often use fuzz testing components to detect network vulnerabilities. However, for existing fuzz testing components, there are relatively few test tools for testing the CAN bus protocol, and it is not possible to achieve full automated testing. Specifically, testers need to master the relevant protocol rules, capture normal data packets from the CAN bus communication process, and analyze and extract data processing logic based on the captured normal data packets, and then generate test instances based on the data processing logic. In this way, the requirements for the testers themselves are relatively high, and it is easy to obtain erroneous data, resulting in low quality of generated test instances. In addition, by capturing normal data packets for fuzz testing, the coverage of the generated test instances is limited, and the protocol cannot be fully covered. Summary of the invention
[0004] The object of the present invention is to provide a method and system for testing a vehicle networking bus communication network that effectively reduces the difficulty of testing technology and improves test quality and test efficiency.
[0005] In order to achieve the above object, the present invention discloses a vehicle networking bus communication network testing method, which includes:
[0006] A fuzz test component is provided, and several protocol templates are configured for the fuzz test component, wherein the several protocol templates are respectively created based on different CAN bus protocols, and any of the protocol templates is provided with data processing logic and mutation logic that conform to one of the CAN bus protocol rules, wherein the data processing logic is used to process random data into a data format that conforms to the CAN bus protocol to which the protocol template belongs; and the mutation logic is used to perform random mutation on a target mutation field;
[0007] Providing a packet transmitter based on the CAN bus protocol, and configuring parameters of the packet transmitter so that the packet transmitter is compatible with the bus network;
[0008] Selecting the currently enabled protocol template for the fuzzy test component according to the protocol type of the bus network of the vehicle to be tested, so as to output a test instance, and transmitting the test instance to the packet sender;
[0009] The test instance is sent to the bus network to be tested through the packet sender, and the test result is determined according to the feedback of the bus network.
[0010] Preferably, the CAN bus protocol includes any one of the CAN protocol, the CANFD protocol and the CANOpen protocol.
[0011] Preferably, the test results are monitored in real time via a monitor connected to the bus network of the vehicle to be tested.
[0012] Preferably, the packet sender comes from a CAN bus analyzer.
[0013] The present invention also discloses a vehicle networking bus communication network testing system, which comprises:
[0014] A fuzz testing component, which includes a data generation module, several protocol templates and a selection module;
[0015] The data generation module is used to generate random data;
[0016] A plurality of protocol templates are created based on different CAN bus protocol rules respectively, wherein the protocol templates are provided with a data processing module and a mutation module;
[0017] The data processing module is used to process the random data generated by the data generation module into a data format that conforms to the CAN bus protocol to which the protocol template belongs;
[0018] The mutation module is used to perform random mutation on the target mutation field;
[0019] The selection module is used to select one from a plurality of the protocol templates to process the test data to obtain a test instance;
[0020] A packet transmitter is constructed based on the CAN bus protocol, wherein the input end of the packet transmitter is connected to the fuzzy test component, and the output end of the packet transmitter is connected to the bus network to be tested, so as to transmit the test instance to the bus network.
[0021] Preferably, the CAN bus protocol includes any one of the CAN protocol, the CANFD protocol and the CANOpen protocol.
[0022] Preferably, the system further comprises a monitor connected to the bus network to be tested, wherein the monitor is used to monitor the test result.
[0023] Preferably, the packet sender comes from a CAN bus analyzer.
[0024] The present invention also discloses another vehicle networking bus communication network testing system, which includes:
[0025] one or more processors;
[0026] Memory;
[0027] And one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include instructions for executing the vehicle networking bus communication network testing method as described above.
[0028] The present invention also discloses a computer-readable storage medium, which includes a computer program, and the computer program can be executed by a processor to complete the vehicle networking bus communication network testing method as described above.
[0029] Compared with the prior art, the above technical scheme of the present invention pre-configures a number of protocol templates for the fuzzy test component. When the bus network of the vehicle is to be tested for vulnerabilities, there is no need to capture normal data packets in the bus network and analyze and extract CAN bus protocol rules. It is only necessary to select a protocol template that is compatible with the CAN bus protocol of the bus network, and then start the fuzzy test component. The fuzzy test component processes random data into a test instance that matches the bus network to be tested by calling the protocol template, and sends the test instance to the bus network through the packet sender. It can be seen that through the above technical scheme, technicians only need to select a protocol template to automatically generate a test instance, without the need to capture and analyze normal data packets, which greatly reduces the technical requirements for testers. In addition, the generated test instances can completely cover all aspects of the bus network to be tested, thereby achieving the purpose of comprehensive testing, and the generated test instances are of high quality and will not have human errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 The figure is a flow chart of the testing method in the embodiment of the present invention.
[0031] Figure 2 1 is a structural diagram of a test system in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to explain the technical content, structural features, achieved objectives and effects of the present invention in detail, the following is a detailed description in conjunction with the implementation methods and the accompanying drawings.
[0033] This embodiment discloses a method for testing a vehicle network bus communication network to detect whether there are loopholes in the bus network of the vehicle and the vehicle network communication. The testing method in this embodiment is based on fuzzy testing components for detection. Specifically, Figure 1 and Figure 2 , the test method comprises the following steps:
[0034] S1: Provide a fuzz test component, and configure several protocol templates for the fuzz test component, wherein the several protocol templates are created based on different CAN bus protocols respectively, and any of the protocol templates is provided with data processing logic and mutation logic that conform to one of the CAN bus protocol rules, wherein the data processing logic is used to process random data into a data format that conforms to the CAN bus protocol to which the protocol template belongs; and the mutation logic is used to perform random mutation on a target mutation field.
[0035] S2: Provide a packet transmitter based on the CAN bus protocol, and configure the parameters of the packet transmitter so that the packet transmitter is compatible with the bus network. Specifically, configure the baud rate, iteration interval and communication port of the packet transmitter so that the packet transmitter can communicate with the bus network in an orderly manner.
[0036] S3: Selecting the currently enabled protocol template for the fuzzy test component according to the protocol type of the bus network of the vehicle to be tested, so as to output a test instance.
[0037] S4: Transmit the test instance to the packet sender.
[0038] S5: Input the test instance into the bus network to be tested through the packet transmitter, and determine the test result according to the feedback of the bus network.
[0039] Specifically, the CAN bus protocol includes any one of the CAN protocol, the CANFD protocol and the CANOpen protocol. Therefore, in this embodiment, three protocol templates are configured for the fuzzy test component, namely, template 1 constructed based on the CAN protocol rules, template 2 constructed based on the CANFD protocol rules and template 3 constructed based on the CANOpen protocol rules. It should also be noted that, in this embodiment, the fuzzy test component has a fuzzy data generation system well known to those skilled in the art, but this fuzzy data generation system is only configured with an http protocol template and cannot generate a test instance compatible with the CAN bus protocol. Therefore, by configuring the fuzzy test component with a protocol template created based on the CAN bus protocol, the test case output by the fuzzy test component matches the bus network with the CAN bus protocol.
[0040] For the test method with the above structure, several protocol templates are pre-configured for the fuzzy test component. When the bus network of the vehicle is to be tested for vulnerabilities, there is no need to capture normal data packets in the bus network and analyze and extract CAN bus protocol rules. It is only necessary to select a protocol template that is compatible with the CAN bus protocol of the bus network, and then start the fuzzy test component. The fuzzy test component processes random data into test instances that match the bus network to be tested by calling the protocol template, and sends the test instances to the bus network through the packet sender. In this way, the technician only needs to select the protocol template to automatically generate the test instance, and there is no need to capture and analyze the normal data packets, which greatly reduces the technical requirements for the tester. In addition, the generated test instances can completely cover all aspects of the bus network to be tested, thereby achieving the purpose of comprehensive testing, and the generated test instances are of high quality and will not have human errors.
[0041] Furthermore, the test results are monitored in real time through a monitor connected to the bus network of the vehicle to be tested.
[0042] Furthermore, the packet sender comes from a CAN bus analyzer, through which the fuzz test component and the target bus network are connected.
[0043] In another preferred embodiment of the present invention, a vehicle networking bus communication network testing system is also disclosed. Figure 2 , which includes a fuzzy test component and a packet sender. The fuzzy test component includes a data generation module, several protocol templates and a selection module.
[0044] The data generation module is used to generate random data.
[0045] A plurality of protocol templates are created based on different CAN bus protocol rules respectively, wherein the protocol templates are provided with a data processing module and a mutation module.
[0046] The data processing module is used to process the random data generated by the data generation module into a data format that complies with the CAN bus protocol to which the protocol template belongs.
[0047] The mutation module is used to perform random mutation on the target mutation field.
[0048] The selection module is used to select one from several protocol templates to process the test data to obtain a test instance.
[0049] A packet transmitter is constructed based on the CAN bus protocol, wherein the input end of the packet transmitter is connected to the fuzzy test component, and the output end of the packet transmitter is connected to the bus network to be tested, so as to transmit the test instance to the bus network.
[0050] The CAN bus protocol includes any one of the CAN protocol, the CANFD protocol and the CANOpen protocol.
[0051] Optionally, the test system further comprises a monitor connected to the bus network to be tested, wherein the monitor is used to monitor the test result.
[0052] Optionally, the packet sender comes from a CAN bus analyzer.
[0053] It should also be noted that the working principle of the test system in this embodiment is detailed in the above-mentioned test method embodiment and will not be repeated here.
[0054] The present invention also discloses another vehicle networking bus communication network test system, which includes one or more processors, a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the program includes instructions for executing the vehicle networking bus communication network test method as above. The processor can adopt a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs to implement the functions required to be performed by the module in the vehicle networking bus communication network test system of the embodiment of the present application, or to execute the vehicle networking bus communication network test method of the method embodiment of the present application.
[0055] The present invention also discloses a computer-readable storage medium, which includes a computer program, and the computer program can be executed by a processor to complete the above vehicle networking bus communication network test method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a read-only memory (ROM), or a random access memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a tape, a magnetic disk, or an optical medium, such as a digital versatile disc (DVD), or a semiconductor medium, such as a solid state disk (SSD), etc.
[0056] The embodiment of the present application also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of an electronic device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device executes the above-mentioned vehicle networking bus communication network testing method.
[0057] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention are still within the scope covered by the present invention.
Claims
1. A vehicle networking bus communication network testing method, characterized in that: include: A fuzz test component is provided, and several protocol templates are configured for the fuzz test component, wherein the several protocol templates are respectively created based on different CAN bus protocols, and any of the protocol templates is provided with data processing logic and mutation logic that conform to one of the CAN bus protocol rules, wherein the data processing logic is used to process random data into a data format that conforms to the CAN bus protocol to which the protocol template belongs; and the mutation logic is used to perform random mutation on a target mutation field; Providing a packet transmitter based on the CAN bus protocol, and configuring parameters of the packet transmitter so that the packet transmitter is compatible with the bus communication network; Selecting the currently enabled protocol template for the fuzzy test component according to the protocol type of the bus network of the vehicle to be tested, so as to output a test instance, and transmitting the test instance to the packet sender; The test instance is sent to the bus network to be tested through the packet sender, and the test result is determined according to the feedback of the bus network; the test result is monitored in real time through a monitor connected to the bus network of the vehicle to be tested; The packet sender comes from a CAN bus analyzer.
2. The vehicle networking bus communication network testing method according to claim 1, characterized in that: The CAN bus protocol includes any one of the CAN protocol, the CANFD protocol and the CANOpen protocol.
3. A vehicle networking bus communication network testing system, characterized in that: include: A fuzz testing component, which includes a data generation module, several protocol templates and a selection module; The data generation module is used to generate random data; A plurality of protocol templates are created based on different CAN bus protocol rules respectively, wherein the protocol templates are provided with a data processing module and a mutation module; The data processing module is used to process the random data generated by the data generation module into a data format that conforms to the CAN bus protocol to which the protocol template belongs; The mutation module is used to perform random mutation on the target mutation field; The selection module is used to select one from a plurality of the protocol templates to process the random data to obtain a test instance; A packet transmitter, which is constructed based on the CAN bus protocol, wherein the input end of the packet transmitter is connected to the fuzzy test component, and the output end of the packet transmitter is connected to the bus network to be tested, and is used to transmit the test instance to the bus network; and further comprises a monitor connected to the bus network to be tested, and the monitor is used to monitor the test results; The packet sender comes from a CAN bus analyzer.
4. The vehicle networking bus communication network test system according to claim 3, characterized in that: The CAN bus protocol includes any one of the CAN protocol, the CANFD protocol and the CANOpen protocol.
5. A vehicle networking bus communication network testing system, characterized in that: include: one or more processors; Memory; And one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include instructions for executing the vehicle networking bus communication network testing method as described in any one of claims 1 to 2.
6. A computer-readable storage medium, characterized in that: It includes a computer program, which can be executed by a processor to complete the vehicle networking bus communication network testing method as described in any one of claims 1 to 2.
