Test method and device, equipment and storage medium

Automatically generate intermediate test programs and write input and output logic through the stream editor, solving the problem of inefficient testing of automotive controller software in the prior art, and achieving efficient testing of multiple modules to be tested.

CN119938537APending Publication Date: 2025-05-06CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510038818.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Existing automotive controller software testing methods rely on manual writing of test programs, resulting in reduced testing efficiency, especially when the number of functional modules increases.

Method used

The stream editor configures the node to be tested corresponding to the module to be tested, and executes the target flow to automatically generate an intermediate test program. The tester only needs to write input and output logic to generate the target test program, thereby realizing the testing of the module to be tested.

Benefits of technology

There is no need to write an intermediate test program, which significantly improves the testing efficiency and can effectively conduct overall or separate testing of multiple modules to be tested.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938537A_ABST
    Figure CN119938537A_ABST
Patent Text Reader

Abstract

The invention relates to a test method and device, equipment and a storage medium, and the test method comprises the steps: responding to an execution control on a flow editor, executing a target flow, and generating an intermediate test program; wherein the target flow comprises at least one to-be-tested node, and the at least one to-be-tested node is configured based on at least one to-be-tested module included in the to-be-tested equipment; in the process of executing the target test program, testing the at least one to-be-tested module based on the input data, and determining a test result of the target test program based on the obtained output data; wherein the target test program is written based on the intermediate test program and the input and output logic program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] At present, the test programs used in software testing of automobile controllers are mainly written by testers. As the number of functional modules included in automobile controllers increases, the test efficiency of automobile controllers is reduced. Summary of the invention

[0003] The present invention provides a testing method to solve the problem of low testing efficiency; secondly, provides a testing device; thirdly, provides an electronic device; thirdly, provides a computer storage medium; and finally, provides a computer program product.

[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0005] A testing method, comprising:

[0006] In response to the execution control on the flow editor, the target flow is executed to generate an intermediate test program; wherein the target flow includes at least one node to be tested, and the at least one node to be tested is configured based on at least one module to be tested included in the device to be tested;

[0007] During the execution of the target test program, the at least one module to be tested is tested based on the input data, and the test result of the target test program is determined based on the obtained output data; wherein the target test program is written based on the intermediate test program and the input-output logic program.

[0008] According to the above technical means, at least one node to be tested corresponding to at least one module to be tested is configured through the flow editor, and the target flow including at least one node to be tested is executed to automatically generate an intermediate test program. On this basis, the tester only needs to write the input and output logic to obtain the target test program. Subsequently, the test of at least one module to be tested is realized by executing the target test program. In this way, there is no need to write an intermediate test program, thereby achieving the purpose of improving test efficiency.

[0009] Further, when the target flow includes multiple nodes to be tested and the device to be tested includes multiple modules to be tested, the testing of the at least one module to be tested based on the input data and determining the test result of the target test program based on the obtained output data include: inputting the input data into the first module to be tested among the multiple modules to be tested, and determining the test result of the target test program based on the output data output by the last module to be tested.

[0010] According to the above technical means, by inputting input data to the first module to be tested among multiple modules to be tested, and determining the test result of the target test program based on the output data output by the last module to be tested, the overall test of multiple modules to be tested is achieved.

[0011] Further, when the target flow includes a target node to be tested, and the device to be tested includes at least one module to be tested, the at least one module to be tested is tested based on input data, and the test result of the target test program is determined based on the output data obtained, including: inputting the input data to the target module to be tested, and determining the test result of the target test program based on the output data output by the target module to be tested; wherein the target module to be tested is any module to be tested among the at least one module to be tested.

[0012] According to the above technical means, input data is input into the target module to be tested, and the test result of the target test program is determined based on the output data output by the target module to be tested, thereby achieving individual testing of each module to be tested.

[0013] Further, the execution of the target flow to generate an intermediate test program includes: executing the target flow to generate the intermediate test program and the first gateway configuration information corresponding to each node to be tested; the testing of the at least one module to be tested based on the input data input and determining the test result of the target test program based on the output data obtained includes: testing the at least one module to be tested based on the input data and the first gateway configuration information corresponding to each node to be tested, and determining the test result of the target test program based on the output data obtained; wherein the gateway included in the module to be tested is used to execute a data forwarding process based on the first gateway configuration information.

