A vehicle control unit model-in-loop test system and method

The vehicle controller model-in-the-loop testing system and method solves the problems of single-item testing and low testing efficiency in existing testing, realizes comprehensive, effective and automatic testing of different projects and products, and improves the testing efficiency and security of vehicle controller software models.

CN119882696BActive Publication Date: 2025-12-26CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510069342.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-12-26
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

Existing vehicle controller model-in-the-loop testing suffers from issues such as project homogeneity, lack of real-world data usage, and simplistic test cases that are not shared with hardware-in-the-loop testing, resulting in low testing efficiency and impacting the safe operation of the vehicle.

Method used

A model-in-the-loop testing system and method for vehicle controllers is provided, including an architecture module, a calibration module, a script module, and an interface module. The system builds a physical model through a pre-defined platform-based model architecture and combines data calibration and script programs to achieve comprehensive, effective, and automated testing of different projects and products.

Benefits of technology

It improves the efficiency of vehicle controller software model-in-the-loop testing, ensures the safe operation of the vehicle, and exposes test problems in advance by simulating the signal sources and flow of real vehicles, thus approximating hardware-in-the-loop test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119882696B_ABST
    Figure CN119882696B_ABST
Patent Text Reader

Abstract

The application relates to the field of automobile testing technology and discloses a vehicle controller model-in-loop test system and method, which comprises a framework module, a calibration module, a script module and an interface module; wherein the framework module is used for building a physical model required by a model-in-loop test environment, the physical model is built according to a preset platform model architecture of vehicle controller software testing in response to preset test requirements; the calibration module is used for providing a vehicle controller software model to be tested after data calibration; the script module comprises a script program connected with the physical model and the vehicle controller software model to be tested, and generates a corresponding interface model in the interface module by running the script program, the interface model is used for communication between the framework module and the calibration module. The application can provide a comprehensive, effective and automatic model-in-loop test system of the vehicle controller suitable for different projects and products, improve the model-in-loop test efficiency of the vehicle controller software model and guarantee the safe operation of the vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of automobile testing technology, in particular to a vehicle control unit model-in-loop test system and method. BACKGROUND

[0002] As a core component of the automobile, the vehicle control unit collects signal data such as the accelerator pedal, gear, brake pedal, etc. to determine the driving intention of the driver, and monitors the vehicle state such as the vehicle speed, temperature, etc. to generate corresponding operation control instructions for controlling the safe, stable and reliable operation of the vehicle. Therefore, the quality of the vehicle control unit directly determines the stability and safety of the vehicle.

[0003] Currently, with the diversified and rapid updating development trend of the vehicle control unit, the software development cycle of each function of the controller is shortened, which makes the software change faster, and further leads to heavy testing tasks of the vehicle control unit. Model-in-loop (MIL) testing is a common testing method, which is used to verify whether the control model meets the functional requirements in the form of pure software simulation after the model is developed. That is, MIL testing is a model simulation test using Simulink by integrating the vehicle control unit software model and the vehicle model to form a closed-loop control. It is used to verify the system function logic in the early stage of software development, can quickly locate the test problem, and can effectively improve the software development efficiency and reduce the testing cost.

[0004] However, due to the variety of vehicle driving types and functional requirements, the existing MIL testing of the vehicle control unit only tests specific vehicle models, such as electric vehicles, which leads to the singleness of the corresponding project and product of the vehicle control unit model; more than that, only the simulation and reading of a single signal, it is also difficult to meet the testing requirements of the vehicle control unit software function involving complex logic processing. In addition, the implementation of the existing vehicle control unit software function is strongly associated with the calibration data, but the existing MIL testing lacks the use of real data; and the test cases are relatively simple, and the case library is not shared with the hardware-in-the-loop test, which makes the efficiency of the MIL testing poor, and further affects the safe operation of the vehicle. SUMMARY

[0005] Therefore, the present application provides a vehicle control unit model-in-loop test system and method to solve the problem of the lack of comprehensive, effective and automatic model-in-loop testing of the vehicle control unit of different projects and products, which leads to many defects and seriously affects the safe operation of the vehicle.

[0006] In a first aspect, the present application provides a vehicle control unit model-in-loop test system, which comprises:

[0007] The architecture module, the calibration module, the script module and the interface module;

[0008] The architecture module is configured to build a physical model required by the model-in-the-loop test environment, and the physical model is built according to a preset platformization model architecture of the vehicle controller software test in response to a preset test requirement.

[0009] The calibration module is configured to provide a vehicle controller software model to be tested after data calibration.

[0010] The script module includes a script program connecting the physical model and the vehicle controller software model to be tested, and generates a corresponding interface model in the interface module by running the script program, wherein the interface model is configured to communicate between the architecture module and the calibration module.

[0011] The vehicle controller model-in-the-loop test system can build a physical model meeting different test environment requirements through a preset platformization model architecture of the vehicle controller software test, and can facilitate comprehensive, effective and automatic model-in-the-loop test of the vehicle controller suitable for different projects and products by combining the vehicle controller software model to be tested after data calibration, the script program and the interface model, thereby greatly improving the efficiency of the vehicle controller software model-in-the-loop test and ensuring safe operation of the vehicle.

[0012] In an alternative embodiment, the architecture module includes a first architecture unit, a second architecture unit and a third architecture unit.

[0013] The first architecture unit is a data layer including a parameter file and a configuration file, the parameter file includes a first parameter file and a second parameter file, the first parameter file is composed of vehicle type independent control parameters and physical calculation parameters, and the second parameter file is a model initialization parameter related to the vehicle type adapted to the preset test requirement, and the model initialization parameter at least includes engine parameters, battery parameters, motor parameters and vehicle parameters.

[0014] The second architecture unit is a software layer including at least one preset function module, and the model parameters and model functions of each preset function module are determined by the corresponding parameter file and configuration file in the first architecture unit.

[0015] The third architecture unit is an interface layer configured to communicate between each preset function module in the second architecture unit.

