Distributed software service assurance method based on swarm intelligence

By modeling the guarantee decision-making system of distributed software services as a reinforcement learning agent, a group intelligent decision-making mechanism is established to solve the global decision-making problem in the distributed software service architecture, achieve global optimal decision-making and service credibility guarantee, and avoid prevent the occurrence of cascading failures.

CN114900420BActive Publication Date: 2024-10-18BEIJING UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210311620.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2024-10-18
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

When a distributed software service architecture faces interference, due to fragmented safeguards and independent decision-making systems, it is easy to ignore the overall interests and fail to achieve global optimal decisions, making service continuation and business maintenance difficult, and prone to cascading failures.

Method used

The guarantee decision-making system of distributed software services is modeled as a reinforcement learning agent. Through interactive experience learning between the agent and the overall situation environment, a mutually independent and collaborative group intelligent decision-making mechanism is established, and the core ideas of reinforcement learning are integrated to improve performance.

Benefits of technology

It realizes global optimal decision-making while maintaining distributed independent decision-making, improves service reliability guarantee, effectively solves the problem of service continuation and business maintenance under interference conditions, and provides an intelligent elastic guarantee mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114900420B_ABST
    Figure CN114900420B_ABST
Patent Text Reader

Abstract

The present invention provides a distributed software service assurance method based on swarm intelligence. The present invention clearly divides software services, service adaptation and reinforcement learning decision-making into three main components, so as to achieve complete decoupling of service assurance decisions from the business logic of distributed software services. Among them, in the distributed software service system, each software service, while maintaining its original functional modules and assurance modules, adds adaptation modules such as state monitoring and dynamic configuration, and provides interfaces to interact with the reinforcement learning decision-making modules to achieve situational awareness of software services and dynamic control of assurance behaviors; the reinforcement learning decision-making component, through continuous interactive learning between the intelligent body and environmental factors such as system operation and maintenance effects and user expectation satisfaction, integrates the core idea of ​​reinforcement learning of "improving performance through experience" into the service assurance activities under the distributed software service architecture, and realizes a swarm intelligent decision-making mechanism that is both independent and collaborative.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of distributed software services. Background Art

[0002] Distributed software services split the original independent software system into multiple independently running small services, and interact and collaborate through lightweight communication mechanisms to realize the business value of users. Compared with traditional monolithic systems, distributed software service architecture has many advantages such as deployment independence, easy scalability, and decentralization. The independent and collaborative interactive relationship between distributed software services in the distributed software service architecture is both its advantage and also contains obvious service credibility risks: on the one hand, independence means independent operation and maintenance and decision-making mode, which is easy to ignore the overall interests due to excessive pursuit of local interests, and even the distributed software services will make contradictory service guarantee efforts; on the other hand, the complex business interaction relationship between distributed software services often magnifies "local failures" into "cascading failures", resulting in an "avalanche effect", and it is impossible to solve the problem because the crux of the problem cannot be sorted out. The core of solving this type of service guarantee problem is to establish an effective distributed software service system group decision-making mechanism, giving each distributed software service the ability to perceive the global situation and the decision-making ability for the entire system.

[0003] Among the numerous artificial intelligence methods, reinforcement learning methods, as an important method for solving sequential decision-making problems, can learn the best strategy through interaction with the environment without prior knowledge. In addition, the distributed software service system has both independent local decision-making and group distributed collaborative decision-making, which is naturally compatible with the multi-agent reinforcement learning method, and provides a new idea for the study of the establishment of group intelligent decision-making mechanism under the distributed software service framework. The present invention proposes a distributed software service guarantee mechanism based on group intelligence, which provides a mechanism and method for solving the guarantee problems of service continuation, business maintenance and smooth transition of interference of distributed software service systems under interference.

[0004] Most of the existing distributed software service assurance research focuses on the local situation of each software service and aims to ensure the normal operation of the service. It is unable to take a comprehensive view of the overall situation and consider the expected assurance of services from the user's perspective. How to establish a service credibility assurance system for global decision-making without breaking the original distributed independence framework of distributed software services is one of the key issues that the distributed software service architecture needs to solve. Summary of the invention