[0014] Furthermore, the testing method further includes: when the output data is not obtained within a preset time period, determining that the test result of the target test program is a result indicating a test failure.

[0015] Further, determining the test result of the target test program based on the obtained output data includes: determining whether the output data is consistent with the preset output data; when the output data is consistent with the preset output data, the test result is a result indicating a successful test.

[0016] Furthermore, the test method further includes: when the output data is inconsistent with the preset output data, the test result is a result indicating a test failure.

[0017] A testing device, comprising:

[0018] A processing unit, configured to execute a target flow in response to an execution control on a flow editor, and generate an intermediate test program; wherein the target flow includes at least one node to be tested, and the at least one node to be tested is configured based on at least one module to be tested included in the device to be tested;

[0019] The processing unit is also used to test the at least one module to be tested based on input data during the execution of the target test program, and determine the test result of the target test program based on the obtained output data; wherein the target test program is written based on the intermediate test program and the input-output logic program.

[0020] An electronic device comprises: a processor and a memory configured to store a computer program that can be run on the processor, wherein the processor is configured to execute the steps of the above method when running the computer program.

[0021] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.

[0022] A computer program product comprises a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the steps of the aforementioned method are implemented.

[0023] Beneficial effects of the present invention:

[0024] (1) The present invention configures at least one node to be tested corresponding to at least one module to be tested through a flow editor, executes a target flow including at least one node to be tested, and automatically generates an intermediate test program. On this basis, the tester only needs to write input and output logic to obtain the target test program. Subsequently, the test of at least one module to be tested is implemented by executing the target test program; in this way, there is no need to write an intermediate test program, thereby achieving the purpose of improving test efficiency;

[0025] (2) The present invention implements an overall test of multiple modules to be tested by inputting input data to the first module to be tested among multiple modules to be tested and determining the test result of the target test program based on the output data output by the last module to be tested. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 The process diagram of the test method in the embodiment of the present invention is shown in FIG. Figure 1 ;

[0027] Figure 2 The process diagram of the test method in the embodiment of the present invention is shown in FIG. Figure 2 ;

[0028] Figure 3 The process diagram of the test method in the embodiment of the present invention is shown in FIG. Figure 3 ;

[0029] Figure 4 A schematic diagram of the configuration of a target test program in an embodiment of the present invention;

[0030] Figure 5 Schematic diagram of target flow in an embodiment of the present invention Figure 1 ;

[0031] Figure 6 Schematic diagram of target flow in an embodiment of the present invention Figure 2 ;

[0032] Figure 7 Schematic diagram of the interaction between the PC and the controller in the embodiment of the present invention Figure 1 ;

[0033] Figure 8 Schematic diagram of the interaction between the PC and the controller in the embodiment of the present invention Figure 2 ;

[0034] Fig. 9 Schematic diagram of target flow in an embodiment of the present invention Figure 3 ;

[0035] Fig.10 Schematic diagram of the interaction between the PC and the controller in the embodiment of the present invention Figure 3 ;

[0036] Fig.11 Schematic diagram of the interaction between the PC and the controller in the embodiment of the present invention Figure 4 ;

[0037] Fig.12 A schematic diagram of the composition structure of a test device in an embodiment of the present invention;

[0038] Fig.13 Schematic diagram of the vehicle structure in an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this embodiment and are not intended to limit this application.

[0041] In the following description, references to “some embodiments,” “this embodiment,” “this embodiment,” and examples, etc., describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.

[0042] If similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the present embodiment described here can be implemented in an order other than that illustrated or described here.

[0043] In this embodiment, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, object A and / or object B may represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.

[0044] The embodiment of the present invention provides a testing method. Figure 1 The process diagram of the test method in the embodiment of the present invention is shown in FIG. Figure 1 , applied to electronic devices, which may be personal computers (PCs).

[0045] like Figure 1 As shown, the test method includes the following steps:

