Test method and device of automobile controller, electronic equipment and storage medium

By converting the original MAP file into a standard MAP file and generating test cases and scripts compatible with the HIL test system, it solves the problem in the existing technology that the creation and configuration of test scripts requires a lot of manual participation, realizes automated testing, reduces costs and improves efficiency.

CN118760593APending Publication Date: 2024-10-11CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410848854.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

In the existing technology, when testing automobile controllers, the creation and configuration of test scripts require the participation of a large number of technical personnel, resulting in high labor costs and low efficiency.

Method used

By obtaining the original MAP file, converting it into a standard MAP file, and automatically generating test cases and test scripts based on the standard MAP file, it ensures that the script is compatible with the HIL test system and reduces manual participation.

Benefits of technology

It realizes the automatic creation of test scripts, reduces labor costs, improves testing efficiency, and reduces the involvement of technical personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760593A_ABST
    Figure CN118760593A_ABST
Patent Text Reader

Abstract

The invention relates to an automobile controller test method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining an original MAP file, and converting the original MAP file into a standard MAP file; wherein the attribute names of all elements in the standard MAP file conform to a preset attribute name naming specification; generating a plurality of test cases; wherein the test case comprises test data, and the test data is determined according to a standard MAP file; generating a test script from the plurality of test cases; wherein the test script is compatible with the current HIL test system; and running the test script on the HIL test system, and determining a test report according to a running result. Through the technical scheme provided by the invention, automatic creation of the test script is realized, and the created test script is compatible with the current HIL test system, so that the participation degree of technicians in the test process is reduced, the labor cost during the test is effectively reduced, and the test efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automobile testing, and in particular to a testing method, device, electronic equipment and storage medium for an automobile controller. Background Art

[0002] At present, when testing the automobile controller, the HIL (Hardware-in-the-Loop) test system is connected to each automobile controller, and the test script is run on the HIL test system. The HIL test system sends the test case to each automobile controller, and determines the test report according to the feedback results of the automobile controller, thereby realizing the test of the automobile controller. However, for HIL test systems of different manufacturers, technicians need to manually create different test scripts, and for different test items, technicians also need to adaptively configure the test scripts.

[0003] In the prior art, when testing an automobile controller, the creation and configuration of a test script requires a large amount of technical personnel's participation, resulting in high labor costs and low test efficiency. Summary of the invention

[0004] The present application provides a testing method, device, electronic device and storage medium for an automobile controller to solve the technical problem in the prior art that when testing an automobile controller, the creation and configuration of a test script require a large amount of participation of technicians, resulting in high labor costs and low testing efficiency.

[0005] In a first aspect, the present application provides a method for testing an automobile controller, the method comprising:

[0006] Acquire an original MAP file, and convert the original MAP file into a standard MAP file; wherein the attribute names of all elements in the standard MAP file conform to a preset attribute name naming specification;

[0007] Generate multiple test cases; wherein the test cases include test data, and the test data is determined according to the standard MAP file;

[0008] Generating a plurality of the test cases into a test script; wherein the test script is compatible with the current HIL test system;

[0009] The test script is run on the HIL test system, and a test report is determined according to the running result.

[0010] In a feasible embodiment of the present application, obtaining an original MAP file and converting the original MAP file into a standard MAP file includes:

[0011] Acquire the original MAP file, wherein the original MAP file includes a plurality of child nodes, and the child nodes include a plurality of elements;

[0012] The attribute name of each element of the sub-node in the original MAP file is modified according to the attribute name naming specification to generate the standard MAP file.

[0013] In a feasible embodiment of the present application, the attribute name of each element of the sub-node in the original MAP file is modified according to the attribute name naming specification to generate the standard MAP file, including:

[0014] Locate the LabelMappingList subnode among the plurality of subnodes in the original MAP file;

[0015] Get the value of FrameworkLabelReferenceLabeld of the LabelMapping element under the LabelMappingList child node;

[0016] Searching for an element to be modified in other subnodes according to the value of FrameworkLabelReferenceLabeld of the LabelMapping element under the LabelMappingList subnode; wherein the value of FrameworkLabelReference Labelld of the element to be modified is the same as the value of FrameworkLabelReference Labelld of the LabelMapping element under the LabelMappingList subnode;

[0017] The attribute names of the LabelMapping element and the element to be modified are modified according to the attribute name naming specification to generate the standard MAP file.

