Chaotic test method and device, electronic equipment and storage medium

By generating unique scenario mapping identifiers and configuring fault message information, the problem of existing chaos testing relying on manual experience is solved, efficient and accurate chaos testing results are achieved, and the comprehensiveness and efficiency of the testing process are improved.

CN120614286APending Publication Date: 2025-09-09INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510851387.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

Existing chaos testing methods rely on manual experience, resulting in large errors in test results, low test efficiency, and difficulty in simulating real failure scenarios. The test results are not accurate and efficient enough.

Method used

By generating a unique scenario mapping identifier, configuring the chaos test identifier and fault message information, using storage middleware to store and accurately feedback at the target node, customized generation and diversity injection of fault messages are achieved, ensuring the comprehensiveness and accuracy of the testing process.

Benefits of technology

It improves the accuracy and efficiency of chaos testing results, reduces dependence on manual experience, and ensures the comprehensiveness and accuracy of the testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120614286A_ABST
    Figure CN120614286A_ABST
Patent Text Reader

Abstract

The invention discloses a chaos test method and device, electronic equipment and a storage medium, and relates to the field of system tests.The method comprises the steps that a fault message configuration result of a target node is obtained, and a matched scene mapping identifier is generated according to the fault message configuration result; configuring a chaos test identifier and a scene mapping identifier in the chaos test request, and storing the scene mapping identifier and the fault message information to storage middleware; and sending the chaos test request to the target node, so that the target node obtains the fault message information based on the scene mapping identifier, and executes a chaos test according to the fault message information. According to the technical scheme, user-defined generation of the fault message configuration result is achieved, the fault message configuration result comes from the real abnormal response fed back by the downstream node, the accuracy of the chaos test result is improved, meanwhile, the obtaining mode of the fault message information is called based on the scene mapping identifier, and the chaos test efficiency is improved. And the test efficiency of the chaos test process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of system testing and financial technology, and in particular to a chaos testing method, device, electronic device and storage medium. Background Art

[0002] With the evolution of distributed architectures such as microservices, a business function often needs to pass through a large number of intermediate service nodes to complete business processing. This places higher demands on the connection processing between nodes. In order to ensure the effective handling of abnormal responses between nodes, chaos testing has become an important testing method.

[0003] Existing chaos testing methods typically involve the following three solutions: the first relies on the testing experience of developers to manually identify whether the upstream and downstream relationships between service providers and service consumers will lead to a decrease in business system availability; the second is to conduct end-to-end joint debugging tests through the developers of each node, and cooperate to simulate abnormal scenarios for testing; the third is to complete chaos testing by registering fake services that always return abnormalities with the registration center.

[0004] However, the testing method of Option 1 relies entirely on manual experience, resulting in large errors in the test results. Option 2 also relies on manual fault simulation, which requires high labor costs and testing literacy, and has low testing efficiency. Option 3 not only requires manual coding, but the chaos testing process can only simulate single faults, which has a poor degree of restoration of real fault scenarios and also has large errors in the test results. Summary of the Invention

[0005] The present invention provides a chaos testing method, device, electronic equipment and storage medium to solve the problem of large errors in chaos testing results.

[0006] According to another aspect of the present invention, a chaos testing method is provided, comprising:

[0007] In response to obtaining the fault message configuration result of the target node, generating a matching scenario mapping identifier according to the fault message configuration result; wherein the scenario mapping identifier is unique;

[0008] Configuring a chaos test identifier and the scenario mapping identifier in a chaos test request, and storing the scenario mapping identifier and the fault message information matching the scenario mapping identifier in a storage middleware;

[0009] The chaos test request is sent to the target node, so that the target node obtains the fault message information based on the scenario mapping identifier and performs a chaos test according to the fault message information.

[0010] Before obtaining the target node's fault message configuration result, the method further includes: obtaining all exception response messages received by the target node and classifying each exception response message using preset classification parameters to obtain the target node's fault message configuration result based on the classification results; wherein the preset classification parameters include at least one of a feedback node identifier, a communication protocol type, a response exception type, and an error code type. This not only improves the configuration convenience of the fault message configuration result, but also enables a variety of fault injections during chaos testing, ensuring the comprehensiveness of the chaos testing process.

[0011] Before classifying each exception response message by the preset classification parameter, the method further includes: performing deduplication processing on each exception response message according to the preset classification parameter, thereby avoiding the repetition of exception response messages with the same message content or the same message type, and simplifying the complexity of the user configuration process.

[0012] Before obtaining the fault message configuration result for the target node, the method further includes: generating the fault message configuration result for the target node based on the preset classification parameters; wherein different feedback nodes correspond to different types of exception response messages. By configuring different types of exception response messages for different feedback nodes corresponding to the target node, the diversity of fault injection during chaos testing is further achieved, ensuring the comprehensiveness of the chaos testing process.

[0013] The chaotic test request is sent to the target node so that the target node obtains the fault message information based on the scene mapping identifier, specifically including: if the entry interception component located at the entry position of the target node detects that the current request has a chaotic test identifier, the request identifier and scene mapping identifier of the current request are added to the thread context; if the exit interception component located at the exit position of the target node detects the request identifier in the thread context, the corresponding fault message information is obtained according to the scene mapping identifier in the thread context. This achieves accurate interception of chaotic test requests and precise feedback of fault message information.

[0014] The execution of the chaos test according to the fault message information includes: restoring the fault message information to send the matching actual memory object to the target node, thereby simplifying the transmission data volume of the fault message information and ensuring the orderly execution of the chaos test.

[0015] According to another aspect of the present invention, there is provided a chaos testing device, comprising:

[0016] A mapping identifier acquisition module, configured to generate a matching scenario mapping identifier according to the fault message configuration result obtained for the target node in response to the fault message configuration result; wherein the scenario mapping identifier is unique;

[0017] An identification configuration execution module is used to configure a chaos test identification and the scenario mapping identification in a chaos test request, and store the scenario mapping identification and the fault message information matching the scenario mapping identification in a storage middleware;

[0018] The test request sending module is used to send the chaos test request to the target node, so that the target node obtains the fault message information based on the scenario mapping identifier and performs chaos testing according to the fault message information.

[0019] According to another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the chaos testing method described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the chaos testing method described in any embodiment of the present invention when executed.

[0021] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the chaos testing method according to any embodiment of the present invention is implemented.

[0022] The technical solution of the embodiment of the present invention is to generate a matching scenario mapping identifier according to the fault message configuration result after obtaining the fault message configuration result of the target node; configure the chaos test identifier and the scenario mapping identifier in the chaos test request, and store the scenario mapping identifier and the fault message information matching the scenario mapping identifier in the storage middleware; send the chaos test request to the target node so that the target node obtains the fault message information based on the scenario mapping identifier, and performs chaos testing based on the fault message information. In this way, not only the customized generation of the fault message configuration result is achieved, avoiding the dependence of the configuration process on manual experience, but also the fault message configuration result is derived from the real abnormal response fed back by the downstream node, which improves the accuracy of the chaos test result. At the same time, the acquisition method of the fault message information is called based on the scenario mapping identifier, which improves the test efficiency of the chaos test process.

[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1 This is a flow chart of a chaos testing method provided according to the first embodiment of the present invention;

[0026] Figure 2 This is a flow chart of another chaos testing method provided according to the second embodiment of the present invention;

[0027] Figure 3 1 is a flow chart of a chaos test system performing a chaos test according to a third embodiment of the present invention;

[0028] Figure 4 This is a structural diagram of a chaos testing device provided according to a fourth embodiment of the present invention;

[0029] Figure 5 The figure is a schematic diagram of the structure of an electronic device for implementing the chaos testing method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] Example 1

[0033] Figure 1 This is a flowchart of a chaos testing method provided by the first embodiment of the present invention. This embodiment is applicable to the case where a matching scene mapping identifier is generated according to the fault message configuration result, and fault message information is obtained based on the scene mapping identifier. The method can be executed by a chaos testing device, which can be implemented in the form of hardware and / or software. The chaos testing device can be configured in a chaos testing system, which can be configured in electronic devices such as servers. The chaos testing system can be used to perform chaos testing on each business node in the business system. Figure 1 As shown, the method includes:

[0034] S101: In response to obtaining a fault message configuration result of a target node, generate a matching scenario mapping identifier according to the fault message configuration result; wherein the scenario mapping identifier is unique.

[0035] The target node may involve calls to one or more downstream nodes in the business system. The downstream node (i.e., the called node) feeds back a response message to the target node based on the call request. Therefore, the downstream node is actually also the feedback node corresponding to the target node. In an embodiment of the present invention, all abnormal response messages are extracted from the response messages fed back to the target node by each called node, and each abnormal response message is provided to the tester as an alternative option.

[0036] Taking the exception response message of the HTTP protocol (Hypertext Transfer Protocol) as an example, the extracted content of the exception response message includes the exception message body, the header information of the exception message and the request identifier of the exception message, that is, the URL (Uniform Resource Locator) identifier; taking the exception response message of the RPC (Remote Procedure Call) protocol as an example, the extracted content of the exception response message includes the exception output parameter, the object class of the exception output parameter, the interface path (that is, the request identifier) ​​and the exception error directly thrown by the RPC interface.

[0037] The fault message configuration result includes one or more exception response messages, which can be pre-selected by the tester; for example, node A (i.e., the target node) in the business system involves calls to downstream nodes B, C, and D. The fault message configuration result can be specifically to configure the message fed back by node B as exception response message 1, and the message fed back by node C as exception response message 2, and not configure the message fed back by node D. That is, during the chaos test, the message actually fed back by node D is used to simulate the business scenario where normal response and exception response occur simultaneously in a real business environment.

[0038] After obtaining the fault message configuration result, a unique scenario mapping identifier can be generated based on the content and timestamp information of each exception response message contained in the fault message configuration result; in addition, when generating the scenario mapping identifier, a random number and the identity of the tester can also be inserted, for example, a 128-bit scenario mapping identifier can be generated by UUID (Universally Unique Identifier).

[0039] Optionally, in an embodiment of the present invention, before obtaining the fault message configuration result of the target node, it also includes: obtaining all abnormal response messages received by the target node, and classifying each abnormal response message according to preset classification parameters to obtain the fault message configuration result of the target node based on the classification result; wherein the preset classification parameters include at least one of the feedback node identifier, communication protocol type, response exception type and error code type.

[0040] Specifically, the feedback node identifier represents the identity identifier of the downstream node that sends the exception response message. As described in the above technical solution, when node A involves calling node B, node C and node D, the feedback node identifier includes the identifiers of node B, node C and node D; the communication protocol type refers to the type of communication protocol supported by the current exception response message. As described in the above technical solution, the communication protocol type may include HTTP protocol and RPC protocol.

[0041] Response exception types can include expected exceptions, illegal errors, and unexpected errors. Expected exceptions refer to expected exceptions returned by the node, which have a clear processing flow and a pre-defined status code. For example, if the status code 100 is fed back by the called node, it indicates that the product inventory is insufficient, and the target node needs to trigger the corresponding replenishment process based on the error type. Although the above exception message indicates an abnormal situation, it is actually an expected exception.

[0042] Illegal errors refer to errors caused by violating code development rules or logical constraints, such as returning malformed data or undefined exception status codes. Unexpected errors refer to sudden errors that are not explicitly handled in the code, usually caused by environmental, configuration, or underlying system problems, such as unknown errors returned due to code defects. In addition, the same error code indicates the same type of exception, while different error codes indicate different types of exceptions, which is also the basis for classifying exception response messages.

[0043] By classifying each exception response message through preset classification parameters, the tester is intuitively shown the category to which each exception response message belongs, and then guided to complete the customized configuration of multiple types of exception response messages. This not only improves the configuration convenience of fault message configuration results, but also realizes the diversity of fault injection during chaos testing, ensuring the comprehensiveness of the chaos testing process.

[0044] Optionally, in an embodiment of the present invention, before obtaining the fault message configuration result of the target node, it also includes: generating the fault message configuration result of the target node according to the preset classification parameters; wherein different feedback nodes correspond to different types of abnormal response messages.

