Fault isolation mechanism verification method and device based on chaos engineering and medium

By creating and triggering fault events in the chaos engineering system, the operating status of the fault isolation mechanism is automatically analyzed and verified, which solves the problems of low verification efficiency and poor accuracy of the fault isolation mechanism in the existing technology, and realizes an efficient and accurate fault isolation mechanism. verify.

CN118796697AInactive Publication Date: 2024-10-18BEIJING PACTERA JINXIN TECH LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410934209.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-10-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing fault isolation mechanism verification methods have low efficiency and poor accuracy, require manual operations and consume a lot of resources. They lack standardized processes, resulting in inaccurate verification results and easy missed or misjudged decisions.

Method used

Using a method based on chaos engineering, by obtaining the network configuration information and fault configuration information of the target system, a fault event is created and triggered in the chaos engineering system, the event results are analyzed and compared with the expected results, and the operating status of the fault isolation mechanism is automatically verified.

Benefits of technology

It reduces the complexity and cost of fault isolation mechanism verification, improves efficiency and accuracy, avoids the need for manual input of computer instructions and scripts, and realizes automated fault isolation mechanism verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796697A_ABST
    Figure CN118796697A_ABST
Patent Text Reader

Abstract

The invention provides a fault isolation mechanism verification method and device based on chaos engineering and a medium, and relates to the field of software testing. The method comprises the steps that network configuration information of a target system and fault configuration information of at least one target domain are acquired, a fault isolation mechanism for isolating faults among different domains is arranged in the front end of the target system, and the fault configuration information is used for enabling the at least one target domain and the rear end of the target system to generate network faults; creating a chaos engineering event in the chaos engineering system based on the fault configuration information and the network configuration information; triggering a chaos engineering event under the condition that the multiple domain equalization processing tasks of the target system; analyzing the target data to determine an event result of the chaos engineering event, wherein the target data is operation data generated by the target system before and after the chaos engineering event is triggered; and determining the operation state of the fault isolation mechanism by comparing an event result with an expected result. According to the scheme, the verification efficiency and accuracy of the fault isolation mechanism can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software testing, and in particular to a method, device and medium for verifying a fault isolation mechanism based on chaos engineering. Background Art

[0002] The system's fault isolation mechanism is a collection of strategies and technologies that aims to prevent system faults from spreading to the entire system, thereby improving the stability and reliability of the system. However, whether in the system development phase or in the system operation and maintenance process, there may be problems with the failure of the fault isolation mechanism. In order to ensure system reliability and user experience, it is essential to verify the fault isolation mechanism.

[0003] At present, the existing fault isolation mechanism verification is mainly implemented by manually typing commands in the target system; for example, manually executing commands such as kill -9 PID in the terminal or executing a script to stop the program to simulate the service outage fault scenario, executing the kill -19 PID command to suspend the process, and manually writing instructions to execute scripts or unplugging the network cable to simulate fault scenarios such as network card failure. However, this method has the following defects: First, it requires manual typing of fault simulation instructions, manual writing and execution of fault simulation scripts, which is inefficient and has a high error rate; second, it requires more resource support and often involves process approval and operation permission application issues; third, there is no standard execution process, and the process steps are confusing, resulting in inaccurate verification results, missed judgments and misjudgments, and therefore it is in urgent need of improvement. Summary of the invention

[0004] The present invention provides a method, device and medium for verifying a fault isolation mechanism based on chaos engineering, so as to solve the defects of the prior art that the verification cost of the fault isolation mechanism is high and the efficiency and accuracy are poor. By means of chaos engineering events, faults are automatically injected into the system business processing process to create a partial domain failure scenario, and the event results are automatically analyzed and compared with the expected results to verify whether the fault isolation mechanism is effective.

[0005] According to a first aspect of the present invention, the present invention provides a method for verifying a fault isolation mechanism based on chaos engineering, the method comprising: Acquire network configuration information of a target system and fault configuration information of at least one target domain, wherein a fault isolation mechanism for isolating faults between different domains is provided in the front end of the target system, and the fault configuration information is used to cause a network fault between at least one target domain and the back end of the target system; Creating a chaos engineering event in a chaos engineering system based on the fault configuration information and the network configuration information; In the case where multiple domains of the target system process tasks in a balanced manner, triggering the chaos engineering event; Analyzing target data to determine the event result of the chaos engineering event, wherein the target data is the operation data generated by the target system before and after the chaos engineering event is triggered; By comparing the event result with the expected result, the operating status of the fault isolation mechanism is determined.

