A hardware-in-the-loop test method and device, electronic equipment and storage medium

By adjusting the differences in transmission and reception rates of offline data in the ECU's working environment through an automated platform, and integrating the data to generate suitable test data, the problem of low efficiency in ECU fault reproduction and troubleshooting is solved, and efficient hardware-in-the-loop testing is achieved.

CN115729214BActive Publication Date: 2026-04-07REPT BATTERO ENERGY CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies are inefficient in reproducing and troubleshooting ECU faults. Manually simulating the ECU operating environment is prone to errors and costly, and it is difficult to effectively reproduce the ECU's operating environment under abnormal working conditions.

Method used

The automated platform receives offline data from the ECU's operating environment at a preset receiving rate. Based on the difference between the transmission and reception rates, the amount and type of data are adjusted, and the offline data is integrated to generate suitable test data for hardware-in-the-loop testing.

Benefits of technology

It improves the efficiency of ECU fault reproduction and troubleshooting, increases data adaptability, reduces testing costs, and improves the efficiency of hardware-in-the-loop testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115729214B_ABST
    Figure CN115729214B_ABST
Patent Text Reader

Abstract

This application relates to a hardware-in-the-loop testing method, apparatus, electronic device, and storage medium, belonging to the field of vehicle control technology. The method includes the following steps: receiving offline ECU operating environment data transmitted at a first transmission rate at a preset first receiving rate; integrating the offline ECU operating environment data received within a corresponding test cycle based on the rate difference between the first transmission rate and the first receiving rate to obtain integrated offline environment data; obtaining corresponding first test data based on the integrated offline environment data; and performing hardware-in-the-loop testing based on the first test data. This allows the integrated offline ECU operating environment data to be directly used for reproducing the operating environment when the ECU malfunctions, increasing the compatibility between the offline ECU operating environment data and the data used for hardware-in-the-loop testing, improving hardware-in-the-loop testing efficiency, and also improving the efficiency of reproducing and troubleshooting ECU faults.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle fault detection and control technology, specifically to a hardware-in-the-loop testing method, apparatus, electronic device, and storage medium. Background Technology

[0002] An ECU (Electronic Control Unit), also known as a "vehicle computer" or "on-board computer," is a specialized microcomputer controller for automobiles. Like a regular computer, it consists of a microprocessor (CPU), memory (ROM, RAM), input / output interfaces (I / O), analog-to-digital converters (A / D), and large-scale integrated circuits for shaping and driving functions. In current ECU products, many functions, either during initial development or after application, exhibit suboptimal performance under certain operating conditions, sometimes even constituting problems or malfunctions. Therefore, effective troubleshooting and fault location methods are crucial for improving ECU functionality and performance.

[0003] Offline data about the ECU's operating environment only reflects events that occurred at the time the data was recorded. If a data record shows that the ECU is in an abnormal operating state, this data is the only way to understand the current operating environment and status of the ECU. When a comprehensive investigation of abnormal ECU malfunctions is required, it is necessary to reproduce the operating environment in which the ECU was in the abnormal operating state.

[0004] However, in existing technologies, restoring the ECU working environment almost always involves manually simulating the actual operating environment of the ECU for testing. Due to the wide variety of offline data signals, manual operation is prone to errors and is inefficient. Furthermore, for occasional anomalies, it is necessary to repeatedly set the ECU operating environment, which results in high testing costs.

[0005] Therefore, improving the efficiency of reproducing and troubleshooting ECU faults is a technical problem that urgently needs to be solved. Summary of the Invention

[0006] This application provides a hardware-in-the-loop method, apparatus, electronic device, and storage medium to improve the efficiency of reproducing and troubleshooting ECU faults.

[0007] To achieve the above objectives, this application provides the following solution.

[0008] In a first aspect, this application provides a hardware-in-the-loop testing method, the method comprising the following steps:

[0009] Receive offline ECU operating environment data transmitted at a preset first receiving rate and a first transmission rate;

[0010] Based on the rate difference between the first transmission rate and the first receiving rate, the offline data of the ECU working environment received within the corresponding test period is integrated to obtain integrated offline environmental data.

[0011] Based on the offline data of the integrated environment, the corresponding first test data is obtained;

[0012] Based on the first test data, hardware-in-the-loop testing is performed.

[0013] Furthermore, the step of integrating the offline data of the ECU operating environment received within the corresponding test period based on the rate difference between the first transmission rate and the first reception rate includes the following steps:

[0014] If the first transmission rate is inconsistent with the first transmission rate, the amount of offline data of the ECU working environment received within the corresponding test cycle shall be adjusted.

[0015] Furthermore, before integrating the offline data of the ECU operating environment received within the corresponding test period based on the rate difference between the first transmission rate and the first reception rate, the following steps are included:

[0016] Based on the first transmission rate, the number of offline data in the ECU working environment within the corresponding test period is counted and recorded as the first quantity.

[0017] Based on the first receiving rate, the amount of offline environmental data required by the ECU within the corresponding test period is counted and recorded as the second quantity.

[0018] Furthermore, if the first transmission rate is inconsistent with the first transmission rate, adjusting the amount of offline environmental data required by the ECU within the corresponding test cycle includes the following steps:

[0019] If the second quantity is greater than the first quantity, then based on the first quantity, the offline data of the ECU working environment in the corresponding test cycle will be reduced to the first quantity.

[0020] If the second quantity is less than the first quantity, then based on the first quantity, the offline data of the ECU working environment in the corresponding test cycle will be increased to the first quantity.

[0021] Furthermore, if the second quantity is less than the first quantity, then based on the first quantity, the offline data of the ECU working environment within the preset period is increased to the first quantity, including the following steps:

[0022] If the second quantity is less than the first quantity, supplementary offline data is obtained based on the offline data of the ECU working environment in the previous cycle of the corresponding test cycle.

[0023] The supplementary offline data is added to the ECU operating environment offline data within the corresponding test cycle, so that the number of supplemented ECU operating environment offline data within the corresponding test cycle reaches a first quantity.

[0024] Furthermore, obtaining the corresponding first test data based on the offline data of the integrated environment includes the following steps:

[0025] Based on the data type of the integrated environment offline data, the integrated environment offline data is divided into signal group data corresponding to the data type;

[0026] Assign the signal group data corresponding to the target data type to the first test data of the matching type.

[0027] Furthermore, based on the data type of the offline data of the ECU working environment, the offline data of the ECU working environment is divided into signal group data corresponding to the data type, including:

[0028] The target data type for acquiring the offline data of the ECU's operating environment;

[0029] Based on the target data type, obtain signal group data corresponding to the target data type from the offline data of the ECU working environment;

[0030] The signal group data are arranged in chronological order of their generation time.

[0031] Secondly, this application provides a hardware-in-the-loop testing apparatus, the apparatus comprising:

[0032] The first data receiving module is used to receive offline ECU operating environment data transmitted at a first transmission rate at a preset first receiving rate.

[0033] An integration module is used to integrate the offline data of the ECU working environment received within the corresponding test cycle based on the rate difference between the first transmission rate and the first receiving rate, and to obtain integrated offline environment data.

[0034] The second data acquisition module is used to obtain the corresponding first test data based on the offline data of the integrated environment;

[0035] The test module is used to perform hardware-in-the-loop testing based on the first test data.

[0036] Furthermore, the integration module is also used to: if the first transmission rate is inconsistent with the first transmission rate, adjust the amount of offline data of the ECU working environment received within the corresponding test cycle.

[0037] Furthermore, the integration module also includes:

[0038] The first statistics module is used to count the number of offline data of the ECU working environment within the corresponding test cycle based on the first transmission rate, and denoted as the first quantity.

[0039] The second statistics module is used to count the amount of offline environmental data required by the ECU within the corresponding test period based on the first receiving rate, and denoted as the second quantity.

[0040] Furthermore, the integration module also includes:

[0041] The deletion submodule is used to reduce the offline data of the ECU working environment in the corresponding test cycle to the first quantity if the second quantity is greater than the first quantity, based on the first quantity.

[0042] An additional submodule is added, which is used to increase the offline data of the ECU working environment within the corresponding test cycle to the first quantity, based on the first quantity, if the second quantity is less than the first quantity.

[0043] Furthermore, the addition of the submodule also includes:

[0044] The supplementary data acquisition unit is used to acquire supplementary offline data based on the offline data of the ECU working environment in the previous cycle of the corresponding test cycle if the second quantity is less than the first quantity.

[0045] A data supplementation unit is used to supplement the offline data of the ECU working environment in the corresponding test cycle to make the number of offline data of the ECU working environment in the corresponding test cycle reach a first quantity.

[0046] The beneficial effects of the technical solution provided in this application include:

[0047] The automated operation platform receives offline ECU operating environment data transmitted at a preset first receiving rate and a first transmission rate; based on the rate difference between the first transmission rate and the first receiving rate, it integrates the offline ECU operating environment data received within the corresponding test cycle to obtain integrated environment offline data; based on the integrated environment offline data, it obtains the corresponding first test data; and based on the first test data, it performs hardware-in-the-loop testing.

[0048] In this application, an automated operating platform receives offline ECU operating environment data transmitted at a first transmission rate at a first receiving rate. Based on the rate difference between the first transmission rate and the first receiving rate, the offline ECU operating environment data is then integrated so that the integrated offline ECU operating environment data can be directly used to reproduce the operating environment when the ECU malfunctions. This increases the compatibility between the offline ECU operating environment data and the data used for hardware-in-the-loop testing, improves the efficiency of hardware-in-the-loop testing, and also improves the efficiency of reproducing and troubleshooting ECU malfunctions. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a flowchart of the hardware-in-the-loop testing method provided in the embodiments of this application;

[0051] Figure 2 This is a flowchart of the integration steps provided in another embodiment of this application.

[0052] Figure 3 This is a flowchart of the second data acquisition step in another embodiment of this application. Detailed Implementation

[0053] 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.

[0054] The embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0055] This application provides a hardware-in-the-loop testing method, apparatus, electronic device, and storage medium to improve the efficiency of reproducing and troubleshooting ECU faults.

[0056] The embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0057] See Figure 1 As shown in the figure, this application provides a hardware-in-the-loop testing method, which includes the following steps:

[0058] S1. Receive offline ECU operating environment data transmitted at a preset first receiving rate according to a first transmission rate;

[0059] Among them, the ECU working environment offline data refers to the ECU working environment data when the hardware ECU is installed on the target actual vehicle and is working. The data types include battery cell voltage data, battery cell temperature data, battery total voltage data, bus current data, etc. This application embodiment only uses the ECU working environment offline data as an example and is not limited to it.

[0060] The first transmission rate refers to the rate at which the offline data transmitter sends data to the ECU to be tested in the hardware-in-the-loop, and the offline data transmitter can be a data transmitter that stores offline data of the ECU's operating environment; the first receiving rate refers to the speed at which the operating environment data needs to be processed when performing hardware-in-the-loop testing on the ECU.

[0061] Understandably, when an ECU is operating in a target vehicle, it needs to receive operating environment data of the vehicle control system from other vehicle components via a signal transceiver on the communication bus. To utilize the ECU's offline operating environment data to reproduce the operating environment of the ECU during hardware-in-the-loop testing, in addition to needing the ECU's operating environment data when the target vehicle is operating, the first receiving rate for receiving the offline ECU operating environment data also needs to be set to the rate at which the ECU receives real-time operating environment data of the vehicle control system from other vehicle components when operating in the target vehicle.

[0062] An automation platform can be an automatic control computing platform composed of Python and related communication protocols. This platform can perform effective processing and integration of offline data from the ECU's operating environment, as well as initiate hardware-in-the-loop testing, and so on.

[0063] Specifically, the automation platform receives offline ECU operating environment data sent by the data sender at a first transmission rate. If the data format of the offline data does not conform to the preset format or the data value of the offline data does not conform to the specific protocol requirements, the offline data is determined to be invalid. The invalid offline data is then removed to obtain valid offline data. The valid offline ECU operating environment data is then classified and stored.

[0064] S2. Based on the rate difference between the first transmission rate and the first reception rate, integrate the offline data of the ECU working environment received within the corresponding test cycle to obtain the integrated offline data of the environment.

