Fault drill method, device, equipment and storage medium

By deploying a proxy client on the application interface, generating a call chain base class template and injecting fault messages, the problem of inaccurate fault injection in chaotic engineering is solved, and interface-level fault control and accurate fault simulation in the production environment are realized.

CN119172219BActive Publication Date: 2026-04-21CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNITED NETWORK COMM GRP CO LTD
Filing Date
2023-06-20
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The current granularity of fault injection in chaos engineering is too coarse, making it impossible to achieve logical isolation of fault injection at the interface level. Furthermore, fault simulation scenarios cannot be conducted in a production environment, resulting in inaccurate fault simulation.

Method used

By deploying a proxy client at the application interface, activating the control switch, determining the interface identifier, and generating a call chain base class template, fault messages are injected into the target call chain base class template, and fault feedback information is compared to determine the source of the fault.

Benefits of technology

It achieves fault control scope based on application interfaces, improves the accuracy of fault simulation, and enables precise fault drills in production environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172219B_ABST
    Figure CN119172219B_ABST
Patent Text Reader

Abstract

The application provides a fault simulation method and device, equipment and a storage medium. Before a control device performs fault injection on an application interface, a control switch of a proxy client of the application interface is turned on, so that the control range of the fault is determined in units of the application interface. Through scanning of each application interface, a plurality of call link base class templates are determined. The control device selects one call link base class template as a target call link base class template, and injects a preset fault packet into the target call link base class template. The application interfaces in the target call link base class template respond to the preset fault packet in turn, and feedback response information to the control device. The control device compares the fault feedback information of each interface with target fault feedback information, and determines whether the target fault is caused by the fault packet. Since the fault injection is performed on the whole call link base class template, the production environment can be simulated, and the accuracy of fault simulation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to communication technology, and more particularly to a fault simulation method, apparatus, device, and storage medium. Background Technology

[0002] The types of faults in operation and maintenance systems are numerous, leading to system chaos and service interruptions. Determining the cause and locating the faulty node after a fault occurs is a reactive and after-the-fact response, resulting in low fault resolution efficiency. In recent years, chaos engineering has emerged, which actively introduces abnormal states (disturbances) into the system's software or hardware to create fault scenarios and analyze the system's behavior under various pressures to reveal system weaknesses, thereby improving the system architecture.

[0003] However, the current granularity of fault injection in chaos engineering is too coarse, the control range of faults is not precise enough, and it cannot achieve logical isolation of fault injection at the interface level. Furthermore, the fault simulation scenarios cannot realize production environment simulations, resulting in inaccurate fault simulations. Summary of the Invention

[0004] This application provides a fault simulation method, apparatus, device, and storage medium to solve the above-mentioned problems.

[0005] In a first aspect, this application provides a fault simulation method, which is applied to a server, the server being communicatively connected to a control device, and the distributed system jointly deployed by the server and other servers including multiple application interfaces and corresponding proxy clients. The method includes:

[0006] Each of the application interfaces obtains the proxy client startup command transmitted by the control device;

[0007] In response to the proxy client startup command, the control switch corresponding to the proxy client of each application interface is turned on;

[0008] The set of call chain base class templates associated with each application interface is transmitted to the control device; the set of call chain base class templates includes at least one call chain base class template, and each call chain base class template includes the order in which at least one application interface is called sequentially;

[0009] The first application interface of the target call link base class template obtains the preset fault message transmitted by the control device; the target call link base class template is a call link base class template determined by the control device from the call link base class template set, and the target call link base class template includes at least one target application interface;

[0010] The preset fault messages are responded to sequentially according to the calling order of each application interface in the target call chain base class template, and corresponding fault feedback information is generated.

[0011] The fault feedback information is transmitted to the control device through the proxy client of each target application interface, so that the control device can determine the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information.

[0012] In the above technical solution, before the control device injects faults into the application interface, the control switch corresponding to the proxy client of the application interface is turned on to determine the control scope of the fault on an application interface-by-application basis. By scanning each application interface, multiple call chain base class templates composed of each application interface are determined. The control device selects one call chain base class template as the target call chain base class template and injects a preset fault message into the target call chain base class template. The application interfaces in the target call chain base class template respond to the preset fault message in sequence and feed back the response information to the control device. This allows the control device to compare the fault feedback information of each interface with the target fault feedback information to determine whether the target fault is caused by the fault message. Since the fault injection is performed on an entire call chain base class template, production environment drills can be implemented, improving the accuracy of fault simulation.

[0013] Optionally, the set of call chain base class templates associated with each application interface is transmitted to the control device, specifically including:

[0014] Each application interface obtains the call link base class template acquisition instruction transmitted by the control device;

[0015] In response to the call chain base class template acquisition instruction, after each application interface obtains the message information transmitted by the upstream object, its corresponding proxy client adds the identification information of the application interface into the message information;

[0016] According to the order of application interface calls, the message information is transmitted to the downstream application interface until the proxy client of the last application interface adds its identification information into the message information;

[0017] The message information is fed back from the last application interface to the first application interface of each application interface in reverse order of the message information transmission sequence.

[0018] The proxy client of the first application interface transmits the message information to the control device, so that the control device obtains the call link base class template from the message information and assembles multiple call link base class templates with different call orders into the call link base class template set.

[0019] Optionally, after each application interface obtains the message information transmitted by the upstream object, its corresponding proxy client adds the identification information of the application interface to the message information, specifically including:

[0020] After the control switch of the proxy client for each application interface is activated, it scans the corresponding application interface to obtain scan information; the scan information includes the controller layer.

[0021] The scanned application interfaces are labeled using the scanned information. The labeling information for each application interface includes the object identifier of the application interface, the module identifier of the application to which the application interface is located, and the main identifier of the device to which the application is located.

[0022] Based on the controller layer, a proxy class is generated. After obtaining the message information transmitted by the upstream object, each application interface adds the identification information of the application interface into the message information through the proxy class.

