Strong and weak dependency treatment method and device based on chaos engineering, electronic equipment and storage medium

By adjusting the system link architecture, downgrading the degree of dependence and setting the dependency service deactivation mechanism in chaos engineering, the problem of poor strong and weak dependency governance in the existing technology is solved, and more efficient strong and weak dependency governance is achieved, adapting to Various scene requirements.

CN118869792AInactive Publication Date: 2024-10-29BEIJING PACTERA JINXIN TECH LTD

Patent Information

Application Number
CN202411052629.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-10-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology is too simple when converting strong dependencies into weak dependencies, and cannot meet the system requirements of different scenarios, resulting in poor governance of strong and weak dependencies.

Method used

A multi-dimensional governance method based on chaos engineering is adopted to adapt to the strong and weak dependency needs of different scenarios by adjusting the system link architecture, downgrading the dependence of the main service and setting the deactivation mechanism of dependent services.

Benefits of technology

It improves the effect of strong and weak dependency governance and can be applied to various scenarios such as high concurrency, large-scale data processing, cross-region and cross-network access, and complex business logic to ensure system stability and availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869792A_ABST
    Figure CN118869792A_ABST
Patent Text Reader

Abstract

The invention provides a strong and weak dependency treatment method and device based on chaos engineering, electronic equipment and a storage medium. The method comprises the steps that whether strong and weak dependency treatment needs to be conducted on a target system link or not is determined; and under the condition of determining that the target system link needs to be subjected to strong and weak dependency treatment, performing strong and weak dependency treatment on the target system link by adopting a preset treatment method, the preset governance method comprises at least one of adjusting a link architecture in the target system link, degrading the degree of dependence of the main service and setting a deactivation mechanism of the dependent service. According to the method, a multi-dimensional treatment method is adopted for strong and weak dependence treatment, strong and weak dependence treatment requirements of different scenes can be met, and the treatment effect of strong and weak dependence treatment 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 service technology, and in particular to a method, device, electronic device and storage medium for managing strong and weak dependencies based on chaos engineering. Background Art

[0002] After adopting the microservice architecture, system functions are generally not independent and usually rely on other services to complete business logic. For example, if the main service A needs to use the function of service B to complete the business logic, it is called that the main service A depends on service B. When service B is abnormal, it will affect the execution of the business process of the main service A and the availability of the system. This is "strong dependency", and vice versa is "weak dependency". After determining that there is a strong dependency relationship between services, the existing technology usually adopts the method of converting strong dependencies into weak dependencies for governance.

[0003] However, the method of directly converting strong dependencies into weak dependencies is too simplistic and cannot meet the system requirements of different scenarios, resulting in poor results in strong and weak dependency management. Summary of the invention

[0004] The present invention provides a strong and weak dependency management method, device, electronic device and storage medium based on chaos engineering, which are used to solve the defect that the strong and weak dependency management effect in the prior art is not good. A multi-dimensional management method is adopted to manage strong and weak dependencies, which can adapt to the strong and weak dependency management needs of different scenarios and improve the management effect of strong and weak dependencies.

[0005] The present invention provides a strong and weak dependency management method based on chaos engineering, comprising the following steps: Determine whether a target system link needs to be managed for strong or weak dependencies, the target system link includes a main service and a dependent service, the main service depends on the dependent service; When it is determined that the target system link needs to be managed for strong or weak dependencies, a preset management method is used to manage the strong or weak dependencies of the target system link. The preset management method includes at least one of adjusting the link architecture in the target system link, downgrading the degree of dependency on the main service, and setting a deactivation mechanism for the dependent service.

[0006] According to a strong and weak dependency management method based on chaos engineering provided by the present invention, the adjusting the link architecture in the target system link includes: By introducing a message queue, a strong dependency in the target system link is converted into a weak dependency, or, by adopting a distributed architecture, a strong dependency caused by a failure or anomaly of a single node in the target system link is converted into a weak dependency; Degrading the degree of dependence on the primary service includes: configuring a degradation strategy, and configuring a trigger strategy, wherein the trigger strategy is used to trigger the degradation strategy; The setting of the deactivation mechanism of the dependent service includes: triggering deactivation of the dependent service when the indicator to be detected is abnormal.

[0007] According to a strong and weak dependency management method based on chaos engineering provided by the present invention, the step of determining whether a target system link needs to be managed for strong and weak dependencies includes: Determine an expected detection result, where the expected detection result is used to indicate a change state of a target parameter value corresponding to the primary service after a preset fault is injected, where the target parameter value includes at least one of a number of services processed per second and a transaction success rate; Perform strong and weak dependency detection on the target system link through the chaos engineering system, monitoring system and pressure system to obtain actual detection results; According to the target comparison result, it is determined whether the target system link needs to be managed for strong or weak dependencies, and the target comparison result is obtained by comparing the actual detection result with the expected detection result.

[0008] According to a strong and weak dependency management method based on chaos engineering provided by the present invention, the expected detection results include: The change value of the target parameter value corresponding to the main service is less than or equal to the preset threshold; The target system link is tested for strong and weak dependencies through the chaos engineering system, the monitoring system, and the pressure system to obtain actual test results, including: Obtaining a first value, where the first value is a target parameter value corresponding to the main service obtained by the monitoring system when the duration of applying load pressure to the target server corresponding to the target system link by the pressure system reaches a preset first duration; Obtaining a second value, where the second value is a target parameter value corresponding to the main service obtained by the monitoring system when a preset fault is injected into a target application node in the target system link by the chaos engineering system after the duration of applying load pressure to the target server corresponding to the target system link by the pressure system reaches a preset second duration; Obtaining a parameter difference between the first value and the second value, wherein the parameter difference is the actual detection result; Determining whether the target system link needs to be managed for strong or weak dependencies according to the target comparison result includes: If the target comparison result indicates that the parameter difference is less than or equal to the preset threshold, it is determined that the target system link does not need to be managed for strong or weak dependencies.

[0009] According to a strong and weak dependency management method based on chaos engineering provided by the present invention, the expected detection result also includes: The change value of the target parameter value corresponding to the main service is greater than a preset threshold, and within a preset third time period, the target parameter value corresponding to the main service is restored to the parameter value before the preset fault is injected; The method of performing strong and weak dependency detection on the target system link through the chaos engineering system, the monitoring system and the pressure system to obtain actual detection results also includes: Acquire a first time, where the first time is the time of injecting the preset fault; Obtain a second time, where the second time is the time when a change value of the target parameter value corresponding to the main service obtained by the monitoring system is greater than a preset threshold and then recovers to the parameter value before the preset fault is injected within a preset second time period after the preset fault is injected into the target application node in the target system link by the chaos engineering system; Obtaining the interval between the first time and the second time, where the interval is the actual detection result; The determining, according to the target comparison result, whether the target system link needs to be managed for strong or weak dependencies also includes: If the target comparison result indicates that the parameter difference is greater than the preset threshold value, and the interval duration is less than or equal to the preset third duration, it is determined that the target system link does not need to be managed for strong or weak dependencies; If the target comparison result indicates that the parameter difference is greater than the preset threshold and the interval duration is not obtained, it is determined that the target system link needs to be managed for strong and weak dependencies.