[0018] In a feasible embodiment of the present application, the test data includes a sent variable, sent data, an expected variable, and expected data, and a plurality of test cases are generated, including:

[0019] Obtain an interface list, a CAN matrix and the standard MAP file; wherein the interface list includes the interface names of multiple interfaces to be tested;

[0020] Obtain the interface name of the interface to be tested from the interface list;

[0021] Obtaining a signal description of a CAN signal corresponding to the interface name of the interface to be tested in the CAN matrix according to the interface name of the interface to be tested; wherein the signal description includes a signal name, a signal identifier, a maximum value, a minimum value, a precision, and an offset;

[0022] Determine the sent data and the expected data according to the signal description;

[0023] Determine the sending variable corresponding to the sending data in the standard MAP file according to the interface name of the interface to be tested, and determine the expected variable corresponding to the expected data;

[0024] The test case is generated according to the sent variable, the sent data, the expected variable and the expected data; wherein the test case uniquely corresponds to one of the interfaces to be tested.

[0025] In a feasible embodiment of the present application, determining the sending variable corresponding to the sending data in the standard MAP file according to the interface name of the interface to be tested, and determining the expected variable corresponding to the expected data, includes:

[0026] Searching the standard MAP file for an element corresponding to the interface name of the interface to be tested;

[0027] An element corresponding to the interface name of the interface to be tested is used as the sending variable or the expected variable.

[0028] In a feasible embodiment of the present application, generating the test case according to the sent variable, the sent data, the expected variable and the expected data includes:

[0029] Get standard test case templates from the HIL test system;

[0030] Acquire a test case description corresponding to the test data according to the test data; wherein the test case description includes at least a test case number and a test case name;

[0031] Fill the test data and the test case description into the corresponding columns of the standard test case template to generate the test case.

[0032] In a feasible embodiment of the present application, a plurality of the test cases are generated into a test script, including:

[0033] Get the standard test script structure from the HIL test system;

[0034] The plurality of test cases are generated into the test script according to the standard test script structure.

[0035] In a second aspect, the present application provides a testing device for an automobile controller, the device comprising:

[0036] The first test module is used to obtain an original MAP file and convert the original MAP file into a standard MAP file; wherein the attribute names of all elements in the standard MAP file conform to a preset attribute name naming specification;

[0037] A second test module is used to generate a plurality of test cases; wherein the test cases include test data, and the test data is determined according to the standard MAP file;

[0038] A third test module, configured to generate a plurality of the test cases into a test script; wherein the test script is compatible with the current HIL test system;

[0039] The running module is used to run the test script on the HIL test system and determine the test report according to the running result.

[0040] In a third aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to execute the testing method for the automobile controller described in any one of the above aspects of the present application.

[0041] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the vehicle controller testing method described in any one of the above aspects of the present application.

[0042] Beneficial effects of the present invention:

[0043] The present application provides a method for testing an automobile controller, in which an original MAP file is obtained and converted into a standard MAP file; wherein the attribute names of all elements in the standard MAP file conform to a preset attribute name specification; a plurality of test cases are generated; wherein the test cases include test data, and the test data is determined according to the standard MAP file; a plurality of test cases are generated into a test script; wherein the test script is compatible with the current HIL test system; the test script is run on the HIL test system, and a test report is determined according to the running result. The technical solution provided by the present application converts the original MAP file into a standard MAP file with a unified format, automatically generates test cases based on the standard MAP file, and then automatically creates a test script based on the test cases. Through the technical solution provided by the present application, the automatic creation of test scripts is realized, and the created test scripts are compatible with the current HIL test system, which reduces the degree of participation of technicians in the test process, effectively reduces the labor cost during testing, and can improve the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A diagram of an implementation scenario of a method for testing a vehicle controller provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of a flow chart of a method for testing an automobile controller provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of a flow chart of modifying an original MAP file in a method for testing an automobile controller provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of the structure of a testing device for an automobile controller provided in an embodiment of the present application;

[0048] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0050] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0051] For ease of description, spatial relative terms may be used in the text to describe the relative position or movement of an element or feature as shown in the figure relative to another element or feature, such as "inside", "outside", "inner side", "outer side", "below", "below", "above", "above", "front", "back", etc. Such spatial relative terms are intended to include different orientations of the device in use or operation in addition to the orientation depicted in the figure. For example, if the device in the figure undergoes a position flip or a change in posture or a change in motion state, then these directional indications will also change accordingly, for example: an element described as "below other elements or features" or "below other elements or features" will subsequently be oriented as "above other elements or features" or "above other elements or features". Therefore, the example term "below..." can include both upper and lower orientations. The device can be oriented otherwise (rotated 90 degrees or in other directions) and the spatial relative descriptors used in the text are interpreted accordingly.