[0046] S101: In response to an execution control on a flow editor, executing a target flow to generate an intermediate test program; wherein the target flow includes at least one node to be tested, and the at least one node to be tested is configured based on at least one module to be tested included in the device to be tested.

[0047] In the embodiment of the present invention, the stream editor is an editor for editing a stream. According to at least one module to be tested included in the device to be tested, a node to be tested having the same function as the corresponding module to be tested is configured on the stream editor, as well as input nodes and output nodes, which are then connected with connecting lines to generate a target stream consisting of at least one node to be tested and input and output nodes.

[0048] In the embodiment of the present invention, the page of the flow editor includes an execution control, and by manually clicking or responding to the execution control (or button) by voice, the target flow is started to execute and an intermediate test program corresponding to the processing flow of the target flow is generated.

[0049] In the embodiment of the present invention, the functions of the modules to be tested included in the at least one module to be tested may be the same or different.

[0050] Exemplarily, the device under test includes at least one microcontroller unit (MCU), or includes at least one system on chip (SOC), or includes at least one MCU and at least one SOC.

[0051] S102: During the execution of the target test program, at least one module to be tested is tested based on input data, and a test result of the target test program is determined based on the obtained output data; wherein the target test program is written based on the intermediate test program and the input-output logic program.

[0052] In an embodiment of the present invention, before executing the target test program, the target test program is written according to the intermediate test program, the preset input data and the preset output data. Then, the target test program is executed, and the electronic device sends input data, i.e., preset input data, to the device under test. When the output data sent by the device under test is received, the test result of the target test program is determined based on the output data and the preset output data, thereby implementing the test of the device under test. The test result is a test success or a test failure.

[0053] In some embodiments, the testing method further includes: if the output data is not obtained within a preset time period, determining that the test result of the target test program is a result indicating a test failure.

[0054] That is, after the electronic device sends input to the device under test, if it does not receive output data sent by the device under test within a preset time period, it is determined that the test of the device under test has failed.

[0055] In some embodiments, determining the test result of the target test program based on the obtained output data includes:

[0056] When the input data is consistent with the preset input data, it is determined whether the output data is consistent with the preset output data; when the output data is consistent with the preset output data, the test result is a result indicating a successful test.

[0057] In some embodiments, the test method further includes: when the output data is inconsistent with the preset output data, the test result is a result indicating a test failure.

[0058] That is, when the input data is consistent with the preset input data, the test result is determined as a test failure or a test success by comparing the output data with the preset output data to see whether they are consistent.

[0059] In the embodiment of the present invention, at least one node to be tested corresponding to at least one module to be tested is configured through a flow editor, a target flow including at least one node to be tested is executed, and an intermediate test program is automatically generated. On this basis, the tester only needs to write input and output logic to obtain the target test program. Subsequently, the test of at least one module to be tested is implemented by executing the target test program; in this way, there is no need to write an intermediate test program, thereby achieving the purpose of improving test efficiency.

[0060] Based on the above embodiments, the present invention also provides a testing method. Figure 2 The process diagram of the test method in the embodiment of the present invention is shown in FIG. Figure 2 ,like Figure 2 As shown, the test method includes the following steps:

[0061] S201: In response to the execution control on the flow editor, execute the target flow and generate an intermediate test program; wherein the target flow includes multiple nodes to be tested, the device to be tested includes multiple modules to be tested, and the multiple nodes to be tested are configured based on the multiple modules to be tested included in the device to be tested.

[0062] In the embodiment of the present invention, before responding to the execution control, according to the multiple modules to be tested included in the device to be tested, the nodes to be tested that are consistent with the functions of the corresponding modules to be tested are configured on the flow editor, and the input nodes and output nodes are configured, and then connected in series with connecting lines, thereby generating a target flow consisting of multiple nodes to be tested and input and output nodes. Then, by manually clicking or voice responding to the execution control (or button), the target flow is started to be executed, and an intermediate test program corresponding to the processing flow of the target flow is generated.

[0063] That is to say, one device under test corresponds to a set of target test programs.

[0064] S202: During execution of the target test program, input data is input to a first module to be tested among multiple modules to be tested, and a test result of the target test program is determined based on output data output by a last module to be tested.

