Generation method and device of automobile gateway test project, equipment and storage medium

By generating automated test projects, the problems of test omissions and time-consuming in gateway testing are solved, and an efficient and reliable testing process is achieved.

CN120110971APending Publication Date: 2025-06-06DONGFENG MOTOR GRP
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510208126.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The prior art has problems such as testing omissions, time-consuming and error-prone in gateway testing, especially when gateway functions are updated, the test script needs to be rewrite and adjust.

Method used

By obtaining the gateway function requirements template documents, generating the function calls in the gateway function test function library files, and testing environment configurations, these elements are integrated into the entrance file of the automated test main program, and finally forming a complete test project.

Benefits of technology

The generation of automated test projects is realized, avoiding test omissions, improving testing efficiency, and ensuring the reliability and effectiveness of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120110971A_ABST
    Figure CN120110971A_ABST
Patent Text Reader

Abstract

The invention discloses a generation method, device and equipment of an automobile gateway test project and a storage medium, and relates to the technical field of automatic testing of vehicle-mounted electronic controllers, and the generation method of the automobile gateway test project comprises the steps: obtaining a gateway function demand template document; according to the gateway function requirement template document, function calling and test environment configuration in an automobile bus communication matrix file and a gateway function test function library file are generated; integrating the function calls to form an entry file of an automatic test main program; and forming a test project according to the automobile bus communication matrix file, the entry file and the test environment configuration. According to the method and the device, an automatic test project can be generated, the test project can simulate an actual vehicle communication scene and verify whether the gateway can correctly process and forward the message according to a predetermined function requirement, so that test omission is avoided, the test efficiency is improved, and the reliability and the effectiveness of a test result are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of automated testing of vehicle-mounted electronic controllers, and in particular to a method, device, equipment and storage medium for generating a vehicle gateway test project. Background Art

[0002] As the complexity of automotive electronic systems increases, cross-domain communications between vehicle electronic controllers are becoming more frequent, and most of these communications rely on automotive gateways. The gateway is responsible for correctly forwarding information from one domain to another, such as forwarding vehicle speed information from the power domain to the cockpit domain. Therefore, ensuring that the gateway can handle these communications accurately and without error is critical to the safety and functionality of the vehicle. This creates a need for effective testing of the gateway to verify its communication and forwarding functions under various conditions.

[0003] At present, the traditional test method of the gateway includes manually sending simulated messages to a certain domain of the gateway through the host computer software according to the routing function requirements, and then manually observing whether the gateway forwards the information to another domain normally. In addition, it is also possible to automatically send simulated messages by writing test projects and automatically detect whether the messages are forwarded correctly. These test methods can be completely manual or semi-automatic, assisted by software scripts.

[0004] Although existing manual and automated testing methods can verify the functions of the gateway to a certain extent, they have obvious limitations. As the requirements for gateway functions are constantly updated and increased, these methods are prone to test omissions, and for non-professional engineers, it takes a long time to train to master testing skills. In addition, each gateway function update requires rewriting and adjusting the test script, which is not only time-consuming but also prone to errors. Therefore, how to generate automated test projects to avoid test omissions and improve test efficiency has become an urgent problem to be solved.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The purpose of this application is to provide a method, device, equipment and storage medium for generating an automotive gateway test project, aiming to solve the technical problem of how to generate an automated test project to avoid test omissions and improve test efficiency.

[0007] To achieve the above objectives, the present application proposes a method for generating an automotive gateway test project, the method comprising:

[0008] Get the gateway functional requirements template document;

[0009] Generate a vehicle bus communication matrix file, function calls in a gateway function test function library file, and a test environment configuration according to the gateway function requirement template document;

[0010] Integrate the function calls to form an entry file of the automated test main program;

[0011] A test project is formed according to the vehicle bus communication matrix file, the entry file and the test environment configuration.

[0012] In one embodiment, the step of generating a vehicle bus communication matrix file, a function call in a gateway function test function library file, and a test environment configuration according to the gateway function requirement template document comprises:

[0013] Generate a vehicle bus communication matrix file according to the attribute information of the message and the signal in the gateway functional requirement document;

[0014] Determine a target library function according to the forwarding relationship of the message or signal in the gateway functional requirement document and the parameters corresponding to the forwarding relationship;

[0015] Generate a function call in a gateway function test function library file according to the target library function;

[0016] Generate the test environment configuration required for the automated testing project based on the gateway functional requirements document.

[0017] In one embodiment, the step of generating the test environment configuration required for the automated test project according to the gateway functional requirement document includes:

[0018] Obtaining a mapping relationship between a hardware controller area network channel and a logic controller area network channel and underlying information of the hardware controller area network channel according to the gateway functional requirement document;

[0019] The test environment configuration required for the automated test project is generated according to the mapping relationship and the underlying information.

[0020] In one embodiment, the step of obtaining the mapping relationship between the hardware controller area network channel and the logic controller area network channel and the underlying information of the hardware controller area network channel according to the gateway functional requirement document includes:

[0021] Determine the hardware controller local area network channel according to the hardware device configuration and channel identification in the gateway functional requirement document;

[0022] Determine the logical controller local area network channel according to the protocol stack and communication protocol in the gateway functional requirement document;

[0023] Determine a mapping relationship between the hardware controller LAN channel and the logic controller LAN channel according to the network topology, function description and message forwarding rules in the gateway function requirement document;

[0024] The underlying information of the hardware controller local area network channel is obtained according to the hardware device configuration and physical parameters in the gateway functional requirement document.

[0025] In one embodiment, the step of obtaining a gateway function requirement template document includes:

[0026] Obtain the attribute information and forwarding relationship of the messages and signals exchanged between the various electronic controllers of the vehicle;

[0027] Packing and combining the vehicle controller signal according to the attribute information to obtain a vehicle controller message;

[0028] A gateway function requirement template document is established according to the attribute information, the vehicle controller signal, the vehicle controller message and the forwarding relationship.

[0029] In one embodiment, after the step of forming a test project according to the vehicle bus communication matrix file, the entry file and the test environment configuration, the step further includes:

[0030] Deploy the test project on a hardware-in-the-loop simulation bench, wherein the hardware-in-the-loop simulation bench is connected to the electronic control unit under test via a vehicle bus communication board;

[0031] The electronic control unit under test is tested by the hardware-in-the-loop simulation bench to obtain a functional test report.

[0032] In one embodiment, the step of testing the electronic control unit under test by the hardware-in-the-loop simulation bench to obtain a functional test report includes:

[0033] When the electronic control unit under test is a gateway, generating a simulation message according to the automobile bus communication matrix file in the test project;

[0034] Sending the simulation message to the gateway on the controller area network bus through the hardware-in-the-loop simulation bench, so that the gateway forwards the simulation message;

[0035] Obtaining the simulated message forwarded by the gateway through the hardware-in-the-loop simulation bench monitoring;

[0036] The message identifier and data integrity of the simulated message are verified to obtain a functional test report of the gateway.

[0037] In addition, to achieve the above purpose, the present application also proposes a device for generating a vehicle gateway test project, the device comprising:

[0038] Functional requirement acquisition module, used to obtain gateway functional requirement template document;

[0039] A test configuration module, used to generate a vehicle bus communication matrix file, function calls in a gateway function test function library file, and a test environment configuration according to the gateway function requirement template document;