[0006] According to the chaos engineering-based fault isolation mechanism verification method of the present invention, the analyzing of target data to determine the event result of the chaos engineering event includes: Obtaining the transaction volume per second of the target system before the chaos engineering event is executed through a preset monitoring program to obtain a first value; Acquire the transaction processing volume per second of the target system during the execution of the chaos engineering event through the preset monitoring program to obtain a second value; Obtaining, through the preset monitoring program, the transaction volume per second of the target system after the chaos engineering event is executed, to obtain a third value; Obtaining, through the preset monitoring program, the abnormal status code, duration, and number of occurrences of the target system after the chaos engineering event is triggered; The following processing is performed on the data obtained by the preset monitoring program to obtain an event result: determine whether the first value and the third value are equal, determine whether the first value and the third value are both greater than the second value, determine whether the second value is equal to zero, determine whether the abnormal status code generated by the target system contains a preset abnormal status code, and determine whether the duration corresponding to the preset abnormal status code exceeds the preset duration.

[0007] According to the fault isolation mechanism verification method based on chaos engineering of the present invention, the operation status of the fault isolation mechanism is determined by comparing the event result with the expected result, including: If the event result is that all the judgment results are met, it is determined that the operating state of the fault isolation mechanism is normal; If any one of the event results is judged to be inconsistent, it is determined that the operating state of the fault isolation mechanism is abnormal.

[0008] According to the chaos engineering-based fault isolation mechanism verification method of the present invention, in the case where multiple domains of the target system are balanced in processing tasks, triggering the chaos engineering event includes: Starting multiple stress testing tools, generating preset stress tasks through the multiple stress testing tools in parallel, and distributing them to each domain of the front end in a load balancing manner; When it is detected that the running time of multiple stress testing tools has reached the set time, the chaos engineering system is instructed to execute the chaos engineering event; When it is detected that the chaos engineering event ends running at a set time, generation of preset stress tasks is stopped, and multiple stress testing tools are closed.

[0009] According to the chaos engineering-based fault isolation mechanism verification method of the present invention, the obtaining of network configuration information of the target system and fault configuration information of at least one target domain includes: Get the target system's network configuration information based on the following steps: Installing an Agent program on the back end of the target system; Obtain the IP and network card information of the target system through the Agent program; Fault configuration information for at least one target domain based on the following steps: Obtaining event parameters, including event name, event duration, and event description; Obtain fault event parameters, wherein the fault event parameters include target domain information, event types corresponding to each target domain, IP and network card information, and the event type includes at least one of killing a process, pausing a process, and network packet loss.

[0010] According to the chaos engineering-based fault isolation mechanism verification method of the present invention, creating a chaos engineering event in a chaos engineering system based on the fault configuration information and the network configuration information includes: Searching for instructions from a fault instruction library of the chaos engineering system according to the event description in the event parameter; The found fault instructions are configured according to the event parameters and the fault event parameters to generate a chaos engineering event consisting of the configured post-fault instructions.

[0011] According to the chaos engineering-based fault isolation mechanism verification method of the present invention, when the operating state of the fault isolation mechanism is abnormal, the method further includes: The target system after the rectification of the fault isolation mechanism is taken as a new target system, and the step of triggering the chaos engineering event is returned to execute the multiple domain balancing processing tasks of the target system.

[0012] According to a second aspect of the present invention, the present invention further provides a fault isolation mechanism verification device based on chaos engineering, the device comprising: an acquisition module, configured to acquire network configuration information of a target system and fault configuration information of at least one target domain, wherein the target system includes a front end and a back end having multiple domains, and the front end has a fault isolation mechanism for isolating faults between different domains; A creation module, used to create a chaos engineering event in a chaos engineering system based on the fault configuration information and the network configuration information; A trigger module, used for triggering the chaos engineering event when multiple domains of the target system are processing tasks in a balanced manner; An analysis module, used to analyze target data to determine the event result of the chaos engineering event, wherein the target data is the operation data generated by the target system before and after the chaos engineering event is triggered; A comparison module is used to determine the operating status of the fault isolation mechanism by comparing the event result with the expected result.

[0013] According to the third aspect of the present invention, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the fault isolation mechanism verification method based on chaos engineering as described above is implemented.

[0014] According to a fourth aspect of the present invention, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for verifying a fault isolation mechanism based on chaos engineering.

[0015] The present invention provides a fault isolation mechanism verification method based on chaos engineering. The method uses the network configuration information of the target system and the fault configuration information including at least one target domain to create a chaos engineering event that can cause a network failure between the target domain in the front end and the back end. The chaos engineering event is triggered when multiple normal business operations are processed at the front end of the target system, thereby creating an effective condition for the fault isolation mechanism of the target system. Then, the operating data generated by the target system before and after the chaos engineering event is triggered is analyzed to obtain the event result. Finally, the event result is compared with the expected result to obtain the operating status of the fault isolation mechanism. The entire verification process does not require multi-professional cooperation to reduce the complexity of the fault isolation mechanism verification. With the help of chaos engineering tools, manual input of any computer instructions, program scripts or changes in program code is avoided, which can not only reduce the verification cost, but also help to improve the efficiency and accuracy of the fault isolation mechanism verification.

[0016] In addition, the present invention provides a chaos engineering-based fault isolation mechanism verification device, an electronic device and a non-transitory computer-readable storage medium, which can also achieve the above-mentioned technical effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 This is one of the flow charts of the chaos engineering-based fault isolation mechanism verification method provided by the present invention.

[0019] Figure 2 It is a schematic diagram of the principle of implementing fault isolation mechanism verification by applying multiple servers provided by the present invention.

[0020] Figure 3 This is the second flow chart of the chaos engineering-based fault isolation mechanism verification provided by the present invention.

[0021] Figure 4 It is a structural schematic diagram of the chaos engineering-based fault isolation mechanism verification device provided by the present invention.

[0022] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] Combine the following Figures 1 to 5 The present invention describes a method for verifying a fault isolation mechanism based on chaos engineering, a device for verifying a fault isolation mechanism based on chaos engineering, an electronic device, and a non-transient computer-readable storage medium.

[0025] Figure 1 This is one of the flow charts of the fault isolation mechanism verification method based on chaos engineering provided by the present invention. Please refer to Figure 1 As shown, this embodiment provides a method for verifying a fault isolation mechanism based on chaos engineering. The method can be implemented through steps S101 to S105. Each step will be described in detail below: Step S101, obtaining network configuration information of a target system and fault configuration information of at least one target domain, wherein the front end of the target system has a fault isolation mechanism for isolating faults between different domains, and the fault configuration information is used to cause a network fault between at least one target domain and the back end of the target system.

[0026] In this embodiment, the target system refers to the end-to-end system that needs to be verified, which processes services through the architecture of the front-end requesting the back-end, such as an end-to-end system that queries various types of data resources. Network configuration information includes but is not limited to the network configuration between the front-end and the back-end and the network configuration between the back-end and the data resources. Domain refers to the logical or physical partition that the fault domain isolation design is used to isolate the impact of the fault, ensuring that the fault in one domain does not spread to other domains. In the specific implementation process, multiple domains in the front-end can be obtained by encapsulating system applications and system services into containers.

[0027] The target domain refers to a part of the domains selected from multiple domains of the front end. The target domain is the object of the chaos engineering event simulation failure. It should be noted that the target domain is a subset of all domains of the front end, that is, in addition to the target domain, there are other domains in the system front end that are not used as the object of chaos engineering event failure simulation. The target domain can be one or more, and the specific number of target domains can be set according to the verification requirements. The fault isolation mechanism is a strategy to ensure the stability and reliability of the system. It prevents the failure of a single component from spreading to the entire system by limiting the scope of the failure.

[0028] Step S102: creating a chaos engineering event in the chaos engineering system based on the fault configuration information and the network configuration information.

[0029] Chaos engineering events refer to practical tasks that use chaos engineering to improve system resilience. Chaos engineering is a work that exposes the weak links of distributed systems by actively injecting hardware or software faults into application systems, and developing optimization plans to continuously improve the resilience of distributed systems. Chaos engineering fault injection technology principle: First, you need to install an agent (with system operation authorization completed) in the target application system. The agent is responsible for information interaction between the chaos engineering system and the target system. When the agent receives a specific fault injection instruction from the platform, it will perform the corresponding fault injection operation on the target system where it is located according to the instruction content. Chaos engineering can simulate many types of faults, such as service suspension, process killing, network packet loss, network delay, etc.

[0030] Step S103, triggering a chaos engineering event when multiple domains of the target system balance processing tasks.

[0031] In this embodiment, in order to make multiple domains of the target system process tasks evenly, this can be achieved by continuously sending tasks to the target system. The sent tasks are generated by a pre-set load tool at a specific pressure, or a large number of tasks can be collected in advance to form a task set, and then the tasks in the task set are sent to each domain according to the set load pressure. In the specific implementation process, in order to ensure that each domain of the system processes business stably, multiple load tools can be set to send tasks to each domain concurrently.

[0032] Step S104, analyzing the target data to determine the event result of the chaos engineering event, wherein the target data is the operation data generated by the target system before and after the chaos engineering event is triggered.

[0033] In this embodiment, there are many ways to obtain the target data, such as obtaining it through a preset monitoring program by monitoring the interface, or collecting and parsing the logs of the target system to find relevant data. It should be noted that the operation data of the target system is continuously generated, and the target data specifically refers to the target system operation data before and after the chaos engineering event is triggered. The target data can characterize the state of the target system before the network fault is injected, after the network fault is injected, and after the network fault is eliminated. The event result is obtained by analyzing the target data in a specific way.