[0052] In order to solve the technical problem in the prior art that when testing an automobile controller, the creation and configuration of a test script requires a large amount of technical personnel's participation, resulting in high labor costs and low testing efficiency, the present application provides a testing method, device, electronic device and storage medium for an automobile controller, which can realize automatic configuration of the test script, reduce labor costs and improve testing efficiency.

[0053] Figure 1 This is an implementation scenario diagram of a method for testing a vehicle controller provided in an embodiment of the present application, referring to Figure 1 The present application provides a method for testing an automobile controller that can be applied to automobile testing scenarios, and the method can be specifically applied to a HIL testing system.

[0054] HIL testing, or hardware-in-the-loop testing, is a testing method widely used in the field of automotive electronic control systems. It connects actual hardware (such as ECU, sensors, actuators, etc.) with simulation devices (such as models, simulators, etc.) through interfaces, simulates the actual operating environment, and tests the real-time running system.

[0055] In some automobile testing scenarios, the automobile controller is tested, and the HIL test system is connected to the automobile controller to be tested and the host computer respectively. The general test process includes: the technician first writes a test script on the host computer according to the actual situation of the automobile controller, test requirements, etc.; makes hardware connection, and actually connects the automobile controller to the HIL test system through the interface; runs the test script on the HIL test system to test the automobile controller; generates a test report based on the test results to complete the test of the automobile controller.

[0056] In the prior art, technicians need to manually configure different test scripts for different test items, different types of HIL test systems, different vehicle controllers, and different vehicle controller software interfaces. This results in a large number of technicians being involved in the testing of vehicle controllers, which is very inconvenient.

[0057] Figure 2 A flow chart of a method for testing a vehicle controller provided in an embodiment of the present application is provided. Figure 2 The present application provides a method for testing an automobile controller, which may specifically include the following steps:

[0058] S1: Obtain an original MAP file and convert the original MAP file into a standard MAP file; wherein the attribute names of all elements in the standard MAP file conform to a preset attribute name naming specification;

[0059] Specifically, the original MAP file is obtained, and the original MAP file is used to record the test variables of the current vehicle controller during the test. The original MAP file is converted to obtain a standard MAP file, and all original attribute names in the obtained standard MAP file comply with the preset attribute name naming specification.

[0060] The essence of a map file is an XML data file that can be used to search for information, add content, delete content, and change content through Python's lxml module. There are multiple original MAP files, which are obtained from the software interfaces of different control software of the automobile controller and record the test variables of the control software corresponding to the software interface. The test variables are stored in the original MAP file in the form of elements under the child nodes of the original MAP file. The elements under the original MAP files obtained by different control software have different naming methods.

[0061] Modify the original MAP file, convert it into a standard MAP file, delete unnecessary information in the original MAP file, and standardize the naming of these elements according to the preset attribute name naming conventions to provide a data basis for the subsequent generation of test cases based on the standard MAP file.

[0062] In a feasible embodiment of the present application, obtaining the original MAP file and converting the original MAP file into a standard MAP file specifically includes the following steps:

[0063] Obtain an original MAP file, the original MAP file includes multiple child nodes, and the child nodes include multiple elements;

[0064] The attribute names of the elements of each sub-node in the original MAP file are modified according to the attribute name naming specification to generate a standard MAP file.

[0065] Specifically, the original MAP file includes multiple sub-nodes, each sub-node includes multiple elements, each element corresponds to a test variable, and the attribute name of the element of each sub-node is modified according to the preset attribute name naming specification, so that the attribute name of each element is modified to a unified format to obtain a standard MAP file.

[0066] In a feasible embodiment of the present application, the attribute name naming specification stipulates that the attribute name of each sub-node element in the standard MAP file can be modified according to the interface name of the software interface of the control software corresponding to the original MAP file.

[0067] For example, the original MAP file is obtained through the M1 interface, and the attribute name of the first element under the first child node in the original MAP file can be modified to 0000_M1, and the attribute name of the second element under the first child node in the original MAP file can be modified to 0001_M1, and so on. After completing the modification of the attribute names of each element, the corresponding standard MAP file is obtained.