[0016] The architecture module of the application designs a preset platformization model architecture of the whole vehicle controller software test, which comprises a first architecture unit of a data layer, a second architecture unit of a software layer and a third architecture unit of an interface layer; a physical model meeting different test environment requirements can be built through the preset platformization model architecture, wherein the physical model can cover different projects and products, and thus the signal transmission between the physical models of the whole vehicle controller software model in-loop test and the state changes of various controllers are realized, the signal source and flow direction of each subsystem of a real vehicle can be simulated, and the state flow and change of the whole vehicle controller software to other controllers and the influence on the whole vehicle system become possible.

[0017] In an alternative embodiment, the calibration module comprises a first calibration unit, a second calibration unit and a third calibration unit.

[0018] The first calibration unit is configured to identify a preset calibration data file, wherein the preset calibration data file comprises a calibration name, a calibration value and a calibration type.

[0019] The second calibration unit is configured to identify a to-be-calibrated data object file of the preset whole vehicle controller software model, wherein the to-be-calibrated data object file comprises a data object name, a data object value and a data object type.

[0020] The third calibration unit is configured to calibrate the preset whole vehicle controller software model according to the preset calibration data file and the to-be-calibrated data object file, and obtain a to-be-tested whole vehicle controller software model.

[0021] The calibration module of the application comprises a first calibration unit for identifying a preset calibration data file, a second calibration unit for identifying a to-be-calibrated data object file of a preset whole vehicle controller software model, and a third calibration unit for calibrating the preset whole vehicle controller software model according to the preset calibration data file and the to-be-calibrated data object file, and obtaining a to-be-tested whole vehicle controller software model, which can realize the import of calibration data of the whole vehicle controller software model, make the in-loop test result of the model closer to the hardware-in-the-loop test and real vehicle test result, expose the test problem in advance, further improve the in-loop test efficiency of the whole vehicle controller software model, and ensure the safe operation of the whole vehicle.

[0022] In an alternative embodiment, the interface module comprises a first interface unit and a second interface unit.

[0023] The first interface unit is configured to provide a first interface model supporting CAN communication.

[0024] The second interface unit is configured to provide a second interface model supporting hard-wire communication.

[0025] The interface module of the application designs a first interface unit containing a first interface model providing support for CAN communication and a second interface model providing support for hard-wire communication, and can provide corresponding interfaces for communication of various modules by considering different communication modes of various components in a whole vehicle.

[0026] In an alternative embodiment, the script module comprises a first script unit and a second script unit.

[0027] The first script unit is configured to provide a first script program for generating the first interface model, and the first script program is composed of operations of reading a first preset table and connecting the model according to software internal signal names after data conversion of the first preset table.

[0028] The second script unit is configured to provide a second script program for generating the second interface model, and the second script program is composed of operations of traversing software internal hard-wire signal names and connecting the model.

[0029] The script module of the application designs a first script unit containing a first script program for generating the first interface model and a second script unit containing a second script program for generating the second interface model, and can generate interface models by running different script programs, so as to ensure communication between different modules.

[0030] In a second aspect, the application provides a whole vehicle controller model-in-loop test method, which is applied to the whole vehicle controller model-in-loop test system in the first aspect or any of the alternative embodiments thereof.

[0031] In response to a preset test requirement, a physical model is built according to a preset platformized model architecture of the whole vehicle controller software test, and the physical model is configured to configure an environment required for model-in-loop test.

[0032] A preset calibration data file and a to-be-calibrated data object file of a preset whole vehicle controller software model are obtained, and the preset whole vehicle controller software model is calibrated according to the preset calibration data file and the to-be-calibrated data object file, so as to obtain a to-be-tested whole vehicle controller software model.

[0033] A script program for model connection is determined based on the physical model and the to-be-tested whole vehicle controller software model, and the script program is run to obtain a corresponding interface model, wherein the interface model is used for communication between the physical model and the to-be-tested whole vehicle controller software model.

[0034] A test case is selected from a preset test case library based on a preset test requirement, and the test case is converted to obtain a test script program.

[0035] Run the test script and output a test report based on the results.

[0036] This invention constructs a physical model based on a pre-defined platform-based model architecture for vehicle controller software testing. This physical model provides a model-in-the-loop (MIL) testing environment that meets pre-defined testing requirements. Data calibration is performed using pre-defined calibration data files and the pre-defined vehicle controller software model's data object files to be calibrated, resulting in the vehicle controller software model to be tested. This model provides a MIL test object that meets pre-defined testing requirements. After constructing the MIL test system using scripts and interface models, testing is conducted using test cases selected from a pre-defined test case library that meet pre-defined testing requirements, generating a corresponding test report. This invention provides a comprehensive, effective, and automated MIL test method for vehicle controllers applicable to different projects and products, significantly improving the efficiency of vehicle controller software MIL test and further ensuring the safe operation of the vehicle.

[0037] In one optional implementation, data calibration is performed on a preset vehicle controller software model based on a preset calibration data file and a data object file to be calibrated, including:

[0038] The system reads and converts the preset calibration data file and the data object file to be calibrated. The preset calibration data file includes the calibration name, calibration value, and calibration type, while the data object file to be calibrated includes the data object name, data object value, and data object type.

[0039] Filter the data object names that match the calibration name, and determine the data object to be calibrated, its current value, and its current type based on the data object name;

[0040] The calibration value is processed based on the calibration value, calibration type, current value, and current type, and the processed calibration value is assigned to the current value.

[0041] This invention performs file reading and format conversion operations on a preset calibration data file and a data object file to be calibrated, filters data object names that match the calibration name, and determines the data object to be calibrated, its current value, and current type based on the data object name. It then processes the calibration value based on the calibration value, calibration type, current value, and current type, and assigns the processed calibration value to the current value to calibrate the preset vehicle controller software model. This makes the model-in-the-loop test results closer to the hardware-in-the-loop test and real vehicle test results, allowing test problems to be exposed earlier, further improving the efficiency of the vehicle controller software model-in-the-loop test, and ensuring the safe operation of the vehicle.

[0042] In an optional implementation, the data processing on the calibration value based on the calibration value, the calibration type, the current value and the current type comprises:

[0043] If the calibration type is different from the current type, the calibration value is converted into a value corresponding to the current type;

[0044] If the calibration value is different from the current value in dimension, the calibration value is interpolated based on the dimension of the current value.