[0034] Step S105: Determine the operating status of the fault isolation mechanism by comparing the event result with the expected result.

[0035] In this embodiment, the expected result is the expected state that can be achieved when the target system processes business normally when a preset fault isolation mechanism is triggered. Comparing the event result with the expected result can be achieved by comparing whether the event result is consistent with the expected result. If the event result is consistent with the expected result, it indicates that the fault isolation mechanism of the target system is triggered normally, that is, the operation state of the fault isolation mechanism is normal. If the event result is inconsistent with the expected result, it indicates that the fault isolation mechanism of the target system is not triggered normally, that is, the operation state of the fault isolation mechanism is abnormal.

[0036] The chaos engineering-based fault isolation mechanism verification method of this embodiment uses the network configuration information of the target system and the fault configuration information containing at least one target domain to create a chaos engineering event that can cause a network failure between the target domain in the front end and the back end, and triggers it when multiple normal business operations are processed at the front end of the target system. The chaos engineering event is triggered to create the effectiveness conditions for the fault isolation mechanism of the target system, and then the operating data generated by the target system before and after the chaos engineering event is triggered is analyzed to obtain the event result. Finally, the event result is compared with the expected result to obtain the operating status of the fault isolation mechanism. The entire verification process does not require multi-professional cooperation to reduce the complexity of the fault isolation mechanism verification. With the help of chaos engineering tools, manual input of any computer instructions, program scripts or changes in program code is avoided, which not only reduces the verification cost, but also helps to improve the efficiency and accuracy of the fault isolation mechanism verification.

[0037] In some possible implementations, step S104, analyzing the target data to determine the event result of the chaos engineering event, specifically includes: The transaction volume per second of the target system before the chaos engineering event is executed is obtained through a preset monitoring program to obtain a first value; The transaction volume per second of the target system during the execution of the chaos engineering event is obtained through a preset monitoring program to obtain a second value; The transaction volume per second of the target system after the chaos engineering event is executed is obtained through a preset monitoring program to obtain a third value; The preset monitoring program is used to obtain the abnormal status code, duration, and number of occurrences of the target system after the chaos engineering event is triggered. The following processing is performed on the data obtained by the preset monitoring program to obtain the event result: determine whether the first value and the third value are equal, determine whether the first value and the third value are both greater than the second value, determine whether the second value is equal to zero, determine whether the abnormal status code generated by the target system contains a preset abnormal status code, and determine whether the duration corresponding to the preset abnormal status code exceeds the preset duration.

[0038] In this embodiment, the preset abnormal status code is not limited to abnormal status codes such as 404 and 500, the preset duration can be set to 30 seconds, and the preset number of times can be set to 50. It should be noted that the specific parameter values ​​listed above are only used for illustration and should not be understood as limiting the solution of the present invention.

[0039] The chaos engineering-based fault isolation mechanism verification method of this embodiment monitors the business processing volume and abnormal status code information of the target system through a pre-deployed monitoring program, and obtains event results by analyzing and comparing the monitored data in a specific way. The event results greatly simplify the amount of comparison data and save computing resources.

[0040] In some possible implementations, step S105, determining the operating state of the fault isolation mechanism by comparing the event result with the expected result, specifically includes: If the event result is that all judgment results are met, it is determined that the operation status of the fault isolation mechanism is normal; If any of the event results is judged to be inconsistent, it is determined that the operating state of the fault isolation mechanism is abnormal.

[0041] The chaos engineering-based fault isolation mechanism verification method of this embodiment sets expected results based on the changes in transaction processing volume per second and the abnormal status code, and provides verification standards for whether the fault isolation mechanism is effectively triggered based on the expected results. It can automatically complete the verification of the effectiveness of the fault isolation mechanism without manual intervention and has high accuracy.

[0042] In some possible implementations, step S103, in the case where multiple domains of the target system balance processing tasks, triggering a chaos engineering event, specifically includes: Start multiple stress testing tools, generate preset stress tasks through multiple stress testing tools in parallel, and distribute them to various front-end domains in a load balancing manner; When it is detected that the running time of multiple stress testing tools has reached the set time, the chaos engineering system is ordered to execute chaos engineering events; When it is detected that the chaos engineering event has ended at the set time, the generation of preset stress tasks will stop and multiple stress testing tools will be closed.

