Micro-service management method and device, equipment and medium

By dynamically determining the routing weight value of the microservice subsystem, the problem of insufficient resource utilization in the existing technology is solved, efficient distribution of microservice requests and maximum resource utilization is achieved, and the overall processing capability of the system is improved.

CN119645619APending Publication Date: 2025-03-18BEIJING HUADIAN TIANREN ELECTRIC POWER CONTROL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411543932.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the prior art, systems based on microservice architecture adopt simple polling or preset fixed weights to route services, resulting in insufficient resource utilization and affecting the overall processing capability of the system.

Method used

By regularly obtaining the statistical data set of the microservice subsystem in the set statistical period, dynamically determine the average load index value of the microservice subsystem. When obtaining the microservice request, determine its routing weight value based on the latest average load index value of the alternative microservice subsystem, and select a suitable microservice subsystem for routing.

Benefits of technology

It realizes efficient and balanced distribution of microservice requests to the most suitable service nodes at present, maximizes resource utilization and improves the overall processing capability of the application system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645619A_ABST
    Figure CN119645619A_ABST
Patent Text Reader

Abstract

The invention provides a micro-service management method and device, equipment and a medium, and relates to the technical field of computers, and the method comprises the steps: when a micro-service request is obtained, determining a plurality of alternative micro-service subsystems from a plurality of micro-service subsystems, and according to the average load index value of each alternative micro-service subsystem in the latest statistical period, calculating the average load index value of each alternative micro-service subsystem in the latest statistical period; determining a routing weight value of each alternative micro-service subsystem, and determining a target micro-service subsystem from the plurality of alternative micro-service subsystems according to the routing weight value of each alternative micro-service subsystem; and routing the micro-service request to the target micro-service subsystem. According to the method and the device, the problems that the resource utilization is insufficient and the overall processing capability of the system is influenced due to the fact that the existing system based on the micro-service architecture adopts a simple polling or preset fixed weight strategy to carry out service routing can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a microservice management method, a microservice management device, an electronic device, and a machine-readable storage medium. Background Art

[0002] Microservice architecture decomposes an application into multiple small, independent services, each of which is responsible for a specific business function and can be independently developed, deployed, and expanded. Microservice architecture has become a mainstream trend in building complex applications due to its flexibility, scalability, and high availability. More and more developers regard it as an important solution to improve system response speed and optimize resource utilization.

[0003] In the related art, when implementing inter-service communication, systems under the microservice architecture usually use simple polling or preset fixed weight strategies for service routing (that is, assigning requests to different microservice instances). Although this approach is easy to implement, it ignores the fact that there may be uneven loads when each microservice instance is actually running, resulting in the problem of not fully utilizing system resources. For example, when some service nodes are lightly loaded and other nodes are overloaded, traditional static routing strategies cannot flexibly direct requests to microservice instances with more abundant resources, thereby affecting the overall processing capacity of the system and user experience.

[0004] In addition, the current limiting measures of microservices mostly rely on preset thresholds to limit access volume in order to protect the system from the impact of sudden traffic. However, this "one-size-fits-all" current limiting mode does not take into account the characteristics of the actual load-bearing capacity of the server fluctuating over time. When the server resources are sufficient, an overly conservative current limiting strategy may unnecessarily reject some legitimate requests, while when the server resources are tight, the fixed current limiting threshold is difficult to effectively curb the traffic peak, increasing the risk of system crash. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a microservice management method, a microservice management device, equipment and a medium to solve the problem that in the prior art, a system based on a microservice architecture adopts a simple polling or a preset fixed weight strategy for service routing, resulting in insufficient resource utilization and affecting the overall processing capacity of the system.

[0006] In order to achieve the above-mentioned object, the first aspect of the present application provides a microservice management method, which is applied to an application system built based on a microservice architecture, wherein the application system includes multiple microservice subsystems, and the method includes:

[0007] When a microservice request is obtained, multiple candidate microservice subsystems are determined from multiple microservice subsystems, and routing weight values ​​of each candidate microservice subsystem are determined according to the average load index value of each candidate microservice subsystem in the latest statistical period. According to the routing weight value of each candidate microservice subsystem, a target microservice subsystem is determined from multiple candidate microservice subsystems; wherein the average load index value of the candidate microservice subsystem in the latest statistical period is determined according to the statistical data set of the candidate microservice subsystem in the latest statistical period, and the statistical data set includes operation data of multiple historical moments;

[0008] Routes microservice requests to target microservice subsystems.

[0009] In an embodiment of the present application, the operating data set includes a first operating parameter data set corresponding to the server resource load parameters and a second operating parameter data set corresponding to the JVM resource usage parameters; the server resource load parameters include CPU usage, memory usage, disk IO status and network usage; the JVM resource usage parameters include memory usage, CPU usage of the JVM process, garbage collection indicators and thread usage; wherein each operating parameter in the server resource load parameters and the JVM resource usage parameters has a corresponding preset weight.

[0010] In an embodiment of the present application, determining the average load index value of the candidate microservice subsystem in the latest statistical period according to the statistical data set of the candidate microservice subsystem in the latest statistical period includes:

[0011] For each historical moment in the latest statistical period, each data in the first operating parameter data set is normalized to obtain a first normalized data set, and the server load index value of the candidate microservice subsystem at the historical moment is determined according to the preset weights corresponding to each operating parameter in the first normalized data set and the server resource load parameter;

[0012] For each historical moment in the latest statistical period, each data in the second operating parameter data set is normalized to obtain a second normalized data set, and the JVM resource usage index value of the candidate microservice subsystem at the historical moment is determined according to the preset weight corresponding to each operating parameter in the second normalized data set and the JVM resource usage parameter;

[0013] According to the server load index value and JVM resource usage index value of the candidate microservice subsystem at each historical moment in the latest statistical period, determine the server average load index value and JVM resource average usage index value of the candidate microservice subsystem in the latest statistical period;

[0014] According to the average server load index value and the average JVM resource usage index value of the candidate microservice subsystem in the latest statistical period, the average load index value of the candidate microservice subsystem in the latest statistical period is determined.

[0015] In the embodiment of the present application, the routing weight value of each candidate microservice subsystem is determined according to the average load index value of each candidate microservice subsystem in the latest statistical period, including:

[0016] According to the average load index value of each candidate microservice subsystem in the latest statistical period, the routing weight value of each candidate microservice subsystem is determined by the first formula, where the first formula is:

[0017]

[0018] Among them, p i represents the routing weight value of the i-th candidate microservice subsystem, x i represents the average load index value of the i-th candidate microservice subsystem in the latest statistical period, and n represents the total number of candidate microservice subsystems;

[0019] According to the routing weight values ​​of each candidate microservice subsystem, a target microservice subsystem is determined from multiple candidate microservice subsystems, including:

[0020] Generate a cumulative probability list according to the routing weight values ​​of each candidate microservice subsystem; wherein the cumulative probability list includes multiple cumulative probability values, and each candidate microservice subsystem corresponds to a cumulative probability value;

[0021] The candidate microservice subsystem corresponding to the first cumulative probability value that meets the preset conditions in the cumulative probability list is determined as the target microservice subsystem.

[0022] In an embodiment of the present application, the method further includes:

[0023] The previous statistical cycle of the latest statistical cycle is determined as the target statistical cycle, and the target QPS data set of each microservice subsystem in the target statistical cycle is determined; wherein the target QPS data set of the microservice subsystem in the target statistical cycle includes the actual QPS value corresponding to each historical moment of the microservice subsystem in the target statistical cycle;

[0024] Based on the statistical data sets and target QPS data sets of each microservice subsystem in the target statistical period, the current limiting threshold of each microservice subsystem is determined, so as to limit the current of microservice requests in the next statistical period of the latest statistical period based on the current limiting threshold of the microservice subsystem.

[0025] In the embodiment of the present application, determining the target QPS data set of each microservice subsystem within the target statistical period includes:

[0026] Determine the QPS value corresponding to each historical moment in the target statistical period, and determine the QPS value of the first historical moment in the target statistical period as the actual QPS value corresponding to the historical moment;

[0027] For each historical moment except the first historical moment in the target statistical period, the actual QPS value corresponding to the historical moment is determined by the second formula, where the second formula is:

[0028]

[0029] in, Indicates the actual QPS value corresponding to the i-th historical moment in the target statistical period. It represents the actual QPS value corresponding to the i-1th historical moment in the target statistical period. α represents the averaging factor, α=2 / (N+1), where N represents the total number of historical moments in the target statistical period.

[0030] In the embodiment of the present application, based on the statistical data set and the target QPS data set of each microservice subsystem within the target statistical period, the current limiting threshold of each microservice subsystem is determined, including:

[0031] For each microservice subsystem, determine the target data set corresponding to each historical moment of the microservice subsystem in the target statistical period according to the statistical data set of the microservice subsystem in the target statistical period; wherein the statistical data set includes parameter values ​​of multiple operating parameters, and the target data set includes the target value of each operating parameter;

[0032] For each microservice subsystem, determine the coefficient data set corresponding to the microservice subsystem according to the target data set and target QPS data set corresponding to each historical moment of the microservice subsystem within the target statistical period; wherein the coefficient data set includes the impact coefficient value corresponding to each operating parameter;

[0033] For each microservice subsystem, a current limiting threshold of the microservice subsystem is determined according to a coefficient data set corresponding to the microservice subsystem and preset resource maximization parameter values ​​corresponding to each operating parameter.

[0034] A second aspect of the present application provides a microservice management device, which is configured in an application system built based on a microservice architecture, wherein the application system includes a plurality of microservice subsystems, and the device includes:

[0035] The target microservice determination module is used to determine multiple candidate microservice subsystems from multiple microservice subsystems when a microservice request is obtained, determine the routing weight value of each candidate microservice subsystem according to the average load index value of each candidate microservice subsystem in the latest statistical period, and determine the target microservice subsystem from multiple candidate microservice subsystems according to the routing weight value of each candidate microservice subsystem; wherein the average load index value of the candidate microservice subsystem in the latest statistical period is determined according to the statistical data set of the candidate microservice subsystem in the latest statistical period, and the statistical data set includes the operation data of multiple historical moments;

[0036] The first microservice management module is used to route the microservice request to the target microservice subsystem.

[0037] A third aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the microservice management method described in the first aspect when executing the computer program.

[0038] In a fourth aspect, the present application provides a machine-readable storage medium having instructions stored thereon, which, when executed by a processor, configure the processor to execute the microservice management method described in the first aspect above.

[0039] The microservice management method, device, equipment and medium provided by the present application periodically obtains the statistical data set of the microservice subsystem within the set statistical period, dynamically determines the average load index value of the microservice subsystem, and then when a microservice request is obtained, first determines the latest routing weight value of the alternative microservice subsystem based on the latest average load index value of the alternative microservice subsystem, and then determines the target microservice subsystem based on the latest routing weight value, and finally routes the microservice request to the target microservice subsystem, that is, selects a suitable route to the microservice. By dynamically determining the routing weight value of the microservice subsystem, the present application ensures that the microservice request can be efficiently and evenly distributed to the most suitable service node at the moment, thereby maximizing resource utilization and improving the overall processing capacity of the application system.

[0040] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:

[0042] Figure 1The following is a schematic diagram showing a process flow of a microservice management method according to an embodiment of the present application;

[0043] Figure 2 A specific application diagram of the microservice management method according to an embodiment of the present application is schematically shown;

[0044] Figure 3 The structure block diagram of the microservice management device of the embodiment of the present application is schematically shown;

[0045] Figure 4 The internal structure diagram of the computer device according to the embodiment of the present application is schematically shown.

[0046] Description of Reference Numerals

[0047] A01-processor; A02-network interface; A03-internal memory; A04-display screen; A05-input device; A06-non-volatile storage medium; B01-operating system; B02-computer program. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0049] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), such directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0050] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0051] In view of the fact that the system based on the microservice architecture in the related technology adopts a simple polling or a preset fixed weight strategy for service routing, there is a problem of insufficient resource utilization, which affects the overall processing capability of the system. The present application provides a microservice management method, apparatus, equipment and medium. The microservice management method, apparatus, equipment and medium provided in the present application are described in detail below in conjunction with the accompanying drawings through specific embodiments and implementation methods.

[0052] Figure 1 The flowchart of the microservice management method of the embodiment of the present application is schematically shown. Figure 1 As shown, in one embodiment of the present application, a microservice management method is provided, which is applied to an application system built based on a microservice architecture, wherein the application system includes multiple microservice subsystems (i.e., multiple microservice instances), and the method may include the following steps.

