MIL environment test method for vehicle control unit
By building an integrated model and defining test sequences using Simulink, the MIL environment testing of the vehicle controller was automated, solving the problem of high workload caused by multi-module testing and improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202511933312.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-02-06
AI Technical Summary
The existing vehicle controller's test results are invalid in the MIL environment due to the mutual references between multiple functional modules, requiring frequent retesting, resulting in a large workload and affecting the development cycle.
An integrated model of VCU and MIL environment is built using Simulink. Test sequences are defined according to the division of labor of functional modules, test links are compiled through automated processes, and test reports are generated.
It reduces the workload of secondary matching in the MIL environment, improves testing efficiency, reduces manpower input, and reduces the risk of missed tests.
Smart Images

Figure CN121477853A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of vehicle controller testing, and more specifically, to a MIL environment testing method for vehicle controllers. Background Technology
[0002] With the development of new energy vehicles, the Vehicle Control Unit (VCU) is playing an increasingly important role in the overall vehicle R&D process, bearing the primary responsibility for realizing the vehicle's functional requirements. However, the diversification of requirements, dynamic demands, and increasingly stringent time constraints have placed a significant workload on VCU developers. Currently, VCU development primarily utilizes Simulink tools for graphical modeling, converting the model to C code format, and then compiling it with the underlying hardware to generate the S19 file for use in the actual vehicle. Throughout the development process, multiple designers collaborate, undergoing unit testing, Model-in-the-Loop (MIL) testing, HIL testing, and real-vehicle testing. Because different functional modules have inter-reference relationships between signals, any change to a signal in the VCU necessitates re-running all tests, consuming a significant amount of time in the development cycle. In the MIL testing phase, modifications to logic blocks or signal sources within the VCU model itself, or changes to virtual hardware parameters within the MIL environment, will invalidate the MIL test results, requiring retesting. Therefore, reducing the workload of secondary matching in the MIL environment caused by VCU model changes is of paramount importance. Summary of the Invention
[0003] This invention provides a MIL environment testing method for vehicle controllers, which solves the problem that existing vehicle controllers require testing multiple functional modules in the MIL environment, resulting in a large workload. This method reduces the workload of secondary matching in the MIL environment and improves the efficiency of MIL environment testing.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] A MIL environment testing method for a vehicle controller includes:
[0006] An integrated model of the VCU and MIL environment is built using Simulink, and all VCU signals are directly connected to the MIL environment for correlation.
[0007] According to the division of labor of VCU functional modules, the test case modules are matched one by one, and each module defines a test sequence, which is then sorted according to the test sequence.
[0008] Automated process development is implemented for test cases of each functional module, and automated test case numbering is defined for each test case to form a test chain;
[0009] The automated testing process tracks the test chain and provides feedback on results based on module number, test case number, and abnormal test case number, and generates a test report output.
[0010] Preferred options also include:
[0011] The expected effect of the input signal is programmed. In each test case, the input module is defined according to the required input signal, and the desired result is used as the condition for jumping to the next step.
[0012] Preferred options also include:
[0013] Each step is named, and the final test result is used to conclude either that the test was successful or that the test failed.
[0014] Preferred options also include:
[0015] Test failures will be reported synchronously, with specific steps indicating the failures, to facilitate subsequent troubleshooting.
[0016] Preferred options also include:
[0017] The test results for each functional module are named with independent signals, which makes it easy to set any functional module in the test path to achieve independent testing or joint testing.
[0018] Preferred options also include:
[0019] After the final test is completed, a test result for each functional module under a specific step sequence can be output to verify the effectiveness of the test cases and the rationality of the current VCU software.
[0020] Preferably, the step of defining automated test case sequence numbers for each test case to form a test chain includes:
[0021] For each functional module, an Excel summary table of test cases is compiled. Automated test cases are defined, and each test condition is converted into a test case according to the test conditions of each module in the Excel summary table. All test cases are then linked together to complete the entire test chain.
[0022] Preferably, using the desired result as the condition for the next step includes:
[0023] In an automated testing pipeline, the execution result of the previous test script is used as a condition to jump to the next test script.
[0024] This invention provides a MIL environment testing method for vehicle controllers. It constructs an integrated model of the Vehicle Control Unit (VCU) and the MIL environment using Simulink, sorts the VCU functional modules according to their test sequence, and automatically compiles test cases for each functional module to form a test chain. The method then automatically tests this test chain to generate a test report. This addresses the problem of excessive workload caused by testing multiple functional modules in existing vehicle controller MIL environment testing methods, reducing the amount of secondary matching work required for the MIL environment and improving the efficiency of MIL environment testing. Attached Figure Description
[0025] To more clearly illustrate the specific embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below.
[0026] Figure 1 This is a schematic diagram of a MIL environment testing method for a vehicle controller provided by the present invention.
[0027] Figure 2 This is a flowchart of an automated MIL test provided by an embodiment of the present invention.
[0028] Figure 3 This is a schematic diagram of the timing sequence of the VCU functional module test provided in an embodiment of the present invention.
[0029] Figure 4 This is a schematic diagram of the test link provided in an embodiment of the present invention. Detailed Implementation
[0030] To enable those skilled in the art to better understand the embodiments of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and implementation methods.
[0031] To address the issue that current MIL environment testing for vehicle controllers involves testing multiple functional modules, which can lead to a large workload, this invention provides a MIL environment testing method for vehicle controllers. This method solves the problem of excessive workload caused by testing multiple functional modules in existing MIL environment testing for vehicle controllers, reduces the workload of secondary matching in the MIL environment, and improves the efficiency of MIL environment testing.
[0032] like Figure 1 and Figure 2 As shown, a MIL environment testing method for a vehicle controller includes:
[0033] S1: Construct an integrated model of VCU and MIL environment using Simulink, with all VCU signals directly connected to the MIL environment for correlation.
[0034] S2: According to the division of labor of VCU functional modules, the test case modules are matched one by one, and each module defines a test sequence, which is then sorted according to the test sequence.
[0035] S3: Automated process development of test cases for each functional module, and definition of automated test case sequence number for each test case to form a test chain.
[0036] S4: Automates the test chain and provides feedback on results based on module number, test case number, and abnormal test case number, and generates a test report output.
[0037] Specifically, according to the division of labor among the VCU functional modules, the test case modules are mapped one-to-one. Each module defines a test sequence named TestFun, starting from TestFun=1 and proceeding sequentially. After all functional modules are completed, a TestFun sequence number can be assigned, for example, TestFun=20. Figure 3 As shown, for each functional module, automated test cases are defined according to an Excel summary table of test cases, forming a test chain. Then, automated testing is performed according to this test chain to generate a test report. This method does not require third-party testing software and achieves automated testing in the MIL environment directly within Simulink at a low cost. Based on the reduced manpower investment in testing, it can, to the extent possible, perform complete verification of test cases for changes to the VCU software, reducing the risk of missed tests due to personnel skill limitations. In the MIL testing environment, it can detect and investigate signal connections from unexpected signals output from the environment to the VCU main model through a full-link observation process. This method reduces the secondary matching workload in the MIL environment and improves the efficiency of MIL environment testing.
[0038] The method also includes: compiling the expected effect of the input signal, defining the input module according to the required input signal in each test case, and using the desired result as the next step condition for jumping.
[0039] The method also includes naming each step and finally forming two conclusions from the test results: test success or test failure.
[0040] The method also includes: synchronously reporting test failures and annotating the specific steps that failed, so as to facilitate subsequent troubleshooting.
[0041] The method also includes naming the test results of each functional module with an independent signal, which makes it easy to set any functional module in the test path to achieve independent testing or joint testing.
[0042] The method also includes: after the final test is completed, a test result under a specific step sequence can be output for each functional module to verify the effectiveness of the test cases and the rationality of the current VCU software.
[0043] Furthermore, the step of defining automated test case sequence numbers for each test case to form a test chain includes:
[0044] For each functional module, an Excel summary table of test cases is compiled. Automated test cases are defined, and each test condition is converted into a test case according to the test conditions of each module in the Excel summary table. All test cases are then linked together to complete the entire test chain.
[0045] In one embodiment, taking the power-on / off logic module as an example, according to the test case Excel sheet, this module has 46 test conditions. Each test condition is converted into a test case, and these test cases are linked together to complete the entire test chain. Figure 4 As shown.
[0046] Furthermore, the requirement to use the desired outcome as the condition for the next step includes:
[0047] In an automated testing pipeline, the execution result of the previous test script is used as a condition to jump to the next test script.
[0048] As can be seen, this invention provides a MIL environment testing method for vehicle controllers. It constructs an integrated model of the VCU and the MIL environment using Simulink, sorts the VCU functional modules according to their test sequence, automatically compiles test cases for each functional module to form a test chain, and automatically tests the test chain to generate a test report. This solves the problem of excessive workload caused by testing multiple functional modules in existing vehicle controller MIL environment testing methods, reduces the secondary matching workload of the MIL environment, and improves the efficiency of MIL environment testing.
[0049] The structure, features, and effects of the present invention have been described in detail above with reference to the embodiments shown in the figures. The above description is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to have equivalent changes, shall be within the protection scope of the present invention as long as they do not exceed the spirit covered by the specification and figures.
Claims
1. A MIL environment test method for a vehicle control unit, characterized by, The application relates to a VCU (Vehicle Control Unit) test method and device. An integrated model of a VCU and a MIL environment is constructed through simulink, and all signals of the VCU are directly connected to the MIL environment for correlation; According to the division of VCU function modules, test case modules are one-to-one corresponding, each module defines a test timing, and each module is sorted according to the test timing; The test case of each function module is automatically programmed, and the test case number of each test case is defined to form a test link; The test link is automatically tested, the module number, the case number and the abnormal case number are fed back, and a test report is output.
2. The MIL environment test method for a vehicle control unit according to claim 1, characterized by, The application further comprises: The expected effect of an input signal is programmed, and in each test case, an input module is defined according to the required input signal, and the required result is taken as the next step condition of the jump.
3. The MIL environment test method for a vehicle control unit according to claim 2, characterized by, The application further comprises: Each sub-step is named, and the final test result forms two conclusions of test success or test failure.
4. The MIL environment test method for a vehicle control unit according to claim 3, characterized by, The application further comprises: Test failure is synchronously fed back, and the specific running failure step is marked to facilitate subsequent problem troubleshooting.
5. The MIL environment test method for a vehicle control unit according to claim 4, wherein The application further comprises: The test result of each function module is named with an independent signal, so that any function module in the test path can be independently tested or jointly tested.
6. The MIL environment test method for a vehicle control unit according to claim 5, wherein The application further comprises: After the final test is completed, the test result of each function module under a specific step sequence can be output, which is used to prove the effectiveness of the test case and the rationality of the current VCU software.
7. The MIL environment test method for a vehicle control unit according to claim 6, wherein The application further comprises: According to the test case excel summary table of each function module, the automatic test case definition is performed, each test condition is converted into a test case, and the test link is completed by connecting the test cases.
8. The MIL environment test method for a vehicle control unit according to claim 7, wherein The application further comprises: In the automatic test link, the execution result of the previous test script is taken as the input condition of the next test script.