Hardware-in-the-loop testing method, device, computer equipment, medium and program product

By automatically processing DBC files and test configuration data in the hardware in the ring testing software, the problem of cumbersome and error-prone manual configuration process is solved, and the test accuracy and efficiency are improved.

CN118921292BActive Publication Date: 2025-02-18CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411398287.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-02-18
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

In hardware-in-ring testing, manually configuring database files (DBC files) of CAN networks is cumbersome, inefficient and prone to configuration errors, affecting the test accuracy.

Method used

By detecting the selection operation of the hardware in-ring testing software, the imported DBC file and matching test configuration data are obtained, the target message matching the node to be tested by the vehicle is automatically determined, and the target message is performed based on the DBC configuration file and system variable file. Configure, get test data.

Benefits of technology

It improves the test accuracy and testing efficiency of the vehicle's nodes to be tested, reduces the possibility of manual configuration errors, and shortens the test preparation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921292B_ABST
    Figure CN118921292B_ABST
Patent Text Reader

Abstract

The present application relates to a hardware-in-the-loop test method, device, computer equipment, medium and program product, which are applied to the field of automobile technology. The method includes: when a selection operation for hardware-in-the-loop test software is detected, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software are obtained; the DBC file includes multiple communication messages; based on the comparison results between the communication nodes in the multiple communication messages and the vehicle nodes to be tested, a target message matching the vehicle nodes to be tested is determined from the multiple communication messages, and the target message is configured based on the DBC configuration file and the system variable file matching the test configuration data to obtain test data; when the selected hardware-in-the-loop test software is run, the vehicle nodes to be tested are tested based on the test data. The use of this method can improve the test accuracy and test efficiency for the vehicle nodes to be tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automobile technology, and in particular to a hardware-in-the-loop testing method, apparatus, computer equipment, medium and program product. Background Art

[0002] In order to implement Controller Area Network (CAN) communication in Hardware in the loop (HIL) test software, after importing the Database CAN (DBC) file of the CAN network in the HIL test software, it is necessary to manually configure it in the HIL test software to simulate the process of sending the data in the DBC file to the nodes to be tested in the vehicle, so as to implement the test of the nodes to be tested in the vehicle.

[0003] However, manual configuration is cumbersome and inefficient, and is prone to configuration errors, which will affect the test accuracy of the nodes to be tested in the vehicle. Summary of the invention

[0004] Based on this, it is necessary to provide a hardware-in-the-loop testing method, device, computer equipment, medium and program product that can improve the test accuracy and test efficiency of the vehicle nodes to be tested in order to solve the above technical problems.

[0005] In the first aspect, the present application provides a hardware-in-the-loop test method. The method includes: in the case of detecting a selection operation for hardware-in-the-loop test software, obtaining a DBC file imported into the selected hardware-in-the-loop test software, and test configuration data matching the selected hardware-in-the-loop test software; the DBC file includes multiple communication messages; based on the comparison results between the communication nodes and the vehicle nodes to be tested in the multiple communication messages, determining the target message matching the vehicle nodes to be tested from the multiple communication messages; obtaining a DBC configuration file and a system variable file matching the test configuration data; based on the DBC configuration file and the system variable file, configuring the target message to obtain test data; the system variable file is used to make the test data reflect a communication scenario, and the communication scenario includes a normal communication scenario and / or an abnormal communication scenario; in the case of running the selected hardware-in-the-loop test software, testing the vehicle nodes to be tested based on the test data.

[0006] In the above embodiment, for different hardware-in-the-loop test software, a specific hardware-in-the-loop test software can be used to test the vehicle node to be tested by selecting it, which improves the selectivity of the hardware-in-the-loop test software when testing the vehicle node to be tested; after the hardware-in-the-loop test software imports the DBC file, it is not necessary to manually configure the DBC file in the hardware-in-the-loop test software, but the target message can be automatically configured to obtain the test data based on the test configuration data matching the hardware-in-the-loop test software, which improves the test efficiency and avoids the manual configuration error. Then, when the hardware-in-the-loop test software is running, the vehicle node to be tested is tested based on the test data, which can improve the test accuracy of the vehicle node to be tested. Moreover, the target message can be automatically configured through the test configuration data designed in advance, which can reduce the preparation time before testing the vehicle-mounted node to be tested, and can avoid the situation of manual configuration errors, thereby improving the accuracy of testing the vehicle node to be tested.

[0007] In one embodiment, the target message is configured based on the DBC configuration file and the system variable file to obtain test data, including: determining a write position in the DBC configuration file that matches the target message; when writing the target message to the write position, configuring at least one communication identifier that matches the target message based on the system variable file to obtain test data; wherein the communication node includes a sending node, and the communication identifier is used to characterize a communication abnormality scenario between the sending node and the vehicle node under test.

[0008] In the above embodiment, based on the obtained test data, the communication process between the sending node and the vehicle tested node in the communication abnormality scenario can be simulated, so that the performance of the vehicle tested node in the communication abnormality scenario can be tested, thereby improving the comprehensiveness of the test of the vehicle tested node.

[0009] In one embodiment, for at least one communication identifier of the target message, a corresponding function key is configured for each communication identifier, and different communication identifiers correspond to different function keys.

[0010] In the above embodiment, by configuring corresponding function keys for different communication identifiers, when the function key is triggered, the communication process between the sending node and the vehicle node under test can be quickly simulated, thereby improving the test efficiency of the vehicle node under test.

[0011] In one embodiment, the target message includes a signal value when the sending node communicates with the vehicle node under test; the method also includes: upon receiving a modification operation on the signal value in the test data, testing the communication process between the sending node and the vehicle node under test based on the modified signal value.

[0012] In the above embodiment, by modifying the signal value carried in the message, the working condition in which the vehicle node under test receives different signal values ​​can be simulated, thereby increasing the testable working condition range of the vehicle node under test, while reducing the time for testers to manually add system variables, thereby improving the testing efficiency of the vehicle node under test.

[0013] In one embodiment, the communication node includes a receiving node; the method also includes: when an input operation for a first input position is detected, the content input at the first input position is determined as the vehicle node to be tested; the target message matching the vehicle node to be tested based on the comparison result between the communication nodes in the multiple communication messages and the vehicle node to be tested includes: from the multiple communication messages, determining a communication message whose receiving node in the communication message is consistent with the vehicle node to be tested; based on the determined communication message, determining a target message matching the vehicle node to be tested.

[0014] In the above embodiment, by inputting the vehicle node to be tested, the vehicle node to be tested that needs to be tested can be quickly determined, thereby improving the test efficiency; by taking the receiving node in the communication message as consistent with the vehicle node to be tested, the message receiver of the vehicle node to be tested can be tested in a targeted manner, thereby improving the test accuracy of the vehicle node to be tested.

[0015] In one embodiment, the communication node also includes a sending node; determining a target message matching the vehicle node to be tested based on the determined communication message includes: obtaining a preset sending node corresponding to the vehicle node to be tested; and determining, from the determined communication message, a communication message whose sending node is consistent with the preset sending node as a target message matching the vehicle node to be tested.

[0016] In the above embodiment, considering that the receiving node in the communication message is consistent with the vehicle node to be tested, and the sending node in the communication message is consistent with the preset sending node corresponding to the vehicle-mounted node to be tested, the message receiver and message sender of the vehicle node to be tested can be tested in a targeted manner, thereby improving the test accuracy of the vehicle node to be tested.

[0017] In one embodiment, obtaining the DBC file imported into the selected hardware-in-the-loop testing software includes: determining the file storage path of the selected hardware-in-the-loop testing software; and reading the DBC file imported into the hardware-in-the-loop testing software based on the file storage path.

[0018] In the above embodiment, the DBC file to be tested can be accurately obtained, thereby improving the test accuracy of the vehicle node to be tested.