[0005] The distributed software service architecture is a new software architecture based on distribution and autonomy. Each distributed software service can configure and deploy its own independent safeguards. From the perspective of business construction, the distributed and autonomous architecture has its advantages, but when encountering interference and requiring credibility assurance, the independent safeguards and independent decision-making systems can easily ignore the global interests due to excessive pursuit of local interests, and cannot make global optimal decisions based on the global situation, and even the distributed software services will make contradictory efforts. How to achieve the global optimal decision-making goal under the premise of maintaining distributed independent decision-making of distributed software services under the distributed software service architecture is the primary problem to be solved in this project. The present invention intends to model the safeguard decision-making system of each distributed software service as a reinforcement learning agent on the basis of maintaining the distributed and autonomous architecture and allowing heterogeneous safeguards to maintain independent decision-making capabilities. Relative to each agent, the safeguards, situation assessments, and user rewards of other distributed software services are used as the overall situation environment. Through the interactive experience learning between the agent and the overall situation environment, each agent is given the ability to perceive the global situation and other agents, and a group intelligent decision-making mechanism that is both independent and collaborative is established. In this way, the present invention integrates the core idea of ​​reinforcement learning of "improving performance through experience" into the service credibility assurance activities of distributed software service systems, solves problems such as service continuation, business maintenance and smooth transition of interference under interference, proposes new ideas of collective intelligence for distributed software service assurance, and lays the foundation for realizing intelligent assurance.

[0006] The distributed software service architecture is a new software architecture based on distribution and autonomy, and each distributed software service can configure and deploy its own independent safeguards. When encountering interference and requiring credibility assurance, the independent safeguards and independent decision-making systems can easily ignore the global interests due to excessive pursuit of local interests, and cannot make global optimal decisions based on the global situation, and even the distributed software services will make contradictory efforts. Therefore, the present invention intends to model the security decision system of distributed software services as a reinforcement learning agent based on the multi-agent reinforcement learning method while maintaining the distributed and autonomous architecture and allowing heterogeneous safeguards. Through the interactive experience learning of the agent and the overall situation environment, an intelligent decision-making method that is both independent and collaborative is established.

[0007] The overall framework of this method is as follows Figure 1 shown.

[0008] The framework clearly divides software services, service adaptation, and reinforcement learning decision-making into three main components, achieving complete decoupling of service assurance decisions from the business logic of distributed software services. In the distributed software service system, each software service maintains its original functional modules and assurance modules, and adds adaptation modules such as status monitoring and dynamic configuration, which provide interfaces to interact with the reinforcement learning decision-making module to achieve situational awareness of software services and dynamic control of assurance behaviors (for ease of demonstration, Figure 1 It simplifies the mutual calling relationship between multiple software services); the reinforcement learning decision-making component integrates the core idea of ​​reinforcement learning of "improving performance through experience" into the service guarantee activities under the distributed software service architecture through continuous interactive learning between the intelligent body and the system operation and maintenance effect, user expectation satisfaction and other environmental factors, and realizes a group intelligent decision-making mechanism that is both independent and collaborative.

[0009] 2. Service Adapter Components

[0010] The core function of the service adapter component is to provide the reinforcement learning decision component with an interface for perceiving the running service status of the software service system and controlling the configuration and implementation of various types of safeguards in a timely manner. The main functional modules include the status monitoring module and the dynamic configuration module. Among them:

[0011] (1) Status monitoring module. The content of status monitoring depends on the actual situation, such as the usual request volume, accuracy, response time, etc., or it can be specific business parameters, exception codes, etc. For example, the more popular microservice framework SpringCloud framework provides interfaces such as / metrics endpoint, / health endpoint, / trace endpoint for conventional microservice status monitoring. Customized status monitoring modules and interfaces are also applicable to the patented method.

[0012] (2) Dynamic configuration module. This patented method is oriented to dynamic protection at runtime, which requires the reinforcement learning decision component to select the optimal protection strategy and configuration according to the real-time service status, and dynamically configure and execute protection measures without restarting the service. This method adopts the method of establishing a configuration center outside the functional business to centrally manage the configuration files of each software service. The reinforcement learning decision component controls the content of each software service configuration file and the configuration update activities in real time according to the decision results, thereby completely decoupling the decision of software service protection from the business logic of the software service.

