CN115509842A - Fault injection method, device, equipment and storage medium - Google Patents

Fault injection method, device, equipment and storage medium Download PDF

Info

Publication number
CN115509842A
CN115509842A CN202211271784.2A CN202211271784A CN115509842A CN 115509842 A CN115509842 A CN 115509842A CN 202211271784 A CN202211271784 A CN 202211271784A CN 115509842 A CN115509842 A CN 115509842A
Authority
CN
China
Prior art keywords
fault
information
target server
command
operation behavior
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211271784.2A
Other languages
Chinese (zh)
Inventor
蔡晓峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202211271784.2A priority Critical patent/CN115509842A/en
Publication of CN115509842A publication Critical patent/CN115509842A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2294Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by remote test

Abstract

The invention discloses a fault injection method, a fault injection device, equipment and a storage medium. The method comprises the following steps: acquiring operation behavior information, fault information and identification information of a target server; generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server; according to the technical scheme of the invention, the fault flow script can be automatically assembled, fault drilling and flow arrangement of multiple servers and multiple fault scenes can be supported, the fault drilling flow can be stored, and subsequent regular execution and multiplexing are facilitated.

Description

Fault injection method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a fault injection method, a fault injection device, fault injection equipment and a storage medium.
Background
Under the distributed architecture environment, the dependence between services is increasingly complex, the influence of a single fault on the whole system is difficult to analyze and predict, and a great challenge is faced to the construction of a highly available distributed system. Under a controllable range or environment, the chaotic engineering experiment tool is used to inject various faults into the system, so that the fault tolerance and elasticity of the distributed system can be continuously improved, and the construction of the high-availability distributed system is facilitated. The chaos engineering provides an end-to-end stability test concept and a tool framework, the vulnerability of a system and application is fully verified by actively introducing faults, the problems are found and solved in advance, the problems are prevented in advance, and the robustness of the system and the application is fundamentally improved.
The chaos engineering implementation tool is an experimental tool following the chaos engineering principle, is used for simulating a common fault scene, and helps to improve the recoverability of a distributed system and the fault tolerance of a fault. The method aims at the defects of fault flow management deficiency and poor reusability of fault experiments existing in the control of a command line interface by a chaotic engineering implementation tool.
The existing chaos engineering experiment tool has the following defects:
1. the chaos engineering experiment tool only provides a command line execution mode, for chaos engineering implementers, fault injection and destruction commands need to be manually input, necessary parameters of different types of faults are different, a practical process needs to refer to a command manual, and the chaos engineering experiment tool is not convenient enough.
2. The method is lack of a unified management entrance of a multi-server experimental scene, and does not support fault injection and fault arrangement of complex scenes for multiple servers at the same time.
3. The method does not have the capability of saving the drilling template in the executed fault drilling process, and has poor reusability.
Disclosure of Invention
The embodiment of the invention provides a fault injection method, a fault injection device, a fault injection equipment and a fault injection storage medium, which can automatically assemble a fault flow script, support fault drilling and flow arrangement of multiple servers and multiple fault scenes, save a fault drilling flow and facilitate subsequent regular execution and reuse.
According to an aspect of the present invention, there is provided a fault injection method, including:
acquiring operation behavior information, fault information and identification information of a target server;
generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server;
and controlling the proxy end of the target server to perform fault injection according to the HTTP message.
According to another aspect of the present invention, there is provided a fault injection apparatus including:
the acquisition module is used for acquiring the operation behavior information, the fault information and the identification information of the target server;
the message generating module is used for generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server;
and the fault injection module is used for controlling the proxy end of the target server to perform fault injection according to the HTTP message.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the fault injection method of any of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the fault injection method according to any one of the embodiments of the present invention when the computer instructions are executed.
The embodiment of the invention obtains the operation behavior information, the fault information and the identification information of the target server; generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server; and controlling an agent end of the target server to perform fault injection according to the HTTP message, automatically assembling a fault flow script, supporting fault drilling and flow arrangement of multiple servers and multiple fault scenes, and storing a fault drilling flow so as to facilitate subsequent regular execution and multiplexing.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flow chart of a fault injection method in an embodiment of the invention;
FIG. 2 is a schematic diagram of fault injection in an embodiment of the invention;
FIG. 3 is a schematic structural diagram of a fault injection apparatus in an embodiment of the invention;
fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a fault injection method provided in an embodiment of the present invention, where the present embodiment is applicable to a fault injection situation, and the method may be executed by a fault injection apparatus in an embodiment of the present invention, where the apparatus may be implemented in a software and/or hardware manner, as shown in fig. 1, the method specifically includes the following steps:
s110, acquiring operation behavior information, fault information and identification information of the target server.
Wherein the operation behavior information is used for defining the behavior type of the execution command, and the create is a create fault. The fault information is used for determining the fault type to be created, such as CPU full load, memory occupation, network delay and the like. The fault information may include at least one of a fault type, a fault parameter, a value corresponding to the fault parameter, and a fault start time, and the fault information may further include: the duration of the fault. The identification information of the target server may be an IP address of the target server, or may be an IP address and a port number of the target server.
Specifically, the manner of obtaining the operation behavior information may be: responding to a preset trigger operation, and displaying a fault command creating interface; responding to the selection operation of a user on a creating control on the fault command creating interface, and displaying a first template; and responding to the selection operation of the operation behavior information on the fault command creation interface by the user, and acquiring the operation behavior information. The manner of obtaining the operation behavior information may also be: responding to a preset trigger operation, and displaying a fault command creating interface; and responding to the selection operation of the operation behavior information of the user on the fault command creation interface, and acquiring the operation behavior information. The manner of obtaining the operation behavior information may also be: responding to a preset trigger operation, and displaying a fault command creating interface; and responding to the selection operation of the user on the creating control on the fault command creating interface, displaying the first template, and acquiring the operation behavior information input by the user into the first template.
Specifically, if the operation behavior information is obtained in the following manner: responding to a preset trigger operation, and displaying a fault command creating interface; responding to the selection operation of a user on a creating control on the fault command creating interface, and displaying a first template; in response to the selection operation of the user on the operation behavior information on the fault command creation interface, acquiring the operation behavior information, where the manner of acquiring the fault information may be: and updating the first template according to the operation behavior information to obtain a target template, and acquiring the fault information of the target template input by the user. If the mode of obtaining the operation behavior information is as follows: responding to a preset trigger operation, and displaying a fault command creating interface; responding to the selection operation of the operation behavior information of the user on the fault command creation interface, and acquiring the operation behavior information; the manner of obtaining the fault information may be: acquiring a fault type list corresponding to the operation behavior information; responding to the selection operation of a user on the fault type in the fault type list, and acquiring the fault type and a fault parameter list corresponding to the fault type; and responding to the selection operation of the user on the fault parameters in the fault parameter list, and acquiring the fault parameters and the numerical values corresponding to the fault parameters input by the user. If the mode of obtaining the operation behavior information is as follows: responding to a preset trigger operation, and displaying a fault command creating interface; responding to the selection operation of a user on a creating control on the fault command creating interface, displaying a first template, and acquiring operation behavior information input by the user to the first template; the manner of obtaining the fault information may be: and acquiring fault information input by a user into the first template.
Specifically, the manner of obtaining the identification information of the target server may be: and acquiring the identification information of the target server of the target template input by the user. The method for acquiring the identification information of the target server may further be: and responding to the selection operation of the identification information of the target server in the identification information list of the deployed servers on the fault command creation interface by the user, and acquiring the identification information of the target server. The method for acquiring the identification information of the target server may also be: and acquiring identification information of the target server input by the user into the first template.
And S120, generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server.
The identification information of the target server may be an IP address of the target server.
Specifically, the manner of generating the HTTP packet according to the operation behavior information, the fault information, and the identification information of the target server may be: and splicing the operation behavior information, the fault information and the identification information of the target server according to a uniform template, and finally packaging the operation behavior information, the fault information and the identification information of the target server into an HTTP message. The manner of generating the HTTP message according to the operation behavior information, the failure information, and the identification information of the target server may further be: and generating an HTTP message according to the fault type, the fault parameters, the values corresponding to the fault parameters, the fault starting time and the fault duration.
S130, controlling the proxy end of the target server to perform fault injection according to the HTTP message.
Specifically, the method for controlling the proxy of the target server to perform fault injection according to the HTTP message may be: and controlling the proxy agent of the target server to perform fault injection by using the HTTP request calling mode.
Optionally, the fault information includes: at least one of fault type, fault parameter, value corresponding to the fault parameter and fault starting time.
The fault type is used to determine the fault type that needs to be created, and may be, for example, cpu load, disk burn, mem load, network delay, or the like. The fault parameters are used for finely setting parameters such as the execution mode, the fault degree, the automatic termination time and the like of the fault, and can be cpu-percent, timeout, destination-ip, process, path and the like. The value corresponding to the fault parameter is set according to the test requirement, and may be a value input by a user, which is not limited in the embodiment of the present invention. The fault start time is a relative time with respect to the starting time of the fault flow, i.e., a start delay. The failure start time is set to prevent a case where a plurality of failure types are started in synchronization when a user selects the plurality of failure types.
Optionally, the obtaining operation behavior information, the fault information, and the identification information of the target server includes:
responding to a preset trigger operation, and displaying a fault command creating interface;
responding to the selection operation of the operation behavior information on the fault command creation interface by a user, and acquiring the operation behavior information and a fault type list corresponding to the operation behavior information;
responding to the selection operation of a user on the fault type in the fault type list, and acquiring the fault type and a fault parameter list corresponding to the fault type;
responding to the selection operation of the user on the fault parameters in the fault parameter list, and acquiring the fault parameters and the numerical values corresponding to the fault parameters input by the user;
responding to the selection operation of the identification information of the target server in the identification information list of the deployed server on the fault command creation interface by the user, and acquiring the identification information of the target server and a port number corresponding to the identification information of the target server;
and responding to the selection operation of the user on the fault starting time in the fault starting time list on the fault command creation interface, and acquiring the fault starting time.
The preset trigger operation may be a click of a prediction control on the interface, or may also be an opening instruction input by voice, or may be other trigger operations, which is not limited in this embodiment of the present invention.
The fault command creation interface may include a target template, where the target template includes: the method comprises the steps that elements such as operation behavior information, fault types, fault parameters, identification information of the server and fault starting time correspond to a pull-down menu, an operation behavior information list, a fault type list, a fault parameter list, an identification information list of the server and a fault starting time list can be displayed through the pull-down menu, and the operation behavior information, the fault information and the identification information of a target server are obtained through clicking data in the list.
The display mode of the fault type list may be in a pull-down menu form, or may be directly displayed in a blank area, which is not limited in the embodiment of the present invention. It should be noted that the display modes of the failure parameter list, the identification information list of the deployed server, and the failure start time list are the same as the failure type list, and are not described herein again.
Specifically, after responding to the selection operation of the operation behavior information of the user on the fault command creation interface, a target fault command template is displayed, the target fault command template supports the direct selection of the operation behavior and the fault type at the management end, after the selection of the fault type is completed, a fault parameter list corresponding to the fault type can be automatically matched according to the established incidence relation between the fault type and the fault parameter, and the user can directly select and configure the required parameters and the values of the parameters.
Optionally, the obtaining of the fault type list corresponding to the operation behavior information includes:
splitting fault commands in a historical fault command set according to a command design rule to obtain attribute information of the fault commands, wherein the attribute information of the fault commands comprises: operational behavior information and fault types;
determining the corresponding relation between the operation behavior and the fault type according to the attribute information of the fault command;
generating a first relation table according to the corresponding relation between the operation behaviors and the fault types;
and inquiring the first relation table according to the operation behavior information to obtain a fault type list corresponding to the operation behavior information.
The first relation table stores operation behaviors and at least one fault type corresponding to the operation behaviors.
Optionally, the attribute information further includes: a fault parameter;
correspondingly, obtaining a fault parameter list corresponding to the fault type includes:
determining the corresponding relation between the fault type and the fault parameter according to the attribute information of the fault command;
generating a second relation table according to the corresponding relation between the fault type and the fault parameter;
and inquiring the second relation table according to the fault type to obtain a fault parameter list corresponding to the fault type.
The second relation table stores fault types and at least one fault parameter corresponding to the fault types.
Wherein the attribute information of the fault command may include: at least one of a command header, an operational behavior, a fault type, a fault parameter, and a mode parameter.
The command design rule is used for determining the command formats and the component elements supported by the tool, and the command design rule may be: the command component elements include: the device comprises a command header, an operation behavior, a fault type, a fault parameter and a mode parameter, wherein the command header is used for a fixed command starting mark, the operation behavior is used for determining the behavior type of an execution command, the fault type is used for determining the fault type needing to be created, the fault parameter is used for finely setting parameters such as an execution mode, a fault degree and an automatic termination time of a fault, and the mode parameter is used for supporting selection of a debug mode and viewing of a help document. For example, as shown in table 1:
TABLE 1
Figure BDA0003895037800000101
Specifically, splitting the fault command in the historical fault command set according to the command design rule to obtain the attribute information of the fault command may be as follows: and carrying out standardized splitting on the complete fault command according to a command design rule, wherein the command comprises 5 parts of a command header, an operation behavior, a fault type, a fault parameter and a mode parameter.
Specifically, an association relationship between a "fault type" and a "fault parameter" is established on the basis of table 1, a one-to-many relationship exists between the fault type and the fault parameter, a fault parameter list corresponding to different fault types is determined, the fault parameters are distinguished according to necessity and non-necessity, the non-necessity parameter may not be set, and the value types and ranges of different parameters are limited.
Optionally, the fault information further includes: the duration of the fault.
Wherein, the duration refers to the acting duration of the fault on the target server, and is an optional setting. After the duration is set, the execution of the fault command can be automatically destroyed after the duration is reached, and if the option is not set, the execution can be continued to the end time of the whole fault flow, and unified destruction is carried out.
Optionally, the method further includes:
and responding to the selection operation of the user on the fault duration in the fault duration list on the fault command creation interface, and acquiring the fault duration.
The display mode of the fault duration list is the same as the fault type list, and details are not repeated here.
It should be noted that the duration of the fault may also be directly input by the user, and this is not limited in the embodiment of the present invention.
Optionally, the method further includes:
responding to the selection operation of a target fault command on the fault command creation interface by a user, and displaying a property editing interface corresponding to the target fault command;
and responding to the editing operation of the user on the attribute editing interface corresponding to the target fault command, and generating an updated target fault command.
And the attribute editing interface corresponding to the target fault command displays the operation behavior information, the fault information and the identification information of the target server corresponding to the target fault command, and a user can modify one or more of the information to generate a new fault command. To facilitate fault injection based on the new fault command.
Specifically, in the embodiment of the present invention, a test case (that is, a fault command) may be generated according to the acquired operation behavior information, the fault information, and the identification information of the target server, the test case is generated and stored, a test case list is displayed on the fault command creation interface, and a user may directly use the test case in the test case list to perform fault injection, or may modify the test case in the test case list to obtain a new test case, and perform fault injection based on the new test case.
In a specific example, acquiring operation behavior information, a fault type, a fault parameter, a numerical value corresponding to the fault parameter, identification information of a target server, a target port number and fault starting time; generating an HTTP message according to the operation behavior information, the fault type, the fault parameters, the values corresponding to the fault parameters, the identification information of the target server, the target port number and the fault starting time; and controlling the proxy end of the target server to perform fault injection according to the HTTP message.
In another specific example, a fault command creation interface is displayed in response to a preset trigger operation; responding to the selection operation of the operation behavior of the user on the fault command creation interface, displaying a target template, and acquiring a fault parameter list corresponding to the operation behavior; responding to the selection operation of a user on a target fault type in a fault parameter list in the target template, and acquiring the target fault type and a fault parameter list corresponding to the target fault type; responding to the selection operation of a user on a target fault parameter in a fault parameter list in the target template, and acquiring a target fault parameter and a target numerical value corresponding to the input target fault parameter; and acquiring identification information, fault starting time and fault duration of the target server input in the target template by the user, and constructing a fault command (namely generating an HTTP message) according to the operation behavior information, the fault type, the fault parameter and the numerical value corresponding to the fault parameter selected in the target template by the user and the identification information, the target port number, the fault starting time and the fault duration of the target server input in the target template by the user.
In a specific example, a document is designed according to a fault command, the fault command is subjected to standardized splitting, optional parameters of each type of fault type are refined, and an incidence relation between command component elements is constructed; after the fault command template is constructed, the method supports the selection of operation behavior information and fault types at the management end, and after the selection of the fault types is completed, a fault parameter list corresponding to the fault types is automatically matched according to the incidence relation between the fault types and the fault parameters, so that an implementer can directly configure required parameters and values of all the parameters; the target server is used for setting an input fault injection position, and comprises a target server IP address and a port number of an agent open monitoring deployed in the target server. The failure timing setting comprises two parts of failure starting time and duration. The fault start time is a relative time with respect to the start time of the fault flow, i.e., a start delay. The duration refers to the acting time of the fault on the target server, and is an optional setting. After the duration is set, the execution of the fault command can be automatically destroyed after the duration is reached, and if the option is not set, the execution can be continued to the end time of the whole fault flow, and unified destruction is carried out. The automatic assembly of the fault flow script is divided into two parts, namely fault remote call command assembly and time sequence control. The fault remote call command comprises an IP address, a port number, a chaos engineering experiment fixed mark (command head) and a fault command body (a fault command body is generated according to fault information) of a target server. The management end tool can be assembled according to various parameters set by implementers and a unified template, finally packaged into an HTTP message, and used for controlling the agent end agent of the target server to perform fault injection in an HTTP request calling mode. The time sequence control part is completed at a management end, and the Sleep command is adopted to realize the control of executing time sequence and delaying starting time of each fault command, thereby achieving the purpose of flow arrangement. If the duration parameter is set, the management end stores the unique fault id returned by the target server agent end agent, and after the duration is over, the HTTP request encapsulation destroy command is used for calling the agent end agent to destroy the fault. And deploying the agent terminal agent at the target server, and realizing monitoring of the command of the management terminal by opening the specified port so as to perform fault injection and fault destruction in a mode of receiving HTTP call.
The main functions of the agent deployment agent are as follows: firstly, establishing a communication link between a management terminal and a target server, and receiving a chaotic engineering experiment command and returning an execution result parameter; secondly, analyzing a fault remote call command sent by a management end, and extracting a fault command body in the HTTP message; and thirdly, starting the chaotic engineering experiment tool on the target server to execute the corresponding fault command in a command line mode. The method comprises the following steps of recording a complete fault drilling sample at a management end, locally storing the generated fault drilling sample, providing analysis and editing functions for a fault flow arrangement script, and facilitating adjustment and multiplexing of subsequent fault drilling based on the existing sample, wherein the specific contents are as follows: after completing a complete fault drilling, the key information of the fault drilling can be recorded in the form of drilling sample, including: and the fault command, the fault parameters, the target server, the fault execution time sequence information, the fault execution abnormal condition and the sample execution times are stored in a local database. The chaotic engineering experiment implementer can check the past fault drilling execution records at the management terminal, can select the past fault drilling sample and reuse the previous fault drilling sample by one key, and the design provides a convenient mode for the chaotic engineering to periodically execute the fault drilling. Meanwhile, the analysis and editing functions of the fault flow arrangement script can adjust the original parameter setting according to the change of the requirement of an implementer, and support the reconfiguration of the fault type, the fault parameters, the fault flow and the target server.
In a specific example, as shown in fig. 2, after the management terminal generates the fault drilling samples based on the operation behavior information, the fault information, and the identification information of the target server, the management terminal arranges the drilling sequences of the plurality of fault drilling samples according to the fault start time, and performs fault injection in the form of receiving an HTTP call by sequentially passing through the agent terminals deployed by the corresponding target servers according to the drilling sequences of the plurality of fault drilling samples.
The embodiment of the invention carries out standardized splitting on the fault command, refines the selectable parameters of each type of fault type and provides a more direct and convenient way for an implementer to edit the fault command. And a management end and an agent end are set, each target server is controlled in an HTTP calling mode to perform fault drilling, and control entries of chaotic engineering drilling are integrated. The method supports process arrangement and time sequence control, automatically controls multiple servers in a fault process script mode, and carries out fault drilling in a time-sharing sequence mode. The method has the advantages that the drilling samples in the chaotic engineering implementation process are recorded and stored, two modes of direct operation and operation after editing are supported, the problem of asset waste in the fault drilling process is solved, and the reusability of chaotic engineering drilling is improved.
According to the technical scheme of the embodiment, operation behavior information, fault information and identification information of a target server are obtained; generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server; according to the technical scheme of the invention, the fault flow script can be automatically assembled, fault drilling and flow arrangement of multiple servers and multiple fault scenes can be supported, the fault drilling flow can be stored, and subsequent regular execution and multiplexing are facilitated.
Example two
Fig. 3 is a schematic structural diagram of a fault injection apparatus according to an embodiment of the present invention. The present embodiment may be applicable to the case of fault injection, where the apparatus may be implemented in a software and/or hardware manner, and the apparatus may be integrated in any device that provides a fault injection function, as shown in fig. 3, where the fault injection apparatus specifically includes: an acquisition module 210, a message generation module 220, and a fault injection module 230.
The acquisition module is used for acquiring operation behavior information, fault information and identification information of the target server;
the message generation module is used for generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server;
and the fault injection module is used for controlling the proxy end of the target server to perform fault injection according to the HTTP message.
The product can execute the method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
According to the technical scheme of the embodiment, operation behavior information, fault information and identification information of a target server are obtained; generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server; according to the technical scheme of the invention, the fault flow script can be automatically assembled, fault drilling and flow arrangement of multiple servers and multiple fault scenes can be supported, the fault drilling flow can be stored, and subsequent regular execution and multiplexing are facilitated.
EXAMPLE III
FIG. 4 shows a schematic block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of 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, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, optical disk, or the like; and a communication unit 19 such as a network card, modem, 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.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of 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, or the like. The processor 11 performs the various methods and processes described above, such as the fault injection method.
In some embodiments, the fault injection method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the fault injection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the fault injection method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, 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 may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, 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: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A fault injection method, comprising:
acquiring operation behavior information, fault information and identification information of a target server;
generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server;
and controlling the proxy end of the target server to perform fault injection according to the HTTP message.
2. The method of claim 1, wherein the fault information comprises: at least one of fault type, fault parameter, value corresponding to the fault parameter and fault starting time.
3. The method of claim 2, wherein obtaining operational behavior information, failure information, and identification information of the target server comprises:
responding to a preset trigger operation, and displaying a fault command creating interface;
responding to the selection operation of the operation behavior information on the fault command creation interface by a user, and acquiring the operation behavior information and a fault type list corresponding to the operation behavior information;
responding to the selection operation of a user on the fault type in the fault type list, and acquiring the fault type and a fault parameter list corresponding to the fault type;
responding to the selection operation of the user on the fault parameters in the fault parameter list, and acquiring the fault parameters and the numerical values corresponding to the fault parameters input by the user;
responding to the selection operation of the identification information of the target server in the identification information list of the deployed server on the fault command creation interface by the user, and acquiring the identification information of the target server and a port number corresponding to the identification information of the target server;
and responding to the selection operation of the user on the fault starting time in the fault starting time list on the fault command creation interface, and acquiring the fault starting time.
4. The method according to claim 3, wherein obtaining the fault type list corresponding to the operation behavior information includes:
splitting fault commands in a historical fault command set according to a command design rule to obtain attribute information of the fault commands, wherein the attribute information of the fault commands comprises: operational behavior information and fault type;
determining the corresponding relation between the operation behavior and the fault type according to the attribute information of the fault command;
generating a first relation table according to the corresponding relation between the operation behaviors and the fault types;
and inquiring the first relation table according to the operation behavior information to obtain a fault type list corresponding to the operation behavior information.
5. The method of claim 4, wherein the attribute information further comprises: a fault parameter;
correspondingly, obtaining a fault parameter list corresponding to the fault type includes:
determining the corresponding relation between the fault type and the fault parameter according to the attribute information of the fault command;
generating a second relation table according to the corresponding relation between the fault type and the fault parameter;
and inquiring the second relation table according to the fault type to obtain a fault parameter list corresponding to the fault type.
6. The method of claim 3, wherein the fault information further comprises: the duration of the fault.
7. The method of claim 6, further comprising:
and responding to the selection operation of the user on the fault duration in the fault duration list on the fault command creation interface, and acquiring the fault duration.
8. A fault injection device, comprising:
the acquisition module is used for acquiring the operation behavior information, the fault information and the identification information of the target server;
the message generation module is used for generating an HTTP message according to the operation behavior information, the fault information and the identification information of the target server;
and the fault injection module is used for controlling the proxy end of the target server to perform fault injection according to the HTTP message.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the fault injection method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the fault injection method of any one of claims 1-7 when executed.
CN202211271784.2A 2022-10-18 2022-10-18 Fault injection method, device, equipment and storage medium Pending CN115509842A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211271784.2A CN115509842A (en) 2022-10-18 2022-10-18 Fault injection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211271784.2A CN115509842A (en) 2022-10-18 2022-10-18 Fault injection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115509842A true CN115509842A (en) 2022-12-23

