Scene test method and system for automobile electronic controller, storage medium and equipment
By recording and reconstructing messages and building timing logic with external devices, the problem that the existing technology cannot simulate complex scenarios in the vehicle environment is solved, and the high-level scene simulation and complex scene testing of automotive electronic controllers are realized, which meets the intelligent network Lianhe Intelligent Driving Safety and Stability Requirements.
Patent Information
- Application Number
- CN202411163139.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-23
AI Technical Summary
The bench test of existing automotive electronic controllers cannot effectively simulate the instantaneous changes of various factors in the vehicle environment, and cannot truly simulate complex scenarios, resulting in the inability to meet the high safety and stability of software testing in intelligent networking and intelligent driving. Sexual requirements.
By recording the messages of the entire vehicle in a predetermined scenario, establishing a scene message library, writing and decomposing scene test cases, reconstructing messages based on the message library, and building timing logic with external devices, realizing scenario testing of automotive electronic controllers . Specific steps include converting message formats, redundant optimization, designing messages, establishing signal mapping relationships, message timing reconstruction and inverse conversion formats, and controlling external devices for non-signal and signal input using Python and CANoe software.
Achieve high-scene simulation of automotive electronic controllers, ensuring that the network signal is consistent with the real scene, and effective simulation of complex scenes through timing control, meeting the high requirements for safety and stability in intelligent networking and intelligent driving. .
Smart Images