[0040] An entry file forming module, used for integrating the function calls to form an entry file of the automated test main program;

[0041] The project generation module is used to form a test project according to the vehicle bus communication matrix file, the entry file and the test environment configuration.

[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for generating an automobile gateway test project, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the method for generating an automobile gateway test project as described above.

[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for generating a vehicle gateway test project as described above are implemented.

[0044] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method for generating a vehicle gateway test project as described above.

[0045] One or more technical solutions proposed in this application have at least the following technical effects:

[0046] Obtain the gateway function requirement template document; generate the function call in the vehicle bus communication matrix file, the gateway function test function library file and the test environment configuration according to the gateway function requirement template document; integrate the function call to form the entry file of the automated test main program; form the test project according to the vehicle bus communication matrix file, the entry file and the test environment configuration. The automated test project generator first obtains the gateway function requirement template document, which records in detail the functional requirements that the gateway needs to implement, including the attributes of the message and signal and their forwarding relationship, and provides detailed guidance and basis for automated testing. Then, the generator generates the vehicle bus communication matrix file according to these requirements. These files describe in detail the communication messages and signals on the vehicle bus to ensure that the test can simulate the actual communication scenario; at the same time, it generates the function call in the gateway function test function library file, defines the specific test operations in the test script; and the test environment configuration to ensure that the test script can run in the correct hardware and software environment. These steps convert complex functional requirements into executable test steps, improving the automation and efficiency of the test. Then, the generator integrates these function calls to form the entry file of the automated test main program, providing a clear starting point and execution framework for the test process, so that the test can be executed in a predetermined order, and the test results can be collected and summarized after the test is completed. Finally, the generator forms a complete test project based on the vehicle bus communication matrix file, entry file, and test environment configuration. This test project can simulate the actual vehicle communication scenario and verify whether the gateway can correctly process and forward messages according to the predetermined functional requirements. The entire process can generate an automated test project, thereby avoiding test omissions and improving test efficiency, ensuring the reliability and effectiveness of the test results. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0049] Figure 1 A flow chart of the first embodiment of the method for generating a vehicle gateway test project of the present application;

[0050] Figure 2 A schematic diagram of a structural framework provided for the first embodiment of a method for generating a vehicle gateway test project of the present application;

[0051] Figure 3 A flow chart of the second embodiment of the method for generating a vehicle gateway test project of the present application;

[0052] Figure 4 This is a schematic diagram of the module structure of a device for generating a vehicle gateway test project according to an embodiment of the present application;

[0053] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the method for generating an automobile gateway test project in an embodiment of the present application.

[0054] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0055] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0056] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0057] As the complexity of automotive electronic systems increases, cross-domain communication between vehicle electronic controllers relies on accurate forwarding by the automotive gateway, and ensuring its functionality and safety is critical. Current gateway testing methods include manually sending simulated messages and manually observing the results, or writing test projects to automatically send and detect messages. These methods can be manual or semi-automated. However, these traditional testing methods have limitations, are prone to test omissions, require high skills from engineers, and each gateway function update requires rewriting and adjusting the test script, which is time-consuming and error-prone.

[0058] The main solution of the embodiment of the present application is: First, the automated test project generator parses the gateway function requirement template document, generates a detailed vehicle bus communication matrix file and a gateway function test function library, ensures that the test can simulate the actual communication scenario and define specific test operations. Then, it configures the test environment and integrates these elements to form the entry file of the automated test main program, providing a clear execution framework. Finally, the generator creates a complete test project that can simulate vehicle communication scenarios and verify whether the gateway correctly processes and forwards messages according to predetermined requirements, thereby improving the automation and efficiency of the test.

[0059] It should be noted that the execution subject of the embodiment of the present application can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device that can realize the above functions, an automated test engineering generator, etc. The following embodiment and the following embodiments are described by taking the automated test engineering generator as an example. The automated test engineering generator is pre-compiled and is compiled from the code corresponding to the generated vehicle bus communication matrix file, the test script and the configuration file. The vehicle bus communication matrix file contains the industry standard format for describing the message signal information, such as files in .dbc or .ldf format, which can be understood as a description language similar to XML. During the test process, these files are used to define the structure and attributes of the message on the CAN bus, including the message ID, name, length, cycle, sender and other information, as well as the name, value type, byte order, length, start bit and other attributes of the signal contained in the message. This information is essential for the test script to simulate the sending of defined messages on the CAN bus to check whether the gateway can correctly forward the message. The test script is a program automatically generated according to the gateway function requirements. It calls the functions in the gateway function test function library file to perform specific test tasks. The test script contains automated test instructions for message routing or signal routing requirements. These instructions simulate sending messages to the gateway and monitor the gateway's response to verify whether the gateway correctly forwards messages or signals according to the predetermined routing function. The generation of the test script depends on the automated test project generator, which automatically selects and calls the corresponding library function according to the message and signal routing requirements in the requirements document. The configuration file is a file that describes the mapping relationship between the hardware CAN channel and the logical CAN channel and the underlying information of the CAN channel, such as the baud rate. These files are crucial for the test script because they define how the test script interacts with the physical CAN channel, including which physical channel to send and receive messages on, and how to associate these physical channels with logical channels. The configuration file ensures that the test script can correctly simulate sending messages on the specified physical channel and correctly identify the messages received from the gateway. These configuration information is usually stored in a .ini format file for the test script to read and apply at runtime.

[0060] Based on this, the embodiment of the present application provides a method for generating a vehicle gateway test project, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for generating a vehicle gateway test project of the present application.

[0061] In this embodiment, the method for generating the automobile gateway test project includes steps S10 to S40:

[0062] Step S10, obtaining a gateway function requirement template document;

[0063] It should be noted that the gateway functional requirements template document refers to a detailed document that contains a detailed description of all functional requirements that the automotive gateway needs to implement in actual work. This document is the basis for the generation of automated test projects. It provides the necessary input information for the automated test project generator so that the generator can automatically create test projects based on these requirements. The following is a detailed explanation of the gateway functional requirements template document: (1) Define the basic attribute information of interactive messages and signals: The gateway functional requirements template document defines the basic attributes of messages and signals that interact between vehicle electronic controllers. This includes information such as the message ID, name, length, period, sender, and sending method, as well as the signal name, value type, byte order, length, start bit, precision, offset, minimum value, maximum value, and unit. (2) The forwarding relationship between messages and signals: The document also describes in detail the forwarding relationship between messages and signals, that is, specifies which signals need to be forwarded from one controller (source) to another controller (destination). For example, the vehicle speed signal may need to be forwarded from the engine controller to the vehicle screen and dashboard. (3) Signal definition decomposition of messages: In the gateway functional requirements template document, a frame of message is regarded as a packaged combination of a group of signals of a controller on the vehicle. Signal definition is a decomposition of messages, that is, breaking down the entire message into separate signals for more detailed management and testing. (4) The basis for test project generation: The gateway functional requirements template document provides the necessary information for the automated test project generator, which generates test scripts, communication matrix description files, and configuration files based on this information. These files together constitute a complete automated test project, which is used to verify whether the gateway can correctly process and forward messages according to the predetermined functional requirements. (5) Auxiliary tools for test engineers: For test engineers, the gateway functional requirements template document is an important auxiliary tool. It not only helps engineers understand the functional requirements of the gateway, but also ensures the comprehensiveness and accuracy of the test. Even engineers without relevant knowledge can get a complete functional test report by running the automatically generated test project.

