Fault detection method, device, electronic device and storage medium
By automatically generating test scripts and measured fault information, the time-consuming and labor-consuming test scripts of different ECU nodes is solved, and efficient and accurate fault detection is achieved.
Patent Information
- Application Number
- CN202211319406.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-10-26
AI Technical Summary
In the prior art, due to the different nodes of different electronic control units (ECUs), the test script needs to be written manually, which is time-consuming and error-prone, affecting the testing efficiency and accuracy.
Using preset test templates and target information of nodes to be tested, a test script is automatically generated, and the node failure is determined through actual measured fault information to automate the test process.
No need to write test scripts manually, which improves the efficiency and accuracy of the test, reduces maintenance difficulty, and achieves efficient and accurate fault detection.
Smart Images

Figure CN115842709B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of testing technology, and in particular to a fault detection method, device, electronic device, and storage medium. Background Art
[0002] With the advancement of electrification, intelligence, and connectivity in vehicles, vehicle failures are receiving increasing attention. In vehicle networks, end-to-end (E2E) testing is used to detect and resolve node communication failures.
[0003] In the related art, since different electronic control units (ECUs) correspond to different nodes, the test scripts used are also different, and it is necessary to manually write a test script for each node.
[0004] However, manually writing test scripts for each node not only takes a lot of time but is also prone to errors. Summary of the Invention
[0005] The embodiments of the present application provide a fault detection method, device, electronic device and storage medium for efficiently and accurately performing fault testing on a node to be tested.
[0006] In a first aspect, an embodiment of the present application further provides a fault detection method, applied to an electronic device, the method comprising:
[0007] Generate a test script corresponding to the node to be tested based on a preset test template and target information of the node to be tested; wherein the target information is information corresponding to the node to be tested in the test; and the preset test template is general information required for the test;
[0008] Running the test script in the node to be tested, and obtaining actual measured fault information for the test script sent by the node to be tested;
[0009] Determine whether the node to be tested has a fault based on the measured fault information.
[0010] This solution automatically generates test scripts for each node under test by acquiring target information about the node under test and setting a universal, pre-set test template. This eliminates the need for manual coding, saves time, and improves the accuracy of the test scripts. After generating the test scripts, the scripts are automatically run to obtain actual fault information about the node under test. Based on this information, the system can accurately and efficiently determine whether the node under test has failed, thus automating the testing process. This eliminates the need for manual coding of repetitive code, improves overall testing efficiency, and reduces the difficulty of subsequent automated test maintenance.
[0011] In some optional implementations, the target information includes target fields corresponding to multiple test items; the preset test template includes initial fields corresponding to the multiple test items; and generating a test script corresponding to the node to be tested based on the preset test template and the target information of the node to be tested includes:
[0012] For any test item, the initial field corresponding to the test item in the preset test template is replaced with the target field corresponding to the test item to obtain a test script corresponding to the node to be tested.
[0013] In some optional implementations, running the test script in the node to be tested includes:
[0014] The test messages in the test script are sent to the node to be tested in sequence based on the message sending order in the test script, so that after receiving any test message sequence, the node to be tested sends the measured fault information of the test message sequence to the electronic device; wherein the test message sequence includes test messages of the same message type sent continuously.
[0015] In some optional implementations, determining whether the node to be tested has a fault based on the measured fault information includes:
[0016] Determining whether the measured fault information of any test message sequence is the same as the preset fault information corresponding to the message type of the test message sequence;
[0017] If the actual fault information of the test message sequence is different from the corresponding preset fault information, it is determined that the node to be tested has a fault.
[0018] In some optional implementation manners, after determining that the node to be tested has failed, the method further includes:
[0019] The detection fault message is notified through a preset notification method; wherein, the detection fault message at least includes the message type of the target test message sequence and the identifier of the node to be tested; the target test message sequence is a test message sequence in which the measured fault information is different from the preset fault information.
[0020] In a second aspect, an embodiment of the present application provides a fault detection device, applied to an electronic device, the device comprising:
[0021] A script generation module is used to generate a test script corresponding to the node to be tested based on a preset test template and target information of the node to be tested; wherein the target information is information corresponding to the node to be tested in the test; and the preset test template is general information required for the test;
[0022] A script running module, configured to run the test script in the node to be tested and obtain actual fault information for the test script sent by the node to be tested;
[0023] A fault determination module is used to determine whether a fault occurs in the node to be tested based on the measured fault information.
[0024] In some optional implementations, the target information includes target fields corresponding to multiple test items; and the script generation module is specifically configured to:
[0025] For any test item, the initial field corresponding to the test item in the preset test template is replaced with the target field corresponding to the test item to obtain a test script corresponding to the node to be tested.
[0026] In some optional implementation manners, the script execution module is specifically used to:
[0027] The test messages in the test script are sent to the node to be tested in sequence based on the message sending order in the test script, so that after receiving any test message sequence, the node to be tested sends the measured fault information of the test message sequence to the electronic device; wherein the test message sequence includes test messages of the same message type sent continuously.
[0028] In some optional implementation manners, the fault determination module is specifically configured to:
[0029] Determining whether the measured fault information of any test message sequence is the same as the preset fault information corresponding to the message type of the test message sequence;
[0030] If the measured fault information of a test message sequence is different from the corresponding preset fault information, it is determined that the node to be tested has a fault.
[0031] In some optional implementations, after determining that the node to be tested has a fault, the fault determination module is further configured to:
[0032] The detection fault message is notified through a preset notification method; wherein, the detection fault message at least includes the message type of the target test message sequence and the identifier of the node to be tested; the target test message sequence is a test message sequence in which the measured fault information is different from the preset fault information.
[0033] In a third aspect, an embodiment of the present application provides an electronic device, comprising at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes any fault detection method described in the first aspect above.
[0034] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program executable by an electronic device. When the program runs on the electronic device, the electronic device executes any fault detection method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0036] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of a flow chart of a first fault detection method provided in an embodiment of the present application;
[0038] Figure 3 A flowchart of a second fault detection method provided in an embodiment of the present application;
[0039] Figure 4 A schematic diagram of a third fault detection method according to an embodiment of the present application;
[0040] Figure 5 A schematic structural diagram of a fault detection device provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] To make the objectives, technical solutions, and advantages of this application more clear, this application will be further described in detail below with reference to the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0043] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. Throughout this application, unless otherwise specified, "plurality" means two or more.
[0044] In vehicle networks, E2E testing is used to detect node communication failures and resolve related faults.
[0045] In related technologies, since different ECUs correspond to different nodes, the test scripts used are also different, and it is necessary to manually write the test script for each node.
[0046] However, manually writing test scripts for each node not only takes a lot of time but is also prone to errors.
[0047] In view of this, embodiments of the present application provide a fault detection method, apparatus, electronic device, and storage medium for efficiently and accurately performing fault testing on a node to be tested.
[0048] See Figure 1 As shown, an application scenario provided by an embodiment of the present application includes an electronic device 100 and a node to be tested 200. In this embodiment, the electronic device 100 is used as a node and the node to be tested 200 is used as another node, and a text sending process is simulated to perform a fault test on the node to be tested 200.
[0049] The electronic device 100 is used for:
[0050] Generate a test script corresponding to the node to be tested based on a preset test template and target information of the node to be tested; wherein the target information is information corresponding to the node to be tested in the test; and the preset test template is general information required for the test;
[0051] Running the test script in the node to be tested, and obtaining actual measured fault information for the test script sent by the node to be tested;
[0052] Determine whether the node to be tested has a fault based on the measured fault information.
[0053] The node to be tested 200 is used to send measured fault information to the electronic device 100 during the test process.
[0054] The above scenarios are only examples of application scenarios of this application, such as connecting an electronic device to multiple nodes to be tested and performing fault detection on each node to be tested. This application does not limit the specific scenarios.
[0055] The following will be combined with the accompanying drawings and specific embodiments to explain in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0056] Figure 2 The flowchart of the first fault detection method provided in the embodiment of the present application is applied to the above electronic equipment, such as Figure 2 As shown, the following steps are included:
[0057] Step S201: Based on a preset test template and target information of the node to be tested, a test script corresponding to the node to be tested is generated.
[0058] The target information is the information corresponding to the node to be tested in the test; and the preset test template is the general information required for the test.
[0059] Exemplarily, the target information is specific test information of the node to be tested. For different nodes, the target information may be the same or different.
[0060] In some optional implementations, the target information is obtained from an E2E signal table.
[0061] In this embodiment, the preset test template is set based on the general information and can be applied to the test of all nodes, that is, there is no need to write the code corresponding to the general information in each test.
[0062] By obtaining the target information of the node to be tested and setting a common preset test template, a test script (CAPL script) for the node to be tested is automatically generated without manual writing, saving time and improving the accuracy of the test script.
[0063] Step S202: running the test script in the node to be tested, and obtaining actual measured fault information for the test script sent by the node to be tested.
[0064] In this embodiment, after the above-mentioned test script is generated, the test script is automatically run and the measured fault information of the node to be tested is obtained. Subsequently, based on the measured fault information, it can be accurately and efficiently determined whether the node to be tested has a fault, thereby realizing one-click automated testing.
[0065] Step S203: Determine whether a fault occurs in the node to be measured based on the measured fault information.
[0066] This solution automatically generates test scripts for each node under test by acquiring target information about the node under test and setting a universal, pre-set test template. This eliminates the need for manual coding, saves time, and improves the accuracy of the test scripts. After generating the test scripts, the scripts are automatically run to obtain actual fault information about the node under test. Based on this information, the system can accurately and efficiently determine whether the node under test has failed, thus automating the testing process. This eliminates the need for manual coding of repetitive code, improves overall testing efficiency, and reduces the difficulty of subsequent automated test maintenance.
[0067] In some optional implementations, the target information includes target fields corresponding to a plurality of test items; the preset test template includes initial fields corresponding to the plurality of test items;
[0068] Correspondingly, the embodiment of the present application provides a flow chart of a second fault detection method, which is applied to the above electronic equipment, such as Figure 3 As shown, the following steps are included:
[0069] Step S301: For any test item, the initial field corresponding to the test item in the preset test template is replaced with the target field corresponding to the test item to obtain a test script corresponding to the node to be tested.
[0070] In this embodiment, the target information includes multiple target fields (that is, each target field corresponds to a test item).
[0071] As mentioned above, the preset test template is based on general information and can be applied to all node tests. However, the fields corresponding to the test items of different nodes under test may be different. Therefore, only the initial fields can be set in the preset test template. The target information is the test information specific to the node under test, including the target fields of the test items mentioned above. By replacing the initial fields of each test item in the preset test template with the corresponding target fields, a complete test script for the node under test can be efficiently generated.
[0072] For example, in a test process, there are four test items, namely, test item A, test item B, test item C, and test item D. The initial field of test item A is A0, the initial field of test item B is B0, the initial field of test item C is C0, and the initial field of test item D is D0.
[0073] For node 1 to be tested, the target field of test item A is A1, the target field of test item B is B1, the target field of test item C is C1, and the target field of test item D is D1;
[0074] Replace A0 in the preset test template with A1, B0 with B1, C0 with C1, and D0 with D1 to obtain the test script corresponding to the node 1 to be tested.
[0075] Step S302: running the test script in the node to be tested, and obtaining actual measured fault information for the test script sent by the node to be tested.
[0076] Step S303: Determine whether a fault occurs in the node to be measured based on the measured fault information.
[0077] The specific implementation of steps S302 to S303 can refer to the above embodiment and will not be repeated here.
[0078] In the above solution, because the preset test template is based on general information and can be applied to all node tests, the fields corresponding to the test items of different nodes under test may be different. Therefore, it is impossible to set the fields corresponding to the test items of the node under test in the preset test template. By setting the initial fields in the preset test template and then determining the target fields corresponding to the test items of the node under test, the initial fields of each test item in the preset test template are replaced with the corresponding target fields, effectively obtaining a complete test script for the node under test.
[0079] Figure 4 The flowchart of the third fault detection method provided in the embodiment of the present application is applied to the above electronic equipment, such as Figure 4 As shown, the following steps are included:
[0080] Step S401: Based on a preset test template and target information of the node to be tested, a test script corresponding to the node to be tested is generated.
[0081] In this embodiment, the generated test script contains multiple test messages, and the testing process consists of sending these test messages to the node under test. Therefore, the target information includes the target field of the first test item required for generating the test message, and the target field of the second test item required for sending the test message. Exemplarily, the first test item includes the test message identifier, the test message length, the node under test identifier, the data identifier, the number of test messages in each test message sequence (i.e., the number of consecutive transmissions of messages of the same message type), etc.; the second test item includes the message transmission order, etc.
[0082] Step S402: sending the test messages in the test script to the node under test in sequence based on the message sending order in the test script, so that the node under test sends the measured fault information of the test message sequence to the electronic device after receiving any test message sequence.
[0083] The test message sequence includes test messages of the same message type that are sent continuously.
[0084] As described above, the testing process involves sending a test message to the node under test. For example, the electronic device invokes CANoe (a bus development environment) to run a script, accesses CANoe's Component Object Model (COM) interface, sends a test message to the node under test, and obtains actual fault information.
[0085] Exemplarily, the electronic device continuously sends several test messages of the same message type (test message sequence) to the node to be tested. When the node to be tested continuously receives a certain number of test messages of the same type, a measured fault information is generated.
[0086] Step S403: Determine whether the measured fault information of any test message sequence is the same as the preset fault information corresponding to the message type of the test message sequence.
[0087] In this embodiment, different message types have different preset fault information. The preset fault information is the fault information when the node is not faulty. For example, if the message type is "correct," meaning the test message contains a correct checksum and rolling counter, the preset fault information does not contain a diagnostic trouble code (DTC). If the message type is "error," meaning the test message contains an incorrect checksum or rolling counter, the preset fault information contains a DTC.
[0088] The measured fault information for each test message sequence is compared with the corresponding preset fault information. If the two are the same, it indicates that the measured fault information is the fault information when the node is not faulty, and the measured fault information for the node under test for the test message sequence is accurate. If the two are different, it indicates that the measured fault information is the fault information when the node is faulty, and the measured fault information for the node under test for the test message sequence is inaccurate. As long as the node under test triggers inaccurate measured fault information, it indicates that the node under test may have a communication problem.
[0089] Step S404: If the measured fault information of the test message sequence is different from the corresponding preset fault information, it is determined that the node to be tested has a fault.
[0090] In the above scheme, since the test process is to send test messages to the node to be tested, by continuously sending several test messages of the same message type (test message sequence) to the node to be tested, the node to be tested generates a measured fault information based on a certain number of continuously received test messages of the same type. Based on the measured fault information, it can be accurately determined whether the measured fault information of each test message sequence is incorrect.
[0091] Furthermore, the measured fault information for each test message sequence is compared with the corresponding preset fault information. If the two are identical, it indicates that the measured fault information corresponds to a node without faults, and the node under test has passed the test for that test message sequence. If the two are different, it indicates that the measured fault information corresponds to a node with faults, and the node under test has failed the test for that test message sequence. As long as the node under test triggers an inaccurate measured fault information, it indicates that the node under test may have a communication problem, thus enabling accurate fault testing in different scenarios.
[0092] In some optional implementations, after determining that the node to be tested has a fault, the following steps are further performed:
[0093] The detection fault message is notified through a preset notification method; wherein, the detection fault message at least includes the message type of the target test message sequence and the identifier of the node to be tested; the target test message sequence is a test message sequence in which the measured fault information is different from the preset fault information.
[0094] As mentioned above, the preset fault information is the fault information that occurs when the node is not faulty. If the actual fault information measured in the test message sequence differs from the corresponding preset fault information, it indicates that the actual fault information measured in the test message sequence is faulty when the node is faulty, and the node under test may not be able to generate the correct measured fault information for the message type of the test message sequence. By notifying the relevant personnel of the message type of the test message sequence and the identifier of the node under test, the relevant personnel can be informed of the specific fault problem of the node under test in a timely manner.
[0095] Exemplarily, the above method (including the steps of generating a test script, running the test script, and determining a fault) may be executed based on a fault detection script generated in Python (a computer scripting language).
[0096] Based on the same inventive concept, the present application provides a fault detection device, see Figure 5 As shown, the fault detection device 500 includes:
[0097] The script generation module 501 is used to generate a test script corresponding to the node to be tested based on a preset test template and target information of the node to be tested; wherein the target information is information corresponding to the node to be tested in the test; and the preset test template is general information required for the test;
[0098] The script running module 502 is configured to run the test script in the node to be tested and obtain the measured fault information for the test script sent by the node to be tested;
[0099] The fault determination module 503 is configured to determine whether a fault occurs in the node to be measured based on the measured fault information.
[0100] In some optional implementations, the target information includes target fields corresponding to multiple test items; the script generation module 501 is specifically configured to:
[0101] For any test item, the initial field corresponding to the test item in the preset test template is replaced with the target field corresponding to the test item to obtain a test script corresponding to the node to be tested.
[0102] In some optional implementations, the script execution module 502 is specifically configured to:
[0103] The test messages in the test script are sent to the node to be tested in sequence based on the message sending order in the test script, so that after receiving any test message sequence, the node to be tested sends the measured fault information of the test message sequence to the electronic device; wherein the test message sequence includes test messages of the same message type sent continuously.
[0104] In some optional implementations, the fault determination module 503 is specifically configured to:
[0105] Determining whether the measured fault information of any test message sequence is the same as the preset fault information corresponding to the message type of the test message sequence;
[0106] If the actual fault information of the test message sequence is different from the corresponding preset fault information, it is determined that the node to be tested has a fault.
[0107] In some optional implementation manners, after determining that the node to be tested has a fault, the fault determination module 503 is further configured to:
[0108] The detection fault message is notified through a preset notification method; wherein, the detection fault message at least includes the message type of the target test message sequence and the identifier of the node to be tested; the target test message sequence is a test message sequence in which the measured fault information is different from the preset fault information.
[0109] Since the device is the device in the method in the embodiment of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0110] Based on the same technical concept, the embodiment of the present application further provides an electronic device 600, such as Figure 6 As shown, it includes at least one processor 601 and a memory 602 connected to the at least one processor. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 For example, the processor 601 and the memory 602 are connected via a bus 603. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0111] Among them, the processor 601 is the control center of the electronic device. It can use various interfaces and lines to connect various parts of the electronic device, and realize data processing by running or executing instructions stored in the memory 602 and calling data stored in the memory 602. Optionally, the processor 601 may include one or more processing units. The processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes the issuance of instructions. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip. In some embodiments, they may also be implemented separately on independent chips.
[0112] The processor 601 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the fault detection method can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0113] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0114] In the embodiment of the present application, the memory 602 stores a computer program. When the program is executed by the processor 601, the processor 601 executes:
[0115] Generate a test script corresponding to the node to be tested based on a preset test template and target information of the node to be tested; wherein the target information is information corresponding to the node to be tested in the test; and the preset test template is general information required for the test;
[0116] Running the test script in the node to be tested, and obtaining actual measured fault information for the test script sent by the node to be tested;
[0117] Determine whether the node to be tested has a fault based on the measured fault information.
[0118] In some optional implementations, the target information includes target fields corresponding to multiple test items; the preset test template includes initial fields corresponding to the multiple test items; and the processor 601 specifically executes:
[0119] For any test item, the initial field corresponding to the test item in the preset test template is replaced with the target field corresponding to the test item to obtain a test script corresponding to the node to be tested.
[0120] In some optional implementations, the processor 601 specifically performs:
[0121] The test messages in the test script are sent to the node to be tested in sequence based on the message sending order in the test script, so that after receiving any test message sequence, the node to be tested sends the measured fault information of the test message sequence to the electronic device; wherein the test message sequence includes test messages of the same message type sent continuously.
[0122] In some optional implementations, the processor 601 specifically performs:
[0123] Determining whether the measured fault information of any test message sequence is the same as the preset fault information corresponding to the message type of the test message sequence;
[0124] If the measured fault information of a test message sequence is different from the corresponding preset fault information, it is determined that the node to be tested has a fault.
[0125] In some optional implementations, after determining that the node to be tested fails, the processor 601 further executes:
[0126] The detection fault message is notified through a preset notification method; wherein, the detection fault message at least includes the message type of the target test message sequence and the identifier of the node to be tested; the target test message sequence is a test message sequence in which the measured fault information is different from the preset fault information.
[0127] Since the electronic device is the electronic device in the method in the embodiment of the present application, and the principle of solving the problem by the electronic device is similar to that of the method, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0128] Based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program that can be executed by an electronic device. When the program runs on the electronic device, the electronic device executes the steps of the above-mentioned fault detection method.
[0129] 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.
[0130] 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 present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 processes in the flowchart and / or block diagram. 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.
[0131] 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.
[0132] 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.
[0133] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0134] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A fault detection method, characterized in that: Applied to electronic equipment, the method comprises: Generate a test script corresponding to the node under test based on a preset test template and target information of the node under test; wherein the target information is information corresponding to the node under test in the test; the preset test template is general information required for the test; the target information includes target fields corresponding to multiple test items, the multiple test items including a first test item corresponding to generating a test message and a second test item corresponding to sending a test message; Running the test script in the node to be tested, and obtaining actual measured fault information for the test script sent by the node to be tested; Determining whether a fault occurs at the node to be measured based on the measured fault information; Running the test script in the node to be tested includes: The test messages in the test script are sent to the node to be tested in sequence based on the message sending order in the test script, so that after receiving any test message sequence, the node to be tested sends the measured fault information of the test message sequence to the electronic device; wherein the test message sequence includes test messages of the same message type sent continuously.
2. The method according to claim 1, characterized in that The preset test template includes initial fields corresponding to the multiple test items; Generate a test script corresponding to the node to be tested based on the preset test template and the target information of the node to be tested, including: For any test item, the initial field corresponding to the test item in the preset test template is replaced with the target field corresponding to the test item to obtain a test script corresponding to the node to be tested.
3. The method according to claim 2, characterized in that Determining whether a fault occurs in the node to be tested based on the measured fault information includes: Determining whether the measured fault information of any test message sequence is the same as the preset fault information corresponding to the message type of the test message sequence; If the actual fault information of the test message sequence is different from the corresponding preset fault information, it is determined that the node to be tested has a fault.
4. The method according to claim 3, characterized in that After determining that the node to be tested has failed, the method further includes: The detection fault message is notified through a preset notification method; wherein, the detection fault message at least includes the message type of the target test message sequence and the identifier of the node to be tested; the target test message sequence is a test message sequence in which the measured fault information is different from the preset fault information.
5. A fault detection device, characterized in that: Applied to electronic equipment, the device comprises: A script generation module is configured to generate a test script corresponding to the node under test based on a preset test template and target information of the node under test; wherein the target information is information corresponding to the node under test during the test; the preset test template is general information required for the test; the target information includes target fields corresponding to multiple test items, wherein the multiple test items include a first test item corresponding to generating a test message and a second test item corresponding to sending a test message; A script running module, configured to run the test script in the node to be tested and obtain actual fault information for the test script sent by the node to be tested; A fault determination module, configured to determine whether a fault occurs in the node to be tested based on the measured fault information; The script execution module is specifically used to: The test messages in the test script are sent to the node to be tested in sequence based on the message sending order in the test script, so that after receiving any test message sequence, the node to be tested sends the measured fault information of the test message sequence to the electronic device; wherein the test message sequence includes test messages of the same message type sent continuously.
6. The device according to claim 5, characterized in that The script generation module is specifically used to: For any test item, the initial field corresponding to the test item in the preset test template is replaced with the target field corresponding to the test item to obtain a test script corresponding to the node to be tested.
7. An electronic device, characterized in that: The electronic device includes at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes the method according to any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that It stores a computer program that can be executed by an electronic device. When the program runs on the electronic device, the electronic device executes the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Test method and device, terminal equipment and storage medium
CN111427778A
Block chain system testing method and system, computer equipment and storage medium
CN114817038A
Vehicle-mounted gateway test method and system and computer readable storage medium
CN115242689A