[0053] Step 300, when a microservice request is obtained, multiple candidate microservice subsystems are determined from multiple microservice subsystems, and the routing weight value of each candidate microservice subsystem is determined according to the average load index value of each candidate microservice subsystem in the latest statistical period, and the target microservice subsystem is determined from the multiple candidate microservice subsystems according to the routing weight value of each candidate microservice subsystem.

[0054] The average load index value of the candidate microservice subsystem in the latest statistical period is determined based on a statistical data set of the candidate microservice subsystem in the latest statistical period, and the statistical data set includes operating data at multiple historical moments.

[0055] To determine the average load index value of the candidate microservice subsystem in the latest statistical period, in a specific implementation, before step 300, the method further includes the following steps:

[0056] Step 100, obtaining a statistical data set of each microservice subsystem in the latest statistical period.

[0057] Step 200: For each microservice subsystem, determine the average load index value of the microservice subsystem in the latest statistical period according to the statistical data set of the microservice subsystem in the latest statistical period.

[0058] Each statistical data set includes operating data at multiple historical moments.

[0059] Specifically, the duration of each statistical period and the number of historical moments in each statistical period can be set according to actual conditions, and the embodiments of the present application do not limit them.

[0060] In a specific example, the duration of each statistical cycle is 10 minutes, and the operation data of the microservice subsystem is obtained once every 1 minute, that is, the statistical data set of the microservice subsystem in each statistical cycle includes the operation data of the microservice subsystem at 10 historical moments.

[0061] In this specific implementation, the operating data set includes a first operating parameter data set corresponding to the server resource load parameters and a second operating parameter data set corresponding to the JVM resource usage parameters; the server resource load parameters include CPU usage, memory usage, disk IO status and network usage; the JVM resource usage parameters include memory usage, CPU usage of the JVM process, garbage collection indicators and thread usage; wherein each operating parameter in the server resource load parameters and the JVM resource usage parameters has a corresponding preset weight.

[0062] Among them, disk IO status refers to the disk I / O utilization rate, that is, the percentage of time the disk processes I / O operations (reading or writing data) in the total time; network usage refers to the proportion of network bandwidth usage, that is, the proportion of actual data transmission rate in the network to available bandwidth; memory usage refers to the proportion of memory usage; garbage collection index refers to the proportion of garbage collection time, that is, the percentage of garbage collection (GC) time in the total running time; thread usage refers to the ratio of the number of active threads to the maximum number of threads.

[0063] In this specific implementation, each operating parameter in the server resource load parameter and the JVM resource usage parameter has a corresponding preset weight, and the numerical value of the preset weight reflects the influence of the corresponding parameter on the system performance or system stability.

[0064] In a specific example, the preset weights corresponding to the CPU usage, memory usage, disk IO status and network usage in the server resource load parameters are 0.4, 0.3, 0.15 and 0.15 respectively; the preset weights corresponding to the memory usage, CPU usage of the JVM process, garbage collection index and thread usage in the JVM resource usage parameters are 0.4, 0.3, 0.1 and 0.2 respectively.

[0065] In this specific implementation, step 200 may include the following steps:

[0066] Step 210, for each historical moment in the latest statistical period, normalize each data in the first operating parameter data set to obtain a first normalized data set, and determine the server load index value of the microservice subsystem at the historical moment according to the preset weights corresponding to each operating parameter in the first normalized data set and the server resource load parameter.

[0067] Among them, normalizing the data means normalizing it to between 0 and 1. For each historical moment in the latest statistical period, according to the preset weights corresponding to each operating parameter in the first normalized data set and the server resource load parameter, a specific implementation method for determining the server load index value of the microservice subsystem at the historical moment is: multiplying each normalized data in the first normalized data set by its corresponding preset weight and then summing them to obtain the server load index value of the microservice subsystem at the historical moment.

[0068] It can be understood that since the normalized data in the first normalized data set are obtained by normalizing the parameter values ​​of the parameters in the server resource load parameters, and each operating parameter in the server resource load parameters has a corresponding preset weight, the normalized data in the first normalized data set can be understood as having a corresponding preset weight, and the corresponding preset weight is the preset weight corresponding to the corresponding parameter.

[0069] Step 220, for each historical moment in the latest statistical period, normalize each data in the second operating parameter data set to obtain a second normalized data set, and determine the JVM resource usage index value of the microservice subsystem at the historical moment according to the preset weight corresponding to each operating parameter in the second normalized data set and the JVM resource usage parameter.

[0070] Among them, for each historical moment in the latest statistical period, according to the preset weights corresponding to each operating parameter in the second normalized data set and the JVM resource usage parameters, a specific implementation method for determining the JVM resource usage index value of the microservice subsystem at that historical moment is: multiplying each normalized data in the second normalized data set by its corresponding preset weight and then summing them up to obtain the JVM resource usage index value of the microservice subsystem at that historical moment.

[0071] It can be understood that since the normalized data in the second normalized data set are obtained by normalizing the parameter values ​​of the parameters in the JVM resource usage parameters, and each operating parameter in the JVM resource usage parameters has a corresponding preset weight, the normalized data in the second normalized data set can be understood as having a corresponding preset weight, and the corresponding preset weight is the preset weight corresponding to the corresponding parameter.

[0072] Step 230, according to the server load index value and JVM resource usage index value of the microservice subsystem at each historical moment in the latest statistical period, determine the server average load index value and JVM resource average usage index value of the microservice subsystem in the latest statistical period.

[0073] Among them, a specific implementation method of step 230 is: summing up and averaging the server load index values ​​of the microservice subsystem at each historical moment in the latest statistical period to obtain the average server load index value of the microservice subsystem in the latest statistical period; summing up and averaging the JVM resource usage index values ​​of the microservice subsystem at each historical moment in the latest statistical period to obtain the average JVM resource usage index value of the microservice subsystem in the latest statistical period.

[0074] Step 240, determining the average load index value of the microservice subsystem in the latest statistical period according to the average server load index value and the average JVM resource usage index value of the microservice subsystem in the latest statistical period.

[0075] Among them, a specific implementation method of step 240 is: summing and averaging the average server load index value and the average JVM resource usage index value of the microservice subsystem in the latest statistical period to obtain the average load index value of the microservice subsystem in the latest statistical period.

[0076] In this specific implementation, after the average load index value is calculated, the service name and IP port of the microservice subsystem are used as the key and the average load index value of the microservice subsystem is used as the value, and the two are stored in the cache database of the application system in the form of a key-value pair. In addition, the first normalized data set and the second normalized data set obtained in step 200 are both stored in the cache database of the application system, which can facilitate the operation and maintenance personnel to analyze and optimize the processing of the microservice request by the application system, thereby improving the performance and reliability of the application system.