[0045] The present application considers the two cases that the calibration type is different from the current type and the calibration value is different from the current value in dimension, and correspondingly designs the corresponding data processing mode to ensure the accuracy of data calibration.

[0046] In an optional implementation, the preset test case library at least contains test cases of hardware-in-the-loop test, software-in-the-loop test and model-in-the-loop test, wherein the format of the test case is an xml file, the test case is converted to obtain a test script program, comprising:

[0047] reading the xml file;

[0048] identifying the test case in the xml file;

[0049] converting the test case based on a preset writing method to correspondingly obtain the test script program, wherein the preset writing method is a statement or function written according to different script languages.

[0050] The preset test case library containing test cases of hardware-in-the-loop test, software-in-the-loop test and model-in-the-loop test and the format conversion of the test case can realize the automatic test of the vehicle controller software model-in-the-loop test, guarantee that the model-in-the-loop test and the hardware-in-the-loop test share the test case library, automatically control the model-in-the-loop test system to run and data to interact, and further complete the execution of complex logic steps and the processing and determination of signal data.

[0051] In an optional implementation, a test report is output according to the running result, comprising:

[0052] identifying the comment and attribute information in the test script program;

[0053] detecting whether there is a running fault in the running process of the test script program;

[0054] when there is a running fault, recording the statement position, the occurrence time and the program error information of the fault, wherein the program error information comprises an error identifier, an error occurrence stack and an error reason;

[0055] Statistical test script program statement fault condition, and generate in-loop test case report of vehicle controller software model to be tested based on annotation, attribute information and statement fault condition;

[0056] Detect whether there is modification of test case in the running process of test script program;

[0057] When there is modification of test case, store the corresponding modification information to obtain a temporary file;

[0058] The test report is composed of in-loop test case report and / or program error information and / or temporary file.

[0059] The application obtains in-loop test case report, program error information or temporary file according to the running result in the running process of test script program to obtain test report and output, which can provide comprehensive test result.

[0060] The vehicle controller model in-loop test system and method of the application builds a physical model meeting different test environment requirements through a preset platformized model architecture of vehicle controller software test; data calibration is performed according to preset calibration data file and preset vehicle controller software model data object file to be calibrated to obtain model in-loop test object, i.e. vehicle controller software model to be tested; and after the model in-loop test system is constructed through script program and interface model, test is performed in combination with test case meeting preset test requirement selected from preset test case library to obtain test report; the above system and method provide a comprehensive, effective and automatic model in-loop test method of vehicle controller applicable to different projects and products, which helps to greatly improve the efficiency of vehicle controller software model in-loop test and greatly guarantees the safe operation of vehicle. BRIEF DESCRIPTION OF DRAWINGS

[0061] In order to more clearly illustrate the specific embodiments of the application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the description of specific embodiments or prior art. Obviously, the drawings in the following description are some embodiments of the application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0062] Figure 1 is a structural schematic diagram of a vehicle controller model in-loop test system according to an embodiment of the application;

[0063] Figure 2 is a structural schematic diagram of another vehicle controller model in-loop test system according to an embodiment of the application;

[0064] Figure 3 is a platformized model architecture schematic diagram of vehicle controller software test;

[0065] Figure 4 is a flowchart of a calibration data integration method of a vehicle controller software model;

[0066] Figure 5 is a connection diagram of a vehicle controller software model in-loop test system;

[0067] Figure 6 is a flowchart of a vehicle controller model in-loop test method according to an embodiment of the present application;

[0068] Figure 7 is a flowchart of another vehicle controller model in-loop test method according to an embodiment of the present application. DETAILED DESCRIPTION

[0069] In order to make the objects, technical solutions and advantages of embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0070] In the present embodiment, a vehicle controller model in-loop test system is provided, Figure 1 is a structural diagram of a vehicle controller model in-loop test system according to an embodiment of the present application. As shown in the figure, Figure 1 the system comprises an architecture module 1, a calibration module 2, a script module 3 and an interface module 4; wherein the architecture module 1 is configured to build a physical model required by a model in-loop test environment, the physical model is built according to a preset platformization model architecture of vehicle controller software test in response to a preset test requirement; the calibration module 2 is configured to provide a vehicle controller software model to be tested after data calibration; the script module 3 comprises a script program connecting the physical model and the vehicle controller software model to be tested, and generates a corresponding interface model in the interface module 4 by running the script program, wherein the interface model is configured to communicate between the architecture module and the calibration module.

[0071] It should be noted that the specific content of the preset test requirement in the present embodiment is not limited here and is adaptively determined based on actual requirements; the preset platformization model architecture of vehicle controller software test in the present embodiment is a platformization model architecture proposed for building a physical model required by a vehicle controller software model in-loop test environment and applicable to different projects and products. Specifically, the platformization model architecture can facilitate switching between projects and products.

[0072] The vehicle controller model-in-the-loop testing system in this embodiment of the invention can build physical models that meet the needs of different testing environments through a preset platform-based model architecture for vehicle controller software testing. Combined with the data-calibrated vehicle controller software model under test, script programs, and interface models, it facilitates comprehensive, effective, and automatic model-in-the-loop testing of vehicle controllers applicable to different projects and products. This greatly improves the efficiency of vehicle controller software model-in-the-loop testing and thus ensures the safe operation of the vehicle.

[0073] In one specific embodiment, Figure 2 This is a schematic diagram of another vehicle controller model-in-the-loop test system according to an embodiment of the present invention. Figure 2 It is known that architecture module 1 includes: a first architecture unit 11, a second architecture unit 12, and a third architecture unit 13; wherein, the first architecture unit 11 is a data layer, including parameter files and configuration files. The parameter files include a first parameter file and a second parameter file. The first parameter file consists of control parameters and physical calculation parameters that are independent of the vehicle model. The second parameter file is a model initialization parameter that is vehicle model-related and adapted to preset test requirements. The model initialization parameter includes at least engine parameters, battery parameters, motor parameters, and vehicle parameters; the second architecture unit 12 is a software layer containing at least one preset functional module, wherein the model parameters and model functions of each preset functional module are determined by the corresponding parameter files and configuration files in the first architecture unit; the third architecture unit 13 is an interface layer used for communication between the preset functional modules in the second architecture unit.