[0023] Optionally, the scanning information further includes: object attribute information of the application interface, the object attribute information including interface name, application name, port, interface method name, interface request method, interface request parameter type, interface return parameter type, and interface request URL;

[0024] The application interfaces obtained from the scan are labeled using the scan information, specifically including:

[0025] The object identifier of the application interface is generated based on the object attribute information. The object identifier includes the interface name, application name, port, application IP, controller, interface method name, interface request method, interface request parameter type, interface return parameter type, and interface request URL.

[0026] Optionally, the scanning information further includes: application module attribute information, which includes the application name and port;

[0027] The method further includes:

[0028] The module identifier of the application is generated based on the module attribute information; the module identifier includes the application name, port, application IPList, and host IPList.

[0029] Optionally, the scanning information further includes: the device's main attribute information, which includes host IP and MAC address information;

[0030] The method further includes:

[0031] The device's main identifier is generated based on the main attribute information; the main identifier includes the main attribute information.

[0032] Optionally, the method further includes:

[0033] The application name, port, and application IP in the object identifier of the application interface are matched with the application name, port, and application IPList in each module identifier to determine the application associated with the application interface;

[0034] The host IPList in the module identifier of the application associated with the application interface is matched with the host IP in each of the main identifiers to determine the device associated with the application;

[0035] The identification information of the application interface is generated based on the object identifier of the application interface, the module identifier of the application associated with the application interface, and the main identifier of the device associated with the application.

[0036] In the above technical solution, the identification information of the application interface is generated by the object identifier of the application interface, the module identifier of the application associated with the application interface, and the main identifier of the device associated with the application, so as to accurately locate the position of each interface and ensure the accuracy of the fault drill process.

[0037] Optionally, the preset fault message includes at least one preset fault sub-message of the target application interface;

[0038] The system responds to the preset fault messages sequentially according to the calling order of each application interface in the target call chain base class template, generating corresponding fault feedback information, specifically including:

[0039] Set breakpoints before and after the caller of the target application interface using a proxy class;

[0040] The fault sub-message is obtained at the breakpoint before the program is called, and the fault sub-message is transmitted to the control device so that the control device can determine the fault transmission situation based on the fault sub-message.

[0041] The endpoint after the program is invoked obtains the fault feedback information of the target application interface for the fault sub-message.

[0042] In the above technical solution, breakpoints are set before and after the calling program is determined, and the running status of the application at each breakpoint is obtained. This further realizes the situation where the interface call causes a failure during fault message injection, thus reducing the granularity of fault injection.

[0043] Secondly, this application provides a fault simulation method, which is applied to a control device. The control device is communicatively connected to at least one server, and the distributed system deployed on each server includes multiple application interfaces and corresponding proxy clients. The method includes:

[0044] Transmit a proxy client startup instruction to each of the application interfaces, the proxy client startup instruction being used to turn on the control switch of the proxy client for each of the application interfaces;

[0045] Obtain a set of call chain base class templates associated with each application interface; the set of call chain base class templates includes at least one call chain base class template, and each call chain base class template includes the order in which at least one application interface is called sequentially;

[0046] A target call chain base class template is determined from the set of call chain base class templates; the target call chain base class template includes at least one target application interface;

[0047] A preset fault message is transmitted to the first application interface of the target call chain base class template; the preset fault message is used to enable each application interface of the target call chain base class template to obtain the preset fault message in the call order and respond to the preset fault message.

[0048] Obtain fault feedback information from each target application interface, and determine the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information.

[0049] In the above technical solution, before the control device injects faults into the application interface, the control switch corresponding to the proxy client of the application interface is turned on to determine the control scope of the fault on an application interface-by-application basis. By scanning each application interface, multiple call chain base class templates composed of each application interface are determined. The control device selects one call chain base class template as the target call chain base class template and injects a preset fault message into the target call chain base class template. The application interfaces in the target call chain base class template respond to the preset fault message in sequence and feed back the response information to the control device. This allows the control device to compare the fault feedback information of each interface with the target fault feedback information to determine whether the target fault is caused by the fault message. Since the fault injection is performed on an entire call chain base class template, production environment drills can be implemented, improving the accuracy of fault simulation.

[0050] Optionally, obtain the collection of call chain base class templates associated with each application interface, specifically including:

[0051] Transmit the call chain base class template retrieval instruction to multiple application interfaces to obtain multiple call chain base class templates with different call orders sent by the proxy client of the first application interface of multiple application interfaces;

[0052] The call chain base class template is composed of multiple call chain base class templates;

[0053] The link base class template acquisition instruction is used to enable the first application interface, after obtaining the message information transmitted by the upstream object, to have its corresponding proxy client add the identification information of the application interface to the message information and transmit it to the downstream application interface, until the proxy client of the last application interface adds its identification information to the message information and feeds back the message information to the first application interface. The proxy client of the first application interface then transmits the message information to the control device, so that the control device can obtain the call link base class template from the message information.

[0054] Thirdly, this application provides a fault simulation device, comprising:

[0055] The acquisition module is used by various application interfaces to acquire the proxy client startup command transmitted by the control device;

[0056] The processing module is used to respond to the proxy client startup command and turn on the control switch corresponding to the proxy client of each application interface;

[0057] The processing module is also used to transmit the call chain base class template set associated with each application interface to the control device; the call chain base class template set includes at least one call chain base class template, and each call chain base class template includes the order in which at least one application interface is called sequentially;

[0058] The processing module is also used to obtain the preset fault message transmitted by the control device from the first application interface of the target call link base class template; the target call link base class template is a call link base class template determined by the control device from the set of call link base class templates, and the target call link base class template includes at least one target application interface;

[0059] The processing module is also used to respond to the preset fault message in the order of calling each application interface in the target call chain base class template, and generate corresponding fault feedback information.

