Simulation test method, device and system and storage medium
By generating and compiling a virtual vehicle control unit containing fault activation recovery logic simulation code, the problem that the existing SIL testing environment cannot test the vehicle's underlying diagnostic functions is solved, and the consistency and testing effect of the test environment are improved.
Patent Information
- Application Number
- CN202311245078.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-03-25
AI Technical Summary
The existing SIL testing environment cannot effectively test the vehicle's underlying diagnostic functions and fault status, resulting in insufficient consistency with the actual vehicle testing environment, affecting the test effect.
By obtaining the preset information of the vehicle control unit under test, generating the state transfer simulation code between the fault signal and the application layer, establishing the connection relationship between the fault signal and the application layer interface, obtaining the fault activation recovery logic simulation code, and compiling it with the real application layer code into a virtual vehicle control unit to realize the simulation test of the vehicle control unit under test.
The test of the underlying diagnostic function of the ECU is realized, which improves the consistency between the SIL test environment and the actual vehicle test environment and improves the test effect.
Smart Images

Figure CN119690031A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a simulation test method, device, system and storage medium. Background Art
[0002] ECU (Electronic Control Unit) refers to an electronic control unit, which is a microprocessor or microcontroller used to control and manage the vehicle's electronic systems. ECU can be regarded as the brain of the vehicle, responsible for monitoring, controlling and coordinating the operation of various vehicle systems. SIL test environment (Software-in-the-Loop Testing Environment) is a software-in-the-loop testing environment based on software simulation. During the automobile development process, SIL test environment is used to verify and test the vehicle's software system. In the SIL test environment, ECU is simulated as VECU (Virtual Electronic Control Unit) and runs on a computer. In SIL testing, the test object is ECU code, which is a software code that can be run in the SIL test environment after appropriate adjustments are made to the software code of the real ECU.
[0003] However, the testing of underlying functions in the existing SIL test environment often only includes the testing of the underlying operating system code, and is unable to test the underlying diagnostic functions and fault conditions, which is different from actual vehicle testing.
[0004] Therefore, how to provide a simulation test method to improve the consistency between the SIL test environment and the actual vehicle test environment and improve the test effect has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present application provides a simulation test method, device, system and storage medium to improve the consistency between the SIL test environment and the actual vehicle test environment and enhance the test effect.
[0006] The present application provides a simulation test method, comprising:
[0007] Acquire preset information of the tested vehicle control unit, wherein the preset information at least includes a first mapping relationship table between the fault signal and the application layer interface;
[0008] Generate a state transfer simulation code between a fault signal and an application layer, and establish a connection relationship between the fault signal and the application layer interface in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code;
[0009] Compiling the simulation code including the fault activation recovery logic simulation code and the real application layer code of the vehicle control unit under test into a virtual vehicle control unit that can be run on the simulation test platform;
[0010] By performing a test operation on the virtual vehicle control unit, a simulation test on the tested vehicle control unit is achieved.
[0011] The beneficial effects of the present application are: by obtaining preset information of the vehicle control unit under test, wherein the preset information at least includes a first mapping relationship table between the fault signal and the application layer interface; generating a state transfer simulation code between the fault signal and the application layer, and establishing a connection relationship between the fault signal and the application layer interface in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code; compiling the simulation code including the fault activation recovery logic simulation code and the real application layer code of the vehicle control unit under test into a virtual vehicle control unit that can be run on a simulation test platform; and performing a test operation on the virtual vehicle control unit to realize a simulation test of the vehicle control unit under test. Since it includes the real application layer code and all the simulation codes including the fault activation recovery logic simulation code, in addition to the conventional testing of the application layer code and the underlying code, the underlying diagnostic function of the ECU can also be tested, thereby improving the consistency between the SIL test environment and the real vehicle test environment and improving the test effect.
[0012] In one embodiment, the preset information further includes memory variable description information, and the method further includes:
[0013] Extracting variable values in the memory variable description information;
[0014] Generate an operation code for reading and writing the variable value;
[0015] The operation code for performing the read and write operations on the variable value is written into a code file to generate a memory function simulation code.
[0016] In one embodiment, the preset information further includes interface information and internal behavior description information, and the method further includes:
[0017] The interface information and internal behavior description information in the preset information are parsed to generate the operating environment layer simulation code and the underlying operating system simulation code, wherein the internal behavior description information is the description information used to explain the function and behavior of a specific block or function in the code.
[0018] In one embodiment, establishing a connection relationship between a fault signal and an application layer interface in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code includes:
[0019] According to the mapping relationship between EID, FID and application layer interface, the simulation code of fault activation recovery logic is automatically generated.
[0020] In one embodiment, the preset information further includes a second mapping relationship table between the application layer interface and the external network communication signal, and the method further includes:
[0021] Calling the mapping relationship between the application layer interface and the external network communication signal in the second mapping relationship table;
[0022] The operating environment layer simulation code and the underlying operating system simulation code are modified through the mapping relationship to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment.
[0023] In one embodiment, the modifying the operating environment layer simulation code and the underlying operating system simulation code through the mapping relationship to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment includes:
[0024] Generate a target simulation code for mapping input and output signals with communication signals through the second mapping relationship table;
[0025] By periodically calling the target simulation code, the interface names of the operating environment layer simulation code and the underlying operating system simulation code are modified to be consistent with the actual vehicle environment.
[0026] In one embodiment, the testing operation is performed on the virtual vehicle control unit to implement a simulation test on the tested vehicle control unit, including:
[0027] Constructing a controlled object model corresponding to the virtual vehicle control unit;
[0028] The virtual vehicle control unit and the controlled object model are imported into a simulation test platform to implement a simulation test on the tested vehicle control unit.
[0029] In one embodiment, the step of constructing a controlled object model corresponding to the virtual vehicle control unit includes:
[0030] Generate a controlled object model through sensor signals directly collected by the tested vehicle control unit, actuator signals directly controlled by the tested vehicle control unit, signals of the tested vehicle control unit, signals of other vehicle control units, input and output interface models, and business logic models;
[0031] The interactive interface of the controlled object model is connected to the interactive interface of the virtual vehicle control unit in a one-to-one correspondence, and the interactive interface includes an input and output interface and a communication interface.
[0032] The present application also provides a simulation test device, comprising:
[0033] An acquisition module, used to acquire preset information of the tested vehicle control unit, wherein the preset information at least includes a first mapping relationship table between the fault signal and the application layer interface;
[0034] A first generating module is used to generate a state transfer simulation code between a fault signal and an application layer, and establish a connection relationship between the fault signal and the application layer interface in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code;
[0035] A compiling module, used for compiling the simulation code including the fault activation recovery logic simulation code and the real application layer code of the vehicle control unit under test into a virtual vehicle control unit that can be run on the simulation test platform;
[0036] The test module is used to implement a simulation test on the tested vehicle control unit by performing a test operation on the virtual vehicle control unit.
[0037] In one embodiment, the preset information further includes memory variable description information, and the device further includes:
[0038] An extraction module, used for extracting variable values in the memory variable description information;
[0039] A second generating module is used to generate an operation code for performing a read and write operation on the variable value;
[0040] The third generating module is used to write the operation code for reading and writing the variable value into a code file to generate a memory function simulation code.
[0041] In one embodiment, the preset information further includes interface information and internal behavior description information, and the device further includes:
[0042] The fourth generation module is used to parse the interface information and internal behavior description information in the preset information to generate the operating environment layer simulation code and the underlying operating system simulation code, wherein the internal behavior description information is the description information used to explain the function and behavior of a specific block or function in the code.
[0043] In one embodiment, the first generating submodule is further used for:
[0044] According to the mapping relationship between EID, FID and application layer interface, the simulation code of fault activation recovery logic is automatically generated.
[0045] In one embodiment, the preset information further includes a second mapping relationship table between the application layer interface and the external network communication signal, and the device further includes:
[0046] A calling module, used for calling the mapping relationship between the application layer interface and the external network communication signal in the second mapping relationship table;
[0047] The modification module is used to modify the operating environment layer simulation code and the underlying operating system simulation code through the mapping relationship so as to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment.
[0048] In one embodiment, the modification module includes:
[0049] A generating submodule, used for generating a target simulation code for mapping input and output signals with communication signals through the second mapping relationship table;
[0050] The modification submodule is used to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment by periodically calling the target simulation code.
[0051] In one embodiment, the test module includes:
[0052] A construction submodule, used to construct a controlled object model corresponding to the virtual vehicle control unit;
[0053] The import submodule is used to import the virtual vehicle control unit and the controlled object model into the simulation test platform to realize the simulation test of the tested vehicle control unit.
[0054] In one embodiment, the construction submodule is further used to:
[0055] Generate a controlled object model through sensor signals directly collected by the tested vehicle control unit, actuator signals directly controlled by the tested vehicle control unit, signals of the tested vehicle control unit, signals of other vehicle control units, input and output interface models, and business logic models;
[0056] The interactive interface of the controlled object model is connected to the interactive interface of the virtual vehicle control unit in a one-to-one correspondence, and the interactive interface includes an input and output interface and a communication interface.
[0057] The present application also provides a simulation test system, comprising:
[0058] at least one processor; and,
[0059] a memory communicatively connected to the at least one processor; wherein,
[0060] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to implement the simulation test method described in any of the above embodiments.
[0061] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the simulation test system, the simulation test system can implement the simulation test method recorded in any of the above embodiments.
[0062] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings.
[0063] The technical solution of the present application is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:
[0065] Figure 1 This is a flow chart of a simulation test method in one embodiment of the present application;
[0066] Figure 2 This is a structural diagram of a SIL simulation test system in one embodiment of the present application;
[0067] Figure 3 This is a structural schematic diagram of a simulation test device in an embodiment of the present application;
[0068] Figure 4 This is a schematic diagram of the hardware structure of a simulation test system in one embodiment of the present application. DETAILED DESCRIPTION
[0069] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application.
[0070] The software running on the ECU can be divided into three levels: application layer code, RTE (Runtime Environment) layer code and bottom layer code. Among them, the application layer code is software developed for specific functions and business needs, which realizes specific functions of the vehicle, such as engine control, brake system control, vehicle entertainment system, etc. The bottom layer code is a low-level software closely related to the hardware, which is used to interact and communicate with the hardware devices, including drivers, implementation of communication protocols, control of bottom layer hardware interfaces, etc. The RTE layer code is a component of the ECU runtime environment, providing general runtime support and resource management functions, including task scheduling, memory management, device drivers, communication interfaces, etc. The main function is to adapt and optimize the application layer functions and performance with the bottom layer hardware. In this application, VECU is a file format that can be run on the SIL simulation test platform after adding simulation code and recompiling the real ECU code. VECU contains the application layer code of the real ECU, the simulated RTE layer code and the simulated bottom layer code.
[0071] Figure 1 Flow chart of a simulation test method in one embodiment of the present application, such as Figure 1 As shown, the method can be implemented as the following steps S101-S104:
[0072] In step S101, the preset information of the tested vehicle control unit is obtained, wherein the preset information at least includes a first mapping relationship table between the fault signal and the application layer interface;
[0073] In step S102, a state transfer simulation code between a fault signal and an application layer is generated, and a connection relationship between the fault signal and the application layer interface is established in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code;
[0074] In step S103, the simulation code including the fault activation recovery logic simulation code and the real application layer code of the tested vehicle control unit are compiled into a virtual vehicle control unit that can be run on the simulation test platform;
[0075] In step S104, a test operation is performed on the virtual vehicle control unit to implement a simulation test on the tested vehicle control unit.
[0076] First, the preset information of the vehicle control unit under test is obtained, wherein the preset information at least includes a first mapping relationship table between fault signals and application layer interfaces. In the present application, in order to improve the consistency between the SIL test environment and the real vehicle test environment, the preset information includes at least the first mapping relationship table between fault signals and application layer interfaces in addition to the necessary information for generating simulated RTE layer code and simulating underlying OS code. In addition, it may also include memory variable description information, interface information and internal behavior description information, and a second mapping relationship table between application layer interfaces and external network communication signals.
[0077] In one embodiment of the present application, it includes: (1) arxml (an XML file format used in Autosar) files, code files and A2L files (a file format used to describe the measurement and calibration parameters of the ECU) of the SWC (Software Component) corresponding to each application in the application layer. Among them, arxml contains the interface information and internal behavior description of each component, and A2L is used to calibrate and observe internal variables. In order to ensure the functional integrity of the ECU, all SWCs of the application layer should be included, but the absence of them will not affect the normal operation of the virtual ECU. (2) A mapping relationship table between the software application layer interface name and the external network communication signal. (3) A mapping relationship table between the EID (Engine Data Interface) and FID (Engine Data Interface) that represent the fault state and the application layer interface. (4) A description table of the variables related to the EEPROM (Electrically Erasable Programmable Read-Only Memory).
[0078] Secondly, a state transfer simulation code between the fault signal and the application layer is generated, and a connection relationship between the fault signal and the application layer interface is established in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code.
[0079] Among them, (1) in order to test the fault state of the system diagnostic function machine, the present application generates a fault activation recovery logic simulation code: first, generate a state transfer simulation code between the fault signal and the application layer; then, since there is a correspondence between the fault signal and the application layer interface in the first mapping relationship table, the connection relationship between the fault signal and the application layer interface can be established in the state transfer simulation code through the first mapping relationship table to obtain the fault activation recovery logic simulation code. Specifically, the fault signal includes an EID signal and a FID signal, and the simulation code of the fault activation recovery logic can be automatically generated according to the mapping relationship between EID, FID and the application layer interface. Specifically, the underlying fault mechanism is abstracted as the state transfer between the EID signal, the FID signal and the application layer interface, and a simulation code file is generated through the correspondence table between the three. If the fault is detected by the application layer, the application layer first sets the corresponding interface after detecting the corresponding fault and passes it to the underlying code. The underlying code then sets the EID, FID, and the corresponding application layer interface in sequence. After the fault is recovered and the corresponding reset conditions are met, the EID, FID, and the corresponding application layer interface are restored in sequence. If it is a fault detected by the underlying layer, the EID is directly used as the input interface, and the corresponding EID can be manually activated. The subsequent signal transmission is the same as the previous one, and the fault degradation handling measures of the application layer code can be tested.
[0080] (2) In order to ensure the normal operation of the test, the present application also generates the operation environment layer simulation code and the underlying operating system simulation code: the interface information and internal behavior description information in the preset information are parsed to generate the operation environment layer simulation code and the underlying operating system simulation code, wherein the internal behavior description information is the description information used to explain the function and behavior of a specific block or function in the code; specifically, the interface information and internal behavior description in the arxml file parsed by the SWC corresponding to each application in the application layer are used to automatically generate virtual RTE layer code and underlying OS code that comply with the Autosar specification standard. There are many ways to implement the automated generation here, such as using professional SIL simulation software for generation, or using a preset code file template and using an automated script to supplement the corresponding content into the code file, and the present application does not limit this.
[0081] (3) In addition, in another embodiment of the present application, a memory function simulation code is also generated: first, the variable value in the variable description information is extracted. For example, the variable name, data type and storage value of the variable are defined in the EEPROM storage variable description table, and the information in the description table can be read by an automated script. Then, an operation code for reading and writing the variable value is generated; finally, the operation code for reading and writing the variable value is written into a code file to generate a memory function simulation code. In addition, during the simulation process, the code file has the following functions to update the memory function simulation code. When the simulation test platform detects that the software is initialized, the initial value of the variable stored in the code file is read; when the software ends, the simulation test platform writes the memory value of the variable, that is, the variable value that changes when the software is running, into the code file to update the variable value. For example, the initial value stored in the txt file is read when the software is initialized, and the memory value is written into the txt file when the software ends. For another example, the user in the car can set the seat angle by reading the user's pre-set information when the software starts, and the seat setting information can be stored through this code after the user modifies it. It should be noted that, in addition to the above information, the preset information also includes code files and A2L files (file formats used to describe the measurement and calibration parameters of the ECU). The code includes general code and assignments. The general code is pre-stored, and then the values are assigned in the information extracted by the preset information during the above automatic code generation process, thereby forming the automatically generated code.
[0082] Then, after obtaining the simulation code, the simulation code including the fault activation recovery logic simulation code and the real application layer code of the vehicle control unit under test are compiled into a virtual vehicle control unit that can run on the simulation test platform, forming a complete virtual vehicle control unit including application layer code, RTE layer code and underlying code.
[0083] Finally, the virtual vehicle control unit is tested to realize the simulation test of the vehicle control unit under test. In order to conduct the test, it is necessary to construct a controlled object model corresponding to the virtual vehicle control unit: first, the controlled object model is generated through the sensor signals directly collected by the vehicle control unit under test, the actuator signals directly controlled by the vehicle control unit under test, the signals of the vehicle control unit under test, the signals of other vehicle control units, the input and output interface model and the business logic model. In order to realize the closed loop of the control function of VECU, the controlled object is modeled and simulated. Among them, the controlled object model should at least include the sensor signals directly collected by the tested ECU, the actuator signals directly controlled by the tested ECU, and the signals of the tested ECU and other required ECUs, so as to finally achieve the purpose of consistent functional performance with the real vehicle environment. Then, the interactive interface of the controlled object model is connected to the interactive interface of the virtual vehicle control unit in a one-to-one correspondence, and the interactive interface includes an input and output interface and a communication interface. In order to communicate with VECU, the controlled object model should include an input and output interface model and a specific business logic model, and should be connected in a one-to-one correspondence with the final input and output / communication interface name of the virtual ECU. Furthermore, the connection form here is not limited to bus protocol connection, and can also be a direct connection of signal physical values without bus protocol. There are many options for the form of the controlled object model, such as Python file, Simulink model compiled into a specific format, or other modeling software supported by the SIL simulation test platform.
[0084] The virtual vehicle control unit and the controlled object model are imported into the simulation test platform to realize the simulation test of the tested vehicle control unit. Specifically, the VECU and the controlled object model are imported into the SIL simulation test platform, and the simulation can be run to perform manual testing or automated testing. Among them, the SIL simulation test platform can be Silver, VEOS or other commercial software for SIL simulation testing, which is not limited in this application.
[0085] like Figure 2 As shown in FIG. 1 , it is a schematic diagram of the structure of a SIL simulation test system in an embodiment of the present application. Figure 2As shown, the system includes three parts: VECU (virtual electronic control unit), controlled object model and SIL simulation test platform. Among them, VECU and controlled object model run on the SIL simulation test platform, and the simulation test platform controls the simulation operation to realize the signal closed loop between virtual ECU and controlled object model. In this embodiment, VECU is a file format that can be run on the SIL simulation test platform after adding simulation code and recompiling the real ECU code. VECU contains the application layer code of the real ECU, the simulated RTE layer code and the simulated bottom layer code. Specifically, the simulated RTE layer code and the bottom layer OS code are automatically generated according to the interface and internal behavior description file of the application layer SWC and the Autosar (Automotive Open System Architecture, an open architecture standard in the automotive industry) specification; the bottom layer fault activation recovery logic simulation code automatically generates code according to the input diagnosis table; the memory function simulation code automatically generates code according to the input related variable description table; the IO / communication interface signal processing code is automatically generated according to the input application layer interface and external signal mapping table. VECU is obtained by compiling the above code.
[0086] The beneficial effects of the present application are: by obtaining preset information of the vehicle control unit under test, wherein the preset information at least includes a first mapping relationship table between the fault signal and the application layer interface; generating a state transfer simulation code between the fault signal and the application layer, and establishing a connection relationship between the fault signal and the application layer interface in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code; compiling the simulation code including the fault activation recovery logic simulation code and the real application layer code of the vehicle control unit under test into a virtual vehicle control unit that can be run on a simulation test platform; and performing a test operation on the virtual vehicle control unit to realize a simulation test of the vehicle control unit under test. Since it includes the real application layer code and all the simulation codes including the fault activation recovery logic simulation code, in addition to the conventional testing of the application layer code and the underlying code, the underlying diagnostic function of the ECU can also be tested, thereby improving the consistency between the SIL test environment and the real vehicle test environment and improving the test effect.
[0087] In one embodiment, the preset information further includes memory variable description information, and the method can also be implemented as the following steps A1-A3:
[0088] In step A1, extract the variable value in the memory variable description information;
[0089] In step A2, an operation code for performing a read and write operation on the variable value is generated;
[0090] In step A3, the operation code for reading and writing the variable value is written into a code file to generate a memory function simulation code.
[0091] In this embodiment, the variable value in the memory variable description information is extracted; for example, the variable name, data type and storage value of the variable are defined in the EEPROM storage variable description table, and the information in the description table can be read by an automated script. Then, an operation code for reading and writing the variable value is generated; finally, the operation code for reading and writing the variable value is written into a code file to generate a memory function simulation code.
[0092] It should be noted that the memory function simulation code can also be updated by the following steps:
[0093] During the simulation process, the code file has the following functions: when the simulation test platform detects that the software is initialized, the initial value of the variable saved in the code file is read; when the software ends, the simulation test platform writes the memory value of the variable, that is, the variable value that changes during the software operation, into the code file to update the variable value. For example, when the software is initialized, the initial value saved in the txt file is read, and when the software ends, the memory value is written into the txt file.
[0094] For another example, when a user sets the seat angle in a car, the software can read the user's pre-set information when the software is started, and store the seat setting information through this code after the user modifies it.
[0095] In one embodiment, the preset information further includes interface information and internal behavior description information. The method can also be implemented as the following step B1:
[0096] In step B1, the interface information and internal behavior description information in the preset information are parsed to generate operating environment layer simulation code and underlying operating system simulation code, wherein the internal behavior description information is description information used to explain the function and behavior of a specific block or function in the code.
[0097] In this embodiment, the interface information and internal behavior description information in the preset information are parsed to generate the operating environment layer simulation code and the underlying operating system simulation code, wherein the internal behavior description information is the description information used to explain the function and behavior of a specific block or function in the code; specifically, the interface information and internal behavior description in the arxml file parsed by the SWC corresponding to each application in the application layer are used to automatically generate virtual RTE layer code and underlying OS code that conform to the Autosar specification standard. There are many ways to implement the automatic generation here, such as using professional SIL simulation software for generation, or using a preset code file template and using an automated script to supplement the corresponding content into the code file, which is not limited by this application.
[0098] In addition, common forms of internal behavior description information include: comments, document strings, and class and function signatures, among which comments refer to the use of comments in the code to explain the function and purpose of a specific line or block.
[0099] Among them, comments are marked with specific syntax or symbols (such as / / or / *…* / ) and placed next to or below the code.
[0100] A documentation string is a text string used to describe the functions, parameters, return values, etc. of a function, class, or module at its definition. The documentation string is usually located at the top of the function or class definition and is identified by a specific comment symbol (such as """...""" or '"...''').
[0101] Class and function signatures refer to descriptive names used when naming classes or functions. Using class and function signatures can directly reflect their functions and purposes in the code. By choosing meaningful names, the behavior of the code can be clearly expressed without the need for additional comments.
[0102] In one embodiment, the preset information further includes a second mapping relationship table between the application layer interface and the external network communication signal. The method can also be implemented as the following steps C1-C2:
[0103] In step C1, the mapping relationship between the application layer interface and the external network communication signal in the second mapping relationship table is called;
[0104] In step C2, the operating environment layer simulation code and the underlying operating system simulation code are modified through the mapping relationship to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment.
[0105] In this embodiment, in order to process the interface name into the interface name corresponding to the real vehicle environment, the second mapping relationship table containing the correspondence between the application layer interface and the external network communication signal is used to automatically generate the simulation code of IO / communication signal mapping, and process the virtual ECU interface name to be consistent with the real vehicle environment. The specific modification process is as follows:
[0106] First, the mapping relationship between the application layer interface and the external network communication signal in the second mapping relationship table is called, for example, the corresponding relationship between the application layer interface and the external network communication signal in the mapping relationship table is read through a script.
[0107] Then, the operating environment layer simulation code and the underlying operating system simulation code are modified through the mapping relationship to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment.
[0108] In one embodiment, the above step C2 can be implemented as the following steps C21-C22:
[0109] In step C21, a target simulation code for mapping input and output signals with communication signals is generated through the second mapping relationship table;
[0110] In step C22, the target simulation code is periodically called to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment.
[0111] In this embodiment, the target simulation code for mapping input and output signals with communication signals is generated through the second mapping relationship table; for example, the correspondence between the application layer interface and the external network communication signal in the mapping relationship table is read through a script, and a new code file is added to perform assignment operations between the input and output signals of the external network communication and the interface between the previously generated RTE layer code and the underlying code.
[0112] Then, the target simulation code is periodically called to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment.
[0113] In one embodiment, the above step S104 may be implemented as the following steps D1-D2:
[0114] In step D1, a controlled object model corresponding to the virtual vehicle control unit is constructed;
[0115] In step D2, the virtual vehicle control unit and the controlled object model are imported into a simulation test platform to implement a simulation test on the tested vehicle control unit.
[0116] In this embodiment, a controlled object model corresponding to the virtual vehicle control unit is constructed; specifically, the controlled object model is generated through sensor signals directly collected by the tested vehicle control unit, actuator signals directly controlled by the tested vehicle control unit, signals of the tested vehicle control unit, signals of other vehicle control units, input-output interface models, and business logic models; then the interactive interface of the controlled object model is connected one-to-one with the interactive interface of the virtual vehicle control unit, and the interactive interface includes an input-output interface and a communication interface.
[0117] Finally, the virtual vehicle control unit and the controlled object model are imported into a simulation test platform to implement a simulation test on the tested vehicle control unit.
[0118] In one embodiment, the above step D1 can be implemented as the following steps D11-D12:
[0119] In step D11, a controlled object model is generated through sensor signals directly collected by the tested vehicle control unit, actuator signals directly controlled by the tested vehicle control unit, signals of the tested vehicle control unit, signals of other vehicle control units, input and output interface models, and business logic models;
[0120] In step D12, the interactive interface of the controlled object model is connected to the interactive interface of the virtual vehicle control unit in a one-to-one correspondence, and the interactive interface includes an input and output interface and a communication interface.
[0121] In this embodiment, the controlled object model is generated through the sensor signals directly collected by the tested vehicle control unit, the actuator signals directly controlled by the tested vehicle control unit, the signals of the tested vehicle control unit, the signals of other vehicle control units, the input and output interface model and the business logic model. In order to realize the closed loop of the control function of the VECU, the controlled object is modeled and simulated. Among them, the controlled object model should at least include the sensor signals directly collected by the tested ECU, the actuator signals directly controlled by the tested ECU, and the signals of the tested ECU and other required ECUs, so as to finally achieve the purpose of functional performance consistent with the actual vehicle environment.
[0122] Then, the interactive interface of the controlled object model is connected to the interactive interface of the virtual vehicle control unit in a one-to-one correspondence, and the interactive interface includes an input and output interface and a communication interface. In order to communicate with the VECU, the controlled object model should include an input and output interface model and a specific business logic model, and should be connected in a one-to-one correspondence with the final input and output / communication interface name of the virtual ECU. Furthermore, the connection form here is not limited to bus protocol connection, but can also be a direct connection of signal physical values without bus protocol. There are many options for the form of the controlled object model, such as Python files, simulink models compiled into a specific format, or modeling software supported by other SIL simulation test platforms.
[0123] Figure 3 FIG. 1 is a schematic diagram of a structure of a simulation test device in an embodiment of the present application. Figure 3 As shown, the device comprises:
[0124] An acquisition module 301 is used to acquire preset information of the vehicle control unit under test, wherein the preset information at least includes a first mapping relationship table between a fault signal and an application layer interface;
[0125] The first generating module 302 is used to generate a state transfer simulation code between the fault signal and the application layer, and establish a connection relationship between the fault signal and the application layer interface in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code;
[0126] A compiling module 303, used to compile the simulation code including the fault activation recovery logic simulation code and the real application layer code of the tested vehicle control unit into a virtual vehicle control unit that can be run on the simulation test platform;
[0127] The testing module 304 is used to implement a simulation test on the tested vehicle control unit by performing a testing operation on the virtual vehicle control unit.
[0128] In one embodiment, the preset information further includes memory variable description information, and the device further includes:
[0129] An extraction module, used for extracting variable values in the memory variable description information;
[0130] A second generating module is used to generate an operation code for performing a read and write operation on the variable value;
[0131] The third generating module is used to write the operation code for reading and writing the variable value into a code file to generate a memory function simulation code.
[0132] In one embodiment, the preset information further includes interface information and internal behavior description information, and the device further includes:
[0133] The fourth generation module is used to parse the interface information and internal behavior description information in the preset information to generate the operating environment layer simulation code and the underlying operating system simulation code, wherein the internal behavior description information is the description information used to explain the function and behavior of a specific block or function in the code.
[0134] In one embodiment, the first generating submodule is further used for:
[0135] According to the mapping relationship between EID, FID and application layer interface, the simulation code of fault activation recovery logic is automatically generated.
[0136] In one embodiment, the preset information further includes a second mapping relationship table between the application layer interface and the external network communication signal, and the device further includes:
[0137] A calling module, used for calling the mapping relationship between the application layer interface and the external network communication signal in the second mapping relationship table;
[0138] The modification module is used to modify the operating environment layer simulation code and the underlying operating system simulation code through the mapping relationship so as to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment.
[0139] In one embodiment, the modification module includes:
[0140] A generating submodule, used for generating a target simulation code for mapping input and output signals with communication signals through the second mapping relationship table;
[0141] The modification submodule is used to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment by periodically calling the target simulation code.
[0142] In one embodiment, the test module includes:
[0143] A construction submodule, used to construct a controlled object model corresponding to the virtual vehicle control unit;
[0144] The import submodule is used to import the virtual vehicle control unit and the controlled object model into the simulation test platform to realize the simulation test of the tested vehicle control unit.
[0145] In one embodiment, the construction submodule is further used to:
[0146] Generate a controlled object model through sensor signals directly collected by the tested vehicle control unit, actuator signals directly controlled by the tested vehicle control unit, signals of the tested vehicle control unit, signals of other vehicle control units, input and output interface models, and business logic models;
[0147] The interactive interface of the controlled object model is connected to the interactive interface of the virtual vehicle control unit in a one-to-one correspondence, and the interactive interface includes an input and output interface and a communication interface.
[0148] Figure 4 FIG. 1 is a schematic diagram of the hardware structure of a simulation test system in one embodiment of the present application. Figure 4 As shown, the simulation test system includes:
[0149] at least one processor 420; and,
[0150] A memory 404 in communication with the at least one processor 420; wherein,
[0151] The memory 404 stores instructions that can be executed by the at least one processor 420 , and the instructions are executed by the at least one processor 420 to implement the simulation test method described in any of the above embodiments.
[0152] Reference Figure 4 The simulation test system 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0153] The processing component 402 generally controls the overall operation of the simulation test system 400. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0154] The memory 404 is configured to store various types of data to support the operation of the simulation test system 400. Examples of such data include instructions for any application or method operating on the simulation test system 400, such as text, pictures, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0155] The power supply component 406 provides power to various components of the simulation test system 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the simulation test system 400.
[0156] The multimedia component 408 includes a screen that provides an output interface between the simulation test system 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 may also include a front camera and / or a rear camera. When the simulation test system 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0157] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the simulation test system 400 is in an operation mode, such as an alarm mode, a recording mode, a voice recognition mode, and a voice output mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0158] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0159] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the simulation test system 400. For example, the sensor assembly 414 may include a sound sensor. In addition, the sensor assembly 414 may detect the open / closed state of the simulation test system 400, the relative positioning of the components, such as the display and keypad of the simulation test system 400, and the sensor assembly 414 may also detect the operating state of the simulation test system 400 or a component of the simulation test system 400, such as the operating state of the air distribution plate, the structural state, the operating state of the discharge scraper, etc., the orientation or acceleration / deceleration of the simulation test system 400 and the temperature change of the simulation test system 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, a material accumulation thickness sensor or a temperature sensor.
[0160] The communication component 416 is configured to enable the simulation test system 400 to provide the ability to communicate with other devices and cloud platforms in a wired or wireless manner. The simulation test system 400 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0161] In an exemplary embodiment, the simulation test system 400 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the simulation test methods described in any of the above embodiments.
[0162] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the simulation test system, the simulation test system can implement the simulation test method recorded in any of the above embodiments.
[0163] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0164] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0165] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0166] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0167] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A simulation test method, characterized in that: include: Acquire preset information of the tested vehicle control unit, wherein the preset information at least includes a first mapping relationship table between the fault signal and the application layer interface; Generate a state transfer simulation code between a fault signal and an application layer, and establish a connection relationship between the fault signal and the application layer interface in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code; Compiling the simulation code including the fault activation recovery logic simulation code and the real application layer code of the vehicle control unit under test into a virtual vehicle control unit that can be run on the simulation test platform; By performing a test operation on the virtual vehicle control unit, a simulation test on the tested vehicle control unit is achieved.
2. The method according to claim 1, characterized in that The preset information also includes memory variable description information, and the method further includes: Extracting variable values in the memory variable description information; Generate an operation code for reading and writing the variable value; The operation code for performing the read and write operations on the variable value is written into a code file to generate a memory function simulation code.
3. The method according to claim 1, characterized in that The preset information also includes interface information and internal behavior description information, and the method further includes: The interface information and internal behavior description information in the preset information are parsed to generate the operating environment layer simulation code and the underlying operating system simulation code, wherein the internal behavior description information is the description information used to explain the function and behavior of a specific block or function in the code.
4. The method according to claim 3, characterized in that The preset information also includes a second mapping relationship table between the application layer interface and the external network communication signal, and the method further includes: Calling the mapping relationship between the application layer interface and the external network communication signal in the second mapping relationship table; The operating environment layer simulation code and the underlying operating system simulation code are modified through the mapping relationship to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment.
5. The method according to claim 4, characterized in that The step of modifying the operating environment layer simulation code and the underlying operating system simulation code by using the mapping relationship to modify the interface names of the operating environment layer simulation code and the underlying operating system simulation code to be consistent with the actual vehicle environment includes: Generate a target simulation code for mapping input and output signals with communication signals through the second mapping relationship table; By periodically calling the target simulation code, the interface names of the operating environment layer simulation code and the underlying operating system simulation code are modified to be consistent with the actual vehicle environment.
6. The method according to claim 1, characterized in that The testing operation is performed on the virtual vehicle control unit to realize the simulation test of the tested vehicle control unit, including: Constructing a controlled object model corresponding to the virtual vehicle control unit; The virtual vehicle control unit and the controlled object model are imported into a simulation test platform to implement a simulation test on the tested vehicle control unit.
7. The method according to claim 6, characterized in that The step of constructing a controlled object model corresponding to the virtual vehicle control unit includes: Generate a controlled object model through sensor signals directly collected by the tested vehicle control unit, actuator signals directly controlled by the tested vehicle control unit, signals of the tested vehicle control unit, signals of other vehicle control units, input and output interface models, and business logic models; The interactive interface of the controlled object model is connected to the interactive interface of the virtual vehicle control unit in a one-to-one correspondence, and the interactive interface includes an input and output interface and a communication interface.
8. A simulation test device, characterized in that: include: An acquisition module, used to acquire preset information of the tested vehicle control unit, wherein the preset information at least includes a first mapping relationship table between the fault signal and the application layer interface; A first generating module is used to generate a state transfer simulation code between a fault signal and an application layer, and establish a connection relationship between the fault signal and the application layer interface in the state transfer simulation code through the first mapping relationship table to obtain a fault activation recovery logic simulation code; A compiling module, used for compiling the simulation code including the fault activation recovery logic simulation code and the real application layer code of the vehicle control unit under test into a virtual vehicle control unit that can be run on the simulation test platform; The test module is used to implement a simulation test on the tested vehicle control unit by performing a test operation on the virtual vehicle control unit.
9. A simulation test system, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to implement the simulation test method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor corresponding to the simulation test system, the simulation test system can implement the simulation test method as described in any one of claims 1 to 7.