[0019] In one embodiment, determining the file storage path of the selected hardware-in-the-loop testing software includes: determining the file storage path that matches the selected hardware-in-the-loop testing software based on a mapping relationship between the hardware-in-the-loop testing software and the file storage path.

[0020] In the above embodiment, based on the mapping relationship set in advance, the file storage path matching the selected hardware-in-the-loop testing software can be quickly determined, and the DBC file in the selected hardware-in-the-loop testing software can be further quickly imported, which can improve the testing efficiency.

[0021] In one embodiment, test configuration data matching the selected hardware-in-the-loop test software is obtained, including: obtaining a configuration data generation script; when an input operation for a second input position is detected, determining the content input at the second input position as the format content of the test configuration data of the selected hardware-in-the-loop test software; configuring the format content of the test configuration data based on the configuration data generation script to obtain test configuration data matching the selected hardware-in-the-loop test software.

[0022] In the above embodiment, by inputting the format content of the test configuration data, the test configuration data can be quickly generated, thereby improving the test efficiency.

[0023] In one embodiment, the method further includes: obtaining software names of multiple hardware-in-the-loop test software; when a selection operation for the software name of the hardware-in-the-loop test software is detected, determining that a selection operation for the hardware-in-the-loop test software is detected, and the hardware-in-the-loop test software corresponding to the selected software name is the selected hardware-in-the-loop test software.

[0024] In the above embodiment, for different hardware-in-the-loop test software, the specific hardware-in-the-loop test software can be used to test the vehicle node to be tested by selecting the software name, thereby improving the selectivity of the hardware-in-the-loop test software when testing the vehicle node to be tested.

[0025] In the second aspect, the present application also provides a hardware-in-the-loop test device. The device includes: a data acquisition module, which is used to acquire the DBC file imported into the selected hardware-in-the-loop test software and the test configuration data matching the selected hardware-in-the-loop test software when a selection operation for the hardware-in-the-loop test software is detected; the DBC file includes multiple communication messages; a determination module, which is used to determine the target message matching the vehicle node to be tested from the multiple communication messages based on the comparison results between the communication nodes and the vehicle node to be tested in the multiple communication messages; a processing module, which is used to obtain a DBC configuration file and a system variable file matching the test configuration data; based on the DBC configuration file and the system variable file, the target message is configured to obtain test data; the system variable file is used to make the test data reflect the communication scenario, and the communication scenario includes a normal communication scenario and / or an abnormal communication scenario; a test module, which is used to test the vehicle node to be tested based on the test data when the selected hardware-in-the-loop test software is running.

[0026] In the third aspect, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program: when a selection operation for the hardware-in-the-loop test software is detected, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software are obtained; the DBC file includes multiple communication messages; based on the comparison results between the communication nodes and the vehicle nodes to be tested in the multiple communication messages, a target message matching the vehicle nodes to be tested is determined from the multiple communication messages; a DBC configuration file and a system variable file matching the test configuration data are obtained; based on the DBC configuration file and the system variable file, the target message is configured to obtain test data; the system variable file is used to make the test data reflect a communication scenario, and the communication scenario includes a normal communication scenario and / or an abnormal communication scenario; when the selected hardware-in-the-loop test software is run, the vehicle nodes to be tested are tested based on the test data.

[0027] In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the following steps are implemented: when a selection operation for the hardware-in-the-loop test software is detected, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software are obtained; the DBC file includes a plurality of communication messages; based on the comparison results between the communication nodes and the vehicle nodes to be tested in the plurality of communication messages, a target message matching the vehicle nodes to be tested is determined from the plurality of communication messages; a DBC configuration file and a system variable file matching the test configuration data are obtained; based on the DBC configuration file and the system variable file, the target message is configured to obtain test data; the system variable file is used to make the test data reflect a communication scenario, and the communication scenario includes a normal communication scenario and / or an abnormal communication scenario; when the selected hardware-in-the-loop test software is run, the vehicle nodes to be tested are tested based on the test data.

[0028] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, which implements the following steps when executed by a processor: when a selection operation for hardware-in-the-loop test software is detected, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software are obtained; the DBC file includes multiple communication messages; based on the comparison results between the communication nodes and the vehicle nodes to be tested in the multiple communication messages, a target message matching the vehicle nodes to be tested is determined from the multiple communication messages; a DBC configuration file and a system variable file matching the test configuration data are obtained; based on the DBC configuration file and the system variable file, the target message is configured to obtain test data; the system variable file is used to make the test data reflect a communication scenario, and the communication scenario includes a normal communication scenario and / or an abnormal communication scenario; when the selected hardware-in-the-loop test software is run, the vehicle nodes to be tested are tested based on the test data.

[0029] The above-mentioned hardware-in-the-loop test method, device, computer equipment, medium and program product can obtain the DBC file imported into the selected hardware-in-the-loop test software and the test configuration data matching the selected hardware-in-the-loop test software when detecting the selection operation for the hardware-in-the-loop test software. Therefore, for different hardware-in-the-loop test software, specific hardware-in-the-loop test software can be used to test the vehicle node to be tested by selection, thereby improving the selectivity of the hardware-in-the-loop test software when testing the vehicle node to be tested; based on the comparison results between the communication nodes in multiple communication messages and the vehicle node to be tested, a target message matching the vehicle node to be tested is determined from the multiple communication messages, Then, a DBC configuration file and a system variable file matching the test configuration data are obtained, and based on the DBC configuration file and the system variable file, the target message is configured to obtain the test data. Therefore, after the hardware-in-the-loop test software imports the DBC file, there is no need to manually configure the DBC file in the hardware-in-the-loop test software. Instead, the target message can be automatically configured to obtain the test data based on the DBC configuration file and the system variable file matching the hardware-in-the-loop test software, thereby improving the test efficiency and avoiding manual configuration errors. Then, when running the selected hardware-in-the-loop test software, the vehicle nodes to be tested are tested based on the test data, which can improve the test accuracy of the vehicle nodes to be tested. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0031] Figure 1 An application environment diagram of a hardware-in-the-loop testing method in one embodiment;

[0032] Figure 2 A flowchart of a hardware-in-the-loop testing method in one embodiment;

[0033] Figure 3 A schematic diagram of a process of configuring a target message based on test configuration data to obtain test data in an embodiment;

[0034] Figure 4 A schematic diagram of a process of configuring a target message and obtaining test data based on a DBC configuration file and a system variable file in an embodiment;

[0035] Figure 5A schematic diagram of a process for determining a target message matching a vehicle node to be tested based on a comparison result between a communication node in a plurality of communication messages and a vehicle node to be tested in an embodiment;

[0036] Figure 6 A schematic diagram of a process for determining a target message matching a vehicle node to be tested based on a determined communication message in an embodiment;

[0037] Figure 7 A schematic diagram of a process for obtaining a DBC file imported into a selected hardware-in-the-loop testing software in one embodiment;

[0038] Figure 8 A schematic diagram of a flow chart of a hardware-in-the-loop testing method in another embodiment;

[0039] Fig. 9 is a structural block diagram of a hardware-in-the-loop testing device in one embodiment;

[0040] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0041] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0043] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0044] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0045] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and subsequent associated objects are in an "or" relationship. The term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).

[0046] When the process of sending the data in the DBC file to the node to be tested in the vehicle is simulated based on the HIL test software, there will be a situation where the manual configuration process is cumbersome, inefficient and prone to configuration errors. Therefore, in order to avoid configuration errors caused by manual configuration parameters, the CAN communication protocol in the DBC file and the format that can be executed by multiple HIL test software can be analyzed, and the conversion principle of the DBC file into the format that can be executed by multiple HIL test software can be sorted out, so as to design a hardware-in-the-loop test script, so that the DBC file imported into the hardware-in-the-loop test software used can be automatically processed based on the hardware-in-the-loop test script, and then the communication process for the node to be tested in the vehicle can be simulated. That is, by defining the processing steps for the DBC file in the hardware-in-the-loop test script, so that the processed DBC file is in a format that can be executed by the HIL test software used, and then based on the processed DBC file, the communication process for the node to be tested in the vehicle can be simulated by running the HIL test software used to realize the test process of the node to be tested in the vehicle.