[0010] According to a strong and weak dependency management method based on chaos engineering provided by the present invention, the method further includes: Determine whether the target system link after governance needs strong or weak dependency governance; In the case where it is determined that the target system link after the management needs to be managed for strong or weak dependencies, the preset management method is used to manage the strong or weak dependencies of the target system link.

[0011] The present invention also provides a strong and weak dependency management device based on chaos engineering, comprising the following modules: A governance judgment module, used to determine whether a target system link needs to be governed by strong or weak dependencies, wherein the target system link includes a main service and a dependent service, and the main service depends on the dependent service; A governance implementation module is used to adopt a preset governance method to perform strong and weak dependency management on the target system link when it is determined that the target system link needs to be managed. The preset governance method includes at least one of adjusting the link architecture in the target system link, downgrading the degree of dependence on the main service, and setting a deactivation mechanism for the dependent service.

[0012] 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 strong and weak dependency management method based on chaos engineering as described above is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements any of the strong and weak dependency management methods based on chaos engineering as described above.

[0014] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned strong and weak dependency management methods based on chaos engineering.

[0015] The strong and weak dependency management method, device, electronic device and storage medium based on chaos engineering provided by the present invention determine whether the target system link needs to be managed for strong and weak dependencies; when it is determined that the target system link needs to be managed for strong and weak dependencies, a preset management method is used to manage the strong and weak dependencies of the target system link, and the preset management method includes at least one of adjusting the link architecture in the target system link, downgrading the degree of dependency on the main service and setting a deactivation mechanism for the dependent service. The method can solve the problem that a single strong and weak dependency management method in the prior art cannot meet the system requirements of different scenarios and has poor management effect. The method for adjusting the link architecture in the target system link provided by the present invention can be applied to strong and weak dependency management scenarios such as high concurrency and large-scale data processing, cross-regional and cross-network access, complex business logic and system integration; the method for downgrading the degree of dependence on the main service provided by the present invention can be applied to strong and weak dependency management scenarios such as resource shortage and pressure surge, dependent service instability or failure, system maintenance and upgrade; the method for setting the deactivation mechanism of the dependent service provided by the present invention can be applied to strong and weak dependency management scenarios such as dependent service change or upgrade, risk avoidance and prevention, business adjustment and policy change. The present invention adopts a multi-dimensional governance method for strong and weak dependency governance, which can adapt to the needs of different strong and weak dependency governance scenarios and improve the governance effect of strong and weak dependency governance. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] 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.

[0017] Figure 1 This is one of the flow charts of the strong and weak dependency management method based on chaos engineering provided by the present invention.

[0018] Figure 2 This is one of the flow charts of the method for determining whether a target system link needs to be managed for strong or weak dependencies provided by the present invention.

[0019] Figure 3 This is the second flow chart of the method for determining whether a target system link needs to be managed for strong or weak dependencies provided by the present invention.

[0020] Figure 4 This is the third flow chart of the method for determining whether a target system link needs to be managed for strong or weak dependencies provided by the present invention.

[0021] Figure 5 This is the second flow chart of the strong and weak dependency management method based on chaos engineering provided by the present invention.

[0022] Figure 6 A schematic diagram of the overall process of managing strong and weak system dependencies provided in an embodiment of the present invention.

[0023] Figure 7 A schematic diagram of the structure of a strong and weak dependency management device based on chaos engineering provided in an embodiment of the present invention.

[0024] Figure 8 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] 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.

[0026] Before introducing the solutions of the present invention, the terms involved in the present invention are first explained.

[0027] Strong or weak dependency: After adopting the microservice architecture, system functions are generally not independent and usually rely on other services to complete business logic. For example, if the main service A needs to use the function of service B to complete the business logic, it is called that the main service A depends on service B. When service B is abnormal, it will affect the execution of the business process of the main service A and the availability of the system. This is a "strong dependency", and vice versa is a "weak dependency".

[0028] Dependency verification and marking: Clarify strong and weak dependencies. The existing technical method is to inject system failures into the dependent services by typing commands, and observe whether the main service process is affected, so as to verify and mark the strong and weak dependencies between services.

[0029] Dependency governance: The goal is to ensure the stability of the service by taking specific measures to ensure that the main service process can be completed normally when the dependent service fails.

[0030] Chaos Engineering: Chaos engineering is the work of actively injecting hardware or software failures into application systems, exposing the weak links of distributed architecture, and formulating optimization plans to continuously improve the resilience of distributed architecture.

[0031] The principle of chaos engineering fault injection technology: First, you need to install an agent (with system operation authorization completed) in the target application system. This agent is like a bridge, responsible for information exchange 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 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.

[0032] After determining that there is a strong dependency between services, the existing technology usually adopts the method of converting strong dependencies into weak dependencies for governance. However, the method of directly converting strong dependencies into weak dependencies is too simple and cannot meet the system requirements of different scenarios, resulting in poor results in strong and weak dependency governance.

[0033] In view of this, an embodiment of the present invention provides a method for managing strong and weak dependencies based on chaos engineering, by determining whether a target system link needs to be managed for strong and weak dependencies, the target system link includes a main service and a dependent service, and the main service depends on the dependent service; when it is determined that the target system link needs to be managed for strong and weak dependencies, a preset management method is used to manage the strong and weak dependencies of the target system link, and the preset management method includes at least one of adjusting the link architecture in the target system link, downgrading the degree of dependence on the main service, and setting a deactivation mechanism for the dependent service. This method uses a multi-dimensional management method to manage strong and weak dependencies, which can adapt to the strong and weak dependency management needs of different scenarios, and can also improve the management effect of strong and weak dependency management.

[0034] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0035] Figure 1 This is one of the flow charts of the strong and weak dependency management method based on chaos engineering provided by the present invention. The strong and weak dependency management method based on chaos engineering can be applied to electronic devices, which can be various types of devices with information processing capabilities during implementation. For example, the electronic device can include a personal computer, a laptop, a PDA or a server, etc.; the electronic device can also be a mobile terminal, for example, the mobile terminal can include a mobile phone, a car computer, a tablet computer or a projector, etc. Figure 1 As shown, the method may include the following steps 101 to 102: Step 101: Determine whether a target system link needs to be managed for strong or weak dependencies, wherein the target system link includes a main service and a dependent service, and the main service depends on the dependent service.

[0036] It should be noted that there are many methods to determine whether the target system link needs to be managed for strong or weak dependencies. It can be determined by manual detection, by a preset detection program, or by a chaos engineering system. The present invention does not limit the method for determining whether the target system link needs to be managed for strong or weak dependencies.

[0037] The target system link may be a preset system link or a system link determined through detection, etc. The present invention does not limit the source of the target system link.