[0064] It is understandable that the gateway function requirements are obtained based on the information interaction between the various electronic controllers of the vehicle. It defines the basic attribute information of the interactive messages and signals, as well as the forwarding relationship between the messages and signals. For example, the vehicle speed signal needs to be forwarded from the engine controller to the vehicle screen and dashboard. The signal definition is a disassembly of the message. That is, a frame of the message is a packaged combination of a group of signals from a controller on the vehicle, and the gateway forwards the entire message or some signals in the message.

[0065] As an example, the step of obtaining the gateway function requirement template document includes: obtaining the attribute information and forwarding relationship of the messages and signals interacting between the various electronic controllers of the whole vehicle; packaging and combining the vehicle controller signals according to the attribute information to obtain the vehicle controller messages; and establishing the gateway function requirement template document according to the attribute information, the vehicle controller signals, the vehicle controller messages and the forwarding relationship.

[0066] In automobiles, electronic controllers refer to electronic devices used to control and manage various functions of the vehicle, such as engine controllers, transmission controllers, body control modules, etc. These controllers communicate with other parts of the vehicle through electronic signals to achieve specific control functions. A message refers to a data packet sent by one electronic controller to another in the automobile bus system. It contains data in a certain format. These data can be a collection of one or more signals used to transmit information between different electronic controllers. A signal refers to a single data item in a message, which represents a specific parameter in the vehicle, such as vehicle speed, engine speed, etc. A signal is the basic unit of a message, and each signal has a specific data type and value. Attribute information refers to detailed information describing the characteristics of messages and signals, including the network segment, ID, name, length, period, sender, sending method, and signals contained in the message. For signals, attribute information includes the name, value type, byte order, length, start bit, precision, offset, minimum value, maximum value, and unit of the signal. The forwarding relationship refers to the specific rules that the gateway needs to forward to another domain after receiving a message or signal from one domain. This includes the ID and network segment of the source and destination messages, the data type and mapping relationship of the source and destination signals, etc. The vehicle controller signal refers to the electronic signal used to indicate the vehicle status or control command in the vehicle's electronic controller. These signals can be analog or digital, and they are used to transmit information within the controller or between controllers. Packaging and combination refers to the process of combining multiple signals into one message. In the automotive bus system, in order to improve communication efficiency, multiple related signals are usually packaged into one message and then sent to other controllers through the bus. The vehicle controller message refers to a data packet containing multiple signals generated by one or more electronic controllers of the vehicle. This message will be transmitted on the vehicle's bus system to realize information exchange between different controllers.

[0067] First, the automated test engineering generator analyzes the design documents and communication protocols of the vehicle electronic system, and records in detail the attribute information of the signals sent and received by each electronic controller, such as the signal name, data type, byte order, length, etc., as well as how these signals are combined into messages. This is because the signal is the basic component unit of the message, and the message is a data packet for communication between controllers. Clarifying this information is crucial to understanding the communication mechanism between controllers. Secondly, the generator combines and packages the related signals into a frame of messages according to specific rules based on the collected signal attribute information. This is because in the automotive bus system, in order to improve data transmission efficiency and reduce communication load, multiple signals are usually packaged into one message for transmission. Finally, the generator organizes these packaged messages and their forwarding relationships into a gateway functional requirement template document. This document describes in detail how the gateway should process and forward these messages, including the source controller, target controller, transmission path, etc. of the message. This provides a clear test blueprint for the automated test engineering generator, ensuring that the test can cover all predetermined functional requirements and can automatically verify whether the gateway can correctly perform its communication and forwarding tasks, thereby improving the accuracy and efficiency of the test.

[0068] Step S20, generating a vehicle bus communication matrix file, a function call in a gateway function test function library file, and a test environment configuration according to the gateway function requirement template document;

[0069] It should be noted that the car bus communication matrix file (such as .dbc or .ldf format files) is a standardized file that describes the communication messages and signals on the car bus in detail. These files contain information such as the message ID, name, length, cycle, sender, and the name, value type, byte order, length, start bit and other attributes of each signal contained in the message. This information is crucial for the test script because they define the specific parameters required to simulate the sending of defined messages on the CAN bus, so that it can be checked whether the gateway has correctly forwarded the simulated message after receiving it. The gateway function test library file is a set of predefined functions that encapsulate various operations required for testing the gateway, such as message routing and signal routing of different value types. These functions provide a set of interfaces so that the automated test script can perform specific test tasks by calling these functions, such as sending specific messages, monitoring message forwarding results, etc. The design of the function library is to simplify the writing of test scripts and improve the reusability and maintainability of the test. Function call refers to the selection and execution of the corresponding function in the gateway function test function library in the automated test script according to the message routing or signal routing requirements defined in the gateway function requirement template document. These function calls contain all the parameters required to execute the test, such as source signal or source message, target signal or target message, and mapping parameters when forwarding signals. Function calls are the core of the test script. They define the specific operations and logic of the test, so that the test script can automatically execute the test case and generate test results. Test environment configuration refers to the parameters used to set and adjust the test environment to ensure that the test script can run in the correct hardware and software environment. This includes the mapping relationship description file between the hardware CAN channel and the logical CAN channel, as well as the underlying information of the CAN channel, such as the baud rate. The test environment configuration ensures that the test script can correctly simulate the sending of messages on the specified physical channel and correctly identify the messages received from the gateway. These configuration information are usually stored in .ini or other configuration file formats for the test script to read and apply at runtime.

[0070] It can be understood that, firstly, the automated test engineering generator extracts detailed information of each signal and message, such as signal name, data type, message ID, etc., by parsing specific entries in the gateway functional requirement template document, and then uses this information to generate a car bus communication matrix file (such as a .dbc file). This file defines the structure and signal properties of the message on the CAN bus. This is done to enable the test script to simulate sending correct messages according to these standard format files to verify whether the gateway can correctly process and forward these messages; secondly, the generator selects corresponding functions from the gateway functional test function library according to the requirements of message routing and signal routing, and generates specific function call codes. These codes contain the logic of message sending, receiving and forwarding. This is done to build an automated test script that can automatically execute test cases and verify whether the routing function of the gateway meets expectations; finally, the generator will create a test environment configuration file based on the communication matrix file and test requirements. This file contains the mapping relationship between the hardware CAN channel and the logical CAN channel and the communication parameters (such as baud rate). This is done to ensure that the test script can correctly communicate with the gateway in the actual hardware environment, simulate the sending and receiving of messages, and correctly interpret the response of the gateway.

[0071] Step S30, integrating the function calls to form an entry file of the automated test main program;

[0072] It should be noted that the main program of automated testing refers to a complete and executable test program, which contains all the logic and instructions required to perform automated testing. This main program is generated by the automated testing project generator based on the gateway functional requirements template document. It integrates all test cases and test processes, and can automatically execute test scripts, simulate sending messages, monitor the response of the gateway, and verify whether the gateway correctly processes and forwards messages according to the predetermined functional requirements. The entry file is the starting point of the main program of automated testing. It is a specific file. When the main program of automated testing is executed, the first thing to run is this entry file. This file usually contains the startup logic of the main program, such as initializing the test environment, loading configuration files, setting test parameters, etc. During the automated testing process, the entry file is responsible for coordinating and scheduling the entire test process, ensuring that the test cases are executed in the predetermined order, and summarizing the test results after the test is completed.

