A high-concurrency automatic expansion and contraction method, system, computer equipment and medium
Through machine learning models, predict monitoring thresholds of business and machine performance indicators, and dynamically execute scaling strategies, the problem of server downtime under high concurrent access is solved and the stability and availability of the system is improved.
Patent Information
- Application Number
- CN202111499796.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-12-09
AI Technical Summary
During large-scale high concurrent access, the server is prone to crash due to request surges, causing the entire application system to crash.
By obtaining historical business data, extracting business performance indicators and machine performance indicators, using machine learning models to predict indicators to monitor thresholds, and forming a capacity expansion mechanism based on traffic rules, dynamically performing capacity expansion and scaling actions to cope with high concurrent access.
It realizes flexible and variable service flow limit configuration, dynamically controls the availability of services, and improves the stability and elastic management capabilities of the system in high concurrency situations.
Smart Images

Figure CN114358134B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a high-concurrency automatic expansion and contraction method, system, computer equipment and storage medium. Background Art
[0002] In the related art, when a server faces large-scale high-concurrency access, the service or interface often becomes unavailable due to a surge in requests, and even triggers a chain reaction that causes the entire application system to crash. In the related art, when the number of accesses or requests increases suddenly, it is easy to cause the server of the underlying service provider to crash. For example, in the IoT application scenario, the periodic surge in traffic data reporting usually leads to serious consequences such as server crashes or downtime. Summary of the invention
[0003] In view of this, in order to at least partially solve one of the above-mentioned technical problems, an embodiment of the present invention aims to provide a high-concurrency automatic scaling method that can realize flexible and variable service flow limiting configuration, as well as a system, computer equipment and storage medium that can implement the method.
[0004] In a first aspect, the technical solution of the present application provides a high-concurrency automatic expansion and contraction method, the method comprising the following steps:
[0005] Acquire historical business data, and extract business performance indicators and machine performance indicators from the historical business data;
[0006] According to the business performance indicator and the machine performance indicator, the indicator monitoring threshold is predicted by the machine learning model obtained through training;
[0007] Match the traffic rules, form an expansion mechanism according to the traffic rules and the indicator monitoring threshold, and execute the expansion and contraction actions of the expansion mechanism.
[0008] In a feasible embodiment of the solution of the present application, before executing the step of scaling action of the scaling mechanism, the method further includes the following steps:
[0009] Acquire a triggering strategy for the capacity expansion mechanism, and set a trigger according to the triggering strategy;
[0010] According to the signaling of the trigger, the expansion and contraction actions of the expansion mechanism are executed.
[0011] In a feasible embodiment of the solution of the present application, after executing the step of scaling action of the scaling mechanism, the method further includes the following steps:
[0012] The current business data is periodically acquired, and the machine learning model is updated according to the current business data to obtain the updated indicator monitoring threshold.
[0013] In a feasible embodiment of the solution of the present application, the step of extracting the service performance index and the machine performance index from the historical service data includes:
[0014] Classifying the historical business data according to key fields to obtain business performance indicator samples and machine performance indicator samples;
[0015] According to the business performance indicator sample and the machine performance indicator sample, a resource critical point is obtained through a decision tree algorithm, and the indicator monitoring threshold is determined according to the resource critical point.
[0016] In a feasible embodiment of the solution of the present application, the step of obtaining the resource critical point by using a decision tree algorithm includes:
[0017] The current number of current limiting tokens is obtained by expanding the step size according to the preset number of tokens;
[0018] According to the result set of the business performance indicator and the usage rate of the machine performance indicator, the credibility of the current limiting strategy is calculated, and the current limiting strategy is determined according to the current number of current limiting tokens;
[0019] It is determined that the credibility meets the credibility threshold, and the resource critical point is output, where the resource critical point includes a traffic critical point, a business performance critical point, and a machine performance critical point.
[0020] In a feasible embodiment of the solution of the present application, the step of matching traffic rules includes:
[0021] The call request of the service gateway is obtained, and the traffic rule is matched according to the application ID, service ID, call request source, open identifier and operation identifier in the call request.
[0022] In a feasible embodiment of the solution of the present application, the scaling action of executing the scaling mechanism includes at least one of the following steps:
[0023] Execute expansion and contraction actions based on the leaky bucket current limiting method;
[0024] The capacity expansion and contraction actions are performed according to the current limiting method of the token bucket.
[0025] On the other hand, the technical solution of the present application also provides a high-concurrency automatic expansion and contraction system, which includes:
[0026] A data acquisition unit, used to acquire historical business data, and extract business performance indicators and machine performance indicators from the historical business data;
[0027] A machine learning unit, configured to predict an indicator monitoring threshold value based on the business performance indicator and the machine performance indicator by using a machine learning model obtained through training;
[0028] The policy execution unit is used to match the traffic rules, form an expansion mechanism according to the traffic rules and the indicator monitoring threshold, and execute the expansion and contraction actions of the expansion mechanism.
[0029] On the other hand, the technical solution of the present invention further provides a high-concurrency automatic expansion and contraction computer device, which includes:
[0030] at least one processor;
[0031] at least one memory for storing at least one program;
[0032] When at least one program is executed by at least one processor, the at least one processor runs a high-concurrency automatic scaling method in the first aspect.
[0033] On the other hand, the technical solution of the present invention further provides a storage medium, in which a program executable by a processor is stored. The program executable by the processor is used to run the method in the first aspect when executed by the processor.
[0034] The advantages and beneficial effects of the present invention will be partially given in the following description, and the other parts can be understood through the specific embodiments of the present invention:
[0035] The technical solution of the present application realizes flexible and variable service flow limiting configuration through application-level machine automatic learning flow limiting strategy, thereby dynamically controlling according to the system service resource situation, opening the indicator monitoring threshold of the real-time call of each service to improve the availability of the service, so as to provide elastic management capabilities and ensure the service capabilities of core services when facing a sudden surge in external requests under the condition of relatively fixed resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 A flowchart of the steps of a high-concurrency automatic expansion and contraction method provided in the technical solution of this application;
[0038] Figure 2 This is a schematic diagram of the deployment of automatic expansion and contraction of the capacity flow in the technical solution of this application. DETAILED DESCRIPTION
[0039] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limitations of the present invention. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0040] The present application proposes a high-concurrency automatic expansion and contraction solution based on an automatic learning current limiting strategy. Based on a unified service gateway, a flexible and variable service current limiting configuration is achieved through an application-level machine automatic learning current limiting strategy, thereby dynamically controlling the maximum or minimum number of transactions per second (TPS) or query rate per second (QPS) thresholds for real-time calls of each service opened according to the system service resource situation, thereby ensuring the high availability of the service as much as possible, thereby providing some elastic management capabilities in the face of a sudden surge in external requests when resources are relatively fixed, and ensuring the service capabilities of core services.
[0041] First, as Figure 1 As shown, in order to solve the technical defects pointed out in the above background technology, the embodiment of the present application provides a high-concurrency automatic expansion and contraction method, which mainly includes steps S100-S300:
[0042] S100, acquiring historical business data, and extracting business performance indicators and machine performance indicators from the historical business data;
[0043] In an embodiment, historical business data may be relevant data such as business service records within 1 to 2 years obtained from a database, wherein business performance indicators are data values formed from the perspective of user operations; and machine performance indicators are data values formed from the perspective of resource usage.
[0044] Specifically, the embodiment collects business service data within 1 to 2 years, selects key fields as feature extraction to obtain business performance indicators and machine performance indicators, and performs corresponding classification to obtain two types of indicator data sets. Among them, business indicators are data reflected from the perspective of user operations, and their key fields include but are not limited to service name, service ID, service type, TPS, number of concurrent users, response time, number of active users, etc. Machine indicators are reflected from the perspective of resource usage, and key fields include CPU, memory, IO, response time, etc.
[0045] S200, predicting the indicator monitoring threshold value through the trained machine learning model according to the business performance indicator and the machine performance indicator;
[0046] Specifically, the embodiment can perform feature classification on the key fields of the business performance indicators and machine performance indicators obtained in step S100 to form two types of indicator data sets. In the embodiment, the business performance indicators and machine performance indicators at the same time can also be displayed through trend charts, combined with the existing business flow operation data and load conditions within 1 to 2 years, through machine learning models, according to the decision tree algorithm, after multiple rounds of learning iterations, the bottleneck critical points of flow, service, and host resources are predicted, and the corresponding indicator monitoring thresholds for current limiting triggering automatic expansion and contraction are formulated.
[0047] S300, matching traffic rules, forming a capacity expansion mechanism according to the traffic rules and indicator monitoring thresholds, and executing the expansion and contraction actions of the capacity expansion mechanism;
[0048] In the embodiment, the traffic rules include but are not limited to flow limiting methods, capacity reduction and expansion mechanisms, and corresponding triggering strategies of the capacity expansion mechanisms. Among them, the flow limiting methods in the embodiment include but are not limited to leaky bucket and token bucket flow limiting methods.
[0049] Specifically, in the embodiment, when the application calls the service gateway, the corresponding traffic rules are matched according to the call request, wherein the matching process of the traffic rules may include selecting leaky buckets and token bucket current limiting methods; determining the size and number of buckets, etc. Then, the corresponding elastic expansion and contraction trigger strategy is also matched according to the call request, and the system expansion mechanism is formed according to the specific content of the current limiting trigger strategy and the traffic rules.
[0050] In some optional embodiments, in step S300, before executing the process of scaling up and down of the scaling mechanism, the method further includes steps S210-S220:
[0051] S210, obtaining a triggering strategy of the expansion mechanism, and setting a trigger according to the triggering strategy;
[0052] S220, executing the expansion and contraction actions of the expansion mechanism according to the signaling of the trigger;
[0053] Specifically, the embodiment configures triggers according to the elastic expansion and contraction triggering strategy of the expansion mechanism, and the trigger type supports triggering according to a period. For example, the implementation can select a certain time period to perform automatic expansion and contraction. Observe the trigger indicator, and send an event when the indicator reaches the expected value to trigger the expansion and contraction action.
[0054] For example, in the embodiment, for the periodic large-scale three-meter NB card data reporting interface, the flow limiting adopts a token bucket with a token number of 100. At a certain moment, the CRM system access concurrency is 1000, and the CPU utilization rate is 20%, but only 100 concurrent requests can access the CRM system, and the remaining 900 can only wait in line, which seriously affects the business call. According to the automatic expansion and contraction capacity flow strategy in the embodiment, if a burst of concurrent indicators is observed, the size of the token bucket can be dynamically adjusted according to the machine learning model, such as adjusting it to 300. According to the learning model, the CPU utilization rate should be 60% at this time, and there will be no CPU overload.
[0055] In some optional embodiments, in step S300, after executing the expansion and contraction action of the expansion mechanism, the method further includes step S310:
[0056] S310, periodically acquiring current business data, updating the machine learning model according to the current business data, and obtaining an updated indicator monitoring threshold;
[0057] Specifically, the machine learning model in the embodiment will automatically update the algorithm model based on the new business operation data generated daily, and dynamically update the threshold indicators for automatic expansion and contraction without the need for manual maintenance.
[0058] In some optional embodiments, in step S100, the process of extracting the business performance index and the machine performance index from the historical business data includes steps S110-S120:
[0059] S110, classifying historical business data according to key fields to obtain business performance indicator samples and machine performance indicator samples;
[0060] S120, obtaining a resource critical point through a decision tree algorithm according to the business performance indicator sample and the machine performance indicator sample, and determining an indicator monitoring threshold according to the resource critical point;
[0061] Specifically, in the embodiment, in the process of calculating the indicator monitoring threshold value according to the decision tree algorithm through the machine learning model, the extracted business performance indicators and machine performance indicators are firstly subjected to feature classification, and business performance indicator samples and machine performance indicator samples are obtained after classification. Different prediction results are generated according to the indicator characteristics in the decision tree, and appropriate data are selected from the prediction results and stored in the database corresponding to the model.
[0062] Exemplarily, the embodiment obtains business and machine indicators for a period of time, taking CPU utilization, service access concurrency and token number as examples. In multiple operating time periods, the number of tokens is 100. 100 business concurrency corresponds to 20% CPU utilization, and 200 business concurrency corresponds to 40% CPU utilization. If this probability is above 90% (which can be specified) (which can be converted into a credibility threshold of the calculation result), then this model rule can be set to adjust the token number to 200 when the concurrency is 200.
[0063] In some optional embodiments, in step S210, the process of obtaining the resource critical point by using a decision tree algorithm and determining the indicator monitoring threshold according to the resource critical point may also include steps S211-S213:
[0064] S211, obtaining the current current limiting token number according to the preset token number expansion step;
[0065] S212, according to the result set of the business performance indicator and the utilization rate of the machine performance indicator, the credibility of the current limiting strategy is calculated, and the current limiting strategy is determined according to the current number of current limiting tokens;
[0066] S213, determine that the credibility meets the credibility threshold, and output the resource critical point, which includes the flow critical point, the business performance critical point, and the machine performance critical point;
[0067] In the embodiment, the input of the decision tree model is:
[0068] The result set of business performance indicators obtained by detection: ServiceRtMetric
[0069] Detected machine performance indicator utilization rate: AvgMetric
[0070] Current number of limit tokens: ActTokens
[0071] Expected number of limit tokens: DisredTokens
[0072] Credibility threshold: Tolerance
[0073] Set the number of tokens to expand the step size: PaceTokens
[0074] Regular learning cycle: T
[0075] Exemplarily, the core algorithm process of the constructed model is as follows:
[0076]
[0077] Specifically, in the model, the matching result between the service operation index result set, the machine operation index usage rate and the current flow limiting strategy of the flow limiting token number is first calculated to determine whether the matching result reaches the set credibility threshold. If the set credibility threshold is not reached, the current flow limiting token number is expanded by the set token number expansion step to obtain the expected flow limiting token number; the expected flow limiting token number is used as the current flow limiting token number, and the matching result between it and the service operation index result set and the machine operation index usage rate is calculated; if the credibility threshold has been reached, the flow limiting strategy corresponding to the current flow limiting token number is used as the flow limiting strategy of the current service operation index and the machine operation index, and the current flow limiting token number is expanded according to the set token number expansion step, and multiple rounds of learning iterations are performed. Finally, after multiple rounds of learning iterations, the bottleneck critical points of traffic, service, and host resources are obtained, which correspond to the traffic critical point, business performance critical point, and machine performance critical point, respectively, and the corresponding indicator monitoring thresholds for flow limiting triggering automatic expansion and contraction are formulated.
[0078] In some optional embodiments, in step S300, the process of matching traffic rules may further include step 320:
[0079] S320, obtaining a call request from the service gateway, and matching traffic rules according to the application ID, service ID, call request source, open identifier, and operation identifier in the call request.
[0080] Specifically, when an application calls a service gateway, the gateway matches the traffic rules according to the application ID (APP_ID), service ID (ABILITY_ID), call source (IP), open identifier (OPEN_ID) and operation identifier (OPER_ID). Exemplarily, the embodiment includes the following seven steps:
[0081] (1) Select an application (APP_ID);
[0082] (2) Select the service (ABILITY_ID) under the application;
[0083] (3) Choose between leaky bucket or token bucket current limiting;
[0084] (4) Select the maximum number of times or bucket size (the number of tokens is set from process 1);
[0085] (5) Select the scope of action based on the service open identifier (OPEN_ID, which indicates whether the service is southbound or northbound);
[0086] (6) Finally, the specific current limiting triggering strategy is obtained, and OPER_ID is set to expansion or reduction operation;
[0087] (7) Set specific policy control conditions based on the source IP of the service call, for example, set no flow limit control for traffic from IP_A.
[0088] In some optional embodiments, in step S300, the process of executing the expansion and contraction action of the expansion mechanism includes the following steps S330 or S340:
[0089] Step S330: perform expansion and contraction actions according to the current limiting method of the leaky bucket;
[0090] Step S340: Execute expansion and contraction actions according to the current limiting method of the token bucket.
[0091] Specifically, in the embodiment, the corresponding algorithm is executed according to the flow limiting method (leaky bucket or token bucket). The leaky bucket forcibly limits the flow per unit time, which is the upper limit flow of the outbound flow. The request first enters the leaky bucket, and the leaky bucket discharges water at a fixed speed, that is, processes the request. When the water is added too quickly, it will overflow directly, that is, reject the request. It can be seen that the leaky bucket algorithm can forcibly limit the data transmission rate, thereby not allowing bursts.
[0092] The token bucket allows bursts, and the token bucket is used to limit the incoming traffic. The principle is that the system will put tokens into the bucket at a constant rate (for example, 100 per second). When the incoming requests do not reach 100, the token bucket will accumulate tokens until the maximum value of the bucket is reached. For example, if it is set to 500, the token bucket can handle a burst of 500 at a certain moment. It depends on whether the tokens in the bucket are exhausted. The larger the bucket size, the higher the burst degree allowed.
[0093] The following is a more detailed description of the technical solution of this application based on specific application scenarios:
[0094] In one embodiment, the API service gateway obtains the operating indicator results of the machine and service POD through the collection agent deployed on the service side, summarizes and generates time series data, and combines the operating data of the API service being called, including TPS, number of concurrent users, and response time, to capture the relationship between resources and service calls. Then, based on the machine learning model, simulation training is performed to obtain the bottleneck critical points of service call traffic, services, and host resources, and the corresponding indicator monitoring thresholds for flow limiting to trigger automatic expansion and contraction are formulated to form expansion and contraction strategies, which are updated to the control strategy library, and the granularity is refined to the control flow limiting method of a specific service in a certain time period.
[0095] In another embodiment, when large-scale high-concurrency business access occurs, it is often the case that services or interfaces are unavailable in the face of skyrocketing requests, and even a chain reaction may be triggered, causing the entire system to crash. The API service gateway currently supports leaky bucket algorithm and token bucket algorithm for flow rate control by setting flow limits for application, IP and other dimensions. The idea of the leaky bucket algorithm is very simple. Water (request) first enters the leaky bucket, and the leaky bucket discharges water at a certain speed. When the water inflow speed is too large, it will overflow directly. It can be seen that the leaky bucket algorithm can forcibly limit the data transmission rate. The principle of the token bucket algorithm is that the system will put tokens into the bucket at a constant speed, and if the request needs to be processed, it is necessary to obtain a token from the bucket first. When there is no token available in the bucket, the service is denied. The gateway system monitors traffic and load in real time, and automatically expands and shrinks when traffic and load do not match. According to business performance indicators and machine performance indicators, according to the preset machine learning model, the frequency of API calls is monitored. When a certain level is reached, the traffic entrance can be dynamically adjusted through the pre-set expansion and shrinking strategy to achieve automatic elastic flow control.
[0096] In a second aspect, the present application provides a high-concurrency automatic scaling system that can implement the method in the first aspect, the system comprising:
[0097] A data acquisition unit is used to acquire historical business data and extract business performance indicators and machine performance indicators from the historical business data;
[0098] A machine learning unit is used to predict indicator monitoring thresholds based on business performance indicators and machine performance indicators through a trained machine learning model;
[0099] The policy execution unit is used to match traffic rules, form an expansion mechanism according to traffic rules and indicator monitoring thresholds, and execute the expansion and contraction actions of the expansion mechanism.
[0100] In another implementation manner, the deployment of the automatic scaling capacity flow in the embodiment of the present application is as follows: Figure 2 As shown in the figure, its architecture is mainly divided into interface domain, demilitarized zone (DMZ) domain and core domain. The interface domain and DMZ domain mainly include traffic access layer and traffic analysis and distribution layer; IoT channel applications access the virtual server (Linux virtual server, LVS) of the traffic access layer through the network traffic gateway of the intranet through the virtual IP, and distribute the traffic to the API gateway of the core domain through the Nginx service of the traffic analysis and distribution layer. The API gateway sends the content of the traffic distribution and the read policy configuration cache to the smart gateway console of the core domain through the Netty service. In the smart gateway console, Redis performs cache loading according to the policy configuration cache.
[0101] In a third aspect, the technical solution of the present application also provides a high-concurrency automatic scaling computer device, which includes at least one processor; at least one memory, which is used to store at least one program; when the at least one program is executed by at least one processor, the at least one processor runs a high-concurrency automatic scaling method as in the first aspect.
[0102] An embodiment of the present invention further provides a storage medium storing a program, and the program is executed by a processor to implement the method in the first aspect.
[0103] From the above specific implementation process, it can be concluded that the technical solution provided by the present invention has the following advantages or strengths compared with the prior art:
[0104] 1. The automatic expansion and contraction strategy provided by the technical solution of this application realizes strict current limiting of the distributed system in the cluster environment and minimizes the performance loss of the system.
[0105] 2. The current limiting automatic expansion and contraction model in the technical solution of this application has self-learning capabilities. Once deployed, it can complete self-upgrade and iteration of the model without basically any human intervention.
[0106] 3. The data set of the technical solution of this application is derived from real data and includes business performance indicators and machine performance indicators. The longer the algorithm learning time, the better the business verification and operation and maintenance effects of this solution, and the more unique it is.
[0107] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0108] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0109] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0110] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0111] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0112] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A high-concurrency automatic expansion and contraction method, characterized in that: The method comprises the following steps: Acquire historical business data, and extract business performance indicators and machine performance indicators from the historical business data; wherein the business performance indicators are data values formed from the perspective of user operations, and the machine performance indicators are data values formed from the perspective of resource usage; The step of extracting the service performance index and the machine performance index from the historical service data comprises: classifying the historical service data according to key fields to obtain service performance index samples and machine performance index samples; According to the business performance indicator sample and the machine performance indicator sample, and according to the machine learning model, a resource critical point is obtained through a decision tree algorithm, and the indicator monitoring threshold is determined according to the resource critical point; The step of obtaining the resource critical point by using a decision tree algorithm includes: The current number of current limiting tokens is obtained by expanding the step size according to the preset number of tokens; According to the result set of the business performance indicators and the usage rate of the machine performance indicators, the credibility of the flow limiting strategy is calculated, the flow limiting strategy is determined according to the current number of flow limiting tokens, and the credibility includes the matching result between the service operation indicator result set, the machine operation indicator usage rate and the flow limiting strategy of the current number of flow limiting tokens; determine that the credibility meets the credibility threshold, and output the resource critical point, the resource critical point includes the traffic critical point, the business performance critical point and the machine performance critical point; Match the traffic rules, form an expansion mechanism according to the traffic rules and the indicator monitoring threshold, and execute the expansion and contraction actions of the expansion mechanism.
2. A high-concurrency automatic expansion and contraction method according to claim 1, characterized in that: Before executing the step of scaling up and down of the capacity expansion mechanism, the method further includes the following steps: Acquire a triggering strategy for the capacity expansion mechanism, and set a trigger according to the triggering strategy; According to the signaling of the trigger, the expansion and contraction actions of the expansion mechanism are executed.
3. A high-concurrency automatic expansion and contraction method according to claim 1, characterized in that: After executing the step of scaling up and down of the capacity expansion mechanism, the method further comprises the following steps: The current business data is periodically acquired, and the machine learning model is updated according to the current business data to obtain the updated indicator monitoring threshold.
4. A high-concurrency automatic expansion and contraction method according to claim 1, characterized in that: The step of matching traffic rules includes: The call request of the service gateway is obtained, and the traffic rule is matched according to the application ID, service ID, call request source, open identifier and operation identifier in the call request.
5. A high-concurrency automatic expansion and contraction method according to any one of claims 1 to 4, characterized in that: The execution of the expansion and contraction action of the expansion mechanism includes at least one of the following steps: Execute expansion and contraction actions based on the leaky bucket current limiting method; The capacity expansion and contraction actions are performed according to the current limiting method of the token bucket.
6. A high-concurrency automatic expansion and contraction system, characterized in that: include: A data acquisition unit is used to acquire historical business data, and extract business performance indicators and machine performance indicators from the historical business data; wherein the business performance indicators are data values formed from the perspective of user operations, and the machine performance indicators are data values formed from the perspective of resource usage; the step of extracting business performance indicators and machine performance indicators from the historical business data includes: classifying the historical business data according to key fields to obtain business performance indicator samples and machine performance indicator samples; A machine learning unit, configured to obtain a resource critical point through a decision tree algorithm according to the business performance indicator sample and the machine performance indicator sample and according to a machine learning model, and determine the indicator monitoring threshold according to the resource critical point; the step of obtaining the resource critical point through the decision tree algorithm includes: obtaining the current flow-limiting token number by expanding the step size according to a preset token number; calculating the credibility of the flow-limiting strategy according to the result set of the business performance indicator and the utilization rate of the machine performance indicator, the flow-limiting strategy is determined according to the current flow-limiting token number, and the credibility includes the matching result between the service operation indicator result set, the machine operation indicator utilization rate and the flow-limiting strategy of the current flow-limiting token number; determining that the credibility meets the credibility threshold, and outputting the resource critical point, the resource critical point includes the flow critical point, the business performance critical point and the machine performance critical point; The policy execution unit is used to match the traffic rules, form an expansion mechanism according to the traffic rules and the indicator monitoring threshold, and execute the expansion and contraction actions of the expansion mechanism.
7. A high-concurrency automatic expansion and contraction computer device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor runs a high-concurrency automatic scaling method as described in any one of claims 1-5.
8. A storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to run a high-concurrency automatic scaling method as described in any one of claims 1 to 5 when executed by the processor.
Citation Information
Patent Citations
Automatic intelligent capacity expansion and contraction method and system for server
CN113032157A