Figure CN119065977A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a scenario testing method, system, storage medium and device for an automotive electronic controller. Background Art
[0002] Automotive electronic controllers account for an increasing proportion of automotive systems. With the continuous application of intelligent networking and intelligent driving in the automotive industry, the complexity of automotive electronic software has increased exponentially. Due to the automotive industry's higher requirements for safety and stability, the difficulty of software testing has also increased, and more complex scenarios need to be considered.
[0003] At present, in bench tests for automotive electronic controllers, the application of scenario methods is limited to designing simple scenarios for a single controller for testing. At the same time, for erroneous scenarios accumulated through project experience, only the main steps of the scenarios are extracted for testing. This makes it impossible to take into account the instantaneous changes of various factors in the actual vehicle environment and to truly simulate real scenarios. Summary of the invention
[0004] In view of the above problems, the present invention proposes a scenario testing method for an automotive electronic controller, the method comprising:
[0005] Record the messages generated by the vehicle in the predetermined scenario and establish a scenario message library;
[0006] Write and decompose scenario test cases;
[0007] Based on the scenario message library, reconstruct the message and obtain the reconstructed message;
[0008] Based on the reconstructed message, in combination with external devices, sequential logic is constructed to perform scenario testing.
[0009] Further,
[0010] The predetermined scenarios include:
[0011] Specific scenarios refer to specific scenarios designed based on test requirements;
[0012] Single scenario means a single operation scenario for each function on the vehicle;
[0013] The timing scenario refers to the timing scenario from power-on to operating each controller and then to power-off;
[0014] Error scenarios refer to scenarios when defects are discovered during testing.
[0015] Further,
[0016] The scenario test cases may be designed based on a single scenario or a complex scenario.
[0017] Further,
[0018] The message reconstruction based on the scenario message library specifically includes:
[0019] Convert message formats;
[0020] Optimize redundancy of messages;
[0021] Design messages;
[0022] Establish the mapping relationship between functions, message signal names and message signal values;
[0023] Reconstruct message timing;
[0024] Reverse conversion message format.
[0025] Further,
[0026] The scenario test based on the reconstructed message and combined with external equipment specifically includes:
[0027] Based on the reconstructed message, in combination with external devices, constructing sequential logic;
[0028] The timing logic is called through Python, and the calling strategy of the timing logic is adjusted according to the information fed back by the automotive electronic controller to perform scenario testing.
[0029] Further,
[0030] The timing logic is controlled by the external device and CANoe software.
[0031] Further,
[0032] The external device is controlled by Python to realize non-signal input to the automotive electronic controller; the CANoe software is responsible for controlling the playback of the reconstructed message to realize signal input to the automotive electronic controller.
[0033] The present invention also provides an automotive electronic controller scenario testing system for implementing the aforementioned automotive electronic controller scenario testing method, the system comprising:
[0034] The message library establishment module is used to record the messages generated by the vehicle in the predetermined scenario and establish a scenario message library;
[0035] Scenario test case writing and decomposition module, used to write and decompose scenario test cases;
[0036] A message reconstruction module, used to reconstruct messages based on the scenario message library and obtain reconstructed messages;
[0037] The scenario testing module is used to build timing logic based on the reconstructed messages and combine with external devices to perform scenario testing.
[0038] The present invention also provides a computer-readable storage medium storing a program or instruction. When the program or instruction is executed on a computer, the computer executes the aforementioned automotive electronic controller scenario testing method.
[0039] The present invention also provides an electronic device, including a processor, which is coupled to a memory; the processor is used to read and execute a computer program stored in the memory to implement the above-mentioned automotive electronic controller scenario testing method.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] By recording the message information of the real scene and parsing and organizing the message information, the network signal can be made exactly the same as the real scene. At the same time, it is combined with peripheral equipment to simulate non-signal information, and a high degree of simulation of the scene is achieved through effective timing control. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is a flow chart of the scenario testing method of the automotive electronic controller of the present invention;
[0044] Figure 2 It is a structural schematic diagram of the automotive electronic controller scenario testing system of the present invention;
[0045] Figure 3 It is a schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] In addition, in order to have a deeper understanding of the present invention, some of the terms are explained as follows:
[0048] CANoe software refers to a graphical development software that integrates bus simulation, test analysis and diagnosis.
[0049] The automotive electronic controller, also known as the automotive electronic control unit, is called ECU (Electronic Control Unit). The automotive electronic controller is a comprehensive control device for the engine. It calculates, processes, and judges various information input by the engine sensors according to its own stored programs, and then outputs instructions to control the actions of related actuators to achieve the purpose of fast, accurate, and automatic control of the engine.
[0050] like Figure 1 As shown, the automotive electronic controller scenario testing method of the present invention specifically includes the following steps:
[0051] S101: Record the messages generated by the vehicle in a predetermined scenario and establish a scenario message library.
[0052] When testing automotive electronic controllers, it is necessary to consider the impact of various factors in the actual vehicle environment on the automotive electronic controllers. Therefore, it is necessary to use CANoe software to comprehensively record the messages generated by the vehicle in predetermined scenarios in order to establish a scenario message library.
[0053] The message formats include: ASC II (hereinafter referred to as ASC) and BLF.
[0054] The message information includes: signal name, signal value, timestamp, byte length and frame rate.
[0055] Pre-order scenarios include:
[0056] a) Specific scenario refers to a specific scenario designed based on test requirements. The specific scenario is operated on the entire vehicle and all messages are recorded.
[0057] b) Single scenario refers to a single operation scenario for each function on the entire vehicle, in which each function is operated and all messages are recorded.
[0058] c) Timing scenario, which refers to the timing scenario from power-on to operating each controller and then to power-off. All messages are operated and recorded according to the timing.
[0059] d) Error scenario, which refers to the scenario when a defect is found during the test process. When a defect is found, the message is recorded.
[0060] The above messages can also be used as signal inputs for typical error scenarios.
[0061] S102: Write and decompose scenario test cases.
[0062] According to the functions of the automotive electronic controller to be tested, scenario test cases are designed based on single scenarios or complex scenarios.
[0063] For complex scenarios, since they involve multiple working conditions, they need to be decomposed into a combination of multiple simple scenarios. These simple scenarios should be the scenarios involved in the scenario message library.
[0064] It is worth noting that when writing and decomposing scenario test cases, new functions will be encountered. Since the scenario message library does not involve the new functions, the new functions need to be associated with the timing scenarios in the scenario message library.
[0065] S103: Reconstruct the message based on the scenario message library and obtain the reconstructed message.
[0066] The specific process is as follows:
[0067] S103-1: Convert the message format.
[0068] The information in the scene message library is parsed into Excel through Python to facilitate subsequent processing. At the same time, it is also necessary to associate it with the signal name according to the signal list matrix.
[0069] S103-2: Optimize the redundancy of the message.
[0070] When executing step S101, since operations unrelated to the predetermined scenario are inevitably performed, redundant and invalid messages are generated. To ensure the accuracy of the messages, the redundant and invalid messages need to be removed. At the same time, the messages sent by the automotive electronic controller itself also need to be removed.
[0071] S103-3: Design message.
[0072] For simple scenarios, the message fragments of the time sequence scenario messages are modified and reconstructed to achieve the goal. For complex scenarios, the complex scenarios need to be decomposed into multiple simple scenarios, and the simple scenarios need to be combined in a certain time sequence to achieve the goal.
[0073] S103-4: Establish a mapping relationship between functions, message signal names, and message signal values.
[0074] The signal name and signal value in the message correspond to different functions. In different projects, the signal name and signal value corresponding to the same function are different. Therefore, it is necessary to establish a mapping relationship between the function, message signal name and message signal value in the project dimension to update the message according to the mapping relationship.
[0075] S103-5: Reconstruct the message timing.
[0076] Message reconstruction will inevitably result in the trigger timing of each signal being unable to fully meet the requirements of the new project, so message timing reconstruction is required.
[0077] S103-6: Reverse conversion of message format.
[0078] Since the information reconstructed through steps S103-1 to S103-5 is stored in Excel and cannot be directly called by CANoe software, it is necessary to convert the information in Excel into a format that can be directly called by CANoe software, namely ASC and BLF format, through Python.
[0079] S104: Based on the reconstructed message, in combination with external devices, construct timing logic and perform scenario testing.
[0080] S104-1: Based on the reconstructed message, in combination with external devices, construct sequential logic.
[0081] Construct a timing logic controlled by external devices and CANoe software. Specifically, the external devices include programmable power supplies, controllable resistors and switch relays. Python is used to control the programmable power supplies, controllable resistors and switch relays to realize non-signal input to the automotive electronic controller. The CANoe software is responsible for controlling the playback of the reconstructed messages to realize signal input to the automotive electronic controller.
[0082] S104-2: Call the timing logic through Python, and adjust the calling strategy of the timing logic according to the information fed back by the automotive electronic controller to perform scenario testing.
[0083] By calling the timing logic through Python, the automotive electronic controller will provide real-time feedback messages during the test. The control timing logic is adjusted through the real-time feedback messages from the automotive electronic controller to ensure that the non-signal control of the automotive electronic controller by the external device and the signal control of the automotive electronic controller by the CANoe software are compatible with each other.
[0084] In the second embodiment, step S102 may be placed after S103 and before S104. The requirement can be met as long as the writing and decomposition of the scenario test cases are completed before the operation S104.
[0085] The embodiment of the present invention also provides a scenario testing system for an automotive electronic controller, such as Figure 2 As shown, including:
[0086] The message library establishment module 201 is used to record the messages generated by the vehicle in a predetermined scenario and establish a scenario message library.
[0087] The scenario test case writing and decomposition module 202 is used to write and decompose scenario test cases.
[0088] The message reconstruction module 203 is used to reconstruct messages based on the scenario message library.
[0089] The scenario testing module 204 is used to perform scenario testing based on the reconstructed message in combination with external devices.
[0090] It should be noted here that the above-mentioned message library establishment module 201, scenario test case writing and decomposition module 202, message reconstruction module 203 and scenario testing module 204 correspond to steps S101 to S104 in the embodiment of the automotive electronic controller scenario testing method. The examples and application scenarios implemented by the above-mentioned modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiments.
[0091] An embodiment of the present invention further provides a computer-readable storage medium storing a program or instruction. When the program or instruction is executed on a computer, the computer executes the automotive electronic controller scenario testing method as described in the above method embodiment.
[0092] like Figure 3 As shown, an embodiment of the present invention further provides an electronic device, including: a processor 301, the processor 301 is coupled to a memory 302, and the processor 301 is used to read and execute a computer program stored in the memory 302 to implement the automotive electronic controller scenario test method as described in the above method embodiment. Although the present invention has been described in detail with reference to the above embodiments, a person of ordinary skill in the art should understand that it is still possible to modify the technical solutions described in the above embodiments, or to replace some of the technical features therein by equivalents; and these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A scenario testing method for an automotive electronic controller, characterized in that: include: Record the messages generated by the vehicle in the predetermined scenario and establish a scenario message library; Write and decompose scenario test cases; Based on the scenario message library, reconstruct the message and obtain the reconstructed message; Based on the reconstructed message, in combination with external devices, sequential logic is constructed to perform scenario testing.
2. The method according to claim 1, characterized in that The predetermined scenarios include: Specific scenarios refer to specific scenarios designed based on test requirements; Single scenario means a single operation scenario for each function on the vehicle; The timing scenario refers to the timing scenario from power-on to operating each controller and then to power-off; Error scenario refers to the scenario when defects are found during the testing process.
3. The method according to claim 1, characterized in that The scenario test cases are designed based on single scenarios or complex scenarios.
4. The method according to claim 1, characterized in that: The message reconstruction based on the scenario message library specifically includes: Convert message formats; Optimize redundancy of messages; Design messages; Establish the mapping relationship between functions, message signal names and message signal values; Reconstruct message timing; Reverse conversion message format.
5. The method according to claim 1, characterized in that The scenario test based on the reconstructed message and combined with external equipment specifically includes: Based on the reconstructed message, in combination with external devices, constructing sequential logic; The timing logic is called through Python, and the calling strategy of the timing logic is adjusted according to the information fed back by the automotive electronic controller to perform scenario testing.
6. The method according to claim 5, characterized in that The timing logic is controlled by the external device and CANoe software.
7. The method according to claim 6, characterized in that The external device is controlled by Python to realize non-signal input to the automotive electronic controller; the CANoe software is responsible for controlling the playback of the reconstructed message to realize signal input to the automotive electronic controller.
8. A scenario test system for automotive electronic controllers, characterized in that: include: The message library establishment module is used to record the messages generated by the vehicle in the predetermined scenario and establish a scenario message library; Scenario test case writing and decomposition module, used to write and decompose scenario test cases; A message reconstruction module, used to reconstruct messages based on the scenario message library and obtain reconstructed messages; The scenario testing module is used to construct timing logic based on the reconstructed message and combine with external devices to perform scenario testing.
9. A computer-readable storage medium, characterized in that: A program or instruction is stored, and when the program or instruction is executed on a computer, the computer is enabled to execute the automotive electronic controller scenario testing method as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: comprising a processor coupled to a memory; The processor is used to read and execute the computer program stored in the memory to implement the automotive electronic controller scenario testing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Automatic generation method and device for scene test case of automobile controller
CN112147967A
Simulation test platform and method and storage medium
CN112835806A
Vehicle use scene simulation test method, device, equipment, medium and program product
CN114579456A
Interface testing method and device, electronic equipment and readable storage medium
CN117851251A
Intelligent driving in-loop test method and environment with real road scenario fused therein, and storage medium
WO2024131678A1