[0060] The processing module is also used to transmit fault feedback information to the control device through the proxy client of each target application interface, so that the control device can determine the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information.

[0061] Fourthly, this application provides a fault simulation device, comprising:

[0062] The processing module is used to transmit proxy client startup instructions to each application interface, wherein the proxy client startup instructions are used to turn on the control switch of the proxy client of each application interface;

[0063] The acquisition module obtains a set of call chain base class templates associated with each application interface; the set of call chain base class templates includes at least one call chain base class template, and each call chain base class template includes the order in which at least one application interface is called sequentially;

[0064] The processing module is further configured to determine a target call chain base class template from the call chain base class template set; the target call chain base class template includes at least one target application interface;

[0065] The processing module is also used to transmit a preset fault message to the first application interface of the target call chain base class template; the preset fault message is used to enable each application interface of the target call chain base class template to obtain the preset fault message in the call order and respond to the preset fault message.

[0066] The processing module is also used to obtain fault feedback information of each target application interface, and determine the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information.

[0067] Fifthly, this application provides an electronic device, including: a processor and a memory communicatively connected to the processor;

[0068] The memory stores computer instructions;

[0069] The processor executes computer instructions to implement the methods involved in the first or second aspect.

[0070] In a sixth aspect, this application provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to implement the method involved in the first or second aspect.

[0071] This application provides a fault simulation method, apparatus, device, and storage medium. Before the control device injects faults into the application interface, the control switch corresponding to the proxy client of the application interface is turned on to determine the control scope of the fault on an application interface-by-application basis. By scanning each application interface, multiple call chain base class templates composed of each application interface are determined. The control device selects one call chain base class template as the target call chain base class template and injects a preset fault message into the target call chain base class template. The application interfaces in the target call chain base class template respond to the preset fault message in sequence and feed back the response information to the control device. This allows the control device to compare the fault feedback information of each interface with the target fault feedback information to determine whether the target fault is caused by the fault message. Since the fault injection is performed on an entire call chain base class template, production environment simulation can be achieved, improving the accuracy of fault simulation. Attached Figure Description

[0072] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0073] Figure 1 This is an application scenario diagram of the fault simulation method provided in this application according to an exemplary embodiment;

[0074] Figure 2 This is an application scenario diagram of the fault simulation method provided in this application according to another exemplary embodiment;

[0075] Figure 3 This is an interaction diagram of a fault simulation method provided in this application according to an exemplary embodiment;

[0076] Figure 4 This is a flowchart illustrating a method for generating a call chain base class template according to an exemplary embodiment of this application;

[0077] Figure 5 This is a schematic diagram of an interface call provided in accordance with an exemplary embodiment of this application;

[0078] Figure 6 This is a schematic diagram of an interface call provided in this application according to another exemplary embodiment;

[0079] Figure 7 This is a schematic diagram of an interface call provided in this application according to another exemplary embodiment;

[0080] Figure 8 This is a schematic diagram of an interface call provided in this application according to another exemplary embodiment;

[0081] Figure 9 This is a schematic diagram illustrating a scenario of a method for generating a call chain base class template according to an exemplary embodiment of this application.

[0082] Figure 10 This is a flowchart illustrating a method for annotating identification information of an application interface according to an exemplary embodiment of this application;

[0083] Figure 11 This is a schematic diagram of the structure of a fault simulation device provided in an exemplary embodiment of this application;

[0084] Figure 12 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application.

[0085] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0086] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0087] The types of faults in operation and maintenance systems are numerous, leading to system chaos and service interruptions. Determining the cause and locating the faulty node after a fault occurs is a reactive and after-the-fact response, resulting in low fault resolution efficiency. In recent years, chaos engineering has emerged, which actively introduces abnormal states (disturbances) into the system's software or hardware to create fault scenarios and analyze the system's behavior under various pressures to reveal system weaknesses, thereby improving the system architecture.

[0088] However, the current granularity of fault injection in chaos engineering is too coarse, the control range of faults is not precise enough, and it cannot achieve logical isolation of fault injection at the interface level. Furthermore, the fault simulation scenarios cannot realize production environment simulations, resulting in inaccurate fault simulations.

[0089] To address the aforementioned issues, this application provides a fault simulation method, apparatus, device, and storage medium. The technical concept of this application is as follows: To determine the application interface to be injected with a fault, a proxy client is set up. After activating the control switch of the proxy client, a unique identifier for each application interface is determined. Through mutual calls between interfaces, a call chain base class template is generated using the identifiers of each interface to represent various call situations between interfaces. A call chain base class template is selected, and a fault message is injected into the interface corresponding to the call chain base class template. The response of each interface to the fault message is analyzed to determine whether the fault message generates the expected fault.

[0090] Figure 1 This is an application scenario diagram of the fault simulation method provided in this application according to an exemplary embodiment, such as... Figure 1 As shown, the system includes a control device 10 and multiple servers 201, which together form a server cluster 20. The control device 10 and the server cluster 20 are connected.

[0091] Deploy a distributed system on server cluster 10. This distributed system includes multiple applications, either individually or in combination, to provide services to user terminals.

[0092] Figure 2 This is an application scenario diagram of the fault simulation method provided in this application according to another exemplary embodiment. Figure 2 The image shows a scenario where an application is deployed on server cluster 20, such as... Figure 2 As shown, the distributed system of server cluster 20 includes application A 301 and application B 302. Application A 301 will call application B 302 during operation.

[0093] One agent client is deployed in each of application A 301 and application B 302. Specifically, agent client 3011 is deployed in application A 301 and agent client 3012 is deployed in application B 302. Both agent client 3011 and agent client 3012 are connected to control device 10 for communication.

[0094] In one embodiment, the control device 10 uses Netty communication to perform heartbeat detection, fault injection, and breakpoint control on the agent client.