[0074] It should be noted that the platform-based model architecture for vehicle controller software testing in this embodiment aims to improve development efficiency, reduce costs, enhance flexibility, and promote standardization. Specifically, by sharing the infrastructure and components, the development process becomes more efficient while reducing development and maintenance costs. Furthermore, platformization enhances the system's flexibility and scalability, facilitating rapid adaptation to changes in market demands. The architecture of this embodiment includes: parameters and configuration files for adapting to projects and products; wherein the parameter file is a model initialization parameter file related to the vehicle model and distinguished by the model name; the configuration file includes power type, drive mode, hardware configuration, and vehicle communication method. A software layer containing different functional modules is also included, including a driver module, environment module, actuator module, sensor module, controller module, and vehicle module. It should be noted that the model parameters for different projects and products are determined by the working variables loaded from the parameter file into the workspace; the module functions for different projects and products are switched using the configuration file. Finally, an IO interface layer for data interaction within the software layer is also included.

[0075] In one specific embodiment, a platform-based model architecture for testing vehicle controller software is provided. Figure 3is a schematic diagram of a platformized model architecture of a vehicle controller software test. The architecture includes three parts, and the specific components include: Figure 3

[0076] The first part is a configuration file and a parameter file. The configuration file includes parameters of power type, driving mode, hardware configuration, and vehicle communication mode. Specifically, the power type includes hybrid power, plug-in hybrid power, extended-range power, and pure electric power; the driving mode includes two-wheel front drive, two-wheel rear drive, four-wheel front drive, and four-wheel rear drive; the hardware configuration includes P-gear mechanism, electronic handbrake hard switch, and gear switching mode; and the vehicle communication mode includes different CAN communication protocols. The parameter file includes two types. The first parameter file includes control parameters and physical calculation parameters that are independent of vehicle models, and the second parameter file includes vehicle model related model initialization parameters of different projects and products, including engine parameters, battery parameters, motor parameters, and vehicle parameters. In this embodiment, when switching between different projects and products, only the configuration file and the second parameter file need to be switched, and the configuration file and the parameter file are loaded into the working area.

[0077] The second part is a software layer including different functional modules. The software layer includes a driver module, an environment module, an actuator module, a sensor module, a controller module, and a vehicle module. Specifically, the actuator module, the sensor module, the controller module, and the vehicle module read parameters from the working area in the form of configuration variables and parameter variables; each module selects the corresponding implemented function according to the configuration variable without modifying the model, and loads the parameter variable into the model, thereby realizing the switching between different projects and products.

[0078] The third part is an IO interface layer. In this embodiment, the interface layer is used for data interaction between different modules of the software layer. Each module sends data to the IO interface layer and obtains data sent by other modules from the IO interface layer, thereby realizing the simulation of signal sources and flows between vehicle systems.

[0079] In a specific embodiment, an example of data flow is provided, including: the driver module outputs a driver operation signal to the IO interface layer; the vehicle module obtains the driver operation signal, environmental parameters, and actuator data from the IO interface layer, and outputs vehicle state data to the IO interface layer; the controller module obtains the driver operation signal and sensor data from the IO interface layer, and each controller of the controller module obtains output signals of other controllers from the IO interface layer and outputs controller signals to the IO interface layer; the actuator module obtains the controller output signals from the IO interface layer and outputs actuator data to the IO interface layer; the sensor module obtains vehicle state data from the IO interface layer and outputs sensor data to the IO interface layer; and the environment module outputs environmental parameters to the IO interface layer.

[0080] ​The physical model is obtained through the architecture module in the embodiment of the application, project and product switching can be conveniently performed without modifying the model, and simulation of system level signal flow transfer can be implemented. Specifically, signal transmission between vehicle controller software model in-loop test physical models and state changes of various controllers are implemented, the signal sources and flow directions of various subsystems of a real vehicle can be simulated, and the state flow and transfer of other controllers and the influence of vehicle controller software on the vehicle system are made possible.

[0081] In a specific embodiment, Figure 2 is a structural schematic diagram of another vehicle controller model in-loop test system according to the embodiment of the application. The vehicle controller model in-loop test system comprises a calibration module 2, a vehicle controller software model 3 and a vehicle controller software model in-loop test platform 4. Figure 2 It can be known that the calibration module 2 comprises a first calibration unit 21, a second calibration unit 22 and a third calibration unit 23; the first calibration unit 21 is configured to identify a preset calibration data file, the preset calibration data file comprising a calibration name, a calibration value and a calibration type; the second calibration unit 22 is configured to identify a preset vehicle controller software model to-be-calibrated data object file, the to-be-calibrated data object file comprising a data object name, a data object value and a data object type; and the third calibration unit 23 is configured to perform data calibration on the preset vehicle controller software model according to the preset calibration data file and the to-be-calibrated data object file, to obtain a to-be-tested vehicle controller software model.

[0082] It should be noted that the embodiment provides a calibration data integration method of a vehicle controller software model, which is used for integrating vehicle calibration data in the vehicle controller software model. Specifically, the data calibration process comprises the following steps: identifying a vehicle calibration data file (i.e. real performance data of the software in the vehicle), and specifically reading the calibration in the file, including a calibration name, a calibration value and a calibration type; identifying a data object management file of the vehicle controller software model (i.e. a preset theoretical value of the software), and specifically reading the data object in the file, including a data object name, a data object value and a data object type; matching the data object and the calibration according to the data object name and the calibration name, assigning the calibration value to the corresponding data object value after data processing, and saving the data object to the data object management file.

[0083] In a specific embodiment, Figure 4 is a flowchart of the calibration data integration method of the vehicle controller software model. It can be known that the calibration data integration method comprises the following four steps: Figure 4

[0084] Step one, reading the calibration in the vehicle calibration data file.

[0085] ​In the embodiment, the vehicle calibration data file is a vehicle controller software calibration file obtained after calibration of an actual vehicle. Specifically, the calibration in the file is read and converted into variables recognizable by a computer program, including calibration name, calibration value and calibration type.

[0086] Step two, reading data objects in the vehicle controller software model data object management file.

[0087] In the embodiment, the data objects are adjustable calibration parameters of the vehicle controller software model. Specifically, the data objects in the file are read and converted into variables recognizable by a computer program, including data object name, data object value and data object type.