[0047] In view of this, the present application provides a hardware-in-the-loop testing method, which can be applied to Figure 1 In the application environment shown. Among them, the hardware-in-the-loop test system 102 communicates with the server 104 through the network. The data storage system can store data that the server 104 needs to process. The hardware-in-the-loop test system 102 is configured with hardware-in-the-loop test software and software for running hardware-in-the-loop test scripts. In some cases, the hardware-in-the-loop test software is integrated in the hardware-in-the-loop test system 102, and in other cases, the hardware-in-the-loop test software is installed on the hardware-in-the-loop test system 102. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers.

[0048] exist Figure 1In the embodiment, when the server 104 detects the selection operation for the hardware-in-the-loop test software, the server 104 obtains the DBC file imported into the selected hardware-in-the-loop test software and the test configuration data matching the selected hardware-in-the-loop test software based on the hardware-in-the-loop test system 102; the DBC file includes multiple communication messages, and based on the comparison results between the communication nodes in the multiple communication messages and the vehicle nodes to be tested, a target message matching the vehicle nodes to be tested is determined from the multiple communication messages, and then the target message data is configured based on the test configuration data to obtain test data, and when the selected hardware-in-the-loop test software is run, the vehicle nodes to be tested are tested based on the test data.

[0049] Among them, HIL test software includes but is not limited to: CANoe, CANalyzer, Simulink, TSMaster, LabVIEW, etc. CANoe is an in-vehicle system simulation and testing software that can be applied to the development, testing and analysis of electronic control units (ECUs) and networks. It includes two major components: Test Module and Test Unit, and integrates the Test Feature Set (TFS) and Test Service Library (TSL) to help users achieve efficient automated testing. CANalyzer is an embedded system analysis, simulation and diagnostic software that can be applied to various bus systems and protocols, such as CAN, Local Interconnect Network (LIN), etc. CANalyzer not only supports online and offline modes, but also provides a wealth of functional modules, such as hardware configuration, measurement settings, logging and simulation settings windows, etc. Simulink provides a graphical editor, a customizable module library and a solver, and can perform dynamic system modeling and simulation. It can be integrated with MATLAB, and can integrate MATLAB algorithms into models in Simulink, and can also export simulation results to MATLAB for further analysis. TSMaster is a software for real-time HIL simulation of vehicle controllers. It loads the designed DBC file into TSMaster and maps its system variables to the bus for simulation. LabVIEW can realize a variety of functions, including data acquisition and analysis, fault injection, and testing under extreme conditions. For example, in the HIL test of automotive ECU, LabVIEW can collect ECU output signals such as engine speed and fuel consumption in real time, and use built-in data analysis tools to process and analyze these data.

[0050] In one embodiment, Figure 2As shown, a hardware-in-the-loop testing method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0051] S202 , when a selection operation for hardware-in-the-loop test software is detected, obtaining a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software.

[0052] In some embodiments, the hardware-in-the-loop test script includes the software names of multiple hardware-in-the-loop test software, so that the server can obtain the software names of multiple hardware-in-the-loop test software from the hardware-in-the-loop test script. When the user's selection operation for the software name of the hardware-in-the-loop test software is detected, it is determined that the selection operation for the hardware-in-the-loop test software is detected, and the hardware-in-the-loop test software corresponding to the selected software name is the selected hardware-in-the-loop test software. Therefore, for different hardware-in-the-loop test software, by selecting the software name, the specific hardware-in-the-loop test software can be used to test the vehicle node to be tested, which improves the selectivity of the hardware-in-the-loop test software when testing the vehicle node to be tested.

[0053] Further, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software are obtained. In some cases, the hardware-in-the-loop test script may be a Python script. In some cases, the hardware-in-the-loop test script may be a JSON script.

[0054] Among them, the DBC file is a standard file commonly used in the automotive industry, which is used to describe and define the communication information in the CAN signal network of the whole vehicle, such as the message identification (Identity document, ID), the message name corresponding to the message ID, and the message information carried by the message to which the message name belongs. The message information may include the sending cycle, sending node name, receiving node name, signal name, signal initial value, maximum value, minimum value and other information.

[0055] In this embodiment, the DBC file includes multiple communication messages. In some embodiments, the hardware-in-the-loop test script includes a parsing script. By parsing the DBC file through the parsing script, multiple communication messages can be obtained. Each communication message has its corresponding message information, and the message information includes message name, message ID, sending node name, receiving node name, signal name, signal initial value, signal maximum value, signal minimum value and other information. In some cases, the automobile manufacturer or parts supplier can provide the DBC file.

[0056] The sending node name refers to the name of the sender of the message, and the receiving node name refers to the name of the receiver of the message. The signal name is used to represent the name of the signal carried in the message. The signal initial value refers to the initial value of the signal carried by the message defined in the DBC file. In some cases, when adjusting the communication process between the sender and the receiver, the signal initial value changes.

[0057] The maximum signal value refers to the maximum value that the signal carried by the message can reach, and the minimum signal value refers to the minimum value of the signal carried by the message. By configuring the maximum signal value and the minimum signal value, the sender and the receiver can send any signal within the signal range composed of the maximum signal value and the minimum signal value.

[0058] Among them, the test configuration data is the configuration data developed and designed by the developer, which is used to automatically process the DBC file imported into the hardware-in-the-loop test software. Based on the processed DBC file, the communication process of the vehicle node to be tested can be simulated.

[0059] In some embodiments, the hardware-in-the-loop test script includes the format content of the test configuration data of each of the multiple HIL test software, and the configuration data generation script, so that the server can obtain the format content of the test configuration data of each of the multiple HIL test software from the hardware-in-the-loop test script, and the configuration data generation script. When the selection operation for the hardware-in-the-loop test software is detected, the format content of the test configuration data of the selected hardware-in-the-loop test software can be configured based on the configuration data generation script to generate test configuration data. Therefore, for different HIL test software, corresponding test configuration data can be generated based on the hardware-in-the-loop test script, that is, the hardware-in-the-loop test script is suitable for different HIL test software, which can reduce the test difficulty of testers. Among them, the configuration data generation script is developed and designed by the developer, and the format content of the test configuration data is used to describe how to generate the test configuration data.

[0060] In some embodiments, the hardware-in-the-loop test script includes a second input position for inputting the format content of the test configuration data of the HIL test software, and a configuration data generation script, so that the server can obtain the configuration data generation script from the hardware-in-the-loop test script, and when the input operation for the second input position is detected, the content input at the second input position is determined as the format content of the test configuration data of the selected hardware-in-the-loop test software, and then, the format content of the test configuration data of the selected hardware-in-the-loop test software is configured based on the configuration data generation script, and the test configuration data matching the selected hardware-in-the-loop test software can be generated. Thus, by adopting the method of inputting the format content of the test configuration data, the test configuration data can be quickly generated, and then the test efficiency can be improved. Moreover, when the format content of the test configuration data of other HIL test software is input into the first input position, the test configuration data matching other HIL test software can be generated, so that other HIL test software can be used to test the vehicle node to be tested, which expands the selectivity of the HIL test software when testing the vehicle node to be tested.

[0061] S204, based on the comparison results between the communication nodes in the multiple communication messages and the vehicle node to be tested, determine a target message matching the vehicle node to be tested from the multiple communication messages.