[0038] Step 102: When it is determined that the target system link needs to be managed for strong or weak dependencies, a preset management method is used to manage the strong or weak dependencies of the target system link. The preset management method includes at least one of adjusting the link architecture in the target system link, downgrading the degree of dependency on the main service, and setting a deactivation mechanism for the dependent service.

[0039] It should be noted that, when it is determined that the target system link needs to be managed for strong or weak dependencies, a preset management method is used to manage the strong or weak dependencies of the target system link. The management method may include at least one of adjusting the link architecture in the target system link, downgrading the degree of dependency on the main service, and setting a deactivation mechanism for the dependent service. Among them, at least one method may be one method, two methods, or three methods. The present invention does not limit the number and type of preset management methods.

[0040] Among them, adjusting the link architecture in the target system link can be used to indicate converting a strong dependency into a weak dependency, for example, it can include converting a strong dependency in the system link into asynchronous processing or step-by-step processing, etc., the downgrading of the degree of dependence on the main service can be used to indicate reducing the degree of dependence on the main service, etc., and the setting of the deactivation mechanism of the dependent service can be used to indicate setting conditions for deactivating the dependent service in some cases, etc.

[0041] It can be understood that the present invention adopts a multi-dimensional governance method to manage strong and weak dependencies, which can further improve the governance effect of strong and weak dependency management.

[0042] In some embodiments, before step 101, the strong and weak dependency management method based on chaos engineering may also include: determining a system target link.

[0043] It should be noted that there are many ways to determine the target system link that needs strong and weak dependency management, for example, the chaos engineering system can obtain the basic information of each node of the main service A and the dependent service B through the agent program, including the IP of the system module, the service process PID, the network card information, etc., and can also be the information of the system target link sent by other devices. The present invention does not limit the method of determining the system target link.

[0044] It can be understood that determining the system target link can provide basic information for determining whether the target system link needs to be managed for strong or weak dependencies, thereby ensuring smooth determination of whether the target system link needs to be managed for strong or weak dependencies.

[0045] In some embodiments, adjusting the link architecture in the target system link may include: converting a strong dependency in the target system link into a weak dependency by introducing a message queue, or converting a strong dependency caused by a failure or anomaly of a single node in the target system link into a weak dependency by adopting a distributed architecture.

[0046] Exemplarily, there are many ways to convert strongly dependent parts into weak dependencies by adjusting the architecture design. For example, by introducing message queues, the systems can be decoupled, so that the original direct strong dependency becomes asynchronous processing, reducing the real-time requirements, and thus weakening the degree of dependency. The way to introduce message queues can be: Design message queue architecture: Select appropriate message queue products (such as RabbitMQ, Kafka, etc.) according to system requirements. Design the topology of the message queue, including the configuration of components such as producers, consumers, queues, and switches. Transform system links: Change the originally directly called strongly dependent services to asynchronous communication through message queues. On the producer side, encapsulate the request to be sent to the dependent service into a message and send it to the message queue. On the consumer side, listen to the messages in the message queue and execute the corresponding business logic according to the message content. It can be seen that the introduction of message queues can achieve service decoupling: through message queues, asynchronous communication between services can be achieved, direct dependency between services can be reduced, and the scalability and maintainability of the system can be improved. Peak shaving and valley filling: In high concurrency scenarios, message queues can cache excessive requests, balance the system load, and prevent the system from crashing due to overload. Asynchronous processing: Putting tasks that do not require immediate response into the message queue for asynchronous processing can improve the system's response speed and throughput.

[0047] For example, by adopting a distributed architecture, the failure or abnormality of a single node will not cause the entire system to have an absolute strong dependence on certain dependencies.

[0048] It is understandable that by adjusting the architectural design, the strongly dependent parts can be converted into weakly dependent parts, thereby minimizing the strong dependencies.

[0049] In some embodiments, downgrading the degree of dependence on the primary service may include: configuring a downgrade strategy, and configuring a trigger strategy, wherein the trigger strategy is used to trigger the downgrade strategy.

[0050] Exemplarily, there are many ways to implement dependency downgrade switching within a specified time, such as combining the configuration center and the monitoring system. For example: through the configuration center: set the downgrade policy in the configuration center, such as the downgrade behavior when the dependent service is unavailable, and the system can read these configurations in real time to make dynamic adjustments. Or monitoring trigger: through real-time monitoring of the system status, when key indicators are detected to be abnormal, such as the dependent service response time is too long (such as ≥10 seconds), trigger the downgrade operation of the configuration center.

[0051] It is understandable that a downgrade plan for the main service is established and the plan is kept active continuously, so that when an exception / failure occurs, it can ensure that the dependent downgrade switch is performed within the specified time.

[0052] In some embodiments, the setting of the deactivation mechanism of the dependent service may include: triggering deactivation of the dependent service when the indicator to be detected is abnormal.

[0053] Exemplarily, there are multiple judgment logics in the deactivation mechanism of the dependent service, such as obtaining abnormal key indicators through the monitoring system, such as the dependent service response time is too long (such as ≥ 10 seconds), to trigger the graceful offline of the dependency. When a dependency is triggered to be offline, a notification is sent to the relevant system in advance to inform the time and specific arrangements of the upcoming offline. When approaching the offline time, the frequency of use of the dependency is gradually reduced, such as through a traffic control strategy, slowly reducing the amount of requests allocated to it until it is offline and disabled.

[0054] It is understandable that setting a dependency graceful offline deactivation mechanism supports offline deactivation of service B that main service A depends on in abnormal / failure scenarios, ensuring that the business processing of main service A is not affected.

[0055] The strong and weak dependency management method based on chaos engineering provided by the present invention adopts a preset management method to manage the dependencies of the target system links. When an abnormality occurs in the dependent service, it can ensure that the business processing of the main service is not affected, thereby improving the management effect of strong and weak dependency management.

[0056] In some embodiments, whether the target system link needs to be managed for strong or weak dependencies can be determined based on the difference between the actual detection result obtained by the strong or weak dependency detection and the expected detection result.

[0057] Figure 2 This is one of the flow charts of the method for determining whether a target system link needs to be managed for strong or weak dependencies provided by the present invention. Figure 2 As shown, the determination of whether the target system link needs to be managed for strong or weak dependencies may include: Step 201: Determine an expected detection result, where the expected detection result is used to indicate a change state of a target parameter value corresponding to the main service after a preset fault is injected, where the target parameter value includes at least one of the number of services processed per second and a transaction success rate.

[0058] It should be noted that the expected detection results can be set according to the needs. For example, in a microservice architecture, the expected detection results can be determined based on at least one of the value of the number of services processed per second and the transaction success rate. Exemplarily, the expected detection results may include thresholds. For example, after injecting a preset fault, if the transaction success rate and the number of services processed per second TPS both drop to ≤95% of the original value, it is determined that strong and weak dependency management is required. The present invention does not limit the content and method of the expected detection results.

[0059] Step 202: Perform strong and weak dependency detection on the target system link through the chaos engineering system, monitoring system and pressure system to obtain actual detection results.