[0013] The interaction logic between the software service adaptation component and the reinforcement learning decision component is as follows: Figure 2As shown in the figure. The reinforcement learning decision component obtains the service status set of each software service through the status monitoring interface and makes assurance strategy decisions based on the reinforcement learning model. According to the decision result, the reinforcement learning decision component dynamically updates the configuration file of the corresponding software service and then sends a configuration update request to each software service. The software service that receives the configuration update request requests the latest configuration file from the configuration center and updates the configuration of the service and assurance measures.

[0014] 3. Reinforcement Learning Decision Component

[0015] The reinforcement learning decision-making component models each software service with decision-making capabilities as an independent agent, and uses a multi-agent reinforcement learning method for centralized training and decentralized execution. That is, the global state is used for training, and the reinforcement learning of each agent considers the action strategies of other agents. During execution, each agent makes decisions to ensure behavior based only on its own state perception. In addition, an experience replay pool is set up to solve the problems of correlation between training samples and non-fixed probability distribution of training samples through the experience replay mechanism. Each group of state transition records saves a state-behavior pair and the corresponding reward and next state, that is:

[0016] (s1,s2,…,s n ; a1, a2, …, a n ; R; s1′,s2′,…,s n ′)

[0017] Among them, s i The current status of each software service, i.e. Figure 2 The state set of each software service shown in; a i is the guarantee behavior selected for each software service; R is the reward value, such as the expected satisfaction of each type of user after executing each guarantee behavior; s i ′ is the next state of each software service. The training framework and process of the two software services are as follows Figure 3 shown.

[0018] Design 2 identical decision strategies for each software service’s “behavior decision” module: target strategy μ i ′ and evaluation strategy μ i , used to make assurance decisions based on the status of the software service itself, where:

[0019] Target strategy μ i 'The next state s served by its own software i ′ is input, output s i ′ corresponds to the protection behavior a i ′:

[0020] s i ′=μi ′(s i ′)

[0021] Target strategy μ i 'Do not actively train, but periodically use the continuously learned evaluation strategy μ i The parameters are updated to increase the stability of the learning process.

[0022] Evaluation strategy μ i The current status of the software service i is the input, and the output is s i Corresponding protection behavior a i :

[0023] a i =μ i (s i )

[0024] Evaluation strategy μ i Continuously train and learn based on the behavioral value (i.e. Q value) feedback of the "value decision" module:

[0025] A comprehensive critic module (i.e., "value decision" module) is designed for all software services, and the Q value corresponding to each software service is output based on the comprehensive reward function. The "value decision" module designs two neural networks with exactly the same structure: the value decision target network Net_target_critic and the value decision evaluation network Net_evaluation_critic, which are used to output the Q value of each software service assurance behavior based on the global state of the software service system, where:

[0026] Net_target_critic takes the next state of the software service system (s1′, s2′, …, s n ′) and the corresponding (a1′,a2′,…,a n ′) as input, and output the Q value corresponding to the next state of each software service:

[0027] Q i ′(s i ′,a i ′,θ tar get )

[0028] Among them, θ target is the parameter of Net_target_critic. Net_target_critic does not actively train and learn, but periodically updates it with the parameters of Net_evaluation_critic that is constantly being learned, thereby increasing the stability of the learning process.

[0029] Net_evaluation_critic is based on the current state of the software service system (s1, s2, ..., s n ) and the corresponding (a1,a2,…,a n ) as input, and output the Q value corresponding to the current state of each software service:

[0030] Q i (s i ,a i ,θ eval )

[0031] Among them, θ eval is the parameter of Net_evaluation_critic. Net_evaluation_critic periodically randomly selects a number of state transition records (assuming N) from the experience replay pool for training and learning. The process of training and learning is the process of continuously optimizing the difference between the estimated Q value and the actual Q value. The loss function is defined as:

[0032]

[0033] Among them, R i is the real-time reward value, γ is the learning rate, γ∈[0,1], the larger the γ is, the more emphasis the learning process places on long-term rewards.

[0034] Evaluation strategy for each software service μ i Update the parameters according to gradient descent:

[0035]

[0036] in, Indicates the gradient of the corresponding parameter. The update of each parameter is based on its gradient, and the parameter is updated in the direction where the gradient decreases fastest.