Family

ID=84510100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211271784.2A Pending CN115509842A (en) 2022-10-18 2022-10-18 Fault injection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115509842A (en)

Similar Documents

Publication Publication Date Title
CN109683859B (en) Computer software development management platform, equipment and readable storage medium
CN114157701A (en) Task testing method, device, equipment and storage medium
CN114328132A (en) Method, device, equipment and medium for monitoring state of external data source
CN114501501A (en) Configuration management method, device, equipment and medium for mobile communication network target range
CN113792341A (en) Privacy compliance automation detection method, device, equipment and medium for application program
CN114546830A (en) Regression testing method, regression testing device, electronic equipment and storage medium
CN113515462A (en) Method, device, equipment and storage medium for testing
CN116089739A (en) Message pushing method, device, electronic equipment and storage medium
CN116894078A (en) Information interaction method, device, electronic equipment and medium
CN115509842A (en) Fault injection method, device, equipment and storage medium
CN116483707A (en) Test method, test device, test apparatus, test program, and test program
CN115437865A (en) Method, device, equipment and medium for testing abnormal power failure of hard disk
CN113326192B (en) Application testing method, device, equipment and storage medium for mobile terminal
CN115391204A (en) Test method and device for automatic driving service, electronic equipment and storage medium
CN115017047A (en) Test method, system, equipment and medium based on B/S architecture
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN111176982A (en) Test interface generation method and device
CN111143193A (en) Big data service testing method, system, terminal and storage medium based on RobotFramework
CN117539719A (en) Application operation monitoring method, device, equipment and medium
CN115964243A (en) Interface simulation method, device, electronic equipment and storage medium
CN115658341A (en) Method, device, equipment and medium for reading and writing data by Freeswitch
CN114461233A (en) System and method for realizing automatic deployment of data center software based on cloud environment
CN116107878A (en) Remote debugging method, device, equipment and storage medium
CN118034749A (en) Updating method and electronic equipment
CN115408120A (en) Operation method, device, equipment, medium and product of script language file

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination