A system behavior testing method, device, equipment and storage medium

By determining the state of target nodes in the autonomous driving system, injecting or recovering exceptions, and obtaining callback messages, the problem of multi-node combination test case explosion in existing technologies is solved, achieving efficient system behavior testing and ensuring the safety and stability of the system.

CN115964239BActive Publication Date: 2026-02-06GUANGZHOU WERIDE TECH LTD CO
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211728765.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-02-06
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing technologies are insufficient for effectively testing the behavior of autonomous driving systems, especially when multiple nodes are combined, which leads to an explosion in the number of test cases, increases the testing workload, and makes it difficult to guarantee the safety and stability of the system.

Method used

By determining the current state of each target node in the system, it is determined whether to inject a preset exception. If the conditions are met, exception recovery or exception injection is performed, and callback messages are obtained to determine the behavioral test results, thereby reducing the number of test cases.

Benefits of technology

It enables behavioral testing of autonomous driving systems, assesses system performance and responsiveness, ensures system safety and stability, reduces the number of test cases, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115964239B_ABST
    Figure CN115964239B_ABST
Patent Text Reader

Abstract

The application discloses a system behavior testing method, device, equipment and storage medium. The method comprises the following steps: determining the current state of each target node in a system; if the current state of each target node is a preparation state, determining whether the system has been injected with a preset target exception; if the system has been injected with the target exception and the system satisfies a preset exception recovery condition, performing an exception recovery operation on the system; if the system has not been injected with the target exception and the system satisfies a preset exception injection condition, injecting the target exception into the system; obtaining a callback message of the system injected with the target exception; and determining a behavior test result of the system according to the callback message. The system can be tested for behavior, so that a staff member can determine the performance and reflection capability of the system according to the behavior test result of the system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of system testing, and particularly relates to a system behavior testing method, device, equipment and storage medium. BACKGROUND

[0002] In a distributed system, the distributed system is composed of multiple independent nodes, and the nodes communicate with each other through a message middleware. The nodes can be composed of multiple independent computers, which communicate with other nodes through a network connected to each other, or the nodes are independent processes on a computer, and the nodes communicate with other processes through inter-process communication. In the field of automatic driving, the modules in the automatic driving system are interdependent. For example, when the perception module perceives that the automatic driving system has a fault, the planning module needs to make a correct decision to keep the automatic driving vehicle in a safe state according to the fault.

[0003] Therefore, it is necessary to test the behavior of the automatic driving system, so as to judge the performance and reflection ability of the system according to the test results, so as to ensure the safety and stability of the system and protect the safety of the personnel on the vehicle. SUMMARY

[0004] Therefore, the present application provides a system behavior testing method, device, equipment and storage medium, which is used to solve the problem that the behavior of the automatic driving system needs to be tested, so as to judge the performance and reflection ability of the system according to the test results, so as to ensure the safety and stability of the system and protect the safety of the personnel on the vehicle.

[0005] To achieve the above purpose, the present scheme is as follows:

[0006] In a first aspect, a system behavior testing method comprises:

[0007] determining the current state of each target node in the system;

[0008] if the current state of each target node is a preparation state, determining whether the system has been injected with a preset target exception;

[0009] if the system has been injected with the target exception and the system meets a preset exception recovery condition, performing an exception recovery operation on the system;

[0010] if the system has not been injected with the target exception and the system meets a preset exception injection condition, injecting the target exception into the system;

[0011] obtaining a callback message of the system injected with the target exception;

[0012] determining a behavior test result of the system according to the callback message.

[0013] Preferably, the determining the current state of each target node in the system comprises:

[0014] initializing an internal variable corresponding to each target node in the system;

[0015] obtaining an initial state of each target node from a message middleware in the system in response to a request instruction of the monitoring node for monitoring each target node;

[0016] registering a message callback function and analyzing the initial state of each target node by using the message callback function to obtain the current state of each target node.

[0017] Preferably, if the system has been injected with the target exception and the system satisfies a preset exception recovery condition, performing an exception recovery operation on the system comprises:

[0018] if the system has been injected with the target exception and the system satisfies a preset exception recovery condition, obtaining a target file of the target exception;

[0019] extracting an error type corresponding to the target exception from the target file;

[0020] determining a recovery state of the system corresponding to the target exception based on the error type;

[0021] performing an exception recovery operation on the system according to the recovery state.

[0022] Preferably, the determining a behavior test result of the system according to the callback message comprises:

[0023] obtaining a target parameter in the callback message;

[0024] determining an expected configuration corresponding to the system based on the target parameter;

[0025] judging whether the target parameter meets a first preset standard according to the expected configuration;

[0026] if the target parameter meets the first preset standard, performing a field comparison between the matching result and the target parameter to obtain a behavior test result of the system.

[0027] Preferably, the judging whether the target parameter meets the first preset standard according to the expected configuration comprises:

[0028] extracting each state type from the expected configuration;

[0029] matching the target parameter with each of the state types to obtain a matching result;

[0030] if the matching result belongs to a first preset result, the target parameter meets a first preset standard;

[0031] if the matching result belongs to a second preset result, the target parameter does not meet the first preset standard.

[0032] Preferably, the matching of the target parameter with each of the state types to obtain a matching result comprises:

[0033] if the target parameter matches each of the state types successfully, determining a target state from each of the state types;

[0034] taking the target state as the matching result, and the matching result belongs to the first preset result;

[0035] if the target parameter fails to match each of the state types, taking a blank result as the matching result, and the matching result belongs to the second preset result.

[0036] Preferably, the abnormality injection condition is that a current time is between a preset abnormality injection time and an abnormality recovery time.

[0037] In a second aspect, a system behavior testing device comprises:

[0038] a current state determining module configured to determine a current state of each target node in a system;

[0039] an injection judging module configured to judge whether the system has been injected with a preset target abnormality if the current state of each target node is a preparation state;

[0040] an abnormality recovery operation module configured to perform an abnormality recovery operation on the system if the system has been injected with the target abnormality and the system meets a preset abnormality recovery condition;

[0041] an abnormality injection module configured to inject the target abnormality into the system if the system has not been injected with the target abnormality and the system meets a preset abnormality injection condition;

[0042] a callback message obtaining module configured to obtain a callback message of a system that has been injected with the target abnormality;

[0043] a behavior testing result determining module configured to determine a behavior testing result of the system according to the callback message.

[0044] Thirdly, a system behavior testing device, characterized in that it includes a memory and a processor;

[0045] The memory is used to store programs;

[0046] The processor is configured to execute the program to implement the various steps of the system behavior testing method as described in the first aspect.

[0047] Fourthly, a storage medium storing a computer program thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the method for testing system behavior as described in the first aspect.

[0048] As can be seen from the above technical solution, this application determines the current state of each target node in the system; if the current state of each target node is a ready state, it determines whether the system has been injected with a preset target anomaly; if the system has been injected with the target anomaly and the system meets the preset anomaly recovery conditions, it performs an anomaly recovery operation on the system; if the system has not been injected with the target anomaly and the system meets the preset anomaly injection conditions, it injects the target anomaly into the system; it obtains the callback message of the system that has been injected with the target anomaly; and it determines the behavioral test result of the system based on the callback message. This solution can perform behavioral testing on the system, thereby facilitating staff to judge the system's performance and responsiveness based on the behavioral test results. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0050] Figure 1 An optional flowchart of a system behavior testing method provided in an embodiment of this application;

[0051] Figure 2 A structural block diagram of a system provided in this application embodiment;

[0052] Figure 3 An optional flowchart of another system behavior testing method provided in an embodiment of this application;

[0053] Figure 4 An optional flowchart of another system behavior testing method provided in an embodiment of this application;

[0054] Figure 5A structural schematic diagram of a system behavior test device provided by an embodiment of the present application;

[0055] Figure 6 A structural schematic diagram of a system behavior test device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0057] In a distributed system, the distributed system is composed of multiple independent nodes, and the nodes communicate with each other through a message middleware. A node can be composed of multiple independent computers, which communicate with other nodes through a network connected to each other, or a node is an independent process on a computer, and each node communicates with other processes through inter-process communication. In the field of autonomous driving, the entire software system can be regarded as a single-machine distributed system, which can include camera sensors, perception modules, planning modules, etc. These modules are independently running but also mutually dependent, and the components communicate with each other through single-machine inter-process communication. When designing a distributed system, it is very important to fully consider the error handling when upstream and downstream faults occur on a node. For example, a perception module depends on each sensor, and a planning module depends on the output of the perception module. When the perception module discovers that a sensor has failed, or more extremely, when the perception module is killed due to a segmentation fault or other reasons, the planning module should receive these faults and make correct decisions (such as issuing a warning or pulling over, etc.). When developing a node, an engineer can test the behavior of the node under certain conditions by designing a reasonable unit test. However, the unit test is only for a single node and cannot test multiple nodes in combination. System integration testing can test the entire system, and based on the input and output of system fault tolerance use cases in the system design document, the overall behavior of the distributed system can be tested. However, there can be multiple states of each node in the distributed system, and the combination of node states can cause state explosion, so it is difficult to completely test each path. In addition, some scenarios need to be tested under certain conditions, such as the downtime of some nodes or the receipt of a message that is difficult to trigger. At this time, some active triggering mechanisms are needed for testing, and if manual intervention is used, the testing workload will be greatly increased.