[0037] Experiments have proven that this method can not only effectively select protection behaviors, but also distinguish downgraded objects according to the source of service risks, thus realizing intelligent elastic protection. In summary, the innovation and effects of this patented method are mainly reflected in:

[0038] (1) Integrate the core idea of ​​reinforcement learning of "improving performance through experience" into distributed software service assurance activities. The present invention maps the independent local decision-making premise and the global collaborative decision-making requirements of distributed software services with the multi-agent reinforcement learning method, innovatively proposes a group intelligence assurance mechanism, and innovatively integrates the core idea of ​​reinforcement learning of "improving performance through experience" into distributed software service assurance activities.

[0039] (2) Realize group decision-making without breaking the original distributed independent decision-making and guarantee system. Distributed and autonomous software architecture has obvious advantages in business logic construction, but when it comes to service guarantee, independent guarantee measures and independent decision-making systems can easily ignore global interests due to excessive pursuit of local interests. The group decision-making system proposed in the present invention uses the method of "centralized learning and decentralized decision-making" to achieve global situation awareness and independent intelligent decision-making of each software service. It well maintains the characteristics of distribution and autonomy, and allows heterogeneous guarantee measures to achieve a group intelligent decision-making mechanism that is both independent and collaborative. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 Overall framework of distributed software service assurance based on swarm intelligence

[0041] Figure 2 Interaction logic diagram between adapter component and decision component

[0042] Figure 3 Reinforcement learning decision-making component framework diagram

[0043] Figure 4 Average reward for requests from each service guarantee mechanism under different service risks DETAILED DESCRIPTION

[0044] Taking the implementation of the present invention under the Spring Cloud microservice framework as an example, the microservice system includes:

[0045] (1) Two request processing microservices are used to receive user information query requests and call the background business processing Provider_user microservice to return the results to the requesting user. The Core_client microservice is the core business that needs to be protected, and the Non_core_client microservice is a non-core business. If necessary, its performance can be sacrificed to ensure the normal operation of the Core_client microservice.

[0046] (2) A Provider_user microservice responsible for background business processing. This microservice receives user information query requests from two request processing microservices and returns the query results.

[0047] The specific implementation steps of this patented method are as follows:

[0048] (1) Since the Spring Cloud microservice framework provides a ready-made configuration center module, you can directly build the configuration center through spring-cloud-config-server, configure the config client for each microservice, and set the configuration file path to the corresponding location of the configuration center.

[0049] (2) Add spring-boot-starter-actuator dependency to each microservice, activate the / refresh endpoint for refreshing configuration, and activate the / metrics endpoint, / health endpoint, and / trace endpoint for software service status monitoring.

[0050] (3) Develop an Agent for each microservice based on Python. The Agent can request the / metrics endpoint through GET,

[0051] / health endpoint and / trace endpoint to obtain the real-time status of software services; randomly send heartbeat monitoring requests to the corresponding microservices every 3 seconds to monitor and record the response time and response content; dynamically update the software service configuration by modifying the corresponding configuration file of the configuration center and POSTing to the / refresh endpoint. The frequency of heartbeat monitoring requests depends on the decision-making efficiency requirements.

[0052] (4) Design of reinforcement learning decision-making components:

[0053] Environmental status: The request response time, request return content and real-time status of the request processing microservice are used as the environmental status of reinforcement learning. The satisfaction degree of user service needs is divided into three situations: 1) Normal service, that is, returning the correct request result within the specified time (based on the analysis of the microservice performance and the consideration of the comparative experimental effect, the response time threshold is set to 3s); 2) Degraded service, that is, downgrading the microservice to fuse its concurrent requests, and ensuring business continuity when the service needs are partially met. This can be achieved by fusing all requests and returning a default value to the user; 3) Service failure, that is, the request response time times out (3s) or the request returns an error.

[0054] Reward function: The corresponding situation of the heartbeat monitoring request randomly sent by each microservice agent is used as the basis for reinforcement learning rewards. The reward function is as follows:

[0055]

[0056] in:

[0057]

[0058]

[0059] Core_requests and Non_core_requests are the total number of microservice status heartbeat monitoring requests randomly sent in the corresponding period, ∑R CC and ∑R NCThe reward value in the formula can be adjusted according to different guarantee decision needs. Generally, a higher value is set for the business that needs to be guaranteed, and a lower value is set for the failure that needs to be avoided.

[0060] Design of reinforcement learning method: states s and s' are designed as the request response time, request return content and real-time status of software services (including request volume, I / O load, CPU and memory usage) of two request processing microservices; the guarantee behavior is designed as whether the two request processing microservices perform downgrade to fuse their concurrent requests; the reward value r is designed as the average reward value of all heartbeat monitoring requests within 15 seconds after the execution of the guarantee behavior; the capacity of the experience replay pool is 200, and 32 groups of state transition records are randomly selected from the experience replay pool every 5 steps as training samples for learning; because the instance scenario is relatively simple, only two layers of target network Net_target and evaluation network Net_evaluation are built based on TensorFlow, and the evaluation network Net_evaluation updates the parameters of the target network Net_target once every 200 learning times; the optimization of the neural network adopts the currently popular RMSprop optimizer; the learning rate γ is set to 0.9 (the larger the learning rate, the more emphasis the learning process places on long-term rewards, which can be adjusted according to actual conditions).

[0061] In order to verify the actual effect of this patented method, comparative experiments in different service risk scenarios were designed based on cases.

[0062] In terms of comparison objects, Hystrix developed by the Netfilix API team is a widely used open source current limiting and circuit breaking function library. The currently popular microservice architecture Spring Cloud also uses Hystrix as its supporting infrastructure, which will promote the widespread application of Hystrix. Therefore, this patent takes the Hytrix mechanism as the main comparison object, and compares and analyzes the service guarantee model trained by this method with the service effect of the implementation of the Hytrix service circuit breaking mechanism and the Normal mechanism without any guarantee measures.

[0063] In terms of service risk scenarios, five service risk scenarios are designed according to whether there is joint high concurrency and whether each request processing microservice has independent high concurrency (the number of concurrent users in each scenario is based on the results of the performance test of each microservice), as shown in Table 1. The naming of the service risk scenario consists of three fields: joint concurrency field (high concurrency HJC or low concurrency LJC), Core_client microservice independent concurrency field (high concurrency HCC or low concurrency LCC), Non_core_client microservice independent concurrency field (high concurrency HNC or low concurrency LNC).

[0064] Table 1 Service risk scenarios and corresponding concurrent user numbers

[0065]

[0066] In various scenarios, the average reward values ​​of heartbeat monitoring requests corresponding to the three different methods (the reward function is unified according to the "design of reinforcement learning decision components") are as follows: Figure 4 shown.

[0067] In scene 3L JC -L CC -L NC In the example, neither the Hystrix fuse mechanism nor the Normal protection method restricts requests to the Provider_user microservice, and all requests can be served normally, so the average reward value is 5. Due to the accuracy problem of the reinforcement learning model itself, this patented method cannot ensure 100% optimal decision-making, so the average reward value is slightly lower than 5 (4.9). In other joint high-concurrency scenarios: (1) The Normal protection method without implementing any measures causes all request response times to time out. According to the reward function designed above, the average reward value is -4; (2) The ordinary Hystrix fuse mechanism is used. Regardless of whether it is independent high concurrency or not, it will cause the two request processing microservices to execute concurrent request fuses for the Provider_user microservice. According to the reward function designed above, the average reward value is 1. Since Hystrix will try to re-request the Provider_user microservice every 15s, normal service can be obtained at this time, but once the circuit breaker is cancelled and the request pressure is restored, the circuit breaker will be activated again immediately. Therefore, the average reward value of the ordinary Hystrix circuit breaker mechanism fluctuates within the range of 1+0.2; (3) The decision model trained by the patented method will intelligently and selectively perform downgrade and service circuit breaker for the Core_client microservice or the Non_core_client microservice based on whether it is independent high concurrency and whether it is critical business independent high concurrency, thereby improving the average reward value. In scenario 5H JC -H CC -H NCThe average reward value is slightly lower than that of the ordinary Hystrix fuse mechanism. This is because the mechanism proposed in this article will not retry requests in high concurrency. Compared with the ordinary Hystrix fuse mechanism, it reduces the normal service reward of this part of the reconnection request and a certain proportion of normal service requests in independent high concurrency. However, if there are external high-concurrency requests in the Provider_user microservice, the service reward of this part of the reconnection request will be negative, the proportion of normal service requests will also decrease, and the average reward value of the ordinary Hystrix fuse mechanism will decrease.