[0062] The vehicle node to be tested refers to a node in the vehicle that needs to be simulated tested. The vehicle node to be tested may include a sending node and / or a receiving node. The number of target messages is at least one.

[0063] Taking the vehicle nodes to be tested including the sending node as an example, the vehicle nodes to be tested include but are not limited to: a vehicle control unit (VCU), a battery management system (BMS), etc.

[0064] In some cases, the VCU sends drive control information to the motor controller so that the motor controller drives the entire vehicle. For example, when the ignition switch is turned to the off position, the VCU will send a telegram to notify the motor controller to turn off the drive. In some cases, the VCU can send control commands to the BMS via the CAN bus, such as charging, discharging and other operating instructions. In some cases, the BMS communicates with the on-board display system via the CAN bus to provide various parameter information of the battery pack, such as battery voltage, battery current, mileage that the current battery pack can provide, and battery temperature.

[0065] Taking the vehicle nodes to be tested including receiving nodes as an example, the vehicle nodes to be tested include but are not limited to: an on-board display system, a battery management system (Battery Management System, BMS), etc.

[0066] In some cases, the vehicle display system receives various parameter information from the BMS, and can display the various parameter information in the vehicle device so that the user can view the various parameter information through the vehicle device. In some cases, the data sent by the motor controller to the BMS includes but is not limited to battery status information, torque shutdown messages, etc., to ensure the coordinated operation of the vehicle's power system and battery management system.

[0067] Referring to the above content, it can be seen that for the same vehicle-mounted node to be tested, when the application scenarios of the vehicle-mounted node to be tested are different, the vehicle-mounted node to be tested can be used as both a sending node and a receiving node. Therefore, the specific content of the vehicle-mounted node to be tested can be set based on the actual application scenario, and this embodiment does not make any specific limitations.

[0068] In one embodiment, the hardware-in-the-loop test script further includes a message determination script, which is used to determine a target message matching the vehicle node to be tested based on a comparison result between a communication node and a vehicle node to be tested in a plurality of communication messages, and the following implementation method may be executed:

[0069] In one implementation, the communication node includes a sending node, and the vehicle node to be tested includes a sending node, then a communication message whose sending node is consistent with the vehicle node to be tested is determined from multiple communication messages; then, based on a first preset signal value corresponding to the vehicle node to be tested, from the determined communication messages, a communication message whose signal difference between an initial signal value in the communication message and the first preset signal value is within a preset range is determined as a target message.

[0070] The first preset signal value is used to describe the signal value carried by the message sent by the vehicle node to be tested. Therefore, based on the first preset signal value, a selected message can be determined as a target message from multiple communication messages, and the sending node of the selected message is consistent with the vehicle node to be tested, and the signal difference between the signal value carried by the selected message and the first preset signal value is within a preset range.

[0071] In another implementation, the communication node includes a receiving node, and the vehicle node to be tested includes a receiving node, then a communication message in which the receiving node is consistent with the vehicle node to be tested is determined from multiple communication messages; then, based on the second preset signal value corresponding to the vehicle node to be tested, from the determined communication messages, a communication message in which the initial signal value of the communication message is greater than or equal to the second preset signal value is determined as the target message.

[0072] The first preset signal value and the second preset signal value may be the same or different. Therefore, based on the second preset signal value, a selected message can be determined as a target message from multiple communication messages, and the receiving node of the selected message is consistent with the vehicle-mounted node to be tested, and the signal value carried by the selected message is greater than the second preset signal value.

[0073] In another implementation, the communication node includes a sending node and a receiving node, and the vehicle node to be tested includes a sending node and a receiving node, then from multiple communication messages, a communication message is determined in which the receiving node in the communication message is consistent with the receiving node in the vehicle node to be tested, and the sending node in the communication message is consistent with the sending node in the vehicle node to be tested; then, based on the third preset signal value and the fourth preset signal value corresponding to the vehicle node to be tested, from the determined communication messages, a communication message in which the initial signal value of the signal in the communication message is greater than the third preset signal value and less than the fourth preset signal value is determined as the target message.

[0074] Among them, the third preset signal value or the fourth preset signal value may be the same as or different from the first preset signal value. Therefore, based on the third preset signal value and the fourth preset signal value, a screened message can be determined as a target message from multiple communication messages, and the sending node and the receiving node of the screened message are consistent with the vehicle-mounted node to be tested, and the signal value carried by the screened message is greater than the third preset signal value and less than the fourth preset signal value.

[0075] S206, configuring the target message based on the test configuration data to obtain test data.

[0076] Among them, the target message can be processed into a format executable by the test software based on the test configuration data, that is, the test data can be run in the HIL test software. Therefore, when running the hardware-in-the-loop test software, the vehicle node to be tested can be tested based on the test data.

[0077] In some embodiments, the CAN channel supported by the HIL test software and the CAN communication protocol in the target message can be mapped based on the test configuration data to configure the message information in the target message to the CAN channel supported by the HIL test software to obtain test data.

[0078] S208 , testing the vehicle node to be tested based on the test data while running the selected hardware-in-the-loop test software.

[0079] Wherein, when the hardware-in-the-loop test software is running, the test data can be sent to the vehicle node to be tested through the hardware-in-the-loop test software to perform a simulation test on the vehicle node to be tested.

[0080] In some embodiments, the hardware-in-the-loop test script includes a test run script, based on which the hardware-in-the-loop test software can be controlled to run, so as to test the vehicle node to be tested based on the test data. The test run script can execute the following process:

[0081] In some embodiments, when the hardware-in-the-loop test software is run under the control of a test run script, the CAN channel of the vehicle node to be tested is connected to the CAN channel of any hardware device in the hardware-in-the-loop test software under the control of the test run script, thereby allowing test data to be sent to the vehicle node to be tested through any hardware device in the hardware-in-the-loop test software to test the vehicle node to be tested.

[0082] In some embodiments, the test data includes multiple working condition data, and different working condition data are used to reflect different communication scenarios. Therefore, based on the test running script, the hardware-in-the-loop test software is controlled to send multiple working condition data to the vehicle node to be tested, and the performance of the vehicle grounding to be tested in multiple communication scenarios can be tested. Among them, the communication scenarios include normal message sending, message stop sending, loss of a specified number of frames, error of a specified number of frames, continuous verification errors, etc.

[0083] based on Figure 2 The method shown can obtain the DBC file imported into the selected hardware-in-the-loop test software and the test configuration data matching the selected hardware-in-the-loop test software when detecting the selection operation for the hardware-in-the-loop test software, so that for different hardware-in-the-loop test software, the specific hardware-in-the-loop test software can be used to test the vehicle node to be tested by selection, thereby improving the selectivity of the hardware-in-the-loop test software when testing the vehicle node to be tested; based on the comparison results between the communication nodes and the vehicle node to be tested in multiple communication messages, the target message matching the vehicle node to be tested is determined, and then the target message is processed based on the test configuration data to obtain the test data, so that after the hardware-in-the-loop test software imports the DBC file, it is not necessary to manually configure the DBC file in the hardware-in-the-loop test software, but the target message can be automatically configured based on the test configuration data matching the selected hardware-in-the-loop test software to obtain the test data, thereby improving the test efficiency and avoiding the situation of manual configuration errors, and then when the hardware-in-the-loop test software is running, the vehicle node to be tested is tested based on the test data, which can improve the test accuracy of the vehicle node to be tested.

[0084] In one embodiment, the target message is processed based on the test configuration data to obtain the test data (ie, S206) as follows: Figure 3 As shown, the following steps are included:

[0085] S302, obtaining a DBC configuration file and a system variable file matching the test configuration data.

