Controller test method, system and device and electronic equipment
By obtaining the test files and software packages of the target controller in the test software library, establishing real-time interactive connection with the host computer, automatically flashing and executing the test process, the problem of low testing efficiency in the existing technology is solved, and the implementation of the implementation of The efficient automated testing of the controller meets the needs of rapid iterative development.
Patent Information
- Application Number
- CN202411258124.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-13
AI Technical Summary
There is a lot of human intervention and manual operation in the existing intelligent driving simulation testing technology, resulting in low testing efficiency and cannot meet the requirements of rapid iterative development for testing timeliness.
By obtaining the test files and software packages of the target controller in the test software library, establishing real-time interactive connections with the host computer, automatically writing the software and executing the test process, realizing the automation of automatically triggering the complete test process after the software is released. Test method.
It realizes the software and hardware linkage of the test process, improves the testing efficiency and accuracy of the controller, meets the testing needs of rapid iteration of the controller's software and hardware, reduces manual intervention, and realizes full-link automated testing.
Smart Images

Figure CN119126759A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of controller testing technology, and in particular to a controller testing method, system, device and electronic equipment. Background Art
[0002] With the continuous development of intelligent connected vehicle technology, autonomous driving simulation testing has gradually become an indispensable part of the development process of autonomous driving vehicles. In the process of rapid iterative development, autonomous driving simulation testing needs to shorten the iterative testing process to promote cost reduction and efficiency improvement.
[0003] Existing intelligent driving simulation test technology has gradually realized stand-alone automated testing, but there is still a lot of human intervention and manual operation in the test process, and the test efficiency is still low, which cannot meet the requirements of rapid iterative development for test timeliness. Therefore, it is urgent to invent an automated testing method that automatically triggers the complete test process after the software is released, speeds up the response speed, and comprehensively improves the test efficiency. Summary of the invention
[0004] In view of this, in order to solve some or all of the above-mentioned technical problems, the embodiments of the present application provide a controller testing method, system, device and electronic device.
[0005] In the first aspect, an embodiment of the present application provides a controller testing method applied to a test server, the method comprising: obtaining a test file corresponding to a host computer on a target test bench from a preset test software library, and obtaining a software package under test; sending the test file and the software package under test to the host computer; establishing a real-time interactive connection with the host computer; sending a software flashing instruction to the host computer so that the host computer flashes the software package under test into the target controller; sending a test instruction to the host computer so that the test software on the host computer loads the test file and executes the test process; in response to the completion of the test of the target controller, receiving the test result sent by the host computer.
[0006] In one possible implementation, obtaining the software package under test includes: obtaining version information of the software package under test from a test software repository; if the version information is release version information, obtaining a complete software package from the test software repository based on the release version information; if the version information is build version information, obtaining a sub-software package from the test software repository based on the build version information.
[0007] In a possible implementation, establishing a real-time interactive connection with a host computer includes: establishing a real-time interactive connection with the host computer through a communication interface included in a service program provided on the host computer.
[0008] In one possible implementation, a test file corresponding to a host computer on a target test bench is obtained from a preset test software library, including: obtaining a test engineering file from the test software library, and obtaining a correspondence table representing the relationship between a test script file and the host computer; based on the correspondence table, determining a test script file corresponding to the host computer on the target test bench; and determining the test engineering file and the test script file as test files.
[0009] In the second aspect, an embodiment of the present application provides a controller testing method applied to a host computer, the method comprising: receiving a test file and a software package under test sent by a test server; determining whether the current test environment is normal; if normal, based on a software flash instruction received from the test server, flashing the software package under test into a target controller; in response to receiving a test instruction sent by the test server, running the test software, loading the test file, and executing the test process; in response to the completion of the test of the target controller, generating a test result, and sending the test result to the test server.
[0010] In one possible implementation, determining whether the current test environment is normal includes: detecting the data link and hardware port mapping relationship between the host computer and the target controller by running a preset environment detection project file and an environment detection script file; if the obtained detection result indicates that the data link and hardware port mapping relationship are normal, determining that the current test environment is normal.
[0011] In one possible implementation, based on a software flash instruction received from a test server, the software package under test is flashed into a target controller, including: in response to receiving the software flash instruction, determining whether the version of the software package under test is the same as the version of an existing software package on the target controller; if they are not the same, flashing the software package under test into the target controller.
[0012] In one possible implementation, after generating test results in response to the completion of the test on the target controller, the method further includes: determining the items that failed the test from the test results; generating problem description information based on the items that failed the test, and sending the problem description information to the corresponding tester terminal.
[0013] In a third aspect, an embodiment of the present application provides a controller testing system, which includes: a test software library, a test server and a test bench, the test bench including a host computer and a controller to be tested; the test server is used to execute the controller testing method applied to the test server in the above-mentioned first aspect; the host computer is used to execute the controller testing method applied to the host computer in the above-mentioned second aspect.
[0014] In a fourth aspect, an embodiment of the present application provides a controller testing device applied to a test server, the device comprising: an acquisition module, used to acquire the test file corresponding to the host computer on the target test bench from a preset test software library, and acquire the software package under test; a first sending module, used to send the test file and the software package under test to the host computer; a connection module, used to establish a real-time interactive connection with the host computer; a second sending module, used to send a software flashing instruction to the host computer so that the host computer flashes the software package under test into the target controller; a third sending module, used to send a test instruction to the host computer so that the test software on the host computer loads the test file and executes the test process; a first receiving module, used to receive the test result sent by the host computer in response to the completion of the test of the target controller.
[0015] In a fifth aspect, an embodiment of the present application provides a controller testing device applied to a host computer, the device comprising: a second receiving module, used to receive a test file and a software package under test sent by a test server; a first determination module, used to determine whether the current test environment is normal; a flashing module, used to flash the software package under test into a target controller based on a software flashing instruction received from the test server if normal; a testing module, used to run the test software, load the test file, and execute the test process in response to receiving a test instruction sent by the test server; a first generating module, used to generate a test result in response to the completion of the test on the target controller, and send the test result to the test server.
[0016] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory, and when the computer program is executed, it implements the method of any embodiment of the controller testing method applied to the test server of the above-mentioned first aspect of the present application, or the method of any embodiment of the controller testing method applied to the host computer of the above-mentioned second aspect.
[0017] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method of any embodiment of the controller testing method applied to the test server of the first aspect above is implemented, or the method of any embodiment of the controller testing method applied to the host computer of the second aspect above is implemented.
[0018] In an eighth aspect, an embodiment of the present application provides a computer program, which includes a computer-readable code. When the computer-readable code runs on a device, the processor in the device implements a method such as any embodiment of the controller testing method applied to a test server in the first aspect above, or any embodiment of the controller testing method applied to a host computer in the second aspect above.
[0019] The controller testing method, system, device and electronic device provided in the embodiments of the present application, by setting test files and tested software packages in the test software library, the test server obtains the test files and tested software packages corresponding to the target controller to be tested, the test server automatically controls the host computer, flashes the software and executes the test process for the target controller, and finally obtains the test results, thereby solving the problem of low testing efficiency caused by the prior art that it is impossible to quickly carry out iterative testing after the software is released, and manual checking of software versions, manual flashing of programs, manual addition of test scripts, manual summary and generation of test reports and other operations are required, and the software and hardware linkage of the testing process is realized. Compared with the prior art limited to stand-alone automated testing methods, the embodiments of the present application realize full-link automation of the testing process, greatly improves the testing efficiency and accuracy of the controller, and meets the testing requirements of rapid iteration of controller software and hardware. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0022] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0023] Figure 1 A flowchart of a controller testing method applied to a testing server provided in an embodiment of the present application;
[0024] Figure 2 A flowchart of another controller testing method applied to a testing server provided in an embodiment of the present application;
[0025] Figure 3 A flowchart of another controller testing method applied to a testing server provided in an embodiment of the present application;
[0026] Figure 4 A flowchart of a controller testing method applied to a host computer provided in an embodiment of the present application;
[0027] Figure 5A flowchart of another controller testing method applied to a host computer provided in an embodiment of the present application;
[0028] Figure 6 A flowchart of another controller testing method applied to a host computer provided in an embodiment of the present application;
[0029] Figure 7 A schematic diagram of the structure of a controller testing system provided in an embodiment of the present application;
[0030] Figure 8 A schematic diagram of the structure of a test bench provided in an embodiment of the present application;
[0031] Fig. 9 A schematic diagram of the execution flow of the controller testing system provided in an embodiment of the present application;
[0032] Fig.10 A schematic diagram of the structure of a controller testing device applied to a testing server provided in an embodiment of the present application;
[0033] Fig.11 A schematic diagram of the structure of a controller testing device applied to a host computer provided in an embodiment of the present application;
[0034] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, the numerical expressions and the numerical values described in these embodiments do not limit the scope of the present application.
[0036] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present application are only used to distinguish between different steps, devices, modules and other objects, and do not represent any specific technical meanings, nor do they indicate the logical order between them.
[0037] It should also be understood that in this embodiment, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.
[0038] It should also be understood that any component, data or structure mentioned in the embodiments of the present application can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0039] In addition, the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0040] It should also be understood that the description of the various embodiments in this application focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0041] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.
[0042] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods, and equipment should be considered as part of the specification.
[0043] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0044] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. To facilitate the understanding of the embodiments of the present application, the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0045] In order to solve the technical problems of insufficient automation and low efficiency in controller testing in the prior art, the present application provides a controller testing method applied to a test server, a controller testing method applied to a host computer, and a controller testing system, which can improve the efficiency of controller testing.
[0046] Figure 1A flow chart of a controller testing method applied to a test server provided in an embodiment of the present application. This method can be applied to a test server, which can be an electronic device that interacts with a host computer on a test bench. The electronic device can be a server or a terminal device such as a desktop computer or a laptop computer. Optionally, the test server can execute a CICD test process to implement a test method for continuous integration (CI), continuous delivery (CD) and continuous deployment (Continuous Deployment) of the controller's software.
[0047] In addition, the execution subject of the present method may be hardware or software. When the execution subject is hardware, the execution subject may be one or more of the electronic devices. For example, a single electronic device may execute the present method, or a plurality of electronic devices may cooperate with each other to execute the present method. When the execution subject is software, the present method may be implemented as a plurality of software or software modules, or as a single software or software module. No specific limitation is made herein.
[0048] like Figure 1 As shown, the method specifically includes:
[0049] Step 101, obtaining the test file corresponding to the host computer on the target test bench from the preset test software library, and obtaining the software package under test.
[0050] In this embodiment, the test software library is used to store software packages and test files used when testing the target controller. As an example, the test software library can be a GIT (Distributed Version Control System) library. After the test server starts the test task (such as a CICD task), it directly obtains the test files and the software package under test from the test software library. The test file is the file required to execute the test process on the target controller. Optionally, the test file may include test project files, test scripts and other files. The software package under test is the software package to be flashed into the target controller.
[0051] Typically, a table representing the corresponding relationship between the software packages under test and the test bench may be provided in the test software library, and the test server may obtain the table and determine the test files and the software packages under test corresponding to the host computer according to the table.
[0052] Optionally, the test server can trigger the test task immediately through manual operation of the tester, or set a scheduled triggering of the test task. Immediate triggering is usually suitable for normal release scenarios, and can quickly start the test. Scheduled triggering is suitable for late release scenarios, and can make full use of nighttime testing.
[0053] Step 102: Send the test file and the tested software package to the host computer.
[0054] In this embodiment, the test server can download the test files and the tested software package from the test software library according to the test project version information, and send the test files and the tested software package to the host computer on the target test bench.
[0055] Step 103, establishing a real-time interactive connection with the host computer.
[0056] In this embodiment, an application program that interacts with the test server in real time can be run on the host computer. Through this application program, the host computer can receive instructions sent by the test server in real time and send various data to the test server. As an example, an http server service program can be set on the host computer, and the service program provides multiple communication interfaces, which can transmit various information between the host computer and the test server.
[0057] Step 104 , sending a software flashing instruction to the host computer, so that the host computer flashes the tested software package into the target controller.
[0058] In this embodiment, the test server can control the host computer to execute the operation of flashing the tested software package to the target controller by sending a software flashing instruction to the host computer. After receiving the software flashing instruction, the host computer can execute a preset flashing program.
[0059] The target controller may be various types of controllers on various devices, for example, an automatic driving controller on a vehicle.
[0060] Step 105 , sending a test instruction to the host computer so that the test software on the host computer loads the test file and executes the test process.
[0061] In this embodiment, after the software is flashed to the target controller, the test server can send a test instruction to the host computer. The host computer is pre-installed with test software. When the test software is started, the test file can be automatically loaded and the test process can be executed.
[0062] Step 106, in response to the completion of the test on the target controller, receiving the test result sent by the host computer.
[0063] In this embodiment, the host computer can generate test results after the test is completed, and send the test results to the test server. The test server can feed back the test results to the tester for viewing.
[0064] The controller testing method applied to the test server provided in the embodiment of the present application sets the test file and the software package to be tested in the test software library, and the test server obtains the test file and the software package to be tested corresponding to the target controller to be tested, and the test server automatically controls the host computer to flash the software and execute the test process for the target controller, and finally obtains the test result, thereby solving the problem of low testing efficiency caused by the prior art that it is impossible to quickly carry out iterative testing after the software is released, and manual checking of software versions, manual flashing of programs, manual addition of test scripts, manual summary and generation of test reports and other operations are required, and realizes the linkage of software and hardware in the testing process. Compared with the prior art automated testing method limited to a single machine version, the embodiment of the present application realizes full-link automation of the testing process, greatly improves the testing efficiency and accuracy of the controller, and meets the testing requirements for rapid iteration of controller software and hardware.
[0065] In some optional implementations of this embodiment, such as Figure 2 As shown, step 101 includes:
[0066] Step 1011, obtaining version information of the tested software package from the test software library.
[0067] The version information includes release version information and build version information. After the software build version passes the integration test, it will be updated to the release version. The release version is relatively more stable, and both the release version and the build version have testing requirements.
[0068] Step 1012: If the version information is release version information, obtain the complete software package from the test software library based on the release version information.
[0069] Specifically, the test software library can maintain release version information. The release version information usually contains a complete version number, which is a major version number. When the release version information maintained by the test software library is not empty, the test task run by the test server can directly match and download the corresponding complete software package by releasing the version information to the version management system in the test software library.
[0070] Step 1013: If the version information is build version information, obtain the sub-software package from the test software library based on the build version information.
[0071] Specifically, the software build version consists of multiple sub-versions, and each sub-version information can be maintained in the test software library. When the version information is the build version information, the test task running on the test server can match and download each sub-version software package according to the build version information to the version management system.
[0072] This embodiment stores the release version information and the build version information in the test software library, thereby realizing flexible configuration of the software version through the test software library, meeting the testing requirements of various versions of software, and improving the testing flexibility and versatility.
[0073] In some optional implementations of this embodiment, the above step 103 may be performed as follows:
[0074] A real-time interactive connection with the host computer is established through a communication interface included in the service program arranged on the host computer.
[0075] The service program may be an http server service program, which provides an http interface for the test task of the test server to call, so as to realize the interaction between the host computer on the test bench and the test server.
[0076] Optionally, the http interfaces provided by the http server service program include: / startCheck, which is used for status check of the host computer, checking the software and hardware mapping configuration of the host computer and the target controller, whether the data link is normal, loading a simple test script, and checking whether the script addition and execution is normal; / getCheckResult, which is used to obtain the status check result of the host computer; / stopCheck, which is used to end the status check of the host computer; / startTest, which is used to start the test project contained in the above test file, and load the test script contained in the test file for testing; / getTestProcess, which is used for test progress feedback. For example, if 400 test scripts are loaded and 200 are actually run, the test progress will be fed back as 200 / 400; / stopTest is used to stop the test project.
[0077] During the test, the http server service program will synchronize the test status, test progress, test results, etc. to the test server through the http interface, so that the tester can view the progress of the test task.
[0078] In this embodiment, by setting a service program on the host computer, the test server uses the communication interface included in the service program to interact with the host computer, thereby realizing more efficient real-time interaction between the host computer and the target controller remotely.
[0079] In some optional implementations of this embodiment, such as Figure 3 As shown, step 101 includes:
[0080] Step 1014, obtaining a test project file from the test software library, and obtaining a corresponding relationship table representing the relationship between the test script file and the host computer.
[0081] Among them, the test engineering file is a file configured for the test environment required to execute the test process on the host computer. In actual testing, there are a large number of test script files, and multiple sets of test benches need to be built. In order to flexibly respond to this demand, this embodiment sets a correspondence table in the test software library, and the test server can use the correspondence table to manage the script files required for each test bench. The test tasks executed on the test server can automatically download the corresponding test script files according to the script version information in the correspondence table, which is used to subsequently send the test script to the specified host computer.
[0082] Step 1015: Determine the test script file corresponding to the host computer on the target test bench based on the correspondence table.
[0083] Specifically, the target test bench may have a corresponding number, and according to the number, the test server may determine the corresponding test script file.
[0084] Step 1016: determine the test project file and the test script file as test files.
[0085] In this embodiment, by setting a correspondence table in the test software library, the test server can quickly obtain the test script required by the host computer on the target test bench according to the correspondence table, thereby improving the test efficiency of the controller.
[0086] Figure 4 A flow chart of a controller testing method applied to a host computer provided in an embodiment of the present application. This method can be applied to a host computer, which can be an electronic device for executing a test process, for example, the electronic device can be a desktop computer, a laptop computer, or various types of electronic devices. The electronic device can be a server, or a terminal device such as a desktop computer or a laptop computer. The host computer can be connected to the target controller via a wiring harness, or via a wireless communication device. The host computer can also be connected to a test server in communication.
[0087] In addition, the execution subject of the present method may be hardware or software. When the execution subject is hardware, the execution subject may be one or more of the electronic devices. For example, a single electronic device may execute the present method, or a plurality of electronic devices may cooperate with each other to execute the present method. When the execution subject is software, the present method may be implemented as a plurality of software or software modules, or as a single software or software module. No specific limitation is made herein.
[0088] like Figure 4 As shown, the method specifically includes:
[0089] Step 401: Receive the test file and the tested software package sent by the test server.
[0090] In this embodiment, the meaning and function of the test file and the tested software package can refer to the above embodiments.
[0091] Step 402, determining whether the current test environment is normal.
[0092] In this embodiment, the test environment includes properties such as the communication link between the host computer and the target controller, the hardware port mapping relationship, etc. The host computer can check whether the test environment meets the conditions required for normal testing by executing the environment test program.
[0093] Step 403: If normal, the software package under test is flashed into the target controller based on the software flashing instruction received from the test server.
[0094] In this embodiment, after receiving the software flashing instruction sent by the test server, the host computer can directly flash the tested software package into the target controller, or flash the tested software package into the target controller after manually confirming the software version of the target controller.
[0095] Step 404, in response to receiving the test instruction sent by the test server, running the test software, loading the test file, and executing the test process.
[0096] In this embodiment, the test software is software installed on the host computer for executing the test process. The test software can load the test project file included in the test file, add the test script file to the test project, and then execute the test process.
[0097] Optionally, the test software may be composed of bus development test software and dynamic scenario simulation software. The bus development test software can read and write message signals collected by the test equipment, support the import of automated scripts, continuously execute and record the details of script data flows, and the dynamic scenario simulation software can realize road environment and traffic scenario simulation.
[0098] Step 405 , in response to the completion of the test on the target controller, a test result is generated and sent to the test server.
[0099] In this embodiment, the test result may include information on whether each item tested is successful, and may also include information such as the test case number, the corresponding tester, etc. The above information may be stored in a file in a TXT format, and a test report may be generated based on the file and sent to the test server.
[0100] As an example, based on the information in the TXT file, the test pass and fail status is automatically written into the test report of each module, and the overall test analysis is summarized. The test report can be directly sent to the relevant parties by email to simultaneously know the completion status of this test.
[0101] The controller testing method applied to the host computer provided in the embodiment of the present application receives the test file and the software package under test through the host computer, automatically flashes the software package under test to the target controller, executes the test process, and sends the test results to the test server at the end of the test, thereby solving the problem of low testing efficiency caused by the prior art that it is impossible to quickly carry out iterative testing after the software is released, and manual inspection of software versions, manual flashing of programs, manual addition of test scripts, manual summary and generation of test reports and other operations are required, thereby realizing the linkage of software and hardware in the testing process. Compared with the prior art automated testing method limited to a single machine version, the embodiment of the present application realizes full-link automation of the testing process, greatly improves the testing efficiency and accuracy of the controller, and meets the testing requirements for rapid iteration of the controller's software and hardware.
[0102] In some optional implementations of this embodiment, such as Figure 5 As shown, step 402 includes:
[0103] Step 4021, by running the preset environment detection project file and environment detection script file, the data link and hardware port mapping relationship between the host computer and the target controller are detected.
[0104] Among them, the environment detection project file and the environment detection script file can be pre-set on the host computer. Before executing the flash operation and the test process, the environment detection project can be run, and the environment detection script can be loaded to automatically execute the environment detection process.
[0105] Step 4022: If the obtained detection result indicates that the mapping relationship between the data link and the hardware port is normal, it is determined that the current test environment is normal.
[0106] Specifically, to detect the mapping relationship between the data link and the hardware port, the running environment detection script can be used to send test data to the data link and the hardware port, and receive data from the data link and the hardware port to determine whether the received data is consistent with the expected data. If consistent, it is determined that the mapping relationship between the data link and the hardware port is normal.
[0107] Optionally, if the test result indicates that the environment test is abnormal, the test task can be exited and the reason for the environment abnormality can be returned to the test server.
[0108] This embodiment realizes automatic environmental detection of the host computer and the target controller by presetting the environmental detection project file and the environmental detection script file, which helps to improve the test efficiency of the controller.
[0109] In some optional implementations of this embodiment, step 403 includes:
[0110] In response to receiving the software flashing instruction, it is determined whether the version of the tested software package is the same as the version of the existing software package on the target controller; if not, the tested software package is flashed into the target controller.
[0111] Specifically, if the version of the tested software package is different from the version of the existing software package, it means that the tested software package has not been flashed on the target controller, and the flashing operation can continue. It should be understood that if the version of the tested software package is the same as the version of the existing software package, the flashing operation can be skipped and the subsequent test steps can be continued.
[0112] Optionally, after the flashing is completed, the updated version can be compared with the software version issued by the test server. If the versions are consistent, the subsequent tasks can be continued. If the versions are inconsistent, it means that the flashing is incorrect, the test task is terminated, and the log of the flashing record is uploaded to the test server.
[0113] This embodiment determines whether the version of the software package under test is the same as the version of the existing software package. If they are not the same, a flash operation is performed to avoid repeatedly flashing the same version of software to the target controller, thereby improving the test efficiency.
[0114] In some optional implementations of this embodiment, such as Figure 6 As shown, after step 405, the method further includes:
[0115] Step 406, determining the items that failed the test from the test results.
[0116] Specifically, after executing each test script, the generated test result may include information on success or failure of each test item, so that the item that failed the test can be determined.
[0117] Step 407: Generate problem description information based on the items that failed the test, and send the problem description information to the corresponding tester terminal.
[0118] Among them, the process of sending problem description information to the tester is the automatic billing operation. The above-mentioned problem description information may include information such as the reason for the test failure and the severity of the problem. The test results may include a GSON (Java class library for mapping between Java objects and JSON data) file recorded during the test process, and the problem description information can be obtained from the GSON file. The correspondence between the test items contained in the problem description information and the tester can be pre-set, and the problem description information is automatically billed to the corresponding tester, so that the tester can confirm and circulate the problem ticket.
[0119] This embodiment automatically generates problem description information and automatically sends the problem description information to the target tester, so that the target tester can automatically receive the problem description information, which helps to make targeted corrections to the test items where problems occur, thereby improving testing efficiency.
[0120] Figure 7 The schematic diagram of the structure of a controller test system provided by the embodiment of the present application is as follows: the system specifically comprises: a test software library 701, a test server 702 and a test bench 703, wherein the test bench 703 comprises a host computer 7031 and a controller 7032 to be tested.
[0121] The test server 702 is used to execute the test method of the controller 7032 applied to the test server 702; the host computer 7031 is used to execute the test method of the controller 7032 applied to the host computer 7031. As an example, the test software library 701 can be a GIT library, and the test server 702 can execute CICD test tasks, that is, the test server 702 can serve as the CICD server of the host computer 7031.
[0122] In this embodiment, the structure of the test bench 703 is as follows: Figure 8 As shown, it includes test equipment, the controller 7032 under test, power supply, connection harness, host computer 7031, etc. The test equipment is divided into CAN communication equipment and Ethernet communication equipment, which are connected to the host computer 7031 through USB, connected to the controller 7032 through a harness, and connected to the power supply through a harness power cord. The CAN communication equipment is used to collect and send CAN messages, and the Ethernet communication equipment is used to collect and send Ethernet messages.
[0123] The software part on the host computer 7031 consists of bus development and testing software and dynamic scene simulation software. The bus development and testing software can read and write message signals collected by the test equipment, support the import of automated scripts for continuous execution and record the details of the script data flow, and the dynamic scene simulation software can realize road environment and traffic scene simulation.
[0124] In this embodiment, the specific steps of the system executing the controller 7032 test process are as follows:
[0125] The test server obtains the test files corresponding to the host computer on the target test bench from the test software library, as well as the software package under test; sends the test files and the software package under test to the host computer; establishes a real-time interactive connection with the host computer; and sends software flashing instructions to the host computer.
[0126] The host computer receives the test file and the tested software package sent by the test server; determines whether the current test environment is normal; if normal, based on the software flashing instruction received from the test server, flashes the tested software package into the target controller.
[0127] The test server sends test instructions to the host computer.
[0128] In response to receiving the test instruction, the host computer runs the test software, loads the test file, and executes the test process; in response to the completion of the test on the target controller, it generates the test result and sends the test result to the test server.
[0129] It should be understood that the test server can execute any embodiment of the controller test method applied to the test server, and correspondingly, the host computer can execute any embodiment of the controller test method applied to the host computer.
[0130] The controller testing system provided in this embodiment, by setting up a test software library, a test server and a test bench, realizes that the test server automatically controls the host computer, flashes the software and executes the test process for the target controller, thereby solving the problem of low testing efficiency caused by the prior art that it is impossible to quickly carry out iterative testing after the software is released, and that manual operations such as checking software versions, manually flashing programs, manually adding test scripts, and manually summarizing and generating test reports are required. It realizes the linkage of software and hardware in the testing process. Compared with the prior art automated testing method limited to a single machine version, the embodiment of the present application realizes full-link automation of the testing process, greatly improves the testing efficiency and accuracy of the controller, and meets the testing requirements for rapid iteration of controller software and hardware.
[0131] Based on the above embodiments, Fig. 9 , which shows a schematic diagram of the execution flow of the controller test system provided in this embodiment. Among them, the CICD task is the test task executed on the test server. The GIT library is the above-mentioned test software library. The specific process is as follows:
[0132] First, the test bench is built, the link is configured and debugged, and the software version information, test project and test script are maintained by the GIT library. After the CICD task is started, the test project and test script are obtained from the GIT library, as well as the version information. The CICD task determines whether the version information is a release version. If so, the complete software package is downloaded according to the release version. If not, the sub-software package is downloaded according to the build version information.
[0133] Then, the CICD task triggers the pipeline task to send the test project, test script and software package to the host computer on the test bench. The CICD task calls the http server service program of the host computer, and calls the local test program of the host computer through the http server service program to control the test bench and realize data link automation.
[0134] Then, the host computer checks the test environment and link, and determines whether the test environment is normal. If not, terminate this CICD task. If normal, flash the software to the controller, and perform version comparison after flashing. If the flashed software version is consistent with the released version, open the test project, load the test script, and execute the test process; if the flashed software version is inconsistent with the released version, terminate this CICD task.
[0135] Finally, the failed items in the test results are automatically submitted to the corresponding testers. The test results are written into the test report, and the test results are analyzed and summarized. The complete test report and test log are uploaded to the CICD task, and the CICD task is updated to completed, ending the process.
[0136] Fig.10 A schematic diagram of the structure of a controller test device applied to a test server provided in an embodiment of the present application. Specifically comprising: an acquisition module 1001, used to acquire the test file corresponding to the host computer on the target test bench from the preset test software library, and to acquire the tested software package; a first sending module 1002, used to send the test file and the tested software package to the host computer; a connection module 1003, used to establish a real-time interactive connection with the host computer; a second sending module 1004, used to send a software flashing instruction to the host computer, so that the host computer flashes the tested software package into the target controller; a third sending module 1005, used to send a test instruction to the host computer, so that the test software on the host computer loads the test file, and executes the test process; a first receiving module 1006, used to receive the test result sent by the host computer in response to the end of the test of the target controller.
[0137] In one possible implementation, the acquisition module includes: a first acquisition unit, used to obtain version information of the software package under test from a test software library; a second acquisition unit, used to obtain a complete software package from the test software library based on the release version information if the version information is release version information; and a third acquisition unit, used to obtain a sub-software package from the test software library based on the build version information if the version information is build version information.
[0138] In a possible implementation manner, the connection module is further used to establish a real-time interactive connection with the host computer through a communication interface included in a service program provided on the host computer.
[0139] In one possible embodiment, the acquisition module includes: a fourth acquisition unit, used to obtain test engineering files from a test software library, and to obtain a correspondence table representing the relationship between test script files and host computers; a first determination unit, used to determine the test script file corresponding to the host computer on the target test bench based on the correspondence table; and a second determination unit, used to determine the test engineering files and test script files as test files.
[0140] The controller testing device provided in this embodiment for testing the server can be as follows: Fig.10 The controller testing device applied to the test server shown in can execute all steps of the above controller testing methods applied to the test server, thereby achieving the technical effects of the above controller testing methods applied to the test server. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.
[0141] Fig.11 A schematic diagram of the structure of a controller test device applied to a host computer provided in an embodiment of the present application. Specifically comprising: a second receiving module 1101, for receiving a test file and a tested software package sent by a test server; a first determining module 1102, for determining whether the current test environment is normal; a flashing module 1103, for flashing the tested software package into a target controller based on a software flashing instruction received from a test server if normal; a testing module 1104, for responding to a test instruction received from a test server, running the test software, loading the test file, and executing the test process; a first generating module 1105, for responding to the completion of the test of the target controller, generating a test result, and sending the test result to the test server.
[0142] In one possible implementation, the determination module includes: a detection unit, used to detect the data link and hardware port mapping relationship between the host computer and the target controller by running a pre-set environment detection project file and an environment detection script file; a third determination unit, used to determine that the current test environment is normal if the detection result obtained indicates that the data link and hardware port mapping relationship are normal.
[0143] In one possible implementation, the flashing module includes: a fourth determination unit, configured to determine whether the version of the software package under test is the same as the version of the existing software package on the target controller in response to receiving a software flashing instruction; and a flashing unit, configured to flash the software package under test into the target controller if they are not the same.
[0144] In one possible implementation, the device further includes: a second determination module, used to determine the items that failed the test from the test results; a second generation module, used to generate problem description information based on the items that failed the test, and send the problem description information to the corresponding tester terminal.
[0145] The controller testing device provided in this embodiment and applied to the host computer can be as follows: Fig.11 The controller testing device applied to the host computer shown in can execute all the steps of the above controller testing methods applied to the host computer, and thus achieve the technical effects of the above controller testing methods applied to the host computer. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.
[0146] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Fig.12 The electronic device 1200 shown includes: at least one processor 1201, a memory 1202, at least one network interface 1204 and other user interfaces 1203. The various components in the electronic device 1200 are coupled together via a bus system 1205. It is understood that the bus system 1205 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 1205 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 1205 is not described in detail. Fig.12 Various buses are labeled as bus system 1205.
[0147] The user interface 1203 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0148] It can be understood that the memory 1202 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memory 1202 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0149] In some embodiments, the memory 1202 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 12021 and an application program 12022 .
[0150] Among them, the operating system 12021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 12022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 12022.
[0151] In this embodiment, by calling the program or instruction stored in the memory 1202, specifically, the program or instruction stored in the application 12022, the processor 1201 is used to execute the method steps provided by each method embodiment, for example, including:
[0152] Obtain the test files corresponding to the host computer on the target test bench from the preset test software library, and obtain the software package under test; send the test files and the software package under test to the host computer; establish a real-time interactive connection with the host computer; send software flashing instructions to the host computer so that the host computer flashes the software package under test into the target controller; send test instructions to the host computer so that the test software on the host computer loads the test files and executes the test process; in response to the completion of the test on the target controller, receive the test results sent by the host computer.
[0153] The method disclosed in the above embodiment of the present application can be applied to the processor 1201, or implemented by the processor 1201. The processor 1201 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1201. The above processor 1201 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1202, and the processor 1201 reads the information in the memory 1202 and completes the steps of the above method in combination with its hardware.
[0154] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the above functions of the present application, or a combination thereof.
[0155] For software implementation, the technology described above in this article can be implemented by a unit that performs the functions described above in this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0156] The electronic device provided in this embodiment may be Fig.12 The electronic device shown in can execute all the steps of the controller testing methods described above, thereby achieving the technical effects of the controller testing methods described above. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.
[0157] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.
[0158] When one or more programs in the storage medium can be executed by one or more processors, the controller testing method executed on the electronic device side can be implemented.
[0159] The processor is used to execute the program stored in the memory to implement the following steps of the controller testing method performed on the electronic device side:
[0160] Obtain the test files corresponding to the host computer on the target test bench from the preset test software library, and obtain the software package under test; send the test files and the software package under test to the host computer; establish a real-time interactive connection with the host computer; send software flashing instructions to the host computer so that the host computer flashes the software package under test into the target controller; send test instructions to the host computer so that the test software on the host computer loads the test files and executes the test process; in response to the completion of the test on the target controller, receive the test results sent by the host computer.
[0161] The professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0162] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0163] It should be understood that the terms used in the text 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 in the text 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.
[0164] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A controller testing method applied to a testing server, characterized in that: The method comprises: Obtain the test files corresponding to the host computer on the target test bench from the preset test software library, and obtain the software package under test; Sending the test file and the tested software package to the host computer; Establishing a real-time interactive connection with the host computer; Sending a software flashing instruction to the host computer so that the host computer flashes the tested software package into the target controller; Sending a test instruction to the host computer so that the test software on the host computer loads the test file and executes the test process; In response to the completion of the test on the target controller, a test result sent by the host computer is received.
2. The method according to claim 1, characterized in that The step of obtaining the tested software package includes: Obtaining version information of the tested software package from the test software library; If the version information is release version information, obtaining a complete software package from the test software library based on the release version information; If the version information is build version information, the sub-software package is obtained from the test software library based on the build version information.
3. The method according to claim 1, characterized in that The establishing of a real-time interactive connection with the host computer comprises: A real-time interactive connection with the host computer is established through a communication interface included in the service program arranged on the host computer.
4. The method according to claim 1, characterized in that: The step of obtaining the test file corresponding to the host computer on the target test bench from the preset test software library includes: Acquire a test engineering file from the test software library, and acquire a corresponding relationship table representing the relationship between the test script file and the host computer; Based on the correspondence table, determining the test script file corresponding to the host computer on the target test bench; The test project file and the test script file are determined as the test files.
5. A controller testing method applied to a host computer, characterized in that: The method comprises: Receive test files and tested software packages sent by the test server; Determine whether the current test environment is normal; If normal, flashing the tested software package into the target controller based on the software flashing instruction received from the test server; In response to receiving the test instruction sent by the test server, running the test software, loading the test file, and executing the test process; In response to the completion of the test on the target controller, a test result is generated and sent to the test server.
6. The method according to claim 5, characterized in that Determining whether the current test environment is normal includes: By running a preset environment detection project file and an environment detection script file, the data link and the hardware port mapping relationship between the host computer and the target controller are detected; If the obtained detection result indicates that the mapping relationship between the data link and the hardware port is normal, it is determined that the current test environment is normal.
7. The method according to claim 5, characterized in that The step of flashing the tested software package into the target controller based on the software flashing instruction received from the test server includes: In response to receiving the software flashing instruction, determining whether the version of the tested software package is the same as the version of the existing software package on the target controller; If they are not the same, the software package under test is flashed into the target controller.
8. The method according to claim 5, characterized in that After generating a test result in response to the test on the target controller being completed, the method further includes: From the test results, determining items that failed the test; Based on the items that failed the test, problem description information is generated, and the problem description information is sent to the corresponding tester terminal.
9. A controller testing system, characterized in that: The system comprises: a test software library, a test server and a test bench, wherein the test bench comprises a host computer and a controller to be tested; The test server is used to execute the controller test method applied to the test server according to any one of claims 1 to 4; The host computer is used to execute the controller testing method applied to the host computer as described in any one of claims 5-8.
10. A controller testing device for testing a server, characterized in that: The device comprises: The acquisition module is used to obtain the test files corresponding to the host computer on the target test bench from the preset test software library, and obtain the software package under test; A first sending module, used for sending the test file and the tested software package to the host computer; A connection module, used to establish a real-time interactive connection with the host computer; A second sending module is used to send a software flashing instruction to the host computer, so that the host computer flashes the tested software package into the target controller; A third sending module is used to send a test instruction to the host computer so that the test software on the host computer loads the test file and executes the test process; The first receiving module is used for receiving the test result sent by the host computer in response to the completion of the test on the target controller.
11. A controller testing device applied to a host computer, characterized in that: The device includes: The second receiving module is used to receive the test file and the tested software package sent by the test server; The first determination module is used to determine whether the current test environment is normal; A flashing module, configured to flash the tested software package into a target controller based on a software flashing instruction received from the test server if normal; A test module, configured to run the test software and load the test file to execute the test process in response to receiving the test instruction sent by the test server; The first generating module is used to generate a test result in response to the completion of the test on the target controller, and send the test result to the test server.
12. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute a computer program stored in the memory, and when the computer program is executed, the controller testing method applied to the test server described in any one of claims 1-4, or the controller testing method applied to the host computer described in any one of claims 5-8 is implemented.
Citation Information
Cited By
Simulation test method, system and equipment and storage medium
CN119829461A