[0095] When the control switches of proxy client 3011 for application A 301 and proxy client 3012 for application B 302 are turned on, proxy client 3011 scans application A 301 and proxy client 3012 scans application B 302 to determine the application-related information, and uses this information to generate unique identification information, and uses this identification information to determine the call chain between applications.

[0096] The proxy client 3011 of application A301 transmits the call chain containing application A and application B to the control device 10, so that the control device 10 sets a fault message for the call chain and transmits the message to application A 301. Application A and application B respond to the message in the order of the call, generate a fault, and transmit the relevant information of the fault to the control device 10. The control device 10 generates a fault and compares it with a preset fault to determine whether the fault is caused by the fault type and fault point in the preset message.

[0097] Based on the above application scenarios and in conjunction with the accompanying drawings, some embodiments of this application will be described in detail below. Where there is no conflict between the embodiments, the following embodiments and features can be combined with each other. Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.

[0098] Figure 3 This is an interaction diagram of a fault simulation method provided in this application according to an exemplary embodiment, such as... Figure 3As shown, it includes:

[0099] S101, The control device sends the agent client start command to each application interface in the server.

[0100] A proxy client is a plugin embedded in a software application, similar to referencing a utility JAR file in a Java project.

[0101] This proxy client can scan and label applications and generate proxy classes. The proxy classes can generate a base class template for fault injection call chains and receive and execute injected fault messages.

[0102] The agent client has a control switch that determines the logical isolation range. When the control switch is on, the application interface is within the logical isolation range and participates in the execution of fault messages; when the control switch is off, the application interface is within the logical isolation range and does not participate in the execution of fault messages.

[0103] S102. In response to the proxy client startup command, the server turns on the control switch corresponding to the proxy client for each application interface.

[0104] S103. The server sends the call chain base class template set associated with each application interface to the control device.

[0105] The call chain base class template set includes at least one call chain base class template, and each call chain base class template includes the order in which at least one application interface is called sequentially.

[0106] S104. The control device determines the target call link base class template from the call link base class template set.

[0107] The control device determines a call link base class template from the call link base class template set as the target call link base class template, and sets a fault message for one or more application interfaces contained in the target call link base class template.

[0108] S105. The control device sends a preset fault message to the first application interface of the target call link base class template.

[0109] S106. The server responds to the preset fault messages in the order of the calls to each application interface in the target call chain base class template, and generates the corresponding fault feedback information.

[0110] The preset fault message includes at least one preset fault sub-message of the target application interface. The target application interface is the application interface for which the control device sets a fault. For example, in a link where interfaces A, B, and C call sequentially, interfaces A and C do not set fault messages but send normal messages, while interface B sets a fault message; in this case, interface B is the target application interface.

[0111] More specifically, the process by which the server responds to a preset fault message and generates corresponding fault feedback information includes:

[0112] By setting breakpoints before and after the calling procedure of the target application interface through the proxy class, the pre-call message is executed before the breakpoint, the fault sub-message is obtained at the breakpoint before the calling procedure, and the fault sub-message is transmitted to the control device so that the control device can determine the fault transmission situation based on the fault sub-message. The fault feedback information of the target application interface to the fault sub-message is obtained at the endpoint after the calling procedure.

[0113] S107. The server sends fault feedback information to the control device through the proxy client of each target application interface.

[0114] S108. The control equipment determines the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information.

[0115] When the fault feedback information matches the target fault feedback information, it is determined that the target fault feedback information was generated by the preset fault message; otherwise, it is not.

[0116] In the above technical solution, before the control device injects faults into the application interface, the control switch corresponding to the proxy client of the application interface is turned on to determine the control scope of the fault on an application interface-by-application basis. By scanning each application interface, multiple call chain base class templates composed of each application interface are determined. The control device selects one call chain base class template as the target call chain base class template and injects a preset fault message into the target call chain base class template. The application interfaces in the target call chain base class template respond to the preset fault message in sequence and feed back the response information to the control device. This allows the control device to compare the fault feedback information of each interface with the target fault feedback information to determine whether the target fault is caused by the fault message. Since the fault injection is performed on an entire call chain base class template, production environment drills can be implemented, improving the accuracy of fault simulation.

[0117] Figure 4 This is a flowchart illustrating a method for generating a call chain base class template according to an exemplary embodiment of this application. Figure 4 As shown, it includes:

[0118] S201. Each application interface obtains the call link base class template acquisition instruction transmitted by the control device.

[0119] S202. In response to the command to retrieve the base class template of the call link, after each application interface obtains the message information transmitted by the upstream object, its corresponding proxy client adds the identification information of the application interface into the message information.

[0120] If the application interface is at the beginning of the call chain, then the upstream object of the application interface is the external system or the front-end interface; if the application interface is not at the beginning of the call chain, then the upstream object of the application interface is the application interface of the call chain.

[0121] S203. According to the calling order of the application interfaces, the message information is transmitted to the downstream application interfaces until the proxy client of the last application interface adds its identification information to the message information.

[0122] In step S202, the application interface transmits a message containing its identification information to the next application interface in the call chain by calling the interface. The called application interface will add its identification to the message according to the processing method in step S202. This process continues until the last application interface in the call chain obtains the message and adds its identification information to the message.

[0123] The following explains the various ways in which the application interface is called:

[0124] In one embodiment, the order of application interface calls is as follows: Figure 5 As shown, in this call chain, the call chain of the application interface is unique. When interface A calls interface B, it transmits its identifier IDA to interface B. The call chain generated by interface A based on this call relationship is "IDA-IDB". When interface B calls interface C, it transmits the determined call chain to interface C. Interface C adds its identifier IDC to the call chain, updates the call chain "IDA-IDB-IDC", and feeds back the call chain to interface B. Interface B then feeds back the call chain to interface A, thus completing the generation of a call chain base class template.