[0045] Specifically, in addition to displaying the classification categories of each exception response message to the tester to guide the tester to complete the customization of the fault message configuration results, the configuration acquisition of the fault message configuration results can also be automatically completed according to different classification categories; taking the above technical solution as an example, the response exception type can include expected exceptions, illegal errors and unexpected errors. Then, when performing chaos testing on node A, the message feedback from node B can be configured as an expected exception, the message feedback from node C can be configured as an illegal error, and the message feedback from node D can be configured as an unexpected error. In this way, by configuring different types of exception response messages for different feedback nodes corresponding to the target node, the diversity of fault injection during chaos testing is further achieved, ensuring the comprehensiveness of the chaos testing process.

[0046] Optionally, in an embodiment of the present invention, before classifying each exception response message using preset classification parameters, the method further includes: performing deduplication processing on each exception response message based on the preset classification parameters. Deduplication processing can be performed on the exception response messages using one or more of the preset classification parameters to avoid repeated occurrences of exception response messages with the same message content or the same message type, thereby simplifying the complexity of the user configuration process.

[0047] S102: Configure a chaos test identifier and the scenario mapping identifier in a chaos test request, and store the scenario mapping identifier and fault message information matching the scenario mapping identifier in a storage middleware.

[0048] The chaos test identifier is the identification information added to the chaos test request after the chaos test request is colored, which is used to indicate that the current request is a chaos test request. The chaos test identifier can be added to different positions of the chaos test request depending on the communication protocol; for example, when the chaos test request is an HTTP protocol request, the chaos test identifier is added to the header information; when the chaos test request is an RPC protocol request, the chaos test identifier is added to the additional information; at the same time, the above-mentioned scenario mapping identifier is also placed in the chaos test request.

[0049] Since the scene mapping identifier is generated based on the fault message configuration result, the specific message content (i.e., fault message information) in the fault message configuration result obviously matches the scene mapping identifier, and the scene mapping identifier and the fault message information matching the scene mapping identifier are stored in the storage middleware; wherein, the storage middleware is a software layer located between the application software and the underlying storage system, which provides a unified data access interface for the application by abstracting the underlying storage technology; in an embodiment of the present invention, the storage middleware may include a distributed cache middleware.

[0050] S103: Send the chaos test request to the target node, so that the target node obtains the fault message information based on the scenario mapping identifier and performs a chaos test according to the fault message information.

[0051] After the chaos test request is sent to the target node, when the target node detects the presence of a chaos test identifier in the input request, it determines that the current input request is a chaos test request, and continues to obtain the scene mapping identifier in the chaos test request, and then obtains the matching fault message information through the storage middleware according to the scene mapping identifier. The fault message information describes the specific fault content, thereby completing the fault injection operation.

[0052] The technical solution of the embodiment of the present invention is to generate a matching scenario mapping identifier according to the fault message configuration result after obtaining the fault message configuration result of the target node; configure the chaos test identifier and the scenario mapping identifier in the chaos test request, and store the scenario mapping identifier and the fault message information matching the scenario mapping identifier in the storage middleware; send the chaos test request to the target node so that the target node obtains the fault message information based on the scenario mapping identifier, and performs chaos testing based on the fault message information. In this way, not only the customized generation of the fault message configuration result is achieved, avoiding the dependence of the configuration process on manual experience, but also the fault message configuration result is derived from the real abnormal response fed back by the downstream node, which improves the accuracy of the chaos test result. At the same time, the acquisition method of the fault message information is called based on the scenario mapping identifier, which improves the test efficiency of the chaos test process.

[0053] Example 2

[0054] Figure 2 This is a flowchart of a chaos testing method provided by the second embodiment of the present invention. The relationship between this embodiment and the above embodiment is that the interception of the call request is completed by deploying the entry interception component and the exit interception component on the target node, such as Figure 2 As shown, the method further includes:

[0055] S201: In response to obtaining a fault message configuration result of a target node, generate a matching scenario mapping identifier according to the fault message configuration result; wherein the scenario mapping identifier is unique.