[0060] It should be noted that the method of obtaining the actual detection result by performing strong and weak dependency detection on the target system link through the chaos engineering system, the monitoring system and the pressure system can be that the current system obtains the actual detection result by connecting with the chaos engineering system, the monitoring system and the pressure system to perform strong and weak dependency detection, or other devices perform strong and weak dependency detection and send the obtained actual detection result to the current system, etc. The present invention does not limit the method of obtaining the actual detection result by performing strong and weak dependency detection on the target system link through the chaos engineering system, the monitoring system and the pressure system.

[0061] Exemplarily, performing strong and weak dependency detection on the target system link through a chaos engineering system, a monitoring system, and a pressure system to obtain actual detection results may include a preparation step and an implementation step.

[0062] The preparation steps include creating chaos engineering failure scenarios, deploying a preset system monitoring system to observe the business processing of the main service, and pre-stressing scenarios to simulate the business processing of the production environment.

[0063] Among them, a chaos engineering fault scenario is created. The creation process may include: ① deploying a chaos engineering system in server I, and the chaos engineering system receives parameters such as "experiment name, experiment duration, and experiment description"; ② obtaining the IP of the target experimental machine; ③ the chaos engineering system receives fault event (event type: kill process, suspend process, network packet loss) parameters, and receives various parameter configurations (experiment start time, end time, event running time, network card information, event type specific configuration parameters, etc.); ④ saving the experimental case and waiting for execution. It is understandable that the prior art simulates fault events, requires manual login to the service to type in computer instructions, and requires prior authorization for operation. This operation has the disadvantages of being prone to errors and low efficiency. The present invention adopts a method for automatically creating chaos engineering fault scenarios to improve the efficiency of strong and weak dependency detection.

[0064] The preset system monitoring system is used to observe the business processing of the main service. The monitoring system (such as application performance management APM, ZABBIX, Prometheus, Grafana, etc.) can be deployed on Server II to receive indicators related to business processing of each application node that various experiments focus on (TPS: number of business transactions per second, transaction success rate).

[0065] Prepare stress scenarios to simulate business processing in the production environment. You can deploy stress testing tools in Server III, such as LoadRunner, JMeter, APTS and other testing tools, to apply load pressure to the front-end system of the main service system. The stress testing tool simulates concurrent access to the front-end system and simulates multiple users making requests to the main service back-end system at the same time in different access actions (batch registration or login, query, modification, etc.) in a certain ratio (refer to the actual ratio of the production environment).

[0066] The implementation steps include executing chaos engineering failure scenarios under background stress, observing and recording key system metrics and data, and concluding the chaos engineering experiment.

[0067] Among them, the chaos engineering failure scenario is executed under background pressure. After the experiment starts, the stress test tool receives the stress trigger instruction and executes the preset stress scenario to stress the target server. Then, it observes and records key system indicators and data, and finally ends the chaos engineering experiment.

[0068] Step 203: Determine whether the target system link needs to be managed for strong or weak dependencies based on the target comparison result, wherein the target comparison result is obtained by comparing the actual detection result with the expected detection result.

[0069] It should be noted that after obtaining the actual detection result, there are many ways to determine whether the target system link needs strong or weak dependency management based on the actual detection result and the expected detection result, such as checking various data, etc. The present invention does not limit the method of determining whether the target system link needs strong or weak dependency management based on the target comparison result.

[0070] It is understandable that the existing methods for determining whether there are strong and weak dependencies in the target system link are inefficient and lack clear and complete verification steps. For example, the prior art often does not have a standard strong and weak dependency detection execution process, and the process steps are confusing or lack necessary steps, resulting in unsatisfactory strong and weak dependency governance results. The present invention sets the expected detection results, performs strong and weak dependency detection on the target system link through the chaos engineering system, the monitoring system and the pressure system, obtains the actual detection results, and then compares the actual detection results with the expected detection results to determine whether strong and weak dependency governance is needed. In the fault simulation process of judging whether the system needs strong and weak dependency governance, there is no need for multi-professional cooperation, no need to manually input any computer instructions, no need to manually run the corresponding program script, no need to change the program code and other operations. Exemplarily, the entire implementation process only needs to select the target node and the fault type to be injected in the chaos engineering system, and then start the chaos engineering experiment with one click, so as to realize various fault injections and determine whether the system needs strong and weak dependency governance, thereby improving the efficiency of the strong and weak dependency detection method.

[0071] In some embodiments, the expected detection results may include two types, one is that after the fault injection, the front-end transaction success rate and TPS (number of transactions processed per second) of the main service are not affected, and the other is that the front-end transaction success rate and TPS of the main service decrease compared to before the fault injection, and recover to the level before the fault injection within a specified time △T (such as: 1 minute). The two types are introduced below.

[0072] Figure 3 This is a second flow chart of a method for determining whether a target system link needs to be managed for strong or weak dependencies provided by the present invention, the method comprising: Step 301: Determine an expected detection result, where the expected detection result includes: a change value of a target parameter value corresponding to the main service is less than or equal to a preset threshold.

[0073] It should be noted that the strong and weak dependency detection experiment requires the use of a chaos engineering system to inject faults into service B, on which the main service depends. The expected result is that after the fault injection, the front-end transaction success rate and TPS (number of transactions processed per second) of the main service will not be affected.

[0074] Step 302: Obtain a first value, which is a target parameter value corresponding to the main service obtained by the monitoring system when the duration of load pressure applied to the target server corresponding to the target system link by the pressure system reaches a preset first duration.

[0075] Step 303: Obtain a second value, where the second value is the target parameter value corresponding to the main service obtained by the monitoring system when a preset fault is injected into the target application node in the target system link through the chaos engineering system after the duration of the load pressure applied to the target server corresponding to the target system link through the pressure system reaches a preset second duration.

[0076] Step 304: Obtain a parameter difference between the first value and the second value, where the parameter difference is the actual detection result.

[0077] It should be noted that in step 302-step 304, the chaos engineering fault scenario is executed under background pressure. After the experiment starts, the stress test tool receives the stress trigger instruction, executes the preset stress scenario to stress the target server, and runs stably for 5 minutes. At this time, the monitoring system obtains the data of the main service transaction success rate and TPS, that is, obtains the first value. After the preset fault is injected, the monitoring system obtains the data of the main service transaction success rate and TPS, that is, obtains the second value. The parameter difference between the first value and the second value is obtained, and the parameter difference is the actual detection result.

[0078] Step 305: Determine whether the target system link needs strong or weak dependency management based on the target comparison result corresponding to the parameter difference and the expected detection result. If the target comparison result indicates that the parameter difference is less than or equal to the preset threshold, determine that the target system link does not need strong or weak dependency management.

[0079] It should be noted that, based on the target comparison result corresponding to the parameter difference and the expected detection result, it is determined whether the target system link needs to be managed for strong or weak dependencies. Exemplarily, if the target comparison result indicates that the parameter difference is less than or equal to the preset threshold, it is determined that the target system link does not need to be managed for strong or weak dependencies. It is understandable that if the target comparison result indicates that the parameter difference is greater than the preset threshold, it is determined that the target system link needs to be managed for strong or weak dependencies.

[0080] At the same time, the above technical solution systematically and completely describes the process of strong and weak dependency detection, and provides a detailed description of the experimental sequence, experimental data, and experimental result judgment in a qualitative and quantitative manner. It is feasible, repeatable, and reproducible, and can effectively guide technical personnel to carry out related work.

[0081] In some embodiments, the expected detection result may include strong and weak dependency detection based on two types of expected detection results after fault injection.

[0082] Figure 4This is a flowchart of a method for determining whether a target system link needs to be managed for strong or weak dependencies provided by the present invention. The method includes: Step 401: Determine the expected detection result, which includes: the change value of the target parameter value corresponding to the main service is less than or equal to the preset threshold, and the change value of the target parameter value corresponding to the main service is greater than the preset threshold, and within the preset third time period, the target parameter value corresponding to the main service is restored to the parameter value before the preset fault is injected.

[0083] It should be noted that the expected results of the strong and weak dependency experiment are determined. The experiment needs to inject faults into service B, which the main service depends on, through the chaos engineering system. The expected results are: after the fault injection, the front-end transaction success rate and TPS (number of transactions processed per second) of the main service are not affected, or the front-end transaction success rate and TPS of the main service are lower than before the fault injection, and recover to the level before the fault injection within the specified time △T (such as: 1 minute).

[0084] Step 402: Obtain a first value and a first time. The first value is the target parameter value corresponding to the main service obtained by the monitoring system when the duration of load pressure applied to the target server corresponding to the target system link by the pressure system reaches a preset first duration. The first time is the time for injecting a preset fault.

[0085] Step 403: Obtain a second value, where the second value is a target parameter value corresponding to the main service obtained by the monitoring system when a preset fault is injected into a target application node in the target system link through the chaos engineering system after the duration of load pressure applied to the target server corresponding to the target system link through the pressure system reaches a preset second duration.

[0086] Step 404: Obtain a second time, where the second time is the time when a change value of the target parameter value corresponding to the main service obtained by the monitoring system is greater than a preset threshold and then recovers to the parameter value before the preset fault is injected within a preset second time period after the preset fault is injected into the target application node in the target system link through the chaos engineering system.

[0087] Step 405: Obtain a parameter difference between the first value and the second value, and an interval duration between the first time and the second time, wherein the parameter difference and the interval duration are the actual detection result.

[0088] It should be noted that the chaos engineering fault scenario is executed under background pressure. After the experiment starts, the stress test tool receives the stress trigger instruction, executes the preset stress scenario to stress the target server, and runs stably for a certain period of time, such as 5 minutes. At this time, the monitoring system obtains the data of the main service transaction success rate and TPS to obtain the first value. After that, the chaos engineering system triggers the fault injection instruction, and executes the chaos engineering experiment case in the main service backend system application cluster. The underlying chaos tool and the Agent agent pre-installed in each application node execute the chaos engineering experiment event on the target application node and inject faults. During this period, the stress scenario is uninterrupted, and the stress test platform continues to send access requests to the main service front-end system and records the fault injection time T1. After the preset fault is injected, the monitoring system obtains the data of the main service transaction success rate and TPS, that is, the second value is obtained.

[0089] After the experimental fault is injected, the system is run again for a certain period of time, for example, 10 minutes. The monitoring system obtains the transaction success rate and TPS data of the main service during this period to obtain the second value. If the monitoring system detects that the transaction success rate and TPS have decreased during this period and return to the value level before the fault injection, the time data when they return to the normal state value is obtained and recorded as T2.

[0090] Step 406: Determine whether the target system link needs to be managed for strong or weak dependencies based on the target comparison result corresponding to the parameter difference, the interval duration, and the expected detection result. If the target comparison result indicates that the parameter difference is less than or equal to the preset threshold, it is determined that the target system link does not need to be managed for strong or weak dependencies; if the target comparison result indicates that the parameter difference is greater than the preset threshold, and the interval duration is less than or equal to the preset third duration, it is determined that the target system link does not need to be managed for strong or weak dependencies; if the target comparison result indicates that the parameter difference is greater than the preset threshold, and the interval duration is not obtained, it is determined that the target system link needs to be managed for strong or weak dependencies.

[0091] It should be noted that the chaos engineering system obtains experimental data records of different chaos engineering fault events from the monitoring system, and calculates whether the experimental results are consistent with the expected results. The judgment of "the transaction success rate and TPS of the main service front end have decreased compared with before the fault injection, and recovered to the level before the fault injection within the specified time △T" requires the application of a computer program to calculate the difference between the experimental records T1 and T2, that is, only when T2-T1≤△T, and return the judgment result, indicating that the experimental results are consistent with the expected results, indicating that there is no need for strong and weak dependency management. Otherwise, after data calculation and judgment, if any phenomenon or result inconsistent with the expected result occurs, the system needs to be managed for strong and weak dependencies.

[0092] It can be understood that the above technical solution systematically and completely describes the process of strong and weak dependency detection, and provides a detailed description of the experimental sequence, experimental data, and experimental result determination in a qualitative and quantitative manner. It is feasible, repeatable, and reproducible, and can effectively guide technical personnel to carry out related work, thus improving the convenience of strong and weak dependency management.

[0093] In some embodiments, the method of detecting and managing strong and weak dependencies on target system links can be repeatedly performed, that is, regression verification is performed.

[0094] Figure 5 This is the second flow chart of the strong and weak dependency management method based on chaos engineering provided by the present invention. Figure 5 As shown, the strong and weak dependency management method based on chaos engineering may include: Step 501: Determine whether a target system link needs to be managed for strong or weak dependencies, wherein the target system link includes a main service and a dependent service, and the main service depends on the dependent service.

[0095] It should be noted that the description of step 501 can refer to the description of step 101 in the above embodiment, which will not be repeated here.

[0096] Step 502: When it is determined that the target system link needs to be managed for strong or weak dependencies, a preset management method is used to manage the strong or weak dependencies of the target system link. The preset management method includes at least one of adjusting the link architecture in the target system link, downgrading the degree of dependency on the main service, and setting a deactivation mechanism for the dependent service.

[0097] It should be noted that the description of step 502 may refer to the description of step 102 in the aforementioned embodiment, and will not be repeated here.

[0098] Step 503: Determine whether the managed target system link needs strong or weak dependency management.

[0099] It should be noted that the method for determining whether the target system link after management needs strong or weak dependency management is the same as the method for determining whether the target system link needs strong or weak dependency management in step 501, and will not be repeated here.

[0100] Step 504: when it is determined that the managed target system link needs to be managed for strong or weak dependencies, the preset management method is used to manage the strong or weak dependencies of the target system link.

[0101] It should be noted that the method of using the preset management method to manage the strong and weak dependencies of the target system link is consistent with the method of using the preset management method to manage the strong and weak dependencies of the target system link in step 502, which will not be repeated here.