[0068] In a feasible embodiment of the present application, the attribute names of the elements of each sub-node in the original MAP file are modified according to the attribute name naming specification to generate a standard MAP file, including:

[0069] Locate the LabelMappingList subnode among the multiple subnodes in the original MAP file;

[0070] Get the value of FrameworkLabelReferenceLabeld of the LabelMapping element under the LabelMappingList child node;

[0071] According to the value of FrameworkLabelReferenceLabeld of the LabelMapping element under the LabelMappingList child node, search for the element to be modified in other child nodes; wherein the value of FrameworkLabelReference Labelld of the element to be modified is the same as the value of FrameworkLabelReference Labelld of the LabelMapping element under the LabelMappingList child node;

[0072] Modify the attribute names of the LabelMapping element and the element to be modified according to the attribute name naming convention to generate a standard MAP file.

[0073] Specifically, the LabelMappingList subnode records the test variables required by the current test. By determining the elements to be modified in other subnodes in the original MAP file based on the LabelMapping element in the LabelMappingList subnode, all the test variables required by the current test in the original MAP file can be determined. All the test variables required by the current test are named in a standardized manner to obtain a standard MAP file. Test variables not required by the current test in the original MAP file are not modified.

[0074] In a feasible embodiment of the present application, the elements to be modified in other child nodes can be determined based on the value of FrameworkLabelReference Labelld of the LabelMapping element under the LabelMappingList child node, that is, the elements in other child nodes that have the same value as the FrameworkLabelReference Labelld of the LabelMapping element under the LabelMappingList child node are found out, and these elements that have the same value as the FrameworkLabelReference Labelld of the LabelMapping element under the LabelMappingList child node are the elements to be modified, that is, the test variables required by the current test.

[0075] Reference Figure 3 , Figure 3 This is a flow chart of modifying the original MAP file in a test method for an automobile controller provided in an embodiment of the present application. The modification process of the LabelMapping element under the FrameworkLabelLIist subnode can be as follows: Figure 3 shown.

[0076] Locate the LabelMappingList child node; locate the FrameworkLabelLIist child node; obtain the value of FrameworkLabelReferenceLabeld of the first LabelMapping element under the LabelMappingList child node; locate the element with the same value as FrameworkLabelReference Labelld under the FrameworkLabelLIist child node; modify the attribute name of the element with the same value as FrameworkLabelReference Labelld under the FrameworkLabelLIist child node according to the attribute name naming rules; repeat the above steps to the last LabelMapping element under the LabelMappingList child node to complete the generation of the standard MAP file.

[0077] The above process of converting the original MAP file into a standard MAP file can be implemented by Python.

[0078] S2: Generate multiple test cases; wherein the test cases include test data, and the test data is determined according to a standard MAP file;

[0079] Specifically, after completing the conversion of the original MAP file, a standard MAP file is obtained, test data is determined based on the standard MAP file, and multiple test cases are generated based on the test data.

[0080] The test data is data used to test the automobile controller. The test data includes sending variables, sending data, expected variables and expected data. The sending data is sent to the test variable corresponding to the sending variable, and feedback data of the test variable corresponding to the expected variable is received. The feedback data is compared with the expected data, and the test result is determined based on the comparison result to realize the testing of the automobile controller, or any control software of the automobile controller, or any software interface of any control software of the automobile controller.

[0081] In a feasible embodiment of the present application, multiple test cases are generated, including:

[0082] Obtain an interface list, a CAN matrix, and a standard MAP file; wherein the interface list includes the interface names of multiple interfaces to be tested;

[0083] Get the interface name of the interface to be tested from the interface list;

[0084] According to the interface name of the interface to be tested, a signal description of the CAN signal corresponding to the interface name of the interface to be tested is obtained in the CAN matrix; wherein the signal description includes a signal name, a signal identifier, a maximum value, a minimum value, a precision, and an offset;

[0085] Determine the sent data and expected data according to the signal description;

[0086] Determine the sending variable corresponding to the sending data in the standard MAP file according to the interface name of the interface to be tested, and determine the expected variable corresponding to the expected data;

[0087] A test case is generated according to the sent variables, the sent data, the expected variables and the expected data; wherein the test case uniquely corresponds to an interface to be tested.

