Automatic testing method, testing system, storage medium and processor
By generating and executing test cases through automatic testing methods, the problems of traditional instrument function testing being time-consuming, labor-intensive and highly subjective are solved, and efficient and accurate automated testing is achieved.
Patent Information
- Application Number
- CN202410236249.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2025-09-09
AI Technical Summary
Traditional instrument functional testing relies on manual operation, which is time-consuming, labor-intensive, and highly subjective, and cannot guarantee the reliability and accuracy of test results.
An automatic testing method is adopted to generate test cases through the test case automatic generation module and execute them on the vehicle mainboard. The status data is monitored in real time, and new test cases are generated to deal with abnormal conditions. The test environment is controlled by combining the power module and bus module, and the display information is collected for result comparison.
It realizes automated testing, shortens testing time, reduces labor costs, and improves testing efficiency and result accuracy.
Smart Images

Figure CN120610883A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated testing technology, and in particular to an automated testing method, a testing system, a storage medium, and a processor. Background Art
[0002] Since the birth of the first car, the automotive industry and technology have entered a period of rapid development. With the development of automobiles, a car has integrated an increasing number of electronic and electrical devices such as sensors and ECUs. However, the truly user-oriented and closely related aspects are the instrument panel and central control, as well as some passenger screens, air conditioning screens, heads-up display, etc., and the most important of these is the instrument panel function. Generally, if the central control panel or other interactive systems freeze or jam, it will not affect the basic use of the car, and the car can still run normally. However, if the instrument panel function fails, the entire car will no longer be able to continue to operate normally or will pose a significant safety risk.
[0003] Therefore, instrument function testing becomes crucial. However, traditional instrument testing relies on manual testing by experienced testers. Consequently, functional testing of instruments in a single project requires multiple manual testers. This not only consumes a significant amount of manpower and time, but also fails to fully test every instrument function. Furthermore, traditional manual testing is highly subjective, and the reliability and accuracy of measurement results cannot be guaranteed. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide an automatic testing method, a testing system, a storage medium, and a processor.
[0005] To achieve the above-mentioned object, the present application provides, in a first aspect, an automatic testing method, which is applied to a test system, wherein the test system includes a test case automatic generation module, wherein the test case automatic generation module includes a data transmission module and a plurality of first data processing modules and a plurality of second data processing modules electrically connected to the data transmission module. The method includes:
[0006] For any first data processing module, control the data transmission module to send test data to the first data processing module, so that the first data processing module generates a corresponding test case according to the test data;
[0007] Controlling all first data processing modules that have generated test cases to send the corresponding test cases to the vehicle mainboard, so that the vehicle mainboard executes the corresponding test cases;
[0008] The control data transmission module receives status data fed back by each first data processing module that generates a test case within a preset interval, wherein the status data includes normal data fed back by the first data processing module in a normal state and abnormal data fed back in an abnormal state;
[0009] In the case where any state data is abnormal data, determining that the first data processing module corresponding to the state data is in an abnormal state;
[0010] Control the data transmission module to send the test data corresponding to the first data processing module in the abnormal state to any second data processing module, so that the second data processing module generates a new test case according to the test data corresponding to the first data processing module in the abnormal state;
[0011] The second data processing module that controls the generation of a new test case sends the new test case to the vehicle mainboard, so that the vehicle mainboard executes the new test case.
[0012] In an embodiment of the present application, the method also includes: after controlling all first data processing modules that have generated test cases to send corresponding test cases to the vehicle mainboard, controlling each first data processing module that has generated a test case to feedback status data to the data transmission module within a preset interval; if any first data processing module that has generated a test case does not feedback status data within the preset interval, sending a prompt message to the data transmission module; controlling the data transmission module to send the test data corresponding to the first data processing module that has not fed back status data to any second data processing module, so that the second data processing module generates a new test case based on the test data corresponding to the first data processing module that has not fed back status data.
[0013] In an embodiment of the present application, the test system also includes multiple power modules and multiple bus modules that are electrically connected to multiple first data processing modules and the vehicle main board respectively, and controls all first data processing modules that have generated test cases to send corresponding test cases to the vehicle main board so that the vehicle main board executes the corresponding test cases, including: for any first data processing module that has generated a test case, controlling the first data processing module to send a first control instruction to the corresponding power module, so that the power module outputs a power parameter of a preset value to the vehicle main board according to the first control instruction; for any first data processing module that has generated a test case, controlling the first data processing module to send a second control instruction to the corresponding bus module, so that the bus module outputs a start signal to the vehicle main board according to the second control instruction; controlling the vehicle main board to execute the test case after receiving the power parameter and the start signal.
[0014] In an embodiment of the present application, the vehicle main board includes a display module, and the method further includes: after executing the test case, obtaining the execution result of the vehicle main board; collecting the display information of the display module within a preset time length, and obtaining each frame icon in the display information; comparing each frame icon with the target icon corresponding to the execution result; when any frame icon is consistent with the target icon, determining that the display function corresponding to the test case in the display module is normal.
[0015] In an embodiment of the present application, the vehicle main board also includes a CAN bus, and the method also includes: after the bus module outputs a start signal to the vehicle main board according to the second control instruction, determining whether there is a start signal on the CAN bus; if there is a start signal on the CAN bus, determining that the vehicle main board successfully receives the start signal.
[0016] In an embodiment of the present application, the test system also includes an adapter module electrically connected to the display module, which collects display information of the display module within a preset time length, and obtains each frame icon in the display information, including: controlling the adapter module to collect display information and converting the display information into data in high-definition video format; obtaining each frame icon in the data in high-definition video format.
[0017] In an embodiment of the present application, the test system further includes an image acquisition module, and acquiring display information of the display module within a preset time period includes: controlling the image acquisition module to acquire display information of the display module within a preset time period.
[0018] A second aspect of the present application provides a processor configured to execute the above-mentioned automatic testing method.
[0019] A third aspect of the present application provides a testing system, the system comprising:
[0020] a test case automatic generation module, the test case automatic generation module including a data transmission module and a plurality of first data processing modules and a plurality of second data processing modules electrically connected to the data transmission module; and
[0021] The above processors.
[0022] A fourth aspect of the present application provides a machine-readable storage medium having instructions stored thereon. When the instructions are executed by a processor, the processor is configured to perform the above-mentioned automatic testing method.
[0023] The above technical solution controls the data transmission module to send test data to any first data processing module, so that the first data processing module generates a corresponding test case based on the test data; controls all first data processing modules that have generated test cases to send the corresponding test cases to the vehicle mainboard, so that the vehicle mainboard executes the corresponding test cases; controls the data transmission module to receive status data fed back by each first data processing module that has generated test cases within a preset time interval, wherein the status data includes normal data fed back when the first data processing module is in a normal state and abnormal data fed back when it is in an abnormal state; if any status data is abnormal data, determines that the first data processing module corresponding to the status data is in an abnormal state; controls the data transmission module to send the test data corresponding to the first data processing module in the abnormal state to any second data processing module, so that the second data processing module generates a new test case based on the test data corresponding to the first data processing module in the abnormal state; and controls the second data processing module that has generated the new test case to send the new test case to the vehicle mainboard, so that the vehicle mainboard executes the new test case. The above technical solution can realize the automated generation and automated testing of test cases, shorten the testing time, improve the testing efficiency, reduce the labor cost, and obtain more accurate test results.
[0024] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following detailed description, they are used to explain the embodiments of the present application but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0026] Figure 1 Schematically shows a first flow chart of the automatic testing method according to an embodiment of the present application;
[0027] Figure 2 A first schematic diagram of an automatic testing method according to an embodiment of the present application is schematically shown;
[0028] Figure 3 A second schematic diagram of the automatic testing method according to an embodiment of the present application is schematically shown;
[0029] Figure 4 A third schematic diagram schematically illustrates a method for automatic testing according to an embodiment of the present application;
[0030] Figure 5 A second flow chart of the automatic testing method according to an embodiment of the present application is schematically shown;
[0031] Figure 6 The internal structure diagram of a computer device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0032] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0033] Figure 1 The first flow chart of the automatic testing method according to the embodiment of the present application is schematically shown. Figure 1 As shown, in one embodiment of the present application, an automatic testing method is provided, which is applied to a test system, wherein the test system includes a test case automatic generation module, wherein the test case automatic generation module includes a data transmission module and multiple first data processing modules and multiple second data processing modules electrically connected to the data transmission module, including the following steps:
[0034] Step 101: for any first data processing module, control the data transmission module to send test data to the first data processing module, so that the first data processing module generates a corresponding test case according to the test data.
[0035] Step 102 : Control all first data processing modules that have generated test cases to send the corresponding test cases to the vehicle mainboard, so that the vehicle mainboard executes the corresponding test cases.
[0036] Step 103, the control data transmission module receives the status data fed back by each first data processing module that generates the test case within a preset interval, wherein the status data includes normal data fed back by the first data processing module in a normal state and abnormal data fed back in an abnormal state.
[0037] Step 104 : When any state data is abnormal data, determine whether the first data processing module corresponding to the state data is in an abnormal state.
[0038] Step 105 , the data transmission module is controlled to send the test data corresponding to the abnormal first data processing module to any second data processing module, so that the second data processing module generates a new test case according to the test data corresponding to the abnormal first data processing module.
[0039] Step 106 : Control the second data processing module that generates the new test case to send the new test case to the vehicle mainboard, so that the vehicle mainboard executes the new test case.
[0040] A test case is a description of a test task for a specific software product, embodying the test plan, method, technique, and strategy. The vehicle mainboard refers to the main control board in the vehicle instrument cluster. The test system may include an automatic test case generation module. The automatic test case generation module may include a data transmission module and multiple first data processing modules and multiple second data processing modules electrically connected to the data transmission module. For any first data processing module, the processor may control the data transmission module to send test data to the first data processing module, causing the first data processing module to generate a corresponding test case based on the test data. The processor may control all first data processing modules that have generated test cases to transfer the corresponding test cases to the vehicle mainboard, causing the vehicle mainboard to execute the corresponding test cases. The processor may control the data transmission module to receive status data fed back by each first data processing module that has generated a test case within a preset time interval. The status data includes normal data fed back by the first data processing module when it is in a normal state and abnormal data fed back when it is in an abnormal state. If any of the status data is abnormal, the processor may determine that the first data processing module corresponding to the status data is in an abnormal state. The processor can control the data transmission module to send the test data corresponding to the first data processing module in the abnormal state to any second data processing module, so that the second data processing module generates a new test case based on the test data corresponding to the first data processing module in the abnormal state. After the second data processing module generates the new test case, the processor can control the second data processing module that generated the new test case to send the new test case to the vehicle mainboard, so that the vehicle mainboard executes the new test case.
[0041] For example, Figure 2As shown, the test system may include a test case automatic generation module. The test case automatic generation module may include a main node corresponding to the data transmission module and multiple sub-nodes corresponding to the first data processing module or the second data processing module. Each sub-node may apply for registration (i.e., electrical connection) to the main node. When the main node acts as an executor that does not perform automated testing. For any sub-node corresponding to the first data processing module, the processor may control the main node to issue a task (i.e., test data) to the sub-node, so that the sub-node generates a corresponding test case based on the issued task. The processor may control all sub-nodes that have generated test cases to issue the corresponding test cases to the vehicle mainboard and hardware devices, so that the vehicle mainboard and hardware devices can execute the corresponding test cases. The processor may control the main node to receive status data fed back by each sub-node that has generated a test case within a preset interval. The status data includes normal data fed back by the sub-node when processing in a normal state and abnormal data fed back when processing in an abnormal state. When any status data is abnormal data, the processor may determine that the sub-node corresponding to the status data is in an abnormal state. The processor can control the main node to send the test data corresponding to the sub-node in an abnormal state to the sub-node corresponding to any second data processing module, so that the sub-node generates a new test case based on the test data corresponding to the sub-node in the abnormal state. The processor can control the sub-node that generates the new test case to send the new test case to the vehicle main board and hardware equipment, so that the vehicle main board and hardware equipment execute the new test case. In the case where the main node serves as an executor for performing automated testing, the processor can control the main node to generate corresponding test cases based on its own test data while sending test data to the sub-node, and send the generated test cases to the vehicle main board and hardware equipment, so that the vehicle main board and hardware equipment execute the corresponding test cases.
[0042] In one embodiment, the method also includes: after controlling all first data processing modules that have generated test cases to send corresponding test cases to the vehicle mainboard, controlling each first data processing module that has generated a test case to feedback status data to the data transmission module within a preset interval; when any first data processing module that has generated a test case does not feedback status data within the preset interval, sending a prompt message to the data transmission module; controlling the data transmission module to send the test data corresponding to the first data processing module that has not fed back status data to any second data processing module, so that the second data processing module generates a new test case based on the test data corresponding to the first data processing module that has not fed back status data.
[0043] After controlling all first data processing modules that have generated test cases to send the corresponding test cases to the vehicle mainboard, the processor can control each first data processing module that has generated a test case to feedback status data to the data transmission module within a preset interval. In the event that any first data processing module that has generated a test case does not feedback status data within the preset interval, the processor can send a prompt message to the data transmission module. After sending the prompt message, the processor can control the data transmission module to send the test data corresponding to the first data processing module that did not feedback status data to any second data processing module, so that the second data processing module generates a new test case based on the test data corresponding to the first data processing module that did not feedback status data.
[0044] For example, Figure 2 As shown, the test system may include a test case automatic generation module. The test case automatic generation module may include a main node corresponding to the data transmission module and multiple sub-nodes corresponding to the first data processing module or the second data processing module. Each sub-node may apply to the main node for registration (i.e., electrically connected). For any sub-node corresponding to the first data processing module, the processor may control the main node to send tasks (i.e., test data) to the sub-nodes, so that the sub-nodes generate corresponding test cases according to the tasks sent. The processor may control all sub-nodes that have generated test cases to send the corresponding test cases to the vehicle main board and hardware devices, so that the vehicle main board and hardware devices can execute the corresponding test cases.
[0045] After controlling all subnodes that have generated test cases to send the corresponding test cases to the vehicle mainboard and hardware, the processor can control each subnode that has generated a test case to feedback status data within a preset interval. If any subnode that has generated a test case fails to feedback status data within the preset interval, the processor can send a prompt message to the master node. The failure of a subnode that has generated a test case to feedback status data within the preset time period may be caused by unstable feedback lines, resulting in loss of status data; or it may be caused by an internal fault in the subnode, resulting in feedback status data exceeding the preset interval.
[0046] The processor can control the master node to send test data corresponding to subnodes that have not fed back status data to any subnode corresponding to the second data processing module, so that the subnode generates a new test case based on the test data corresponding to the subnode in the abnormal state. After the subnode generates the new test case, the processor can control the subnode that generated the new test case to send the new test case to the vehicle mainboard and hardware devices, so that the vehicle mainboard and hardware devices execute the new test case.
[0047] In one embodiment, the test system also includes multiple power modules and multiple bus modules that are electrically connected to multiple first data processing modules and the vehicle main board respectively, and controls all first data processing modules that have generated test cases to send corresponding test cases to the vehicle main board so that the vehicle main board executes the corresponding test cases, including: for any first data processing module that has generated a test case, controlling the first data processing module to send a first control instruction to the corresponding power module, so that the power module outputs a power parameter of a preset value to the vehicle main board according to the first control instruction; for any first data processing module that has generated a test case, controlling the first data processing module to send a second control instruction to the corresponding bus module, so that the bus module outputs a start signal to the vehicle main board according to the second control instruction; controlling the vehicle main board to execute the test case after receiving the power parameter and the start signal.
[0048] The test system also includes a plurality of power modules and a plurality of bus modules that are electrically connected to the plurality of first data processing modules and the vehicle mainboard respectively. The processor can control all the first data processing modules that have generated test cases to send the corresponding test cases to the vehicle mainboard, so that the vehicle mainboard executes the corresponding test cases. Specifically, for any first data processing module that has generated a test case, the processor can control the first data processing module to send a first control instruction to the corresponding power module, so that the power module outputs a power parameter of a preset value to the vehicle mainboard according to the first control instruction. For any first data processing module that has generated a test case, the processor can control the first data processing module to send a second control instruction to the corresponding bus module, so that the bus module outputs a start signal to the vehicle mainboard according to the second control instruction. The processor can control the vehicle mainboard to execute the test case after receiving the power parameter and the start signal.
[0049] In one embodiment, the vehicle main board includes a display module, and the method further includes: after executing the test case, obtaining the execution result of the vehicle main board; collecting display information of the display module within a preset time length, and obtaining each frame icon in the display information; comparing each frame icon with the target icon corresponding to the execution result; when any frame icon is consistent with the target icon, determining that the display function corresponding to the test case in the display module is normal.
[0050] After the vehicle's mainboard executes the test case, the processor can obtain the execution results of the vehicle's mainboard. The processor can collect the display information of the display module within a preset time period and obtain each frame icon in the display information. After obtaining each frame icon, the processor can compare each frame icon with the target icon corresponding to the execution result. If any frame icon matches the target icon, the processor can determine that the display function corresponding to the test case in the display module is normal.
[0051] In one embodiment, the vehicle mainboard further includes a CAN bus, and the method further includes: after the bus module outputs a start signal to the vehicle mainboard according to the second control instruction, determining whether the start signal exists on the CAN bus; and if the start signal exists on the CAN bus, determining that the vehicle mainboard successfully receives the start signal. The CAN bus is an in-vehicle bus protocol. Various devices can be mounted on the CAN bus, and signals sent by all devices are sent to the CAN bus.
[0052] After the bus module outputs the start signal to the vehicle mainboard according to the second control instruction, the processor can determine whether there is a start signal on the CAN bus. If there is a start signal on the CAN bus, the processor can determine that the vehicle mainboard has successfully received the start signal.
[0053] In one embodiment, the test system also includes an adapter module electrically connected to the display module, which collects display information of the display module within a preset time length and obtains each frame icon in the display information, including: controlling the adapter module to collect display information and converting the display information into data in high-definition video format; obtaining each frame icon in the data in high-definition video format.
[0054] The processor can collect display information from the display module within a preset time period and obtain each frame of icons in the display information. Specifically, the processor can control the adapter module to collect the display information and convert the display information into data in a high-definition video format. After obtaining the data in the high-definition video format, the processor can obtain each frame of icons in the data in the high-definition video format.
[0055] In one embodiment, the test system further includes an image acquisition module, and acquiring display information of the display module within a preset time period includes: controlling the image acquisition module to acquire display information of the display module within the preset time period.
[0056] The processor can test that the system further includes an image acquisition module that acquires display information of the display module within a preset time period. Specifically, the processor can control the image acquisition module to acquire display information of the display module within a preset time period.
[0057] For example, Figure 3As shown, the test system may include a computer, a programmable power supply (i.e., a power module), a CAN device (i.e., a bus module), an LVDS adapter (i.e., an adapter module) and a camera (i.e., an image acquisition module). Among them, the computer includes a data transmission module, multiple first data processing modules and multiple second data processing modules. The computer can open 4 USB interfaces (communication interfaces), which are respectively connected to the programmable power supply, the CAN device, the LVDS adapter, the camera and the vehicle instrument central control motherboard (i.e., the vehicle mainboard). Among them, the vehicle instrument central control motherboard may include an instrument screen (i.e., a display module), a CAN bus and a central control screen. The vehicle instrument central control motherboard also includes a power port and a LOG port (query port).
[0058] The processor can control the computer to generate test cases. For any generated test case, the processor can determine the specified maximum voltage, maximum current, overvoltage protection voltage value, and current protection current value of the test case. The processor can control the computer to send a first control instruction to the control port of the programmable power supply through the USB interface connected to the programmable power supply, so that the programmable power supply outputs preset power parameters to the power port of the automobile instrument central control motherboard according to the first control instruction. The power parameters include the maximum voltage, maximum current, overvoltage protection voltage value, and current protection current value. The processor can control the computer to send a second control instruction to the CAN device through the USB interface connected to the CAN device, so that the CAN device outputs a CAN signal to the CAN bus of the automobile instrument central control motherboard. After the CAN device outputs the CAN signal to the CAN bus of the automobile instrument central control motherboard, the processor can determine whether there is a CAN signal on the CAN bus. If there is a CAN signal on the CAN bus, it is determined that the automobile instrument central control motherboard successfully received the CAN signal.
[0059] When it is determined that the power parameters of the automobile instrument central control mainboard are configured successfully and the CAN signal is successfully received, the processor can control the computer to send the test case through the USB interface connected to the LOG port of the automobile instrument central control mainboard. And control the automobile instrument central control mainboard to execute the test case. After the automobile instrument central control mainboard executes the test case, the processor can obtain the execution result of the automobile instrument central control mainboard. At the same time, through line 1, the processor can control the computer to send an acquisition instruction to the LVDS adapter through the USB interface connected to the LVDS adapter, so that the LVDS adapter collects the display information of the instrument screen within a preset time length through the LVDS Input (acquisition port), and converts the display information into HDMI (high-definition video) format information to be transmitted to the computer through the HDMIOutput (output port). The processor can control the computer to obtain each frame icon in the HDMI format information.
[0060] Through line 2, the processor can also control the computer to send a capture command to the camera via the USB interface connected to the camera, so that the camera can capture the instrument screen display information within a preset time period. The instrument screen and camera can be placed in a dark box. The processor can control the camera to send the captured display information to the computer to obtain each frame of the display information.
[0061] The processor can compare each frame icon with the target icon corresponding to the execution result. When any frame icon is consistent with the target icon, the processor can determine that the display function corresponding to the test case in the display module is normal.
[0062] In one embodiment, Figure 4 As shown, the test system may include a computer and a hardware device connected to the computer, and the hardware device may communicate with the vehicle mainboard. The application on the computer may use Python 3.8 (test framework). Python 3.8 may send data to the distributed task packaging and allocation module, and assign tasks to the Pytest (test framework) module. The Pytest module may perform initialization operations, and after initialization is completed, Pytest may call the use case automatic generation module. The use case automatic generation module may scan the test case data (.json file, data exchange format), and generate data in .py format (file format) after performing data parsing and rule detection on the test case data through submodules. After generating the data in .py format, the data in .py format may be returned to the use case generation module for the use case generation module to call. The use case generation module may call the data in .py format to generate test cases, and send the test cases to the use case execution module. The use case execution module may initialize the hardware devices connected to the computer. Among them, the hardware devices may include LVDS or cameras, CAN devices, programmable power supplies, ADB (debug bridge) or other LOG interfaces. After initialization is complete, you can start the CAN submodule, set the programmable power supply, set the offline configuration, send CAN signals, and compare images to confirm that the test case execution is complete. After the test case execution is complete, you can use the Allture module (a multi-language test reporting tool) to generate a test case execution report.
[0063] Specifically, if Figure 5As shown, the processor can control the computer to initialize the connected hardware. After hardware initialization is complete, the processor can control the computer to launch the CAN tool, which continuously sends signals to the vehicle mainboard to maintain normal operation. The processor can also control the computer to power on the programmable power supply, which sets the voltage output to the vehicle mainboard. For example, it can set the voltage and maximum current, as well as the overvoltage protection voltage and overcurrent protection current, to ensure stability of the vehicle mainboard. The processor can control the CAN device to send offline configuration information, so that the vehicle mainboard can configure the corresponding ports based on the offline configuration information. After the vehicle mainboard's port configuration is complete, the processor can control the CAN device to send a CAN signal to the vehicle mainboard's CAN bus and obtain the signal value on the CAN bus to determine whether the signal value matches the signal value of the CAN signal. If the signal value matches, the processor can control the computer to send a test case to the vehicle mainboard, causing the vehicle mainboard to execute the corresponding test case. The processor can control the computer to capture a real-time screenshot of the vehicle mainboard's instrument panel via a camera or LVDS, and compare the captured screenshot with a template image. The template image refers to the target image corresponding to the test case's execution result on the vehicle's mainboard. The processor controls the computer to determine the comparison result. If the screenshot and the template image are consistent, the corresponding display function on the instrument panel can be determined to be normal. If the screenshot and the template image are inconsistent, the corresponding display function on the instrument panel can be determined to be abnormal.
[0064] The above technical solution controls the data transmission module to send test data to any first data processing module, so that the first data processing module generates a corresponding test case based on the test data; controls all first data processing modules that have generated test cases to send the corresponding test cases to the vehicle mainboard, so that the vehicle mainboard executes the corresponding test cases; controls the data transmission module to receive status data fed back by each first data processing module that has generated test cases within a preset time interval, wherein the status data includes normal data fed back when the first data processing module is in a normal state and abnormal data fed back when it is in an abnormal state; if any status data is abnormal data, determines that the first data processing module corresponding to the status data is in an abnormal state; controls the data transmission module to send the test data corresponding to the first data processing module in the abnormal state to any second data processing module, so that the second data processing module generates a new test case based on the test data corresponding to the first data processing module in the abnormal state; and controls the second data processing module that has generated the new test case to send the new test case to the vehicle mainboard, so that the vehicle mainboard executes the new test case. The above technical solution can realize the automated generation and automated testing of test cases, shorten the testing time, improve the testing efficiency, reduce the labor cost, and obtain more accurate test results.
[0065] Figure 1 、 5 FIG. 1 is a flow chart of an automatic testing method in one embodiment. It should be understood that although Figure 1 、 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 、 5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0066] An embodiment of the present application provides a processor, which is used to run a program, wherein the above-mentioned automatic testing method is executed when the program is running.
[0067] The present invention provides a testing system, which includes:
[0068] a test case automatic generation module, the test case automatic generation module including a data transmission module and a plurality of first data processing modules and a plurality of second data processing modules electrically connected to the data transmission module; and
[0069] The above processors.
[0070] An embodiment of the present application provides a storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned automatic testing method is implemented.
[0071] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected via a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The database of the computer device is used to store test data and status data. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a method of automatic testing is implemented.
[0072] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0073] An embodiment of the present application provides a device, comprising a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: for any first data processing module, controlling the data transmission module to send test data to the first data processing module, so that the first data processing module generates a corresponding test case based on the test data; controlling all first data processing modules that have generated test cases to send the corresponding test cases to a vehicle mainboard, so that the vehicle mainboard executes the corresponding test cases; controlling the data transmission module to receive status data fed back by each first data processing module that has generated a test case within a preset time interval, wherein the status data includes normal data fed back by the first data processing module when it is in a normal state and abnormal data fed back when it is in an abnormal state; if any status data is abnormal data, determining that the first data processing module corresponding to the status data is in an abnormal state; controlling the data transmission module to send the test data corresponding to the first data processing module in the abnormal state to any second data processing module, so that the second data processing module generates a new test case based on the test data corresponding to the first data processing module in the abnormal state; and controlling the second data processing module that has generated the new test case to send the new test case to the vehicle mainboard, so that the vehicle mainboard executes the new test case.
[0074] In one embodiment, the method also includes: after controlling all first data processing modules that have generated test cases to send corresponding test cases to the vehicle mainboard, controlling each first data processing module that has generated a test case to feedback status data to the data transmission module within a preset interval; when any first data processing module that has generated a test case does not feedback status data within the preset interval, sending a prompt message to the data transmission module; controlling the data transmission module to send the test data corresponding to the first data processing module that has not fed back status data to any second data processing module, so that the second data processing module generates a new test case based on the test data corresponding to the first data processing module that has not fed back status data.
[0075] In one embodiment, the test system also includes multiple power modules and multiple bus modules that are electrically connected to multiple first data processing modules and the vehicle main board respectively, and controls all first data processing modules that have generated test cases to send corresponding test cases to the vehicle main board so that the vehicle main board executes the corresponding test cases, including: for any first data processing module that has generated a test case, controlling the first data processing module to send a first control instruction to the corresponding power module, so that the power module outputs a power parameter of a preset value to the vehicle main board according to the first control instruction; for any first data processing module that has generated a test case, controlling the first data processing module to send a second control instruction to the corresponding bus module, so that the bus module outputs a start signal to the vehicle main board according to the second control instruction; controlling the vehicle main board to execute the test case after receiving the power parameter and the start signal.
[0076] In one embodiment, the vehicle main board includes a display module, and the method further includes: after executing the test case, obtaining the execution result of the vehicle main board; collecting display information of the display module within a preset time length, and obtaining each frame icon in the display information; comparing each frame icon with the target icon corresponding to the execution result; when any frame icon is consistent with the target icon, determining that the display function corresponding to the test case in the display module is normal.
[0077] In one embodiment, the vehicle main board also includes a CAN bus, and the method further includes: after the bus module outputs a start signal to the vehicle main board according to the second control instruction, determining whether there is a start signal on the CAN bus; if there is a start signal on the CAN bus, determining that the vehicle main board successfully receives the start signal.
[0078] In one embodiment, the test system also includes an adapter module electrically connected to the display module, which collects display information of the display module within a preset time length and obtains each frame icon in the display information, including: controlling the adapter module to collect display information and converting the display information into data in high-definition video format; obtaining each frame icon in the data in high-definition video format.
[0079] In one embodiment, the test system further includes an image acquisition module, and acquiring display information of the display module within a preset time period includes: controlling the image acquisition module to acquire display information of the display module within the preset time period.
[0080] The present application also provides a computer program product which, when executed on a data processing device, is adapted to execute a program for initiating method steps such as automatic testing.
[0081] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0082] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0083] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0085] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0086] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0087] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0088] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0089] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for automatic testing, characterized in that: Applied to a test system, the test system includes a test case automatic generation module, wherein the test case automatic generation module includes a data transmission module and a plurality of first data processing modules and a plurality of second data processing modules electrically connected to the data transmission module, the method includes: For any first data processing module, controlling the data transmission module to send test data to the first data processing module, so that the first data processing module generates a corresponding test case according to the test data; Controlling all first data processing modules that have generated test cases to send the corresponding test cases to the vehicle mainboard, so that the vehicle mainboard executes the corresponding test cases; Controlling the data transmission module to receive status data fed back by each first data processing module that generates a test case within a preset time interval, wherein the status data includes normal data fed back by the first data processing module when it is in a normal state and abnormal data fed back when it is in an abnormal state; In the case where any state data is the abnormal data, determining that the first data processing module corresponding to the state data is in the abnormal state; Controlling the data transmission module to send the test data corresponding to the first data processing module in the abnormal state to any second data processing module, so that the second data processing module generates a new test case according to the test data corresponding to the first data processing module in the abnormal state; The second data processing module that controls the generation of a new test case sends the new test case to the vehicle mainboard, so that the vehicle mainboard executes the new test case.
2. The automatic testing method according to claim 1, characterized in that: The method further comprises: After controlling all first data processing modules that have generated test cases to send corresponding test cases to the vehicle mainboard, controlling each first data processing module that has generated a test case to feed back the status data to the data transmission module within the preset time interval; If any first data processing module that generates a test case fails to feed back the status data within the preset time interval, sending a prompt message to the data transmission module; Control the data transmission module to send the test data corresponding to the first data processing module that has not fed back the status data to any second data processing module, so that the second data processing module generates a new test case based on the test data corresponding to the first data processing module that has not fed back the status data.
3. The automatic testing method according to claim 1, characterized in that: The test system further includes a plurality of power modules and a plurality of bus modules electrically connected to the plurality of first data processing modules and the vehicle mainboard, respectively. Controlling all first data processing modules that have generated test cases to send corresponding test cases to the vehicle mainboard so that the vehicle mainboard executes the corresponding test cases includes: For any first data processing module that generates a test case, control the first data processing module to send a first control instruction to a corresponding power module, so that the power module outputs a power parameter of a preset value to the vehicle mainboard according to the first control instruction; For any first data processing module that generates a test case, control the first data processing module to send a second control instruction to a corresponding bus module, so that the bus module outputs a start signal to the vehicle mainboard according to the second control instruction; The vehicle mainboard is controlled to execute the test case after receiving the power supply parameters and the start signal.
4. The automatic testing method according to claim 3, characterized in that: The vehicle mainboard includes a display module, and the method further includes: After executing the test case, obtaining the execution result of the vehicle mainboard; Collecting display information of the display module within a preset time period, and obtaining each frame icon in the display information; Comparing each frame icon with a target icon corresponding to the execution result; When any frame icon is consistent with the target icon, it is determined that the display function corresponding to the test case in the display module is normal.
5. The automatic testing method according to claim 3, characterized in that: The vehicle mainboard further includes a CAN bus, and the method further includes: After the bus module outputs a start signal to the vehicle mainboard according to the second control instruction, determining whether the start signal exists on the CAN bus; In a case where the start signal exists on the CAN bus, it is determined that the vehicle mainboard successfully receives the start signal.
6. The automatic testing method according to claim 4, characterized in that: The test system further includes a switching module electrically connected to the display module, and the collecting of display information of the display module within a preset time period and obtaining each frame icon in the display information includes: Controlling the switching module to collect the display information and convert the display information into data in a high-definition video format; Obtain an icon for each frame in the data in the high-definition video format.
7. The automatic testing method according to claim 4, characterized in that: The test system further includes an image acquisition module, and the acquisition of display information of the display module within a preset time period includes: The image acquisition module is controlled to acquire display information of the display module within a preset time period.
8. A processor, characterized in that: A method configured to perform an automatic test according to any one of claims 1 to 7.
9. A testing system, characterized in that: The system comprises: a test case automatic generation module, the test case automatic generation module including a data transmission module and a plurality of first data processing modules and a plurality of second data processing modules electrically connected to the data transmission module; and The processor according to claim 8.
10. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by a processor, the processor is configured to perform the automatic testing method according to any one of claims 1 to 7.