ECU automatic test method and device based on TSMaster software
By creating a GUI application panel in the TSMaster software and automatically configuring the environment and packets of the ECU test project, the problem of ECU testing relies on professional programmers and early environment configuration in the existing technology is solved, and efficient ECU project testing and agile development are achieved.
Patent Information
- Application Number
- CN202510401474.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-06-17
AI Technical Summary
The existing ECU testing methods rely on professional programmers to customize test scripts, and the early environment configuration takes a long time, resulting in inefficient testing.
The ECU automation testing method based on TSMaster software is adopted. By pre-creating the GUI application panel in the TSMaster software, the environment and packets of the ECU test project are automatically configured, reducing the requirements for the professional capabilities of the testers.
It realizes a rapid configuration of the test environment, reduces the skill requirements of testers, significantly improves the testing efficiency of ECU projects, and supports daily agile development and simultaneous testing of multiple ECU projects.
Smart Images

Figure CN120162272A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ECU automatic testing, and in particular to an ECU automatic testing method and device based on TSMaster software. Background Art
[0002] With the increasing complexity of automotive electronic systems, the testing of electronic control units (ECUs) has become increasingly important. To ensure the functional reliability and performance stability of ECUs, various testing methods have been developed in the industry, such as various different manual testing methods. However, considering that manual testing methods have many deficiencies such as long time consumption, high cost, and easy errors, while automatic testing methods have the advantages of saving time, improving efficiency, and low error occurrence rate, therefore, how to develop an automatic testing method has become a key problem that needs to be solved urgently.
[0003] In related technologies, software tools for ECU testing are usually used, such as VectorCANoe software and dSPACE ControlDesk software, etc., to support the development process and testing process of ECUs; however, although the above software tools provide a certain degree of automatic testing ability, they rely on professional programmers to customize test scripts, which requires high professional capabilities of testers; and for complex testing environments, a large number of parameters and conditions need to be manually configured in the early stage of configuring the testing environment, increasing the testing preparation time. Summary of the Invention
[0004] The purpose of the present invention is to provide an ECU automatic testing method and device based on TSMaster software, so as to solve the technical problems that the existing ECU testing depends on professional programmers to customize test scripts and the time required for early environment configuration is long. Testers do not need to deeply understand the interaction logic of each function, and can complete the configuration of the testing environment in the early stage of the project, further reducing the requirements for various capabilities of testers. It not only ensures that both testers and other developers can complete ECU testing through simple configuration, greatly improving the testing efficiency of ECU projects, but also can achieve the technical effects of daily agile development and simultaneous testing of multiple ECU projects every day. The many technical effects that can be produced by the preferred technical solutions among the many technical solutions provided by the present invention are described in detail below.
[0005] To achieve the above purpose, the present invention provides the following technical solutions:
[0006] The present invention provides an ECU automatic testing method based on TSMaster software, including:
[0007] In response to a user operation, determine a first ECU test item specified by the user operation in a GUI application panel pre-created in the TSMaster software;
[0008] In response to a first item start instruction, trigger an operation to wait for the first ECU test item to start and complete;
[0009] Based on the start completion result, execute test cases for the first ECU test item using the GUI application panel; the start completion result indicates that the automation configuration of the environment and messages for the first ECU test item has been completed in the GUI application panel.
[0010] According to an ECU automated test method based on the TSMaster software provided by the present invention, the method further includes:
[0011] Based on a project switching requirement, stop running the TSMaster software, and determine a second ECU test item specified by the project switching requirement in the GUI application panel;
[0012] Run the TSMaster software, and in response to a second item start instruction, switch the first ECU test item to the second ECU test item.
[0013] According to an ECU automated test method based on the TSMaster software provided by the present invention, the creation process of the GUI application panel includes:
[0014] Import the project DBC files of all ECU test items into the TSMaster software respectively, and perform CAN channel configuration for all the imported ECU test items;
[0015] Based on the CAN channel configuration result, determine the C code project of the to-be-simulated messages of the to-be-tested controllers in each DBC file;
[0016] Create a small program library file based on each C code project to obtain a first C small program library file for each ECU test item;
[0017] Create a GUI panel based on the system variable values of each first C small program library file and a second C small program library file library for project start management to obtain the GUI application panel.
[0018] According to an ECU automated test method based on the TSMaster software provided by the present invention, the performing CAN channel configuration for all the imported ECU test items includes:
[0019] In response to a channel selection operation, determine the number of hardware channels that match all the ECU test items in the channel selection interface, and perform the CAN channel configuration based on the hardware channel data.
[0020] According to an ECU automated test method based on the TSMaster software provided by the present invention, determining, based on the CAN channel configuration result, the C code project of the to-be-simulated message of the controller under test in each DBC file includes:
[0021] In response to a project activation operation, determine all the activated ECU test items in the CAN remaining bus simulation interface of the TSMaster software; each of the activated ECU test items indicates that the corresponding ECU test item has been activated;
[0022] For each activated ECU test item, determine the to-be-simulated message of the controller under test in the message selection pop-up window of the activated ECU test item, and generate the C code project of the to-be-simulated message based on the project DBC file of the activated ECU test item.
[0023] According to an ECU automated test method based on the TSMaster software provided by the present invention, creating a small program library file based on each of the C code projects to obtain the first C small program library file for each ECU test item includes:
[0024] In response to a code editor addition operation, determine the initial small program library for each ECU test item in the code editor addition interface of the TSMaster software;
[0025] In response to a program start event addition operation, determine the to-be-received message for each ECU test item in the code editor addition interface;
[0026] Based on the message determination result, add the C code project corresponding to each ECU test item to the code editor addition interface to obtain the first C small program library file for each ECU test item.
[0027] According to an ECU automated test method based on the TSMaster software provided by the present invention, creating a GUI application panel based on the system variable values of each of the first C small program library files and a second C small program library file for project start management to obtain the GUI application panel includes:
[0028] In the case where each of the first C small program library files has been generated, in response to a system variable creation operation, determine the created system variable values in the system variable window of the TSMaster software;
[0029] In response to the panel addition instruction, add the GUI buttons of the TSMaster software to the panel window, and perform item identification configuration for each ECU test item in the panel window;
[0030] Create the second C small program library file in the panel window based on the pre-written project start management code;
[0031] Based on the project identification configuration result, perform code writing and compilation operations for each of the first C small program library file and the second C small program library file in the panel window;
[0032] Based on the completion result of the compilation operation and the touch operation received by the switch auto-start button in the panel window, complete the creation operation of the GUI application panel.
[0033] The present invention also provides an ECU automatic test device based on the TSMaster software, including the following modules.
[0034] A project determination module, configured to determine a first ECU test item specified by the user operation in a GUI application panel pre-created in the TSMaster software in response to the user operation;
[0035] A project start module, configured to trigger a waiting-for-start-completion operation of the first ECU test item in response to a first project start instruction;
[0036] A project test module, configured to execute test cases of the first ECU test item by using the GUI application panel based on the start completion result; the start completion result indicates that the automatic configuration of the environment and messages for the first ECU test item is completed in the GUI application panel.
[0037] An ECU automated testing method and device based on TSMaster software provided by the present invention. In the ECU automated testing method based on TSMaster software, first, in response to a user operation, a first ECU test item specified by the user operation is determined in the GUI application panel pre-created in the TSMaster software. Then, in further response to a first item start instruction, a waiting-for-start-completion operation for the first ECU test item is triggered. Finally, when the automated configuration of the environment and messages for the first ECU test item is completed in the GUI application panel, the test cases for the first ECU test item are executed using the GUI application panel. In this way, the technical problem of the long time required for the pre-configuration of the test environment in a complex test environment is solved, and testers do not need to deeply understand the interaction logic of each function, can complete the pre-test environment configuration of the project, and the requirements for testers in all aspects are further reduced. It not only ensures that both testers and other developers can complete ECU testing through simple configuration, greatly improving the testing efficiency of ECU projects, but also can achieve the technical effects of daily agile development and simultaneous testing of multiple ECU projects per day. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0039] Figure 1 It is a flowchart of the ECU automated testing method based on TSMaster software provided by an embodiment of the present invention;
[0040] Figure 2 It is a structural diagram of the ECU automated testing device based on TSMaster software provided by an embodiment of the present invention;
[0041] Figure 3 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention in conjunction with the drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0043] In the embodiments of the present invention, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. In the textual description of the present invention, the character " / " generally indicates that the previous and next associated objects are in an "or" relationship. In addition, it should be noted that the serial numbers themselves, such as "first", "second", etc., used to distinguish the objects described in the present invention are only used to distinguish the objects described, and do not have any order or technical meaning.
[0044] As automotive electronic systems become increasingly complex, ECU testing is becoming more and more important. In order to ensure the functional reliability and performance stability of ECUs, the industry has developed a variety of testing methods, such as a variety of different manual testing methods. However, considering that manual testing methods have many shortcomings such as long time consumption, high cost and easy errors, automated testing methods have the advantages of saving time, improving efficiency and low error rate. Therefore, automated testing methods have become an effective means to improve testing efficiency and accuracy. Therefore, how to develop automated testing methods has become a key issue that needs to be solved urgently.
[0045] In the related technology, software tools for ECU testing are usually used, that is, some software tools for testing ECU currently available on the market, such as VectorCANoe software, dSPACEControlDesk software and TSMaster software, etc. These software tools provide rich functions to support the development and testing process of ECU; among them, TSMaster software is a software tool specially used for CAN bus communication analysis and ECU testing. It not only supports multiple communication protocols, but also provides a graphical interface to facilitate user configuration and operation. However, although TSMaster software provides a certain degree of automated testing capabilities, it still relies on limitations in the actual application process, such as complex test script writing, that is, although TSMaster software allows users to customize test scripts, its scripting language is relatively professional and has a steep learning curve, which is difficult for non-programmers; another limitation is that the test scenario setting is cumbersome, that is, for complex test scenarios, the early configuration environment requires manual setting of a large number of parameters and conditions, which greatly increases the time for test preparation.
[0046] Exemplarily, in the existing ECU test method, in the early stage, testers manually configure the C code applet module in the TSMaster software to write the functional simulation logic, and the bus simulation module is responsible for sending messages. The vehicle simulation of the ECU is carried out through the cooperation of the two modules. Subsequently, a graphical module (such as a graphical user interface) is used to execute test cases. When switching the project environment, the existing test project needs to be closed and another test project needs to be reopened.
[0047] Obviously, in the above existing ECU test method, a test project can only have a test environment for one test project. When switching test projects, a new test project needs to be established to configure various parameters, and the time cost of switching test projects is very high. Especially when the test project becomes more and more complex and the number of test projects increases as the test progresses, the time for switching the test environment is also too long.
[0048] The following explains the professional terms involved in the present invention:
[0049] VectorCANoe software: A bus development environment software, mainly used for the development, testing and analysis of automotive buses. CANoe supports multiple network protocols, including CAN, LIN, Ethernet, FlexRay and MOST, etc., and is applicable to the entire development process from requirement analysis to system implementation.
[0050] dSPACE ControlDesk software: A general modular experiment and instrumentation software for ECU (Electronic Control Unit) development. It can seamlessly handle all tasks in ECU development and provide a single working environment. ControlDesk integrates the functions of multiple dedicated tools, can access the simulation platform, bus system and ECU, and supports standardized interfaces such as CCP (Calibration Protocol), XCP (Measurement Protocol) and ODX (Open Data Exchange Format) for ECU calibration, measurement and diagnosis.
[0051] TSMaster software: An automotive bus development tool, which is currently the only tool that can rival CANoe; the TSMaster software supports connecting, configuring and controlling all Tongxing hardware tools and devices, and is widely used in various occasions such as automotive bus monitoring, simulation, diagnosis, calibration, BootLoader, I / O control, measurement and testing, and EOL.
[0052] DBC file: The full name is the CAN bus protocol database file, which is a database file describing the communication of the Controller Area Network (CAN).
[0053] To solve the above technical problems, the present invention provides an ECU automated test method and device based on the TSMaster software.
[0054] The following combines Figures 1-3 to describe the ECU automated test method and device based on the TSMaster software. The execution subject of the ECU automated test method based on the TSMaster software is an electronic device or a server. The TSMaster software is pre-installed in the electronic device or server, and a graphical user interface (GUI) for ECU test use and switching is pre-created in the TSMaster software; the electronic device can be a personal computer (PC), a portable device, a laptop computer, a smart phone, a tablet computer, a portable wearable device, or other device cloud servers. The server can refer to a single server or a server cluster, a cloud server, etc. composed of multiple servers. The present invention does not specifically limit the specific form of the electronic device or the server. Further, the ECU automated test method based on the TSMaster software can also be applied to the ECU automated test device based on the TSMaster software provided in the electronic device or the server. The ECU automated test device based on the TSMaster software can be implemented by software, hardware, or a combination of both. The following takes the execution subject of the ECU automated test method based on the TSMaster software as an electronic device as an example to describe the ECU automated test method based on the TSMaster software.
[0055] To facilitate the understanding of the ECU automated test method provided by the embodiments of the present invention, the following will describe in detail the ECU automated test method provided by the present invention through the following several exemplary embodiments. It can be understood that the following several exemplary embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0056] Referring to Figure 1 , which is a schematic flowchart of the ECU automated test method provided by the embodiments of the present invention. As Figure 1 shown, the ECU automated test method based on the TSMaster software includes the following steps 110 to step 130.
[0057] Step 110: In response to a user operation, determine a first ECU test item specified by the user operation in the GUI application panel pre-created in the TSMaster software.
[0058] Among them, the graphical user interface (GUI) application panel can perform automated configuration for all ECU test items using the GUI panel based on the TSMaster software, as well as the application panel created after switching the ECU test item configuration. The ECU test item switching configuration can specifically include automating the configuration of the environment and messages after switching between ECU test items.
[0059] The GUI application panel at least has the function of automatically configuring the environment and messages of a certain ECU test item among all ECU test items, as well as the function of automatically configuring the environment and messages after switching between ECU test items.
[0060] The first ECU test item can be the ECU test item specified by the user using the GUI application panel; and the number of the first ECU test items can be 1 or multiple, which is not specifically limited here.
[0061] The ECU test item can include, but is not limited to, one of the other tests such as power supply and ground test, sleep and wake-up current test, closed-loop control test, and external circuit test.
[0062] The user operation can be that the user clicks on a certain GUI test item in the new drop-down box in the GUI application panel, and the ECU test item clicked by the user is the first ECU test item.
[0063] Specifically, in the running TSMaster software, the user first clicks on a certain ECU test item in the created drop-down box in the pre-created GUI application panel, such as selecting the Prj1 project or the Prj2 project. At this time, the ECU test item clicked by the user can be determined as the first ECU test item specified by the user operation.
[0064] Step 120: In response to the first project start instruction, trigger the operation of waiting for the first ECU test item to start and complete.
[0065] Among them, the first project start instruction can be an instruction automatically generated after the user clicks the start button in the upper left corner of the TSMaster software for the first ECU test item.
[0066] Specifically, when the user clicks on a certain ECU test item in the created drop-down box in the GUI application panel to select the first ECU test item to be detected, the user can click the start button in the upper left corner of the TSMaster software again to trigger the operation of waiting for the start to complete, that is, waiting for the operation of automatically configuring the environment and messages of the first ECU test item to complete.
[0067] Step 130: Based on the startup completion result, execute the test cases of the first ECU test project using the GUI application panel; the startup completion result indicates that the automated configuration of the environment and messages for the first ECU test project has been completed in the GUI application panel.
[0068] Specifically, when it is determined that the automated configuration of the environment and messages for the first ECU test project has been completed in the GUI application panel, the test cases of the first ECU test project can be executed using the GUI application panel, thereby completing the ECU test corresponding to the first ECU test project.
[0069] The ECU automated test method based on the TSMaster software provided by the embodiments of the present invention first determines the first ECU test project specified by the user operation in the GUI application panel pre-created in the TSMaster software in response to the user operation, and then further triggers the waiting-for-startup-completion operation of the first ECU test project in response to the first project startup instruction; finally, when the automated configuration of the environment and messages for the first ECU test project has been completed in the GUI application panel, execute the test cases of the first ECU test project using the GUI application panel; in this way, the technical problem of the long time required for the pre-configuration of the test environment in a complex test environment is solved, and the tester does not need to deeply understand the interaction logic of each function, can complete the pre-project test environment configuration, and the requirements for the tester's various abilities are further reduced. It not only ensures that both the tester and other developers can complete the ECU test through simple configuration, greatly improving the ECU project test efficiency, but also can achieve the technical effects of daily agile development and simultaneous testing of multiple ECU projects per day.
[0070] Based on the above Figure 1 For the ECU automated test method based on the TSMaster software shown above, in an exemplary embodiment, the newly created GUI application panel in the TSMaster software can not only automatically configure the environment and messages of the ECU test project, but also switch to another ECU test project without reopening the TSMaster software. Based on this, the ECU automated test method provided by the present invention may further include the following process.
[0071] First, based on the project switching requirement, stop running the TSMaster software, and determine the second ECU test project specified by the project switching requirement in the GUI application panel; then, run the TSMaster software, and in response to the second project startup instruction, switch the first ECU test project to the second ECU test project.
[0072] Specifically, during the process of executing the test case of the first ECU test project in the newly created GUI application panel in the TSMaster software, if the user needs to switch to another ECU test project, the second ECU test project that is different from the first ECU test project is input into the TSMaster software to generate a project switching requirement. The project switching requirement is the requirement to switch the first ECU test project to the second ECU test project.
[0073] In this way, when there is a need to switch projects, first stop running the TSMaster software, then select the second ECU test project specified by the project switching requirement in the GUI application panel, and then further start running the TSMaster software, and respond to the second project start instruction, that is, the instruction automatically generated after the user clicks the start button in the upper left corner of the TSMaster software for the second ECU test project; after the selection is completed, click the start button in the upper left corner of the TSMaster software to complete the project switch. Then wait for the automatic configuration of the environment and messages of the second ECU test project to complete the operation, so that after the automatic configuration of the environment and messages for the second ECU test project is completed in the GUI application panel, the test case of the second ECU test project is executed using the GUI application panel.
[0074] Based on the above Figure 1 In the ECU automated testing method based on TSMaster software shown, in an exemplary embodiment, the process of creating a GUI application panel includes the following steps.
[0075] First, import the project DBC files of all ECU test projects into the TSMaster software, and configure the CAN channels for all imported ECU test projects; secondly, based on the CAN channel configuration results, determine the C code project of the message to be simulated of the controller to be tested in each DBC file; then, create a small program library file based on each C code project to obtain the first C small program library file for each ECU test project; then, create a GUI panel based on the system variable values of each first C small program library file and the second C small program library file library used for project startup management to obtain a GUI application panel.
[0076] Specifically, all the project DBC files of all current ECU test projects are imported into TSMaster software, and the import process of the project DBC files of each ECU test project is completed by loading the CAN database file and determining the path selection.
[0077] Exemplarily, there are two project DBC files for different ECU test items on the desktop of the electronic device, such as Prj1.dbc (Project 1 dbc) and Prj2.dbc (Project 2 dbc). At this time, the user needs to click Analysis -> Database -> Display CAN Database File -> Load CAN Database File (the first option in the upper left corner of the interface) in the TSMaster software to enter the file import interface. Then, select the "Prj1.dbc" file under the desktop path in the file import interface and click the "OK" button; repeat the above process to add the second project DBC file (that is, add the "Prj2.dbc" file); after adding the two project DBC files, right-click on "Channel 1" in this file import interface and select the two loaded project DBC files in sequence to complete the import process of the two project DBC files.
[0078] At this time, for all imported ECU test items, perform CAN channel configuration. The number of configured CAN channels can be the same as or different from the number of project DBC files. For example, the two project DBC files can have only 1 hardware channel or two hardware channels.
[0079] In the case of importing all project DBC files and completing the hardware channel configuration, according to the actual test requirements, at least 1 message can be selected from all the messages of the to-be-tested controller in each project DBC file as the to-be-simulated message, so as to generate a C code project corresponding to the to-be-simulated message.
[0080] In the case of generating a C code project for the to-be-simulated messages of the to-be-tested controller in each project DBC file, a first C small program library file for each ECU test item can be generated by adding a C code editor, configuring the program startup event based on all C code projects, and code compilation; each first C small program library file is a binary file.
[0081] In the case of generating the first C small program library file for each ECU test item, through the method of GUI switching interface configuration and program startup event configuration, create a GUI panel for the system variable values of each first C small program library file and the second C small program library file to obtain a GUI application panel.
[0082] Based on the above Figure 1 In an example embodiment of the ECU automated test method based on the TSMaster software shown above, for all imported ECU test items, perform CAN channel configuration, and the configuration process includes the following steps.
[0083] In response to a channel selection operation, determine the number of hardware channels that match all ECU test items in the channel selection interface, and perform CAN channel configuration based on the hardware channel data.
[0084] Specifically, the user inputs a channel selection operation by touching Hardware -> Channel Selection in the TSMaster software, and in response to this channel selection operation, a channel selection interface is presented to the user. At this time, the user can select a corresponding number of hardware physical devices in the hardware channel selection option by first clicking the application channel number button in the channel selection interface and then selecting one of the 10 numbers from 1 to 10 displayed in the drop-down option box (for example, selecting "1"), and then touching the OK button to complete the CAN channel configuration; the touch method can be a mouse click method or a finger touch method, etc.; no specific limitation is made here.
[0085] Exemplarily, the hardware physical device includes at least one of, but is not limited to, a microcontroller, a power management module, an input interface, an output interface, a communication interface, a monitoring module, a fault injection device, an oscilloscope, a programmer, and a debugging tool.
[0086] It should be noted that the specific number selected by the user from the 10 numbers from 1 to 10 displayed in the drop-down option box can specifically be the specific number of project DBC files; for example, when the actual number of project DBC files is 1 in total, "1" can be selected from the 10 numbers from 1 to 10 displayed in the drop-down option box; at this time, 1 hardware physical device can be selected in the hardware channel selection option in the channel selection interface, and then the CAN channel configuration can be completed after clicking the OK button.
[0087] Based on the above Figure 1 In an example embodiment of the ECU automated test method based on the TSMaster software shown above, based on the CAN channel configuration result, determine the C code project of the to-be-simulated messages of the to-be-tested controllers in each DBC file, and the determination process is implemented through the following steps.
[0088] First, in response to a project activation operation, determine all activated ECU test items in the CAN remaining bus simulation interface of the TSMaster software; each activated ECU test item indicates that the corresponding ECU test item has been activated; then, for each activated ECU test item, determine the to-be-simulated messages of the to-be-tested controllers in the message selection pop-up window of the activated ECU test item, and generate a C code project of the to-be-simulated messages based on the project DBC file of the activated ECU test item.
[0089] Specifically, the user inputs the project activation operation by touching the toolbar -> simulation -> CAN bus simulation in the TSMaster software, and after responding to the project activation operation, displays the remaining CAN bus simulation interface to the user. At this time, in the popped-up remaining CAN bus simulation interface, the activation operation of an ECU test project is completed by the user checking the activation option on the right side of each ECU test project, that is, determining an activated ECU test project; repeating the above process until all activated ECU test projects are determined.
[0090] Further, by instructing the user to first touch the plus sign (such as "+") on the left side of the activated ECU test project and then check the message nodes to be simulated, a message selection pop-up window is popped up. By the user first checking at least 1 message to be simulated in the message selection pop-up window, right-clicking on the project DBC file of the activated ECU test project after checking, and then touching the button to generate the network initialization code, a C code project for at least 1 message to be simulated of the controller to be tested in a project DBC file is generated; repeating the above process until a C code project for at least 1 message to be simulated of the controller to be tested in each project DBC file is determined; and saving all C code projects.
[0091] It should be noted that at least 1 message selected is a message to be simulated, and the selected message node for simulation is the controller to be tested; the controller to be tested can be a node in the CAN network, that is, an ECU, including various controllers such as an engine electronic control unit, an automatic transmission electronic control unit, an ABS electronic control unit, etc.
[0092] Based on the above Figure 1 In an example embodiment of the ECU automation test method based on the TSMaster software shown, based on each C code project, a small program library file is created to obtain the first C small program library file for each ECU test project, and its specific process is implemented by the following steps.
[0093] First, in response to the code editor addition operation, determine the initial small program library for each ECU test project in the code editor addition interface of the TSMaster software; then, in further response to the program start event addition operation, determine the messages to be received for each ECU test project in the code editor addition interface; then, based on the message determination result, add the C code project corresponding to each ECU test project to the code editor addition interface to obtain the first C small program library file for each ECU test project.
[0094] Specifically, the user inputs the code editor addition operation by touching Design -> C Mini Program Library -> Add C Mini Program Editor in the TSMaster software, and after responding to the code editor addition operation, displays the code editor addition interface to the user. At this time, by the user checking the sub-option of Automatically Include All in the option of Dependent Database under the Property Pop-up Window in the code editor addition interface, the original display name and program name are changed to the current ECU test project, such as changing to "Prj1", and touching the option that this program is a mini program, so as to achieve the purpose of switching 1 C code project to a mini program library and determining the initial mini program library of 1 ECU test project; repeating the above process to determine the initial mini program library of each ECU test project, that is, obtaining the message determination result.
[0095] In the case of determining the initial mini program library of each ECU test project, further, the user touches the option of Object first and then right-clicks on the option of CAN Pre-Transmission Event in the code editor addition interface to pop up the message reception tab, and by the user first selecting at least 1 message to be simulated corresponding to the controller under test in the message reception tab and then right-clicking on the Program Start Event after selection, pastes all the C code projects determined in the previous step into the corresponding Program Start Event addition box; then touches the Compile button (such as the "F9" button) to perform compilation, waits for the compilation to succeed, and in the case of successful compilation, the user can view the first C mini program library file of the ECU test project by touching Design -> C Mini Program Library interface in the TSMaster software; thus, the first C mini program library file of one ECU test project can be completed.
[0096] Repeat the above process until the first C mini program library file of each ECU test project is determined. For example, for the two ECU test projects of Prj1.dbc (Project 1 dbc) and Prj2.dbc (Project 2 dbc), the two first C mini program library files of "Prj1.mp" file and "Prj2.mp file" can be viewed.
[0097] Exemplarily, in the Prj1.dbc project DBC file, there are 10 messages: 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109, and 0x110. Only 0x101 and 0x102 need to be simulated in this simulation. Then the user right-clicks on the option of CAN Pre-Transmission Event, selects 0x101 and 0x102 in sequence and then clicks OK.
[0098] Based on the above Figure 1The ECU automation test method based on the TSMaster software shown. In an exemplary embodiment, a GUI application panel is created based on the system variable values of each first C small program library file and a second C small program library file for project startup management, and the GUI application panel is obtained. The specific process can be implemented through the following steps.
[0099] First, in the case where each first C small program library file has been generated, in response to a system variable creation operation, determine the created system variable values in the system variable window of the TSMaster software; then, in response to a panel addition instruction, add the GUI buttons of the TSMaster software to the panel window, and configure the project identification for each ECU test project in the panel window; further, based on the pre-written project startup management code, create a second C small program library file in the panel window; then, based on the project identification configuration result, perform code writing and compilation operations for each first C small program library file and the second C small program library file in the panel window; finally, based on the completion result of the compilation operation and the touch operation received by the switch automatic startup button in the panel window, complete the creation operation of the GUI application panel.
[0100] Specifically, in the case where all the first C small program library files required for the ECU test projects are determined, the system variable creation operation is input by the user through the way of touching Simulation -> System Variables in the TSMaster software, and in response to this system variable creation operation, the system variable window is displayed to the user. At this time, the variable name dialog box is popped up by the user right-clicking on the blank interface in the popped-up system variable window and touching the option of creating a user variable. The user can input the created system variable name, such as "Prj_Start_Type", in the variable name dialog box, and then touch the OK button to obtain the created system variable values.
[0101] Further, the panel addition instruction is automatically generated by the user through the way of touching Simulation -> Panel -> Add Panel in the TSMaster software, and in response to this panel addition instruction, the panel window is displayed to the user. At this time, the user selects the GUI button under the right toolbar category in the popped-up panel window and drags it to the left panel window, and then further touches the GUI button in the panel window. After selecting the ValueTable option in the property pop-up window popped up on the right, the identification configuration pop-up window is popped up, and the identification configuration of all ECU test projects is performed in this identification configuration pop-up window; thus, the project identification configuration of all ECU test projects is completed to obtain the project identification configuration result.
[0102] Exemplarily, for two ECU test projects, Prj1 and Prj2, enter "Prj1 = 0" in the first line and "Prj2 = 1" in the second line of the pop-up identification configuration window. The identification can be any integer value, which is defined as 0 and 1 in this example. Then click the "ok" button below to indicate that the project identification configuration is successful.
[0103] Further, create a new C small program library to manage project startup, and create a second C small program library file named "Start_Prj" according to the principle of creating the first C small program library file described above and the pre-written project startup management code. The difference is that there is no need to add CAN pre-transmission events during the creation of the second C small program library file, and the added code is the project startup management code; thus, the second C small program library file is created.
[0104] Exemplarily, the project startup management code can be the following C language code:
[0105] s32 Prj_Type;
[0106] app.get_system_var_int32("Prj_Start_Type", &Prj_Type);
[0107] if (0 == Prj_Type)
[0108] {
[0109] app.set_system_var_int32("MPLib.Prj1", 1);
[0110] }
[0111] else
[0112] {
[0113] app.set_system_var_int32("MPLib.Prj2", 1);
[0114] }
[0115] It should be noted that first, obtain the system variable value created for the current ECU test project (such as the app.get_system_var_int32 function), and then start different C small program library files according to the system variable value (such as the structure variable MPlib, which the user can view in the internal variable window of the system variable window); then trigger the program startup event in the corresponding C small program library file to automatically configure the to-be-simulated message and CAN pre-transmission event.
[0116] After the code is written, the user touches the compilation button (such as the "F9" button).
[0117] Then touch the compilation button (such as the "F9" button) again to start compilation. Wait for the compilation to succeed. In the case of successful compilation, touch the user-design -> applet library to pop up the project switching interface. At this time, the second C applet file named "Start_Prj.mp" that has been created is displayed in the project switching interface. Further, right-click on the switch auto-start button with the mouse to complete the creation operation of the GUI application panel.
[0118] Through the ECU automated test method based on the TSMaster software provided by the present invention, the technical problem of long pre-environment configuration time is solved. And the testers do not need to deeply understand the interaction logic of each function, and can complete the configuration of the pre-project test environment, further reducing the requirements for the testers' various capabilities; in addition, the GUI application panel created by the present invention, as an artificial interaction interface, can realize the function of quickly switching the simulation environment, solve the problem that only one project can be tested in one project, facilitate the switching and testing of multiple projects, and improve the efficiency of automated testing; that is, the project DBC files of multiple ECU test projects can be added to the TSMaster software at the same time. According to the selection of the GUI application panel and without reopening the software, the ECU test project can be flexibly and quickly switched, solving the difficulties in daily agile development and the simultaneous testing of multiple projects in one day; thus, for agile development, the project test efficiency is increased by more than 30%. Not only for testers, but also for other developers, they can complete the project switching test through simple configuration.
[0119] Next, the ECU automated test device based on the TSMaster software provided by the present invention will be described. The ECU automated test device based on the TSMaster software described below can be correspondingly referred to the ECU automated test method based on the TSMaster software described above.
[0120] Refer to Figure 2 , which is a schematic structural diagram of the ECU automated test device based on the TSMaster software provided by an embodiment of the present invention. As Figure 2 shown, the ECU automated test device 200 based on the TSMaster software includes: a project determination module 210, a project start module 220, and a project test module 230.
[0121] The project determination module 210 is configured to determine a first ECU test project specified by a user operation in a GUI application panel pre-created in the TSMaster software in response to the user operation.
[0122] The project startup module 220 is used to trigger the waiting-for-startup-completion operation of the first ECU test project in response to the first project startup instruction.
[0123] The project testing module 230 is used to execute the test cases of the first ECU test project by using the GUI application panel based on the startup completion result; the startup completion result indicates that the automatic configuration of the environment and messages for the first ECU test project has been completed in the GUI application panel.
[0124] Optionally, the ECU automatic testing device based on the TSMaster software provided by the present invention further includes a project switching module, which is used to stop running the TSMaster software based on the project switching requirement, and determine the second ECU test project specified by the project switching requirement in the GUI application panel; run the TSMaster software, and in response to the second project startup instruction, switch the first ECU test project to the second ECU test project.
[0125] Optionally, the ECU automatic testing device based on the TSMaster software provided by the present invention further includes a panel creation module, which is used to import the project DBC files of all ECU test projects into the TSMaster software respectively, and perform CAN channel configuration for all imported ECU test projects; determine the C code project of the messages to be simulated of the controllers to be tested in each DBC file based on the CAN channel configuration result; create a small program library file based on each C code project to obtain the first C small program library file of each ECU test project; create a GUI panel based on the system variable values of each first C small program library file and the second C small program library file for project startup management to obtain the GUI application panel.
[0126] Optionally, the panel creation module 320 is further specifically used to determine the number of hardware channels matching all ECU test projects in the channel selection interface in response to the channel selection operation, and perform CAN channel configuration based on the hardware channel data.
[0127] Optionally, the panel creation module 320 is further specifically used to determine all the activated ECU test projects in the CAN remaining bus simulation interface of the TSMaster software in response to the project activation operation; each activated ECU test project indicates that the corresponding ECU test project has been activated; for each activated ECU test project, determine the messages to be simulated of the controllers to be tested in the message selection pop-up window of the activated ECU test project, and generate the C code project of the messages to be simulated based on the project DBC file of the activated ECU test project.
[0128] Optionally, the panel creation module 320 is further configured to, in response to the code editor addition operation, determine the initial applet library of each ECU test item in the code editor addition interface of the TSMaster software; in response to the program startup event addition operation, determine the to-be-received message of each ECU test item in the code editor addition interface; based on the message determination result, add the C code project corresponding to each ECU test item to the code editor addition interface to obtain the first C applet library file of each ECU test item.
[0129] Optionally, the panel creation module 320 is further configured to, in the case where each first C applet library file has been generated, in response to the system variable creation operation, determine the created system variable values in the system variable window of the TSMaster software; in response to the panel addition instruction, add the GUI buttons of the TSMaster software to the panel window and perform project identification configuration for each ECU test item in the panel window; based on the pre-written project startup management code, create a second C applet library file in the panel window; based on the project identification configuration result, perform code writing and compilation operations for each of the first C applet library file and the second C applet library file in the panel window; based on the completion result of the compilation operation and the touch operation received by the switch auto-start button in the panel window, complete the creation operation of the GUI application panel.
[0130] Figure 3 An example of the physical structure diagram of an electronic device is shown as Figure 3 As shown, the electronic device may include: a processor 310, a communications interface 320, a memory 330, and a communication bus 340. Among them, the processor 310, the communications interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logical instructions in the memory 330 to execute the ECU automation test method based on the TSMaster software. The method includes: in response to a user operation, determining a first ECU test item specified by the user operation in the GUI application panel pre-created in the TSMaster software; in response to a first project startup instruction, triggering the waiting-for-startup completion operation of the first ECU test item; based on the startup completion result, executing the test cases of the first ECU test item by using the GUI application panel; the startup completion result indicates that the automatic configuration of the environment and messages for the first ECU test item has been completed in the GUI application panel.
[0131] In addition, when the logical instructions in the above-mentioned memory 330 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs, Read-Only Memories), random access memories (RAMs, Random Access Memories), magnetic disks, or optical discs that can store program codes.
[0132] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the ECU automation test method based on the TSMaster software provided by the above-mentioned various methods. The method includes: in response to a user operation, determining a first ECU test item specified by the user operation in a GUI application panel pre-created in the TSMaster software; in response to a first item start instruction, triggering a waiting-for-start-completion operation for the first ECU test item; based on the start completion result, using the GUI application panel to execute the test cases of the first ECU test item; the start completion result indicates that the automated configuration of the environment and messages for the first ECU test item has been completed in the GUI application panel.
[0133] In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the ECU automation test method based on the TSMaster software provided by the above-mentioned various methods. The method includes: in response to a user operation, determining a first ECU test item specified by the user operation in a GUI application panel pre-created in the TSMaster software; in response to a first item start instruction, triggering a waiting-for-start-completion operation for the first ECU test item; based on the start completion result, using the GUI application panel to execute the test cases of the first ECU test item; the start completion result indicates that the automated configuration of the environment and messages for the first ECU test item has been completed in the GUI application panel.
[0134] The device embodiments described above are merely illustrative. 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 to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0135] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing 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.
[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or equivalently replace some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An ECU automated testing method based on TSMaster software, characterized in that: include: In response to a user operation, determining a first ECU test item specified by the user operation in a GUI application panel pre-created in the TSMaster software; In response to the first item start instruction, triggering the waiting start completion operation of the first ECU test item; Based on the startup completion result, the test case of the first ECU test item is executed using the GUI application panel; the startup completion result indicates that the automatic configuration of the environment and messages for the first ECU test item is completed in the GUI application panel.
2. The ECU automated testing method based on TSMaster software according to claim 1, characterized in that: The method further comprises: Based on the project switching requirement, stop running the TSMaster software, and determine the second ECU test item specified by the project switching requirement in the GUI application panel; The TSMaster software is run, and in response to a second project start instruction, the first ECU test project is switched to the second ECU test project.
3. The ECU automated testing method based on TSMaster software according to claim 1 or 2, characterized in that: The creation process of the GUI application panel includes: Import the project DBC files of all ECU test items into the TSMaster software, and configure the CAN channels for all the imported ECU test items; Based on the CAN channel configuration result, determine the C code project of the message to be simulated of the controller to be tested in each of the DBC files; Create a small program library file based on each of the C code projects to obtain a first C small program library file for each of the ECU test projects; A GUI panel is created based on the system variable values of each of the first C applet library files and a second C applet library file library used for project startup management to obtain the GUI application panel.
4. The ECU automated testing method based on TSMaster software according to claim 3 is characterized in that: The CAN channel configuration for all the imported ECU test items includes: In response to the channel selection operation, the number of hardware channels matching the all ECU test items is determined in the channel selection interface, and the CAN channel configuration is performed based on the hardware channel data.
5. The ECU automated testing method based on TSMaster software according to claim 3 is characterized in that: The C code engineering of the message to be simulated of the controller to be tested in each of the DBC files is determined based on the CAN channel configuration result, including: In response to the project activation operation, all activated ECU test items are determined in the CAN remaining bus simulation interface of the TSMaster software; each of the activated ECU test items indicates that the corresponding ECU test item has been activated; For each activated ECU test item, the message to be simulated of the controller to be tested is determined in the message selection pop-up window of the activated ECU test item, and the C code project of the message to be simulated is generated based on the project DBC file of the activated ECU test item.
6. The ECU automated testing method based on TSMaster software according to claim 3 is characterized in that: The small program library file is created based on each of the C code projects to obtain the first C small program library file of each of the ECU test items, including: In response to a code editor adding operation, determining an initial applet library for each of the ECU test items in a code editor adding interface of the TSMaster software; In response to a program start event adding operation, determining a message to be received for each of the ECU test items in the code editor adding interface; Based on the message determination result, the C code project corresponding to each of the ECU test items is added to the code editor adding interface to obtain the first C applet library file of each of the ECU test items.
7. The ECU automated testing method based on TSMaster software according to claim 3 is characterized in that: The step of creating a GUI application panel based on the system variable values of the respective first C applet library files and the second C applet library file library for project startup management to obtain the GUI application panel includes: In the case where each of the first C applet library files has been generated, in response to a system variable creation operation, determining the values of each of the created system variables in the system variable window of the TSMaster software; In response to the panel adding instruction, a GUI button of the TSMaster software is added to the panel window, and a project identification configuration is performed for each of the ECU test items in the panel window; Based on the pre-written project startup management code, creating the second C applet library file in the panel window; Based on the project identification configuration result, executing code writing and compiling operations for each of the first C applet library file and the second C applet library file in the panel window; Based on the result of the compilation operation and the touch operation received by the switch automatic start button in the panel window, the creation operation of the GUI application panel is completed.
8. An ECU automated testing device based on TSMaster software, characterized in that: include: An item determination module, for determining, in response to a user operation, a first ECU test item specified by the user operation in a GUI application panel pre-created in the TSMaster software; A project start module, configured to trigger a wait-for-start completion operation of the first ECU test project in response to a first project start instruction; The project test module is used to execute the test case of the first ECU test project using the GUI application panel based on the startup completion result; the startup completion result indicates that the automatic configuration of the environment and message for the first ECU test project has been completed in the GUI application panel.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the ECU automated testing method based on TSMaster software as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the ECU automated testing method based on TSMaster software as described in any one of claims 1 to 7 is implemented.