[0056] S202: Configure a chaos test identifier and the scenario mapping identifier in a chaos test request, and store the scenario mapping identifier and fault message information matching the scenario mapping identifier in a storage middleware.

[0057] S203: If the entry interception component located at the entry position of the target node detects that the current request has a chaos test identifier, the request identifier and the scene mapping identifier of the current request are added to the thread context.

[0058] S204: If the request identifier in the thread context is detected by the exit interception component located at the exit of the target node, corresponding fault message information is obtained according to the scenario mapping identifier in the thread context.

[0059] Whether in the HTTP framework or the RPC framework, when the current chaos test system sends a chaos test request to the target node, the chaos test request must pass through the necessary class method of the server framework; among them, the necessary class method refers to the core entry of the server framework to process the request; therefore, it is necessary to insert an entry interception component at a specified position before the framework executes the core business logic, so as to detect the chaos test request through the entry interception component.

[0060] When the entry interception component detects the presence of a chaos test identifier in the current request, it determines that the current request is a chaos test request, and accordingly places the request identifier and mapping identifier string in the current request into the thread context; wherein, the request identifier refers to the identifier of the current chaos test request, which is also unique. The request identifiers of different types of chaos test requests and between chaos test requests and normal business requests are all different; the thread context is a mechanism for implementing thread-level data isolation in a multi-threaded environment, which ensures that an independent copy of the variables is provided for each thread, ensuring that threads do not interfere with each other when operating data, thereby avoiding synchronization overhead.

[0061] After the target node receives the chaos test request, it calls a downstream node. At this time, when the target node calls the downstream node as a service consumer, it will also go through the core methods of the framework, and these methods are also the necessary paths of the call link. Therefore, the exit interception component is also inserted at the specified position before the framework executes the above core methods to detect whether the current request is a chaos test request through the exit interception component.

[0062] When the exit interception component detects the request identifier in the thread context, it can be determined that the current request is a chaos test request and intercepted. At the same time, the fault message information is obtained from the storage middleware through the scenario mapping identifier recorded in the thread context, and the fault message information is fed back to the target node, thereby injecting the specified type of fault into the target node. In this way, the entry interception component inserted at the entry position of the target node can accurately detect the chaos test identifier, and the exit interception component inserted at the exit position of the target node can detect and obtain the request identifier, achieving accurate interception of the chaos test request and accurate feedback of the fault message information.

[0063] S205: Enable the target node to perform a chaos test according to the fault message information.

[0064] Optionally, in an embodiment of the present invention, the execution of chaos testing according to the fault message information includes: restoring the fault message information to send the matching actual memory object to the target node. Specifically, in order to enable testers to more intuitively know the message content of each abnormal response message, the fault message information can exist in the form of descriptive information, that is, describing the specific content included in the current message, rather than carrying the code program actually executed by the target node, thereby simplifying the amount of data transmitted by the fault message information; at the same time, after obtaining the fault message information, the actual memory object is constructed through reflection and deserialization technology, so that the target node performs chaos testing based on the restoration result, that is, the executable code program, so as to ensure the orderly execution of the chaos test.

[0065] The technical solution of the embodiment of the present invention is that if the chaos test system detects the presence of a chaos test identifier in the current request through the entry interception component located at the target node's entry point, it will add the current request's request identifier and scenario mapping identifier to the thread context. If the exit interception component located at the target node's exit point detects the request identifier in the thread context, it will obtain the corresponding fault message information based on the scenario mapping identifier in the thread context. This achieves accurate interception of chaos test requests and precise feedback of fault message information.

[0066] Example 3

[0067] Figure 3FIG. 3 is a flow chart of a chaos test system performing chaos testing provided by the third embodiment of the present invention. Figure 3 As shown in FIG, the chaos test system includes an anomaly collection module, a chaos initiation module, an interception module and a restoration module.

[0068] After the tester initiates a collection request to the exception collection module, the exception collection module sends a collection request to the target node; the target node feeds back all the acquired exception response messages to the exception collection module; the exception collection module deduplicates each acquired exception response message and displays the deduplicated exception response messages to the tester as alternative options.