[0086] In some embodiments, the test configuration data includes a DBC configuration file and a system variable file, so that the DBC configuration file and the system variable file can be obtained by analyzing the test configuration data. In some embodiments, the hardware-in-the-loop test script includes an analysis script, so that the server can parse the test configuration data based on the analysis script. In some cases, the analysis script can be a Python script. In some cases, the analysis script can be a JSON script.

[0087] In some embodiments, when an input operation is detected for a second input position, the content input at the second input position is determined to be the format content of the DBC configuration file and the system variable file of the selected hardware-in-the-loop testing software; then, the format content of the DBC configuration file and the system variable file is configured based on the configuration data generation script, and the format content of the DBC configuration file and the system variable file that matches the selected hardware-in-the-loop testing software can be generated, that is, the format content of the test configuration data of the selected hardware-in-the-loop testing software includes: the format content of the DBC configuration file and the system variable file.

[0088] S304, configuring the target message based on the DBC configuration file and the system variable file to obtain test data.

[0089] In some embodiments, the DBC configuration file is used to configure the message information of the target message, so that based on the configured message information, when the hardware-in-the-loop test software is running, the configured target message can be sent to the vehicle unit under test, that is, based on the DBC configuration file, the configured target message (i.e., test data) can be run in the hardware-in-the-loop test software. The system variable file is used to configure the target message so that the configured target message can reflect the communication scenario, and the communication scenario can refer to a normal communication scenario and / or an abnormal communication scenario. Thus, the target message is configured based on the DBC configuration file and the system variable file to obtain test data.

[0090] based on Figure 3 In the embodiment shown, by obtaining a DBC configuration file and a system variable file that match the test configuration data, the target message can be configured based on the DBC configuration file and the system variable file to obtain test data. Thus, the target message can be automatically configured through the test configuration data designed in advance, which can reduce the preparation time before testing the vehicle-mounted node under test, avoid manual configuration errors, and improve the accuracy of testing the vehicle node under test.

[0091] In one embodiment, the hardware-in-the-loop test script may further include a test data generation script, which is used to configure the target message based on the DBC configuration file and the system variable file to obtain test data. The implementation method of configuring the target message based on the DBC configuration file and the system variable file to obtain test data (i.e., S304) may be as follows: Figure 4 As shown, the following steps are included:

[0092] S402, determining a write position in the DBC configuration file that matches the target message.

[0093] Among them, the message information of the target message includes the message name, message ID, sending node name, receiving node name, signal name, signal initial value, signal maximum value, and signal minimum value. By analyzing the DBC configuration file, the writing position of each parameter in the message information in the DBC configuration file can be determined.

[0094] In some embodiments, the DBC configuration file includes comment content, and the comment content is used to explain and illustrate the file content of the DBC configuration file. Thus, by analyzing the comment content in the DBC configuration file, when the comment content matches the parameters in the message information, the content corresponding to the comment content in the DBC configuration file can be written into the location and determined as the write location of the parameters in the matching message information.

[0095] S404, when the target message is written to the write position, at least one communication identifier matching the target message is configured based on the system variable file to obtain test data.

[0096] By writing each parameter in the message information of the target message to the matching write position in the DBC configuration file, the target message can be configured based on the DBC configuration file. Further, at least one communication identifier is configured for the target message based on the system variable file to obtain test data.

[0097] The communication node includes a sending node, and the communication identifier is used to characterize the abnormal communication scenario between the sending node and the vehicle node under test. For example, abnormal communication scenarios include stopping sending messages, losing one or more frames, losing a specified number of frames, continuous message check errors, continuous message count errors, or errors in a specified number of frames.

[0098] In one embodiment, for at least one communication identifier of the target message, a corresponding function key is configured for each communication identifier, and different communication identifiers correspond to different function keys. Thus, when the function key is triggered, by running the hardware-in-the-loop test software, the communication process between the sending node matching the triggered function key and the vehicle node under test in a communication abnormality scenario can be simulated. Thus, by configuring corresponding function keys for different communication identifiers, when the function key is triggered, the communication process between the sending node and the vehicle node under test can be quickly simulated, thereby improving the test efficiency of the vehicle node under test.

[0099] For example, for a certain message in the target message, you can define pressing F1 to simulate stopping sending a certain message, pressing F2 to simulate continuous message verification errors, pressing F3 to simulate continuous message counting errors, etc.

[0100] based on Figure 4 The content of the illustrated embodiment can be used to configure the target message based on the DBC configuration file and the system variable file to obtain test data. Thus, based on the obtained test data, the communication process between the sending node and the vehicle tested node in the communication abnormality scenario can be simulated, so that the performance of the vehicle tested node in the communication abnormality scenario can be tested, thereby improving the comprehensiveness of the test of the vehicle tested node.

[0101] In one embodiment, the target message includes a signal value when the sending node communicates with the vehicle node under test, and the method further includes: in the case of receiving a modification operation for the signal value in the test data, testing the communication process between the sending node and the vehicle node under test based on the modified signal value. Thus, by modifying the signal value carried in the message, it is possible to simulate the working condition of the vehicle node under test receiving different signal values, thereby increasing the testable working condition range of the vehicle node under test, while reducing the time for testers to manually add system variables, thereby improving the test efficiency of the vehicle node under test.

[0102] In one embodiment, the communication node includes a receiving node, and based on the comparison results between the communication node and the vehicle node to be tested in the plurality of communication messages, determines the target message (ie, S204) that matches the vehicle node to be tested, such as Figure 5 As shown, the following steps may be included:

[0103] S502: When an input operation directed to a first input position is detected, the content input at the first input position is determined as a vehicle node to be tested.

[0104] The hardware-in-the-loop test script further includes a first input position for inputting the vehicle node to be tested, so that the server can determine the content input at the first input position as the vehicle node to be tested when an input operation for the first input position is detected. Further, the hardware-in-the-loop test script further includes a message determination script, and the message determination script can execute steps S504 and S506.

[0105] S504, determining, from a plurality of communication messages, a communication message in which a receiving node is consistent with a node to be tested of the vehicle.

[0106] Among them, from multiple communication messages, the receiving nodes in each communication message are traversed in turn, and when the receiving node in the traversed communication message is consistent with the vehicle node to be tested, the traversed communication message is used as the communication message determined from the multiple communication messages. It should be understood that the vehicle node to be tested is the receiving node.

[0107] In some embodiments, when the receiving node in the traversed communication message is consistent with the vehicle node to be tested, the message information of the traversed communication message is stored in the target array, and the next communication message is traversed until multiple communication messages are traversed. The message in the target array is the communication message determined from the multiple communication messages.

[0108] S506: Based on the determined communication message, determine a target message that matches the vehicle node to be tested.

[0109] In some embodiments, the determined communication message may be determined as a target message that matches the vehicle node to be tested.

[0110] based on Figure 5 The content of the illustrated embodiment can determine, from multiple communication messages, a communication message in which a receiving node in the communication message is consistent with a vehicle node to be tested, and determine the determined communication message as a target message that matches the vehicle node to be tested. Thus, from the perspective that the receiving node in the communication message is consistent with the vehicle node to be tested, the message receiver of the vehicle node to be tested can be tested in a targeted manner, thereby improving the test accuracy of the vehicle node to be tested.

[0111] In one embodiment, the communication node further includes a sending node, and based on the determined communication message, the implementation method of determining the target message matching the vehicle node to be tested (ie, S506) may be as follows: Figure 6 As shown, the following steps are included:

[0112] S602, obtaining a preset sending node corresponding to the vehicle node to be tested.

[0113] The preset sending node refers to the sender of the message received by the vehicle node to be tested. In some cases, the preset sending node represents a sampling device, which may include a current sensor, a voltage sensor, etc. In some cases, the preset sending node may represent a VCU or a vehicle display system, etc.

[0114] In some embodiments, when a sending node name input in the hardware-in-the-loop test software is received, the sending node corresponding to the input sending node name is determined as a preset sending node corresponding to the vehicle node to be tested.