[0125] In another embodiment, the order of application interface calls is as follows: Figure 6 and Figure 7 As shown, the calling process of interfaces A, B, and C is similar to... Figure 5 The embodiments shown are the same and will not be repeated here. When interface C is called, interface D can be called on one hand, and interface E can be called on the other hand, thus generating two call chains "IDA-IDB-IDC-IDD" and "IDA-IDB-IDC-IDE" respectively.

[0126] In another embodiment, the order of application interface calls is as follows: Figure 8 As shown, if interface A calls interfaces B, C, and D in sequence, the final call chain will be "IDA-IDB-IDC-IDD".

[0127] S204. Following the reverse order of message information transmission, feed the message information back from the last application interface to the first application interface among all application interfaces.

[0128] S205. The proxy client of the first application interface transmits the message information to the control device, so that the control device can obtain the call link base class template from the message information and form a call link base class template set by combining multiple call link base class templates with different call orders.

[0129] In the above technical solution, each application interface adds identification information to the message in the order of its calls. This not only automatically records the specific application interfaces included in the call chain, but also automatically records the order of calls to each application interface. This allows the control device to set and inject faults based on the chain, thereby achieving fine-grained fault drills according to the application interfaces.

[0130] Figure 9 This is a schematic diagram illustrating a scenario of the method for generating a call chain base class template according to an exemplary embodiment of this application, such as... Figure 9 As shown, there are two physical machines: physical machine A and physical machine B.

[0131] Applications A and B are installed on physical machine A, and applications C, D, and E are installed on physical machine B. A proxy client is configured for each of these applications, and the proxy clients are enabled.

[0132] When generating the call chain, application A receives an external call or a front-end call and runs application A. During the running process, it calls interface B to run application B, application B calls interface C1 to run application C, application C calls interface D1 to run application D, and after the call is completed, it feeds back the call chain "interface A-interface B-interface C1-interface D1" to the control device.

[0133] During its operation, application B also calls interface C2 to run application C. During its operation, it calls interface E to run application E. After completing the call, it sends a call chain feedback to the control device: "interface A-interface B-interface C2-interface E".

[0134] Figure 10 This is a flowchart illustrating a method for annotating the identification information of an application interface according to an exemplary embodiment of this application, as shown below. Figure 10 As shown, it includes:

[0135] S301. After the control switch of the proxy client for each application interface is activated, it scans the corresponding application interface to obtain scan information.

[0136] The scan information includes controller layer, object attribute information, application module attribute information, and device main attribute information. The object attribute information includes interface name, application name, port, interface method name, interface request method, interface request parameter type, interface return parameter type, and interface request URL.

[0137] The application's module attribute information includes the application name and port.

[0138] The main attribute information includes host IP and MAC address information.

[0139] S302. Use the scanned information to annotate the application interfaces obtained from the scan.

[0140] The annotation information for each application interface includes the object identifier of the application interface, the module identifier of the application in which the application interface is located, and the main identifier of the device in which the application is located.

[0141] More specifically, during the process of annotating the application interfaces obtained from the scan, an object identifier for the application interface is generated based on the object attribute information. This object identifier includes the interface name, application name, port, application IP, controller, interface method name, interface request method, interface request parameter type, interface return parameter type, and interface request URL.

[0142] The module identifier of the application is generated based on the module attribute information; the module identifier includes the application name, port, application IPList, and host IPList.

[0143] The device's main identifier is generated based on the main attribute information; the main identifier includes the main attribute information.

[0144] The host IPList in the module identifier of the application associated with the application interface is matched with the host IP in each subject identifier to determine the device associated with the application.

[0145] The application interface's identification information is generated based on the object identifier of the application interface, the module identifier of the application associated with the application interface, and the main identifier of the device associated with the application.

[0146] S303. Generate a proxy class based on the controller layer. After obtaining the message information transmitted by the upstream object, each application interface adds the identification information of the application interface into the message information through the proxy class.

[0147] By adding the identification information of each interface to the message, a base class template for software fault link calls is generated.

[0148] The orchestration of base class template calls for software fault chains is divided into automatic and manual methods;

[0149] For example, there exists a fault injection chain base class template: Interface A->Interface B->Interface C->Interface D;

[0150] Interface A has two instances (APP1 and APP2), interface B has one instance (APP3), interface C has two instances (APP4 and APP5), and interface D has one instance (APP6).

[0151] The automatic orchestration module identifies all corresponding application and host information based on the elements in the interface. Then, it performs orchestration according to its proprietary algorithm. The specific process is as follows:

[0152] The application IP of the attribute element in the interface A object exists in two places (APP1-IP and APP2-IP); by associating the application IPs APP1-IP and APP2-IP with the module IDs of application APP1 and APP2, we can find the APP1-host ID and APP2-host ID in the module ID attribute;

[0153] Interface A generates two physical instance nodes:

[0154] Interface A (Application APP1, APP1-Module ID, APP1-Host ID) is abbreviated as: Interface A Logical Node 1;

[0155] Interface A (Application APP2, APP2-Module ID, APP2-Host ID) is abbreviated as: Interface A Logical Node 2.

[0156] Similarly, B, C, and D are listed below:

[0157] Interface B (Application APP3, APP3-Module ID, APP3-Host ID) is abbreviated as: Interface B Logical Node 1;

[0158] Interface C (Application APP4, APP4-Module ID, APP4-Host ID) is abbreviated as: Interface C Logical Node 1;

[0159] Interface C (Application APP5, APP5-Module ID, APP5-Host ID) is abbreviated as: Interface C Logical Node 2;

[0160] Interface D (Application APP6, APP6-Module ID, APP6-Host ID) is abbreviated as: Interface D Logical Node 1.

[0161] Based on the physical instance nodes above, automatically orchestrate and generate software fault injection physical node links:

[0162] Interface A logical node 1 -> Interface B logical node 1 -> Interface C logical node 1 -> Interface D logical node 1;