[0058] Based on the above defects, the present application provides a system behavior testing method, which can test the behavior of an automatic driving system, so as to judge the performance and reflection ability of the system according to the test results, ensure the safety and stability of the system, protect the safety of the personnel on the vehicle, and support the testing of multiple node combinations without causing too many test cases due to state explosion.

[0059] The method can be applied in various computer terminals or intelligent terminals, and the execution subject can be a processor or server of the computer terminal or the intelligent terminal. The method flowchart of the method is shown in Figure 1 The method specifically includes the following steps.

[0060] S1: Determine the current state of each target node in the system.

[0061] In the present application, determining the current state of each target node in the system can ensure whether each target node is ready. The target node can represent various modules in the system. In an example, as shown in Figure 2 The target node can include a monitoring node, a sensor, a perception module, and a planning module, which can communicate with each other through a message middleware.

[0062] S2: If the current state of each target node is a ready state, determine whether the system has been injected with a preset target exception.

[0063] The current state of the target node can include a ready state and an unready state. If the current state of each target node is a ready state, it is determined that all target nodes are ready. At this time, it is necessary to determine whether the system has been injected with a preset target exception. In an example, the target exception can be that the left front camera of the system is black.

[0064] S3: If the system has been injected with the target exception, and the system meets a preset exception recovery condition, perform an exception recovery operation on the system.

[0065] When the system has been injected with the target exception, it is necessary to determine whether recovery is needed. It needs to be understood that the recovery here refers to restoring the system to the state before the exception, that is, the state of the system before being injected with the target exception.

[0066] If the system meets the recovery condition, perform an exception recovery operation on the system.

[0067] S4: If the system has not been injected with the target exception, and the system meets a preset exception injection condition, inject the target exception into the system.

[0068] If the system has not been injected with the target exception, it is determined whether the target exception needs to be injected at this time, and if the system meets the preset exception injection condition, the target exception can be injected into the system.

[0069] The exception injection condition can be set as that the current time is between the preset exception injection time and the exception recovery time.

[0070] S5: Obtain a callback message of the system injected with the target exception.

[0071] S6: Determine a behavior test result of the system according to the callback message.

[0072] If the behavior test result of the system determined according to the callback message is that some reactions of the system are not as expected, the system is unqualified.

[0073] As can be seen from the above technical solution, the current state of each target node in the system is determined, if the current state of each target node is the preparation state, it is determined whether the system has been injected with the preset target exception, if the system has been injected with the target exception and the system meets the preset exception recovery condition, an exception recovery operation is performed on the system, if the system has not been injected with the target exception and the system meets the preset exception injection condition, the target exception is injected into the system, a callback message of the system injected with the target exception is obtained, and a behavior test result of the system is determined according to the callback message. The scheme can perform behavior test on the system, so that the performance and reflection ability of the system can be determined by the staff according to the behavior test result of the system.

[0074] In one example, a system is composed of three target nodes A, B and C, wherein B depends on the state of A, C depends on the state of B, A can output three states, B can output two states, and C can output three states. If all possible states of the system need to be fully tested, 3*2*3=18 tests can be needed. However, if the test method provided by the application is used, the test is divided into A and B test and B and C test, and the test case can only need 3*2+2*3=12 tests. This reduces the number of test cases, and when the system is more complex, this test strategy can reduce the number of tests.

[0075] In the method provided by the embodiment of the application, the process of determining the current state of each target node in the system is specifically described as follows:

[0076] Initialize internal variables corresponding to each target node in the system; in response to a request instruction of the monitoring node for monitoring each target node, obtain the initial state of each target node from the message middleware in the system; register a message callback function, and analyze the initial state of each target node by using the message callback function to obtain the current state of each target node.

[0077] Specifically, the monitoring node in the distributed system can be started, and each internal variable in the monitoring node can be initialized; in response to a request instruction of the monitoring node for monitoring each target node in the distributed system, each message middleware between each target node can be obtained; then the initial state of each target node can be obtained from the message middleware, so that the initial state is analyzed.

[0078] The above scheme describes the process of determining the current state of each target node in the system in the present application. The process of performing an exception recovery operation on the system if the system has been injected with the target exception and the system meets the preset exception recovery condition will be described in detail.

[0079] If the system has been injected with the target exception and the system meets the preset exception recovery condition, the target file of the target exception is obtained; the error type corresponding to the target exception is extracted from the target file; based on the error type, the recovery state of the system corresponding to the target exception is determined; and the exception recovery operation is performed on the system according to the recovery state.

[0080] Optionally, the target file can also include an error opportunity and a system expected behavior. The above entire process can be as shown in Figure 3 .

[0081] The above describes the process of performing an exception recovery operation on the system if the system has been injected with the target exception and the system meets the preset exception recovery condition. The process of determining the behavior test result of the system according to the callback message in the present application will be described below. Please refer to Figure 4 .

[0082] S61: Obtain the target parameter in the callback message.

[0083] First, the callback message is obtained, and the target parameter in the callback message includes the behavior actually made by the system.

[0084] S62: Determine the expected configuration corresponding to the system based on the target parameter.

[0085] In one example, the expected configuration corresponding to the system is set as:

[0086] Anomaly: The front left camera of the system is black; the perception module is reporting an error; error 1 exists, but error 2 and error 3 do not exist.

[0087] S63: Determine whether the target parameters meet the first preset standard based on the desired configuration.

[0088] This process may include:

[0089] S631: Extract each state type from the desired configuration.

[0090] Using the above example, the status type could include: Error 1 (existence), Error 2 (non-existence), Error 3 (non-existence), etc.

[0091] S632: Match the target parameter with each of the state types to obtain a matching result; in this step, if the target parameter successfully matches each of the state types, then determine the target state from each of the state types; take the target state as the matching result, and the matching result belongs to a first preset result; if the target parameter fails to match each of the state types, then take the blank result as the matching result, and the matching result belongs to a second preset result.

[0092] If the target parameter is error 1, then matching error 1 with error 1, error 2, and error 3 will yield a matching result indicating that error 1 exists.

[0093] S633: If the matching result belongs to the first preset result, then the target parameter meets the first preset standard.

[0094] S634: If the matching result belongs to the second preset result, then the target parameter does not meet the first preset standard.

[0095] S64: If the target parameter meets the first preset standard, the matching result is compared with the target parameter field to obtain the behavior test result of the system.

[0096] After comparing each field, it was found that the target parameter was error 1, and the matching result was that error 1 existed. Therefore, the behavior test result obtained was that the system met expectations.

[0097] and Figure 1 Corresponding to the method described above, embodiments of the present invention also provide a system behavior testing apparatus for testing... Figure 1 The specific implementation of the method, the system behavior testing device provided in this embodiment of the invention can be used in a computer terminal or various mobile devices, combined with Figure 5 The test equipment for system behavior is introduced, such as... Figure 5 As shown, the device may include:

[0098] A current state determining module 10 is configured to determine the current state of each target node in the system;

[0099] An injection judging module 20 is configured to judge whether the system has been injected with a preset target exception if the current state of each target node is the preparation state;

[0100] An exception recovery operation module 30 is configured to perform an exception recovery operation on the system if the system has been injected with the target exception and the system satisfies a preset exception recovery condition;

[0101] An exception injection module 40 is configured to inject the target exception into the system if the system has not been injected with the target exception and the system satisfies a preset exception injection condition;

[0102] A callback message obtaining module 50 is configured to obtain a callback message of the system injected with the target exception;

[0103] A behavior test result determining module 60 is configured to determine a behavior test result of the system according to the callback message.

[0104] As can be seen from the above technical solution, the current state of each target node in the system is determined, and whether the system has been injected with a preset target exception is judged if the current state of each target node is the preparation state. If the system has been injected with the target exception and the system satisfies a preset exception recovery condition, an exception recovery operation is performed on the system. If the system has not been injected with the target exception and the system satisfies a preset exception injection condition, the target exception is injected into the system. A callback message of the system injected with the target exception is obtained, and a behavior test result of the system is determined according to the callback message. The scheme can perform a behavior test on the system, so that the performance and reflection ability of the system can be judged by the staff according to the behavior test result of the system.

[0105] In one example, the current state determining module 10 can include:

[0106] An initialization module is configured to initialize the internal variable corresponding to each target node in the system;

[0107] An initial state obtaining module is configured to obtain the initial state of each target node from the message middleware in the system in response to the request instruction of the monitoring node for monitoring each target node;

[0108] An analysis module is configured to register a message callback function and analyze initial states of each target node by using the message callback function to obtain current states of each target node.

[0109] In one example, the abnormal recovery operation module 30 can include:

[0110] A target file obtaining module is configured to obtain a target file of the target exception if the system has been injected with the target exception and the system meets a preset abnormal recovery condition.

[0111] An extracting module is configured to extract an error type corresponding to the target exception from the target file.

[0112] A recovery state obtaining module is configured to determine a recovery state of the system corresponding to the target exception based on the error type.

[0113] An executing module is configured to perform an abnormal recovery operation on the system according to the recovery state.

[0114] In one example, the behavior test result determining module 60 can include:

[0115] A target parameter obtaining module is configured to obtain a target parameter in the callback message.

[0116] An expected configuration determining module is configured to determine an expected configuration corresponding to the system based on the target parameter.

[0117] A preset standard judging module is configured to judge whether the target parameter meets a first preset standard according to the expected configuration.

[0118] A comparing module is configured to compare the matching result with the target parameter in a field to obtain a behavior test result of the system if the target parameter meets the first preset standard.

[0119] In one example, the preset standard judging module can include:

[0120] A state type extracting module is configured to extract each state type from the expected configuration.

[0121] A matching module is configured to match the target parameter with each state type to obtain a matching result.

[0122] A meeting module is configured to determine that the target parameter meets the first preset standard if the matching result belongs to a first preset result.

[0123] A non-meeting module is configured to determine that the target parameter does not meet the first preset standard if the matching result belongs to a second preset result.

[0124] In one example, the matching module can include:

[0125] a target state determining module, configured to determine a target state from each of the state types if the target parameter matches each of the state types;

[0126] a matching result first judging module, configured to take the target state as a matching result, and the matching result belongs to a first preset result;

[0127] a matching result second judging module, configured to take a blank result as a matching result if the target parameter fails to match each of the state types, and the matching result belongs to a second preset result.

[0128] Further, the embodiment of the present application provides a system behavior testing device. Optionally, Figure 6 A hardware structure block diagram of the system behavior testing device is shown, referring to Figure 6 The hardware structure of the system behavior testing device can include at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.

[0129] In the embodiment of the present application, the number of the processor 01, the communication interface 02, the memory 03 and the communication bus 04 is at least one, and the processor 01, the communication interface 02 and the memory 03 complete the communication with each other through the communication bus 04.

[0130] The processor 01 can be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiment of the present application, etc.

[0131] The memory 03 can include a high-speed RAM memory, and can also include a non-volatile memory, etc., for example, at least one disk memory.

[0132] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to execute the following system behavior testing method, which includes:

[0133] determining the current state of each target node in the system;

[0134] if the current state of each target node is a preparation state, judging whether the system has been injected with a preset target exception;

[0135] if the system has been injected with the target exception and the system satisfies a preset exception recovery condition, performing an exception recovery operation on the system;

[0136] if the system has not been injected with the target exception and the system satisfies a preset exception injection condition, injecting the target exception into the system;

[0137] obtaining a callback message of the system injected with the target exception;

[0138] determining a behavior test result of the system according to the callback message.

[0139] Optionally, the refinement and extension of the program can refer to the description of the system behavior test method in the method embodiment.

[0140] The embodiment of the present application further provides a storage medium which can store a program suitable for processor execution, and when the program runs, controls a device where the storage medium is located to perform the system behavior test method, comprising:

[0141] determining a current state of each target node in the system;

[0142] if the current state of each target node is a preparation state, judging whether the system has been injected with a preset target exception;

[0143] if the system has been injected with the target exception and the system satisfies a preset exception recovery condition, performing an exception recovery operation on the system;

[0144] if the system has not been injected with the target exception and the system satisfies a preset exception injection condition, injecting the target exception into the system;

[0145] obtaining a callback message of the system injected with the target exception;

[0146] determining a behavior test result of the system according to the callback message.