[0073] It can be understood that, first, the automated test project generator generates a series of function calls based on the message routing and signal routing requirements in the gateway functional requirements template document. These function calls define specific test operations, such as sending specific messages, monitoring specific signals, etc. Then, the generator integrates these function calls into a main program file, which is the entry file of the automated test main program. In this file, all test cases and test processes are organized to form a complete test sequence.

[0074] Step S40, forming a test project according to the vehicle bus communication matrix file, the entry file and the test environment configuration.

[0075] It should be noted that a test project refers to a complete test solution that integrates all necessary test resources, scripts, and configuration files based on specific test requirements and environment configurations, including key components such as vehicle bus communication matrix files, entry files, and test environment configurations.

[0076] It can be understood that, first, the automated test engineering generator will read the car bus communication matrix files, which contain the specific parameters of the message and signal. The generator uses these parameters to build the test script to simulate the sending and receiving of the message. This is to ensure that the test script can accurately simulate the actual vehicle communication environment; secondly, the generator will associate the entry file with these test scripts. The entry file contains the startup logic of the test execution and the scheduling instructions of the test case. This is to ensure that the test can be executed in a predetermined order and the test results can be collected and summarized after the test is completed; finally, the generator will integrate the test environment configuration, which details the correspondence between the hardware CAN channel and the logical CAN channel and the communication parameters, such as the baud rate, etc. This is to ensure that the test script can correctly communicate with the gateway in the actual hardware environment, simulate the sending and receiving of the message, and correctly interpret the response of the gateway. Through these three steps, the test project formed can automatically execute complex test processes, improve the efficiency and accuracy of the test, reduce human errors, and ensure the consistency and reliability of the test results.

[0077] Please refer to Figure 2 , Figure 2The structural framework diagram provided for the first embodiment of the method for generating the automotive gateway test project of this application shows the workflow and output structure of the automated test project generator, in which the functional requirements document is used as input and is the basis of the entire automated test project. The automated test project generator generates four key components based on the information in the functional requirements document: first, it generates a gateway functional test function library, which is a collection of predefined test functions for performing specific test tasks; second, it generates communication matrix files, which describe the communication messages and signals on the vehicle bus in detail and provide the necessary communication parameters for the test script; then, it generates the automated test main program, which is the starting point of the test execution and contains all the instructions and parameters required to start the test process; finally, it generates environment configuration files, which record the specific settings of the test environment, such as the mapping relationship between the hardware CAN channel and the logical CAN channel and the communication parameters. These four components together constitute the automated test project, which can simulate the actual vehicle communication scenario and verify whether the gateway can correctly process and forward messages according to the predetermined functional requirements, thereby improving the efficiency and accuracy of the test, reducing human errors, and ensuring the reliability of the test results.

[0078] As an example, after the step of forming a test project according to the vehicle bus communication matrix file, the entry file and the test environment configuration, it also includes: deploying the test project on a hardware-in-the-loop simulation bench, the hardware-in-the-loop simulation bench is connected to the electronic control unit under test through a vehicle bus communication board; testing the electronic control unit under test through the hardware-in-the-loop simulation bench to obtain a functional test report.

[0079] A hardware-in-the-loop (HIL) simulation bench is a test system that places actual hardware components (such as the electronic control unit of a car) in a simulated or virtual test environment. On this bench, the actual hardware components can interact with the simulated software model to simulate real-world operating conditions. In automotive gateway testing, the HIL simulation bench allows test engineers to simulate various driving conditions and communication scenarios to verify the performance and reliability of the gateway in actual operation. The automotive bus communication board is a hardware device used to realize communication between the various electronic control units inside the car. These boards support communication protocols such as CAN and LIN, allowing data exchange between the test system and the electronic control unit under test. In the hardware-in-the-loop simulation bench, the communication boards are connected to the simulation system and the gateway under test, so that the test script can send and receive messages through these boards to simulate actual vehicle communication. The electronic control unit (ECU) under test refers to the automotive electronic component whose function needs to be verified during the test process. In the case of gateway testing, the ECU under test is the automotive gateway, which is responsible for processing and forwarding communication messages from different ECUs. The purpose of the test is to ensure that the gateway can correctly perform its communication and forwarding tasks and meet the predetermined functional requirements. The functional test report is a document generated after the test process is completed. It records the test results in detail, including the execution of the test cases, whether the test passed, any problems or anomalies found, etc. This report provides test engineers with a clear overview of the test results, helping them evaluate the functional performance of the ECU under test (such as the gateway) and serving as a basis for subsequent analysis and problem solving.

[0080] First, the automated test project generator will upload and deploy the generated test project, including all test scripts, communication matrix files and test environment configurations, to the hardware-in-the-loop simulation bench. This is done to simulate the actual vehicle communication scenario in the simulation environment to ensure the accuracy of the test and the consistency of the actual application. Secondly, the generator will configure the vehicle bus communication boards on the simulation bench. These boards are physically connected to the electronic control unit under test (such as the vehicle gateway) to establish a communication link between the simulation bench and the unit under test. This is done to achieve the sending and receiving of test signals, so that the test script can be executed on the actual hardware and simulate the communication process of the vehicle in actual operation. Finally, the generator executes the test cases in the test project on the simulation bench, performs actual functional tests on the electronic control unit under test, records all data and results during the test, and generates a functional test report after the test is completed, reporting the test results and any abnormal conditions in detail. The effect of this is to provide a comprehensive and objective performance evaluation, help engineers verify whether the gateway meets the predetermined functional requirements, and provide detailed data support for subsequent optimization and problem solving. Through this process, the automated test engineering generator can ensure the automation and systematization of testing, improve testing efficiency, reduce human errors, and ensure the reliability and effectiveness of test results.

[0081] As an example, the step of testing the electronic control unit under test through the hardware-in-the-loop simulation bench to obtain a functional test report includes: when the electronic control unit under test is a gateway, generating a simulation message according to the vehicle bus communication matrix file in the test project; sending the simulation message to the gateway on the controller local area network bus through the hardware-in-the-loop simulation bench, so that the gateway forwards the simulation message; obtaining the simulation message forwarded by the gateway through the hardware-in-the-loop simulation bench; verifying the message identifier and data integrity of the simulation message to obtain a functional test report of the gateway.