[0102] Exemplarily, the present invention can adopt a regression verification method. After strong and weak dependency management, the steps of strong and weak dependency detection and strong and weak dependency management are executed again until the experimental results meet the expected results, the process is ended, and the strong and weak dependency management work is completed.

[0103] It can be understood that the present invention provides a method and process for applying a chaos engineering system to detect and manage strong and weak dependencies on target system links, including a specific execution process, scenario design (configuration requirements for monitoring systems and pressure scenarios), and a method for determining expected results. It fully describes the process of strong and weak dependency management, and provides a detailed qualitative and quantitative description of the experimental sequence, experimental data, and experimental result determination. It is feasible, repeatable, and reproducible, and can effectively guide technical personnel to perform related work.

[0104] The following describes an exemplary application of an embodiment of the present invention in a practical application scenario.

[0105] Figure 6 The overall flow diagram of the system strong and weak dependency management provided by the embodiment of the present invention is as follows. Figure 6 As shown, the method includes the following steps 601 to 611: Step 601: Determine the system target links that need strong and weak dependency management.

[0106] It should be noted that to determine the target system links that need strong and weak dependency management, the chaos engineering system obtains the basic information of each node of the main service A and the dependent service B through the agent program, including the IP of the system module, the PID of the service process, the network card information, etc.

[0107] Step 602: Determine the expected results of the experiment.

[0108] It should be noted that the experiment needs to use the chaos engineering system to inject faults into service B, which the main service depends on. The expected results are: after the fault injection, the front-end transaction success rate and TPS (number of transactions processed per second) of the main service are not affected, or the front-end transaction success rate and TPS of the main service are lower than before the fault injection, and recover to the level before the fault injection within the specified time △T (such as: 1 minute).

[0109] Step 603: Create a chaos engineering failure scenario.

[0110] It should be noted that the creation process includes: ① deploying the chaos engineering system in server I, and the chaos engineering system receives parameters such as "experiment name, experiment duration, experiment description"; ② obtaining the IP of the target experimental machine; ③ the chaos engineering system receives fault event (event type: kill process, suspend process, network packet loss) parameters, and receives various parameter configurations (experiment start time, end time, event running time, network card information, event type specific configuration parameters, etc.); ④ saving the experimental case and waiting for execution.

[0111] It is understandable that the existing technology simulates fault events, which requires manual login to the service to type in computer instructions, and requires prior authorization of operations, which has the disadvantages of being prone to errors and low efficiency. The present invention uses a chaos engineering system to implement an innovative way of fault simulation in the process of strong and weak dependency management, that is, after determining the target application node, the preset monitoring system, the pressure scenario and the indicator judgment basis, the chaos engineering system initiates a chaos engineering experiment, executes the corresponding experimental events at the target node, injects fault types such as service stop, process kill, and network card crash, simulates the corresponding fault scenario, and then performs system strong and weak dependency management.

[0112] Step 604: Preset the system monitoring system to observe the business processing of the main service. Preset the stress scenario to simulate the business processing of the production environment.

[0113] For example, a monitoring system (such as APM, ZABBIX, Prometheus, Grafana, etc.) is deployed in Server II to receive indicators related to business processing of each application node that are of interest to various experiments (TPS: number of businesses processed per second, transaction success rate).

[0114] Exemplarily, stress testing tools such as LoadRunner, JMeter, APTS and other testing tools are deployed in Server III to apply load pressure to the front-end system of the main service system. The stress testing tools simulate concurrent access to the front-end system and simulate multiple users simultaneously making requests to the main service back-end system in a certain ratio (refer to the actual ratio of the production environment) with different access actions (batch registration or login, query, modification, etc.).

[0115] Step 605: Execute the chaos engineering failure scenario under background pressure.

[0116] For example, after the experiment starts, the stress test tool receives the stress trigger instruction, executes the preset stress scenario to stress the target server, and runs stably for 5 minutes. At this time, the monitoring system obtains the transaction success rate and TPS data of the main service. After that, the chaos engineering system triggers the fault injection instruction, executes the chaos engineering experiment case in the main service backend system application cluster, and the underlying chaos tool and the Agent agent pre-installed in each application node execute the chaos engineering experiment event on the target application node and inject faults. During this period, the stress scenario is uninterrupted, and the stress test platform continues to send access requests to the main service front-end system and records the fault injection time T1.

[0117] Step 606: Observe and record key system indicators and data.

[0118] For example, after the experimental fault is injected, the system runs again for 10 minutes, and the monitoring system obtains the transaction success rate and TPS data of the main service during this period. If the monitoring system detects that the transaction success rate and TPS have decreased during this period and return to the value level before the fault injection, the time data when they return to the normal state value is obtained, which is recorded as T2.

[0119] Step 607: End the chaos engineering experiment.

[0120] For example, the chaos engineering system triggers a command to release the fault injection (the process suspension and network packet loss fault scenarios will automatically release the fault injection and restore the application node service after stopping the chaos engineering experiment case. If the fault scenario is "killing the process", the corresponding business startup script needs to be executed to restore the application node service).

[0121] Step 608: The chaos engineering system obtains experimental data records of different chaos engineering failure events from the monitoring system, and calculates whether the experimental results are consistent with the expected results.

[0122] For example, the judgment of "the transaction success rate and TPS of the main service front end have decreased compared with before the fault injection, and recovered to the level before the fault injection within the specified time △T" requires the application of a computer program to calculate the difference between the experimental records T1 and T2, that is, only when T2-T1≤△T, and return the judgment result, indicating that the experimental result meets the expected result, indicating that there is no need to perform strong and weak dependency management. Otherwise, after data calculation and judgment, if any phenomenon or result inconsistent with step 602 appears, the system needs to be managed for strong and weak dependencies.

[0123] Step 609: Strong and weak dependency management.

[0124] For example, a. adjust the architecture design to convert the strongly dependent parts into weak dependencies to minimize strong dependencies; b. establish a downgrade plan for the main service, and keep the plan active continuously to ensure that the dependency downgrade switch can be performed within the specified time when an exception / failure occurs; c. set up a dependency graceful offline deactivation mechanism to support offline deactivation of service B that the main service A depends on in exception / failure scenarios to ensure that the business processing of the main service A is not affected.

[0125] Step 610: Regression verification. After strong and weak dependency management is performed, steps 605 to 608 are performed again until the experimental results meet the expected results in step 602, and the process ends, completing the strong and weak dependency management work.