[0077] To determine the average load index value of the candidate microservice subsystem in the latest statistical period, in another specific implementation, step 300 includes the following steps:

[0078] Step 311, obtaining a statistical data set of each candidate microservice subsystem in the latest statistical period.

[0079] Step 312: For each candidate microservice subsystem, determine the average load index value of the candidate microservice subsystem in the latest statistical period according to the statistical data set of the candidate microservice subsystem in the latest statistical period.

[0080] In this specific implementation, step 312 may include the following steps:

[0081] Step 3121, for each historical moment in the latest statistical period, normalize each data in the first operating parameter data set to obtain a first normalized data set, and determine the server load index value of the alternative microservice subsystem at the historical moment according to the preset weights corresponding to each operating parameter in the first normalized data set and the server resource load parameter.

[0082] Step 3122, for each historical moment in the latest statistical period, normalize each data in the second operating parameter data set to obtain a second normalized data set, and determine the JVM resource usage index value of the alternative microservice subsystem at that historical moment based on the preset weights corresponding to each operating parameter in the second normalized data set and the JVM resource usage parameters.

[0083] Step 3123, based on the server load index value and JVM resource usage index value of the candidate microservice subsystem at each historical moment in the latest statistical period, determine the server average load index value and JVM resource average usage index value of the candidate microservice subsystem in the latest statistical period.

[0084] Step 3124, determine the average load index value of the candidate microservice subsystem in the latest statistical period according to the average server load index value and the average JVM resource usage index value of the candidate microservice subsystem in the latest statistical period.

[0085] The specific implementation method of this specific implementation method is similar to the specific implementation method of the previous specific implementation method, and will not be repeated here.

[0086] In the embodiment of the present application, in step 300, when a microservice request is obtained, multiple candidate microservice subsystems are determined from multiple microservice subsystems according to the target service name in the microservice request.

[0087] In the embodiment of the present application, in step 300, according to the average load index value of each candidate microservice subsystem in the latest statistical period, the routing weight value of each candidate microservice subsystem is determined, and according to the routing weight value of each candidate microservice subsystem, the target microservice subsystem is determined from multiple candidate microservice subsystems, which may include the following steps:

[0088] Step 320: Determine the routing weight value of each candidate microservice subsystem according to the average load index value of each candidate microservice subsystem in the latest statistical period through the first formula.

[0089] Among them, the first formula is:

[0090]

[0091] Among them, pi represents the routing weight value of the i-th candidate microservice subsystem, x i It represents the average load index value of the i-th candidate microservice subsystem in the latest statistical period, and n represents the total number of candidate microservice subsystems.

[0092] Specifically, for each candidate microservice subsystem, if the load of the candidate microservice subsystem is very high, the probability of the candidate microservice subsystem being selected as the target microservice subsystem should be reduced, and conversely, if the load of the candidate microservice subsystem is low, the probability of the candidate microservice subsystem being selected as the target microservice subsystem should be increased. The embodiment of the present application determines the routing weight value of each candidate microservice subsystem based on this design principle, so that the application system can make full use of available resources, improve the overall processing capacity of the application system, and better adapt to specific application scenarios.

[0093] It should be noted that in an embodiment of the present application, after the alternative microservice subsystems are determined, a set of alternative microservice subsystems will be generated, and each alternative microservice subsystem has a corresponding index value in the set. The arrangement of each alternative microservice subsystem in the set can be generated randomly, or it can be generated in descending or ascending order according to the numerical value of the average load index value of the alternative microservice subsystem in the latest statistical period. This application does not limit it.

[0094] Step 330: Generate a cumulative probability list according to the routing weight values ​​of each candidate microservice subsystem.

[0095] The cumulative probability list includes multiple cumulative probability values, and each candidate microservice subsystem corresponds to a cumulative probability value.

[0096] Specifically, the cumulative probability list can be expressed as: [0, p1, p1+p2, p1+p2+p3, …, 1]. In this list, the first element is 0, which represents the starting probability, that is, the cumulative probability value of the first candidate microservice subsystem. The second element represents the cumulative probability value of the second candidate microservice subsystem, and its value is p1. The third element represents the cumulative probability value of the third candidate microservice subsystem, and its value is p1+p2. The fourth element represents the cumulative probability value of the fourth candidate microservice subsystem, and its value is p1+p2+p3. And so on. The last element is 1, which represents the sum of all candidate microservice subsystems. That is to say, the index value of the i-th candidate microservice subsystem in the cumulative probability list is i.

[0097] Step 340: Determine the candidate microservice subsystem corresponding to the first cumulative probability value that meets the preset condition in the cumulative probability list as the target microservice subsystem.

[0098] Among them, the preset condition is that the cumulative probability value is greater than the preset target cumulative probability value; wherein the preset target cumulative probability value can be randomly generated, and its value range is [0,1).

[0099] The method for determining the target microservice subsystem in step 300 is explained below by using an example.

[0100] Assuming there are three candidate microservice subsystems, and the routing weight values ​​of these three candidate microservice subsystems are 0.5, 0.3, and 0.2 respectively, then the generated cumulative probability list is:

[0101] [0,p1,p1+p2,p1+p2+p3]=[0,0.5,0.8,1]

[0102] Assuming that the randomly generated preset target cumulative probability value is 0.65, the comparison process for determining the target microservice subsystem is: 0.65>0, corresponding to the first candidate microservice subsystem; 0.65>0.5, corresponding to the second candidate microservice subsystem; 0.65<0.8, corresponding to the third candidate microservice subsystem. Therefore, when a microservice request is obtained, the request will be routed to the third candidate microservice subsystem, that is, the third candidate microservice subsystem is the target microservice subsystem.

[0103] The embodiment of the present application achieves load-based dynamic load balancing by first generating a cumulative probability list based on the routing weight values ​​of each candidate microservice subsystem, and then determining the target microservice subsystem based on the cumulative probability list, thereby ensuring that requests are more likely to be routed to microservice subsystems with lower loads, thereby improving the overall performance and responsiveness of the application system.

[0104] Step 400: Routing the microservice request to the target microservice subsystem.

