Test method, device and electronic equipment of virtual ecu
By sending the simulation file of the virtual ECU to the target vehicle for testing and using the target vehicle's operating data to determine the test results, the problem of inaccurate virtual ECU test results is solved, achieving higher test accuracy and efficiency.
Patent Information
- Application Number
- CN202610401623.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-30
- Publication Date
- 2026-06-26
AI Technical Summary
The test results of virtual ECUs in the prior art are inaccurate, mainly because the test is conducted in a computer simulation system and the actual vehicle environment is different.
By acquiring the simulation file of the virtual ECU, it is sent to the target vehicle, which then executes the simulation file to start the virtual ECU. Data is collected during the operation of the target vehicle to determine the test results of the virtual ECU.
It achieves the effect of virtual ECU testing in real vehicles, improves testing accuracy, reduces development and testing processes, and improves development efficiency.
Smart Images

Figure CN122285509A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing, and more particularly to a testing method, apparatus, and electronic device for a virtual ECU. Background Technology
[0002] In existing technologies, when developing a virtual ECU, testing is typically performed within a computer simulation system. However, this method relies on a computer simulation, which differs from the environment of a real vehicle, leading to inaccurate test results. Summary of the Invention
[0003] This application provides a testing method, apparatus, and electronic device for virtual ECUs to solve the technical problem of inaccurate test results for virtual ECUs.
[0004] Firstly, this application provides a testing method for a virtual ECU, applied in the cloud, comprising: acquiring a simulation file of the virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; distributing the simulation file to a target vehicle, wherein the target vehicle executes the simulation file to start the virtual ECU, so as to control the target vehicle through the virtual ECU; acquiring operating data during the process of the virtual ECU controlling the target vehicle, wherein the operating data is data of the target vehicle collected during the operation of the target vehicle; and determining the test result of the virtual ECU based on the operating data.
[0005] As an optional example, distributing the simulation file to the target vehicle includes: sending a notification message to the target vehicle's OTA client, wherein the notification message includes the download address of the simulation file; and receiving a download request from the OTA client to distribute the simulation file to the target vehicle.
[0006] As an optional example, before distributing the simulation file to the target vehicle, the method further includes: determining the type of the virtual ECU to be tested; obtaining a simulation file matching the type; determining the real ECU included in each of all test vehicles; and identifying the test vehicle whose real ECU includes the virtual ECU as the target vehicle.
[0007] Secondly, this application provides a testing method for a virtual ECU, applied to a vehicle, comprising: obtaining a simulation file of the virtual ECU from the cloud, wherein the simulation file is an executable file obtained through code development and compilation; executing the simulation file to start the virtual ECU to control the target vehicle through the virtual ECU; collecting data during the operation of the target vehicle as operating data; and sending the operating data to the cloud so that the cloud can determine the test results of the virtual ECU based on the operating data.
[0008] As an optional example, obtaining the simulation file of the virtual ECU from the cloud includes: upon receiving a notification message, obtaining the download address of the simulation file from the notification message; and downloading the simulation file according to the download address.
[0009] As an optional example, executing the simulation file includes: creating a target virtual machine via the target vehicle's domain controller; loading the simulation file into the target virtual machine; and starting the target virtual machine to execute the simulation file.
[0010] As an optional example, the data of the target vehicle collected during operation as operational data includes: capturing messages from the vehicle bus through a recording module connected to the same vehicle bus as the virtual ECU, as operational data.
[0011] Thirdly, this application provides a testing device for a virtual ECU, applied in the cloud, comprising: a first acquisition module for acquiring a simulation file of the virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; a sending module for sending the simulation file to a target vehicle, wherein the target vehicle executes the simulation file to start the virtual ECU, so as to control the target vehicle through the virtual ECU; a second acquisition module for acquiring operating data during the process of the virtual ECU controlling the target vehicle, wherein the operating data is data of the target vehicle collected during the operation of the target vehicle; and a determination module for determining the test result of the virtual ECU based on the operating data.
[0012] Fourthly, this application provides a testing device for a virtual ECU, applied to a vehicle, comprising: an acquisition module for acquiring a simulation file of the virtual ECU from the cloud, wherein the simulation file is an executable file obtained through code development and compilation; a running module for executing the simulation file to start the virtual ECU, so as to control the target vehicle through the virtual ECU; a data acquisition module for acquiring data during the operation of the target vehicle as operating data; and a sending module for sending the operating data to the cloud, so that the cloud can determine the test results of the virtual ECU based on the operating data.
[0013] Fifthly, this application provides an electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement a test method for a virtual ECU of any of the above when executing the computer program.
[0014] Compared with the prior art, the technical solution provided in this application has the following advantages: The solution provided in this application obtains a simulation file of the virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; the simulation file is sent to the target vehicle, and the target vehicle executes the simulation file to start the virtual ECU, so as to control the target vehicle through the virtual ECU; the running data during the process of the virtual ECU controlling the target vehicle is obtained, wherein the running data is the data of the target vehicle collected during the operation of the target vehicle; the test result of the virtual ECU is determined based on the running data, thereby remotely sending the virtual ECU to the target vehicle for testing, and receiving the collected running data to determine the test result of the virtual ECU, realizing the effect of real vehicle testing of virtual ECU, and improving the testing accuracy of virtual ECU. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0018] Figure 1 A flowchart illustrating a testing method for a virtual ECU provided in this application embodiment; Figure 2 A flowchart illustrating another virtual ECU testing method provided in this application embodiment; Figure 3 A flowchart for testing a virtual ECU is provided as an embodiment of this application; Figure 4This is a schematic diagram of the structure of a test device for a virtual ECU provided in an embodiment of this application; Figure 5 A schematic diagram of the structure of another virtual ECU testing device provided in an embodiment of this application; Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0021] To address the technical problem of inaccurate test results for virtual ECUs in existing technologies, this application provides a test method for virtual ECUs that can improve the accuracy of virtual ECU testing.
[0022] Figure 1 A flowchart illustrating a testing method for a virtual ECU provided in an embodiment of this application. Figure 1 As shown, the testing method for the aforementioned virtual ECU includes: S102, Obtain the simulation file of the virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; S104, The simulation file is sent to the target vehicle, and the target vehicle executes the simulation file to start the virtual ECU, so as to control the target vehicle through the virtual ECU; S106, acquire the operating data during the process of virtual ECU controlling the target vehicle, wherein the operating data is the data of the target vehicle collected during the operation of the target vehicle; S108 determines the test results of the virtual ECU based on the operating data.
[0023] The above-mentioned testing method for virtual ECUs can be applied in the cloud. The cloud can obtain the simulation files obtained by the user in developing the virtual ECU. The simulation files are files obtained by the user after developing the code for the virtual ECU and compiling the code into an executable file. The file can be run on the virtual machine to simulate the function of the ECU.
[0024] Optional, Figure 2 A flowchart illustrating another virtual ECU testing method provided in this embodiment. Figure 2 As shown, it includes: S202, obtain the simulation file of the virtual ECU from the cloud, wherein the simulation file is an executable file obtained through code development and compilation; S204, Execute the simulation file to start the virtual ECU, so as to control the target vehicle through the virtual ECU; S206, Collect data during the operation of the target vehicle as operational data; S208 sends the operating data to the cloud so that the cloud can determine the test results of the virtual ECU based on the operating data.
[0025] Figure 2 The virtual ECU testing method shown can be applied to vehicles. The vehicle interacts with the cloud to obtain the virtual ECU simulation file, runs it on the vehicle, and collects operating data to feed back to the cloud.
[0026] The following is a detailed explanation.
[0027] The simulation file to be tested is stored in the cloud. This file is a compiled executable program containing complete perception and decision-making logic. The simulation file is not generated out of thin air, but is generated by the user developing code for the virtual ECU in the development environment. The resulting code is then compiled to obtain the simulation file.
[0028] In this application, code is developed for a virtual ECU in a development environment. The purpose is to simulate the function of a real ECU using a virtual ECU. The simulation file of the virtual ECU is then downloaded to the target vehicle for testing. If the virtual ECU passes the functional test, the code can be solidified into a real ECU, which can then be installed in the physical vehicle to control it. If errors or defects are found in the virtual ECU during testing, adjustments can be made, a new simulation file can be generated, and then downloaded to the target vehicle for testing. This eliminates a significant amount of development and testing steps, improving development efficiency. Furthermore, since the simulation file is downloaded to a real vehicle for testing, the test results are more accurate.
[0029] The developed simulation files can be uploaded to the platform for storage. The platform can then determine whether to distribute the simulation files to the target vehicle based on trigger conditions.
[0030] Triggering conditions can be varied. For example, manual triggering involves manually initiating a command to distribute a simulation file. The sender can choose which simulation file or version to distribute, as well as the target vehicle model, manufacturer, and location. Location is used to differentiate between different weather and road conditions, such as humid weather and muddy roads in the south, or dry weather and hard roads in the north. Triggering conditions can also be timed, such as setting a specific time to distribute the simulation file, or setting a preset number of target vehicles to which the simulation file can be distributed.
[0031] When distributing simulation files to the target vehicle, the cloud can use a network, such as 5G or Cellular Vehicle-to-Everything (C-V2X), to distribute the simulation files to the target vehicle located in a closed test range. Alternatively, the cloud can also distribute the simulation files to the target vehicle via Over-the-Air (OTA) technology.
[0032] After receiving the simulation file, the target vehicle starts the simulation file through its domain controller. At this point, the virtual ECU takes over control (or partial control) of the vehicle. It begins to receive real data from the vehicle's cameras and radar, performs calculations, and outputs throttle and brake commands to control the real vehicle to travel along the route set in the cloud.
[0033] During the operation of the target vehicle, onboard sensors (such as wheel speedometers and cameras) collect real-time data on the vehicle's motion status (position, speed, and attitude) as well as environmental perception data. Simultaneously, messages are captured on the vehicle bus to check whether the inputs and outputs of the virtual ECU meet expectations.
[0034] All the collected operational data is uploaded back to the cloud, where the test results of the virtual ECU are determined.
[0035] The solution provided in this application embodiment obtains a simulation file of a virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; the simulation file is sent to the target vehicle, and the target vehicle executes the simulation file to start the virtual ECU, thereby controlling the target vehicle through the virtual ECU; the operating data during the process of the virtual ECU controlling the target vehicle is obtained, wherein the operating data is data collected from the target vehicle during its operation; the test result of the virtual ECU is determined based on the operating data, thereby remotely sending the virtual ECU to the target vehicle for testing, and receiving the collected operating data to determine the test result of the virtual ECU, realizing the effect of testing the virtual ECU in a real vehicle, and improving the testing accuracy of the virtual ECU.
[0036] As an optional example, the cloud-based method of distributing the simulation file to the target vehicle includes: sending a notification message to the target vehicle's OTA client, wherein the notification message includes the download address of the simulation file; and receiving a download request from the OTA client to distribute the simulation file to the target vehicle.
[0037] In this application, when the cloud sends the simulation file to the target vehicle, it can do so via OTA (Over-The-Air) technology. A lightweight background service program, referred to as the OTA client, can reside permanently within the domain controller of the target vehicle. This client is responsible for maintaining a connection with the cloud, receiving instructions, and securely downloading and updating the simulation file.
[0038] The cloud can send a notification message to the OTA client of the target vehicle, carrying the download address of the simulation file in the notification message. After receiving the notification message, the OTA client downloads the simulation file from the download address.
[0039] When transmitting simulation files, a differential packet can be generated by comparing the old and new versions of the simulation file. This differential packet is then sent to the target vehicle. Alternatively, the new version of the simulation file can be sent directly to the target vehicle. The cloud will digitally sign the simulation file or differential packet (using a private key). Upon receiving the data, the target vehicle will verify the packet's legitimacy using the public key. Metadata is also transmitted along with the simulation file or differential packet. This metadata may include information such as the version number, file size, and checksum.
[0040] After the vehicle obtains the simulation file, it verifies the simulation file. If the verification passes, the simulation file is saved and ready to run.
[0041] In this application, the simulation file is distributed via OTA technology, achieving the effect of remotely distributing the simulation file.
[0042] As an optional example, before the cloud distributes the simulation file to the target vehicle, the above method also includes: determining the type of the virtual ECU to be tested; obtaining a simulation file matching the type; determining the real ECU included in each of all test vehicles; and identifying the test vehicle whose real ECU includes the virtual ECU as the target vehicle.
[0043] In this application, since virtual ECUs can be developed for vehicles from different manufacturers and of different models, different virtual ECUs can be developed. Each virtual ECU corresponds to a different simulation file. When distributing simulation files, it is necessary to select which type of virtual ECU simulation file to distribute.
[0044] When distributing simulation files, it's crucial to identify the target vehicle. This can be done by using the actual ECUs (Electronic Control Units) within each test vehicle as a basis for selection from all test vehicles. Specifically, identify the actual ECUs in each test vehicle; then, identify the test vehicles whose actual ECUs include the virtual ECU. The rationale for this is that if a test vehicle contains an actual ECU, the simulation file can be installed on that vehicle to replace the actual ECU and interact with the components, sensors, etc., that need to be controlled or interacted with. However, if the test vehicle does not contain the corresponding ECU, even if the simulation file is installed, it will not be possible to control the corresponding components, sensors, etc., through the simulation file.
[0045] For example, consider the control of vehicle windows. In a vehicle with a physical ECU, the physical ECU can control the windows. However, if a virtual ECU is developed, its simulation file can be downloaded to the vehicle to simulate the physical ECU and control the windows. In older vehicles, windows are controlled by physical buttons or cranks. Even with the simulation file, the vehicle cannot control the windows using the simulation file. Therefore, when identifying a target vehicle, it's crucial to ensure that the simulation file can replace the original physical ECU for vehicle control.
[0046] This application determines the target vehicle for testing the virtual ECU by obtaining the corresponding simulation file according to the type of the virtual ECU and by determining whether the test vehicle includes the simulation file.
[0047] As an optional example, the target vehicle obtains the simulation file of the virtual ECU from the cloud by: upon receiving a notification message, obtaining the download address of the simulation file from the notification message; and downloading the simulation file according to the download address.
[0048] In this application, the target vehicle can obtain simulation files from the cloud via OTA (Over-The-Air) technology. A lightweight background service program, referred to as the OTA client, can reside within the target vehicle's domain controller. This client is responsible for maintaining a connection with the cloud, receiving instructions, and securely downloading and updating simulation files.
[0049] The cloud can send a notification message to the OTA client of the target vehicle, carrying the download address of the simulation file in the notification message. After receiving the notification message, the OTA client downloads the simulation file from the download address.
[0050] When transmitting simulation files, a differential packet can be generated by comparing the old and new versions of the simulation file. This differential packet is then sent to the target vehicle. Alternatively, the new version of the simulation file can be sent directly to the target vehicle. The cloud will digitally sign the simulation file or differential packet (using a private key). Upon receiving the data, the target vehicle will verify the packet's legitimacy using the public key. Metadata is also transmitted along with the simulation file or differential packet. This metadata may include information such as the version number, file size, and checksum.
[0051] After the vehicle obtains the simulation file, it verifies the simulation file. If the verification passes, the simulation file is saved and ready to run.
[0052] In this application, the simulation file is distributed via OTA technology, achieving the effect of remotely distributing the simulation file.
[0053] As an optional example, executing the simulation file for the target vehicle includes: creating a target virtual machine through the target vehicle's domain controller; loading the simulation file into the target virtual machine; and starting the target virtual machine to execute the simulation file.
[0054] In this application, after the target vehicle downloads the simulation file from the cloud, a target virtual machine can be created through the target vehicle's domain controller, and then the simulation file can be loaded through the target virtual machine.
[0055] Since virtual ECUs cannot run directly on traditional automotive microcontrollers, this application installs a domain controller on the target vehicle. This domain controller centralizes the originally dispersed electronic system functional modules in the target vehicle into a single core processor. This significantly improves the overall system's functional integration and reduces the hardware requirements for sensing and executing various functions.
[0056] On the domain processor, the Hypervisor software is pre-installed, which virtualizes a single physical hardware unit into multiple logical hardware units. On the Hypervisor, a target virtual machine is created, specifically designed to simulate the processor resources, memory, and network interface environment required for the virtual ECU to operate.
[0057] To enable data exchange between the virtual ECU and other components and sensors on the target vehicle, the physical wiring of the domain controller, such as the Ethernet port and CAN FD interface, must be correctly connected. Then, in the Hypervisor configuration, the physical network card is mapped to the target virtual machine. For example, the physical CAN FD channel 1 is mapped to the virtual machine's "virtual CAN port 1".
[0058] Inside the target virtual machine, configure the network protocol stack so that the target virtual machine can understand the meaning of the data transmitted in the target vehicle.
[0059] Then the simulation file can be transferred to the domain controller, which will use the created target virtual machine to load the simulation file and run the virtual ECU.
[0060] After deployment, you can connect to the target virtual machine via a remote terminal to view the startup logs and confirm whether there are any errors (such as missing drivers or port conflicts).
[0061] Vehicle diagnostic tools can be used to check whether the virtual ECU can send and receive messages normally, such as whether it can correctly respond to the "vehicle speed" request to adjust the vehicle speed, or whether it can control the "lights" switch to adjust the lights.
[0062] To ensure safety, after the simulation file is distributed but before officially taking over control of the target vehicle by replacing the real ECU file with the simulation file, bus data can be monitored to verify whether the virtual ECU's input and output meet expectations. If, after verification, the virtual ECU's input and output are found to be as expected, the vehicle's control mode is switched, and actuators originally controlled by the traditional ECU (such as throttle and steering) are transferred to the virtual ECU via bus commands. A real-time monitoring channel is established. If the virtual ECU malfunctions (such as output timeout or value exceeding limits), control can be immediately severed and returned to the target vehicle's physical ECU.
[0063] In this application, by executing a simulation file on the target vehicle, the virtual ECU can be tested on a real vehicle, thereby improving the accuracy of testing the virtual ECU.
[0064] As an optional example, the target vehicle data collected during operation as operational data includes: capturing messages from the vehicle bus through a recording module connected to the same vehicle bus as the virtual ECU, as operational data.
[0065] In this application, after running a virtual ECU in the target vehicle, the virtual ECU can be connected to the vehicle's bus. Within the target vehicle, real ECUs communicate with each other via the vehicle bus. Therefore, connecting the virtual ECU to the target vehicle's bus allows the virtual ECU to communicate with real ECUs via the vehicle bus, thereby enabling communication and data transfer with other ECUs.
[0066] Once the virtual ECU is connected to the vehicle bus, it communicates with other real ECUs. At this time, a recording module connected to the vehicle bus can be used to capture messages from the vehicle bus, thereby collecting the target vehicle's operating data. This operating data includes the communication data between the virtual ECU and other real ECUs.
[0067] In this application, in order for the virtual ECU to recognize the data transmitted by other ECUs on the target vehicle, a whole vehicle database file can be imported into the virtual ECU. The virtual ECU can receive and parse bus messages through the database structure, thereby recognizing the meaning of the data sent by other ECUs.
[0068] In this application, the messages transmitted between the virtual ECU and other real ECUs are parsed into operating data, and the operating data is uploaded to the cloud, whereby the cloud determines the test results of the virtual ECU.
[0069] For example, during development, the control logic of the virtual ECU is designed to lower or raise the window at a constant speed A upon receiving a command to control the window. However, when the virtual ECU is deployed to the target vehicle for testing, after receiving the command, it sends the control command to the window control module via the target vehicle's vehicle bus, or the virtual ECU directly controls the window. The sensors detect the window's raising or lowering speed as speed B, which differs significantly from speed A. Therefore, as the sensors return the detected data to the virtual ECU via the target vehicle's vehicle bus, the recording module obtains the commands sent by the virtual ECU and the data returned by the sensors by acquiring messages on the vehicle bus. This data is then uploaded to the cloud as operational data. After analysis, the cloud can determine that the current control logic of the virtual ECU is unsuitable for the target vehicle and requires adjustment and retesting.
[0070] Figure 3 This is a flowchart of the testing of the virtual ECU in this application.
[0071] In this application, at the hardware level, a real-time computing platform is built on the target vehicle, including an embedded real-time processor running a real-time operating system, which is the domain controller in this application, used to run simulation files containing ECU control logic. A comprehensive range of vehicle interfaces are deployed on the target vehicle, including a real-time communication serial bus interface (Controller Area Network, CAN), a local interconnect network interface (Local Interconnect Network, LIN), and an in-vehicle Ethernet bus interface, for communication with other real ECUs on the target vehicle, as well as analog / digital inputs and outputs for acquiring or simulating sensor signals.
[0072] The power input is 9-36V DC, allowing for easy power drawing from the vehicle battery. The robust metal casing provides excellent heat dissipation and electromagnetic interference resistance. Automotive-grade connectors ensure reliable connections even in vibration environments. Wireless communication modules, such as 4G / 5G modules, are included for remote wide area network connectivity and OTA (Over-The-Air) updates.
[0073] For the software layer, the virtual ECU functional logic is developed in an environment such as Simulink or Python, and then compiled into an executable file, i.e., a simulation file, that can run on a real-time system.
[0074] After executing the simulation file on the target vehicle, the virtual ECU imports vehicle database files such as database files (Database Can, DBC), database transaction log files (Microsoft SQL Server, LDF), configuration files (AUTOSAR XML, ARXML), etc. It receives and parses bus messages through the database structure and uses them as input to the virtual ECU. The virtual ECU calculates the results based on the input signals and sends messages periodically or triggered by events.
[0075] An OTA agent is set up in the target vehicle, with a lightweight background service program, namely the OTA client, running continuously. This agent is responsible for maintaining a connection with the cloud, receiving instructions, securely downloading update packages such as simulation files, configurations, scripts, and firmware, and executing update tasks such as restarting services, loading new simulation files, collecting data including bus logs, system status, and test results, and compressing and uploading them to the cloud.
[0076] In the cloud, development engineers can manage the embedded real-time processors on all target vehicles via a browser. A version repository stores all versions of virtual ECUs, configurations, and test scripts. A task scheduler distributes update or test tasks to specified or grouped target vehicles, and a data and analysis module receives, stores, visualizes, and analyzes the massive amounts of test data transmitted from these target vehicles.
[0077] Figure 4 This is a schematic diagram of a test device for a virtual ECU provided in an embodiment of this application. Figure 4 As shown, the testing apparatus for the aforementioned virtual ECU includes: The first acquisition module 402 is used to acquire the simulation file of the virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; The sending module 404 is used to send the simulation file to the target vehicle, and the target vehicle executes the simulation file to start the virtual ECU, so as to control the target vehicle through the virtual ECU; The second acquisition module 406 is used to acquire the operating data during the process of virtual ECU controlling the target vehicle, wherein the operating data is the data of the target vehicle collected during the operation of the target vehicle; The determination module 408 is used to determine the test results of the virtual ECU based on the operating data.
[0078] In this application, Figure 4 The virtual ECU testing setup shown can be used in the cloud, where the simulation file to be tested is stored. This file is a compiled executable program containing complete perception and decision-making logic. The simulation file is not generated out of thin air, but rather obtained by the user developing code for the virtual ECU in a development environment, and the resulting code is then compiled to produce the simulation file.
[0079] In this application, code is developed for a virtual ECU in a development environment. The purpose is to simulate the function of a real ECU using a virtual ECU. The simulation file of the virtual ECU is then downloaded to the target vehicle for testing. If the virtual ECU passes the functional test, the code can be solidified into a real ECU, which can then be installed in the physical vehicle to control it. If errors or defects are found in the virtual ECU during testing, adjustments can be made, a new simulation file can be generated, and then downloaded to the target vehicle for testing. This eliminates a significant amount of development and testing steps, improving development efficiency. Furthermore, since the simulation file is downloaded to a real vehicle for testing, the test results are more accurate.
[0080] The developed simulation files can be uploaded to the platform for storage. The platform can then determine whether to distribute the simulation files to the target vehicle based on trigger conditions.
[0081] Triggering conditions can be varied. For example, manual triggering involves manually initiating a command to distribute a simulation file. The sender can choose which simulation file or version to distribute, as well as the target vehicle model, manufacturer, and location. Location is used to differentiate between different weather and road conditions, such as humid weather and muddy roads in the south, or dry weather and hard roads in the north. Triggering conditions can also be timed, such as setting a specific time to distribute the simulation file, or setting a preset number of target vehicles to which the simulation file can be distributed.
[0082] When distributing simulation files to the target vehicle, the cloud can use a network, such as 5G or Cellular Vehicle-to-Everything (C-V2X), to distribute the simulation files to the target vehicle located in a closed test range. Alternatively, the cloud can also distribute the simulation files to the target vehicle via Over-the-Air (OTA) technology.
[0083] After receiving the simulation file, the target vehicle starts the simulation file through its domain controller. At this point, the virtual ECU takes over control (or partial control) of the vehicle. It begins to receive real data from the vehicle's cameras and radar, performs calculations, and outputs throttle and brake commands to control the real vehicle to travel along the route set in the cloud.
[0084] During the operation of the target vehicle, onboard sensors (such as wheel speedometers and cameras) collect real-time data on the vehicle's motion status (position, speed, and attitude) as well as environmental perception data. Simultaneously, messages are captured on the vehicle bus to check whether the inputs and outputs of the virtual ECU meet expectations.
[0085] All the collected operational data is uploaded back to the cloud, where the test results of the virtual ECU are determined.
[0086] The solution provided in this application embodiment obtains a simulation file of a virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; the simulation file is sent to the target vehicle, and the target vehicle executes the simulation file to start the virtual ECU, thereby controlling the target vehicle through the virtual ECU; the operating data during the process of the virtual ECU controlling the target vehicle is obtained, wherein the operating data is data collected from the target vehicle during its operation; the test result of the virtual ECU is determined based on the operating data, thereby remotely sending the virtual ECU to the target vehicle for testing, and receiving the collected operating data to determine the test result of the virtual ECU, realizing the effect of testing the virtual ECU in a real vehicle, and improving the testing accuracy of the virtual ECU.
[0087] For other examples of this embodiment, please refer to the examples above, which will not be repeated here.
[0088] Figure 5 This is a schematic diagram of a test device for a virtual ECU provided in an embodiment of this application. Figure 5 As shown, the testing apparatus for the aforementioned virtual ECU includes: The acquisition module 502 is used to acquire the simulation file of the virtual ECU from the cloud, wherein the simulation file is an executable file obtained through code development and compilation; The execution module 504 is used to execute a simulation file to start a virtual ECU, so as to control the target vehicle through the virtual ECU; The data acquisition module 506 is used to collect data during the operation of the target vehicle as operational data. The sending module 508 is used to send the operating data to the cloud so that the cloud can determine the test results of the virtual ECU based on the operating data.
[0089] In this application, Figure 5 The virtual ECU testing device shown can be applied to the target vehicle.
[0090] The target vehicle in this application transmits data to the cloud via OTA technology. The cloud stores the simulation file to be tested, which is a compiled executable program containing complete perception and decision-making logic. The simulation file is not generated out of thin air, but is obtained by the user developing code for the virtual ECU in the development environment, and the resulting code is compiled to obtain the simulation file.
[0091] In this application, code is developed for a virtual ECU in a development environment. The purpose is to simulate the function of a real ECU using a virtual ECU. The simulation file of the virtual ECU is then downloaded to the target vehicle for testing. If the virtual ECU passes the functional test, the code can be solidified into a real ECU, which can then be installed in the physical vehicle to control it. If errors or defects are found in the virtual ECU during testing, adjustments can be made, a new simulation file can be generated, and then downloaded to the target vehicle for testing. This eliminates a significant amount of development and testing steps, improving development efficiency. Furthermore, since the simulation file is downloaded to a real vehicle for testing, the test results are more accurate.
[0092] The developed simulation files can be uploaded to the platform for storage. The platform can then determine whether to distribute the simulation files to the target vehicle based on trigger conditions.
[0093] Triggering conditions can be varied. For example, manual triggering involves manually initiating a command to distribute a simulation file. The sender can choose which simulation file or version to distribute, as well as the target vehicle model, manufacturer, and location. Location is used to differentiate between different weather and road conditions, such as humid weather and muddy roads in the south, or dry weather and hard roads in the north. Triggering conditions can also be timed, such as setting a specific time to distribute the simulation file, or setting a preset number of target vehicles to which the simulation file can be distributed.
[0094] When distributing simulation files to the target vehicle, the cloud can use a network, such as 5G or Cellular Vehicle-to-Everything (C-V2X), to distribute the simulation files to the target vehicle located in a closed test range. Alternatively, the cloud can also distribute the simulation files to the target vehicle via Over-the-Air (OTA) technology.
[0095] After receiving the simulation file, the target vehicle starts the simulation file through its domain controller. At this point, the virtual ECU takes over control (or partial control) of the vehicle. It begins to receive real data from the vehicle's cameras and radar, performs calculations, and outputs throttle and brake commands to control the real vehicle to travel along the route set in the cloud.
[0096] During the operation of the target vehicle, onboard sensors (such as wheel speedometers and cameras) collect real-time data on the vehicle's motion status (position, speed, and attitude) as well as environmental perception data. Simultaneously, messages are captured on the vehicle bus to check whether the inputs and outputs of the virtual ECU meet expectations.
[0097] All the collected operational data is uploaded back to the cloud, where the test results of the virtual ECU are determined.
[0098] The solution provided in this application embodiment obtains a simulation file of a virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; the simulation file is sent to the target vehicle, and the target vehicle executes the simulation file to start the virtual ECU, thereby controlling the target vehicle through the virtual ECU; the operating data during the process of the virtual ECU controlling the target vehicle is obtained, wherein the operating data is data collected from the target vehicle during its operation; the test result of the virtual ECU is determined based on the operating data, thereby remotely sending the virtual ECU to the target vehicle for testing, and receiving the collected operating data to determine the test result of the virtual ECU, realizing the effect of testing the virtual ECU in a real vehicle, and improving the testing accuracy of the virtual ECU.
[0099] For other examples of this embodiment, please refer to the examples above, which will not be repeated here.
[0100] like Figure 6 As shown in the figure, this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114. Memory 113 is used to store computer programs; In one embodiment of this application, the processor 111, when executing the program stored in the memory 113, implements the virtual ECU testing method provided in any of the foregoing method embodiments.
[0101] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the test method for the virtual ECU as provided in any of the foregoing method embodiments.
[0102] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0103] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0104] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0105] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A testing method for a virtual ECU, applied in the cloud, characterized in that, include: Obtain the simulation file of the virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; The simulation file is sent to the target vehicle, which executes the simulation file to start the virtual ECU, thereby controlling the target vehicle through the virtual ECU; The operation data during the process of the virtual ECU controlling the target vehicle is acquired, wherein the operation data is the data of the target vehicle collected during the operation of the target vehicle; Based on the operational data, the test results of the virtual ECU are determined.
2. The method according to claim 1, characterized in that, Distributing the simulation file to the target vehicle includes: Send a notification message to the OTA client of the target vehicle, wherein the notification message includes the download address of the simulation file; The system receives a download request from the OTA client to send the simulation file to the target vehicle.
3. The method according to claim 1, characterized in that, Before sending the simulation file to the target vehicle, the method further includes: Determine the type of virtual ECU to be tested; Based on the type, obtain the simulation file that matches the type; Identify the actual ECUs included in each of all test vehicles; The test vehicle that includes the virtual ECU in the real ECU is identified as the target vehicle.
4. A testing method for a virtual ECU, applied to a vehicle, characterized in that, include: The simulation file of the virtual ECU is obtained from the cloud, wherein the simulation file is an executable file obtained through code development and compilation; The simulation file is executed to start the virtual ECU, thereby controlling the target vehicle through the virtual ECU; Data collected during the operation of the target vehicle is used as operational data. The operational data is sent to the cloud so that the cloud can determine the test results of the virtual ECU based on the operational data.
5. The method according to claim 4, characterized in that, The simulation files for the virtual ECU obtained from the cloud include: Upon receiving a notification message, the download address of the simulation file is obtained from the notification message; Download the simulation file from the provided download address.
6. The method according to claim 4, characterized in that, Executing the simulation file includes: Create a target virtual machine using the domain controller of the target vehicle; Load the simulation file into the target virtual machine; Start the target virtual machine to execute the simulation file.
7. The method according to claim 4, characterized in that, The data collected from the target vehicle during operation, as operational data, includes: The recording module, which is connected to the same vehicle bus as the virtual ECU, captures messages from the vehicle bus as the operating data.
8. A testing device for a virtual ECU, applied in the cloud, characterized in that, include: The first acquisition module is used to acquire the simulation file of the virtual ECU, wherein the simulation file is an executable file obtained through code development and compilation; The sending module is used to send the simulation file to the target vehicle, and the target vehicle executes the simulation file to control the target vehicle through the virtual ECU; The second acquisition module is used to acquire the operating data during the process of the virtual ECU controlling the target vehicle, wherein the operating data is the data of the target vehicle collected during the operation of the target vehicle; The determination module is used to determine the test results of the virtual ECU based on the operating data.
9. A testing device for a virtual ECU, applied to a vehicle, characterized in that, include: The acquisition module is used to acquire the simulation file of the virtual ECU from the cloud, wherein the simulation file is an executable file obtained through code development and compilation; The running module is used to execute the simulation file to start the virtual ECU, so as to control the target vehicle through the virtual ECU; The data acquisition module is used to collect data during the operation of the target vehicle as operational data. The sending module is used to send the operating data to the cloud so that the cloud can determine the test results of the virtual ECU based on the operating data.
10. An electronic device, characterized in that, include: At least one communication interface; At least one bus connected to the at least one communication interface; At least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor executes the computer program to implement the test method for the virtual ECU as described in any one of claims 1 to 3 or 4 to 7.