[0115] S604: From the determined communication messages, determine the communication message whose sending node is consistent with the preset sending node as the target message that matches the vehicle node to be tested.

[0116] based on Figure 6 The content of the illustrated embodiment is to obtain a preset sending node corresponding to the vehicle node to be tested, and then, from the determined communication message, determine the communication message whose sending node is consistent with the preset sending node as the target message matching the vehicle node to be tested. Therefore, when considering that the receiving node in the communication message is consistent with the vehicle node to be tested, and the sending node in the communication message is consistent with the preset sending node corresponding to the vehicle-mounted node to be tested, the message receiver and the message sender of the vehicle node to be tested can be tested in a targeted manner, thereby improving the test accuracy of the vehicle node to be tested.

[0117] In one embodiment, the implementation method of obtaining the DBC file imported into the selected hardware-in-the-loop testing software can be as follows: Figure 7 As shown, the following steps are included:

[0118] S702, determining a file storage path of the selected hardware-in-the-loop testing software.

[0119] The file storage path refers to the storage path of the files entered into the hardware-in-the-loop test software.

[0120] In some embodiments, the hardware-in-the-loop test script includes a file reading script. Based on the mapping relationship between the hardware-in-the-loop test software and the file storage path in the file reading script, the file storage path matching the selected hardware-in-the-loop test software can be determined, and then, based on the determined file storage path, the DBC file imported into the selected hardware-in-the-loop test software can be read. Thus, based on the mapping relationship set in advance, the file storage path matching the selected hardware-in-the-loop test software can be quickly determined, and further, the DBC file in the selected hardware-in-the-loop test software can be quickly imported, which can improve the test efficiency.

[0121] In some embodiments, the hardware-in-the-loop test script also includes the respective file storage paths of multiple HIL test software. The server can obtain the respective file storage paths of multiple HIL test software from the hardware-in-the-loop test script, and when the user's selection operation for the file storage path is detected, the selected file storage path is determined as the file storage path of the selected hardware-in-the-loop test software. Thus, by performing real-time detection on the file storage paths of multiple hardware-in-the-loop test software, the selected file storage path can be quickly determined as the file storage path of the selected hardware-in-the-loop test software, and then, the efficiency of obtaining the DBC file imported into the selected hardware-in-the-loop test software can be improved, and the test efficiency can be further improved.

[0122] S704, based on the file storage path, read the DBC file imported into the selected hardware-in-the-loop test software.

[0123] The server may determine the file in the file reading path that is closest to the current time as the DBC file to be imported into the selected hardware-in-the-loop testing software.

[0124] based on Figure 7 The content of the illustrated embodiment can accurately obtain the DBC file to be tested, and further improve the test accuracy of the vehicle node to be tested.

[0125] In combination with the above content, in one embodiment, taking the hardware-in-the-loop test script as a Python script as an example, Figure 8 As shown, a hardware-in-the-loop testing method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0126] S802, obtaining software names of multiple hardware-in-the-loop test software from a hardware-in-the-loop test script, and determining that a selection operation for the hardware-in-the-loop test software is detected when a selection operation for the software name of the hardware-in-the-loop test software is detected.

[0127] S804, obtaining a file reading script from the hardware-in-the-loop test script, and determining a file storage path matching the selected hardware-in-the-loop test software based on a mapping relationship between the hardware-in-the-loop test software and the file storage path in the file reading script.

[0128] S806, based on the file reading script, read the DBC file imported into the selected hardware-in-the-loop test software from the file storage path, obtain the parsing script from the hardware-in-the-loop test script, parse the DBC file based on the parsing script, and obtain multiple communication messages.

[0129] S808, obtain a message determination script from the hardware-in-the-loop test script, and determine, from multiple communication messages, a communication message whose receiving node is consistent with the vehicle node to be tested based on the message determination script, and from the determined communication messages, determine a communication message whose sending node is consistent with a preset sending node corresponding to the vehicle node to be tested as a target message that matches the vehicle node to be tested.

[0130] S810, obtain configuration data from the hardware-in-the-loop test script to generate a script. When an input operation is detected for the second input position in the hardware-in-the-loop test script, the content input at the second input position is determined as the format content of the DBC configuration file and system variable file of the selected hardware-in-the-loop test software.

[0131] S812, configuring the format content of the DBC configuration file and the system variable file based on the configuration data generation script, and generating the DBC configuration file and the system variable file matching the selected hardware-in-the-loop test software.

[0132] S814, read the test data generation script from the hardware-in-the-loop test script, determine the write position in the DBC configuration file that matches the target message based on the test data generation script, and when the target message is written to the write position, configure at least one communication identifier that matches the target message based on the system variable file to obtain test data.

[0133] S816, reading a test running script from the hardware-in-the-loop test script, and based on the test running script, testing the vehicle node to be tested based on the test data while running the selected hardware-in-the-loop test software.

[0134] Among them, the specific content of S802-S816 can be adapted to the description of the above content and will not be repeated here.

[0135] based on Figure 8 It can be seen from the content of the illustrated embodiment that automatic processing of the DBC file imported into the selected hardware-in-the-loop test software can be achieved by running the hardware-in-the-loop test script. Thus, for different hardware-in-the-loop test software, specific hardware-in-the-loop test software can be used to test the vehicle nodes to be tested by selection, thereby improving the selectivity of the hardware-in-the-loop test software when testing the vehicle nodes to be tested; moreover, test data matching the DBC file can be obtained by running the hardware-in-the-loop test script. Thus, after the hardware-in-the-loop test software imports the DBC file, there is no need to manually configure the DBC file in the hardware-in-the-loop test software, thereby improving the test efficiency and avoiding manual configuration errors. Further, when the hardware-in-the-loop test software is running, the vehicle nodes to be tested are tested based on the test data, thereby improving the test accuracy of the vehicle nodes to be tested.

[0136] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0137] Based on the same inventive concept, the embodiment of the present application also provides a hardware-in-the-loop test device for implementing the hardware-in-the-loop test method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more hardware-in-the-loop test device embodiments provided below can refer to the limitations of the hardware-in-the-loop test method above, and will not be repeated here.

[0138] In one embodiment, Fig. 9 As shown, a hardware-in-the-loop test device is provided, including: a data acquisition module 902, a determination module 904, a processing module 906 and a test module 908, wherein:

[0139] A data acquisition module 902 is used to acquire a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software when a selection operation for the hardware-in-the-loop test software is detected; the DBC file includes multiple communication messages; a determination module 904 is used to determine a target message matching the vehicle node to be tested based on a comparison result between the communication nodes in the multiple communication messages and the vehicle node to be tested; a processing module 906 is used to configure the target message based on the test configuration data to obtain test data; a test module 908 is used to test the vehicle node to be tested based on the test data while running the selected hardware-in-the-loop test software.

[0140] In one embodiment, the processing module 906 is further used to: obtain a DBC configuration file and a system variable file matching the test configuration data; and configure the target message based on the DBC configuration file and the system variable file to obtain test data.

[0141] In one embodiment, the processing module 906 is also used to: determine a write position in the DBC configuration file that matches the target message; when writing the target message to the write position, configure at least one communication identifier that matches the target message based on the system variable file to obtain test data; wherein the communication node includes a sending node, and the communication identifier is used to characterize an abnormal communication scenario between the sending node and the vehicle node under test.

[0142] In one embodiment, the processing module 906 is further used to: for at least one communication identifier of the target message, configure a corresponding function key for each communication identifier, and different communication identifiers correspond to different function keys.

[0143] In one embodiment, the target message includes a signal value when the sending node communicates with the vehicle node under test; the processing module 906 is also used to: upon receiving a modification operation on the signal value in the test data, test the communication process between the sending node and the vehicle node under test based on the modified signal value.