[0065] When performing hardware-in-the-loop testing on an ECU, it is necessary to acquire offline data of different ECU operating environments at a preset first receiving rate and use it as operating environment data at different times during hardware-in-the-loop testing, so as to restore the real-time operating environment of the ECU on the target vehicle based on the offline data of the ECU operating environment.

[0066] Because there is a difference between the first transmission rate and the first receiving rate, data loss or overlap may occur when using offline data to test the ECU. Therefore, it is necessary to adjust the offline data sent at the first transmission rate so that the transmission rate of the offline data becomes the second transmission rate. Only when the second transmission rate matches the first receiving rate can the hardware-in-the-loop test of the ECU be successfully completed.

[0067] This application embodiment can use a Hardware-in-the-Loop (HiL) simulation test system for ECU hardware-in-the-loop testing. In this case, the second transmission rate is the data transmission rate from the automation platform to the HiL. HiL uses a real-time processor to run a simulation model to simulate the operating state of the controlled object. When performing hardware-in-the-loop testing on an ECU, it connects to the ECU under test via an I / O interface to perform comprehensive and systematic testing. Considering safety, feasibility, and reasonable cost, HiL hardware-in-the-loop simulation testing has become a crucial part of the ECU development process, reducing the number of real-vehicle road tests, shortening development time, reducing costs, improving ECU software quality, and reducing risks for automakers.

[0068] In this embodiment, both the first transmission rate and the first receiving rate are fixed. Therefore, the amount of data transmitted or received within a preset time period is also fixed. To facilitate adjustment of the transmission rate, the amount of offline data in the ECU's operating environment within the corresponding test cycle can be increased or decreased, thereby adjusting the first transmission rate of the offline data to a second transmission rate that matches the first receiving rate, where the first receiving rate and the second transmission rate are equal. In this embodiment, the preset time period is considered a test cycle, and the time for hardware-in-the-loop testing of the ECU includes multiple test cycles. When adjusting the first transmission rate, one of the corresponding test cycles can be selected for adjustment.

[0069] Specifically, the automation platform first obtains the first transmission rate and the preset first receiving rate of the offline data sent by the offline data transmitter to the ECU working environment. Then, based on the difference between the first transmission rate and the first receiving rate, it adjusts the amount of offline data of the ECU working environment in the corresponding period so that the transmission rate of the adjusted offline data becomes the second transmission rate and the second transmission rate is numerically equal to the first receiving rate.

[0070] S3. Based on the offline data of the integrated environment, obtain the corresponding first test data;

[0071] Among them, the integrated environmental offline data refers to the environmental offline data obtained by integrating the amount of ECU environmental offline data in the corresponding test cycle through the automated platform in S2, so that the second transmission rate is equal to the first receiving rate.

[0072] The first test data refers to the data used for ECU hardware-in-the-loop testing, and the value of the first test data is assigned by the offline data of the integrated environment.

[0073] Specifically, the automated platform assigns the integrated environment offline data to the first test data used for hardware-in-the-loop testing of the ECU. The assignment process is as follows: First, the data type of the integrated environment offline data is obtained. The integrated environment offline data is then divided into signal groups corresponding to each data type. These signal groups contain signal values ​​sent at different times. Each time the offline data transmitter sends a signal value, it obtains the target data type to which that signal value belongs, and then assigns that signal value to the data type corresponding to the target data type in the first test data. This process continues until the offline data transmitter has completed sending all ECU environment offline data.

[0074] S4. Based on the first test data, perform hardware-in-the-loop testing.

[0075] After generating the first test data, the automated platform sends it to the HiL test platform at the second transmission rate, enabling the HiL test platform to perform offline simulation of the ECU's operating environment in the target actual vehicle based on the first test data.

[0076] In this application, an automated operating platform receives offline ECU operating environment data transmitted at a first transmission rate at a first receiving rate. Based on the rate difference between the first transmission rate and the first receiving rate, the offline ECU operating environment data is then integrated so that the integrated offline ECU operating environment data can be directly used to reproduce the operating environment when the ECU malfunctions. This increases the compatibility between the offline ECU operating environment data and the data used for hardware-in-the-loop testing, improves the efficiency of hardware-in-the-loop testing, and also improves the efficiency of reproducing and troubleshooting ECU malfunctions.

[0077] In one embodiment, step S2 includes the following steps:

[0078] If the first receiving rate is inconsistent with the first transmitting rate, the amount of offline data of the ECU working environment received within the corresponding test cycle shall be adjusted.

[0079] First, before step S2, the automation platform counts the number of offline data of the ECU working environment within the corresponding test cycle based on the first receiving rate and records it as the first quantity; based on the first transmission rate, it counts the number of offline data of the working environment required by the ECU within the corresponding test cycle and records it as the second quantity.

[0080] If the first receiving rate is inconsistent with the first transmitting rate, it means that the first quantity and the second quantity are inconsistent. Then, based on the first quantity, the second quantity is made equal to the first quantity by increasing or decreasing the amount of offline data in the ECU working environment within the corresponding test cycle, so that the second transmitting rate of the adjusted offline data is equal to the first receiving rate.

[0081] In this embodiment, by adjusting the amount of offline data in the ECU operating environment within the corresponding test cycle, the second transmission rate of the adjusted offline data transmission is made equal to the first receiving rate, thereby increasing the compatibility between the offline data in the ECU operating environment and the data used for hardware-in-the-loop testing, and improving the efficiency of hardware-in-the-loop testing.

[0082] Based on the above embodiments, in one embodiment, such as Figure 2 As shown, step S2 further includes the following steps:

[0083] S201, if the second quantity is greater than the first quantity, then the first quantity will be used as the benchmark, and the offline data of the ECU working environment will be reduced to the first quantity within the corresponding test cycle.

[0084] Specifically, if the second quantity is greater than the first quantity, the automated platform identifies redundant offline data in the ECU operating environment offline data within the corresponding test cycle; it deletes the redundant offline data until the ECU operating environment offline data is reduced to the first quantity within the corresponding test cycle. Specifically, within the corresponding test cycle, the ECU operating environment offline data is sorted chronologically, and offline data exceeding the first quantity is considered redundant and is deleted; alternatively, the proportional relationship between the first and second quantities is determined, a preset interval order is determined according to this proportional relationship, and the ECU operating environment offline data is deleted according to the preset interval order until the ECU operating environment offline data is reduced to the first quantity.

[0085] S202, if the second quantity is less than the first quantity, then the first quantity will be used as the benchmark, and the offline data of the ECU working environment will be increased to the first quantity within the corresponding test cycle.

[0086] If the second quantity is less than the first quantity, the automation platform will obtain supplementary offline data based on the offline data of the ECU working environment in the previous cycle of the corresponding test cycle.

[0087] Specifically, the automated platform acquires supplementary offline data based on the offline data of the ECU operating environment in the previous cycle of the corresponding test cycle. This includes: determining the sequential position of the missing data in the corresponding test cycle, and using the average of the previous and subsequent offline data in the same sequential position in the previous cycle of the corresponding test cycle as the supplementary offline data for the missing data, or using the offline data in the same sequential position in the previous cycle of the corresponding test cycle as the supplementary offline data for the missing data; then, the supplementary offline data is added to the offline data of the ECU operating environment in the corresponding test cycle until the offline data of the ECU operating environment in the corresponding test cycle increases to a first quantity.

[0088] In this embodiment, by adjusting the amount of offline data in the ECU operating environment within the corresponding test cycle, the second transmission rate is made equal to the first receiving rate, thereby increasing the compatibility between the offline data in the ECU operating environment and the data used for hardware-in-the-loop testing, and improving the efficiency of hardware-in-the-loop testing.

[0089] In one embodiment, such as Figure 3 As shown, step S3 includes the following steps:

[0090] S301, based on the data type of the integrated environment offline data, divide the integrated environment offline data into signal group data corresponding to the data type;

[0091] First, obtain the target data type of the offline data in the integrated environment. Then, based on the target data type, obtain the signal group data corresponding to the target data type from the offline data in the integrated environment. Arrange the signal group data in chronological order of data generation time.

