Virtual testing platform, testing method, storage medium, and computer program product
By combining virtual electronic control units and simulation testing environments at both local and cloud-based testing terminals in a virtual testing platform, the problem of low efficiency in automotive electronic controller simulation testing has been solved, achieving efficient simulation testing and reduced hardware costs.
Patent Information
- Application Number
- PCT/CN2024/144044
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-24
- Filing Date
- 2024-12-30
- Publication Date
- 2026-01-02
AI Technical Summary
In the existing technology, the simulation testing efficiency of automotive electronic controllers is low, mainly due to the rapid software version updates and iterations and the reliance on customized hardware development, which leads to low testing efficiency.
A virtual testing platform is adopted, including a local testing terminal and a cloud testing terminal. By creating a virtual electronic control unit locally and building a simulation test execution environment in the cloud, simulation testing is carried out using test cases, thus avoiding customized hardware development.
It improves simulation testing efficiency, adapts to various testing needs, reduces hardware costs, and reduces execution errors caused by clock asynchrony.
Smart Images

Figure CN2024144044_02012026_PF_FP_ABST
Abstract
Description
Virtual testing platforms, testing methods, storage media, and computer program products Cross-references to related applications
[0001] This application claims priority to Chinese patent application CN202410826090.3, filed on June 24, 2024, entitled “Virtual Test Platform, Test Method, Storage Medium and Computer Program Product”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of simulation technology, and more specifically, to a virtual testing platform, a testing method, a computer-readable storage medium, and a computer program product. Background Technology
[0003] With the continuous development of automotive technology in the fields of new energy and intelligent driving, newly developed functions in automobiles are mainly defined by software. During automotive software development, these newly developed software functions run in the Electronic Control Unit (ECU), requiring simulation testing of the ECU to verify the software's various functions. Due to the rapid pace of software version updates and the fact that most simulation tests rely on customized development of the ECU hardware, the efficiency of ECU simulation testing is relatively low. Summary of the Invention
[0004] The purpose of this application is to provide a virtual testing platform, testing method, computer-readable storage medium, and computer program product to improve the efficiency of simulation testing of electronic controllers.
[0005] In a first aspect, this application provides a virtual testing platform, comprising: a local testing terminal and a cloud testing terminal; the local testing terminal is used to create and run a virtual electronic control unit; the cloud testing terminal is communicatively connected to the local testing terminal, and the cloud testing terminal is configured with a simulation test execution environment; the cloud testing terminal is used to perform simulation testing on the virtual electronic control unit based on the simulation test execution environment and according to test cases.
[0006] In this embodiment, a virtual electronic control unit (ECU) is created and run on a local testing terminal, while a simulation test execution environment is built on a cloud-based testing terminal. Test cases are used to simulate and test various functions of the virtual ECU. For different testing needs, a corresponding simulation test execution environment is configured on the cloud-based testing terminal to simulate and test the virtual ECU on the local testing terminal. This ensures that the testing phase is not affected or limited by the electronic controller hardware, eliminating the need for customized development of the electronic controller hardware and improving simulation testing efficiency.
[0007] In an optional implementation, the cloud-based testing terminal includes a simulation environment configuration module, which is used to receive simulation environment configuration instructions and construct the simulation test execution environment according to the environment configuration instructions.
[0008] In this embodiment of the application, different testing requirements correspond to different simulation test execution environments. A simulation environment configuration module is set in the cloud test terminal to receive simulation environment configuration instructions to build a simulation test execution environment that meets different testing requirements, thereby realizing the adaptation of the virtual test platform to various testing requirements.
[0009] In an optional implementation, the simulation test execution environment includes at least one physical model, which is used to generate test signals for simulating the virtual electronic control unit based on the test cases.
[0010] In this embodiment of the application, a simulation test execution environment is generated through a physical model, thereby ensuring that the simulation test execution environment meets the test requirements.
[0011] In an optional implementation, the cloud-based testing terminal includes a test management module, which is used to generate the test cases according to editing instructions.
[0012] In this embodiment, the test management module receives editing instructions from testers and generates test cases based on these instructions. Testers can flexibly edit test cases according to actual needs, improving the applicability of the virtual testing platform and increasing the efficiency of test case generation.
[0013] In an optional implementation, the virtual testing platform further includes a task scheduler; the task scheduler is connected to both the local testing terminal and the cloud testing terminal, and is used to send task scheduling instructions to the local testing terminal and the cloud testing terminal, and to monitor the task execution status of the local testing terminal and the cloud testing terminal.
[0014] In this embodiment, a task scheduler is set up to send task scheduling instructions to the local test terminal and the cloud test terminal, and to monitor the task execution status of the local test terminal and the cloud test terminal. This enables the local test terminal and the cloud test terminal to execute the corresponding local tasks and cloud tasks according to the task scheduling instructions, thereby reducing execution logic errors or execution time errors caused by the clock asynchrony between the local test terminal and the cloud test terminal, and thus satisfying the logical correctness and timing correctness of the local tasks and the cloud tasks.
[0015] In an optional implementation, the virtual testing platform further includes a virtual data bus, which is connected to both the local testing terminal and the cloud testing terminal, and is used to transmit test data between the local testing terminal and the cloud testing terminal.
[0016] In this embodiment, a virtual data bus is set up to realize the test data transmission between the local test terminal and the cloud test terminal. The local test terminal and the cloud test terminal do not need to be connected by a physical bus, which reduces hardware costs and allows for remote simulation testing.
[0017] Secondly, this application provides a testing method applied to a virtual testing platform, the virtual testing platform including a local testing terminal and a cloud testing terminal, the method comprising: creating and running a virtual electronic control unit on the local testing terminal according to electronic control unit configuration instructions; configuring a simulation test execution environment on the cloud testing terminal according to simulation environment configuration instructions; and performing simulation testing on the virtual electronic control unit in the simulation test execution environment according to test cases.
[0018] In an optional implementation, the test cases include cloud tasks and local tasks. The step of performing simulation testing on the virtual electronic control unit in the simulation test execution environment according to the test cases includes: the cloud test terminal generating a test signal in the simulation test execution environment according to the cloud task; sending the test signal to the local test terminal; the virtual electronic control unit in the local test terminal generating a response signal according to the local task and the test signal; sending the response signal to the cloud test terminal; and the cloud test terminal determining the test result based on the response signal.
[0019] In an optional implementation, the simulation test execution environment includes at least one physical model, and the cloud test terminal generates a test signal in the simulation test execution environment according to the cloud task, including: determining a target physical model from the simulation test execution environment according to the cloud task; and injecting the cloud task into the target physical model to generate the test signal.
[0020] In an optional implementation, the virtual testing platform further includes a task scheduler; the method further includes: the task scheduler determining the current cloud task and the current local task according to the test case; correspondingly, the cloud testing terminal generates a test signal in the simulation test execution environment according to the cloud task, including: the cloud testing terminal receiving the current cloud task sent by the task scheduler; the cloud testing terminal generating a test signal in the simulation test execution environment according to the current cloud task; correspondingly, the virtual electronic control unit in the local testing terminal generates a response signal according to the local task and the test signal, including: the local testing terminal receiving the current local task sent by the task scheduler; the local testing terminal generating a response signal according to the current local task and the test signal.
[0021] Thirdly, this application provides a computer-readable storage medium storing computer program instructions, which, when read and executed by a computer, perform a method corresponding to any of the embodiments in the second aspect.
[0022] Fourthly, this application provides a computer program product, which includes a computer program that, when executed by a processor, implements the method corresponding to any of the embodiments in the second aspect described above. Attached Figure Description
[0023] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application, and other related drawings can be obtained based on these drawings.
[0024] Figure 1 is a schematic diagram of the structure of a virtual testing platform provided in this application example;
[0025] Figure 2 is a schematic diagram of the structure of a cloud-based testing terminal provided in this application example;
[0026] Figure 3 is a schematic diagram of another virtual testing platform provided in this application example;
[0027] Figure 4 is a flowchart illustrating a testing method provided in an embodiment of this application;
[0028] Figure 5 is a schematic diagram of the execution flow of a test case provided in an embodiment of this application. Detailed Implementation
[0029] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0030] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0031] With the continuous development of automotive technology in the fields of new energy and intelligent driving, more and more newly developed functions in a car are defined by software. Due to the increasing computing power of chips, the functions of multiple controllers are integrated into one or more vehicle electronic controllers in the automotive electronic and electrical architecture. To ensure that the newly developed automotive software functions correctly, simulation testing methods are needed to verify the correctness and reliability of the software functionality development.
[0032] In automotive software development, newly developed software functions run within electronic controllers (ECAs), which provide the operating environment for these functions. Therefore, simulating and testing automotive electronic control systems can be understood as simulating and testing the EDAC. However, due to the rapid pace of software version updates and the diverse testing requirements of different versions, customized development of the EDAC hardware is necessary, resulting in long design cycles and consequently, low simulation and testing efficiency.
[0033] Therefore, this application provides a virtual testing platform, which includes a local testing terminal and a cloud testing terminal. A virtual electronic control unit (ECU) is created and run on the local testing terminal, while a simulation test execution environment is built on the cloud testing terminal. Test cases are used to simulate and test various functions of the virtual ECU. For different testing needs, a corresponding simulation test execution environment is configured on the cloud testing terminal to simulate and test the virtual ECU on the local testing terminal. This ensures that the testing phase is not affected or limited by the electronic controller hardware, eliminating the need for customized development of the electronic controller hardware and improving simulation testing efficiency.
[0034] The virtual testing platform disclosed in this application can, but is not limited to, perform simulation tests on electronic control units in equipment such as vehicles, ships, or aircraft.
[0035] Please refer to Figure 1, which is a schematic diagram of the structure of a virtual testing platform provided in this application example. The virtual testing platform 100 may include a local testing terminal 101 and a cloud testing terminal 102.
[0036] The local test terminal 101 is used to create and run the virtual electronic control unit. The local test terminal 101 can be a personal computer (PC), laptop, etc.
[0037] The cloud-based test terminal 102 is configured with a simulation test execution environment. Based on this environment, the cloud-based test terminal 102 performs simulation tests on the virtual ECU running in the local test terminal 101 according to the test cases. The cloud-based test terminal 102 can be a cloud server, a cloud server cluster, etc.
[0038] An ECU (Electronic Control Unit) is installed in a car to control its driving status and implement various control functions. An ECU can be understood as a circuit board that uses data acquisition and exchange from various sensors and buses on the car to determine the vehicle's status and driving intentions, thereby controlling the vehicle. During the software development phase, to reduce reliance on the ECU hardware, a virtual ECU is created on the local test terminal 101 to run the application-layer control logic.
[0039] In some implementations, the virtual ECU can be an executable binary file generated from source code on an x86 architecture. The virtual ECU runs under the Automotive Open System Architecture (AutoSAR), its interface is defined by ARXML files, and its logic is developed and implemented by application-layer software components (SWC).
[0040] The following describes how to create a virtual ECU on a local test server.
[0041] Obtain the source code or a fully defined static link file of the virtual ECU. Since the virtual ECU runs on the computer rather than on the ECU hardware, the hardware-related code needs to be removed from the hardware ECU's source code to obtain the source code or a fully defined static link file of the virtual ECU.
[0042] An interactive interface is integrated into a well-defined static link file of the virtual ECU's source code or interface. This interface enables communication and signal transmission between the virtual ECU and the cloud-based testing terminal. The virtual ECU's simulation test execution environment is deployed on the cloud-based testing terminal. During simulation testing of the virtual ECU, the cloud-based testing terminal generates test signals based on test cases and sends these signals to the virtual ECU. The virtual ECU performs logical processing based on the test signals, generates response signals, and sends these response signals to the cloud-based testing terminal for verification. The virtual ECU and the cloud-based testing terminal achieve this data interaction through the interactive interface.
[0043] After integrating the interactive interface, an executable binary file is generated on the local test terminal, which is the virtual ECU.
[0044] Furthermore, in some embodiments, the task scheduler is adapted in the source code or a well-defined static link file of the virtual ECU.
[0045] In this embodiment, since the local test terminal and the cloud test terminal are two different execution platforms, there may be differences in the operating clock signals between the different platforms. To achieve synchronous task execution, a task scheduler is set up to schedule tasks on both the local and cloud test terminals and monitor their task execution status. Therefore, during the creation of the virtual ECU on the local test terminal, the task scheduler is adapted in the source code or a well-defined static link file of the virtual ECU, enabling the task scheduler to perform task scheduling and monitoring of the virtual ECU.
[0046] During the task scheduler adaptation process, the interface of the task scheduler can be designed according to the requirements of the virtual ECU. The interface allows the task scheduler to communicate with the virtual ECU, such as obtaining the task list, setting task priorities, starting and stopping tasks, etc. Then, the code corresponding to the interface of the task scheduler can be written in the source code of the virtual ECU or the static link file with well defined interface, so that the task scheduler can be adapted to the virtual ECU generated according to the source code or the static link file.
[0047] The virtual testing platform provided in this application includes a local testing terminal and a cloud-based testing terminal. A virtual electronic control unit (ECU) is created and run on the local testing terminal, while a simulation test execution environment is built on the cloud-based testing terminal. Test cases are used to simulate and test various functions of the virtual ECU. For different testing needs, a corresponding simulation test execution environment is configured on the cloud-based testing terminal to simulate and test the virtual ECU on the local testing terminal. This ensures that the testing phase is not affected or limited by the electronic controller hardware, eliminating the need for customized development of the electronic controller hardware and improving simulation testing efficiency.
[0048] As an optional implementation, as shown in Figure 2, the cloud-based test terminal 102 may include a simulation environment configuration module and a test management module.
[0049] The simulation environment configuration module receives simulation environment configuration instructions and constructs a simulation test execution environment based on these instructions. These instructions can be used to select a desired model from a set of predefined physical models, and the simulation environment configuration module can load the corresponding model file based on this selection. As one implementation, the model file may include information such as the model's definition, parameters, and algorithms.
[0050] Different software functions correspond to different testing requirements, and different testing requirements correspond to different simulation test execution environments. By setting up a simulation environment configuration module in the cloud test terminal 102, simulation environment configuration instructions are received to build a simulation test execution environment that meets different testing requirements, thereby enabling the virtual test platform to adapt to various testing requirements.
[0051] In some implementations, the simulation test execution environment includes at least one physical model used to generate test signals for simulating the virtual electronic control unit based on test cases.
[0052] In this embodiment, the cloud test terminal 102 is pre-configured with at least one physical model, including but not limited to: vehicle dynamics model, power system model, low-pressure management model, high-pressure management model, scene simulation model, driver model, etc.
[0053] Vehicle dynamics models are used to simulate the dynamic response of vehicles under different operating conditions, such as high-speed driving, emergency braking, and cornering, in order to verify the control strategies and algorithms of the ECU.
[0054] The powertrain model is used to simulate the vehicle's power output and response to verify the ECU's control effectiveness over the powertrain. It can also simulate powertrain faults to test the ECU's response and handling capabilities under fault conditions.
[0055] The low-voltage management model is used to simulate various operating states of low-voltage electrical systems, such as battery charging and discharging, generator output voltage and current, etc., to verify the ECU's management capabilities of the low-voltage electrical system.
[0056] The high-voltage management model is used to simulate various operating conditions of high-voltage electrical systems, such as the charging and discharging of high-voltage batteries and the output of motor controllers, in order to verify the ECU's management capabilities of the high-voltage electrical system.
[0057] Scenario simulation models are used to provide a realistic test environment for ECU testing to verify the performance of the ECU in real road and traffic environments.
[0058] Driver models are used to simulate driver input in ECU testing to verify the ECU's ability to respond to and process driver intentions.
[0059] Users can input environment configuration commands related to this simulation test in the interactive interface provided by the cloud test terminal 102. The simulation environment configuration module receives the simulation environment configuration commands, determines the physical model corresponding to the simulation test execution environment according to the environment configuration commands, runs the physical model, and constructs the simulation test execution environment for this simulation test.
[0060] The aforementioned simulation environment configuration commands can be used to select the desired model from pre-configured physical models such as vehicle dynamics models, powertrain models, low-pressure management models, high-pressure management models, scenario simulation models, and driver models. The simulation environment configuration module can then load the corresponding model file based on this selection. As one implementation method, the aforementioned physical model can be a model in Functional Mock-Up Unit (FMU) format.
[0061] Taking the above simulation environment configuration instruction as an example of configuring a vehicle dynamics model, the simulation environment configuration module can load the parameters (such as vehicle mass, tire characteristics, suspension system parameters, etc.) and algorithms corresponding to the vehicle dynamics model, thereby completing the configuration of the simulation test execution environment.
[0062] The test management module is used to generate test cases based on editing instructions. It provides interface information for the simulation test execution environment. Users can input editing instructions through the interactive interface provided by the cloud-based test terminal 102. The test management module responds to these instructions by calling the corresponding interface information of the simulation test execution environment to edit the test cases.
[0063] Test cases can include multiple test steps, each corresponding to different test step information. Test step information includes, but is not limited to: driver input information, road environment information, and fault injection information. For example, during vehicle operation, the driver's action of pressing the brake pedal corresponds to one driver input: brake pedal opening 100%, gear selected as drive. As another example, the driver's action of releasing the brake pedal and pressing the drive pedal during vehicle operation corresponds to another driver input: brake pedal opening 0%, accelerator pedal opening 100%.
[0064] The test management module receives editing instructions from testers and generates test cases based on these instructions. Testers can flexibly edit test cases according to actual needs, improving the applicability of the virtual testing platform and increasing the efficiency of test case generation.
[0065] Furthermore, as an optional implementation, the test management module can also display test results. After the cloud-based test terminal 102 performs simulation tests on the virtual electronic control unit according to the test cases, it generates test results. These test results can be displayed on the cloud-based test terminal 102 through the test management module, so that testers can debug the virtual ECU based on the test results.
[0066] Furthermore, as an optional implementation, as shown in FIG3, the virtual testing platform 100 provided in this application embodiment may further include a task scheduler 103. The task scheduler 103 is connected to the local testing terminal 101 and the cloud testing terminal 102 respectively. The task scheduler 103 is used to send task scheduling instructions to the local testing terminal 101 and the cloud testing terminal 102, and to monitor the task execution status of the local testing terminal 101 and the cloud testing terminal 102.
[0067] In this embodiment, since the local test terminal 101 and the cloud test terminal 102 are two different execution platforms, there may be differences in the operating clock signals of the different platforms. During the simulation test of the virtual ECU, the test cases may include local tasks executed on the local test terminal 101 and cloud tasks executed on the cloud test terminal 102. The task scheduler 103 determines the cloud tasks and local tasks according to the test cases, monitors the task execution status of the local test terminal 101 and the cloud test terminal 102, and sends task scheduling instructions to the local test terminal 101 and the cloud test terminal 102 at the time set by the test cases. The local test terminal 101 and the cloud test terminal 102 execute the corresponding local tasks and cloud tasks according to the task scheduling instructions, thereby satisfying the logical correctness and timing correctness of the local tasks and cloud tasks. Logical correctness means that the local test terminal 101 executes the local tasks according to the logical order specified in the test cases, and the cloud test terminal 102 executes the cloud tasks according to the logical order specified in the test cases. Timing correctness refers to the local test terminal 101 executing the local task according to the time point set in the test case, and the cloud test terminal 102 executing the cloud task according to the time point set in the test case.
[0068] For example, a test case includes cloud task A, cloud task B, and local task C, executed in the following order: cloud task A, local task C, and cloud task B, looping 10 times. After the simulation test begins, cloud task A becomes the current cloud task. Task scheduler 103 first sends a task scheduling instruction to cloud test terminal 102, controlling cloud test terminal 102 to execute cloud task A and monitoring its execution status. After cloud test terminal 102 completes cloud task A, it sends an execution completion flag and the time for the next loop execution of cloud task A to task scheduler 103. After receiving the execution completion flag for cloud task A, task scheduler 103 sets local task C as the current local task. Task scheduler 103 sends a task scheduling instruction to local test terminal 101, controlling local test terminal 101 to execute local task C and monitoring its execution status. After local test terminal 101 completes local task C, it sends an execution completion flag and the time for the next loop execution of local task C to task scheduler 103. After receiving the completion flag of local task C, task scheduler 103 designates cloud task A as the current cloud task. Task scheduler 103 sends a task scheduling instruction to cloud test terminal 102, controlling cloud test terminal 102 to execute cloud task B and monitor the task execution status of cloud test terminal 102.
[0069] A simulation counter is set in the task scheduler 103. The simulation counter continuously increments. When the accumulated value is the same as the time for executing cloud task A in the next cycle, the task scheduler 103 sends a task scheduling instruction to the cloud test terminal 102 again, controlling the cloud test terminal 102 to execute cloud task A. This process is repeated until the 10th cycle is completed.
[0070] By setting up a task scheduler to send task scheduling instructions to the local test client and the cloud test client, and monitoring the task execution status of the local test client and the cloud test client, the local test client and the cloud test client can execute the corresponding local tasks and cloud tasks according to the task scheduling instructions. This reduces the execution logic errors or execution time errors caused by the clock asynchrony between the local test client and the cloud test client, thereby ensuring the logical correctness and timing correctness of the local tasks and the cloud tasks.
[0071] Furthermore, as an optional implementation, the virtual testing platform provided in this application embodiment may further include a virtual data bus 104. The virtual data bus 104 is connected to the local testing terminal 101 and the cloud testing terminal 102 respectively, and is used to transmit test data between the local testing terminal 101 and the cloud testing terminal 102.
[0072] In this embodiment, the virtual data bus 104 is a mechanism for simulating the behavior of a physical data bus in a virtual testing platform. The virtual data bus 104 provides a logical connection between the local test terminal 101 and the cloud test terminal 102, allowing data transmission and communication between them. At the software level, the virtual data bus 104 acts as an abstraction layer or middleware, responsible for managing and coordinating data exchange between the local test terminal 101 and the cloud test terminal 102.
[0073] The virtual ECU can receive data sent by the cloud test terminal 102 through the virtual data bus 104 via the aforementioned integrated interactive interface, and can also send data that needs to be sent to the cloud test terminal 102 via the virtual data bus 104 through the interactive interface.
[0074] The test data between the local test terminal 101 and the cloud test terminal 102 may include, but is not limited to, test step information, scheduling execution information, vehicle network information, physical transmission information, and sensor information.
[0075] Test procedure information may include: driver input information, road environment information, fault injection information, etc. Test procedure information can be set by testers on the cloud test terminal 102 and sent to the corresponding physical models in the simulation test execution environment and the virtual ECU running in the local test terminal 101 for processing via the virtual data bus 104.
[0076] The scheduling execution information consists of a virtual time counter, task scheduling execution information, and task status information. The scheduling execution information is sent from the task corresponding to the test case to the virtual data bus 104, and then from the virtual data bus 104 to the task scheduler 103. The task scheduler 103 receives all task execution and status information, and, based on the triggering status of the virtual time counter, uniformly schedules the execution of all tasks in the local test terminal 101 and the cloud test terminal.
[0077] The vehicle network information includes: CAN / LIN communication, Ethernet communication, and RTE (Run-Time Environment) inter-core communication; the vehicle network information is sent / received by the virtual ECU and is logically processed in the application software layer (ASW) of the virtual ECU.
[0078] Physical transfer information includes information transfer between different physical domains. Each physical model collects physical transfer information and performs simulation calculations of physical domain signals to simulate the simulation environment of the virtual ECU under test. Physical transfer information can include: motion transfer signals (vehicle dynamics, motor rotation, etc.), energy transfer signals (current, SOC, and other energy calculations), and thermal management information (battery temperature, motor temperature, cooling circuit).
[0079] Sensor information includes the data collected by each virtual ECU on signals related to the physical model, such as voltage values, current values, resistance values, and PWM (Pulse Width Modulation) signals.
[0080] By setting up a virtual data bus, test data can be transmitted between the local test terminal and the cloud test terminal. The local test terminal and the cloud test terminal do not need to be connected by a physical bus, which reduces hardware costs and also allows for remote simulation testing.
[0081] Based on the same inventive concept, this application also provides a testing method. Please refer to Figure 4, which is a flowchart illustrating a testing method provided in an embodiment of this application. This testing method can be applied to the aforementioned virtual testing platform 100, and the testing method may include:
[0082] S1: Create and run a virtual electronic control unit on the local test terminal according to the electronic control unit configuration instructions.
[0083] The tester inputs an electronic control unit (ECU) configuration command into the local test terminal 101. The local test terminal 101 responds to the ECU configuration command, creating and running a virtual ECU. The specific implementation method for creating and running the virtual ECU can be referred to the aforementioned description of the local test terminal 101, and will not be repeated here for the sake of brevity.
[0084] S2: Configure the simulation test execution environment on the cloud test terminal according to the simulation environment configuration instructions.
[0085] The tester inputs a simulation environment configuration command into the cloud-based test terminal 102. The cloud-based test terminal 102 responds to the simulation environment configuration command and configures the simulation test execution environment. The specific implementation method for configuring the simulation test execution environment can be referred to the aforementioned description of the cloud-based test terminal 102, and will not be repeated here for the sake of brevity.
[0086] S3: Perform simulation testing on the virtual electronic control unit in the simulation test execution environment according to the test cases.
[0087] The following describes the process of simulating and testing the virtual electronic control unit using the virtual testing platform 100.
[0088] As an optional implementation, step S1 may include: the cloud-based test terminal generating a test signal in the simulation test execution environment according to the cloud task; the cloud-based test terminal sending the test signal to the local test terminal; the virtual electronic control unit in the local test terminal generating a response signal according to the local task and the test signal; the local test terminal sending the response signal to the cloud-based test terminal; and the cloud-based test terminal determining the test result based on the response signal.
[0089] In this embodiment, during the test case execution, the test case includes cloud tasks and local tasks. The cloud task is the task executed by the test case in the cloud test terminal 102, and the local task is the task executed by the test case in the local test terminal 101. The cloud test terminal 102 runs the cloud task in the simulation test execution environment, generates a test signal, and sends the test signal to the local test terminal 101. The virtual ECU in the local test terminal 101 generates a response signal based on the received test signal and the local task, and sends the response signal to the cloud test terminal 102. The test case sets the expected test result. The cloud test terminal 102 compares the response signal with the expected test result. If they match, it indicates that the virtual ECU is working normally, and the test result is that this simulation test meets expectations; conversely, if they do not match, it indicates that the virtual ECU is malfunctioning, and the test result is that this simulation test does not meet expectations.
[0090] In an optional implementation, the simulation test execution environment includes at least one physical model, and the cloud test terminal generates a test signal in the simulation test execution environment according to the cloud task, including: determining a target physical model from the simulation test execution environment according to the cloud task; and injecting the cloud task into the target physical model to generate the test signal.
[0091] In an optional implementation, the virtual testing platform further includes a task scheduler; the method further includes: the task scheduler determining the current cloud task and the current local task according to the test case; correspondingly, the cloud testing terminal generates a test signal in the simulation test execution environment according to the cloud task, including: the cloud testing terminal receiving the current cloud task sent by the task scheduler; the cloud testing terminal generating a test signal in the simulation test execution environment according to the current cloud task; correspondingly, the virtual electronic control unit in the local testing terminal generates a response signal according to the local task and the test signal, including: the local testing terminal receiving the current local task sent by the task scheduler; the local testing terminal generating a response signal according to the current local task and the test signal.
[0092] The testing method provided in this application corresponds to the virtual testing platform provided in the foregoing embodiments. To keep the specification concise, the same or similar parts can be referred to the content of the virtual testing platform section, and will not be repeated here.
[0093] The following explanation of S3 will be based on a specific test case.
[0094] As shown in Figure 5, the test case includes three steps. Test Step 1: The driver plugs in the slow charging gun to wake up the vehicle and put it into slow charging mode. Expected test result: The vehicle is awakened and enters slow charging mode.
[0095] Test Step 2: Configure the battery to report charging faults. Expected test result: The virtual ECU detects the fault and stops charging the vehicle.
[0096] Test Step 3: The driver disconnects the charging gun, charging ends, and the vehicle enters sleep mode. Expected test result: The vehicle enters sleep mode.
[0097] This test case involves an on-board charger model and a battery management system model. The cloud-based test terminal 102 determines the on-board charger model and the battery management system model as the target physical models from the simulation test execution environment. Test step 1 is executed. The first cloud task corresponding to test step 1 is: the on-board charger model sends a test signal to the virtual ECU: slow charging gun connection status = connected. The first local task is: the virtual ECU receives the charging gun status signal and controls the entry into the slow charging process. The virtual ECU sends a response signal to the cloud-based test terminal 102: slow charging enable signal = enable slow charging. The second cloud task is: the battery management system model, based on the response signal: slow charging enable signal = enable slow charging, controls the battery to enter the slow charging state. The third cloud task is: the on-board charger model, based on the response signal: slow charging enable signal = enable slow charging, controls the on-board charger to start the slow charging process for the battery. The cloud-based test terminal 102 receives the response signal: slow charging enable signal = enable slow charging, determines whether the response signal is consistent with the expected test result, and obtains the simulation test result of test step 1.
[0098] Execute test step 2. The first cloud task corresponding to test step 2 is: inject a charging fault signal into the battery management system model. The battery management system model sends a test signal to the virtual ECU based on the charging fault signal: Status = Charging Fault. The first local task is: the virtual ECU receives the charging fault signal and controls the exit from the charging process. The virtual ECU sends a response signal to the cloud test terminal 102: Slow Charge Enable Signal = Stop Slow Charge. The second cloud task is: the battery management system model controls the battery to exit the slow charge state based on the response signal: Slow Charge Enable Signal = Stop Slow Charge. The third cloud task is: the on-board charger model controls the on-board charger to stop the slow charge process based on the response signal: Slow Charge Enable Signal = Stop Slow Charge. The cloud test terminal 102 receives the response signal: Slow Charge Enable Signal = Stop Slow Charge, determines whether the response signal is consistent with the expected test result, and obtains the simulation test result of test step 2.
[0099] Execute test step 3. The first cloud task corresponding to test step 3 is: the on-board charger model sends a test signal to the virtual ECU: slow charging gun connection status = disconnected. The first local task is: the virtual ECU receives the test signal: slow charging gun connection status = disconnected, and controls the vehicle to enter sleep mode. The virtual ECU sends a response signal to the cloud test terminal 102: vehicle system status = sleep mode. The cloud test terminal 102 receives the response signal: slow charging enable signal = stop slow charging, determines whether the response signal is consistent with the expected test result, and obtains the simulation test result of test step 3.
[0100] During the above test, the task scheduler 103 sends a task scheduling instruction to the local test terminal 101 to execute a local task, and sends a task scheduling instruction to the cloud test terminal 102 to execute a remote task. Both the test signal and the response signal are transmitted through the virtual data bus 104.
[0101] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when run by a computer, performs the steps of the testing method as described in the above embodiments.
[0102] Furthermore, this application also provides a computer program product, which includes a computer program that, when executed by a processor, performs the steps of the testing method described in the above embodiments.
[0103] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0104] Furthermore, 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 units can be selected to achieve the purpose of this embodiment according to actual needs.
[0105] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0106] It should be noted that if the function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0107] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A virtual testing platform, characterized in that, include: Local testing client and cloud testing client; The local test terminal is used to create and run a virtual electronic control unit; The cloud-based testing terminal is communicatively connected to the local testing terminal, and the cloud-based testing terminal is configured with a simulation test execution environment; the cloud-based testing terminal is used to perform simulation tests on the virtual electronic control unit based on the simulation test execution environment and test cases.
2. The virtual testing platform according to claim 1, characterized in that, The cloud-based testing terminal includes a simulation environment configuration module, which is used to receive simulation environment configuration instructions and construct the simulation test execution environment according to the environment configuration instructions.
3. The virtual testing platform according to claim 2, characterized in that, The simulation test execution environment includes at least one physical model, which is used to generate test signals for simulating the virtual electronic control unit based on the test cases.
4. The virtual testing platform according to claim 1, characterized in that, The cloud-based testing platform includes a test management module, which is used to generate test cases according to editing instructions.
5. The virtual testing platform according to claim 1, characterized in that, The virtual testing platform further includes a task scheduler; the task scheduler is connected to both the local testing terminal and the cloud testing terminal, and is used to send task scheduling instructions to the local testing terminal and the cloud testing terminal, and to monitor the task execution status of the local testing terminal and the cloud testing terminal.
6. The virtual testing platform according to claim 1, characterized in that, The virtual testing platform further includes a virtual data bus, which is connected to both the local testing terminal and the cloud testing terminal, and is used to transmit test data between the local testing terminal and the cloud testing terminal.
7. A testing method, characterized in that, Applied to a virtual testing platform, which includes a local testing terminal and a cloud-based testing terminal, the method includes: A virtual electronic control unit is created and run on the local test terminal according to the electronic control unit configuration instructions; Configure the simulation test execution environment on the cloud-based test terminal according to the simulation environment configuration instructions; The virtual electronic control unit is simulated and tested in the simulation test execution environment according to the test cases.
8. The test method according to claim 7, characterized in that, The test cases include cloud tasks and local tasks. The simulation test of the virtual electronic control unit in the simulation test execution environment according to the test cases includes: The cloud-based test terminal generates test signals in the simulation test execution environment according to the cloud task; and sends the test signals to the local test terminal. The virtual electronic control unit in the local test terminal generates a response signal based on the local task and the test signal; and sends the response signal to the cloud test terminal. The cloud-based testing terminal determines the test result based on the response signal.
9. The test method according to claim 8, characterized in that, The simulation test execution environment includes at least one physical model, and the cloud test terminal generates test signals in the simulation test execution environment according to the cloud task, including: The target physical model is determined from the simulation test execution environment based on the cloud task; The cloud task is injected into the target physical model to generate the test signal.
10. The test method according to claim 8, characterized in that, The virtual testing platform further includes a task scheduler; the method further includes: the task scheduler determining the current cloud task and the current local task according to the test cases; Accordingly, the cloud-based testing terminal generates test signals in the simulation test execution environment according to the cloud-based task, including: The cloud-based test terminal receives the current cloud-based task sent by the task scheduler; The cloud-based testing terminal generates test signals in the simulation test execution environment according to the current cloud task; Accordingly, the virtual electronic control unit in the local test terminal generates a response signal based on the local task and the test signal, including: The local test terminal receives the current local task sent by the task scheduler; The local test terminal generates a response signal based on the current local task and the test signal.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when read and executed by a computer, perform the method as described in any one of claims 7-10.
12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method described in any one of claims 7-10.
Citation Information
Patent Citations
Virtual platform as well as application layer software testing method and system
CN104866419A
Vehicle semi-virtual ECU test system and test method thereof
CN110377004A
Automatic virtual automobile simulation method and device based on assembly line
CN115455564A
Virtual twin automobile system, detection method, electronic equipment and storage medium
CN115903538A
Vehicle body controller in-loop test method and platform based on cloud management end, and storage medium
CN116224974A