[0065] In an embodiment of the present invention, a plurality of modules to be tested are connected in series. A target test program is executed, input data is input to a first module to be tested, and when output data sent by a last module to be tested is received, a test result of the target test program is determined to be a test failure or a test success based on the output data output by the plurality of modules to be tested.

[0066] In some embodiments, the execution of the target flow to generate an intermediate test program includes: executing the target flow to generate the intermediate test program and the first gateway configuration information corresponding to each node to be tested; the testing of the at least one module to be tested based on the input data input and determining the test result of the target test program based on the output data obtained includes: testing the at least one module to be tested based on the input data and the first gateway configuration information corresponding to each node to be tested, and determining the test result of the target test program based on the output data obtained; wherein the gateway included in the module to be tested is used to execute a data forwarding process based on the first gateway configuration information.

[0067] It should be noted that the reason why the first gateway configuration information corresponding to each node to be tested is sent to at least one module to be tested is because the default configuration information of the gateway included in each module to be tested may be inconsistent with the first gateway configuration information. In this way, when the gateway determines that the default configuration information is inconsistent with the first gateway configuration information, the configuration information of the gateway is updated to the first gateway configuration information. The first gateway configuration information includes a routing table, which defines the transmission path of data in the network, thereby ensuring accurate forwarding of data.

[0068] Exemplarily, if the multiple modules to be tested include a first module to be tested and a second module to be tested, the first module to be tested and the second module to be tested are connected in series in sequence. When the first module to be tested receives the first gateway configuration information corresponding to each node to be tested, it obtains the first gateway configuration information corresponding to the corresponding node to be tested, and then compares it with the default configuration information; if they are inconsistent, the configuration information of the gateway of the first module to be tested is updated to the first gateway configuration information, and the gateway of the first module to be tested forwards the forwarding data and the first gateway configuration information corresponding to each node to be tested to the second module to be tested based on the first gateway configuration information; if they are consistent, the gateway of the first module to be tested forwards the forwarding data and the first gateway configuration information corresponding to each node to be tested to the second module to be tested based on the default configuration information. When the second module to be tested receives the first gateway configuration information corresponding to each node to be tested, it obtains the first gateway configuration information corresponding to the corresponding node to be tested, and then compares it with the default configuration information; if they are inconsistent, the configuration information of the gateway of the second module to be tested is updated to the first gateway configuration information, and the gateway of the second module to be tested forwards the forwarding data and the first gateway configuration information corresponding to each node to be tested to the electronic device based on the first gateway configuration information; if they are consistent, the gateway of the second module to be tested forwards the forwarding data to the electronic device based on the default configuration information.

[0069] In some embodiments, the testing method further includes: if the output data is not obtained within a preset time period, determining that the test result of the target test program is a result indicating a test failure.

[0070] That is, after the electronic device sends input to the device under test, if it does not receive output data sent by the device under test within a preset time period, it is determined that the test of the device under test has failed.

[0071] In some embodiments, determining the test result of the target test program based on the obtained output data includes:

[0072] When the input data is consistent with the preset input data, it is determined whether the output data is consistent with the preset output data; when the output data is consistent with the preset output data, the test result is a result indicating a successful test.

[0073] In some embodiments, the test method further includes: when the output data is inconsistent with the preset output data, the test result is a result indicating a test failure.

[0074] That is, when the input data is consistent with the preset input data, the test result is determined as a test failure or a test success by comparing the output data with the preset output data to see whether they are consistent.

[0075] Based on the above embodiments, the present invention also provides a testing method. Figure 3 The process diagram of the test method in the embodiment of the present invention is shown in FIG. Figure 3 ,like Figure 3 As shown, the test method includes the following steps:

[0076] S301: In response to the execution control on the flow editor, execute the target flow, generate an intermediate test program and first gateway configuration information corresponding to each node to be tested; wherein the target flow includes a target node to be tested, the device to be tested includes at least one module to be tested, the target node to be tested is configured based on the target module to be tested, and the target module to be tested is any module to be tested among at least one module to be tested.

[0077] In the embodiment of the present invention, before responding to the execution control, according to the target module to be tested included in the device to be tested, the target node to be tested that is consistent with the function of the corresponding module to be tested is configured on the flow editor, and the input node and the output node are configured, and then connected in series with connecting lines, thereby generating a target flow consisting of the target node to be tested and the input and output nodes. Then, by manually clicking or voice responding to the execution control (or button), the target flow is started to be executed, and an intermediate test program corresponding to the processing flow of the target flow is generated.

[0078] In the embodiment of the present invention, the target module to be tested is any module to be tested among at least one module to be tested. The device to be tested includes at least one module to be tested. Then, one device to be tested corresponds to at least one set of target test programs.

[0079] S302: During execution of the target test program, input data is input to the target module to be tested, and a test result of the target test program is determined based on output data output by the target module to be tested.

[0080] In the embodiment of the present invention, there is no connection between the modules to be tested. The target test program is executed, input data is input to the target module to be tested, and when output data sent by the target module to be tested is received, the test result of the target test program is determined to be a test failure or a test success based on the output data output by the target module to be tested. Then, the test of the next module to be tested is automatically executed.

[0081] In some embodiments, the execution of the target flow to generate an intermediate test program includes: executing the target flow to generate the intermediate test program and the first gateway configuration information corresponding to each node to be tested; the testing of the at least one module to be tested based on the input data input and determining the test result of the target test program based on the output data obtained includes: testing the at least one module to be tested based on the input data and the first gateway configuration information corresponding to each node to be tested, and determining the test result of the target test program based on the output data obtained; wherein the gateway included in the module to be tested is used to execute a data forwarding process based on the first gateway configuration information.

[0082] It should be noted that the reason why the first gateway configuration information corresponding to each node to be tested is sent to at least one module to be tested is because the default configuration information of the gateway included in each module to be tested may be inconsistent with the first gateway configuration information. In this way, when the gateway determines that the default configuration information is inconsistent with the first gateway configuration information, the configuration information of the gateway is updated to the first gateway configuration information. The first gateway configuration information includes a routing table, which defines the transmission path of data in the network, thereby ensuring accurate forwarding of data.

[0083] Exemplarily, if the multiple modules to be tested include a first module to be tested and a second module to be tested, the first module to be tested and the second module to be tested are connected in series in sequence. When the first module to be tested receives the first gateway configuration information corresponding to each node to be tested, it obtains the first gateway configuration information corresponding to the corresponding node to be tested, and then compares it with the default configuration information; if they are inconsistent, the configuration information of the gateway of the first module to be tested is updated to the first gateway configuration information, and the gateway of the first module to be tested forwards the forwarding data and the first gateway configuration information corresponding to each node to be tested to the second module to be tested based on the first gateway configuration information; if they are consistent, the gateway of the first module to be tested forwards the forwarding data and the first gateway configuration information corresponding to each node to be tested to the second module to be tested based on the default configuration information. When the second module to be tested receives the first gateway configuration information corresponding to each node to be tested, it obtains the first gateway configuration information corresponding to the corresponding node to be tested, and then compares it with the default configuration information; if they are inconsistent, the configuration information of the gateway of the second module to be tested is updated to the first gateway configuration information, and the gateway of the second module to be tested forwards the forwarding data and the first gateway configuration information corresponding to each node to be tested to the electronic device based on the first gateway configuration information; if they are consistent, the gateway of the second module to be tested forwards the forwarding data to the electronic device based on the default configuration information.

[0084] In some embodiments, the testing method further includes: if the output data is not obtained within a preset time period, determining that the test result of the target test program is a result indicating a test failure.

[0085] That is, after the electronic device sends input to the device under test, if it does not receive output data sent by the device under test within a preset time period, it is determined that the test of the device under test has failed.

[0086] In some embodiments, determining the test result of the target test program based on the obtained output data includes:

[0087] When the input data is consistent with the preset input data, it is determined whether the output data is consistent with the preset output data; when the output data is consistent with the preset output data, the test result is a result indicating a successful test.

[0088] In some embodiments, the test method further includes: when the output data is inconsistent with the preset output data, the test result is a result indicating a test failure.