[0082] In automotive electronic systems, the gateway is a key electronic control unit responsible for managing and forwarding communication messages between different network domains. As a central node, it receives messages from one network domain and forwards these messages to another network domain according to preset routing rules. The gateway ensures that information is correctly and securely transmitted between different electronic systems in the vehicle. Simulated messages are messages generated by the test system to simulate messages in actual communication scenarios. These messages contain the same structure and data as actual messages, but they are generated by the test equipment during the test process to verify whether the gateway can correctly process and forward these messages. Simulated messages allow testers to test the function of the gateway without interfering with the normal operation of the vehicle. The controller area network (CAN) bus is a communication protocol commonly used in automobiles. It allows data exchange between different electronic control units. The CAN bus is a multi-master bus system, which means that multiple devices can listen to data on the bus at the same time and send data when needed. During the test process, the CAN bus is used to send simulated messages to the gateway and receive messages forwarded by the gateway. The message identifier (MID) is a field in the CAN bus message that uniquely identifies the type or content of the message. Each message has a specific identifier so that the gateway and receiving device can identify the purpose of the message and make corresponding processing accordingly. Data integrity refers to the fact that the message data has not been tampered with, lost or damaged during transmission, and its original integrity and accuracy are maintained. Verifying the data integrity of the simulated message means checking whether the message data forwarded by the gateway is exactly the same as the data when it was sent. This is a key verification step to ensure that the gateway correctly forwards the message.

[0083] First, the automated test engineering generator uses a programming language (such as Python) to write code to generate simulation messages based on the message structure and attributes defined in the vehicle bus communication matrix file in the test project. These messages simulate the communication data that the gateway may receive in actual work. This is done to simulate actual communication scenarios in a safe and controlled test environment without having to test in actual vehicles, thereby reducing testing costs and risks. Secondly, the hardware-in-the-loop simulation bench sends these simulation messages to the gateway through the communication board connected to the controller area network (CAN) bus, forcing the gateway to process and forward these messages. This step is completed through the software interface operation on the simulation bench. The simulation bench software provides the function of sending messages. The user only needs to select the corresponding message and target gateway, and then perform the sending operation. This can verify whether the gateway can correctly identify, process and forward the received messages, ensuring that the communication function of the gateway meets the design requirements. Finally, while sending simulated messages, the hardware-in-the-loop simulation bench will also monitor the communication on the CAN bus, capture the messages forwarded by the gateway, and verify the message identifiers and data content of these messages, checking whether the messages are forwarded completely and correctly, and whether the message identifiers are correct. This is achieved through the monitoring and analysis tools of the simulation bench. By comparing the sent and received messages, it is verified whether the forwarding function of the gateway is correct. If the message is correct, it means that the gateway functions normally; if there are errors or losses, it means that there may be problems with the gateway. Through this process, a detailed functional test report can be obtained, which will record the detailed process and results of the test, providing a basis for subsequent problem diagnosis and system optimization. This can comprehensively evaluate the gateway's ability to process and forward messages and ensure that it can work reliably in actual vehicles.

[0084] This embodiment provides a method for generating a car gateway test project, obtaining a gateway function requirement template document; generating a car bus communication matrix file, a function call in a gateway function test library file, and a test environment configuration according to the gateway function requirement template document; integrating the function call to form an entry file of the automated test main program; and forming a test project according to the car bus communication matrix file, the entry file, and the test environment configuration. The automated test project generator first obtains the gateway function requirement template document, which records in detail the functional requirements that the gateway needs to implement, including the attributes of messages and signals and their forwarding relationships, and provides detailed guidance and basis for automated testing. Then, the generator generates a car bus communication matrix file based on these requirements, which describes in detail the communication messages and signals on the car bus to ensure that the test can simulate the actual communication scenario; at the same time, it generates function calls in the gateway function test library file, defines the specific test operations in the test script; and the test environment configuration ensures that the test script can run in the correct hardware and software environment. These steps convert complex functional requirements into executable test steps, improving the automation and efficiency of the test. Then, the generator integrates these function calls to form the entry file of the automated test main program, providing a clear starting point and execution framework for the test process, so that the test can be executed in a predetermined order, and the test results can be collected and summarized after the test is completed. Finally, the generator forms a complete test project based on the vehicle bus communication matrix file, entry file, and test environment configuration. This test project can simulate the actual vehicle communication scenario and verify whether the gateway can correctly process and forward messages according to the predetermined functional requirements. The entire process can generate an automated test project, thereby avoiding test omissions and improving test efficiency, ensuring the reliability and effectiveness of the test results.

[0085] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 3 , Figure 3 This is a flow chart of a second embodiment of a method for generating a vehicle gateway test project of the present application. Step S20 of the method for generating a vehicle gateway test project includes steps S21 to S24:

[0086] Step S21, generating a vehicle bus communication matrix file according to the attribute information of the message and the signal in the gateway function requirement document;

[0087] It should be noted that the attribute information in the briefing document refers to the detailed characteristics and parameters of the messages and signals related to the gateway function. This information is the basis for the gateway to correctly process and forward communication data. Specifically, the attribute information includes the following aspects: Message attributes: (1) Network segment: the network segment or domain to which the message belongs. (2) ID: the unique identifier of the message, used to distinguish different messages. (3) Name: the name of the message, used to identify the content or function of the message. (4) Length: the total data length of the message, that is, the number of data bytes contained in the message. (5) Period: the frequency or time interval of message transmission. (6) Sender: the electronic control unit that sends the message. (7) Transmission mode: the transmission mechanism of the message, such as periodic transmission or event-triggered transmission. (8) Included signals: a list of all signals included in the message. Signal attributes: (1) Name: the name of the signal, used to identify the physical quantity or parameter represented by the signal. (2) Numeric type: the data type of the signal, such as integer, floating point, etc. (3) Byte order: the order in which the bytes of the signal are arranged in the message. (4) Length: The data length of the signal, that is, the number of bytes occupied by the signal. (5) Start bit: The start bit position of the signal in the message. (6) Accuracy: The measurement or representation accuracy of the signal. (7) Offset: The offset of the signal value, used to convert the signal value into an actual physical quantity. (8) Minimum and maximum values: The value range of the signal value. (9) Unit: The unit of the signal value.

[0088] It can be understood that, firstly, the automated test engineering generator identifies the specific attributes of each message and signal, such as the message ID, name, length, etc., and the signal name, data type, byte order, length, start bit, etc., by reading the detailed entries in the gateway functional requirements document. This is to obtain the precise data required to build the communication matrix file; secondly, the generator arranges these data according to the specified structure of the .dbc or .ldf file format, and uses a programming language or a dedicated conversion tool to convert the extracted attribute information into a standardized file format. This is to ensure that the generated file can be correctly identified and used by the test tools and equipment; finally, the generated vehicle bus communication matrix file is used in the automated testing process to guide the test script to simulate the sending and receiving of messages, and verify whether the gateway can correctly process the messages according to the predetermined communication protocol and attribute requirements. The effect of this is to ensure the accuracy and reliability of the test, improve the test efficiency, and reduce human errors, so that the test results can fully reflect the actual communication performance of the gateway.

[0089] Step S22, determining a target library function according to the forwarding relationship of the message or signal in the gateway function requirement document and the parameters corresponding to the forwarding relationship;