[0105] It can be seen that the embodiment of the present application abandons the traditional manual configuration dependence, and instead dynamically determines the average load index value of the microservice subsystem based on the actual operation of the microservice subsystem, so as to perform optimized routing decisions when a microservice request is obtained, that is, first determine the alternative microservice subsystem based on the request content, and then determine its routing weight value according to the latest average load index value of the alternative microservice subsystem, and determine the target microservice subsystem according to the latest routing weight value of the alternative microservice subsystem, and finally route the service request to the target microservice subsystem, ensuring that the request can be efficiently and evenly distributed to the most suitable service node at the moment, thereby maximizing resource utilization and improving the overall processing capability of the application system.

[0106] Optionally, the method may further include the following steps:

[0107] Step 510: determine the previous statistical period of the latest statistical period as the target statistical period, and determine the target QPS data set of each microservice subsystem in the target statistical period.

[0108] The target QPS data set of the microservice subsystem within the target statistical period includes the actual QPS values ​​of the microservice subsystem corresponding to each historical moment within the target statistical period.

[0109] In the embodiment of the present application, step 510 may include the following steps:

[0110] Step 511, determining the QPS value corresponding to each historical moment in the target statistical period, and determining the QPS value of the first historical moment in the target statistical period as the actual QPS value corresponding to the historical moment.

[0111] Specifically, QPS refers to the number of requests per second. The operating data also includes request response time information (the request response time information of each request can be recorded based on request interception). The request response time information includes the request start time and the request end time. The request response time information is used to calculate the QPS value.

[0112] Step 512: For each historical moment except the first historical moment in the target statistical period, the actual QPS value corresponding to the historical moment is determined by the second formula.

[0113] Among them, the second formula is:

[0114]

[0115] in, Indicates the actual QPS value corresponding to the i-th historical moment in the target statistical period. It represents the actual QPS value corresponding to the i-1th historical moment in the target statistical period. α represents the averaging factor, α=2 / (N+1), where N represents the total number of historical moments in the target statistical period.

[0116] The embodiment of the present application can effectively evaluate the performance of each microservice subsystem under the microservice architecture by determining the number of requests per second (QPS) of each microservice subsystem at each historical moment, that is, the actual QPS value. This evaluation helps the application system to dynamically adjust the current limiting strategy, avoid idle or overloaded resources, improve resource utilization efficiency, and thus provide efficient performance and stable service quality.

[0117] Step 520, based on the statistical data set and the target QPS data set of each microservice subsystem in the target statistical period, determine the current limiting threshold of each microservice subsystem, so as to limit the current of microservice requests in the next statistical period of the latest statistical period based on the current limiting threshold of the microservice subsystem.

[0118] In the embodiment of the present application, step 520 may include the following steps:

[0119] Step 521 : For each microservice subsystem, according to the statistical data set of the microservice subsystem in the target statistical period, determine the target data set corresponding to each historical moment in the target statistical period of the microservice subsystem.

[0120] The statistical data set includes parameter values ​​of multiple operating parameters, and the target data set includes target values ​​of each operating parameter.

[0121] Specifically, the target data set corresponding to the historical moment includes the first normalized data set and the second normalized data set corresponding to the historical moment. The method for determining the target data set corresponding to each historical moment of the microservice subsystem in the target statistical period in the embodiment of the present application is the same as determining the first normalized data set and the second normalized data set of each historical moment of the microservice subsystem in the target statistical period, and will not be repeated here.

[0122] Step 522: For each microservice subsystem, determine the coefficient data set corresponding to the microservice subsystem according to the target data set and the target QPS data set corresponding to each historical moment of the microservice subsystem within the target statistical period.

[0123] The coefficient data set includes the influence coefficient values ​​corresponding to each operating parameter.

[0124] In a specific implementation, for each microservice subsystem, step 522 may determine the coefficient data set corresponding to the microservice subsystem in the following manner, specifically:

[0125] Construct an input data set; wherein each input data in the input data set includes a target data set and a target QPS data set corresponding to a historical moment of the microservice subsystem within a target statistical period;

[0126] Based on the input data set, a multivariate linear regression equation is constructed between the target data set and the target QPS data set of the microservice subsystem within the target statistical period;

[0127] According to the multivariate linear regression equation, the coefficient data set corresponding to the microservice subsystem is determined.

[0128] Among them, the multiple linear regression equation can be determined by data mining tools, and the determined multiple linear regression equation can be expressed as: QPS j =SP×a+SM×b+SD×c+SN×d+JM×e+JP×f+JG×g+JT×h+k, where QPS j It represents the actual QPS value of the microservice subsystem at the j-th historical moment in the target statistical period. SP, SM, SD, SN, JM, JP, JG, and JT respectively represent the normalized data of the CPU usage, memory usage, disk IO, network usage, memory usage, CPU usage of the JVM process, garbage collection indicators, and thread usage of the microservice subsystem at the j-th historical moment in the target statistical period. a, b, c, d, e, f, g, h, and k are all influence coefficient values. The numerical value of the influence coefficient reflects the influence of the corresponding operating parameter on QPS.

[0129] Step 523 , for each microservice subsystem, determine the current limiting threshold of the microservice subsystem according to the coefficient data set corresponding to the microservice subsystem and the preset resource maximization parameter values ​​corresponding to each operating parameter.

[0130] In a specific example, under the premise of ensuring service stability, the preset resource maximization parameter values ​​corresponding to CPU usage, memory usage, disk IO, network usage, memory usage, CPU usage of the JVM process, garbage collection index and thread usage are set to 0.4, 0.7, 0.6, 0.6, 0.7, 0.4, 0.01, and 0.6, respectively, to determine the current limiting threshold of the microservice subsystem, that is, for each microservice subsystem, after determining the coefficient data set corresponding to the microservice subsystem, SP=0.4, SM=0.7, SD=0.6, SN=0.6, JM=0.7, JP=0.4, JG=0.01, and JT=0.6 are substituted into the above-mentioned multivariate linear regression equation to obtain the current limiting threshold of the microservice subsystem (the calculated value on the left side of the equal sign).

[0131] In an embodiment of the present application, if the calculated current limiting threshold of the microservice subsystem is 0, the current limiting threshold of the microservice subsystem remains unchanged; if the calculated current limiting threshold of the microservice subsystem is not 0, the calculated current limiting threshold is used.

[0132] In the embodiment of the present application, the microservice request in the next statistical period of the latest statistical period is limited based on the current limiting threshold of the microservice subsystem, which can be implemented by a current limiter (such as RateLimiter) based on the token bucket algorithm. Since it is an existing technology to implement microservice current limiting based on the token bucket algorithm using a current limiter, it will not be repeated here.