[0144] In one embodiment, the communication node includes a receiving node; the determination module 904 is also used to: when an input operation for a first input position is detected, determine the content input at the first input position as the vehicle node to be tested; from the multiple communication messages, determine the communication message whose receiving node is consistent with the vehicle node to be tested; based on the determined communication message, determine the target message that matches the vehicle node to be tested.

[0145] In one embodiment, the communication node also includes a sending node; the determination module 904 is also used to: obtain a preset sending node corresponding to the vehicle node to be tested; and from the determined communication message, determine the communication message whose sending node is consistent with the preset sending node as the target message matching the vehicle node to be tested.

[0146] In one embodiment, the data acquisition module 902 is further used to: determine the file storage path of the selected hardware-in-the-loop testing software; and read the DBC file imported into the hardware-in-the-loop testing software based on the file storage path.

[0147] In one embodiment, the data acquisition module 902 is further used to determine a file storage path matching the selected hardware-in-the-loop test software based on a mapping relationship between the hardware-in-the-loop test software and the file storage path.

[0148] In one embodiment, the data acquisition module 902 is also used to: acquire a configuration data generation script; when an input operation for a second input position is detected, determine the content input at the second input position as the format content of the test configuration data of the selected hardware-in-the-loop test software; configure the format content of the test configuration data based on the configuration data generation script to obtain test configuration data that matches the selected hardware-in-the-loop test software.

[0149] In one embodiment, the determination module 904 is also used to: obtain software names of multiple hardware-in-the-loop test software; when a selection operation for the software name of the hardware-in-the-loop test software is detected, determine that a selection operation for the hardware-in-the-loop test software is detected, and the hardware-in-the-loop test software corresponding to the selected software name is the selected hardware-in-the-loop test software.

[0150] Each module in the hardware-in-the-loop test device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0151] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as DBC files imported into the selected hardware-in-the-loop test software. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a hardware-in-the-loop test method is implemented.

[0152] Those skilled in the art will understand that Fig.10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0153] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: when a selection operation for hardware-in-the-loop test software is detected, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software are obtained; the DBC file includes multiple communication messages; based on the comparison results between the communication nodes in the multiple communication messages and the vehicle nodes to be tested, a target message matching the vehicle nodes to be tested is determined; the target message is configured based on the test configuration data to obtain test data; and when the selected hardware-in-the-loop test software is run, the vehicle nodes to be tested are tested based on the test data.

[0154] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a DBC configuration file and a system variable file that match the test configuration data; and configuring the target message based on the DBC configuration file and the system variable file to obtain test data.

[0155] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining a write position in the DBC configuration file that matches the target message; when writing the target message to the write position, configuring at least one communication identifier that matches the target message based on the system variable file to obtain test data; wherein the communication node includes a sending node, and the communication identifier is used to characterize an abnormal communication scenario between the sending node and the vehicle node under test.

[0156] In one embodiment, when the processor executes the computer program, the following steps are also implemented: for at least one communication identifier of the target message, a corresponding function key is configured for each communication identifier, and different communication identifiers correspond to different function keys.

[0157] In one embodiment, the target message includes a signal value when the sending node communicates with the vehicle node under test; when the processor executes the computer program, the following steps are also implemented: upon receiving a modification operation on the signal value in the test data, the communication process between the sending node and the vehicle node under test is tested based on the modified signal value.

[0158] In one embodiment, the communication node includes a receiving node; when the processor executes the computer program, the following steps are also implemented: when an input operation for a first input position is detected, the content input at the first input position is determined as the vehicle node to be tested; from the multiple communication messages, a communication message whose receiving node is consistent with the vehicle node to be tested is determined; based on the determined communication message, a target message matching the vehicle node to be tested is determined.

[0159] In one embodiment, the communication node also includes a sending node; when the processor executes the computer program, the following steps are also implemented: obtaining a preset sending node corresponding to the vehicle node to be tested; from the determined communication messages, determining the communication message whose sending node is consistent with the preset sending node as a target message matching the vehicle node to be tested.

[0160] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the file storage path of the selected hardware-in-the-loop testing software; based on the file storage path, reading the DBC file imported into the hardware-in-the-loop testing software.

[0161] In one embodiment, when the processor executes the computer program, the following steps are further implemented: based on the mapping relationship between the hardware-in-the-loop test software and the file storage path, determining the file storage path that matches the selected hardware-in-the-loop test software.

[0162] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a configuration data generation script; when an input operation for a second input position is detected, determining the content input at the second input position as the format content of the test configuration data of the selected hardware-in-the-loop test software; configuring the format content of the test configuration data based on the configuration data generation script to obtain test configuration data that matches the selected hardware-in-the-loop test software.

[0163] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining software names of multiple hardware-in-the-loop test software; when a selection operation for the software name of the hardware-in-the-loop test software is detected, determining that a selection operation for the hardware-in-the-loop test software is detected, and the hardware-in-the-loop test software corresponding to the selected software name is the selected hardware-in-the-loop test software.

[0164] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: when a selection operation for hardware-in-the-loop test software is detected, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software are obtained; the DBC file includes multiple communication messages; based on the comparison results between the communication nodes in the multiple communication messages and the vehicle nodes to be tested, a target message matching the vehicle nodes to be tested is determined; the target message is configured based on the test configuration data to obtain test data; and when the selected hardware-in-the-loop test software is run, the vehicle nodes to be tested are tested based on the test data.

[0165] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a DBC configuration file and a system variable file matching the test configuration data; configuring the target message based on the DBC configuration file and the system variable file to obtain test data.

[0166] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a write position in the DBC configuration file that matches the target message; when writing the target message to the write position, configuring at least one communication identifier that matches the target message based on the system variable file to obtain test data; wherein the communication node includes a sending node, and the communication identifier is used to characterize an abnormal communication scenario between the sending node and the vehicle node under test.

[0167] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for at least one communication identifier of the target message, a corresponding function key is configured for each communication identifier, and different communication identifiers correspond to different function keys.

[0168] In one embodiment, the target message includes a signal value when the sending node communicates with the vehicle node under test; when the computer program is executed by the processor, the following steps are also implemented: upon receiving a modification operation on the signal value in the test data, the communication process between the sending node and the vehicle node under test is tested based on the modified signal value.

[0169] In one embodiment, the communication node includes a receiving node; when the computer program is executed by the processor, the following steps are also implemented: when an input operation for a first input position is detected, the content input at the first input position is determined as the vehicle node to be tested; from the multiple communication messages, a communication message whose receiving node is consistent with the vehicle node to be tested is determined; based on the determined communication message, a target message matching the vehicle node to be tested is determined.

[0170] In one embodiment, the communication node also includes a sending node; when the computer program is executed by the processor, the following steps are also implemented: obtaining a preset sending node corresponding to the vehicle node to be tested; from the determined communication messages, determining the communication message whose sending node is consistent with the preset sending node as a target message matching the vehicle node to be tested.

[0171] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the file storage path of the selected hardware-in-the-loop testing software; based on the file storage path, reading the DBC file imported into the hardware-in-the-loop testing software.

[0172] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: based on the mapping relationship between the hardware-in-the-loop test software and the file storage path, a file storage path matching the selected hardware-in-the-loop test software is determined.

[0173] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a configuration data generation script; when an input operation for a second input position is detected, determining the content input at the second input position as the format content of the test configuration data of the selected hardware-in-the-loop test software; configuring the format content of the test configuration data based on the configuration data generation script to obtain test configuration data that matches the selected hardware-in-the-loop test software.

[0174] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining software names of multiple hardware-in-the-loop test software; when a selection operation for the software name of the hardware-in-the-loop test software is detected, determining that a selection operation for the hardware-in-the-loop test software is detected, and the hardware-in-the-loop test software corresponding to the selected software name is the selected hardware-in-the-loop test software.