[0088] Specifically, the interface list includes the interface names of multiple interfaces, including the interface name of the interface to be tested. The interface to be tested is the interface that the current testing technician expects to test; the CAN matrix specifies the form in which the interface to be tested transmits CAN signals. The CAN matrix is ​​usually defined by the car manufacturer itself. In a general CAN matrix, the signal name, signal identifier, maximum value, minimum value, precision and offset are usually defined. The software interfaces of each control software in the car controller transmit CAN signals according to the provisions of the CAN matrix.

[0089] Determine the interface name of the interface to be tested from the interface list, search the signal description of the CAN signal corresponding to the interface name of the interface to be tested in the CAN matrix according to the interface name of the interface to be tested, determine the signal name, signal identifier, maximum value, minimum value, precision and offset of the CAN signal, and calculate the sending data and the expected data according to the CAN signal and the signal description of the CAN signal.

[0090] Search each standard MAP file according to the interface name of the interface to be tested, find the element corresponding to the interface name of the interface to be tested in the standard MAP file, and determine the element corresponding to the interface name of the interface to be tested in the standard MAP file as the expected variable and the sending variable.

[0091] After the sent data and the expected data are calculated and the sent variables corresponding to the sent data and the expected variables corresponding to the expected data are obtained, a test case is generated according to the sent variables, the sent data, the expected variables and the expected data.

[0092] In this embodiment, the sending data and the expected data are calculated according to the CAN signal and the signal description of the CAN signal. The technicians can specify the calculation method of the sending data and the expected data according to the test requirements, and the specific calculation method of the sending data and the expected data will not be described in detail here.

[0093] In a feasible embodiment of the present application, determining the sending variable corresponding to the sending data in the standard MAP file according to the interface name of the interface to be tested, and determining the expected variable corresponding to the expected data, including:

[0094] Find the element corresponding to the interface name of the interface to be tested in the standard MAP file;

[0095] The element corresponding to the interface name of the interface to be tested is used as the sent variable or the expected variable.

[0096] In the aforementioned embodiment, the attribute name naming specification stipulates that the attribute name of the element of each sub-node in the standard MAP file is modified according to the interface name of the software interface of the control software corresponding to the original MAP file. Then, there is a corresponding relationship between the elements in the standard MAP file and the interface name of the interface to be tested. According to the interface name of the interface to be tested, the element corresponding to the interface name is determined in the standard MAP file, thereby determining the sending variable and the expected variable.

[0097] In a feasible embodiment of the present application, generating a test case according to the sent variables, the sent data, the expected variables and the expected data includes:

[0098] Get standard test case templates from the HIL test system;

[0099] Obtain a test case description corresponding to the test data according to the test data; wherein the test case description includes at least a test case number and a test case name;

[0100] Fill in the test data and test case description into the corresponding columns of the standard test case template to generate the test case.

[0101] Specifically, the standard test case template specifies the generation format of the test case. The standard test case template may be preset in the HIL test system or generated based on the analysis of historical test cases of the HIL test system.

[0102] The test case description is used to describe the intent and content of this test. The test case description includes at least the test case number and the test case name. Of course, it can also include some text-type descriptions to help technicians understand the test content of this test. The test case description can be obtained based on test data or can be pre-set in the standard test case template.

[0103] The standard test case template includes at least a column for filling in sent variables, a column for filling in sent data, a column for filling in expected variables, a column for filling in expected data, a column for filling in test case numbers, and a column for filling in test case names. According to the provisions of the standard test case template, the test data and test case descriptions are filled in the corresponding columns of the standard test case template in sequence to generate a test case.

[0104] Through the above step S2, and the technical solutions provided by the various embodiments included in step S2, the sending data, sending variables, expected data and expected variables are automatically determined based on the interface name of the interface to be tested, thereby completing the determination of the test data. This process can be implemented based on Python. In this process, the technician only needs to provide the test requirements to automatically determine the test data of each interface to be tested. The technician does not need to configure the test cases of each interface to be tested in turn, which saves human resources and effectively improves the test efficiency of different software interfaces.

[0105] S3: Generate multiple test cases into test scripts; wherein the test scripts are compatible with the current HIL test system;

[0106] Specifically, the test case specifies what kind of data should be sent to the vehicle controller, what kind of data should be received, the specific content of the received data, and other information during a test. However, the test case cannot be run directly on the HIL test system. The test case needs to be converted into a corresponding test script and the vehicle controller is tested based on the test script.