[0088] Step three, matching data objects with calibrations and performing data processing on the calibrations.

[0089] In the embodiment, calibrations and data objects are traversed to find calibrations and data objects with the same calibration name and data object name. Specifically, if the calibration type of the calibration and the data object type of the data object are inconsistent, the calibration value is converted into the value of the data object type; if the dimension of the calibration value and the dimension of the data object value are inconsistent, the calibration value is interpolated according to the dimension of the data object value to obtain the calibration value after data processing.

[0090] It should be noted that interpolating data with different dimensions can unify the data dimension, facilitating subsequent data analysis and processing. In the embodiment, the specific interpolation method can be determined according to the characteristics of the data and the analysis requirements, and common interpolation methods include linear interpolation, polynomial interpolation, spline interpolation, etc.

[0091] Step four, assigning the calibration to the corresponding data object and saving to the data object management file.

[0092] In the embodiment, the calibration value after data processing is assigned to the matching data object value, and the data object corresponding to the data object value is saved to the data object management file.

[0093] In the embodiment, the calibration module is used to import the vehicle calibration data of the vehicle controller software model, so that the model-in-loop test result is closer to the hardware-in-loop test and real vehicle test result, the time of exposing test problems is advanced, the efficiency of the vehicle controller software model-in-loop test is further improved, and the safe operation of the vehicle is ensured.

[0094] It should be noted that the number of script programs in the script module of the embodiment is adaptively adjusted according to the number of interface units in the interface module, and the number of interface units is adaptively adjusted according to the communication modes supported by each component in the actual vehicle, such as the communication mode supporting the bus and the communication mode supporting the hardwire, which are only exemplary.

[0095] In a specific embodiment, Figure 2 is a structural schematic diagram of another vehicle controller model-in-the-loop test system according to an embodiment of the application. By Figure 2 It can be known that the interface module 4 includes a first interface unit 41 and a second interface unit 42; wherein the first interface unit 41 is used to provide a first interface model supporting CAN communication; and the second interface unit 42 is used to provide a second interface model supporting hardwire communication. Specifically, different communication modes of each component in the vehicle are considered through the interface module, and corresponding interfaces are provided for the communication of each module.

[0096] It should be noted that CAN (Controller Area Network) is an internationally standardized serial communication protocol, mainly used for real-time applications, and has become a standard bus protocol in the automotive industry. The signal involved in the communication process is a CAN signal; the hardwire mainly refers to the physical connection mode used in the traditional automotive electrical system, including wires, connectors and wiring harnesses, etc., which are used to transmit power and signals and connect various components and sensors. The signal involved in the communication process is a hardwire signal.

[0097] In a specific embodiment, Figure 2 is a structural schematic diagram of another vehicle controller model-in-the-loop test system according to an embodiment of the application. By Figure 2 It can be known that the script module 3 includes a first script unit 31 and a second script unit 32; wherein the first script unit 31 is used to provide a first script program for generating the first interface model, the first script program is composed of operations of reading a first preset table, performing data conversion on the first preset table, and connecting the model according to the software internal signal name, and the first preset table contains the mapping relationship of different CAN signals, software internal signals and model default values; and the second script unit 32 is used to provide a second script program for generating the second interface model, the second script program is composed of operations of traversing the software internal hardwire signal name and connecting the model.

[0098] It should be noted that the script module 3 in the embodiment is used to integrate the script programs of the physical model and the vehicle controller software model to construct the interface model; the interface module 4 is used to implement the script programs to obtain the corresponding interface model to establish the communication bridge between different models; and the specific content of the first preset table and the second preset table is not limited here, and is adaptively adjusted based on the actual product or project requirements.

[0099] In the embodiment, a script program supporting different communication modes is generated, specifically including the following three steps:

[0100] Step one, read the correspondence table of input and output CAN signals and software internal signals, the correspondence table has predetermined rules, that is, after the software design is completed, the controller obtains data (including specific values and types) from the CAN bus, and converts the above data into variables recognizable by the computer program, including CAN signal name, software internal signal name and default value (i.e. model default value).

[0101] Step two, add CAN signal interface model. Specifically, traverse the software internal signal name, if the corresponding CAN signal name is empty, add a model with constant zero and connect the vehicle controller software model; if the corresponding CAN signal name exists, add a model connected to the corresponding CAN signal in the physical model IO interface layer; if the corresponding CAN signal in the physical model IO interface layer does not exist, add a model with constant default value and connect the vehicle controller software model.

[0102] Step three, add virtual hard-wire signal interface model. Specifically, traverse the software internal hard-wire signal name, add a model connected to the corresponding hard-wire signal in the physical model IO interface layer.

[0103] The script module in the embodiment designs a first script unit including a first script program for generating a first interface model and a second script unit including a second script program for generating a second interface model, and only by running different script programs can the interface model be generated correspondingly, so as to guarantee the communication between different modules.

[0104] In a specific embodiment, a vehicle controller software model in-loop test system is provided, the system includes: a physical model built through a preset platformization model architecture, a vehicle controller software model obtained through a calibration data integration method, a script program integrating the physical model and the vehicle controller software model, and an interface model including CAN signals and virtual hard-wire signals obtained by implementing different script programs, Figure 5 is a connection diagram of the vehicle controller software model in-loop test system.

[0105] The embodiment of the application also provides a vehicle controller model in-loop test method embodiment. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0106] The embodiment provides a vehicle controller model-in-loop test method, which is applied to a vehicle controller model-in-loop test system, Figure 6 is a flowchart of the vehicle controller model-in-loop test method according to the embodiment of the application, as shown in the figure, the flowchart comprises the following steps: Figure 6

[0107] In step S601, a physical model is built according to a preset platformization model architecture of vehicle controller software test in response to a preset test requirement, and the physical model is used to configure an environment required by model-in-loop test.

[0108] It should be noted that the related content of the preset test requirement, the preset platformization model and the physical model in the embodiment is described above, and is not repeated here.

[0109] In step S602, a preset calibration data file and a to-be-calibrated data object file of a preset vehicle controller software model are acquired, and the preset vehicle controller software model is calibrated according to the preset calibration data file and the to-be-calibrated data object file, so as to obtain a to-be-tested vehicle controller software model.