[0068] The architecture of this method is mainly divided into three core components: (1) adding a state monitoring module based on the original business logic of each distributed software service to support the state perception capability required in the reinforcement learning method; (2) establishing a dynamic configuration module for each distributed software service to support the behavior execution capability required in the reinforcement learning method; (3) modeling the decision-making capability of each distributed software service as an independent intelligent entity, and realizing "centralized learning and decentralized decision-making" by designing "distributed multi-behavior decision-making module and single comprehensive value decision-making module", thereby realizing collaborative group intelligent decision-making while maintaining distributed autonomy.

Claims

1. A distributed software service assurance method based on swarm intelligence, characterized by include: The framework of the method is divided into distributed software service system, service adaptation and reinforcement learning decision; among them: (1) The distributed software service system is a distributed software system that provides business services, and a service assurance mechanism is deployed in some or all distributed modules to ensure the reliability of the service; (2) Service adaptation includes state monitoring and dynamic configuration, which expands the state monitoring and dynamic configuration functions for the distributed software service system, and provides interfaces to interact with reinforcement learning decision components to realize the situation awareness and dynamic control of the assurance behavior of distributed software services; (3) Reinforcement learning decision obtains the service state set of each software service through the state monitoring interface of service adaptation, and adaptively optimizes the decision based on the reinforcement learning model; according to the decision results, the reinforcement learning decision The policy dynamically updates the configuration of services and safeguards through the dynamic configuration interface of service adaptation; reinforcement learning decision-making, modeling each software service with decision-making ability as an independent agent, using multi-agent reinforcement learning method for centralized training and decentralized execution, that is, training using global state, each agent's reinforcement learning considers the action strategy of other agents, and each agent makes safeguard behavior decisions based only on its own state perception during execution; and setting up an experience replay pool, through the experience replay mechanism, solve the problem of correlation between training samples and non-fixed probability distribution of training samples; each group of state transition records saves a state-behavior pair and the corresponding reward and next state, that is: (s1,s2,...,s n ;a1,a2,...,a n ;R;s′1,s′2,...,s′ n ) Among them, s i is the current status of each software service, a i is the guarantee behavior selected for each software service; R is the reward value, and the expected satisfaction of each type of user after executing each guarantee behavior; s′ i The next state of each software service; Design two identical decision strategies for each "behavior decision" module of each software service: target strategy μ′ i and the evaluation strategy μ i , used to make assurance decisions based on the status of the software service itself, where: .Target strategy μ′ i The next state s' served by its own software i is the input, and the output is s′ i The corresponding guarantee behavior a′ i : a′ i =μ′ i (s′ i ) Target strategy μ′ i Instead of actively training, we periodically use a continuously learned evaluation strategy μ i The parameters are updated to increase the stability of the learning process; .Evaluation strategy μ i The current status of the software service i is the input, output s i Corresponding protection behavior a i : a i =μ i (s i ) Evaluation strategy μ i Continuously train and learn based on the behavioral value of the "value decision" module, i.e., the Q-value feedback: A comprehensive critic module, namely the "value decision" module, is designed for all software services, and the Q value corresponding to each software service is output based on the comprehensive reward function; the "value decision" module designs two neural networks with exactly the same structure: the value decision target network Net_target_critic and the value decision evaluation network Net_evaluation_critic, which are used to output the Q value of each software service assurance behavior based on the global state of the software service system, where: .Net_target_critic takes the next state of the software service system (s′1, s′2, ..., s′ n ) and the corresponding (a′1, a′2, ..., a′ n ) as input, and output the Q value corresponding to the next state of each software service: Q′ i (s′ i ,a′ i ,the target ) Among them, θ target are the parameters of Net_target_critic; Net_target_critic does not actively train and learn, but periodically updates it with the parameters of Net_evaluation_critic that is constantly being learned, thereby increasing the stability of the learning process; .Net_evaluation_critic is based on the current state of the software service system (s1, s2, ..., s n ) and the corresponding (a1, a2, ..., a n ) as input, and output the Q value corresponding to the current state of each software service: Q i (s i ,a i ,the eval ) Among them, θ eval is the parameter of Net_evaluation_critic; Net_evaluation_critic periodically randomly selects a number of state transition records (assuming N) from the experience replay pool for training and learning; the training and learning process is the process of continuously optimizing the difference between the estimated Q value and the actual Q value; the loss function is defined as: Among them, R i is the real-time reward value, γ is the learning rate, γ∈[0,1]; Evaluation strategy for each software service μ i Update the parameters according to gradient descent: in, Indicates that the gradient of the corresponding parameter is calculated; each parameter is updated based on its gradient, and the parameter is updated in the direction where the gradient decreases fastest.