[0163] Interface A logical node 1 -> Interface B logical node 1 -> Interface C logical node 2 -> Interface D logical node 1;

[0164] Interface A logical node 2 -> Interface B logical node 1 -> Interface C logical node 1 -> Interface D logical node 1;

[0165] Interface A logical node 2 -> Interface B logical node 1 -> Interface C logical node 2 -> Interface D logical node 1.

[0166] The process of hand-arranging is as follows:

[0167] If the user specifies to use interface A logical node 1 and interface C logical node 1.

[0168] Users only need to manually select the element information of each interface to generate a physical node link for fault injection that meets their needs:

[0169] Interface A (Module ID and Host ID of APP1) -> Interface B (Module ID and Host ID of APP3) -> Interface C (Module ID and Host ID of APP4) -> Interface D (Module ID and Host ID of APP6).

[0170] It is worth noting that, for the fault injection physical node links generated above, it is essential to ensure that the proxy client switches of all logical nodes are turned on when injecting fault messages.

[0171] In the above technical solution, the identification information of the application interface is generated by the object identifier of the application interface, the module identifier of the application associated with the application interface, and the main identifier of the device associated with the application, so as to accurately locate the position of each interface and ensure the accuracy of the fault drill process.

[0172] Figure 11 This is a schematic diagram of the structure of a fault simulation device 400 according to an embodiment of the present application. The fault simulation device 400 includes an acquisition module 401 and a processing module 402, wherein...

[0173] The acquisition module 401 is used by each application interface to acquire the proxy client startup command transmitted by the control device;

[0174] Processing module 402 is used to respond to the proxy client startup command and turn on the control switch corresponding to the proxy client of each application interface;

[0175] The processing module 402 is also used to transmit the call chain base class template set associated with each application interface to the control device; the call chain base class template set includes at least one call chain base class template, and each call chain base class template includes the order in which at least one application interface is called sequentially;

[0176] The processing module 402 is also used to obtain the preset fault message transmitted by the control device from the first application interface of the target call link base class template; the target call link base class template is a call link base class template determined by the control device from the set of call link base class templates, and the target call link base class template includes at least one target application interface;

[0177] The processing module 402 is also used to respond to the preset fault messages in the order of calling each application interface in the target call chain base class template, and generate corresponding fault feedback information.

[0178] The processing module 402 is also used to transmit fault feedback information to the control device through the proxy client of each target application interface, so that the control device can determine the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information.

[0179] In one feasible embodiment, the processing module 402 is further configured to:

[0180] Each application interface obtains the call link base class template acquisition instruction transmitted by the control device;

[0181] In response to the command to retrieve the link base class template, each application interface, after obtaining the message information transmitted by the upstream object, adds the application interface's identification information into the message information;

[0182] According to the order of application interface calls, the message information is transmitted to the downstream application interface until the proxy client of the last application interface adds its identification information to the message information.

[0183] In reverse order of message transmission sequence, the message information is fed back from the last application interface to the first application interface among all application interfaces.

[0184] The proxy client of the first application interface transmits the message information to the control device, so that the control device can obtain the call link base class template from the message information and form a call link base class template set by combining multiple call link base class templates with different call orders.

[0185] In one feasible embodiment, the processing module 402 is further configured to:

[0186] After the control switch of the proxy client for each application interface is activated, it scans the corresponding application interface to obtain scan information; the scan information includes the controller layer.

[0187] The application interfaces obtained by scanning are labeled using the scanning information. The labeling information of each application interface includes the object identifier of the application interface, the module identifier of the application in which the application interface is located, and the main identifier of the device in which the application is located.

[0188] Based on the proxy class generated by the controller layer, each application interface adds its identification information to the message information after obtaining the message information transmitted by the upstream object through the proxy class.

[0189] In one feasible embodiment, the processing module 402 is further configured to:

[0190] The object identifier of the application interface is generated based on the object attribute information. The object identifier includes the interface name, application name, port, application IP, controller, interface method name, interface request method, interface request parameter type, interface return parameter type, and interface request URL.

[0191] The scanning information also includes: object attribute information of the application interface, which includes interface name, application name, port, interface method name, interface request method, interface request parameter type, interface return parameter type, and interface request URL.

[0192] In one feasible embodiment, the processing module 402 is further configured to:

[0193] Generate the application's module identifier based on the module attribute information; the module identifier includes the application name, port, application IPList, and host IPList;

[0194] The scan information also includes the application's module attribute information, which includes the application name and port.

[0195] In one feasible embodiment, the processing module 402 is further configured to:

[0196] The device's main identifier is generated based on the main attribute information; the main identifier includes main attribute information; the scanning information also includes: the device's main attribute information, which includes host IP and MAC address information.

[0197] In one feasible embodiment, the processing module 402 is further configured to:

[0198] Match the application name, port, and application IP in the object identifier of the application interface with the application name, port, and application IPList in each module identifier to determine the application associated with the application interface;

[0199] The host IPList in the module identifier of the application associated with the application interface is matched with the host IP in each subject identifier to determine the device associated with the application;

[0200] The application interface's identification information is generated based on the object identifier of the application interface, the module identifier of the application associated with the application interface, and the main identifier of the device associated with the application.

[0201] In one feasible embodiment, the processing module 402 is further configured to:

[0202] Set breakpoints before and after the caller of the target application interface using a proxy class;

[0203] The fault sub-message is obtained at the breakpoint before the program is called, and the fault sub-message is transmitted to the control device so that the control device can determine the fault transmission situation based on the fault sub-message.

[0204] Obtain the fault feedback information of the target application interface for the fault sub-message at the endpoint after the program is called;

[0205] Among them, the preset fault message includes a preset fault sub-message of at least one target application interface.

[0206] Figure 12 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. The electronic device 500 includes a memory 501 and a processor 502. The memory 501 stores computer instructions executable by the processor. The memory 501 may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk drive, or a USB flash drive, portable hard drive, read-only memory, magnetic disk, or optical disk, etc.