[0090] It should be noted that the forwarding relationship refers to the rules and paths that the gateway needs to follow to forward a specific message or signal from one network domain to another network domain after receiving it. This includes the IDs and network segments of the source and target messages, as well as the mapping relationship between the source and target signals. In automated testing, understanding these forwarding relationships is essential for simulating the correct communication scenarios and verifying whether the gateway correctly performs its forwarding function. Parameters refer to specific values ​​or settings related to the forwarding relationship. These parameters define how to forward messages or signals. For example, parameters may include the value range of the source signal, the offset of the target signal, the conversion formula of the signal, the frequency of message transmission, etc. These parameters ensure that during the test, the simulated messages and signals can accurately reflect the actual communication needs and verify whether the gateway can process these messages and signals in the predetermined manner. Target library functions refer to pre-defined functions in the gateway functional test library for performing specific test operations. These functions encapsulate the logic required to perform the test, such as sending messages, monitoring signals, and verifying forwarding results. According to the forwarding relationship and the corresponding parameters, the automated test project generator will select or generate appropriate library function calls, which will be integrated into the test script to perform specific test tasks. The selection and generation of the target library function is based on the specific requirements of the forwarding relationship and parameters to ensure that the test can cover all functional requirements and verify whether the behavior of the gateway meets expectations.

[0091] It can be understood that, first, the automated test engineering generator identifies which messages or signals need to be forwarded and the target network domains to which they are forwarded by parsing the gateway functional requirements document. This step involves a detailed review of the description of message and signal routing in the document to determine their forwarding paths between different controllers. This is done to ensure that the test can simulate the actual vehicle communication environment; secondly, the generator will extract specific parameters related to these forwarding paths, such as the mapping relationship of signal values, the timing and conditions of message sending, etc. These parameters are the key to the correct execution of the forwarding function. The generator may need to perform some calculations or conversions to obtain the correct values ​​of these parameters. This is done to accurately reproduce the forwarding process of messages and signals in the test; finally, based on the above forwarding paths and parameters, the generator will select appropriate library functions or generate new library function codes. These library functions will be integrated into the test script for performing operations such as sending messages and monitoring forwarding results. This enables the automated test script to automatically execute complex test cases and verify whether the gateway can correctly process communication data according to the predetermined forwarding rules, thereby improving the accuracy and efficiency of the test and reducing human errors.

[0092] Step S23, generating a function call in a gateway function test function library file according to the target library function;

[0093] It can be understood that, first, the automated test engineering generator will identify the target library functions for specific test requirements. These library functions are pre-defined and can perform operations such as sending messages, receiving messages, and signal conversion. Then, the generator organizes these target library functions according to the test logic and process, and generates specific function call codes. These codes specify the call timing, input parameters, and expected behavior of each library function in detail. This is done to ensure that the test script can be executed according to the predetermined test plan. Finally, the generated function call code is written into the gateway function test function library file, which will be directly referenced by the test script to perform the actual test operation. This process creates an automated test framework that allows test engineers to build complete test cases without having to deeply understand the internal implementation of each library function, thereby improving the efficiency and maintainability of the test.

[0094] Step S24: Generate the test environment configuration required for the automated test project according to the gateway functional requirement document.

[0095] It can be understood that, first, the automated test engineering generator will extract the specific configuration requirements of the test environment from the gateway functional requirements document one by one, including determining which physical CAN channels need to be mapped to which logical CAN channels, and setting the correct communication baud rate and other parameters. This step is completed by parsing the description in the document, in order to ensure that the test environment can accurately simulate the actual vehicle communication environment; secondly, the generator will use a text editor or a dedicated configuration file generation tool to create specific configuration files based on the extracted information. These files record the hardware settings and communication parameters in detail. This step is achieved by writing code or using a graphical interface tool, in order to generate a configuration file that can be recognized and used by the test script; finally, the generated configuration files are integrated into the automated test project. When the test script runs, it will read these configuration files and set the hardware and communication parameters according to the instructions in the file. This enables the test script to send and receive messages on the correct hardware channel, ensuring that the test can simulate the actual vehicle communication situation, thereby improving the accuracy and reliability of the test. Through this detailed step, the automated test engineering generator can ensure that the configuration of the test environment is both accurate and efficient, providing a plug-and-play test platform for test engineers.

[0096] As an example, the step of generating the test environment configuration required for the automated testing project based on the gateway function requirement document includes: obtaining the mapping relationship between the hardware controller LAN channel and the logic controller LAN channel and the underlying information of the hardware controller LAN channel based on the gateway function requirement document; generating the test environment configuration required for the automated testing project based on the mapping relationship and the underlying information.

[0097] Hardware Controller Area Network (CAN) channels refer to CAN communication interfaces at the physical level. These interfaces exist on the electronic control unit (ECU) or test equipment of the car and are used to implement the actual sending and receiving of CAN messages. In automated testing, hardware CAN channels are the physical media connecting the test equipment and the gateway under test. They are part of the actual circuit and are responsible for transmitting electronic signals. Logical Controller Area Network channels refer to CAN communication channels defined at the software level. They represent different communication networks or network domains. In a car, different ECUs may belong to different logical CAN channels. These channels are defined in software to distinguish different types of communication traffic and network topologies. The mapping relationship refers to the correspondence between hardware CAN channels and logical CAN channels. In automated testing, it is necessary to clearly specify which hardware CAN channel corresponds to which logical CAN channel, so that the test script can correctly simulate the sending and receiving of messages on the physical hardware and ensure that these messages are sent to the correct network domain. The underlying information refers to the configuration parameters of the hardware CAN channel, such as baud rate, bit timing settings, etc. These parameters are crucial for CAN communication because they determine how messages are transmitted on the physical medium. Understanding and setting these underlying information is the basis for ensuring that CAN messages can be transmitted correctly.

[0098] First, the automated test project generator extracts key information from the gateway functional requirements document, including identifying which hardware controller area network (CAN) channels will be used for testing and determining the correspondence between these physical channels and logical CAN channels. This mapping relationship is crucial to ensure that the test signal is sent to the correct network domain; at the same time, the generator also collects the underlying information of the hardware CAN channel, such as the communication baud rate and bit timing settings. These parameters are essential for the correct transmission and reception of CAN messages. Secondly, using these collected mapping relationships and underlying information, the generator creates or updates the test environment configuration files, which record all the necessary environment settings in a specific format to ensure that the test script can correctly interact with the hardware interface and network domain according to these settings. Finally, these configuration files are integrated into the automated test project to guide the specific hardware settings and communication parameters during test execution. This ensures that the test environment can accurately simulate the actual vehicle communication environment, making the test results more accurate and reliable. Through this detailed step, the automated test project generator can provide test engineers with a pre-configured test platform that matches the actual vehicle communication environment.

[0099] As an example, the step of obtaining the mapping relationship between the hardware controller LAN channel and the logical controller LAN channel and the underlying information of the hardware controller LAN channel according to the gateway function requirement document includes: determining the hardware controller LAN channel according to the hardware device configuration and channel identification in the gateway function requirement document; determining the logical controller LAN channel according to the protocol stack and communication protocol in the gateway function requirement document; determining the mapping relationship between the hardware controller LAN channel and the logical controller LAN channel according to the network topology, functional description and message forwarding rules in the gateway function requirement document; and obtaining the underlying information of the hardware controller LAN channel according to the hardware device configuration and physical parameters in the gateway function requirement document.