[0069] The tester selects the required exception response message based on the alternative options and forms a fault message configuration result, and then sends the fault message configuration result to the chaos initiation module; the chaos initiation module configures the chaos test identifier and the scene mapping identifier in the chaos test request (that is, completes the coloring operation), and stores the scene mapping identifier and the fault message information matching the scene mapping identifier to the storage middleware (that is, completes the cache upload operation).

[0070] When the chaos initiation module sends the chaos test request to the target node, the chaos test request will first pass through the interception module; the interception module specifically includes an entry interception component and an exit interception component; as described in the above technical solution, the entry interception component first detects that the current request has a chaos test identifier, and then adds the request identifier and scene mapping identifier of the current request to the thread context; the exit interception component detects the request identifier in the thread context, and obtains the corresponding fault message information according to the scene mapping identifier in the thread context, thereby intercepting the call request sent by the target node to the downstream node.

[0071] The interception module sends the fault message information to the restoration module; the restoration module restores the fault message information and returns the matching actual memory object to the interception module; the interception module then injects the actual memory object as a fault into the target node; after the target node performs chaos testing based on the actual memory object, it returns the test results of the chaos test request to the chaos initiation module; the chaos initiation module displays the test results of the chaos test request to the tester.

[0072] The technical solution of the embodiment of the present invention is to generate a matching scenario mapping identifier according to the fault message configuration result after obtaining the fault message configuration result of the target node; configure the chaos test identifier and the scenario mapping identifier in the chaos test request, and store the scenario mapping identifier and the fault message information matching the scenario mapping identifier in the storage middleware; send the chaos test request to the target node so that the target node obtains the fault message information based on the scenario mapping identifier, and performs chaos testing based on the fault message information. In this way, not only the customized generation of the fault message configuration result is achieved, avoiding the dependence of the configuration process on manual experience, but also the fault message configuration result is derived from the real abnormal response fed back by the downstream node, which improves the accuracy of the chaos test result. At the same time, the acquisition method of the fault message information is called based on the scenario mapping identifier, which improves the test efficiency of the chaos test process.

[0073] Example 4

[0074] Figure 4 This is a structural block diagram of a chaos testing device provided by the fourth embodiment of the present invention, which specifically includes:

[0075] A mapping identifier acquisition module 401 is configured to generate a matching scenario mapping identifier based on the acquired fault message configuration result of the target node; wherein the scenario mapping identifier is unique;

[0076] The identification configuration execution module 402 is used to configure the chaos test identification and the scene mapping identification in the chaos test request, and store the scene mapping identification and the fault message information matching the scene mapping identification in the storage middleware;

[0077] The test request sending module 403 is used to send the chaos test request to the target node, so that the target node obtains the fault message information based on the scenario mapping identifier and performs a chaos test according to the fault message information.

[0078] The technical solution of the embodiment of the present invention is to generate a matching scenario mapping identifier according to the fault message configuration result after obtaining the fault message configuration result of the target node; configure the chaos test identifier and the scenario mapping identifier in the chaos test request, and store the scenario mapping identifier and the fault message information matching the scenario mapping identifier in the storage middleware; send the chaos test request to the target node so that the target node obtains the fault message information based on the scenario mapping identifier, and performs chaos testing based on the fault message information. In this way, not only the customized generation of the fault message configuration result is achieved, avoiding the dependence of the configuration process on manual experience, but also the fault message configuration result is derived from the real abnormal response fed back by the downstream node, which improves the accuracy of the chaos test result. At the same time, the acquisition method of the fault message information is called based on the scenario mapping identifier, which improves the test efficiency of the chaos test process.

[0079] Optionally, the chaos testing device is also used to obtain all abnormal response messages received by the target node, and classify each abnormal response message according to preset classification parameters to obtain the fault message configuration result of the target node based on the classification result; wherein the preset classification parameters include at least one of the feedback node identifier, communication protocol type, response exception type and error code type.

[0080] Optionally, the chaos testing device is further configured to perform deduplication processing on each abnormal response message according to the preset classification parameters.

