Automobile bus automatic test system and method based on artificial intelligence

Through the automotive bus automation test system based on artificial intelligence, test code is automatically generated and executed, which solves the problems of inefficiency, error prone and insufficient flexibility in the existing technology, and achieves efficient and accurate bus testing.

CN120540977APending Publication Date: 2025-08-26FEIYIN VEHICLE NETWORKING (SUZHOU) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510600413.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

Existing automotive bus testing tools rely on users to write code manually, resulting in inefficiency, error-prone and insufficient flexibility, making it difficult to quickly adapt to new testing needs.

Method used

The automotive bus automation test system based on artificial intelligence is adopted, including user interaction module, artificial intelligence proxy module, code generation module and python engine module, to automatically generate and execute test codes, and use the API in the communication box SDK module to perform bus testing.

Benefits of technology

It significantly improves testing efficiency and accuracy, reduces testing costs, enhances testing flexibility, and avoids the cumbersome and error-proneness of manually writing code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120540977A_ABST
    Figure CN120540977A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic automobile bus test system and method based on artificial intelligence, the system comprises an upper computer and a communication box SDK module, the upper computer comprises a user interaction module, an artificial intelligence agent module, a code generation module and a python engine module, and an API is stored in the communication box SDK module; the user interaction module is used for acquiring a test requirement and a test result; the artificial intelligence agent module is used for generating a test code; the code generation module is used for generating a specific bus test code; the python engine module calls an API in the communication box SDK module by running a bus test code to carry out automobile bus test and feeds back a test result to the user interaction module, and automatic generation and execution of the test code are realized by introducing an artificial intelligence technology. The tool can significantly improve the test efficiency and accuracy, reduce the test cost and enhance the test flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automobile bus automatic testing, and in particular to an automobile bus automatic testing system and method based on artificial intelligence. Background Art

[0002] In automotive electronics systems, buses (such as CAN, LIN, and FlexRay) are the core of communication between electronic control units (ECUs). To ensure the reliability and stability of bus communication, comprehensive bus testing is required. Currently, automotive bus testing tools (such as Vector's CANoe) primarily rely on users to manually write test code, which presents the following issues:

[0003] 1. Inefficiency: Users need to have high programming skills, and manually writing test code takes a long time.

[0004] 2. Error-prone: Manually writing code can easily introduce errors, affecting the accuracy of test results.

[0005] 3. Lack of flexibility: The modification and expansion of test code is relatively complex, and it is difficult to quickly adapt to new testing requirements.

[0006] In order to solve the above problems, the present invention proposes an artificial intelligence-based automotive bus automation testing tool and method. By introducing artificial intelligence technology (such as DeepSeek), the automatic generation and execution of test code is realized, thereby improving test efficiency and accuracy. Summary of the Invention

[0007] The technical problem solved by the present invention is to provide an artificial intelligence-based automobile bus automatic testing system that can automatically generate test codes.

[0008] The technical solution adopted by the present invention to solve the technical problem is: an artificial intelligence-based automobile bus automatic testing system, including a host computer and a communication box SDK module, the host computer including a user interaction module, an artificial intelligence agent module, a code generation module and a Python engine module, and the communication box SDK module storing an API;

[0009] The user interaction module is used to obtain test requirements and test results;

[0010] The artificial intelligence agent module is used to generate test code based on artificial intelligence technology;

[0011] The code generation module is used to generate test code and API in the communication box SDK module based on artificial intelligence technology to generate specific bus test code;

[0012] The Python engine module calls the API in the communication box SDK module by running the bus test code to perform vehicle bus testing and feeds back the test results to the user interaction module.

[0013] Furthermore, the communication box SDK module includes a hardware interface for communicating with the vehicle bus and an SDK module, and the SDK module includes an API for performing bus testing.

[0014] The present invention also discloses an automatic testing method for an automobile bus based on artificial intelligence, comprising the following steps:

[0015] S100: Obtain test requirements;

[0016] S200: Analyze requirements through AI agents and generate test code through AI;

[0017] S300: Generates bus test code through AI-generated test code and the API in the communication box SDK module;

[0018] S400: Connect the generated bus test code to the communication box SDK module;

[0019] S500: Return the generated bus test code to the user;

[0020] S600: Execute the bus test code and control the communication box SDK module to complete the test;

[0021] S700: Feedback the test result to the user.

[0022] Furthermore, in step S200, the requirements are parsed by an artificial intelligence agent, and test code is generated by artificial intelligence, specifically:

[0023] S201: Use specific contexts to define the boundaries of artificial intelligence;

[0024] S202: Send user demand questions;

[0025] S203: Artificial intelligence generates test code based on compilation limitations and user requirements.

[0026] Furthermore, in step S300, the test code is generated by using the test code generated by artificial intelligence and the API in the communication box SDK module, specifically:

[0027] S301: Receive test code generated by artificial intelligence;

[0028] S302: Integrate the generated test code with the communication box SDK module;

[0029] S303: Precompile the test code. If the compilation fails, feedback is given to the artificial intelligence to regenerate the test code. After the test code is regenerated, the process proceeds to step S301. If the test code compilation succeeds, the process proceeds to step S304.

[0030] S304: Perform a trial run of the precompiled code. If the trial run is unsuccessful, feedback is given to the artificial intelligence to regenerate the code. After the code is regenerated, step S301 is entered. If the trial run is successful, step S500 is entered.

[0031] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned artificial intelligence-based automobile bus automatic testing method are implemented.

[0032] The present invention also discloses a computer device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; wherein:

[0033] The memory is used to store computer programs;

[0034] The processor is used to execute the steps of the above-mentioned artificial intelligence-based automobile bus automatic testing method by running the program stored in the memory.

[0035] The beneficial effects of the present invention are:

[0036] 1. This invention uses artificial intelligence technology to automatically generate and execute test code. The tool includes a user interaction module, an artificial intelligence module, a code generation module, a communication box module, and a Python engine. It can significantly improve test efficiency and accuracy, reduce test costs, and enhance test flexibility.

[0037] 2. Through the artificial intelligence agent module, the system can intelligently analyze test requirements and automatically generate test code, avoiding the tediousness and error-proneness of manual code writing. At the same time, the code generation module can quickly generate specific test code based on the generated test code and the API in the communication box SDK module, further improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a schematic diagram of the framework of an artificial intelligence-based automotive bus automation test system according to an embodiment of the present application.

[0039] Figure 2 This is a flow chart of an automated vehicle bus testing method based on artificial intelligence according to an embodiment of the present application.

[0040] Figure 3 Schematic diagram of the process of step S300 in the automatic testing method of an automobile bus based on artificial intelligence according to an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0042] like Figure 1 As shown, the embodiment of the present application discloses an artificial intelligence-based automotive bus automated testing system, including a host computer and a communication box SDK module, wherein the host computer includes a user interaction module, an artificial intelligence agent module, a code generation module and a Python engine module, and the communication box SDK module stores an API;

[0043] The user interaction module is used to obtain test requirements and test results;

[0044] The artificial intelligence agent module is used to generate test code based on artificial intelligence technology;

[0045] The code generation module is used to generate test code and API in the communication box SDK module based on artificial intelligence technology to generate specific bus test code;

[0046] The Python engine module calls the API in the communication box SDK module by running the bus test code to perform vehicle bus testing and feeds back the test results to the user interaction module.

[0047] It should be explained that an SDK (Software Development Kit) is a set of development tools that helps developers quickly build applications for specific platforms, hardware, or services. It typically includes APIs, documentation, sample code, debugging tools, library files, etc.

[0048] An API (Application Programming Interface) is a set of predefined rules and protocols that allow different software systems to interact with each other. It defines how to request data, send instructions, and receive responses.

[0049] The communication box SDK can be used to control hardware, and its API is the interface for specific control instructions.

[0050] During specific use, the user enters the test requirements in the user interaction module, such as "test whether the ECU can correctly respond to CAN messages within 100ms". After the artificial intelligence agent module parses the requirements, it generates test code by using artificial intelligence. After the code generation module generates specific executable bus test code, it feeds the code back to the user. The user uses the test code to execute the test through the Python engine module.

[0051] This invention uses artificial intelligence technology to automatically generate and execute test code. The tool, which includes a user interaction module, an artificial intelligence module, a code generation module, a communication box module, and a Python engine, significantly improves test efficiency and accuracy, reduces testing costs, and enhances test flexibility.

[0052] In this embodiment, the artificial intelligence technology is DeepSeek, and may also be other artificial intelligences, such as: OpenAI series, Meta, iFlytek Spark, 360 Brain, ChatGPT, etc.

[0053] In this embodiment, the communication box SDK module includes a hardware interface for communicating with the vehicle bus and an SDK, and the SDK includes an API for performing bus testing.

[0054] Specifically, the hardware interface can be, but is not limited to, a USB interface, Ethernet interface, or serial port, used to enable data communication between the host computer and the communication box. The API in the SDK provides operation functions for the hardware interface, which are used to implement specific bus testing functions, such as sending test data, receiving response data, and parsing data.

[0055] In actual applications, users can input corresponding test parameters and conditions through the user interaction module according to specific test requirements. The artificial intelligence agent module will then use DeepSeek or other artificial intelligence technologies to intelligently analyze the test requirements and generate the corresponding test code based on the input test requirements.