[0110] In the embodiment, the specific content of the data calibration is described above, and is not repeated here.

[0111] In step S603, a script program of model connection is determined based on the physical model and the to-be-tested vehicle controller software model, and the script program is run to obtain a corresponding interface model, wherein the interface model is used for communication between the physical model and the to-be-tested vehicle controller software model.

[0112] In the embodiment, the related content of the script program and the interface model is described above, and is not repeated here.

[0113] In step S604, a test case is selected from a preset test case library based on the preset test requirement, and the test case is converted to obtain a test script program.

[0114] It should be noted that the preset test case library in the embodiment is used to meet different software function test requirements, and integrates a case library constructed by different test modes, for example, the test modes include hardware-in-loop test, software-in-loop test and model-in-loop test, etc. In actual application, because the file formats of test cases provided by different test modes are different, the test cases need to be format-converted to generate a standardized script program which can be directly used for test.

[0115] In step S605, the test script program is run, and a test report is output according to a running result.

[0116] ​It should be noted that the specific content of the test report in the embodiment is not limited here and can be adjusted as needed. For example, test results, types and causes of program running failures, are only illustrative.

[0117] The vehicle controller model-in-loop test method according to the embodiment of the application builds a physical model according to a preset platformized model architecture for vehicle controller software testing, the physical model providing a model-in-loop test environment meeting preset test requirements; data calibration is performed according to a preset calibration data file and a data object file to be calibrated of a preset vehicle controller software model, to obtain a vehicle controller software model to be tested, for providing a model-in-loop test object meeting preset test requirements; and after a model-in-loop test system is constructed through a script program and an interface model, test is performed in combination with test cases meeting preset test requirements selected from a preset test case library, to obtain a test report correspondingly, which can provide a comprehensive, effective and automatic model-in-loop test method for vehicle controllers suitable for different projects and products, and can greatly improve the efficiency of model-in-loop test of vehicle controller software models and further ensure safe operation of a vehicle.

[0118] In the embodiment, a vehicle controller model-in-loop test method is provided, Figure 7 is a flowchart of another vehicle controller model-in-loop test method according to the embodiment of the application, as shown in Figure 7 The flowchart includes the following steps:

[0119] In step S701, a physical model is built according to a preset platformized model architecture for vehicle controller software testing in response to preset test requirements, and the physical model is used to configure an environment required for model-in-loop test. For details, see step S601 of the embodiment shown in Figure 6 which will not be described here again.

[0120] In step S702, a preset calibration data file and a data object file to be calibrated of a preset vehicle controller software model are obtained, and data calibration is performed on the preset vehicle controller software model according to the preset calibration data file and the data object file to be calibrated, to obtain a vehicle controller software model to be tested.

[0121] Specifically, the data calibration on the preset vehicle controller software model according to the preset calibration data file and the data object file to be calibrated in step S702 includes:

[0122] In step S7021, file reading and format conversion are performed on the preset calibration data file and the data object file to be calibrated, wherein the preset calibration data file includes a calibration name, a calibration value and a calibration type, and the data object file to be calibrated includes a data object name, a data object value and a data object type.

[0123] It should be noted that the specific manner of file reading in this embodiment can be determined according to the conventional reading manner in the art; the format conversion in this embodiment is to convert the read file into a variable recognizable by a computer, and the specific conversion manner is not limited herein and can also be implemented by referring to the conventional conversion manner in the art.

[0124] In step S7022, the data object name matching the calibration name is screened, and the to-be-calibrated data object and its current value and current type are determined according to the data object name.

[0125] In this embodiment, the data object name matching the calibration name is screened according to the conventional screening manner in the art, which is not limited herein.

[0126] In step S7023, the calibration value is data-processed based on the calibration value, the calibration type, the current value and the current type, and the data-processed calibration value is assigned to the current value.

[0127] In this embodiment, the calibration value is assigned to the current value of the to-be-calibrated data object in the preset vehicle controller software model after data processing.

[0128] Specifically, the data processing of the calibration value based on the calibration value, the calibration type, the current value and the current type in the above step S7023 includes:

[0129] In step A1, if the calibration type is different from the current type, the calibration value is converted into a value corresponding to the current type.

[0130] In step A2, if the dimension of the calibration value is different from that of the current value, the calibration value is interpolated based on the dimension of the current value.

[0131] In this embodiment, the related content of the interpolation processing is described in the foregoing, which is not repeated herein.

[0132] The embodiment of the present application considers the difference between the calibration type and the current type and the difference between the calibration value and the current value dimension, and corresponding data processing methods are designed to ensure the accuracy of data calibration. In addition, by performing file reading and format conversion operations on the preset calibration data file and the to-be-calibrated data object file, the data object name matching the calibration name is screened, and the to-be-calibrated data object and its current value and current type are determined according to the data object name. The calibration value is processed based on the calibration value, the calibration type, the current value and the current type, and the calibration value after data processing is assigned to the current value to realize data calibration of the preset vehicle controller software model, so that the model-in-loop test result is closer to the hardware-in-loop test and real vehicle test result, the test problem exposure time is advanced, the vehicle controller software model in-loop test efficiency is further improved, and the safe operation of the vehicle is ensured.

[0133] In step S703, a script program of model connection is determined based on the physical model and the to-be-tested vehicle controller software model, and the script program is run to obtain a corresponding interface model, wherein the interface model is used for communication between the physical model and the to-be-tested vehicle controller software model. For details, please refer to Figure 6 The step S603 of the embodiment shown is not repeated here.

[0134] In step S704, test cases are screened from a preset test case library based on a preset test requirement, and the test cases are converted to obtain a test script program.

[0135] In the embodiment, the preset test case library at least contains test cases of hardware-in-loop test, software-in-loop test and model-in-loop test, wherein the format of the test cases is an xml file.

[0136] Specifically, the conversion of the test cases in step S704 to obtain the test script program includes:

[0137] In step S7041, an xml file is read.