[0207] When executing computer instructions, processor 502 implements the various steps in the fault simulation method with a control device or server as the execution entity in the above embodiments. For details, please refer to the relevant descriptions in the foregoing method embodiments. The processor 502 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0208] Optionally, the memory 501 can be either independent or integrated with the processor 502. When the memory 501 is configured independently, the electronic device 500 also includes a bus for connecting the memory 501 and the processor 502. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0209] This application also provides a computer-readable storage medium storing computer instructions. When a processor executes the computer instructions, it implements the various steps of the fault simulation method described in the above embodiments.

[0210] This application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the various steps of the fault simulation method described above.

[0211] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0212] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method of failure drill, characterized by, The method is applied to a server, which is communicatively connected to a control device. The distributed system jointly deployed by the server and other servers includes multiple application interfaces and corresponding proxy clients. The method includes: Each of the application interfaces obtains the proxy client startup command transmitted by the control device; In response to the proxy client startup command, the control switch corresponding to the proxy client of each application interface is turned on; The set of call chain base class templates associated with each application interface is transmitted to the control device; the set of call chain base class templates includes at least one call chain base class template, and each call chain base class template includes the order in which multiple application interfaces are called sequentially; The first application interface of the target call link base class template obtains the preset fault message transmitted by the control device; the target call link base class template is a call link base class template determined by the control device from the call link base class template set, and the target call link base class template includes multiple target application interfaces; The preset fault messages are responded to sequentially according to the calling order of each application interface in the target call chain base class template, and corresponding fault feedback information is generated. The fault feedback information is transmitted to the control device through the proxy client of each target application interface, so that the control device can determine the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information. The collection of call chain base class templates associated with each application interface is transmitted to the control device, specifically including: Each application interface obtains the call link base class template acquisition instruction transmitted by the control device; In response to the call chain base class template acquisition instruction, after each application interface obtains the message information transmitted by the upstream object, its corresponding proxy client adds the identification information of the application interface into the message information; According to the order of application interface calls, the message information is transmitted to the downstream application interface until the proxy client of the last application interface adds its identification information into the message information; The message information is fed back from the last application interface to the first application interface of each application interface in reverse order of the message information transmission sequence. The proxy client of the first application interface transmits the message information to the control device, so that the control device obtains the call link base class template from the message information and assembles multiple call link base class templates with different call orders into the call link base class template set. After each application interface receives the message information transmitted by the upstream object, its corresponding proxy client adds the identification information of the application interface to the message information, specifically including: After the control switch of the proxy client for each application interface is activated, it scans the corresponding application interface to obtain scan information; the scan information includes the controller layer. The application interfaces obtained by scanning are labeled using the scanning information. The labeling information of each application interface includes the object identifier of the application interface, the module identifier of the application in which the application interface is located, and the main identifier of the device in which the application is located. Based on the controller layer, a proxy class is generated. After obtaining the message information transmitted by the upstream object, each application interface adds the identification information of the application interface into the message information through the proxy class.

2. The method of claim 1, wherein, The scanning information also includes: object attribute information of the application interface, which includes interface name, application name, port, interface method name, interface request method, interface request parameter type, interface return parameter type, and interface request URL; The application interfaces obtained from the scan are labeled using the scan information, specifically including: The object identifier of the application interface is generated based on the object attribute information. The object identifier includes the interface name, application name, port, application IP, controller, interface method name, interface request method, interface request parameter type, interface return parameter type, and interface request URL.

3. The method according to claim 2, characterized in that, The scanning information also includes: application module attribute information, which includes application name and port; The method further includes: The module identifier of the application is generated based on the module attribute information; the module identifier includes the application name, port, application IPList, and host IPList.

4. The method of claim 3, wherein, The scanning information also includes: the device's main attribute information, which includes host IP and MAC address information; The method further includes: The device's main identifier is generated based on the main attribute information; the main identifier includes the main attribute information.

5. The method of claim 4, wherein, The method further includes: The application name, port, and application IP in the object identifier of the application interface are matched with the application name, port, and application IPList in each module identifier to determine the application associated with the application interface; The host IPList in the module identifier of the application associated with the application interface is matched with the host IP in each of the main identifiers to determine the device associated with the application; The identification information of the application interface is generated based on the object identifier of the application interface, the module identifier of the application associated with the application interface, and the main identifier of the device associated with the application.

6. The method of claim 1, wherein, The preset fault message includes at least one preset fault sub-message of the target application interface; The system responds to the preset fault messages sequentially according to the calling order of each application interface in the target call chain base class template, generating corresponding fault feedback information, specifically including: Set breakpoints before and after the caller of the target application interface using a proxy class; The fault sub-message is obtained at the breakpoint before the program is called, and the fault sub-message is transmitted to the control device so that the control device can determine the fault transmission situation based on the fault sub-message. At the breakpoint after the program is called, obtain the fault feedback information of the target application interface for the fault sub-message.