[0043] The chaos engineering-based fault isolation mechanism verification method of this embodiment utilizes multiple stress testing tools to concurrently send tasks to multiple domains of the target system to simulate the normal business processing process, and uses load balancing to achieve task allocation to multiple domains to ensure the authenticity and effectiveness of the business simulation. In addition, the chaos engineering event is initiated by detecting a specific time point, and the business simulation is automatically ended by detecting a specific time point. The entire process does not require human intervention and has a high degree of automation.

[0044] In some possible implementations, step S101, obtaining network configuration information of a target system and fault configuration information of at least one target domain, specifically includes: Get the target system's network configuration information based on the following steps: Install the Agent program on the back end of the target system; Obtain the target system's IP and network card information through the Agent program; Fault configuration information for at least one target domain based on the following steps: Get event parameters, including event name, event duration, and event description; Obtain fault event parameters, wherein the fault event parameters include target domain information, event types corresponding to each target domain, IP and network card information, and the event type includes at least one of killing a process, pausing a process, and network packet loss.

[0045] The chaos engineering-based fault isolation mechanism verification method of this embodiment uses an Agent program to obtain the network configuration information of the target system, builds a communication bridge between the target system and the chaos engineering system, and makes it possible to automatically inject network faults into the target system; in addition, chaos engineering events are generated by obtaining event-related parameters and fault event parameters. The fault event parameters include target domain information and event type, etc., which improves the flexibility of fault configuration and only requires simple parameter configuration, which significantly reduces the business capability requirements of verification personnel.

[0046] In some possible implementations, step S102, based on the fault configuration information and the network configuration information, creates a chaos engineering event in the chaos engineering system, specifically including: Search for instructions from the fault instruction library of the chaos engineering system according to the event description in the event parameters; The found fault instructions are configured according to the event parameters and the fault event parameters to generate a chaos engineering event consisting of the configured post-fault instructions.

[0047] The chaos engineering-based fault isolation mechanism verification method of this embodiment realizes the automatic generation of fault events with the help of the fault instruction library of the chaos engineering system and the configured fault information. The generation of the fault events is relatively flexible and only requires simple parameter configuration for the user, thus reducing the business capability requirements of the verification personnel.

[0048] In some possible implementations, when the operating state of the fault isolation mechanism is abnormal, the method further includes: The target system after the fault isolation mechanism rectification is completed is used as a new target system, and the process returns to step S103. When multiple domains of the target system process tasks in a balanced manner, a chaos engineering event is triggered.

[0049] The chaos engineering-based fault isolation mechanism verification method of this embodiment implements re-verification by returning to execute fault injection under normal business after rectification in the case where the fault isolation mechanism is not effective. The result of the re-verification can assist in judging the rectification result and help improve the efficiency of the fault isolation mechanism rectification.

[0050] In another embodiment, in order to facilitate understanding of the solution of the present invention, the following Figure 2The multi-server architecture shown in the figure is used as an example to explain the method of the present invention in detail. Specifically, five servers are pre-deployed and recorded as server A, server B, server C, server D, and server E, respectively. A chaos engineering system is deployed in server A, a monitoring system is deployed in server B, and stress testing tools are deployed in servers C, server D, and server E. This embodiment provides a fault isolation mechanism verification method based on chaos engineering applied to the architecture. Please refer to Figure 3 As shown, the implementation process of this method is as follows: Step S301: Determine the target system. Determine the target system that needs to be verified for fault isolation effectiveness, and the chaos engineering system obtains basic information of each domain of the system through the agent program, including the IP and network card information of the target domain.

[0051] Step S302: Determine the expected result of the event. The fault event needs to be injected into one or more domains of the target system through the chaos engineering system. The expected result is: after the fault injection, the target domain where the fault injection is performed will trigger the fault isolation mechanism after reaching the fault isolation threshold, so that the front-end system of the target domain where the fault injection is performed will no longer request its back-end system, but the business processing of other target domains that have not been injected with faults will not be affected. At this time, the total TPS (number of business transactions processed per second) of the overall system obtained by the monitoring system will decrease compared to before the fault injection is performed, but will not drop to 0. After the chaos engineering event is ended, the fault scenario is resolved, so that the back-end system returns to normal. At this time, the fault isolation mechanism is also synchronously resolved, and the front-end can normally initiate transaction requests to the back-end, and the TPS returns to the level before the fault injection.

[0052] Step S303: Create a chaos engineering event. The creation process includes: (1) deploying a chaos engineering system in server A, and the chaos engineering system receives parameters such as "event name, event duration, event description"; (2) obtaining the IP of the target event machine; (3) the chaos engineering system receives fault events, such as event types (kill process, pause process, network packet loss), and configures various parameters, such as event start time, end time, event running time, target domain, event type specific configuration parameters, etc.; (4) saving the event case and waiting for execution.

[0053] Step S304: Preset the system monitoring system to obtain monitoring data and verify the system status. Deploy the monitoring system in Server B. On the monitoring system (such as APM, ZABBIX, Prometheus, Grafana, etc.), pre-set indicators related to the business processing of event attention (such as TPS: the number of business processed per second), and preset the interface request monitoring of the front-end system to the back-end system. The monitoring system needs to monitor the above indicator values ​​of all business systems (including the target domain that needs fault injection and other domains that do not need fault injection), and complete the monitoring settings of the front-end system to the back-end system interface request.

[0054] Step S305: Pre-set stress scenarios to simulate business processing in the production environment. Deploy the same stress testing tools, such as LoadRunner, JMeter, APTS and other testing tools, on the three servers C, D and E respectively, and configure them to form a stress machine cluster to achieve stable output of a large stress value. Because this process needs to simulate the application of a large business pressure, the exemplary stress machine cluster can refer to the number of concurrent users greater than 200 to generate tasks. Apply load pressure to the front-end system of the target system, simulate concurrent access to the front-end system through the test tool, and simulate multiple users simultaneously requesting the back-end system in accordance with different access actions (batch registration or login, query, modification, etc.) in a certain ratio (refer to the actual ratio of the production environment).

[0055] Step S306: Execute chaos engineering events to simulate fault scenarios under background pressure. After the event starts, run stably for 10 minutes under the preset stress scenario, and use the monitoring system deployed in server B to obtain the average value of the total TPS of all business systems, which is recorded as V1. After that, the chaos engineering system triggers the fault injection instruction and executes the chaos engineering event case in the back-end system application cluster. The underlying chaos tool and the Agent agent pre-installed in each application execute chaos engineering events on the target domain and perform fault injection. During this period, the stress scenario is uninterrupted, and the stress testing tool continues to send transaction requests to the target system; Step S307: Observe the situation of the system front-end requesting the back-end and the impact on other businesses. After the event fault injection, run again for 10 minutes. The chaos engineering system obtains the request data of the front-end system of the target domain where the fault injection is executed to its back-end system through the monitoring system during this period, and judges the situation of the front-end system triggering the fault isolation mechanism based on whether the amount of calculated request data gradually decreases to 0. At the same time, the monitoring system deployed in server B is used to obtain the average total TPS of all business systems during this step, which is recorded as V2.

[0056] Step S308: End the chaos engineering event and terminate the fault injection. Specifically, the process suspension and network packet loss fault scenarios will automatically terminate the fault injection and restore the target domain service after stopping the chaos engineering event case. If the fault scenario is "killing the process", the corresponding business startup script needs to be executed to restore the target domain service. The stress scenario continues to run for another 10 minutes to observe the recovery of the business processing of the target domain where the fault injection is executed. The monitoring system deployed in server B is used to obtain the average total TPS of all business systems during this step, which is recorded as V3.

[0057] Step S309: The chaos engineering system executes the event monitoring data of different chaos engineering failure events from the monitoring system, and calculates and determines whether the event results are consistent with the expected results of step S302. Among them, whether the total TPS of the overall system meets the expected results needs to be calculated and judged in combination with the data records during the event, that is, referring to the values ​​recorded during the above event process: V1, V2, V3. If after calculation, the result is V1=V3>V2, and V2≠0.

[0058] Step S310: If the monitoring data level during the event is consistent with that in step S302, it means that the event result meets the expected result, and then it is determined that the fault isolation mechanism of the target system is effective.

[0059] Step S311: If the monitoring data level during the event is inconsistent with that in step S302, it is determined that the fault isolation mechanism of the target system is invalid, and the fault isolation mechanism of the target system needs to be rectified.

[0060] The chaos engineering-based fault isolation mechanism verification method of this embodiment realizes that in the fault simulation process for verifying the effectiveness of system fault isolation, there is no need for multi-professional cooperation, no need to manually input any computer instructions, no need to manually run the corresponding program scripts, no need to change the program code and other operations; the entire implementation process only requires selecting the target domain and the injected fault type in the chaos engineering system, and then automatic chaos engineering events can realize various fault injections to verify the effectiveness of system fault isolation; it is suitable for various end-to-end systems and has good versatility.

[0061] The following is a description of the chaos engineering-based fault isolation mechanism verification device provided by the present invention. The chaos engineering-based fault isolation mechanism verification device described below and the chaos engineering-based fault isolation mechanism verification method described above can refer to each other.