[0133] It can be seen that in terms of current limiting, the embodiment of the present application, based on the acquired operation data, flexibly sets the upper limit of the QPS metric by adopting a dynamic adjustment strategy, which not only avoids resource waste, but also effectively responds to sudden traffic and ensures the stability of the service. This adaptive mechanism not only reduces the burden on operation and maintenance personnel, but also enables the microservice system (i.e., the application system) to maintain a high degree of elasticity and resilience in a constantly changing operating environment, providing technical support for business continuity and high-quality development.

[0134] The embodiments of the present application introduce an adaptive adjustment method to make routing and current limiting more intelligent and efficient, laying the foundation for building high-performance and highly reliable microservice applications.

[0135] The following is an example to introduce and illustrate the specific application of the microservice management method provided in the embodiment of the present application.

[0136] like Figure 2 As shown, an application system includes a load collection component, a load calculation component, a service routing component, and a service current limiting component, wherein:

[0137] The load collection component runs together with the microservice subsystem to collect the operation data of the microservice subsystem, and reports the collected operation data, collection time and the microservice subsystem's own attribute information (including service name, IP port) to the load calculation component based on the asynchronous interface;

[0138] The load calculation component runs independently and is used to calculate the average load index value (corresponding to Figure 2 The “load index” in the data) and the actual QPS value are stored in the cache database, and the relevant data (including operation data, actual QPS value, average load index value and intermediate data obtained when calculating the average load index value) are saved in the cache database, and the requests of other components to obtain relevant data are responded to; the cache database adopts Redis, and the reported data is saved through the RedisTimeSeries time series storage module, and the average load index value of the microservice subsystem is stored in the cache database of the application system in the form of key-value pairs;

[0139] The service routing component runs together with the microservice gateway to periodically query the average load index value calculated by the load calculation component and cache it in the memory. When a microservice request is received, the routable service, i.e., the candidate microservice subsystem, is determined according to the target service name contained in the request, and the target microservice subsystem is determined according to the latest average load index value of the candidate microservice subsystem, and the microservice request is routed to the low-load service, i.e., the target microservice subsystem, so that the server resources are fully utilized. Among them, the initiated microservice request first reaches the microservice gateway, and then the target service name in the current request is parsed by the service routing component, and then the memory is queried to see whether there is an average load index value corresponding to the candidate microservice subsystem. If so, the routing weight value of the candidate microservice subsystem is calculated to determine the microservice subsystem to be accessed. If not, the default routing strategy (such as the polling strategy) is used to select the microservice subsystem to be accessed.

[0140] The service current limiting component runs together with the microservice subsystem, and is used to periodically query the target intermediate data (including target QPS data set and target data set) of the microservice subsystem in the cache database according to the service name and IP port of the microservice subsystem. If the target intermediate data exists, the current limiting threshold of the microservice subsystem is calculated, and the microservice requests in the next statistical period of the latest statistical period are limited according to the calculated current limiting threshold. If the target intermediate data does not exist, it indicates that the microservice subsystem does not need to set current limiting.

[0141] The application system ensures the stability of each microservice subsystem by dynamically adjusting the routing weight value and current limiting threshold of the microservice subsystem while fully utilizing server resources.

[0142] Figure 1 FIG. 1 is a flow chart of a microservice management method in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0143] Figure 3 The structure block diagram of the microservice management device of the embodiment of the present application is schematically shown. Figure 3As shown, in one embodiment of the present application, a microservice management device is provided, which is configured in an application system built based on a microservice architecture, wherein the application system includes multiple microservice subsystems, and the microservice management device may include the following functional modules.

[0144] The target microservice determination module is used to determine multiple candidate microservice subsystems from multiple microservice subsystems when a microservice request is obtained, determine the routing weight value of each candidate microservice subsystem according to the average load index value of each candidate microservice subsystem in the latest statistical period, and determine the target microservice subsystem from multiple candidate microservice subsystems according to the routing weight value of each candidate microservice subsystem. Among them, the average load index value of the candidate microservice subsystem in the latest statistical period is determined according to the statistical data set of the candidate microservice subsystem in the latest statistical period, and the statistical data set includes operation data of multiple historical moments.

[0145] The first microservice management module is used to route the microservice request to the target microservice subsystem.

[0146] In the embodiment of the present application, the operation data set includes a first operation parameter data set corresponding to the server resource load parameter and a second operation parameter data set corresponding to the JVM resource usage parameter; the server resource load parameter includes CPU usage, memory usage, disk IO status and network usage; the JVM resource usage parameter includes memory usage, CPU usage of the JVM process, garbage collection index and thread usage. Each operation parameter in the server resource load parameter and the JVM resource usage parameter has a corresponding preset weight.

[0147] In the embodiment of the present application, the microservice management device may further include a first relevant data determination module, and the first relevant data determination module may include:

[0148] The first relevant data determination unit normalizes each data in the first operating parameter data set for each historical moment in the latest statistical period to obtain a first normalized data set, and determines the server load index value of the alternative microservice subsystem at the historical moment according to the preset weights corresponding to each operating parameter in the first normalized data set and the server resource load parameter.

[0149] The second related data determination unit is used to normalize each data in the second operating parameter data set for each historical moment in the latest statistical period to obtain a second normalized data set, and determine the JVM resource usage index value of the alternative microservice subsystem at the historical moment according to the preset weights corresponding to each operating parameter in the second normalized data set and the JVM resource usage parameters.

[0150] The third related data determination unit is used to determine the server average load index value and the JVM resource average usage index value of the candidate microservice subsystem in the latest statistical period according to the server load index value and the JVM resource usage index value of the candidate microservice subsystem at each historical moment in the latest statistical period.

[0151] The fourth related data determination unit is used to determine the average load index value of the candidate microservice subsystem in the latest statistical period according to the server average load index value and the JVM resource average usage index value of the candidate microservice subsystem in the latest statistical period.

[0152] In an embodiment of the present application, the target microservice determination module may include:

[0153] The routing weight value determination unit is used to determine the routing weight value of each candidate microservice subsystem according to the average load index value of each candidate microservice subsystem in the latest statistical period through the first formula. The first formula is:

[0154]

[0155] Among them, p i represents the routing weight value of the i-th candidate microservice subsystem, x i It represents the average load index value of the i-th candidate microservice subsystem in the latest statistical period, and n represents the total number of candidate microservice subsystems.