[0126] The advantages of the strong and weak dependency governance method based on chaos engineering provided by the present invention include: 1. The strong and weak dependency governance is carried out by adopting a multi-dimensional governance method, which can adapt to the strong and weak dependency governance requirements of different scenarios and improve the governance effect of strong and weak dependency governance. 2. The method and process of applying the chaos engineering system to the strong and weak dependency governance of the target system link: the experiment is initiated by the chaos engineering system, and through the chaos tool and the probe pre-installed on each server node, one-click simulation of service stop, process killing, network card downtime and other faults are realized on the target server node, as well as the corresponding execution process, scenario design (configuration requirements for the monitoring system and pressure scenario), and expected result judgment method. The process of strong and weak dependency governance is fully described, and the sequence of each experiment, experimental data, and experimental result judgment are described in detail qualitatively and quantitatively. It has feasibility, repeatability, and replicability, and can effectively guide technical personnel to carry out related work. 3. In the fault simulation process of judging whether the system needs strong and weak dependency governance, there is no need for multi-professional cooperation, no need to manually input any computer instructions, no need to manually run the corresponding program script, no need to change the program code and other operations. The entire implementation process only requires selecting the target node and the type of fault to be injected in the chaos engineering system, and then starting the chaos engineering experiment with one click to inject various faults and determine whether the system needs strong or weak dependency management. 4. An innovative way to use the chaos engineering system to implement fault simulation in the process of strong or weak dependency management, that is, after determining the target application node, preset monitoring system, stress scenario and indicator judgment basis, the chaos engineering system initiates the chaos engineering experiment and executes the corresponding experimental events at the target node to inject fault types such as service suspension, process killing, and network card failure, simulate the corresponding fault scenarios, and then perform system strong or weak dependency management.

[0127] Based on the foregoing embodiments, an embodiment of the present invention provides a strong and weak dependency management device based on chaos engineering. The modules included in the device and the units included in each module can be implemented by a processor; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0128] The strong and weak dependency management device based on chaos engineering provided by the present invention is described below. The strong and weak dependency management device based on chaos engineering described below and the strong and weak dependency management method based on chaos engineering described above can be referenced to each other.

[0129] Figure 7 The schematic diagram of the structure of the strong and weak dependency management device based on chaos engineering provided by the embodiment of the present invention. Figure 7 As shown, the device 700 includes a governance judgment module 701 and a governance implementation module 702, wherein: The governance judgment module 701 is used to determine whether the target system link needs to be governed by strong or weak dependencies, the target system link includes a main service and a dependent service, and the main service depends on the dependent service; The governance implementation module 702 is used to adopt a preset governance method to perform strong or weak dependency management on the target system link when it is determined that the target system link needs to be managed. The preset governance method includes at least one of adjusting the link architecture in the target system link, downgrading the degree of dependence on the main service, and setting a deactivation mechanism for the dependent service.

[0130] In some embodiments, the governance implementation module 702 includes an architecture adjustment unit, a dependency downgrading unit and a dependency deactivation unit, wherein the architecture adjustment unit is used to: convert the strong dependency in the target system link into a weak dependency by introducing a message queue, or, by adopting a distributed architecture, convert the strong dependency caused by the failure or abnormality of a single node in the target system link into a weak dependency; the dependency downgrading unit is used to: configure a downgrade strategy, and, configure a trigger strategy, the trigger strategy is used to trigger the downgrade strategy; the dependency deactivation unit is used to trigger the deactivation of the dependency service when the indicator to be detected is abnormal.

[0131] In some embodiments, the governance judgment module 701 includes an expectation determination unit, a detection implementation unit and a result determination unit, wherein:

[0132] The expected determination unit is used to determine an expected detection result, where the expected detection result is used to indicate a change state of a target parameter value corresponding to the primary service after a preset fault is injected, where the target parameter value includes at least one of a number of services processed per second and a transaction success rate; The detection implementation unit is used to perform strong and weak dependency detection on the target system link through a chaos engineering system, a monitoring system, and a pressure system to obtain an actual detection result; The result determination unit is used to determine whether the target system link needs to be managed for strong or weak dependencies according to the target comparison result, and the target comparison result is obtained by comparing the actual detection result with the expected detection result.

[0133] In some embodiments, the expectation determination unit is specifically used to: determine that the expected detection result includes: the change value of the target parameter value corresponding to the main service is less than or equal to a preset threshold value; the detection implementation unit is specifically used to: obtain a first value, which is the target parameter value corresponding to the main service obtained by the monitoring system when the duration of the load pressure applied to the target server corresponding to the target system link by the pressure system reaches a preset first duration; obtain a second value, which is the target parameter value corresponding to the main service obtained by the monitoring system when a preset fault is injected into the target application node in the target system link by the chaos engineering system after the duration of the load pressure applied to the target server corresponding to the target system link by the pressure system reaches a preset second duration; obtain a parameter difference between the first value and the second value, and the parameter difference is the actual detection result; the result determination unit is specifically used to: if the target comparison result indicates that the parameter difference is less than or equal to the preset threshold value, determine that the target system link does not need to be subject to strong or weak dependency management.

[0134] In some embodiments, the expected determination unit is also specifically used to: determine that the expected detection result also includes: the change value of the corresponding target parameter value of the main service is greater than a preset threshold, and the target parameter value corresponding to the main service is restored to the parameter value before the preset fault is injected within a preset third time period; the detection implementation unit is also specifically used to: obtain a first time, the first time is the time of injecting the preset fault; obtain a second time, the second time is the time when the change value of the target parameter value corresponding to the main service obtained by the monitoring system is greater than the preset threshold and then restored to the parameter value before the preset fault is injected within the preset second time period after the preset fault is injected into the target application node in the target system link through the chaos engineering system; obtain the interval duration between the first time and the second time, the interval duration is the actual detection result; the result determination unit is also specifically used to: if the target comparison result indicates that the parameter difference is greater than the preset threshold, and the interval duration is less than or equal to the preset third duration, determine that the target system link does not need to perform strong and weak dependency management; if the target comparison result indicates that the parameter difference is greater than the preset threshold, and the interval duration is not obtained, determine that the target system link needs to perform strong and weak dependency management.

[0135] In some embodiments, the device also includes a regression verification module, which is used to: determine whether the target system link after management needs to be managed with strong or weak dependencies; if it is determined that the target system link after management needs to be managed with strong or weak dependencies, use the preset management method to perform strong or weak dependency management on the target system link.

[0136] In the embodiment of the present invention, by adopting a multi-dimensional governance method to perform strong and weak dependency governance, it can adapt to the strong and weak dependency governance needs of different scenarios and improve the governance effect of strong and weak dependency governance.

[0137] Figure 8 is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as Figure 8As shown, the electronic device may include: a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802 and the memory 803 communicate with each other through the communication bus 804. The processor 801 may call the logic instructions in the memory 803 to execute a strong and weak dependency governance method based on chaos engineering, the method comprising: determining whether a target system link needs to be governed by strong and weak dependencies, the target system link comprising a main service and a dependent service, the main service depending on the dependent service; in the case of determining that the target system link needs to be governed by strong and weak dependencies, a preset governance method is used to govern the target system link by strong and weak dependencies, the preset governance method comprising at least one of adjusting the link architecture in the target system link, downgrading the degree of dependence on the main service and setting a deactivation mechanism for the dependent service.

[0138] In addition, the logic instructions in the above-mentioned memory 803 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 several instructions for enabling 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: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.