[0147] Specifically, the storage medium can be a computer readable storage medium, and the computer readable storage medium can be an electronic storage such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM.

[0148] Optionally, the refinement and extension of the program can refer to the description of the system behavior test method in the method embodiment.

[0149] In addition, each functional module in various embodiments of the present disclosure can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the functions are realized in the form of a software functional module and sold or used as an independent product, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present disclosure.

[0150] Finally, it should be noted that, in this document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0151] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between various embodiments can be referred to each other.

[0152] The above description of disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method of testing system behavior, characterized by, The method comprises the following steps: determining the current state of each target node in the system; the target nodes represent various modules in the system, including monitoring nodes, sensors, perception modules, planning modules, and intercommunication through message middleware; wherein: initializing the internal variables corresponding to each target node in the system; in response to the request instruction of the monitoring node for monitoring each target node, obtaining the initial state of each target node from the message middleware in the system; registering a message callback function and analyzing the initial state of each target node using the message callback function to obtain the current state of each target node; if the current state of each target node is a preparation state, it is determined whether the system has been injected with a preset target exception; if the system has been injected with the target exception and the system meets the preset exception recovery condition, an exception recovery operation is performed on the system; if the system has not been injected with the target exception and the system meets the preset exception injection condition, the target exception is injected into the system; the exception injection condition is that the current time is between the preset exception injection time and the exception recovery time; obtaining the callback message of the system injected with the target exception; determining the behavior test result of the system according to the callback message.

2. The method of claim 1, wherein, If the system has been injected with the target exception and the system meets the preset exception recovery condition, the method comprises the following steps: if the system has been injected with the target exception and the system meets the preset exception recovery condition, obtaining a target file of the target exception; extracting the error type corresponding to the target exception from the target file; based on the error type, determining the recovery state of the system corresponding to the target exception; performing an exception recovery operation on the system according to the recovery state.

3. The method of claim 1, wherein, The method of determining the behavior test result of the system according to the callback message comprises the following steps: obtaining a target parameter in the callback message; determining an expected configuration corresponding to the system based on the target parameter; determining whether the target parameter meets the first preset standard according to the expected configuration; if the target parameter meets the first preset standard, performing a field comparison between the matching result and the target parameter to obtain the behavior test result of the system.

4. The method of claim 3, wherein, The method of determining whether the target parameter meets the first preset standard according to the expected configuration comprises the following steps: extracting each state type from the expected configuration; matching the target parameter with each state type to obtain a matching result; if the matching result belongs to the first preset result, the target parameter meets the first preset standard; if the matching result belongs to the second preset result, the target parameter does not meet the first preset standard.

5. The method of claim 4, wherein, The method of matching the target parameter with each state type to obtain a matching result comprises the following steps: if the target parameter matches each state type successfully, determining a target state from each state type; the target state is used as the matching result, and the matching result belongs to the first preset result; If the target parameter fails to match each state type, a blank result is taken as the matching result, and the matching result belongs to a second preset result.

6. A test apparatus for system behavior, characterized by, The system comprises: a current state determining module, configured to determine a current state of each target node in a system; the target nodes represent various modules in the system, including a monitoring node, a sensor, a perception module, and a planning module, and intercommunication is performed through a message middleware; wherein: internal variables corresponding to each target node in the system are initialized; in response to a request instruction of the monitoring node for monitoring each target node, an initial state of each target node is obtained from the message middleware in the system; a message callback function is registered, and the initial state of each target node is analyzed by using the message callback function to obtain the current state of each target node; an injection determining module, configured to determine whether the system has been injected with a preset target exception if the current state of each target node is a preparation state; an exception recovery operation module, configured to perform an exception recovery operation on the system if the system has been injected with the target exception and the system satisfies a preset exception recovery condition; an exception injection module, configured to inject the target exception into the system if the system has not been injected with the target exception and the system satisfies a preset exception injection condition; the exception injection condition is that a current time is between a preset exception injection time and an exception recovery time; a callback message obtaining module, configured to obtain a callback message of the system injected with the target exception; a behavior test result determining module, configured to determine a behavior test result of the system according to the callback message.

7. A test apparatus for system behavior, characterized by, The system comprises a memory and a processor; the memory is configured to store a program; the processor is configured to execute the program to implement each step of the system behavior test method according to any one of claims 1-5.

8. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement each step of the system behavior test method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Fault injection test method and device and storage medium

    CN112698974A