[0156] The cumulative probability list generating unit is used to generate a cumulative probability list according to the routing weight values ​​of each candidate microservice subsystem, wherein the cumulative probability list includes a plurality of cumulative probability values, and each candidate microservice subsystem corresponds to a cumulative probability value.

[0157] The target microservice determination unit is used to determine the candidate microservice subsystem corresponding to the first cumulative probability value that meets the preset conditions in the cumulative probability list as the target microservice subsystem.

[0158] In the embodiment of the present application, the microservice management device may further include:

[0159] The second related data determination module is used to determine the previous statistical period of the latest statistical period as the target statistical period, and determine the target QPS data set of each microservice subsystem in the target statistical period. Among them, the target QPS data set of the microservice subsystem in the target statistical period includes the actual QPS value corresponding to each historical moment of the microservice subsystem in the target statistical period.

[0160] The second microservice management module is used to determine the current limiting threshold of each microservice subsystem based on the statistical data set and the target QPS data set of each microservice subsystem in the target statistical period, so as to limit the current of microservice requests in the next statistical period of the latest statistical period based on the current limiting threshold of the microservice subsystem.

[0161] In the embodiment of the present application, the second relevant data determination module may include:

[0162] The first actual QPS value determination unit is used to determine the QPS value corresponding to each historical moment in the target statistical period, and determine the QPS value of the first historical moment in the target statistical period as the actual QPS value corresponding to the historical moment.

[0163] The second actual QPS value determination unit is used to determine the actual QPS value corresponding to each historical moment except the first historical moment in the target statistical period by using a second formula. The second formula is:

[0164]

[0165] in, Indicates the actual QPS value corresponding to the i-th historical moment in the target statistical period. It represents the actual QPS value corresponding to the i-1th historical moment in the target statistical period. α represents the averaging factor, α=2 / (N+1), where N represents the total number of historical moments in the target statistical period.

[0166] In this embodiment of the present application, the second microservice management module may include:

[0167] The target data set determination unit is used to determine, for each microservice subsystem, the target data set corresponding to each historical moment in the target statistical period according to the statistical data set of the microservice subsystem in the target statistical period. The statistical data set includes parameter values ​​of multiple operating parameters, and the target data set includes the target value of each operating parameter.

[0168] The coefficient data set determination unit is used to determine the coefficient data set corresponding to each microservice subsystem according to the target data set and target QPS data set corresponding to each historical moment of the microservice subsystem in the target statistical period. The coefficient data set includes the impact coefficient value corresponding to each operating parameter.

[0169] The current limiting threshold determination unit is used to determine the current limiting threshold of each microservice subsystem according to the coefficient data set corresponding to the microservice subsystem and the preset resource maximization parameter values ​​corresponding to each operating parameter.

[0170] Since the microservice management device provided in the embodiment of the present application is a virtual device corresponding to the microservice management method of the above embodiment, it can also solve the problem that the system based on the microservice architecture in the prior art adopts a simple polling or preset fixed weight strategy for service routing, resulting in insufficient resource utilization and affecting the overall processing capacity of the system.

[0171] An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the microservice management method described in the above embodiment when executing the computer program.

[0172] Specifically, in the embodiment of the present application, the processor implements the following steps when executing the computer program:

[0173] When a microservice request is obtained, multiple candidate microservice subsystems are determined from multiple microservice subsystems, and routing weight values ​​of each candidate microservice subsystem are determined according to the average load index value of each candidate microservice subsystem in the latest statistical period. According to the routing weight value of each candidate microservice subsystem, a target microservice subsystem is determined from multiple candidate microservice subsystems; wherein the average load index value of the candidate microservice subsystem in the latest statistical period is determined according to the statistical data set of the candidate microservice subsystem in the latest statistical period, and the statistical data set includes operation data of multiple historical moments;

[0174] Routes microservice requests to target microservice subsystems.

[0175] The electronic device provided in the embodiment of the present application includes a processor capable of running the microservice management method of the aforementioned embodiment, and therefore can also solve the problem in the prior art that the system based on the microservice architecture adopts a simple polling or preset fixed weight strategy for service routing, resulting in insufficient resource utilization and affecting the overall processing capacity of the system.

[0176] An embodiment of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the microservice management method described in the above embodiment.

[0177] Specifically, in the embodiment of the present application, when the instruction is executed by the processor, the processor is configured to perform the following steps:

[0178] When a microservice request is obtained, multiple candidate microservice subsystems are determined from multiple microservice subsystems, and routing weight values ​​of each candidate microservice subsystem are determined according to the average load index value of each candidate microservice subsystem in the latest statistical period. According to the routing weight value of each candidate microservice subsystem, a target microservice subsystem is determined from multiple candidate microservice subsystems; wherein the average load index value of the candidate microservice subsystem in the latest statistical period is determined according to the statistical data set of the candidate microservice subsystem in the latest statistical period, and the statistical data set includes operation data of multiple historical moments;

[0179] Routes microservice requests to target microservice subsystems.

[0180] The machine-readable storage medium provided in the embodiment of the present application stores instructions for enabling a machine to execute the microservice management method of the above embodiment. Therefore, it can also solve the problem in the prior art that a system based on a microservice architecture adopts a simple polling or a preset fixed weight strategy for service routing, resulting in insufficient resource utilization and affecting the overall processing capability of the system.

[0181] Figure 4 The internal structure diagram of the computer device of the embodiment of the present application is schematically shown. Figure 4 As shown, in one embodiment of the present application, a computer device is provided, which may be a terminal. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected via a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, a microservice management method is implemented. The display screen A04 of the computer device may be a liquid crystal display or an electronic ink display, and the input device A05 of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0182] Those skilled in the art will understand that Figure 4The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0183] In one embodiment, the microservice management device provided by the present application can be implemented in the form of a computer program. The computer program can be Figure 4 The computer device is run on the computer device shown. The memory of the computer device can store various program modules that constitute the microservice management device, such as: Figure 3 The target microservice determination module and the first microservice management module shown. The computer program composed of each program module enables the processor to execute the steps of the microservice management method of each embodiment of the present application described in this specification.

[0184] Figure 4 The computer device shown can be Figure 3 The target microservice determination module in the microservice management device shown executes step 300 and the first microservice management module executes step 400 .