[0138] It should be noted that the xml file is a file with “.xml” as the file extension. This file format is often used for data storage and transmission, and is a very popular text format in current application programs. In the embodiment, the specific reading method of the xml file is not limited here, and can be adjusted adaptively based on the actual development platform or programming language. For example, for an xml file written in Python programming language, the ElementTree module in the standard library of Python can be used to read it, which is only an exemplary description.

[0139] In step S7042, the test cases in the xml file are identified.

[0140] In step S7043, the use case is converted based on a preset writing method, and a test script program is obtained correspondingly, wherein the preset writing method is a statement or a function written according to different script languages.

[0141] In this embodiment, the specific type of the script language and the specific content of the preset writing method are not limited here and can be adjusted adaptively according to actual needs.

[0142] In a specific embodiment, the use cases in the use case library are xml files applicable to hardware-in-the-loop testing, software-in-the-loop testing and model-in-the-loop testing, and the test case script is an m script running in Matlab (i.e., a development platform integrating functions such as numerical analysis, matrix operation, data visualization and interactive program design).

[0143] (1) Reading the xml file and identifying the use case.

[0144] In this embodiment, the use case writing method includes Block (modularization), Loop (loop), IfThenElse (condition), Read (read), Write (write), Restore (restore), Package (use case package), Wait (wait), Calculation (calculation) and Comment (comment).

[0145] (2) Converting the use case into an m script language.

[0146] In this embodiment, this step is essentially converting the use case writing method into an m script language. Specifically, the Block method is converted into a loop statement with a loop variable, a loop number and an exit condition; the Loop method is converted into a loop statement with a loop variable, a loop number and an exit condition; the IfThenElse method is converted into a conditional statement retaining the judgment condition; the Read method is converted into a TestRead function; the Write method is converted into a TestWrite function; the Restore method is converted into a TestRestore function; the Package method is converted into a run function of a written use case package script by looking up a corresponding table; the Wait method is converted into a TestWait function; the Calculation method is converted into a TestCal function; and the Comment method is converted into a comment statement.

[0147] The preset test case library containing the hardware-in-the-loop test, the software-in-the-loop test and the model-in-the-loop test is designed, and the format conversion of the test case is performed, so that the automatic test of the vehicle controller software model in the loop test is realized, the model-in-the-loop test and the hardware-in-the-loop test share the test case library, the model-in-the-loop test system operation and data interaction can be automatically controlled, and then the execution of the complex logic step and the processing and determination of the signal data are completed.

[0148] In step S705, the test script program is run, and a test report is output according to a running result.

[0149] In the embodiment, the test script program is run, that is, the m script obtained in the foregoing steps is automatically run. Specifically, the script running includes two parts, the first part is a mapping file of signal names and model paths, and the second part is a self-defined TestRead function, a TestWrite function, a TestRestore function, a TestWait function and a TestCal function; the TestRead function reads the signal value from the model and judges whether the read signal value is consistent with the expected value, the TestWrite function writes the parameter value to the model, the TestRestore function reads the initial value of the parameter and writes it to the model, the TestWait function waits for the real time, and the TestCal function performs numerical calculation.

[0150] In the embodiment, the test report is output according to the running result in step S705, and the test report includes:

[0151] In step B1, the comment and attribute information in the test script program are recognized.

[0152] In the embodiment, the comment and attribute information can be obtained according to the corresponding recognition mode of the script type, for example, the m script can obtain all comment lines in the file through the comment function, and obtain the attribute information through the meta.classInfo function, which is only illustrative.

[0153] In step B2, whether there is a running fault in the running process of the test script program is detected.

[0154] In the embodiment, the specific detection mode of the program running fault is not limited here, and is adaptively adjusted based on the actual program running environment.

[0155] In step B3, when there is a running fault, the statement position, the occurrence time and the program error information of the fault occurrence are recorded, and the program error information includes an error identifier, a stack at the error occurrence position and an error reason.

[0156] It needs to be explained that the stack where the error occurs refers to the function call sequence when the error occurs during program execution. Specifically, when the program encounters an error or exception during execution, the call stack information at the time of the error is automatically recorded, including the type of error, the location of the error, and the function call sequence at the time of the error.

[0157] Step B4, count the statement fault conditions in the test script program, and generate an in-loop test case report of the vehicle controller software model based on the annotations, attribute information, and statement fault conditions.

[0158] Step B5, detect whether there is a modification of the test case during the running of the test script program.

[0159] Step B6, when there is a modification of the test case, store the corresponding modification information to obtain a temporary file.

[0160] Step B7, the test report is composed of the in-loop test case report and / or program error information and / or temporary file.

[0161] In a specific embodiment, the test report includes the test case report, the program error information, and the temporary file; wherein the test case report is an in-loop test case report of the vehicle controller software model, containing annotations and attribute information, passing and failing of each step, model time and failure information of the failing statement; the program error information contains error identification, stack where the error occurs, and error cause; and the temporary file contains storage variable modification information of the test case.

[0162] In the embodiment of the present application, the in-loop test case report, the program error information, or the temporary file is obtained according to the running results during the running of the test script program to obtain the test report and output, which can provide comprehensive test results.

[0163] In summary, the vehicle controller model in-loop test system and method of the embodiment of the present application constructs a platformized model architecture for vehicle controller software testing, realizes integration of calibration data of the vehicle controller software model, and simultaneously realizes construction and automatic testing of the vehicle controller software model in-loop test system, which can conveniently switch different projects and products for automatic testing, and the test results are closer to hardware-in-the-loop and real vehicle testing; and the automatic testing and hardware-in-the-loop testing share the test case library, which can complete complex logic step execution, signal data processing and judgment, and greatly improves the efficiency of the vehicle controller software model in-loop test.

[0164] Although the embodiments of the present application are described in conjunction with the drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.

Claims

