An interface automated hardware-in-the-loop test method for a power domain control system
By generating automated test case packages and utilizing hardware-in-the-loop systems for automated testing, the testing challenges of a large number and highly variable number of interfaces in centralized power domain control systems have been solved, achieving efficient and accurate interface verification.
Patent Information
- Application Number
- CN202211137508.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2042-09-19
AI Technical Summary
Existing technologies are insufficient to effectively address the challenges of a large number of interfaces in centralized power domain control systems, which can vary significantly. This results in difficulties in interface verification, low testing efficiency, and insufficient accuracy.
By collecting interface variable information, an automated test case design table is generated and transformed into an automated test case package. An automated test project is built, and automated testing is carried out using a hardware-in-the-loop system. By setting pass criteria and change values, automated testing of the interface is achieved.
It reduces the need for testing manpower, shortens testing time, improves testing efficiency and accuracy, and is adaptable and repeatable, meeting the automated testing needs of interface changes.
Smart Images

Figure CN115495347B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application is used in the field of automobile software testing, and more particularly relates to an interface hardware-in-the-loop test including software of an automobile control system. BACKGROUND
[0002] Current automobiles are developing towards electrification, intelligence, networking and sharing, which brings about a multiple increase in software scale, transmission data volume and electronic and electrical quantity. The traditional distributed power control system has limitations in coping with the new development needs, so that the centralized power control system based on domain controllers has become a development trend. The centralized power control system integrates multiple power controllers and combines them into a power domain control system, thereby reducing the number of controllers, lowering the research and development cost and production cost, and reducing the weight of the whole vehicle, which is conducive to efficiency and benefit improvement. However, the power domain control system involves CAN communication of multiple controllers and hard-wire communication with sensors and actuators, and the number of interactive signals increases, which accordingly increases the difficulty of verifying the interface of the power domain control system.
[0003] Hardware-in-the-loop is a test method that embeds part of the object being tested into a software and hardware environment through an interface, realizes the connection of the controller and the controlled object simulated by real-time simulation hardware, can realize low-cost and efficient testing of various functions of the controller, and is widely used in the process of automobile software development.
[0004] Patent document CN114201346A discloses a HIL test method for a CAN communication interface. First, CAN test case design data required for constructing a test case is obtained, and a test case group corresponding to each CAN communication interface signal is generated to obtain a test case table. Then, test signal data is determined based on the simulation system category, and an automatic test case template is constructed according to the test signal data. Finally, the test case table is imported into the automatic test case template, each test case group is executed in a loop, and test result data is obtained. This method has the following two problems: first, this method only provides an automatic hardware-in-the-loop method for CAN communication signals, and the centralized power domain control system, which has become a trend, integrates more hard-wire interfaces and contains more complex conversion relationships; second, the activity ends after the test result is obtained, and no subsequent regression test is considered. For the centralized power domain control system with a large number of interfaces and possible potential changes, the automatic hardware-in-the-loop test method for the interface should consider the possible frequent regression test. SUMMARY
[0005] To solve the above problems, the application provides an interface automatic hardware-in-the-loop test method of a power domain control system, which is suitable for centralized power domain control systems with a large number of interfaces and potential changes, reduces the test manpower demand of interface testing, reduces the test time of interface testing, and improves the efficiency and accuracy of interface hardware-in-the-loop testing.
[0006] The technical solutions of the application are as follows:
[0007] An interface automatic hardware-in-the-loop test method of a power domain control system, the method comprising the following steps:
[0008] Step 1: According to the software interface data of the power domain control system, collect interface variable information and summarize it in an automatic test case design table.
[0009] Step 2: Convert the automatic test case design table into an automatic test case package through programming.
[0010] Step 3: Build an automatic test project and import the automatic test case package.
[0011] The automatic test project includes a hardware-in-the-loop system, a hardware-in-the-loop test project, and an automatic test tool; the automatic test project needs to adapt to the tools used in the hardware-in-the-loop system; the automatic test project needs to be configured according to the requirements of the power domain control system to meet the tools required for hardware-in-the-loop testing of the power domain control system; and the automatic test tool needs to normally call the tools used in the hardware-in-the-loop system.
[0012] Step 4: Execute the automatic test case and analyze the test results.
[0013] Step 5: Publish the test results, if the test results pass, the activity ends; if the test results do not pass, feedback to the front-end department of the hardware-in-the-loop for modification, and repeat steps 1 to 5.
[0014] Further, the interface variable information includes interface variable names, interface change enable variable names, interface change variable value names, and interface change values; the interface change values include interface variable maximum values, interface variable minimum values, and interface variable intermediate values.
[0015] Further, the programming logic of step 2 comprises:
[0016] Step 2.1 Add the path of the automatic test tool;
[0017] Step 2.2 Open the automatic test case design table;
[0018] Step 2.3 reads interface variable information; the interface variable information includes interface variable name, interface change enabling variable name, interface change variable value name and interface change value;
[0019] Step 2.4 opens the interface change enabling;
[0020] Step 2.5 sets the interface change variable value to the change value, sets the waiting time, and determines whether the interface variable meets the passing standard according to the test result.
[0021] Further, the step 4 of analyzing the test result includes: judging whether the interface test result passes according to the interface passing standard required by the power domain control system; if the test result passes, entering step 5; if the test result does not pass, analyzing the failure reason; if the test does not pass due to the automatic test engineering design problem, improving the automatic test engineering and repeating steps 3 to 4; if the test does not pass due to the test case design problem, perfecting the automatic test case and repeating steps 2 to 4;
[0022] By adopting the above technical solution, the present application has the following advantages:
[0023] The test method disclosed by the present application can cope with the current phenomenon of interface multiplication of the automobile control system, reduce the test manpower demand of the interface test, reduce the test time of the interface test, and at the same time, set the passing standard in advance to reduce the error rate of the traditional manual analysis of the test result, so as to improve the efficiency and accuracy of the interface hardware-in-the-loop test.
[0024] The test method disclosed by the present application has repeatability, when the interface of the power domain control system changes, only the interface information disclosed by the present application needs to be adaptively modified, so that the automatic hardware-in-the-loop test of the changed interface can be performed.
[0025] The test method disclosed by the present application has adaptability, when the passing standard or the change value range of the interface of the power domain control system changes, only the programming script of the automatic test case needs to be adaptively modified (for example, for the "passing standard", the programming code is modified in step 2.5, such as the absolute error is not more than 5% and the like similar judgment condition statement; for the "change value range", the range value is filled in the specified column in the use case design table in step 1), so that the automatic hardware-in-the-loop test of the interface with the changed passing standard or change range can be performed.
[0026] The interface automatic hardware-in-the-loop test method of the power domain control system disclosed by the present application realizes the generation of the automatic test case package through the programming script, and avoids the repeated development of the automatic test case in the automatic test tool. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1A flowchart of an interface automatic hardware-in-the-loop test method of a power domain control system provided by the application;
[0028] Figure 2 A programming logic diagram for generating an automatic test case in the interface automatic hardware-in-the-loop test method of the power domain control system provided by the application. DETAILED DESCRIPTION
[0029] The technical solutions in the application will be described in detail below with reference to the accompanying drawings of the application.
[0030] Referring to Figure 1 , Figure 1 A flowchart of an interface automatic hardware-in-the-loop test method of a power domain control system provided by the application, the method comprises:
[0031] S010, collecting interface variable information according to software interface data of the power domain control system, and summarizing the collected interface variable information in an automatic test case design table.
[0032] The interface variable information comprises an interface variable name, an interface change enabling variable name, an interface change variable value name and an interface change value. The interface change value comprises an interface variable maximum value, an interface variable minimum value and an interface variable intermediate value. The interface change value meets the precision requirement and boundary requirement of the corresponding variable in the power domain control system software, and the interface variable intermediate value is adaptively selected on the basis of meeting the precision requirement of the corresponding variable in the power domain control system software, and is not a mathematical intermediate value.
[0033] The automatic test case design table adopts a unified automatic test case design template, and the interface variable name, the interface change enabling variable name, the interface change variable value name and the interface change value contained in the template adopt a unified table header name.
[0034] S020, realizing the conversion of the automatic test case design table to an automatic test case package by using a programming means. The programming means can use any programming language as long as it can connect the automatic test tool. The interface signals all go through the programming step.
[0035] Referring to Figure 2 , Figure 2 A programming logic diagram for generating an automatic test case in the interface automatic hardware-in-the-loop test method of the power domain control system provided by the application, the programming means logic comprises the following steps:
[0036] S021, adding an automatic test tool path.
[0037] S022, opening an automatic test case design table.
[0038] S023, read interface variable information; the interface variable information includes interface variable name, interface change enable variable name, interface change variable value name and interface change value.
[0039] S024, open interface change enable.
[0040] S025, set the interface change variable value to the maximum value, set the waiting time, and judge whether the interface variable meets the passing standard with the set maximum value; set the interface change variable value to the minimum value, set the waiting time, and judge whether the interface variable meets the passing standard with the set minimum value; set the interface change variable value to the intermediate value, set the waiting time, and judge whether the interface variable meets the passing standard with the set intermediate value. The change value can be set to multiple change values according to the test needs, not only including the maximum value, the minimum value and the intermediate value.
[0041] S030, build an automatic test project, which includes a hardware-in-the-loop system, a hardware-in-the-loop test project and an automatic test tool.
[0042] The hardware-in-the-loop system includes a hardware simulation platform, a physical model, an upper computer containing test management software and a controller hardware to be tested, to simulate the vehicle operating state for software function verification of the power domain control system.
[0043] The hardware-in-the-loop test project refers to an engineering file created in the test management software in the upper computer of the hardware-in-the-loop system, used to connect the physical model and the hardware simulation platform to control the hardware-in-the-loop system. The automatic test tool refers to a software tool that can call the hardware-in-the-loop test project to make the hardware-in-the-loop system automatically run according to the set steps, to realize hardware-in-the-loop automatic testing.
[0044] The automatic test project needs to adapt to the use tools in the hardware-in-the-loop system, so that the automatic test tool can automatically open the use tools in the hardware-in-the-loop system when working. The automatic test project needs to be configured according to the requirements of the power domain control system, to meet the use tools required by the hardware-in-the-loop test of the power domain control system. The automatic test project needs to import the automatic test case package in S020.
[0045] The automatic test project depends on the automatic test tool, and the configuration methods of the automatic test projects of different automatic test tools are different.
[0046] S040, executing the automation test case, which refers to the automation test case package completed in S030. Then, the test result is analyzed, and whether the interface test result passes is judged according to the interface passing standard required by the power domain control system; if the test result passes, S050 is entered; if the test result does not pass, the failure reason is analyzed; if the test does not pass due to the automation test engineering design problem, the automation test engineering is improved, and S030 to S040 is repeated; if the test does not pass due to the test case design problem, the automation test case is improved, and S020 to S040 is repeated.
[0047] The interface passing standard is a quantifiable standard, which is determined according to the overall design error of the power domain control system and the hardware-in-the-loop system error.
[0048] The automation test engineering design problem includes a hardware-in-the-loop model problem, a hardware-in-the-loop engineering configuration problem, and a hardware-in-the-loop system problem.
[0049] The test case design problem includes a programming problem, a passing standard design problem, and an automation test tool and automation test case implementation matching problem.
[0050] S050, publishing the test result, which can be pass or fail; if the test result passes, the activity ends; if the test result fails, it is fed back to the front-end department of the hardware-in-the-loop for modification, and S010 to S050 is repeated.
[0051] The front-end modification refers to feeding back the test result to the front-end department of the hardware-in-the-loop test. The front-end department finds the reason for the test result failure through problem analysis and completes the modification, and then performs the interface automation hardware-in-the-loop test of the power domain control system again.
[0052] When the final test result is pass, the interface automation hardware-in-the-loop test activity of the power domain control system ends.
[0053] In the test method, the automation test tool and the programming tool used can be replaced. Those skilled in the art should understand that there are multiple replaceable schemes for the hardware-in-the-loop automation test tool and the programming tool described in the present application, and the scope of the present application cannot be limited by this. That is, as long as the test method described in the present application is used but different automation test tools and programming tools are used, it is still within the scope covered by the present application.
[0054] In addition, for the flow of the test method and the programming logic of generating the automation test case described in the present application, in order to simply describe, it is expressed as a series of action combinations. Those skilled in the art should understand that the related actions can be recombined and merged, and part of the actions is not limited by the order and the execution times.
Claims
1. An interface automated hardware-in-the-loop test method for a power domain control system, characterized in that, Comprise: Step 1, according to the software interface data of the power domain control system, collect interface variable information, and summarize in the automatic test case design table; Step 2, through programming, the automatic test case design table is converted into an automatic test case package, and the programming logic comprises: Step 2.1 add the path of the automatic test tool; Step 2.2 open the automatic test case design table; Step 2.3 read the interface variable information; the interface variable information includes interface variable name, interface change enable variable name, interface change variable value name and interface change value; Step 2.4 open the interface change enable; Step 2.5 set the interface change variable value to the change value, set the waiting time, and determine whether the interface variable and the set change value meet the pass standard according to the test result; Step 3, build an automatic test project and import the automatic test case package; The automatic test project includes a hardware-in-the-loop system, a hardware-in-the-loop test project and an automatic test tool; the automatic test project needs to adapt to the tools used in the hardware-in-the-loop system; the automatic test project needs to be configured according to the requirements of the power domain control system to meet the tools required by the hardware-in-the-loop test of the power domain control system; the automatic test tool needs to normally call the tools used in the hardware-in-the-loop system; Step 4, execute the automatic test case and analyze the test result; Step 5, release the test result, if the test result is passed, end; if the test result is not passed, feedback to the front-end department of the hardware-in-the-loop for modification, repeat steps 1 to 4; When the interface of the power domain control system changes, the interface information is adaptively modified, so that the automatic hardware-in-the-loop test of the changed interface can be performed.
2. The interface automated hardware-in-the-loop test method of a power domain control system according to claim 1, wherein, The interface change value includes the maximum value of the interface variable, the minimum value of the interface variable and the intermediate value of the interface variable.
3. The interface automated hardware-in-the-loop test method of a power domain control system according to claim 2, wherein, The automatic test case design table uses a unified automatic test case design template, and the interface variable name, interface change enable variable name, interface change variable value name and interface change value included in the template use a unified table header name.
4. The interface automation hardware-in-the-loop test method of a power domain control system according to claim 1, characterized in that, The step 4 analyzes the test result, which comprises: judging whether the interface test result passes according to the interface pass standard required by the power domain control system; if the test result passes, go to step 5; if the test result does not pass, analyze the failure reason; if the test does not pass due to the automatic test project design problem, improve the automatic test project and repeat steps 3 to 4; if the test does not pass due to the test case design problem, perfect the automatic test case and repeat steps 2 to 4.
5. The interface automated hardware-in-the-loop test method of a power domain control system according to claim 4, wherein, The automatic test project design problem includes hardware-in-the-loop model problem, hardware-in-the-loop engineering configuration problem and hardware-in-the-loop system problem.
6. The interface automation hardware-in-the-loop test method of a power domain control system according to claim 4, wherein, The test case design problem includes programming problem, pass standard design problem, and automatic test tool and automatic test case implementation matching problem.
Citation Information
Patent Citations
HIL test method and device for CAN communication interface, and electronic equipment
CN114201346A
Vehicle controller diagnosis automation hardware-in-the-loop test method and system
CN114967650A