[0185] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0186] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0187] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0189] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0190] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0191] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0192] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0193] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A microservice management method, characterized in that: Applied to an application system built based on a microservice architecture, the application system includes multiple microservice subsystems, and the method includes: When a microservice request is obtained, multiple candidate microservice subsystems are determined from multiple microservice subsystems, and routing weight values ​​of each candidate microservice subsystem are determined according to the average load index value of each candidate microservice subsystem in the latest statistical period. According to the routing weight value of each candidate microservice subsystem, a target microservice subsystem is determined from multiple candidate microservice subsystems; wherein the average load index value of the candidate microservice subsystem in the latest statistical period is determined according to the statistical data set of the candidate microservice subsystem in the latest statistical period, and the statistical data set includes operation data of multiple historical moments; Routes microservice requests to target microservice subsystems.

2. The method according to claim 1, characterized in that The operating data set includes a first operating parameter data set corresponding to the server resource load parameters and a second operating parameter data set corresponding to the JVM resource usage parameters; the server resource load parameters include CPU usage, memory usage, disk IO status and network usage; the JVM resource usage parameters include memory usage, CPU usage of the JVM process, garbage collection indicators and thread usage; wherein each operating parameter in the server resource load parameters and the JVM resource usage parameters has a corresponding preset weight.

3. The method according to claim 2, characterized in that According to the statistical data set of the candidate microservice subsystem in the latest statistical period, the average load index value of the candidate microservice subsystem in the latest statistical period is determined, including: For each historical moment in the latest statistical period, each data in the first operating parameter data set is normalized to obtain a first normalized data set, and the server load index value of the candidate microservice subsystem at the historical moment is determined according to the preset weights corresponding to each operating parameter in the first normalized data set and the server resource load parameter; For each historical moment in the latest statistical period, each data in the second operating parameter data set is normalized to obtain a second normalized data set, and the JVM resource usage index value of the candidate microservice subsystem at the historical moment is determined according to the preset weight corresponding to each operating parameter in the second normalized data set and the JVM resource usage parameter; According to the server load index value and JVM resource usage index value of the candidate microservice subsystem at each historical moment in the latest statistical period, determine the server average load index value and JVM resource average usage index value of the candidate microservice subsystem in the latest statistical period; According to the average server load index value and the average JVM resource usage index value of the candidate microservice subsystem in the latest statistical period, the average load index value of the candidate microservice subsystem in the latest statistical period is determined.

4. The method according to claim 1, characterized in that According to the average load index value of each candidate microservice subsystem in the latest statistical period, the routing weight value of each candidate microservice subsystem is determined, including: According to the average load index value of each candidate microservice subsystem in the latest statistical period, the routing weight value of each candidate microservice subsystem is determined by the first formula, where the first formula is: Among them, p i represents the routing weight value of the i-th candidate microservice subsystem, x i represents the average load index value of the i-th candidate microservice subsystem in the latest statistical period, and n represents the total number of candidate microservice subsystems; According to the routing weight values ​​of each candidate microservice subsystem, a target microservice subsystem is determined from multiple candidate microservice subsystems, including: Generate a cumulative probability list according to the routing weight values ​​of each candidate microservice subsystem; wherein the cumulative probability list includes multiple cumulative probability values, and each candidate microservice subsystem corresponds to a cumulative probability value; The candidate microservice subsystem corresponding to the first cumulative probability value that meets the preset conditions in the cumulative probability list is determined as the target microservice subsystem.

5. The method according to claim 1, characterized in that The method further comprises: The previous statistical cycle of the latest statistical cycle is determined as the target statistical cycle, and the target QPS data set of each microservice subsystem in the target statistical cycle is determined; wherein the target QPS data set of the microservice subsystem in the target statistical cycle includes the actual QPS value corresponding to each historical moment of the microservice subsystem in the target statistical cycle; Based on the statistical data sets and target QPS data sets of each microservice subsystem in the target statistical period, the current limiting threshold of each microservice subsystem is determined, so as to limit the current of microservice requests in the next statistical period of the latest statistical period based on the current limiting threshold of the microservice subsystem.

6. The method according to claim 5, characterized in that Determine the target QPS data set for each microservice subsystem within the target statistical period, including: Determine the QPS value corresponding to each historical moment in the target statistical period, and determine the QPS value of the first historical moment in the target statistical period as the actual QPS value corresponding to the historical moment; For each historical moment except the first historical moment in the target statistical period, the actual QPS value corresponding to the historical moment is determined by the second formula, where the second formula is: in, Indicates the actual QPS value corresponding to the i-th historical moment in the target statistical period. It represents the actual QPS value corresponding to the i-1th historical moment in the target statistical period. α represents the averaging factor, α=2 / (N+1), where N represents the total number of historical moments in the target statistical period.

7. The method according to claim 5, characterized in that Based on the statistical data sets and target QPS data sets of each microservice subsystem within the target statistical period, determine the current limiting threshold of each microservice subsystem, including: For each microservice subsystem, determine the target data set corresponding to each historical moment of the microservice subsystem in the target statistical period according to the statistical data set of the microservice subsystem in the target statistical period; wherein the statistical data set includes parameter values ​​of multiple operating parameters, and the target data set includes the target value of each operating parameter; For each microservice subsystem, determine the coefficient data set corresponding to the microservice subsystem according to the target data set and target QPS data set corresponding to each historical moment of the microservice subsystem within the target statistical period; wherein the coefficient data set includes the impact coefficient value corresponding to each operating parameter; For each microservice subsystem, a current limiting threshold of the microservice subsystem is determined according to a coefficient data set corresponding to the microservice subsystem and preset resource maximization parameter values ​​corresponding to each operating parameter.

8. A microservice management device, characterized in that: An application system configured on a microservice architecture, the application system comprising a plurality of microservice subsystems, the device comprising: The target microservice determination module is used to determine multiple candidate microservice subsystems from multiple microservice subsystems when a microservice request is obtained, determine the routing weight value of each candidate microservice subsystem according to the average load index value of each candidate microservice subsystem in the latest statistical period, and determine the target microservice subsystem from multiple candidate microservice subsystems according to the routing weight value of each candidate microservice subsystem; wherein the average load index value of the candidate microservice subsystem in the latest statistical period is determined according to the statistical data set of the candidate microservice subsystem in the latest statistical period, and the statistical data set includes the operation data of multiple historical moments; The first microservice management module is used to route the microservice request to the target microservice subsystem.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the microservice management method according to any one of claims 1 to 7 is implemented.

10. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the microservice management method according to any one of claims 1 to 7.