7. A method of failure drill, characterized by, The method is applied to a control device, which is communicatively connected to at least one server. Each server deploys a distributed system including multiple application interfaces and corresponding proxy clients. The method includes: Transmit a proxy client startup instruction to each of the application interfaces, the proxy client startup instruction being used to turn on the control switch of the proxy client for each of the application interfaces; Obtain a set of call chain base class templates associated with each application interface; the set of call chain base class templates includes at least one call chain base class template, and each call chain base class template includes the order in which multiple application interfaces are called sequentially; The target call chain base class template is determined from the set of call chain base class templates; the target call chain base class template includes multiple target application interfaces; A preset fault message is transmitted to the first application interface of the target call chain base class template; the preset fault message is used to enable each application interface of the target call chain base class template to obtain the preset fault message in the call order and respond to the preset fault message. Obtain fault feedback information from each target application interface, and determine the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information; Obtain the collection of call chain base class templates associated with each application interface, specifically including: Transmit the call chain base class template retrieval instruction to multiple application interfaces to obtain multiple call chain base class templates with different call orders sent by the proxy client of the first application interface of multiple application interfaces; The call chain base class template is composed of multiple call chain base class templates; The link base class template acquisition instruction is used to enable the first application interface, after obtaining the message information transmitted by the upstream object, to have its corresponding proxy client add the identification information of the application interface to the message information and transmit it to the downstream application interface, until the proxy client of the last application interface adds its identification information to the message information and feeds back the message information to the first application interface. The proxy client of the first application interface then transmits the message information to the control device, so that the control device can obtain the call link base class template set from the message information. After the control switch is activated, the proxy client of each application interface scans its corresponding application interface to obtain scanning information including the controller layer; it uses the scanning information to annotate the application interface, and the annotation information includes the object identifier of the application interface, the module identifier of the application, and the main identifier of the device; it generates a proxy class according to the controller layer, and each application interface adds its own identification information to the message information through the proxy class.

8. A fault rehearsal apparatus characterized by, The device is applied to a server, which is communicatively connected to a control device. The distributed system jointly deployed by the server and other servers includes multiple application interfaces and corresponding proxy clients, including: The acquisition module is used by various application interfaces to acquire the proxy client startup command transmitted by the control device; The processing module is used to respond to the proxy client startup command and turn on the control switch corresponding to the proxy client of each application interface; The processing module is also used to transmit the call chain base class template set associated with each application interface to the control device; the call chain base class template set includes at least one call chain base class template, and each call chain base class template includes the order in which multiple application interfaces are called sequentially; The processing module is also used to obtain the preset fault message transmitted by the control device from the first application interface of the target call link base class template; the target call link base class template is a call link base class template determined by the control device from the call link base class template set, and the target call link base class template includes multiple target application interfaces; The processing module is also used to respond to the preset fault message in the order of calling each application interface in the target call chain base class template, and generate corresponding fault feedback information. The processing module is also used to transmit fault feedback information to the control device through the proxy client of each target application interface, so that the control device can determine the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information. When transmitting the call chain base class template set associated with each application interface to the control device, the processing module is specifically used to: each application interface obtains a call chain base class template acquisition instruction transmitted by the control device; in response to the call chain base class template acquisition instruction, after obtaining the message information transmitted by the upstream object, each application interface's corresponding proxy client adds the application interface's identification information to the message information; according to the call order of the application interfaces, the message information is transmitted to the downstream application interfaces until the proxy client of the last application interface adds its identification information to the message information; according to the reverse order of the message information transmission, the message information is fed back from the last application interface to the first application interface among all application interfaces; the proxy client of the first application interface transmits the message information to the control device, so that the control device obtains the call chain base class template from the message information and assembles multiple call chain base class templates with different call orders into the call chain base class template set; After each application interface receives the message information transmitted by the upstream object, and its corresponding proxy client adds the identification information of the application interface to the message information, the processing module is specifically used to scan the corresponding application interface after the control switch of the proxy client of each application interface is activated, and obtain scan information; the scan information includes the controller layer; the scanned application interfaces are labeled using the scan information, and the labeling information of each application interface includes the object identifier of the application interface, the module identifier of the application in which the application interface is located, and the main identifier of the device in which the application is located; a proxy class is generated according to the controller layer, and after each application interface receives the message information transmitted by the upstream object, the identification information of the application interface is added to the message information through the proxy class.

9. A fault drill apparatus, characterized by, The device is applied to a control equipment, which is communicatively connected to at least one server. Each server deploys a distributed system including multiple application interfaces and corresponding proxy clients, comprising: The processing module is used to transmit proxy client startup instructions to each application interface, wherein the proxy client startup instructions are used to turn on the control switch of the proxy client of each application interface; The acquisition module obtains a set of call chain base class templates associated with each application interface; the set of call chain base class templates includes at least one call chain base class template, and each call chain base class template includes the order in which multiple application interfaces are called sequentially; The processing module is further configured to determine a target call chain base class template from the call chain base class template set; the target call chain base class template includes multiple target application interfaces; The processing module is also used to transmit a preset fault message to the first application interface of the target call chain base class template; the preset fault message is used to enable each application interface of the target call chain base class template to obtain the preset fault message in the call order and respond to the preset fault message. The processing module is also used to obtain fault feedback information of each target application interface, and determine the relationship between the preset fault message and the target fault feedback information based on the fault feedback information and the target fault feedback information. The acquisition module is specifically used to transmit a call link base class template acquisition instruction to multiple application interfaces, and to obtain multiple call link base class templates with different call orders sent by the proxy client of the first application interface of the multiple application interfaces. The call chain base class template is composed of multiple call chain base class templates; The link base class template acquisition instruction is used to enable the first application interface, after obtaining the message information transmitted by the upstream object, to have its corresponding proxy client add the identification information of the application interface to the message information and transmit it to the downstream application interface, until the proxy client of the last application interface adds its identification information to the message information and feeds back the message information to the first application interface. The proxy client of the first application interface then transmits the message information to the control device, so that the control device can obtain the call link base class template set from the message information. After the control switch is activated, the proxy client of each application interface scans its corresponding application interface to obtain scan information including the controller layer. The application interface is marked using the scan information, and the marking information includes the object identifier of the application interface, the module identifier of the application, and the main identifier of the device. A proxy class is generated according to the controller layer, and each application interface adds its own identification information to the message information through the proxy class.

10. An electronic device, comprising: include: A processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor, when executing the computer execution instructions, is configured to implement the method as described in any one of claims 1 to 6, or as described in claim 7.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used for implementing the method in any one of claims 1 to 6 or the method in claim 7 when executed by the processor.

Citation Information

Patent Citations

  • Fault injection service

    US10986013B1