[0107] Generate multiple test cases into test scripts, which should be compatible with the current HIL test system. In some possible implementation scenarios, the vehicle controller is tested through HIL test systems of multiple versions or manufacturers. Different versions of test scripts need to be run on different HIL test systems. In order to improve the compatibility of test scripts, test cases need to be generated into test scripts based on test scripts compatible with the HIL test system.

[0108] In a feasible embodiment of the present application, multiple test cases are generated into a test script, including:

[0109] Get the standard test script structure from the HIL test system;

[0110] Generate multiple test cases into test scripts according to the standard test script structure.

[0111] Specifically, a standard test script structure can be obtained from the HIL test system. The standard test script structure obtained from the HIL test system is compatible with the HIL test system. Test cases are generated into test scripts according to the main structure of the test script defined by the standard test script structure.

[0112] The standard test script structure can be obtained through the HIL interface in the HIL test system. In a feasible embodiment of the present application, the historical test scripts that have been run in the HIL test system can also be called through the HIL interface to determine the standard test script structure based on the structural analysis of the historical test scripts.

[0113] Through the above step S3, and the technical solutions provided by the various embodiments included in step S3, a test script is generated according to the standard test script structure of the HIL test system, ensuring that the generated test script is compatible with the HIL test system. For example, in some possible implementation scenarios exemplified above, the HIL test systems of type A and type B test the vehicle controller at the same time, the HIL test system of type A is compatible with the test script of structure A, and the HIL test system of type B is compatible with the test script of structure B, then based on the standard test script structure A of the HIL test system of type A, a test script A is generated, and at the same time, based on the standard test script structure B of the HIL test system of type B, a test script B is generated, and the test scripts are adaptively generated, so that the HIL test systems of type A and type B can test the vehicle controller at the same time.

[0114] S4: Run the test script on the HIL test system and determine the test report based on the running results;

[0115] Specifically, a test script is run on the HIL test system, and for any test case in the test script, test data of the test case is sent to the interface to be tested, wherein the sent data is sent to the test variable corresponding to the sent variable, feedback data of the test variable feedback corresponding to the expected variable is received, the feedback data is compared with the expected data, and the running result of the test script on the interface to be tested is determined based on the comparison result, so as to obtain a test report according to the running result, and complete the test of the interface to be tested.

[0116] The process of generating the test report is similar to the process of generating the test report when the HIL test system performs a test in the prior art, and will not be described in detail here.

[0117] Based on the above embodiments provided by the present application, in some actual automobile testing processes, the technical solutions provided by the present application can be implemented in the following ways:

[0118] The technicians write MapTool, CaseTool and ScriptTool based on Python on the host computer, and MapTool, CaseTool and ScriptTool run on the HIL test system.

[0119] Among them, MapTool is used to modify, delete or edit the original MAP file through Python's lxml module, and convert the original MAP file into a standard MAP file; CaseTool reads standard MAP files, CAN matrices, interface lists and other files through Python scripts, determines the test data according to the test requirements, and generates test cases based on the test data; ScriptTool writes a general test framework, calls the HIL test system interface through Python scripts to determine the standard test script structure of the test script, and generates a test script based on the standard test script structure and test cases.

[0120] The test scripts of the software interfaces of each control software of the vehicle controller are automatically generated through MapTool, CaseTool and ScriptTool, and the test scripts are run on the HIL test system to generate test reports and complete the test.

[0121] The technical solution provided by this application converts the original MAP file into a standard MAP file with a unified format, automatically generates test cases based on the standard MAP file, and then automatically creates test scripts based on the test cases. Through the technical solution provided by this application, the automatic creation of test scripts is realized, and the created test scripts are compatible with the current HIL test system, which reduces the degree of participation of technicians in the test process, effectively reduces the labor cost during testing, and can improve test efficiency.

[0122] The following are device embodiments of the present application, which can be used to execute method embodiments of the present application.

[0123] Figure 4 This is a schematic diagram of the structure of a vehicle controller test device provided in an embodiment of the present application. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 4 As shown, the test device of the automobile controller includes a first test module 401, a second test module 402, a third test module 403 and an operation module 404, wherein:

[0124] The first test module 401 is used to obtain an original MAP file and convert the original MAP file into a standard MAP file; wherein the attribute names of all elements in the standard MAP file conform to a preset attribute name naming specification;