[0056] The present invention also discloses an automatic testing method for an automobile bus based on artificial intelligence, comprising the following steps:

[0057] S100: Obtain test requirements;

[0058] S200: Analyze requirements through AI agents and generate test code through AI;

[0059] S300: Generates bus test code through AI-generated test code and the API in the communication box SDK module;

[0060] S400: Connect the generated bus test code to the communication box SDK module;

[0061] S500: Return the generated bus test code to the user;

[0062] S600: Execute the code to control the communication box SDK module to complete the test;

[0063] S700: Feedback the test result to the user.

[0064] In practice, the user enters a test requirement, such as "test whether the ECU can correctly respond to CAN messages within 100ms." The AI ​​agent module then interprets this requirement and generates test code based on DeepSeek or other AI technologies. This generated test code is then integrated with the Communication Box SDK module and returned to the user, who then uses it to perform specific bus testing functions.

[0065] The present invention introduces artificial intelligence technology to achieve automatic generation and execution of test codes, thereby significantly improving test efficiency and accuracy, reducing test costs, and enhancing test flexibility.

[0066] In this embodiment, in step S200, the requirements are parsed by an artificial intelligence agent, and the test code is generated by artificial intelligence, specifically:

[0067] S201: Use specific contexts to define the boundaries of artificial intelligence;

[0068] S202: Send user demand questions;

[0069] S203: Artificial intelligence generates test code based on compilation limitations and user requirements.

[0070] Specifically, the following is one embodiment:

[0071] Suppose the user asks the following question:

[0072] Use Python to write an automated test script to send 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 data frames on a physical bus with a baud rate of 512k and port number 1, with a period of 100ms.

[0073] Before the user asks a question, the AI ​​agent enters the following into DeepSeek to define its boundaries:

[0074] I've developed a CAN bus driver SDK, which includes three specific APIs: Can_Init(baurate, portNumber), Can_Write(buffer, size), and Can_Read(buffer, size). These APIs have been packaged into a Python library called can.py. Can I write various Python-based automated test scripts based on the SDK's interface definitions? The answer is yes and no.

[0075] Deepseek's feedback on the preset restrictions is:

[0076] Can.

[0077] The AI ​​agent will input the following into DeepSeek:

[0078] Use Python to write an automated test script to send 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 data frames on a physical bus with a baud rate of 512k and port number 1, with a period of 100ms.

[0079] Deepseek's feedback on user needs (i.e. test code):

[0080] The following is a Python automated test script based on the CAN bus driver SDK you provided, which is used to periodically send data frames on port 1 at a baud rate of 512k:

[0081]

[0082]

[0083] illustrate:

[0084] 1. The script uses three APIs from your can.py library:

[0085] οCan_Init() initializes the CAN interface

[0086] οCan_Write() sends data frame

[0087] ο No receiving function is required so Can_Read() is not used

[0088] 2. Key parameters:

[0089] οBaud rate is set to 512000 (512k)

[0090] οThe port number is set to 1

[0091] οThe sending cycle is strictly maintained at 100ms

[0092] οSend data is 8 bytes 0x1

[0093] 3. Operation mode:

[0094] ο Press Ctrl+C to stop the test safely

[0095] οThe sent data will be printed every time it is sent

[0096] 4. Notes:

[0097] ο Make sure your CAN hardware is connected correctly

[0098] ο Ensure that the baud rate configuration matches that of other nodes on the bus

[0099] If the CAN driver requires special handling, the exception handling section may need to be adjusted. Please let me know if any adjustments or additional test functions are required.

[0100] From DeepSeekV3

[0101] The setting of the above-mentioned artificial intelligence agent method can parse the test requirements input by the user, and automatically generate test code that can be connected to the communication box SDK module through artificial intelligence, thereby greatly improving the efficiency and accuracy of test code generation.

[0102] In this embodiment, in step S300, the test code is generated by using the test code generated by artificial intelligence and the API in the communication box SDK module, specifically:

[0103] S301: Receive test code generated by artificial intelligence;

[0104] S302: Integrate the generated test code with the communication box SDK module;

[0105] S303: Precompile the test code. If the compilation fails, feedback is given to the artificial intelligence to regenerate the test code. After the test code is regenerated, the process proceeds to step S301. If the test code compilation succeeds, the process proceeds to step S304.

[0106] S304: Perform a trial run of the precompiled code. If the trial run is unsuccessful, feedback is given to the artificial intelligence to regenerate the code. After the test code is regenerated, step S301 is entered. If the trial run is successful, step S500 is entered.

[0107] Specifically, after receiving the AI-generated test code, it is integrated with the communication box SDK module. This integration process typically involves matching function calls in the test code with APIs in the SDK to ensure that the test code can correctly call the hardware interface to complete the test task. After integration is complete, the system precompiles the generated test code. The purpose of precompiling is to check the code for syntax errors and logic problems to ensure that the code can be effectively corrected before actual execution. If the precompile fails, the system will feedback an error message to the AI ​​agent, requesting the regeneration of the test code. This process is repeated iteratively until the generated test code passes precompilation. Once the test code successfully passes precompilation, the system will perform a test run on the precompiled code. The test run aims to verify the code's performance in the actual operating environment and ensure that it can complete the test task as expected. If the test run fails, an error message will also be fed back to the AI ​​agent, requesting the regeneration of the test code. This process is also repeated iteratively until the generated test code passes the test run. If the test code successfully passes precompilation and the test run, it is deemed valid and returned to the user. Users can use this test code to execute specific bus test functions through the Python engine module to verify the performance and reliability of the vehicle bus.

[0108] In summary, the present invention, by introducing artificial intelligence technology, realizes the automatic generation and execution of test code. This automated testing method can significantly improve test efficiency and accuracy, reduce test costs, and enhance test flexibility.

[0109] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned artificial intelligence-based automobile bus automatic testing method are implemented.

[0110] The present invention also discloses a computer device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; wherein:

[0111] The memory is used to store computer programs;

[0112] The processor is used to execute the steps of the above-mentioned artificial intelligence-based automobile bus automatic testing method by running the program stored in the memory.

[0113] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An artificial intelligence-based automobile bus automated testing system, characterized in that: It includes a host computer and a communication box SDK module. The host computer includes a user interaction module, an artificial intelligence agent module, a code generation module and a python engine module. The communication box SDK module stores an API. The user interaction module is used to obtain test requirements and test results; The artificial intelligence agent module is used to generate test code based on artificial intelligence technology; The code generation module is used to generate test code and API in the communication box SDK module based on artificial intelligence technology to generate specific bus test code; The Python engine module calls the API in the communication box SDK module by running the bus test code to perform vehicle bus testing and feeds back the test results to the user interaction module.

2. The artificial intelligence-based automobile bus automation test system according to claim 1, characterized in that: The communication box SDK module includes a hardware interface for communicating with the vehicle bus and an SDK module, and the SDK module includes an API for performing bus testing.

3. The vehicle bus automation testing method based on artificial intelligence is characterized by: The steps include: S100: Obtain test requirements; S200: Analyze requirements through AI agents and generate test code through AI; S300: Generates bus test code through AI-generated test code and the API in the communication box SDK module; S400: Connect the generated bus test code to the communication box SDK module; S500: Return the generated bus test code to the user; S600: Execute the bus test code and control the communication box SDK module to complete the test; S700: Feedback the test result to the user.

4. The method for automated testing of an automobile bus based on artificial intelligence according to claim 3, wherein: In step S200, the requirements are parsed by an artificial intelligence agent, and the artificial intelligence generates a logical framework of the test code, specifically: S201: Use specific contexts to define the boundaries of artificial intelligence; S202: Send user demand questions; S203: Artificial intelligence generates test code based on compilation limitations and user requirements.

5. The method for automated testing of automobile buses based on artificial intelligence according to claim 3, wherein: In step S300, the test code is generated by using the test code generated by artificial intelligence and the API in the communication box SDK module, specifically: S301: Receive test code generated by artificial intelligence; S302: Integrate the generated test code with the communication box SDK module; S303: Precompile the test code. If the compilation fails, feedback is given to the artificial intelligence to regenerate the test code. After the test code is regenerated, the process proceeds to step S301. If the test code compilation succeeds, the process proceeds to step S304. S304: Perform a trial run of the precompiled code. If the trial run is unsuccessful, feedback is given to the artificial intelligence to regenerate the test code. After the test code is regenerated, step S301 is entered. If the trial run is successful, step S500 is entered.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the automobile bus automatic testing method based on artificial intelligence according to any one of claims 3 to 5.

7. A computer device, characterized in that: The system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: The memory is used to store computer programs; The processor is configured to execute the steps of the automobile bus automation testing method based on artificial intelligence according to any one of claims 3 to 5 by running the program stored in the memory.

Citation Information

Patent Citations

  • Automobile HIL test method and system, electronic equipment and storage medium

    CN115562220A

  • Autosar CP virtualization system and test method

    CN118295903A

  • Automatic integration test method based on CAN communication interface implantation simulation

    CN118672926A

  • Systems and methods for generative ai behaviour-driven development

    US20240411673A1