2. The method according to claim 1, characterized in that The method includes: (1) Two request processing microservices are used to receive user information query requests and call the background business processing Provider_user microservice to return the results to the requesting user. The Core_client microservice is the core business that needs to be protected, and the Non_core_client microservice is a non-core business. (2) A Provider_user microservice responsible for background business processing. This microservice receives user information query requests from two request processing microservices and returns the query results; The specific implementation steps are as follows: (1) Since the Spring Cloud microservice framework provides a ready-made configuration center module, build the configuration center through spring-cloud-config-server, configure configclient for each microservice, and set the configuration file path to the corresponding location of the configuration center; (2) Add spring-boot-starter-actuator dependency to each microservice, activate the "refresh endpoint" to refresh the configuration; activate the "metrics endpoint", "health endpoint", and "trace endpoint" for software service status monitoring; (3) Based on Python, an agent is developed for each microservice. The agent sends a GET request to the "metrics endpoint", "health endpoint", and "trace endpoint" to obtain the real-time status of the software service; a heartbeat monitoring request is randomly sent to the corresponding microservice every 3 seconds to monitor and record the response time and response content; the software service configuration is dynamically updated by modifying the corresponding configuration file of the configuration center and sending a POST request to the "refresh endpoint"; the frequency of the heartbeat monitoring request depends on the decision-making efficiency requirements; (4) Design of reinforcement learning decision-making components: Environmental status: The request response time, request return content and real-time status of the request processing microservice are used as the environmental status of reinforcement learning. The satisfaction degree of user service requirements is divided into three situations: 1) normal service, that is, returning the correct request result within the specified time, and the response time threshold is set to 3s; 2) degraded service, that is, downgrading the microservice to fuse its concurrent requests, ensuring business continuity when the service requirements are partially met, by fusing all requests and returning a default value to the user; 3) service failure, that is, the request response time exceeds 3s or the request returns an error; Reward function: The corresponding situation of the heartbeat monitoring request randomly sent by each microservice agent is used as the basis for reinforcement learning rewards; the reward function is as follows: in: Core_requests and Non_core_requests are the total number of microservice status heartbeat monitoring requests randomly sent in the corresponding period, ∑R CC and ∑R NC are the sum of the heartbeat monitoring request rewards for the Core_client microservice and the Non_core_client microservice respectively. The reward value in the formula can be adjusted according to different guarantee decision needs. A higher value is set for the business that needs to be protected, and a lower value is set for the failure that needs to be avoided. · Reinforcement learning method design: states s and s' are designed as the request response time, request return content and real-time status of software services of two request processing microservices, including request volume, I / O load, CPU and memory usage; the guarantee behavior is designed as whether the two request processing microservices perform downgrade to fuse their concurrent requests; the reward value r is designed as the average reward value of all heartbeat monitoring requests within 15 seconds after the execution of the guarantee behavior; the capacity of the experience replay pool is 200, and 32 groups of state transition records are randomly selected from the experience replay pool as training samples for learning every 5 steps; based on TensorFlow, a two-layer target network Net_target and an evaluation network Net_evaluation are constructed respectively. The evaluation network Net_evaluation updates the parameters of the target network Net_target once every 200 learning times; the RMSprop optimizer is used for neural network optimization; the learning rate γ is set to 0.9.

Citation Information

Patent Citations

  • Method and system of location-aware certificate based authentication

    CN102857492A

  • Containerized application load scheduling method based on swarm intelligence

    CN107589992A