[0139] On the other hand, the present invention also provides a computer program product, which includes a computer program, and 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 strong and weak dependency management method based on chaos engineering provided by the above-mentioned methods, and the method includes: determining whether the target system link needs to be managed with strong and weak dependencies, and the target system link includes a main service and a dependent service, and the main service depends on the dependent service; when it is determined that the target system link needs to be managed with strong and weak dependencies, a preset management method is used to manage the strong and weak dependencies of the target system link, and the preset management method includes at least one method of adjusting the link architecture in the target system link, downgrading the degree of dependence on the main service, and setting a deactivation mechanism for the dependent service.

[0140] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0141] 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 strong and weak dependency management methods based on chaos engineering provided by the above-mentioned methods, the method comprising: determining whether a target system link needs to be managed for strong and weak dependencies, the target system link comprising a main service and a dependent service, the main service depending on the dependent service; in the case of determining that the target system link needs to be managed for strong and weak dependencies, a preset management method is used to perform strong and weak dependency management on the target system link, the preset management method comprising at least one of adjusting the link architecture in the target system link, downgrading the degree of dependence on the main service, and setting a deactivation mechanism for the dependent service.

[0142] The above-mentioned computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, 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 portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0143] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0144] The program code embodied on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.

[0145] Computer program code for performing the operations of the present specification may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0146] 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.

[0147] 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.

[0148] 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 strong and weak dependency management method based on chaos engineering, characterized in that: include: Determine whether a target system link needs to be managed for strong or weak dependencies, the target system link includes a main service and a dependent service, the main service depends on the dependent service; When it is determined that the target system link needs to be managed for strong or weak dependencies, a preset management method is used to manage the strong or weak dependencies of the target system link. The preset management method includes at least one of adjusting the link architecture in the target system link, downgrading the degree of dependency on the main service, and setting a deactivation mechanism for the dependent service.

2. The method for managing strong and weak dependencies based on chaos engineering according to claim 1 is characterized in that: The adjusting the link architecture in the target system link includes: By introducing a message queue, a strong dependency in the target system link is converted into a weak dependency, or, by adopting a distributed architecture, a strong dependency caused by a failure or anomaly of a single node in the target system link is converted into a weak dependency; Degrading the degree of dependence on the primary service includes: configuring a degradation strategy, and configuring a trigger strategy, wherein the trigger strategy is used to trigger the degradation strategy; The setting of the deactivation mechanism of the dependent service includes: triggering deactivation of the dependent service when the indicator to be detected is abnormal.

3. The method for managing strong and weak dependencies based on chaos engineering according to claim 1 is characterized in that: The step of determining whether the target system link needs to be managed for strong or weak dependencies includes: Determine an expected detection result, where the expected detection result is used to indicate a change state of a target parameter value corresponding to the primary service after a preset fault is injected, where the target parameter value includes at least one of a number of services processed per second and a transaction success rate; Perform strong and weak dependency detection on the target system link through the chaos engineering system, monitoring system and pressure system to obtain actual detection results; According to the target comparison result, it is determined whether the target system link needs to be managed for strong or weak dependencies, and the target comparison result is obtained by comparing the actual detection result with the expected detection result.

4. The method for managing strong and weak dependencies based on chaos engineering according to claim 3 is characterized in that: The expected test results include: The change value of the target parameter value corresponding to the main service is less than or equal to the preset threshold; The target system link is tested for strong and weak dependencies through the chaos engineering system, the monitoring system, and the pressure system to obtain actual test results, including: Obtaining a first value, where the first value is a target parameter value corresponding to the main service obtained by the monitoring system when the duration of applying load pressure to the target server corresponding to the target system link by the pressure system reaches a preset first duration; Obtaining a second value, where the second value is a target parameter value corresponding to the main service obtained by the monitoring system when a preset fault is injected into a target application node in the target system link by the chaos engineering system after the duration of applying load pressure to the target server corresponding to the target system link by the pressure system reaches a preset second duration; Obtaining a parameter difference between the first value and the second value, wherein the parameter difference is the actual detection result; Determining whether the target system link needs to be managed for strong or weak dependencies according to the target comparison result includes: If the target comparison result indicates that the parameter difference is less than or equal to the preset threshold, it is determined that the target system link does not need to be managed for strong or weak dependencies.

5. The strong and weak dependency management method based on chaos engineering according to claim 4 is characterized in that: The expected detection results also include: The change value of the target parameter value corresponding to the main service is greater than a preset threshold, and within a preset third time period, the target parameter value corresponding to the main service is restored to the parameter value before the preset fault is injected; The method of performing strong and weak dependency detection on the target system link through the chaos engineering system, the monitoring system and the pressure system to obtain actual detection results also includes: Acquire a first time, where the first time is the time of injecting the preset fault; Obtain a second time, where the second time is the time when a change value of the target parameter value corresponding to the main service obtained by the monitoring system is greater than a preset threshold and then recovers to the parameter value before the preset fault is injected within a preset second time period after the preset fault is injected into the target application node in the target system link by the chaos engineering system; Obtaining the interval between the first time and the second time, where the interval is the actual detection result; The determining, according to the target comparison result, whether the target system link needs to be managed for strong or weak dependencies also includes: If the target comparison result indicates that the parameter difference is greater than the preset threshold, and the interval duration is less than or equal to the preset third duration, it is determined that the target system link does not need to be managed for strong or weak dependencies.

6. The method for managing strong and weak dependencies based on chaos engineering according to claim 1 is characterized in that: The method further comprises: Determine whether the target system link after governance needs strong or weak dependency governance; In the case where it is determined that the target system link after the management needs to be managed for strong or weak dependencies, the preset management method is used to manage the strong or weak dependencies of the target system link.

7. A strong and weak dependency management device based on chaos engineering, characterized in that: include: A governance judgment module, used to determine whether a target system link needs to be governed by strong or weak dependencies, wherein the target system link includes a main service and a dependent service, and the main service depends on the dependent service; A governance implementation module is used to adopt a preset governance method to perform strong and weak dependency management on the target system link when it is determined that the target system link needs to be managed. The preset governance method includes at least one of adjusting the link architecture in the target system link, downgrading the degree of dependence on the main service, and setting a deactivation mechanism for the dependent service.

8. 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 computer program, the strong and weak dependency management method based on chaos engineering as described in any one of claims 1 to 6 is implemented.

9. 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 strong and weak dependency management method based on chaos engineering as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the strong and weak dependency management method based on chaos engineering as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Extensible chaos engineering experiment architecture compatible with cloud native and traditional environments

    CN113687918A

  • Fault drilling method and device based on chaos engineering, terminal equipment and medium

    CN114113984A

  • Dependence degree determination method and device

    CN115705190A

  • Network anomaly simulation test method and device, electronic equipment and storage medium

    CN115766469A

  • Chaos engineering task arrangement method and chaos experiment implementation method

    CN116974838A

Cited By

  • Dependency verification method and apparatus, device, storage medium, and product

    WO2026091155A1