[0125] The second test module 402 is used to generate multiple test cases; wherein the test cases include test data, and the test data is determined according to the standard MAP file;

[0126] The third test module 403 is used to generate multiple test cases into a test script; wherein the test script is compatible with the current HIL test system;

[0127] The running module 404 is used to run the test script on the HIL test system and determine a test report according to the running result.

[0128] In a feasible embodiment of the present application, the first test module 401 includes:

[0129] A first acquisition unit is used to acquire an original MAP file, where the original MAP file includes a plurality of child nodes, and the child nodes include a plurality of elements;

[0130] The first generating unit is used to modify the attribute name of the element of each sub-node in the original MAP file according to the attribute name naming specification to generate a standard MAP file.

[0131] In a feasible embodiment of the present application, the first generating unit includes:

[0132] The positioning sub-unit is used to locate the LabelMappingList sub-node among the multiple sub-nodes in the original MAP file;

[0133] The first acquisition subunit is used to obtain the value of the FrameworkLabelReference Labelld of the LabelMapping element under the LabelMappingList subnode;

[0134] The first search sub-unit is used to search for the element to be modified in other sub-nodes according to the value of FrameworkLabelReference Labelld of the LabelMapping element under the LabelMappingList sub-node; wherein the value of FrameworkLabelReference Labelld of the element to be modified is the same as the value of FrameworkLabelReference Labelld of the LabelMapping element under the LabelMappingList sub-node;

[0135] The first generating subunit is used to modify the attribute names of the LabelMapping element and the element to be modified according to the attribute name naming specification to generate a standard MAP file.

[0136] In a feasible embodiment of the present application, the test data includes a sent variable, sent data, an expected variable, and expected data, and the second test module 402 includes:

[0137] The second acquisition unit is used to acquire an interface list, a CAN matrix and a standard MAP file; wherein the interface list includes interface names of multiple interfaces to be tested;

[0138] A third acquisition unit is used to acquire the interface name of the interface to be tested from the interface list;

[0139] A fourth acquisition unit, used to acquire a signal description of a CAN signal corresponding to the interface name of the interface to be tested in the CAN matrix according to the interface name of the interface to be tested; wherein the signal description includes a signal name, a signal identifier, a maximum value, a minimum value, a precision, and an offset;

[0140] A first determining unit, configured to determine the transmitted data and the expected data according to the signal description;

[0141] A second determining unit, configured to determine a sending variable corresponding to the sending data in the standard MAP file according to the interface name of the interface to be tested, and to determine an expected variable corresponding to the expected data;

[0142] The second generating unit is used to generate a test case according to the sent variables, the sent data, the expected variables and the expected data; wherein the test case uniquely corresponds to one interface to be tested.

[0143] In a feasible embodiment of the present application, the second determining unit includes:

[0144] The second search subunit is used to search the standard MAP file for an element corresponding to the interface name of the interface to be tested;

[0145] The determination subunit is used to use the element corresponding to the interface name of the interface to be tested as a sending variable or an expected variable.

[0146] In a feasible embodiment of the present application, the second generating unit includes:

[0147] A second acquisition subunit is used to acquire a standard test case template from the HIL test system;

[0148] A third acquisition subunit is used to acquire a test case description corresponding to the test data according to the test data; wherein the test case description includes at least a test case number and a test case name;

[0149] The second generating subunit is used to fill the test data and the test case description into the corresponding columns of the standard test case template to generate the test case.

[0150] In a feasible embodiment of the present application, the third test module 403 includes:

[0151] A fifth acquisition unit, used for acquiring a standard test script structure from the HIL test system;

[0152] The third generating unit is used to generate multiple test cases into test scripts according to the standard test script structure.

[0153] The apparatus of the above-mentioned embodiment is used to implement the corresponding method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0154] like Figure 5 As shown, an embodiment of the present application provides an electronic device, including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0155] Memory 503, used for storing computer programs;

[0156] In one embodiment of the present application, the processor 501 is used to execute the program stored in the memory 503 to implement a method for testing a vehicle controller provided by any of the above method embodiments, for example, including:

[0157] Obtaining an original MAP file, and converting the original MAP file into a standard MAP file; wherein the attribute names of all elements in the standard MAP file conform to a preset attribute name naming specification;

[0158] Generate multiple test cases; wherein the test cases include test data, and the test data is determined according to a standard MAP file;

[0159] Generate multiple test cases into test scripts; wherein the test scripts are compatible with the current HIL test system;