[0062] Please refer to Figure 4 As shown, this embodiment provides a fault isolation mechanism verification device based on chaos engineering. Specifically, the device includes: an acquisition module 401, a creation module 402, a trigger module 403, an analysis module 404 and a comparison module 405. The above modules are described in detail below: The acquisition module 401 is used to acquire network configuration information of a target system and fault configuration information of at least one target domain, wherein the target system includes a front end and a back end having multiple domains, and the front end has a fault isolation mechanism for isolating faults between different domains; A creation module 402, used to create a chaos engineering event in the chaos engineering system based on the fault configuration information and the network configuration information; A trigger module 403 is used to trigger a chaos engineering event when multiple domains of the target system process tasks in a balanced manner; The analysis module 404 is used to analyze the target data to determine the event result of the chaos engineering event, wherein the target data is the operation data generated by the target system before and after the chaos engineering event is triggered; The comparison module 405 is used to determine the operating status of the fault isolation mechanism by comparing the event result with the expected result.

[0063] The chaos engineering-based fault isolation mechanism verification device of this embodiment uses the network configuration information of the target system and the fault configuration information including at least one target domain to create a chaos engineering event that can cause a network failure between the target domain in the front end and the back end, and triggers it when multiple normal business operations are processed at the front end of the target system. The chaos engineering event is triggered to create the effective conditions for the fault isolation mechanism of the target system, and then the operating data generated by the target system before and after the chaos engineering event is triggered is analyzed to obtain the event result, and finally the event result is compared with the expected result to obtain the operating status of the fault isolation mechanism. The entire verification process does not require multi-professional cooperation to reduce the complexity of the fault isolation mechanism verification. With the help of chaos engineering tools, manual input of any computer instructions, program scripts or changes in program code is avoided, which not only reduces the verification cost, but also helps to improve the efficiency and accuracy of the fault isolation mechanism verification.

[0064] It should be noted that each module in the above-mentioned chaos engineering-based fault isolation mechanism verification device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0065] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor (processor) 510, a communication interface (Communications Interface) 520, a memory (memory) 530 and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call the logic instructions in the memory 530 to execute a fault isolation mechanism verification method based on chaos engineering, which includes: obtaining network configuration information of the target system and fault configuration information of at least one target domain, wherein the front end of the target system has a fault isolation mechanism for isolating faults between different domains, and the fault configuration information is used to cause a network fault between at least one target domain and the back end of the target system; based on the fault configuration information and the network configuration information, creating a chaos engineering event in the chaos engineering system; when multiple domains of the target system perform balanced processing tasks, triggering the chaos engineering event; analyzing the target data to determine the event result of the chaos engineering event, wherein the target data is the operating data generated by the target system before and after the chaos engineering event is triggered; and determining the operating status of the fault isolation mechanism by comparing the event result with the expected result.

[0066] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0067] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the fault isolation mechanism verification method based on chaos engineering provided by the above methods, the method including: obtaining network configuration information of the target system and fault configuration information of at least one target domain, wherein the front end of the target system has a fault isolation mechanism for isolating faults between different domains, and the fault configuration information is used to cause a network fault between at least one target domain and the back end of the target system; based on the fault configuration information and the network configuration information, creating a chaos engineering event in the chaos engineering system; triggering the chaos engineering event when multiple domains of the target system perform balanced processing tasks; analyzing the target data to determine the event result of the chaos engineering event, wherein the target data is the operating data generated by the target system before and after the chaos engineering event is triggered; determining the operating status of the fault isolation mechanism by comparing the event result with the expected result.

[0068] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the chaos engineering-based fault isolation mechanism verification method provided by the above-mentioned methods, the method comprising: obtaining network configuration information of the target system and fault configuration information of at least one target domain, wherein the front end of the target system has a fault isolation mechanism for isolating faults between different domains, and the fault configuration information is used to cause a network fault between at least one target domain and the back end of the target system; creating a chaos engineering event in the chaos engineering system based on the fault configuration information and the network configuration information; triggering the chaos engineering event when multiple domains of the target system perform balanced processing tasks; analyzing the target data to determine the event result of the chaos engineering event, wherein the target data is the operating data generated by the target system before and after the chaos engineering event is triggered; determining the operating status of the fault isolation mechanism by comparing the event result with the expected result.

[0069] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0070] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fault isolation mechanism verification method based on chaos engineering, characterized in that: The method comprises: Acquire network configuration information of a target system and fault configuration information of at least one target domain, wherein a fault isolation mechanism for isolating faults between different domains is provided in the front end of the target system, and the fault configuration information is used to cause a network fault between at least one target domain and the back end of the target system; Creating a chaos engineering event in a chaos engineering system based on the fault configuration information and the network configuration information; In the case where multiple domains of the target system process tasks in a balanced manner, triggering the chaos engineering event; Analyzing target data to determine the event result of the chaos engineering event, wherein the target data is the operation data generated by the target system before and after the chaos engineering event is triggered; By comparing the event result with the expected result, the operating status of the fault isolation mechanism is determined.