[0100] Hardware device configuration refers to the specific settings and parameters of hardware devices in the gateway functional requirements document, including device model, interface type, connection method, etc. These configurations determine how to physically connect devices and how they interact with the gateway. Channel identification refers to the unique identifier or name used to distinguish different hardware controller area network (CAN) channels. These identifiers help to clearly specify and reference specific hardware channels in documents and test scripts. Protocol stack refers to the software hierarchy that implements specific communication functions. It includes a series of protocols from the physical layer to the application layer. In automotive networks, protocol stacks may include CAN protocols, network management protocols, etc., which are used to ensure the effective transmission of data between different network layers. Communication protocols refer to the rules and standards used for data exchange in network communications. In automotive networks, common communication protocols include CAN, LIN, FlexRay, etc., which define the format, transmission rate and other communication parameters of data packets. Network topology refers to the structure of how various devices in the network are connected and organized. In automotive networks, network topology describes the physical and logical connections between ECUs and how they form a communication network. Functional description refers to the detailed description of the specific functions that the gateway needs to implement in the document, including how the gateway processes and forwards messages, what diagnostic services are performed, etc., which is a key part of understanding gateway behavior and testing requirements. Message forwarding rules refer to the specific rules on how the gateway forwards a specific message to other networks or ECUs after receiving it. These rules determine the routing path of the message based on factors such as the message ID, signal content, and sending conditions. Physical parameters refer to the physical characteristics that affect the communication performance of the hardware controller LAN channel, such as baud rate, bit timing, electrical characteristics, etc. These parameters are critical to ensuring that messages are correctly transmitted on physical media.

[0101] First, the automated test engineering generator reads the hardware device configuration section in the gateway functional requirements document in detail, finds and records the specific configuration information of each hardware controller area network (CAN) channel, such as the channel number, the connected ECU, and their interface type, and records the channel identifier. This is done to simulate the actual hardware channel one-to-one in the test environment to ensure the accuracy of the test; secondly, the generator analyzes the protocol stack and communication protocol section in the document to determine the communication rules and protocols corresponding to each logical controller area network channel. This step involves identifying the network domain and data flow at the software level in order to correctly define and handle it in the test script. The generator then establishes the mapping relationship between the hardware CAN channel and the logical CAN channel according to the network topology diagram, functional description and message forwarding rules in the document, which includes specifying which hardware channels are responsible for transmitting the data of which logical channels. This is done to simulate the actual vehicle network structure and ensure that the test can cover all communication paths. Finally, the generator extracts the physical parameters of the hardware device configuration part from the document, such as the baud rate and bit timing of the CAN channel. These parameters are crucial for simulating actual physical communication conditions, ensuring that the data transmission rate and electrical characteristics in the test environment match the actual conditions in the vehicle. Through this detailed step, the automated test engineering generator can create an accurate test environment configuration so that the test results can truly reflect the communication behavior and performance of the gateway in the actual vehicle, thereby improving the reliability and effectiveness of the test.

[0102] This embodiment generates a vehicle bus communication matrix file according to the attribute information of the message and signal in the gateway function requirement document; determines the target library function according to the forwarding relationship of the message or signal in the gateway function requirement document and the parameters corresponding to the forwarding relationship; generates the function call in the gateway function test function library file according to the target library function; and generates the test environment configuration required for the automated test project according to the gateway function requirement document. First, the automated test project generator generates the vehicle bus communication matrix file according to the message and signal attribute information in the gateway function requirement document, such as their ID, name, data type, etc., converts these detailed information into a standardized file format, provides accurate communication parameters for the test script, and ensures that the test can accurately simulate the communication activities on the vehicle bus, which has the beneficial effect of improving the accuracy and coverage of the test. Then, the generator determines the target library function according to the forwarding relationship of the message or signal and the corresponding parameters, such as the forwarding rules and signal conversion formulas, selects or generates functions that can perform specific test tasks, ensures that the test can simulate complex communication scenarios and verify the routing logic of the gateway, and the effect is to enhance the complex scenario processing capability of the test. Then, the generator generates function calls in the gateway function test library file based on these target library functions, organizes the selected library functions according to the test logic, and builds the execution framework of the test script, which improves the automation and efficiency of the test process. Finally, the generator generates the test environment configuration required for the automated test project based on the gateway function requirement document, sets the specific parameters of the test environment, such as the mapping relationship and baud rate of the CAN channel, simulates the actual vehicle communication environment, ensures the accuracy and reliability of the test results, and provides a test platform that matches the actual vehicle communication environment. Overall, these steps together ensure that the test can fully cover the functional requirements of the gateway, improve the automation level of the test, reduce human errors, and ultimately make the test results more accurate and reliable, providing a solid foundation for the functional verification and performance evaluation of the gateway.

[0103] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the generation method of the automotive gateway test project of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0104] This application also provides a generation device for an automotive gateway test project, please refer to Figure 4 , the generation device of the automobile gateway test project includes:

[0105] Function requirement acquisition module 10, used to obtain gateway function requirement template document;

[0106] A test configuration module 20, for generating a vehicle bus communication matrix file, function calls in a gateway function test function library file, and a test environment configuration according to the gateway function requirement template document;

[0107] An entry file forming module 30, used for integrating the function calls to form an entry file of the automated test main program;

[0108] The project generation module 40 is used to form a test project according to the vehicle bus communication matrix file, the entry file and the test environment configuration.

[0109] In one embodiment, the test configuration module 20 is also used to generate a vehicle bus communication matrix file based on the attribute information of the message and signal in the gateway function requirement document; determine the target library function based on the forwarding relationship of the message or signal in the gateway function requirement document and the parameters corresponding to the forwarding relationship; generate a function call in the gateway function test function library file based on the target library function; and generate the test environment configuration required for the automated testing project based on the gateway function requirement document.

[0110] In one embodiment, the test configuration module 20 is also used to obtain the mapping relationship between the hardware controller LAN channel and the logic controller LAN channel and the underlying information of the hardware controller LAN channel according to the gateway function requirement document; and generate the test environment configuration required for the automated testing project according to the mapping relationship and the underlying information.

[0111] In one embodiment, the test configuration module 20 is also used to determine the hardware controller LAN channel according to the hardware device configuration and channel identification in the gateway function requirement document; determine the logical controller LAN channel according to the protocol stack and communication protocol in the gateway function requirement document; determine the mapping relationship between the hardware controller LAN channel and the logical controller LAN channel according to the network topology, functional description and message forwarding rules in the gateway function requirement document; and obtain the underlying information of the hardware controller LAN channel according to the hardware device configuration and physical parameters in the gateway function requirement document.

[0112] In one embodiment, the functional requirement acquisition module 10 is also used to obtain the attribute information and forwarding relationship of the messages and signals interacting between the various electronic controllers of the vehicle; package and combine the vehicle controller signals according to the attribute information to obtain the vehicle controller messages; and establish a gateway functional requirement template document based on the attribute information, the vehicle controller signals, the vehicle controller messages and the forwarding relationship.

[0113] In one embodiment, the project generation module 40 is also used to deploy the test project on a hardware-in-the-loop simulation bench, and the hardware-in-the-loop simulation bench is connected to the electronic control unit under test through a vehicle bus communication board; the electronic control unit under test is tested through the hardware-in-the-loop simulation bench to obtain a functional test report.

[0114] In one embodiment, the project generation module 40 is also used to generate a simulation message according to the vehicle bus communication matrix file in the test project when the electronic control unit under test is a gateway; send the simulation message to the gateway on the controller local area network bus through the hardware-in-the-loop simulation bench so that the gateway forwards the simulation message; obtain the simulation message forwarded by the gateway through the hardware-in-the-loop simulation bench; verify the message identifier and data integrity of the simulation message to obtain a functional test report of the gateway.

[0115] The device for generating the automobile gateway test project provided by the present application adopts the method for generating the automobile gateway test project in the above-mentioned embodiment, which can solve the technical problem of how to generate an automated test project to avoid test omissions and improve test efficiency. Compared with the prior art, the beneficial effects of the device for generating the automobile gateway test project provided by the present application are the same as the beneficial effects of the method for generating the automobile gateway test project provided by the above-mentioned embodiment, and the other technical features in the device for generating the automobile gateway test project are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0116] The present application provides a device for generating an automobile gateway test project, the device for generating an automobile gateway test project comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for generating an automobile gateway test project in the above-mentioned embodiment 1.

[0117] Reference below Figure 5 , which shows a schematic diagram of the structure of a generation device suitable for implementing the automotive gateway test project of the embodiment of the present application. The generation device of the automotive gateway test project in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The generation device of the automobile gateway test project shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0118] like Figure 5 As shown, the generation device of the automotive gateway test project may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the generation device of the automotive gateway test project are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the generation device of the automotive gateway test project to communicate wirelessly or wired with other devices to exchange data. Although the figure shows the generation device of the automotive gateway test project with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0119] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0120] The device for generating the automobile gateway test project provided by the present application adopts the method for generating the automobile gateway test project in the above embodiment, which can solve the technical problem of how to generate an automated test project to avoid test omissions and improve test efficiency. Compared with the prior art, the beneficial effects of the device for generating the automobile gateway test project provided by the present application are the same as the beneficial effects of the method for generating the automobile gateway test project provided by the above embodiment, and the other technical features in the device for generating the automobile gateway test project are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0121] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0122] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0123] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the method for generating a vehicle gateway test project in the above-mentioned embodiment.

[0124] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, 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 this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0125] The computer-readable storage medium may be included in the generation device of the automobile gateway test project; or may exist independently without being assembled into the generation device of the automobile gateway test project.

[0126] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the generation device of the automobile gateway test project, the generation device of the automobile gateway test project: obtains a gateway function requirement template document; generates a vehicle bus communication matrix file, function calls in a gateway function test function library file, and a test environment configuration according to the gateway function requirement template document; integrates the function calls to form an entry file of the automated test main program; and forms a test project according to the vehicle bus communication matrix file, the entry file, and the test environment configuration.

[0127] Computer program code for performing the operations of the present application 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 the case of 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., via the Internet using an Internet service provider).

[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. 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, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, 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.

[0129] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0130] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for generating the automotive gateway test project, and can solve the technical problem of how to generate an automated test project to avoid test omissions and improve test efficiency. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for generating the automotive gateway test project provided by the above-mentioned embodiment, and will not be repeated here.

[0131] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method for generating a vehicle gateway test project as described above.

[0132] The computer program product provided by the present application can solve the technical problem of how to generate an automated test project to avoid test omissions and improve test efficiency. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the method for generating a vehicle gateway test project provided by the above embodiment, and will not be repeated here.

[0133] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for generating an automobile gateway test project, characterized in that: The method comprises: Obtain the gateway functional requirements template document; Generate a vehicle bus communication matrix file, function calls in a gateway function test function library file, and a test environment configuration according to the gateway function requirement template document; Integrate the function calls to form an entry file of the automated test main program; A test project is formed according to the vehicle bus communication matrix file, the entry file and the test environment configuration.

2. The method according to claim 1, characterized in that The step of generating a vehicle bus communication matrix file, a function call in a gateway function test function library file, and a test environment configuration according to the gateway function requirement template document comprises: Generate a vehicle bus communication matrix file according to the attribute information of the message and the signal in the gateway functional requirement document; Determine a target library function according to the forwarding relationship of the message or signal in the gateway functional requirement document and the parameters corresponding to the forwarding relationship; Generate a function call in a gateway function test function library file according to the target library function; Generate the test environment configuration required for the automated testing project based on the gateway functional requirements document.

3. The method according to claim 2, characterized in that The step of generating the test environment configuration required for the automated test project according to the gateway functional requirement document includes: Obtaining a mapping relationship between a hardware controller area network channel and a logic controller area network channel and underlying information of the hardware controller area network channel according to the gateway functional requirement document; The test environment configuration required for the automated test project is generated according to the mapping relationship and the underlying information.

4. The method according to claim 3, characterized in that The step of obtaining the mapping relationship between the hardware controller LAN channel and the logic controller LAN channel and the bottom layer information of the hardware controller LAN channel according to the gateway function requirement document comprises: Determine the hardware controller local area network channel according to the hardware device configuration and channel identification in the gateway functional requirement document; Determine the logical controller local area network channel according to the protocol stack and communication protocol in the gateway functional requirement document; Determine a mapping relationship between the hardware controller LAN channel and the logic controller LAN channel according to the network topology, function description and message forwarding rules in the gateway function requirement document; The underlying information of the hardware controller local area network channel is obtained according to the hardware device configuration and physical parameters in the gateway functional requirement document.

5. The method according to claim 1, characterized in that The step of obtaining the gateway function requirement template document comprises: Obtain the attribute information and forwarding relationship of the messages and signals exchanged between the various electronic controllers of the vehicle; Packing and combining the vehicle controller signal according to the attribute information to obtain a vehicle controller message; A gateway function requirement template document is established according to the attribute information, the vehicle controller signal, the vehicle controller message and the forwarding relationship.

6. The method according to any one of claims 1 to 5, characterized in that After the step of forming a test project according to the vehicle bus communication matrix file, the entry file and the test environment configuration, the step further includes: Deploy the test project on a hardware-in-the-loop simulation bench, wherein the hardware-in-the-loop simulation bench is connected to the electronic control unit under test via a vehicle bus communication board; The electronic control unit under test is tested by the hardware-in-the-loop simulation bench to obtain a functional test report.

7. The method according to claim 6, characterized in that The step of testing the electronic control unit under test by the hardware-in-the-loop simulation bench to obtain a functional test report comprises: When the electronic control unit under test is a gateway, generating a simulation message according to the automobile bus communication matrix file in the test project; Sending the simulation message to the gateway on the controller area network bus through the hardware-in-the-loop simulation bench, so that the gateway forwards the simulation message; Obtaining the simulated message forwarded by the gateway through the hardware-in-the-loop simulation bench monitoring; The message identifier and data integrity of the simulated message are verified to obtain a functional test report of the gateway.

8. A device for generating a vehicle gateway test project, characterized in that: The device comprises: Functional requirement acquisition module, used to obtain gateway functional requirement template document; A test configuration module, used to generate a vehicle bus communication matrix file, function calls in a gateway function test function library file, and a test environment configuration according to the gateway function requirement template document; An entry file forming module, used for integrating the function calls to form an entry file of the automated test main program; The project generation module is used to form a test project according to the vehicle bus communication matrix file, the entry file and the test environment configuration.

9. A generation device for an automobile gateway test project, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for generating a vehicle gateway test project according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for generating a vehicle gateway test project according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Serial test method, device and system, electronic equipment and storage medium

    CN121541623A

  • Chassis domain electric control system test scene generation method and device, equipment and medium

    CN122614742A