[0092] For example, the integrated environmental offline data includes N data types such as message1, message2, ..., messageN. Each data type contains several data values; for example, message1 contains multiple data such as signal1-1 and signal1-2. The target data type is selected according to the needs of ECU testing. For example, ECU testing requires M data types (target data types) such as message1, message2, ..., messageM, where M is less than or equal to N. Then, the data corresponding to message1, message2, ..., messageM are signal group data, which are then arranged in chronological order of data generation time. The selection of the target data type in this embodiment is only an example and is not limited to this. The specific selection depends on actual needs; for example, it can also be any M data types from message1 to messageN.

[0093] S302, assign the signal group data corresponding to the target data type to the first test data of the matching type.

[0094] Based on the above-mentioned exemplary target data types, for example, the ECU requires M data types such as message-A, message-B...message-M, for example, messageA contains multiple data such as signalA-1 and signalA-2.

[0095] If message1 and message-A are set to be of the same data type, then signal1-1, signal1-2, etc. are assigned to message-A. If message2 and message-B are set to be of the same data type, then signal2-1, signal2-2, etc. are assigned to message-B, and so on, until all target data types have been assigned, thus obtaining the first test data.

[0096] In this embodiment, assigning the integrated environment offline data to the first test data according to the target data type ensures that the integrated environment offline data of each type is accurately assigned to the first test data, thereby improving the efficiency of hardware-in-the-loop testing of the ECU.

[0097] It should be noted that the step numbers in the embodiments of this application do not limit the order of operations in the technical solution of this application.

[0098] Based on the same inventive concept as the hardware-in-the-loop testing method embodiments, this application provides a hardware-in-the-loop testing apparatus, which includes:

[0099] The first data receiving module is used to receive offline ECU operating environment data transmitted at a first transmission rate at a preset first receiving rate.

[0100] An integration module is used to integrate the offline data of the ECU working environment received within the corresponding test cycle based on the rate difference between the first transmission rate and the first receiving rate, and to obtain integrated offline environment data.

[0101] The second data acquisition module is used to obtain the corresponding first test data based on the offline data of the integrated environment;

[0102] The test module is used to perform hardware-in-the-loop testing based on the first test data.

[0103] Specifically, the automation platform can be an automatic control computing platform composed of Python and related communication protocols. This platform can perform effective processing and integration of offline data from the ECU's operating environment, as well as initiate hardware-in-the-loop testing, and so on.

[0104] Specifically, the automation platform receives offline ECU operating environment data sent by the data sender at a first transmission rate. If the data format of the offline data does not conform to the preset format or the data value of the offline data does not conform to the specific protocol requirements, the offline data is determined to be invalid. The invalid offline data is then removed to obtain valid offline data. The valid offline ECU operating environment data is then classified and stored.

[0105] In this embodiment, the adjusted second transmission rate can be made equal to the first receiving rate by increasing or decreasing the amount of offline data in the ECU operating environment within a preset period.

[0106] In one embodiment of the application, the integration module is further configured to: if the first transmission rate is inconsistent with the first transmission rate, adjust the amount of offline data of the ECU working environment received within the corresponding test cycle.

[0107] In one embodiment of the application, the integration module further includes:

[0108] The first statistics module is used to count the number of offline data of the ECU working environment within the corresponding test cycle based on the first transmission rate, and denoted as the first quantity.

[0109] The second statistics module is used to count the amount of offline environmental data required by the ECU within the corresponding test period based on the first receiving rate, and denoted as the second quantity.

[0110] In one embodiment, the integration module further includes:

[0111] The deletion submodule is used to reduce the offline data of the ECU working environment in the corresponding test cycle to the first quantity if the second quantity is greater than the first quantity, based on the first quantity.

[0112] An additional submodule is added, which is used to increase the offline data of the ECU working environment within the corresponding test cycle to the first quantity, based on the first quantity, if the second quantity is less than the first quantity.

[0113] In one embodiment of the application, the addition of the submodule is specifically used for:

[0114] The supplementary data acquisition unit is used to acquire supplementary offline data based on the offline data of the ECU working environment in the previous cycle of the corresponding test cycle if the second quantity is less than the first quantity.

[0115] A data supplementation unit is used to supplement the offline data of the ECU working environment in the corresponding test cycle to make the number of offline data of the ECU working environment in the corresponding test cycle reach a first quantity.