[0081] Optionally, the chaos testing device is further used to generate a fault message configuration result of the target node according to the preset classification parameters; wherein different feedback nodes correspond to different types of abnormal response messages.

[0082] Optionally, the test request sending module 403 is specifically used to add the request identifier and scene mapping identifier of the current request to the thread context if it is detected that the current request has a chaos test identifier through the entry interception component located at the entry position of the target node; if it is detected that the request identifier in the thread context is detected through the exit interception component located at the exit position of the target node, obtain the corresponding fault message information according to the scene mapping identifier in the thread context.

[0083] Optionally, the test request sending module 403 is further configured to perform restoration processing on the fault message information to send the matching actual memory object to the target node.

[0084] The above device can execute the chaos testing method provided by any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the chaos testing method provided by any embodiment of the present invention.

[0085] Example 5

[0086] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, electronic devices, blade electronic devices, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0087] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0088] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0089] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the chaos testing method.

[0090] In some embodiments, the chaos testing method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on a heterogeneous hardware accelerator via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by a processor, one or more steps of the chaos testing method described above can be performed. Alternatively, in other embodiments, the processor can be configured to perform the chaos testing method by any other appropriate means (for example, by means of firmware).

[0091] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0092] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0093] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0094] To provide interaction with a user, the systems and techniques described herein can be implemented on a heterogeneous hardware accelerator that has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the heterogeneous hardware accelerator. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0095] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0096] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0097] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0098] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A chaos testing method, characterized in that: include: In response to obtaining the fault message configuration result of the target node, generating a matching scenario mapping identifier according to the fault message configuration result; wherein the scenario mapping identifier is unique; Configuring a chaos test identifier and the scenario mapping identifier in a chaos test request, and storing the scenario mapping identifier and the fault message information matching the scenario mapping identifier in a storage middleware; The chaos test request is sent to the target node, so that the target node obtains the fault message information based on the scenario mapping identifier and performs a chaos test according to the fault message information.

2. The chaos testing method according to claim 1, characterized in that: Before obtaining the fault message configuration result of the target node, the following steps are also included: Obtain all exception response messages received by the target node, and classify each exception response message according to preset classification parameters to obtain a fault message configuration result of the target node based on the classification result; wherein the preset classification parameters include at least one of the feedback node identifier, the communication protocol type, the response exception type, and the error code type.

3. The chaos testing method according to claim 2, characterized in that: Before classifying each exception response message using the preset classification parameters, the following steps are also performed: Deduplication processing is performed on each abnormal response message according to the preset classification parameters.

4. The chaos testing method according to claim 2, characterized in that: Before obtaining the fault message configuration result of the target node, the following steps are also included: A fault message configuration result of the target node is generated according to the preset classification parameters; wherein different feedback nodes correspond to different types of abnormal response messages.

5. The chaos testing method according to claim 1, characterized in that: The sending the chaos test request to the target node so that the target node obtains the fault message information based on the scenario mapping identifier specifically includes: If the entry interception component located at the entry position of the target node detects that the current request has a chaos test identifier, the request identifier and the scene mapping identifier of the current request are added to the thread context; If the request identifier in the thread context is detected by the exit interception component located at the exit position of the target node, the corresponding fault message information is obtained according to the scene mapping identifier in the thread context.

6. The chaos testing method according to claim 1, characterized in that: The performing of chaos testing according to the fault message information includes: The fault message information is restored to send the matching actual memory object to the target node.

7. A chaos testing device, characterized in that: include: A mapping identifier acquisition module, configured to generate a matching scenario mapping identifier according to the fault message configuration result obtained for the target node in response to the fault message configuration result; wherein the scenario mapping identifier is unique; An identification configuration execution module is used to configure a chaos test identification and the scenario mapping identification in a chaos test request, and store the scenario mapping identification and the fault message information matching the scenario mapping identification in a storage middleware; The test request sending module is used to send the chaos test request to the target node, so that the target node obtains the fault message information based on the scenario mapping identifier and performs chaos testing according to the fault message information.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the chaos testing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the chaos testing method according to any one of claims 1 to 6 when executed.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the chaos testing method according to any one of claims 1 to 6.