[0175] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0176] When a selection operation for hardware-in-the-loop test software is detected, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software are obtained; the DBC file includes multiple communication messages; based on the comparison results between the communication nodes in the multiple communication messages and the vehicle nodes to be tested, a target message matching the vehicle nodes to be tested is determined; the target message is configured based on the test configuration data to obtain test data; and when the selected hardware-in-the-loop test software is run, the vehicle nodes to be tested are tested based on the test data.

[0177] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a DBC configuration file and a system variable file matching the test configuration data; configuring the target message based on the DBC configuration file and the system variable file to obtain test data.

[0178] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a write position in the DBC configuration file that matches the target message; when writing the target message to the write position, configuring at least one communication identifier that matches the target message based on the system variable file to obtain test data; wherein the communication node includes a sending node, and the communication identifier is used to characterize an abnormal communication scenario between the sending node and the vehicle node under test.

[0179] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for at least one communication identifier of the target message, a corresponding function key is configured for each communication identifier, and different communication identifiers correspond to different function keys.

[0180] In one embodiment, the target message includes a signal value when the sending node communicates with the vehicle node under test; when the computer program is executed by the processor, the following steps are also implemented: upon receiving a modification operation on the signal value in the test data, the communication process between the sending node and the vehicle node under test is tested based on the modified signal value.

[0181] In one embodiment, the communication node includes a receiving node; when the computer program is executed by the processor, the following steps are also implemented: when an input operation for a first input position is detected, the content input at the first input position is determined as the vehicle node to be tested; from the multiple communication messages, a communication message whose receiving node is consistent with the vehicle node to be tested is determined; based on the determined communication message, a target message matching the vehicle node to be tested is determined.

[0182] In one embodiment, the communication node also includes a sending node; when the computer program is executed by the processor, the following steps are also implemented: obtaining a preset sending node corresponding to the vehicle node to be tested; from the determined communication messages, determining the communication message whose sending node is consistent with the preset sending node as a target message matching the vehicle node to be tested.

[0183] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the file storage path of the selected hardware-in-the-loop testing software; based on the file storage path, reading the DBC file imported into the hardware-in-the-loop testing software.

[0184] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: based on the mapping relationship between the hardware-in-the-loop test software and the file storage path, a file storage path matching the selected hardware-in-the-loop test software is determined.

[0185] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a configuration data generation script; when an input operation for a second input position is detected, determining the content input at the second input position as the format content of the test configuration data of the selected hardware-in-the-loop test software; configuring the format content of the test configuration data based on the configuration data generation script to obtain test configuration data that matches the selected hardware-in-the-loop test software.

[0186] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining software names of multiple hardware-in-the-loop test software; when a selection operation for the software name of the hardware-in-the-loop test software is detected, determining that a selection operation for the hardware-in-the-loop test software is detected, and the hardware-in-the-loop test software corresponding to the selected software name is the selected hardware-in-the-loop test software.

[0187] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0188] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0189] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A hardware-in-the-loop testing method, characterized in that: The method comprises: When a selection operation for hardware-in-the-loop test software is detected, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software are obtained; the DBC file includes a plurality of communication messages; Based on the comparison results between the communication nodes in the plurality of communication messages and the vehicle node to be tested, determining a target message matching the vehicle node to be tested from the plurality of communication messages; Obtaining a DBC configuration file and a system variable file matching the test configuration data; Determine a write position in the DBC configuration file that matches the target message; When the target message is written to the write location, at least one communication identifier matching the target message is configured based on the system variable file to obtain test data; wherein the communication node includes a sending node, and the communication identifier is used to characterize a communication abnormality scenario between the sending node and the vehicle node to be tested; the system variable file is used to make the test data reflect a communication scenario, and the communication scenario includes a normal communication scenario and / or a communication abnormality scenario; When the selected hardware-in-the-loop test software is run, the vehicle node to be tested is tested based on the test data.

2. The method according to claim 1, characterized in that The method further comprises: For at least one communication identifier of the target message, a corresponding function key is configured for each communication identifier, and different communication identifiers correspond to different function keys.

3. The method according to claim 1, characterized in that The target message includes a signal value when the sending node communicates with the vehicle node to be tested; the method further includes: In case of receiving a modification operation on the signal value in the test data, the communication process between the sending node and the vehicle node to be tested is tested based on the modified signal value.

4. The method according to claim 1, characterized in that The communication node includes a receiving node; the method further includes: When an input operation for a first input position is detected, content input at the first input position is determined as the vehicle node to be tested; The determining, based on the comparison results between the communication nodes in the plurality of communication messages and the vehicle node to be tested, a target message matching the vehicle node to be tested comprises: Determine, from the plurality of communication messages, a communication message in which a receiving node is consistent with the vehicle node to be tested; Based on the determined communication message, a target message matching the vehicle node to be tested is determined.

5. The method according to claim 4, characterized in that The communication node also includes a sending node; the determining, based on the determined communication message, a target message matching the vehicle node to be tested, includes: Obtaining a preset sending node corresponding to the vehicle node to be tested; From the determined communication messages, a communication message whose sending node is consistent with the preset sending node is determined as a target message that matches the vehicle node to be tested.

6. The method according to any one of claims 1 to 5, characterized in that: The obtaining of the DBC file imported into the selected hardware-in-the-loop testing software comprises: Determine the file storage path of the selected hardware-in-the-loop test software; Based on the file storage path, the DBC file imported into the hardware-in-the-loop testing software is read.

7. The method according to claim 6, characterized in that Determining the file storage path of the selected hardware-in-the-loop test software includes: Based on the mapping relationship between the hardware-in-the-loop test software and the file storage path, a file storage path matching the selected hardware-in-the-loop test software is determined.

8. The method according to claim 6, characterized in that Acquiring test configuration data matching the selected hardware-in-the-loop test software, including: Get the configuration data to generate the script; When an input operation for a second input position is detected, the content inputted at the second input position is determined as the format content of the test configuration data of the selected hardware-in-the-loop test software; The format content of the test configuration data is configured based on the configuration data generation script to obtain test configuration data matching the selected hardware-in-the-loop test software.

9. The method according to claim 8, characterized in that The method further comprises: Get the software names of multiple hardware-in-the-loop test software; When a selection operation for a software name of the hardware-in-the-loop test software is detected, it is determined that the selection operation for the hardware-in-the-loop test software is detected, and the hardware-in-the-loop test software corresponding to the selected software name is the selected hardware-in-the-loop test software.

10. A hardware-in-the-loop testing device, characterized in that: The device comprises: A data acquisition module, for acquiring, when a selection operation for hardware-in-the-loop test software is detected, a DBC file imported into the selected hardware-in-the-loop test software and test configuration data matching the selected hardware-in-the-loop test software; the DBC file includes a plurality of communication messages; A determination module, configured to determine a target message matching the vehicle node to be tested from the plurality of communication messages based on a comparison result between the communication nodes in the plurality of communication messages and the vehicle node to be tested; A processing module, used to obtain a DBC configuration file and a system variable file matching the test configuration data; determine a write position in the DBC configuration file that matches the target message; when the target message is written to the write position, based on the system variable file, configure at least one communication identifier that matches the target message to obtain test data; wherein the communication node includes a sending node, and the communication identifier is used to characterize a communication abnormality scenario between the sending node and the vehicle node to be tested; the system variable file is used to make the test data reflect a communication scenario, and the communication scenario includes a normal communication scenario and / or a communication abnormality scenario; A testing module is used to test the vehicle node to be tested based on the test data while running the selected hardware-in-the-loop testing software.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • CAN checksum script automatic generation method and device, equipment and storage medium

    CN118409915A