[0116] Secondly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program that runs on the processor, and the processor executes the computer program to implement the hardware-in-the-loop testing method mentioned in the first aspect.

[0117] Thirdly, embodiments of this application provide a storage medium storing a computer program that, when executed by a processor, implements the hardware-in-the-loop testing method mentioned in the first aspect.

[0118] It should be noted that in this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "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 limitations, 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 the element.

[0119] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Furthermore, any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory.

[0120] The above are merely specific embodiments of this application, enabling those skilled in the art to understand or implement this application. 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 this application. Therefore, this application 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 hardware-in-the-loop testing method, characterized in that, The method includes the following steps: Receive offline ECU operating environment data transmitted at a preset first receiving rate and a first transmission rate; Based on the rate difference between the first transmission rate and the first receiving rate, the offline data of the ECU working environment received within the corresponding test period is integrated to obtain integrated offline environmental data. Based on the offline data of the integrated environment, the corresponding first test data is obtained; Based on the first test data, perform hardware-in-the-loop testing; The process of integrating the offline data of the ECU operating environment received within the corresponding test period based on the rate difference between the first transmission rate and the first reception rate includes the following steps: If the first receiving rate is inconsistent with the first transmitting rate, the amount of offline data of the ECU working environment received within the corresponding test cycle shall be adjusted. Before integrating the offline data of the ECU operating environment received within the corresponding test period based on the rate difference between the first transmission rate and the first reception rate, the following steps are included: Based on the first receiving rate, the number of offline data in the ECU working environment within the corresponding test period is counted and recorded as the first quantity. Based on the first transmission rate, the number of offline working environment data required by the ECU in the corresponding test cycle is counted and recorded as the second quantity. If the first receiving rate is inconsistent with the first transmitting rate, the amount of offline data of the ECU operating environment received within the corresponding test cycle is adjusted, including the following steps: If the second quantity is greater than the first quantity, then based on the first quantity, the offline data of the ECU working environment in the corresponding test cycle will be reduced to the first quantity; If the second quantity is less than the first quantity, then based on the first quantity, the offline data of the ECU working environment in the corresponding test cycle will be increased to the first quantity.

2. The hardware-in-the-loop testing method as described in claim 1, characterized in that, If the second quantity is less than the first quantity, then based on the first quantity, the offline data of the ECU working environment within the corresponding test cycle is increased to the first quantity, including the following steps: If the second quantity is less than the first quantity, supplementary offline data is obtained based on the offline data of the ECU working environment in the previous cycle of the corresponding test cycle. The supplementary offline data is added to the ECU operating environment offline data within the corresponding test cycle, so that the number of supplemented ECU operating environment offline data within the corresponding test cycle reaches a first quantity.

3. The hardware-in-the-loop testing method as described in claim 1 or 2, characterized in that, The process of obtaining the corresponding first test data based on the offline data of the integrated environment includes the following steps: Based on the data type of the integrated environment offline data, the integrated environment offline data is divided into signal group data corresponding to the data type; Assign the signal group data corresponding to the target data type to the first test data of the matching type.

4. The hardware-in-the-loop testing method as described in claim 3, characterized in that, Based on the data type of the integrated environment offline data, the integrated environment offline data is divided into signal group data corresponding to the data type, including: Obtain the target data type of the offline data in the integrated environment; Based on the target data type, obtain signal group data corresponding to the target data type from the offline data of the integrated environment; The signal group data are arranged in chronological order of their generation time.

5. A hardware-in-the-loop testing apparatus for implementing the method as described in any one of claims 1-4, characterized in that, The device includes: The first data receiving module is used to receive offline ECU operating environment data transmitted at a first transmission rate at a preset first receiving rate. An integration module is used to integrate the offline data of the ECU working environment received within the corresponding test cycle based on the rate difference between the first transmission rate and the first receiving rate, and to obtain integrated offline environment data. The second data acquisition module is used to obtain the corresponding first test data based on the offline data of the integrated environment; The test module is used to perform hardware-in-the-loop testing based on the first test data.

6. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Service signal rate smooth adjustment circuit, chip and method of SPN system

    CN112364594A