1. A vehicle control unit model-in-the-loop test system, characterized by, The system comprises: an architecture module, a calibration module, a script module and an interface module; The architecture module is configured to build a physical model required by a model-in-the-loop test environment, the physical model being built according to a preset platformized model architecture of a vehicle controller software test in response to a preset test requirement; the architecture module comprises a first architecture unit, which is a data layer and comprises parameter files and configuration files, the parameter files including first parameter files and second parameter files, the first parameter files being composed of control parameters and physical calculation parameters irrelevant to a vehicle model, and the second parameter files being model initialization parameters relevant to the vehicle model and adapted to the preset test requirement, the model initialization parameters at least including engine parameters, battery parameters, motor parameters and vehicle parameters; The calibration module is configured to provide a vehicle controller software model to be tested after data calibration; the data calibration comprises obtaining a preset calibration data file and a data object file to be calibrated of a preset vehicle controller software model, and performing data calibration on the preset vehicle controller software model according to the preset calibration data file and the data object file to be calibrated, to obtain the vehicle controller software model to be tested; The script module comprises a script program connecting the physical model and the vehicle controller software model to be tested, and generates a corresponding interface model in the interface module by running the script program, wherein the interface model is used for communication between the architecture module and the calibration module.

2. The vehicle control unit model-in-the-loop test system according to claim 1, wherein The architecture module further comprises a second architecture unit and a third architecture unit; The second architecture unit is a software layer comprising at least one preset function module, wherein model parameters and model functions of each preset function module are determined by corresponding parameter files and configuration files in the first architecture unit; The third architecture unit is an interface layer used for communication of each preset function module in the second architecture unit.

3. The vehicle control unit model-in-the-loop test system according to claim 1, wherein The calibration module comprises a first calibration unit, a second calibration unit and a third calibration unit; The first calibration unit is configured to identify a preset calibration data file, the preset calibration data file including a calibration name, a calibration value and a calibration type; The second calibration unit is configured to identify a data object file to be calibrated of a preset vehicle controller software model, the data object file to be calibrated including a data object name, a data object value and a data object type; The third calibration unit is configured to perform data calibration on the preset vehicle controller software model according to the preset calibration data file and the data object file to be calibrated, to obtain the vehicle controller software model to be tested.

4. The vehicle control unit model-in-the-loop test system according to claim 1, wherein The interface module comprises a first interface unit and a second interface unit; The first interface unit is configured to provide a first interface model supporting CAN communication; The second interface unit is configured to provide a second interface model supporting hardwire communication.

5. The vehicle control unit model-in-the-loop test system according to claim 4, wherein The script module comprises a first script unit and a second script unit; The first script unit is configured to provide a first script program for generating the first interface model, the first script program is composed of operations of reading a first preset table, performing data conversion on the first preset table, and connecting models according to software internal signal names, and the first preset table contains mapping relationships among different CAN signals, software internal signals, and model default values. The second script unit is configured to provide a second script program for generating the second interface model, the second script program is composed of operations of traversing software internal hard-wire signal names and connecting models. 6.A method for model-in-the-loop test of a vehicle control unit, applied to the model-in-the-loop test system of any one of claims 1 to 5, characterized in that, The method comprises: In response to a preset test requirement, a physical model is built according to a preset platformization model architecture of a vehicle controller software test, the physical model is configured to configure an environment required for model-in-loop testing; wherein building the physical model comprises: configuring a parameter file and a configuration file through a data layer, the parameter file comprises a first parameter file and a second parameter file, the first parameter file is composed of control parameters and physical calculation parameters irrelevant to a vehicle model, and the second parameter file is a model initialization parameter related to the vehicle model adapted to the preset test requirement, the model initialization parameter at least comprises an engine parameter, a battery parameter, a motor parameter, and a vehicle parameter; A preset calibration data file and a to-be-calibrated data object file of a preset vehicle controller software model are acquired, and data calibration is performed on the preset vehicle controller software model according to the preset calibration data file and the to-be-calibrated data object file, to obtain a to-be-tested vehicle controller software model; A script program of model connection is determined based on the physical model and the to-be-tested vehicle controller software model, and the script program is run to obtain a corresponding interface model, wherein the interface model is configured to communicate between the physical model and the to-be-tested vehicle controller software model; Test cases are screened from a preset test case library based on the preset test requirement, and the test cases are converted to obtain a test script program; The test script program is run, and a test report is output according to a running result.

7. The vehicle control unit model-in-the-loop test method according to claim 6, characterized by, The data calibration on the preset vehicle controller software model according to the preset calibration data file and the to-be-calibrated data object file comprises: File reading and format conversion are performed on the preset calibration data file and the to-be-calibrated data object file, wherein the preset calibration data file comprises a calibration name, a calibration value, and a calibration type, and the to-be-calibrated data object file comprises a data object name, a data object value, and a data object type; Data object names matching the calibration name are screened, and to-be-calibrated data objects and current values and current types thereof are determined according to the data object names; The calibration value is data-processed based on the calibration value, the calibration type, the current value, and the current type, and the calibration value after data processing is assigned to the current value.

8. The vehicle control unit model-in-the-loop test method according to claim 7, characterized by, The data processing on the calibration value based on the calibration value, the calibration type, the current value, and the current type comprises: If the calibration type is different from the current type, the calibration value is converted into a value corresponding to the current type; If the calibration value has a different dimension from the current value, the calibration value is interpolated based on the dimension of the current value.

9. The method of claim 6, wherein, The preset test case library at least includes test cases of hardware-in-the-loop testing, software-in-the-loop testing and model-in-the-loop testing, wherein the format of the test cases is an xml file, and the conversion of the test cases to obtain a test script program comprises: reading the xml file; identifying the test cases in the xml file; converting the test cases based on a preset writing method to obtain a test script program, wherein the preset writing method is a statement or function written according to different script languages.

10. The method of claim 6, wherein, The test report is output according to the running result, which comprises: identifying the annotations and attribute information in the test script program; detecting whether there is a running fault in the running process of the test script program; when there is a running fault, recording the statement position, occurrence time and program error information of the fault, wherein the program error information includes error identification, error occurrence stack and error cause; counting the statement fault condition in the test script program, and generating the in-the-loop test case report of the vehicle controller software model to be tested based on the annotations, the attribute information and the statement fault condition; detecting whether there is a modification of the test case in the running process of the test script program; when there is a modification of the test case, storing the corresponding modification information to obtain a temporary file; the test report is composed of the in-the-loop test case report and / or the program error information and / or the temporary file.

Citation Information

Patent Citations

  • Method and device for generating environment model of automobile controller test

    CN104536856A

  • Pure electric vehicle control unit model in-loop test device and test method thereof

    CN105446316A