CN-121996542-A - Combined instrument testing method, equipment and medium
Abstract
The application discloses a method, equipment and a medium for testing a combination instrument, which comprise the steps of obtaining a function definition of the combination instrument to be tested, analyzing and classifying the function definition based on a preset function module dividing rule to generate a plurality of test function module sets, generating a corresponding automatic test script according to the display type and the association relation of display signals in the test function module sets for each test function module set, sequentially loading and running the automatic test script corresponding to a selected target function module to send a corresponding display signal to the combination instrument to be tested according to the sequence and the value taking and timing logic defined in the automatic test script, observing and recording the actual display state of the combination instrument to be tested after the corresponding automatic test script is executed, and comparing the actual display state with the predefined expected display state in a test case to generate a test judgment result for the target function module.
Inventors
- YAN MING
- CHANG JIUPENG
- Tang Yanzhao
- YUAN XIAOLING
Assignees
- 潍柴新能源商用车有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251226
Claims (10)
- 1. A method for testing a combination meter, the method comprising: acquiring a function definition of a to-be-tested combination instrument, and analyzing and classifying the function definition based on a preset function module dividing rule to generate a plurality of test function module sets, wherein the function definition comprises a plurality of types of display signals and association relations; Generating a corresponding automatic test script according to the display type and the association relation of the display signals in each test function module set; Loading and running an automatic test script corresponding to the selected target functional module in sequence to send a corresponding display signal to the to-be-tested combination instrument according to the sequence defined in the automatic test script, the value and the time sequence logic; And observing and recording the actual display state of the to-be-tested combined instrument after the corresponding automatic test script is executed, and comparing and analyzing the actual display state with the predefined expected display state in the test case to generate a test judgment result aiming at the target functional module.
- 2. The method for testing a combination meter according to claim 1, wherein the analyzing and classifying the functional definition based on a preset functional module dividing rule to generate a plurality of test functional module sets specifically includes: Extracting control system identifiers of all signal sources from the function definition, and classifying display signals to corresponding control systems based on the control system identifiers, wherein the control systems comprise a chassis control system, a power control system and a vehicle body control system; Extracting display type identifiers of all display signals from the function definition, and classifying the display signals into corresponding display types based on the display type identifiers, wherein the display types comprise a visual indication type, a numerical value display type, an audible alarm type, a text prompt type and a code error report type; Based on predefined module division logic, collecting display signals which are derived from the same control system identifier and belong to the same display type identifier to generate a first type of test function module set; Under the condition that the display signals identified by a plurality of different control systems cooperatively control the same display content in the function definition, corresponding signal combinations are collected to generate a second class test function module set; And integrating the first type test function module set and the second type test function module set to form a plurality of final test function module sets which are independent of each other.
- 3. The method for testing a combination meter according to claim 1, wherein for each test function module set, generating a corresponding automated test script according to a display type and an association relationship of a display signal in the test function module set, specifically comprises: Analyzing the test function module set to obtain the signal identification, the allowable value range and the triggering condition of each display signal; According to the triggering condition and the display logic of the combination instrument to be tested, a test sequence logic chain of display signals is constructed, and a test case is configured for each test node in the test sequence logic chain, wherein signal state change paths required for triggering different display states are defined in the test sequence logic chain, and the test case comprises test values and duration time applied to corresponding display signals; And based on the test sequence logic chain and the nested test cases, performing code conversion according to a preset script grammar rule to generate an automatic test script which can be directly loaded and operated.
- 4. The method for testing a combination meter according to claim 1, wherein the automatic test scripts corresponding to the selected target function modules are loaded and run sequentially, so as to send corresponding display signals to the combination meter to be tested according to the sequence, the value and the time sequence logic defined in the automatic test scripts, specifically comprising: Initializing a communication interface through a test host, and loading a target automation test script corresponding to a target functional module to a script interpreter in a test host memory; the script interpreter analyzes the target automation test script line by line, and converts a control instruction in the target automation test script into a bottom communication message, wherein the bottom communication message comprises a specific identifier, a data value and a sending time stamp; the test host sends the bottom communication message to a vehicle communication network corresponding to the to-be-tested combination instrument in real time through the communication interface according to the time sequence of the sending time stamp; monitoring the execution progress of the target automation test script, and triggering a script switching event after receiving an execution ending instruction or reaching a preset execution duration; And responding to the script switching event, loading and executing the next automation test script of the target automation test script by the test host until all automation test scripts are executed.
- 5. The method for testing a combination meter according to claim 1, wherein observing and recording an actual display state of the combination meter to be tested after executing the corresponding automated test script specifically comprises: Acquiring real-time display change information of the to-be-tested combination instrument based on a display screen, an indicator light area and a buzzer of the to-be-tested combination instrument, and determining state information of a key check point aiming at the predefined key check point in a test case, wherein the key check point comprises a lighting-up state of a specific indicator light, accuracy of numerical value display, appearance and content of text information and a sound mode of the buzzer; and converting the display change information and the state information of the key check points into records in text form or code form to generate actual display states, wherein the actual display states have field structures which are comparable with the predefined expected display states in the test cases.
- 6. The method for testing a combination meter according to claim 5, wherein comparing the actual display state with a predefined expected display state in a test case and analyzing the actual display state to generate a test decision result for a target functional module, specifically comprises: establishing a mapping relation of fields between the actual display state and the expected display state; Comparing each observation in the actual display state with a corresponding expected result in the expected display state field by field to check whether the actual display state and the expected display state are completely matched in state, value or content; Generating a binary judgment result according to the matching result for each comparison field, marking as passing if matching, marking as failure if not matching, and recording the difference condition between the actual value and the expected value; synthesizing binary judgment results of all the comparison fields, applying a predefined passing rule, and generating a judgment conclusion that the whole test passes if all the key fields are marked as passing; if any key field is marked as failure, generating a judging conclusion of the failure of the whole test, and adding the difference condition of all the failed fields in the judging conclusion, and summarizing to generate a test judging result.
- 7. The method for testing a combination meter according to claim 3, wherein the step of constructing a test sequence logic chain of display signals according to the trigger condition and the display logic of the combination meter to be tested specifically comprises: analyzing the triggering conditions, and extracting the dependency relationship and the mutual exclusion relationship between each display signal to construct initial signal relationship map data; Traversing the display logic of the to-be-tested combination instrument, determining each target display state to be tested, mapping each target display state to a specific signal condition to be met, and generating display state and signal condition mapping table data; Taking the initial signal relation graph data as constraint, taking each group of specific signal conditions in the display state and signal condition mapping table data as test target nodes, and planning an optimal path sequence traversing all the test target nodes from the initial state; And converting each state switching step in the optimal path sequence into a standardized instruction unit consisting of a signal identifier, a target value and a switching condition, and combining the standardized instruction units according to the sequence to form a test sequence logic chain.
- 8. The method for testing a combination meter according to claim 4, wherein monitoring the execution progress of the target automation test script, and triggering a script switching event after receiving an execution end instruction or reaching a preset execution duration, specifically comprises: Setting an execution pointer in the script interpreter, tracking the position of a code line of the current analysis execution in real time, and generating an execution progress; Continuously monitoring the execution progress, and comparing the execution progress with preset key nodes of the target automation test script; When the execution progress indicates that the execution is analyzed and executed to a preset end marker in the target automation test script, generating an end event as a trigger signal of a script switching event; Starting a timer to record the executed time of the target automation test script, and generating a timeout event as a trigger signal of the script switching event when the executed time exceeds a maximum allowable execution duration threshold preset for the script; and responding to the received ending event or the overtime event, suspending the current script execution flow, cleaning the execution context environment of the current script, and setting a script switching event mark at the corresponding position of the target automation test script.
- 9. A cluster meter test apparatus, the apparatus comprising: at least one processor; and a memory communicatively coupled to the at least one processor; Wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a cluster test method according to any one of claims 1-8.
- 10. A non-transitory computer storage medium storing computer executable instructions which, when executed, implement a cluster test method according to any one of claims 1-8.
Description
Combined instrument testing method, equipment and medium Technical Field The application relates to the technical field of vehicle testing, in particular to a method, equipment and medium for testing a combination instrument. Background In the technical field of automobile electronics, a combination instrument is used as a core component for vehicle information interaction, and the functional accuracy and reliability of the combination instrument are important. Along with the diversification of commercial vehicle platforms and the iterative acceleration of functions, the types and the quantity of signals required to be supported by the combination instrument are increased sharply, and the comprehensive and efficient test of the combination instrument becomes a key link in the product development process. Currently, two main technical routes exist for testing the functions of the combination instrument in the industry. One relies on a tester to manually operate a specialized software tool to configure and send hundreds of bus signals one by one to simulate the vehicle condition, followed by manual observation of the meter display for judgment. Although the method can flexibly adjust the signal sequence according to different test requirements, the manual operation is very easy to miss test items, the time consumption is long, the accuracy and the consistency of test results depend on the concentration degree and experience of testers to a great extent, and the method is difficult to adapt to the large-scale and high-frequency test verification requirements. Another technical route aims at improving the degree of automation by introducing special automated test equipment and writing fixed test scripts. The method can automatically execute the test cases and generate reports, thereby obviously shortening the test time and improving the normalization of the flow. However, it has the disadvantage that the system is rigid and the test script is coupled deep with the specific hardware equipment and instrumentation software version. When the combined instrument with different platforms and different function definitions is faced, the test script and the equipment configuration need to be redeveloped or greatly adjusted according to each variation, the early investment is large, the debugging period is long, the market demands of product diversification and function rapid iteration cannot be responded rapidly, and the flexibility is insufficient. Disclosure of Invention The embodiment of the application provides a method, equipment and medium for testing a combination instrument, which are used for solving the technical problems. In one aspect, an embodiment of the present application provides a method for testing a combination meter, including: acquiring a function definition of a to-be-tested combination instrument, and analyzing and classifying the function definition based on a preset function module dividing rule to generate a plurality of test function module sets, wherein the function definition comprises a plurality of types of display signals and association relations; Generating a corresponding automatic test script according to the display type and the association relation of the display signals in each test function module set; Loading and running an automatic test script corresponding to the selected target functional module in sequence to send a corresponding display signal to the to-be-tested combination instrument according to the sequence defined in the automatic test script, the value and the time sequence logic; And observing and recording the actual display state of the to-be-tested combined instrument after the corresponding automatic test script is executed, and comparing and analyzing the actual display state with the predefined expected display state in the test case to generate a test judgment result aiming at the target functional module. In one implementation manner of the present application, based on a preset function module dividing rule, the function definition is parsed and categorized to generate a plurality of test function module sets, which specifically includes: Extracting control system identifiers of all signal sources from the function definition, and classifying display signals to corresponding control systems based on the control system identifiers, wherein the control systems comprise a chassis control system, a power control system and a vehicle body control system; Extracting display type identifiers of all display signals from the function definition, and classifying the display signals into corresponding display types based on the display type identifiers, wherein the display types comprise a visual indication type, a numerical value display type, an audible alarm type, a text prompt type and a code error report type; Based on predefined module division logic, collecting display signals which are derived from the same control system identifier and belong to the same dis