2. The method for verifying a fault isolation mechanism based on chaos engineering according to claim 1, characterized in that: The analyzing the target data to determine the event result of the chaos engineering event includes: Obtaining the transaction volume per second of the target system before the chaos engineering event is executed through a preset monitoring program to obtain a first value; Acquire the transaction processing volume per second of the target system during the execution of the chaos engineering event through the preset monitoring program to obtain a second value; Obtaining, through the preset monitoring program, the transaction volume per second of the target system after the chaos engineering event is executed, to obtain a third value; Obtaining, through the preset monitoring program, the abnormal status code, duration, and number of occurrences of the target system after the chaos engineering event is triggered; The following processing is performed on the data obtained by the preset monitoring program to obtain an event result: determine whether the first value and the third value are equal, determine whether the first value and the third value are both greater than the second value, determine whether the second value is equal to zero, determine whether the abnormal status code generated by the target system contains a preset abnormal status code, and determine whether the duration corresponding to the preset abnormal status code exceeds the preset duration.

3. The method for verifying a fault isolation mechanism based on chaos engineering according to claim 2 is characterized in that: Determining the operating state of the fault isolation mechanism by comparing the event result with the expected result includes: If the event result is that all the judgment results are met, it is determined that the operating state of the fault isolation mechanism is normal; If any one of the event results is judged to be inconsistent, it is determined that the operating state of the fault isolation mechanism is abnormal.

4. The method for verifying a fault isolation mechanism based on chaos engineering according to claim 1, characterized in that: In the case where multiple domains of the target system are balanced in processing tasks, triggering the chaos engineering event includes: Starting multiple stress testing tools, generating preset stress tasks through the multiple stress testing tools in parallel, and distributing them to each domain of the front end in a load balancing manner; When it is detected that the running time of multiple stress testing tools has reached the set time, the chaos engineering system is instructed to execute the chaos engineering event; When it is detected that the chaos engineering event ends running at a set time, generation of preset stress tasks is stopped, and multiple stress testing tools are closed.

5. The method for verifying a fault isolation mechanism based on chaos engineering according to claim 1, characterized in that: The acquiring of network configuration information of the target system and fault configuration information of at least one target domain includes: Get the target system's network configuration information based on the following steps: Installing an Agent program on the back end of the target system; Obtain the IP and network card information of the target system through the Agent program; Fault configuration information for at least one target domain based on the following steps: Obtaining event parameters, including event name, event duration, and event description; Obtain fault event parameters, wherein the fault event parameters include target domain information, event types corresponding to each target domain, IP and network card information, and the event type includes at least one of killing a process, pausing a process, and network packet loss.

6. The method for verifying a fault isolation mechanism based on chaos engineering according to claim 5 is characterized in that: The creating a chaos engineering event in the chaos engineering system based on the fault configuration information and the network configuration information includes: Searching for instructions from a fault instruction library of the chaos engineering system according to the event description in the event parameter; The found fault instructions are configured according to the event parameters and the fault event parameters to generate a chaos engineering event consisting of the configured post-fault instructions.

7. The method for verifying a fault isolation mechanism based on chaos engineering according to claim 3 is characterized in that: In the case where the operating state of the fault isolation mechanism is abnormal, the method further includes: The target system after the rectification of the fault isolation mechanism is taken as a new target system, and the step of triggering the chaos engineering event is returned to execute the multiple domain balancing processing tasks of the target system.

8. A fault isolation mechanism verification device based on chaos engineering, characterized in that: The device comprises: An acquisition module, used to acquire network configuration information of a target system and fault configuration information of at least one target domain, wherein the target system includes a front end and a back end having multiple domains, and the front end has a fault isolation mechanism for isolating faults between different domains; A creation module, used to create a chaos engineering event in a chaos engineering system based on the fault configuration information and the network configuration information; A trigger module, used for triggering the chaos engineering event when multiple domains of the target system are processing tasks in a balanced manner; An analysis module, used to analyze target data to determine the event result of the chaos engineering event, wherein the target data is the operation data generated by the target system before and after the chaos engineering event is triggered; A comparison module is used to determine the operating status of the fault isolation mechanism by comparing the event result with the expected result.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the fault isolation mechanism verification method based on chaos engineering as described in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the fault isolation mechanism verification method based on chaos engineering as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Test method, device, equipment, medium and program product

    CN115080449A

  • Chaotic test method and device, electronic equipment and storage medium

    CN115374011A

  • System load balancing capability verification method and device based on chaos engineering

    CN117056081A

  • Business system operation quality information determination method and fault injection task creation method

    CN117194205A

  • Method and device for testing system

    CN117742999A