[0089] That is, when the input data is consistent with the preset input data, the test result is determined as a test failure or a test success by comparing the output data with the preset output data to see whether they are consistent.

[0090] Based on the above embodiments, the present invention example is based on the node_red editing tool, which provides a browser-based stream editor that can easily connect data streams together using various nodes in the library. Then, the stream can be deployed to the runtime with just one click. JavaScript functions can be created in the editor using a text editor.

[0091] Figure 4 FIG. 1 is a schematic diagram of the configuration of the target test program in an embodiment of the present invention. Figure 4 As shown, configure node 41 according to controller 40 (i.e., device under test) on the flow editor, generate intermediate test program 42 and configuration file 43 (i.e., first gateway configuration information of each node). Write input and output logic to obtain input and output logic program 44. Input and output logic program 44 and intermediate test program 42 generate target test program 45. Subsequently, controller 40 is tested by executing target test program 45.

[0092] Figure 5 Schematic diagram of target flow in an embodiment of the present invention Figure 1 ,like Figure 5 As shown, the input connection line is connected to node11, node11 is connected to node22, and node22 is connected to the output connection line.

[0093] The example controller includes an MCU and a SOC, based on which the MCU node 33 and the SOC node 44 are configured. Figure 6 Schematic diagram of target flow in an embodiment of the present invention Figure 2 ,like Figure 6 As shown, the input end communicates with the MCU node 33 via the CAN communication protocol, the MCU node 33 communicates with the SOC node 44 based on a preset communication protocol (such as Ethernet), and the SOC node 44 communicates with the output end via the DDS communication protocol.

[0094] Next, execute Figure 6 The target flow shown generates an intermediate test program and the first gateway configuration information of the MCU node, and then combines the input and output logic programs to generate a target test program.

[0095] Figure 7 Schematic diagram of the interaction between the PC and the controller in the embodiment of the present invention Figure 1 ,like Figure 7 As shown, the PC executes Figure 6The target test program corresponding to the target flow shown is that PC55 sends CAN data to MCU66 based on the CAN communication protocol. After MCU66 converts the CAN data into Ethernet data, it forwards the Ethernet data to SOC77 based on the corresponding first gateway configuration information. After SOC77 converts the Ethernet data into output data, it sends the output data (i.e., result feedback) to PC55 based on the corresponding first gateway configuration information.

[0096] Figure 8 Schematic diagram of the interaction between the PC and the controller in the embodiment of the present invention Figure 2 ,like Figure 8 As shown, PC55 executes the target test program, and PC55 sends ssh data to soc88 based on the Secure Shell (ssh) protocol. After soc88 converts the ssh data, it forwards the converted data to soc99 based on the corresponding first gateway configuration information. Soc99 further converts the data into output data, and soc99 sends the output data (i.e., result feedback) to PC55 based on the corresponding first gateway configuration information.

[0097] Fig. 9 Schematic diagram of target flow in an embodiment of the present invention Figure 3 ,like Fig. 9 As shown, the input connection line is connected to node 100, and node 100 is connected to the output connection line.

[0098] The example controller includes an mcu. Based on this, the mcu node is configured, and the mcu node is connected to the input connection line and the output connection line respectively to form a target flow. The target flow is executed to generate an intermediate test program, and then combined with the input and output logic programs to generate a target test program.

[0099] Fig.10 Schematic diagram of the interaction between the PC and the controller in the embodiment of the present invention Figure 3 ,like Fig.10 As shown, PC55 executes the target test program corresponding to the target flow, PC55 sends doip data to mcu111 based on the doip communication protocol, mcu111 converts the doip data into output data, and mcu111 sends the output data (ie, doip data) to PC55 based on the corresponding first gateway configuration information.

[0100] The example controller includes soc122 and soc133, and there is no connection between soc122 and soc133. Based on this, the soc node corresponding to soc122 is configured, and then connected with the input connection line and the output connection line respectively to form the target flow 1. Execute the target flow 1, generate the intermediate test program, and then combine the input and output logic programs to generate the target test program 1. And configure the soc node corresponding to soc133, and then connect with the input connection line and the output connection line respectively to form the target flow 2. Execute the target flow 2, generate the intermediate test program, and then combine the input and output logic programs to generate the target test program 2.

[0101] Fig.11 Schematic diagram of the interaction between the PC and the controller in the embodiment of the present invention Figure 4 ,like Fig.11 As shown, PC55 executes target test program 1 corresponding to target stream 1, PC55 sends ssh data to soc122 based on the ssh communication protocol, soc122 converts the ssh data into output data, and soc122 sends the output data to PC55 based on the corresponding first gateway configuration information. Next, PC55 executes target test program 2 corresponding to target stream 2, PC55 sends ssh data to soc133 based on the ssh communication protocol, soc133 converts the ssh data into output data, and soc133 sends the output data to PC55 based on the corresponding first gateway configuration information.

[0102] It should be noted that the present invention decouples the use case method and the communication method (embedded system), because now all automobile industries have high, medium and low-end controllers, but the peripherals and functions are the same. If the node_red tool of the present invention is used, the use case method can use the same program, and only the node needs to be changed to implement the complete test case script.

[0103] An embodiment of the present invention provides a testing device. Fig.12 Schematic diagram of the structure of the test device in the embodiment of the present invention. Fig.12 As shown, the testing device 120 includes:

[0104] The processing unit 1201 is used to execute the target flow in response to the execution control on the flow editor to generate an intermediate test program; wherein the target flow includes at least one node to be tested, and the at least one node to be tested is configured based on at least one module to be tested included in the device to be tested;

[0105] The processing unit 1201 is also used to test the at least one module to be tested based on input data during the execution of the target test program, and determine the test result of the target test program based on the output data obtained; wherein the target test program is written based on the intermediate test program and the input-output logic program.

[0106] In the embodiment of the present invention, at least one node to be tested corresponding to at least one module to be tested is configured through a flow editor, a target flow including at least one node to be tested is executed, and an intermediate test program is automatically generated. On this basis, the tester only needs to write input and output logic to obtain the target test program. Subsequently, the test of at least one module to be tested is implemented by executing the target test program; in this way, there is no need to write an intermediate test program, thereby achieving the purpose of improving test efficiency.

[0107] In some embodiments, when the target flow includes multiple nodes to be tested and the device to be tested includes multiple modules to be tested, the processing unit 1201 is also used to input the input data to the first module to be tested among the multiple modules to be tested, and determine the test result of the target test program based on the output data output by the last module to be tested.

[0108] In some embodiments, when the target flow includes a target node to be tested and the device to be tested includes at least one module to be tested, the processing unit 1201 is also used to input the input data into the target module to be tested, and determine the test result of the target test program based on the output data output by the target module to be tested; wherein the target module to be tested is any module to be tested among the at least one module to be tested.

[0109] In some embodiments, the processing unit 1201 is further configured to execute the target flow, generate the intermediate test program and first gateway configuration information corresponding to each node to be tested;

[0110] And testing the at least one module to be tested based on the input data and the first gateway configuration information corresponding to each node to be tested, and determining the test result of the target test program based on the output data; wherein the gateway included in the module to be tested is used to execute the data forwarding process based on the first gateway configuration information.

[0111] In some embodiments, the processing unit 1201 is further configured to determine that the test result of the target test program is a result indicating a test failure when the output data is not obtained within a preset time period.

[0112] In some embodiments, the target test program is written based on the intermediate test program, preset input data and preset output data; the processing unit 1201 is also used to determine whether the output data is consistent with the preset output data when the input data is consistent with the preset input data; when the output data is consistent with the preset output data, the test result is a result that indicates a successful test.

[0113] In some embodiments, the processing unit 1201 is further configured to, when the output data is inconsistent with the preset output data, the test result is a result indicating a test failure.

[0114] The embodiment of the present invention further provides another electronic device, Fig.13 FIG. 1 is a schematic diagram of a vehicle structure in an embodiment of the present invention. Fig.13 As shown, the electronic device 130 includes: a processor 1301 and a memory 1302 configured to store a computer program that can be run on the processor;

[0115] The processor 1301 is configured to execute the method steps in the aforementioned embodiment when running a computer program.

[0116] Of course, in practical applications, Fig.13 As shown, the various components in the electronic device 130 are coupled together via a bus system 1303. It is understood that the bus system 1303 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1303 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig.13 Various buses are labeled as bus system 1303.

[0117] In practical applications, the processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiments of the present invention do not specifically limit this.

[0118] The above-mentioned memory can be a volatile memory (volatile memory), such as a random access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor.

[0119] In an exemplary embodiment, an embodiment of the present invention further provides a computer-readable storage medium for storing a computer program.

[0120] Optionally, the computer-readable storage medium can be applied to any one of the methods in the embodiments of the present invention, and the computer program enables the computer to execute the corresponding processes implemented by the processor in each method in the embodiments of the present invention. For the sake of brevity, they are not described here.

[0121] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0122] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0123] In addition, all functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art may understand that all or part of the steps of implementing the above method embodiments may be completed by hardware related to program instructions, and the above program may be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the above storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0124] The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.

[0125] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.

[0126] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0127] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A testing method, characterized in that: The test method includes: In response to the execution control on the flow editor, the target flow is executed to generate an intermediate test program; wherein the target flow includes at least one node to be tested, and the at least one node to be tested is configured based on at least one module to be tested included in the device to be tested; During the execution of the target test program, the at least one module to be tested is tested based on the input data, and the test result of the target test program is determined based on the obtained output data; wherein the target test program is written based on the intermediate test program and the input-output logic program.

2. The testing method according to claim 1, characterized in that: When the target flow includes a plurality of nodes to be tested, and the device to be tested includes a plurality of modules to be tested, the step of testing at least one module to be tested based on input data and determining a test result of the target test program based on output data obtained comprises: The input data is input to a first module to be tested among the plurality of modules to be tested, and a test result of the target test program is determined based on output data output by a last module to be tested.

3. The testing method according to claim 1, characterized in that: When the target flow includes a target node to be tested, and the device to be tested includes at least one module to be tested, the step of testing the at least one module to be tested based on input data and determining a test result of the target test program based on output data obtained includes: The input data is input to the target module to be tested, and a test result of the target test program is determined based on the output data output by the target module to be tested; wherein the target module to be tested is any module to be tested among the at least one module to be tested.

4. The testing method according to any one of claims 1 to 3, characterized in that: The executing target flow generates an intermediate test program, including: Execute the target flow to generate the intermediate test program and first gateway configuration information corresponding to each node to be tested; The step of testing the at least one module to be tested based on the input data input, and determining the test result of the target test program based on the obtained output data, comprises: The at least one module to be tested is tested based on the input data and the first gateway configuration information corresponding to each node to be tested, and the test result of the target test program is determined based on the output data obtained; wherein the gateway included in the module to be tested is used to execute the data forwarding process based on the first gateway configuration information.

5. The testing method according to any one of claims 1 to 3, characterized in that: The test method also includes: When the output data is not obtained within a preset time period, the test result of the target test program is determined to be a result indicating a test failure.

6. The testing method according to any one of claims 1 to 3, characterized in that: Determining the test result of the target test program based on the obtained output data includes: Determining whether the output data is consistent with preset output data; When the output data is consistent with the preset output data, the test result is a result indicating a successful test.

7. The testing method according to claim 6, characterized in that: The test method also includes: In the case where the output data is inconsistent with the preset output data, the test result is a result indicating a test failure.

8. A testing device, characterized in that: The testing device comprises: A processing unit, configured to execute a target flow in response to an execution control on a flow editor, and generate an intermediate test program; wherein the target flow includes at least one node to be tested, and the at least one node to be tested is configured based on at least one module to be tested included in the device to be tested; The processing unit is also used to test the at least one module to be tested based on input data during the execution of the target test program, and determine the test result of the target test program based on the obtained output data; wherein the target test program is written based on the intermediate test program and the input-output logic program.

9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory configured to store a computer program capable of running on the processor, Wherein, the processor is configured to execute the steps of the testing method according to any one of claims 1 to 7 when running the computer program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the testing method according to any one of claims 1 to 7 are implemented.