[0160] Run the test script on the HIL test system and determine the test report based on the running results.

[0161] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of a method for testing an automobile controller provided in any of the aforementioned method embodiments are implemented.

[0162] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0163] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0164] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0165] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for testing an automobile controller, characterized in that: The method comprises: Acquire an original MAP file, and convert the original MAP file into a standard MAP file; wherein the attribute names of all elements in the standard MAP file conform to a preset attribute name naming specification; Generate multiple test cases; wherein the test cases include test data, and the test data is determined according to the standard MAP file; Generating a plurality of the test cases into a test script; wherein the test script is compatible with the current HIL test system; The test script is run on the HIL test system, and a test report is determined according to the running result.

2. The method according to claim 1, characterized in that Acquire an original MAP file, and convert the original MAP file into a standard MAP file, including: Acquire the original MAP file, wherein the original MAP file includes a plurality of child nodes, and the child nodes include a plurality of elements; The attribute name of each element of the sub-node in the original MAP file is modified according to the attribute name naming specification to generate the standard MAP file.

3. The method according to claim 2, characterized in that Modifying the attribute name of each element of the sub-node in the original MAP file according to the attribute name naming specification to generate the standard MAP file includes: Locate the LabelMappingList subnode among the plurality of subnodes in the original MAP file; Get the value of FrameworkLabelReferenceLabeld of the LabelMapping element under the LabelMappingList child node; Searching for an element to be modified in other subnodes according to the value of FrameworkLabelReferenceLabeld of the LabelMapping element under the LabelMappingList subnode; wherein the value of FrameworkLabelReference Labelld of the element to be modified is the same as the value of FrameworkLabelReference Labelld of the LabelMapping element under the LabelMappingList subnode; The attribute names of the LabelMapping element and the element to be modified are modified according to the attribute name naming specification to generate the standard MAP file.

4. The method according to claim 1, characterized in that: The test data includes sending variables, sending data, expected variables and expected data, and generates multiple test cases, including: Obtain an interface list, a CAN matrix and the standard MAP file; wherein the interface list includes the interface names of multiple interfaces to be tested; Obtain the interface name of the interface to be tested from the interface list; Obtaining a signal description of a CAN signal corresponding to the interface name of the interface to be tested in the CAN matrix according to the interface name of the interface to be tested; wherein the signal description includes a signal name, a signal identifier, a maximum value, a minimum value, a precision, and an offset; Determine the sent data and the expected data according to the signal description; Determine the sending variable corresponding to the sending data in the standard MAP file according to the interface name of the interface to be tested, and determine the expected variable corresponding to the expected data; The test case is generated according to the sent variable, the sent data, the expected variable and the expected data; wherein the test case uniquely corresponds to one of the interfaces to be tested.

5. The method according to any one of claims 2 to 4, characterized in that: Determining the sending variable corresponding to the sending data in the standard MAP file according to the interface name of the interface to be tested, and determining the expected variable corresponding to the expected data, including: Searching the standard MAP file for an element corresponding to the interface name of the interface to be tested; An element corresponding to the interface name of the interface to be tested is used as the sending variable or the expected variable.

6. The method according to claim 4, characterized in that Generating the test case according to the sent variable, the sent data, the expected variable, and the expected data includes: Get standard test case templates from the HIL test system; Acquire a test case description corresponding to the test data according to the test data; wherein the test case description includes at least a test case number and a test case name; Fill the test data and the test case description into the corresponding columns of the standard test case template to generate the test case.

7. The method according to claim 1, characterized in that Generating a plurality of the test cases into a test script, including: Get the standard test script structure from the HIL test system; The plurality of test cases are generated into the test script according to the standard test script structure.

8. A test device for an automobile controller, characterized in that: The device comprises: The first test module is used to obtain an original MAP file and convert the original MAP file into a standard MAP file; wherein the attribute names of all elements in the standard MAP file conform to a preset attribute name naming specification; A second test module is used to generate a plurality of test cases; wherein the test cases include test data, and the test data is determined according to the standard MAP file; A third test module, configured to generate a plurality of the test cases into a test script; wherein the test script is compatible with the current HIL test system; The running module is used to run the test script on the HIL test system and determine the test report according to the running result.

9. An electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to execute the vehicle controller testing method described in any one of the above aspects of the present application.

10. A computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the vehicle controller testing method described in any one of the above items of the present application.