Request operation flow limiting method and device, computer equipment and readable storage medium
By predicting the concurrency amount and resource utilization rate of the requested operation, determining the target number limit value, the problem of inaccurate setting of the current limit value in the prior art is solved, and the current limit accuracy of the requested operation is improved.
Patent Information
- Application Number
- CN202411700495.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, when limiting the current flow to the requested operation of the server, the accuracy of setting the current limit value is low, resulting in a low accuracy of the current limit of the requested operation.
By obtaining the current time and request operation type, enter the concurrency prediction model and resource utilization prediction model, predict the concurrency and resource utilization, determine the target quantity limit value, and perform current limit processing according to this value.
This improves the current limit accuracy of requested operations, avoids the problem of manual setting of current limit values inaccurate enough, and ensures the stable operation of the server.
Smart Images

Figure CN119557097A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for request operation current limiting. Background Art
[0002] In order to avoid exhaustion of server resources and ensure stable operation of the server, it is necessary to limit the flow of request operations sent to the server.
[0003] In traditional technology, when the request operation sent to the server is subjected to flow control processing, the server's flow control value is generally set manually to limit the concurrency of the request operations sent to the server; however, different services consume different resources when processing different request operations, and the processing capabilities of different servers are also different. If the flow control value is set based on manual experience, the accuracy of the setting of the flow control value will be low, resulting in the inability to accurately flow control the request operation, thereby causing the flow control accuracy of the request operation to be low. Summary of the invention
[0004] Based on this, it is necessary to provide a request operation current limiting method, device, computer equipment, computer readable storage medium and computer program product that can improve the current limiting accuracy of request operations in response to the above technical problems.
[0005] In a first aspect, the present application provides a request operation current limiting method, comprising:
[0006] Get the request operation type for the target server at the current time;
[0007] Input the current time and the request operation type into a concurrency prediction model corresponding to the target server to obtain a predicted concurrency corresponding to the request operation type;
[0008] Inputting the requested operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the requested operation type;
[0009] Determining a target quantity limit value of the target server for the requested operation type at the current time according to a difference between the predicted resource usage rate and a target resource usage rate of the target server;
[0010] According to the target quantity limit value, the concurrency of the request operation type is limited.
[0011] In one embodiment, inputting the request operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain the predicted resource usage corresponding to the request operation type includes:
[0012] Determine a feature vector corresponding to the request operation type and the predicted concurrency;
[0013] Inputting the feature vector into a resource usage prediction model corresponding to the target server to obtain an initial resource usage corresponding to the requested operation type;
[0014] The predicted concurrency and the initial resource usage are multiplied to obtain the predicted resource usage corresponding to the requested operation type.
[0015] In one of the embodiments, the predicted resource usage rate includes a plurality of predicted sub-resource usage rates, and the target resource usage rate includes a target sub-resource usage rate corresponding to each predicted sub-resource usage rate;
[0016] The determining, according to the difference between the predicted resource usage rate and the target resource usage rate of the target server, a target quantity limit value of the target server for the requested operation type at the current time includes:
[0017] Filtering out the maximum predicted sub-resource usage rate from each predicted sub-resource usage rate;
[0018] Determining a quantity update ratio according to a ratio between a target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate and the maximum predicted sub-resource usage rate;
[0019] According to the quantity update ratio, the preset quantity limit value of the target server for the requested operation type at the current time is updated to obtain the target quantity limit value.
[0020] In one embodiment, the quantity update ratio is a quantity enlargement ratio or a quantity reduction ratio;
[0021] The determining the quantity update ratio according to the ratio between the target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate and the maximum predicted sub-resource usage rate includes:
[0022] In the case where each predicted sub-resource usage rate is less than the corresponding target sub-resource usage rate, determining the ratio as the quantity magnification ratio;
[0023] In the case where each predicted sub-resource usage rate is greater than the corresponding target sub-resource usage rate, the ratio is determined as the quantity reduction ratio.
[0024] In one embodiment, the concurrency prediction model corresponding to the target server is trained in the following manner:
[0025] Obtaining a sample request operation type for the target server at a sample time, and an actual concurrency corresponding to the sample request operation type;
[0026] Input the sample time and the sample request operation type into the concurrency prediction model to be trained to obtain the predicted concurrency corresponding to the sample request operation type;
[0027] According to the difference between the predicted concurrency corresponding to the sample request operation type and the actual concurrency, the concurrency prediction model to be trained is iteratively trained to obtain a concurrency prediction model corresponding to the target server.
[0028] In one embodiment, the resource usage prediction model corresponding to the target server is trained in the following manner:
[0029] Acquire a sample request operation type for the target server at a sample time, and an actual concurrency and an actual resource usage rate corresponding to the sample request operation type;
[0030] Inputting the sample request operation type and the actual concurrency into the resource usage prediction model to be trained to obtain the predicted resource usage corresponding to the sample request operation type;
[0031] According to the difference between the predicted resource utilization rate corresponding to the sample request operation type and the actual resource utilization rate, the resource utilization rate prediction model to be trained is iteratively trained to obtain a resource utilization rate prediction model corresponding to the target server.
[0032] In a second aspect, the present application further provides a request operation current limiting device, comprising:
[0033] A type acquisition module is used to obtain the type of request operation for the target server at the current time;
[0034] A first prediction module, configured to input the current time and the request operation type into a concurrency prediction model corresponding to the target server to obtain a predicted concurrency corresponding to the request operation type;
[0035] A second prediction module is used to input the request operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the request operation type;
[0036] a value determination module, configured to determine a target quantity limit value of the target server for the requested operation type at the current time according to a difference between the predicted resource usage rate and the target resource usage rate of the target server;
[0037] The current limiting processing module is used to perform current limiting processing on the concurrency of the request operation type according to the target quantity limit value.
[0038] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0039] Get the request operation type for the target server at the current time;
[0040] Input the current time and the request operation type into a concurrency prediction model corresponding to the target server to obtain a predicted concurrency corresponding to the request operation type;
[0041] Inputting the requested operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the requested operation type;
[0042] Determining a target quantity limit value of the target server for the requested operation type at the current time according to a difference between the predicted resource usage rate and a target resource usage rate of the target server;
[0043] According to the target quantity limit value, the concurrency of the request operation type is limited.
[0044] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0045] Get the request operation type for the target server at the current time;
[0046] Input the current time and the request operation type into a concurrency prediction model corresponding to the target server to obtain a predicted concurrency corresponding to the request operation type;
[0047] Inputting the requested operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the requested operation type;
[0048] Determining a target quantity limit value of the target server for the requested operation type at the current time according to a difference between the predicted resource usage rate and a target resource usage rate of the target server;
[0049] According to the target quantity limit value, the concurrency of the request operation type is limited.
[0050] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0051] Get the request operation type for the target server at the current time;
[0052] Input the current time and the request operation type into a concurrency prediction model corresponding to the target server to obtain a predicted concurrency corresponding to the request operation type;
[0053] Inputting the requested operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the requested operation type;
[0054] Determining a target quantity limit value of the target server for the requested operation type at the current time according to a difference between the predicted resource usage rate and a target resource usage rate of the target server;
[0055] According to the target quantity limit value, the concurrency of the request operation type is limited.
[0056] The above-mentioned request operation current limiting method, device, computer equipment, computer-readable storage medium and computer program product first obtain the request operation type for the target server at the current time, and then input the current time and the request operation type into the concurrency prediction model corresponding to the target server to obtain the predicted concurrency corresponding to the request operation type, and then input the request operation type and the predicted concurrency into the resource utilization prediction model corresponding to the target server to obtain the predicted resource utilization corresponding to the request operation type; finally, according to the difference between the predicted resource utilization and the target resource utilization of the target server, the target number limit value for the request operation type at the current time is determined, and the concurrency of the request operation type is current limited according to the target number limit value. In this way, when the concurrency of the request operation type for the target server at the current time is limited, the current time, the request operation type, the predicted concurrency corresponding to the current time and the request operation type, the predicted resource usage rate corresponding to the request operation type and the predicted concurrency, and the target resource usage rate of the target server are comprehensively considered, which is conducive to improving the accuracy of determining the target quantity limit value for the request operation type at the current time of the target server, and facilitating the accurate flow limitation of the concurrency of the request operation type for the target server at the current time, thereby improving the accuracy of the flow limitation of the request operation, avoiding the defect that the manually set flow limitation value is not accurate enough, resulting in a low flow limitation accuracy of the request operation. At the same time, using the concurrency prediction model corresponding to the target server to output the predicted concurrency corresponding to the request operation type, and using the resource usage prediction model corresponding to the target server to output the predicted resource usage rate corresponding to the request operation type, the determined target quantity limit value can be made more accurate, further improving the flow limitation accuracy of the request operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions 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 related drawings can be obtained based on these drawings without paying creative work.
[0058] Figure 1 A schematic diagram of a flow chart of a method for limiting current of a request operation in one embodiment;
[0059] Figure 2 A flowchart of a step of determining a predicted resource usage rate corresponding to a request operation type in one embodiment;
[0060] Figure 3 A flowchart of the training steps of a concurrency prediction model in one embodiment;
[0061] Figure 4 A schematic diagram of a flow chart of a training step of a resource usage prediction model in one embodiment;
[0062] Figure 5 A schematic diagram of a flow chart of a method for limiting current of a request operation in another embodiment;
[0063] Figure 6 A flowchart of a method for limiting the flow of an object storage service based on machine learning in one embodiment;
[0064] Figure 7 A structural block diagram of a current limiting device for requesting operation in one embodiment;
[0065] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0067] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0068] Theoretically, object storage services support unlimited storage space, but this requires continuous expansion of server capacity. As servers are put into use in batches and stages, their hardware resources vary and their request processing capabilities also vary. Different services also require different server resources, which must be used in a reasonable combination to maximize the use of hardware resources.
[0069] The services in object storage can be broadly divided into access request services and storage services. Of course, there are also background services and basic component services, which will not be described here. (1) Access request service: It needs to support a large number of concurrent requests and related business processing; when processing read object requests, it is necessary to pre-read and verify the correctness of the data, which relies on memory resources and CPU (Central Processing Unit) resources and occupies public network export bandwidth resources; when processing write object requests, it is also necessary to verify the correctness of the data, which relies on CPU resources and occupies public network entrance bandwidth resources; viewing object list requests consume server memory resources. (2) Storage service: Store object data and make it persistent; when processing read and write object requests, it is necessary to read and write files from the disk, which occupies the disk's read IO resources.
[0070] Different services consume different resources when processing different requests. At the same time, the processing capabilities of different servers are also different, resulting in different usage of server resources for different requests. When a service processes a request, each resource may become a bottleneck. When a resource bottleneck occurs, it may cause problems such as slow service response and unavailability. Therefore, it is necessary to introduce service flow control (referring to limiting the number of visits to a system or service to avoid system overload or resource exhaustion) to prevent requests from exhausting server resources. The flow control strategies are different for different servers and services. Different operations consume different resources. If flow control is not distinguished between operations, resource consumption cannot be accurately predicted, which will lead to excessive or insufficient resource utilization. A large number of small resource requests occupy a certain amount of resources, resulting in insufficient utilization of server resources; a large number of large resource requests cause a certain resource of the service to reach a bottleneck, resulting in service unavailability.
[0071] Conventional service-level request throttling does not distinguish between the consumption of service resources by different request operations. If the same request operation occurs at a certain time, for example, all read object operations, preloading objects may cause insufficient memory. At this time, throttling is required for specific request operations. Settings based on manual experience may not be accurate enough due to differences in performance of different servers.
[0072] In summary, conventional current limiting methods do not take into account the different consumption of server resources by each request type, and do not make detailed resource consumption predictions. They also do not take into account that the concurrency of each request type served will be different in different seasons and at different times, and more refined current limiting is required by time and request type. Therefore, this application introduces a machine learning method to predict the server resource consumption of different request operations; at the same time, the problem introduced is that it is necessary to know the number of different request operations in order to predict the total resource consumption of the server. Based on this, this application proposes a request operation current limiting method for improving the current limiting accuracy of request operations.
[0073] In an exemplary embodiment, Figure 1 As shown, a request operation current limiting method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, etc.; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0074] In this embodiment, the method includes the following steps S101 to S105. Among them:
[0075] Step S101, obtaining the request operation type for the target server at the current time.
[0076] The target server refers to the server that currently needs to be limited.
[0077] The current time refers to the sending timestamp of the current request operation to the target server, which may refer to morning, noon, afternoon, evening, or early morning, or may refer to a specific time point on a specific date, such as 17:50:15 on a certain day of a certain month.
[0078] The request operation type refers to the operation type of the request operation, such as a write object request, a read object request, etc. It should be noted that the request operation type can be represented by a sequence number, such as 0 for a write object request, 1 for a read object request, etc. The request operation refers to a request operation on a target server, specifically, a request operation on an object stored in the target server, such as a write object request operation, a read object request operation, etc.
[0079] Exemplarily, the terminal monitors the request operation for the target server at the current time to obtain a monitoring result, and determines the type of the request operation for the target server at the current time according to the monitoring result.
[0080] Step S102, input the current time and the requested operation type into a concurrency prediction model corresponding to the target server to obtain a predicted concurrency corresponding to the requested operation type.
[0081] Among them, the concurrency prediction model refers to the request operation type concurrency prediction model, which is used to predict the concurrency of the request operation type for the target server at the current time. In actual scenarios, the concurrency prediction model can refer to the LSTM (Long Short-Term Memory) model; the LSTM model can better capture and process long-term dependencies in time series data through the gating mechanism, which means that when processing tasks that require remembering long time interval information, the LSTM model can usually perform better; use time series-based prediction to complete the prediction of the concurrency of request operation types at a time point.
[0082] Among them, different servers correspond to different concurrency prediction models. For example, server A corresponds to concurrency prediction model 1, and server B corresponds to concurrency prediction model 2.
[0083] Among them, concurrency is usually used to describe the number of multiple tasks or requests processed by a system or application at a certain moment.
[0084] Among them, the predicted concurrency corresponding to the request operation type refers to the predicted concurrency corresponding to the request operation type for the target server at the current time, specifically refers to the predicted concurrency number of request operations under the request operation type for the target server at the current time, such as 100, 150, etc.
[0085] Exemplarily, the terminal queries the correspondence between the server and the concurrency prediction model to obtain the concurrency prediction model corresponding to the target server; then, feature extraction is performed on the current time and the request operation type to obtain a feature vector corresponding to the current time and the request operation type, such as feature extraction is performed on the current time and the request operation type to obtain a feature vector corresponding to the current time and a feature vector corresponding to the request operation type, and the feature vector corresponding to the current time and the feature vector corresponding to the request operation type are fused to obtain a first fused vector as the feature vector corresponding to the current time and the request operation type; finally, the feature vector corresponding to the current time and the request operation type is input into the concurrency prediction model corresponding to the target server, and concurrency prediction is performed on the feature vector through the concurrency prediction model to obtain the predicted concurrency corresponding to the request operation type for the target server at the current time.
[0086] For example, the terminal represents the current time as M and the request operation type as 1, thereby obtaining a feature vector [M, 1] corresponding to the current time and the request operation type, and then inputs the feature vector [M, 1] into the concurrency prediction model corresponding to the target server to obtain the predicted concurrency corresponding to the request operation type, such as 100.
[0087] Step S103: input the requested operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the requested operation type.
[0088] The resource utilization prediction model is used to predict the resource utilization corresponding to the request operation type for the target server at the current time. In actual scenarios, the resource utilization prediction model can refer to a neural network linear regression model; the neural network linear regression model can better adapt to the potential complex relationships in the data, and can learn the nonlinear features in the data through multiple layers of neurons, thereby improving the prediction accuracy. The traditional linear regression algorithm may not be able to capture the nonlinear relationship in the data well. Therefore, in this case, the neural network linear regression model is more suitable for modeling and predicting resource utilization.
[0089] Among them, different servers correspond to different resource utilization prediction models. For example, server A corresponds to resource utilization prediction model 1, server B corresponds to resource utilization prediction model 2, and so on.
[0090] Among them, resource utilization refers to the server resource utilization, such as CPU utilization, memory utilization, disk I / O (input and output) utilization, network I / O (input and output) utilization, etc.
[0091] Among them, the predicted resource utilization rate corresponding to the requested operation type refers to the predicted resource utilization rate corresponding to the requested operation type for the target server at the current time, which is used to characterize the predicted utilization of the server resources of the target server for the requested operation type for the target server at the current time, such as the predicted CPU utilization rate is 80%, the predicted memory utilization rate is 70%, the predicted disk I / O utilization rate is 60%, the predicted network I / O utilization rate is 50%, etc.
[0092] Exemplarily, the terminal queries the correspondence between the server and the resource utilization prediction model to obtain the resource utilization prediction model corresponding to the target server; then, feature extraction is performed on the request operation type and the predicted concurrency to obtain a feature vector corresponding to the request operation type and the predicted concurrency, for example, feature extraction is performed on the request operation type and the predicted concurrency to obtain a feature vector corresponding to the request operation type and a feature vector corresponding to the predicted concurrency, and the feature vector corresponding to the request operation type and the feature vector corresponding to the predicted concurrency are fused to obtain a second fused vector as the feature vector corresponding to the request operation type and the predicted concurrency; finally, the feature vector corresponding to the request operation type and the predicted concurrency is input into the resource utilization prediction model corresponding to the target server, and resource utilization prediction is performed on the feature vector through the resource utilization prediction model to obtain the predicted resource utilization corresponding to the request operation type for the target server at the current time.
[0093] For example, the terminal represents the request operation type as 1 and the predicted concurrency as 100, thereby obtaining a feature vector [1, 100] corresponding to the request operation type and the predicted concurrency. The feature vector [1, 100] is then input into the resource utilization prediction model corresponding to the target server to obtain the predicted resource utilization corresponding to the request operation type, such as the predicted CPU utilization of 80%, the predicted memory utilization of 70%, the predicted disk I / O utilization of 60%, the predicted network I / O utilization of 50%, etc.
[0094] Step S104: determining a target quantity limit value of the target server for the requested operation type at the current time according to the difference between the predicted resource usage rate and the target resource usage rate of the target server.
[0095] Among them, the target resource utilization rate of the target server refers to the target value or upper limit of the resource utilization rate of the target server, such as the target CPU utilization rate is 80% to ensure the normal operation of the system; the target memory utilization rate is 80% to avoid frequent swapping; the target disk I / O utilization rate is 70% to maintain sufficient I / O capacity of the disk and avoid I / O waiting; the target network I / O utilization rate is 80% to reserve sufficient bandwidth.
[0096] The target quantity limit value refers to the limit value of the concurrent quantity of request operations of the target server under the same request operation type at the current time, such as 80, 120, etc.
[0097] Among them, the target quantity limit values of the target server for different request operation types at different times are different and need to be dynamically updated.
[0098] Among them, the difference between the predicted resource utilization and the target resource utilization of the target server includes the difference between the predicted CPU utilization and the target CPU utilization, the difference between the predicted memory utilization and the target memory utilization, the difference between the predicted disk I / O utilization and the target disk I / O utilization, the difference between the predicted network I / O utilization and the target network I / O utilization, etc.
[0099] According to the difference between the predicted resource usage rate and the target resource usage rate of the target server, the target quantity limit value of the target server for the requested operation type at the current time is reasonably set.
[0100] Exemplarily, the terminal obtains the target resource utilization of the target server from the local database, and calculates the difference between the predicted resource utilization and the target resource utilization of the target server, and then queries the correspondence between the difference and the quantity limit value based on the difference between the predicted resource utilization and the target resource utilization of the target server, and obtains the quantity limit value corresponding to the difference as the target quantity limit value of the target server for the requested operation type at the current time.
[0101] For example, when the predicted resource utilization rate is less than the target resource utilization rate of the target server, the current quantity limit value is adjusted slightly higher to obtain the target quantity limit value of the target server for the requested operation type at the current time; when the predicted resource utilization rate is greater than or equal to the target resource utilization rate of the target server, the current quantity limit value is adjusted slightly lower to obtain the target quantity limit value of the target server for the requested operation type at the current time.
[0102] Step S105: According to the target quantity limit value, the concurrency of the request operation type is limited.
[0103] Among them, current limiting processing refers to controlling the concurrent number of request operations under the request operation type for the target server at the current time below the target number limit value to avoid server overload.
[0104] Exemplarily, the terminal performs corresponding current limiting processing on the concurrent number of request operations under the request operation type for the target server at the current time according to the target number limit value, so as to control the concurrent number of request operations under the request operation type for the target server at the current time below the target number limit value, so as to ensure the stable operation of the server.
[0105] For example, assuming that the target quantity limit value is 120, the concurrent number of request operations under the request operation type for the target server at the current time is controlled below 120.
[0106] In the above-mentioned request operation limiting method, the request operation type for the target server at the current time is first obtained, and then the current time and the request operation type are input into the concurrency prediction model corresponding to the target server to obtain the predicted concurrency corresponding to the request operation type, and then the request operation type and the predicted concurrency are input into the resource utilization prediction model corresponding to the target server to obtain the predicted resource utilization corresponding to the request operation type; finally, based on the difference between the predicted resource utilization and the target resource utilization of the target server, the target number limit value for the request operation type at the current time is determined, and the concurrency of the request operation type is limited according to the target number limit value. In this way, when the concurrency of the request operation type for the target server at the current time is limited, the current time, the request operation type, the predicted concurrency corresponding to the current time and the request operation type, the predicted resource usage rate corresponding to the request operation type and the predicted concurrency, and the target resource usage rate of the target server are comprehensively considered, which is conducive to improving the accuracy of determining the target quantity limit value for the request operation type at the current time of the target server, and facilitating the accurate flow limitation of the concurrency of the request operation type for the target server at the current time, thereby improving the accuracy of the flow limitation of the request operation, avoiding the defect that the manually set flow limitation value is not accurate enough, resulting in a low flow limitation accuracy of the request operation. At the same time, using the concurrency prediction model corresponding to the target server to output the predicted concurrency corresponding to the request operation type, and using the resource usage prediction model corresponding to the target server to output the predicted resource usage rate corresponding to the request operation type, the determined target quantity limit value can be made more accurate, further improving the flow limitation accuracy of the request operation.
[0107] In an exemplary embodiment, Figure 2 As shown, the above step S103, inputs the requested operation type and the predicted concurrency into the resource usage prediction model corresponding to the target server to obtain the predicted resource usage corresponding to the requested operation type, including the following steps S201 to S203. Among them:
[0108] Step S201, determining a feature vector corresponding to the request operation type and the predicted concurrency.
[0109] Step S202: input the feature vector into a resource usage prediction model corresponding to the target server to obtain an initial resource usage corresponding to the requested operation type.
[0110] Step S203: multiply the predicted concurrency and the initial resource usage rate to obtain the predicted resource usage rate corresponding to the requested operation type.
[0111] The initial resource utilization rate refers to the resource utilization rate corresponding to a single request operation under the request operation type, such as the initial CPU utilization rate is 0.8%, the initial memory utilization rate is 0.7%, the initial disk I / O utilization rate is 0.6%, the initial network I / O utilization rate is 0.5%, etc.
[0112] Among them, the predicted resource utilization rate corresponding to the request operation type is obtained by multiplying the predicted concurrency and the initial resource utilization rate. For example, if the predicted concurrency is 100, the predicted CPU utilization rate is 80% (100×0.8%), the predicted memory utilization rate is 70% (100×0.7%), the predicted disk I / O utilization rate is 60 (100×0.6%), and the predicted network I / O utilization rate is 50% (100×0.5%).
[0113] Exemplarily, the terminal performs feature extraction processing on the request operation type and predicted concurrency through a feature extraction model to obtain a feature vector corresponding to the request operation type and the predicted concurrency, and then inputs the feature vector into a resource utilization prediction model corresponding to the target server, and performs resource utilization prediction processing on the feature vector through the resource utilization prediction model to obtain an initial resource utilization rate corresponding to the request operation type; finally, the predicted concurrency and the initial resource utilization rate are multiplied to obtain the predicted resource utilization rate corresponding to the request operation type, that is, predicted concurrency × initial resource utilization rate.
[0114] In this embodiment, the request operation type and the predicted concurrency are comprehensively considered, and the resource utilization prediction model corresponding to the target server is used to output the predicted resource utilization corresponding to the request operation type, which is beneficial to improving the accuracy of determining the predicted resource utilization, so that the target quantity limit value subsequently determined based on the predicted resource utilization is more accurate.
[0115] In an exemplary embodiment, the predicted resource utilization rate includes multiple predicted sub-resource utilization rates, and the target resource utilization rate includes a target sub-resource utilization rate corresponding to each predicted sub-resource utilization rate; then, the above-mentioned step S104, based on the difference between the predicted resource utilization rate and the target resource utilization rate of the target server, determines the target quantity limit value of the target server for the requested operation type at the current time, specifically including the following contents: from each predicted sub-resource utilization rate, screen out the largest predicted sub-resource utilization rate; determine the quantity update ratio based on the ratio between the target sub-resource utilization rate corresponding to the largest predicted sub-resource utilization rate and the largest predicted sub-resource utilization rate; according to the quantity update ratio, update the preset quantity limit value of the target server for the requested operation type at the current time to obtain the target quantity limit value.
[0116] The predicted sub-resource usage rate refers to the predicted CPU usage rate, the predicted memory usage rate, the predicted disk I / O usage rate, the predicted network I / O usage rate, etc.
[0117] The target sub-resource usage rate refers to the target CPU usage rate, the target memory usage rate, the target disk I / O usage rate, the target network I / O usage rate, etc.
[0118] The quantity update ratio refers to the update ratio of the preset quantity limit value of the target server for the requested operation type at the current time, which can be greater than 1 or less than 1.
[0119] Among them, the quantity update ratio is equal to the ratio between the target sub-resource utilization rate corresponding to the maximum predicted sub-resource utilization rate and the maximum predicted sub-resource utilization rate; for example, the maximum predicted sub-resource utilization rate is the predicted CPU utilization rate (60%), and the corresponding target sub-resource utilization rate is the target CPU utilization rate (80%), then the quantity update ratio = 80% / 60% = 1.33.
[0120] The preset quantity limit value refers to a pre-set quantity limit value, such as 80, 70, etc.
[0121] Wherein, target quantity limit value = preset quantity limit value × quantity update ratio.
[0122] Exemplarily, the terminal filters out the maximum predicted sub-resource usage rate from each predicted sub-resource usage rate, and filters out the target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate from the target sub-resource usage rate, and then calculates the ratio between the target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate and the maximum predicted sub-resource usage rate as the quantity update ratio; finally, obtains the preset quantity limit value of the target server for the requested operation type at the current time, and updates the preset quantity limit value according to the quantity update ratio to obtain the updated quantity limit value as the target quantity limit value (i.e., preset quantity limit value × quantity update ratio).
[0123] For example, if the preset quantity limit value is 100, the maximum predicted sub-resource usage is the predicted CPU usage (60%), and the corresponding target sub-resource usage is the target CPU usage (80%), then the quantity update ratio = 80% / 60% = 1.33, and the target quantity limit value = 100×1.33 = 133. For example, if the maximum predicted sub-resource usage is the predicted CPU usage (90%), and the corresponding target sub-resource usage is the target CPU usage (80%), then the quantity update ratio = 80% / 90% = 0.89, and the target quantity limit value = 100×0.89 = 89.
[0124] In this embodiment, comprehensive consideration of the maximum predicted sub-resource utilization rate and the target sub-resource utilization rate corresponding to the maximum predicted sub-resource utilization rate is beneficial to improving the accuracy of determining the quantity update ratio, thereby making the target quantity limit value determined based on the quantity update ratio more accurate, which is beneficial to the subsequent precise flow control of the concurrency of the request operation type.
[0125] In an exemplary embodiment, the quantity update ratio is a quantity enlargement ratio or a quantity reduction ratio; then, the quantity update ratio is determined according to the ratio between the target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate and the maximum predicted sub-resource usage rate, which specifically includes the following contents: when each predicted sub-resource usage rate is less than the corresponding target sub-resource usage rate, the ratio is determined as the quantity enlargement ratio; when each predicted sub-resource usage rate is greater than the corresponding target sub-resource usage rate, the ratio is determined as the quantity reduction ratio.
[0126] The quantity amplification ratio refers to the amplification ratio of the preset quantity limit value of the target server for the request operation type at the current time, such as 1.33. When each predicted sub-resource usage rate is less than the corresponding target sub-resource usage rate, the quantity update ratio is the quantity amplification ratio.
[0127] The quantity reduction ratio refers to the reduction ratio of the preset quantity limit value of the target server for the requested operation type at the current time, such as 0.89. When each predicted sub-resource usage rate is greater than the corresponding target sub-resource usage rate, or when some predicted sub-resource usage rates are greater than the corresponding target sub-resource usage rates and some predicted sub-resource usage rates are less than the corresponding target sub-resource usage rates, the quantity update ratio is the quantity reduction ratio.
[0128] Exemplarily, the terminal compares each predicted sub-resource usage rate with the target sub-resource usage rate corresponding to each predicted sub-resource usage rate. When each predicted sub-resource usage rate is less than the corresponding target sub-resource usage rate, the terminal calculates the ratio between the target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate and the maximum predicted sub-resource usage rate as the quantity magnification ratio, such as 1.33; when each predicted sub-resource usage rate is greater than the corresponding target sub-resource usage rate, or when some predicted sub-resource usage rates are greater than the corresponding target sub-resource usage rates and some predicted sub-resource usage rates are less than the corresponding target sub-resource usage rates, the terminal calculates the ratio between the target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate and the maximum predicted sub-resource usage rate as the quantity reduction ratio, such as 0.89.
[0129] For example, the predicted CPU usage is 60%, the predicted memory usage is 50%, the predicted disk I / O usage is 40%, and the predicted network I / O usage is 30%. The target CPU usage is 80%, the target memory usage is 80%, the target disk I / O usage is 70%, and the target network I / O usage is 80%. Each predicted sub-resource usage is less than the corresponding target sub-resource usage, and the maximum predicted sub-resource usage is the predicted CPU usage (60%), and the corresponding target sub-resource usage is the target CPU usage (80%). Then the quantity magnification ratio = 80% / 60% = 1.33. For example, the predicted CPU usage is 90%, the predicted memory usage is 85%, the predicted disk I / O usage is 75%, and the predicted network I / O usage is 85%. This means that each predicted sub-resource usage is greater than the corresponding target sub-resource usage, and the maximum predicted sub-resource usage is the predicted CPU usage (90%), and the corresponding target sub-resource usage is the target CPU usage (80%). Then the quantity reduction ratio = 80% / 90% = 0.89.
[0130] In this embodiment, the quantity enlargement ratio or quantity reduction ratio is determined based on the comparison between each predicted sub-resource utilization rate and the corresponding target sub-resource utilization rate, which is conducive to accurately enlarging or reducing the preset quantity limit value of the target server for the requested operation type at the current time, thereby rationally utilizing the server resources, avoiding server overload, and thereby improving the server resource utilization.
[0131] In an exemplary embodiment, Figure 3 As shown, the request operation current limiting method provided by the present application also includes a training step of a concurrent volume prediction model corresponding to the target server, including the following steps S301 to S303. Among them:
[0132] Step S301, obtaining a sample request operation type for a target server at a sample time, and an actual concurrency corresponding to the sample request operation type.
[0133] Step S302: input the sample time and the sample request operation type into the concurrency prediction model to be trained to obtain the predicted concurrency corresponding to the sample request operation type.
[0134] Step S303, according to the difference between the predicted concurrency corresponding to the sample request operation type and the actual concurrency, the concurrency prediction model to be trained is iteratively trained to obtain a concurrency prediction model corresponding to the target server.
[0135] Among them, the concurrency prediction model corresponding to each server is trained separately.
[0136] The concurrency prediction model to be trained refers to the LSTM model.
[0137] Exemplarily, the terminal collects sample request operation types for the target server at the sample time, and the actual concurrency corresponding to the sample request operation type, then performs feature extraction processing on the sample time and the sample request operation type to obtain a sample feature vector corresponding to the sample time and the sample request operation type, and then inputs the sample feature vector corresponding to the sample time and the sample request operation type into the concurrency prediction model to be trained, and performs concurrency prediction processing on the sample feature vector through the concurrency prediction model to be trained to obtain the predicted concurrency corresponding to the sample request operation type for the target server at the sample time; finally, according to the difference between the predicted concurrency corresponding to the sample request operation type and the actual concurrency, calculates a first loss value, and according to the first loss value, iteratively trains the concurrency prediction model to be trained until the first loss value obtained by the trained concurrency prediction model is less than the first preset threshold, then stops training, and uses the trained concurrency prediction model as the concurrency prediction model corresponding to the target server.
[0138] It should be noted that the training process of the concurrency prediction model corresponding to each server is consistent with the training process of the concurrency prediction model corresponding to the target server, and will not be repeated here.
[0139] In this embodiment, the concurrency prediction model to be trained is iteratively trained using sample time and sample request operation type, so that the predicted concurrency output by the concurrency prediction model corresponding to the target server can be more accurate, thereby improving the accuracy of determining the target quantity limit value.
[0140] In an exemplary embodiment, Figure 4 As shown, the request operation current limiting method provided by the present application also includes a training step of a resource usage prediction model corresponding to the target server, including the following steps S401 to S403. Among them:
[0141] Step S401, obtaining sample request operation types for a target server at a sample time, and actual concurrency and actual resource usage corresponding to the sample request operation types.
[0142] Step S402: input the sample request operation type and the actual concurrency into the resource usage prediction model to be trained to obtain the predicted resource usage corresponding to the sample request operation type.
[0143] Step S403, iteratively training the resource utilization prediction model to be trained according to the difference between the predicted resource utilization corresponding to the sample request operation type and the actual resource utilization, to obtain a resource utilization prediction model corresponding to the target server.
[0144] Among them, the resource utilization prediction model corresponding to each server is trained separately.
[0145] The resource utilization rate prediction model to be trained refers to a neural network linear regression model.
[0146] Exemplarily, the terminal collects sample request operation types for the target server at the sample time, as well as the actual concurrency and actual resource utilization corresponding to the sample request operation types, then performs feature extraction processing on the sample request operation types and the actual concurrency to obtain sample feature vectors corresponding to the sample request operation types and the actual concurrency, then inputs the sample feature vectors corresponding to the sample request operation types and the actual concurrency into the resource utilization prediction model to be trained, performs resource utilization prediction processing on the sample feature vectors through the resource utilization prediction model to be trained, and obtains the predicted resource utilization corresponding to the sample request operation types for the target server at the sample time; finally, according to the difference between the predicted resource utilization corresponding to the sample request operation types and the actual resource utilization, calculates the second loss value, and according to the second loss value, iteratively trains the resource utilization prediction model to be trained until the second loss value obtained by the trained resource utilization prediction model is less than the second preset threshold, then stops the training, and uses the trained resource utilization prediction model as the resource utilization prediction model corresponding to the target server.
[0147] It should be noted that the training process of the resource utilization prediction model corresponding to each server is consistent with the training process of the resource utilization prediction model corresponding to the target server, and will not be repeated here.
[0148] In this embodiment, the resource utilization prediction model to be trained is iteratively trained using sample request operation types and actual concurrency, so that the predicted resource utilization output by the resource utilization prediction model corresponding to the target server can be more accurate, thereby improving the accuracy of determining the target quantity limit value.
[0149] In an exemplary embodiment, Figure 5 As shown, another request operation current limiting method is provided, and the method is applied to a terminal as an example for explanation, including the following steps S501 to S512. Among them:
[0150] Step S501, obtaining sample request operation types for a target server at a sample time, and actual concurrency and actual resource usage corresponding to the sample request operation types.
[0151] Step S502: Input the sample time and sample request operation type into the concurrency prediction model to be trained to obtain the predicted concurrency corresponding to the sample request operation type; and iteratively train the concurrency prediction model to be trained based on the difference between the predicted concurrency corresponding to the sample request operation type and the actual concurrency to obtain a concurrency prediction model corresponding to the target server.
[0152] Step S503, input the sample request operation type and the actual concurrency into the resource utilization prediction model to be trained to obtain the predicted resource utilization corresponding to the sample request operation type; according to the difference between the predicted resource utilization corresponding to the sample request operation type and the actual resource utilization, the resource utilization prediction model to be trained is iteratively trained to obtain the resource utilization prediction model corresponding to the target server.
[0153] Step S504: Obtain the request operation type for the target server at the current time.
[0154] Step S505 , input the current time and the requested operation type into a concurrency prediction model corresponding to the target server to obtain a predicted concurrency corresponding to the requested operation type.
[0155] Step S506: determine a feature vector corresponding to the requested operation type and the predicted concurrency.
[0156] Step S507: input the feature vector into a resource usage prediction model corresponding to the target server to obtain an initial resource usage corresponding to the requested operation type.
[0157] Step S508, multiplying the predicted concurrency and the initial resource usage rate to obtain the predicted resource usage rate corresponding to the requested operation type; the predicted resource usage rate includes a plurality of predicted sub-resource usage rates.
[0158] Step S509: Filter out the maximum predicted sub-resource usage rate from each predicted sub-resource usage rate.
[0159] Step S510, determining a quantity update ratio according to a ratio between a target sub-resource utilization rate corresponding to a maximum predicted sub-resource utilization rate and the maximum predicted sub-resource utilization rate; the quantity update ratio is a quantity enlargement ratio or a quantity reduction ratio.
[0160] Step S511: updating the preset quantity limit value of the target server for the requested operation type at the current time according to the quantity update ratio, and obtaining the target quantity limit value of the target server for the requested operation type at the current time.
[0161] Step S512: According to the target quantity limit value, the concurrent quantity of the request operation type for the target server at the current time is limited.
[0162] In the above-mentioned request operation current limiting method, when the current limiting process is performed on the concurrency of the request operation type for the target server at the current time, the current time, the request operation type, the predicted concurrency corresponding to the current time and the request operation type, the predicted resource utilization rate corresponding to the request operation type and the predicted concurrency, and the target resource utilization rate of the target server are comprehensively considered, which is conducive to improving the accuracy of determining the target quantity limit value for the request operation type at the current time of the target server, and facilitating the accurate current limiting of the concurrency of the request operation type for the target server at the current time, thereby improving the current limiting accuracy of the request operation, avoiding the defect that the manually set current limiting value is not accurate enough, resulting in a low current limiting accuracy of the request operation. At the same time, using the concurrency prediction model corresponding to the target server to output the predicted concurrency corresponding to the request operation type, and using the resource utilization prediction model corresponding to the target server to output the predicted resource utilization rate corresponding to the request operation type, the determined target quantity limit value can be made more accurate, further improving the current limiting accuracy of the request operation.
[0163] In order to more clearly illustrate the request operation current limiting method provided in the embodiment of the present application, the request operation current limiting method is specifically described below with a specific embodiment. In an exemplary embodiment, Figure 6 As shown, this application also proposes a method for limiting the flow of object storage services based on machine learning. This method uses a machine learning algorithm to predict the concurrency of each request type at different times on the one hand, and the consumption of server resources by each request type on the other hand. The flow limiting configuration is calculated based on the resource consumption and concurrency of the request type, and the service flow limiting is configured in real time to achieve reasonable utilization of resources. Specifically, the method includes the following steps:
[0164] Step 1: Use machine learning to predict the resource consumption of each request operation type.
[0165] The purpose of this step is to accurately predict the resource consumption of each request operation type; collect request data of each request type as a training data set; record server resource usage at time points, including CPU, memory, disk I / O, network I / O resource usage, each request operation type and quantity. Due to the different processing capabilities of servers, data from different servers need to be collected separately, and the models also need to be trained separately. The request operation type is represented by: service_operation. For example, the read object operation for requesting access to the service is api_getObject, and the write object operation for requesting access to the service is api_putObject. Sort out a list of all operations, number the request operation types starting from 0, and use numbers to represent the request operation type; the request operation type and the corresponding concurrency are used as training parameter inputs.
[0166] In terms of model selection, a neural network linear regression model is selected for training. Input: request operation type and corresponding concurrency; represented by a vector, the first digit of the vector represents the operation type, and the second digit represents the concurrency; for example: [1,100] represents an operation with a request operation type of 1 and a concurrency of 100. Output: CPU, memory, disk I / O, network I / O usage; represented by a vector, for example: [0.65, 0.55, 0.62, 0.52], using decimals to represent the above usage in sequence. Algorithm: neural network linear regression.
[0167] Use the collected data set for training to obtain a model. Based on the model, the resource consumption of specific request operations can be completed. The prediction result is for a specific server; the data of each server needs to be trained separately. The above can complete the prediction of resource usage of a specified service request operation type in the server.
[0168] Step 2: Use machine learning to predict the concurrency of request operation types at a given time point.
[0169] Due to different time periods and cycles, the concurrency of each request operation type is different. For example, objects stored on video websites are read in large quantities after get off work and before rest; and for the photo backup function, the uploaded photo objects are generally backed up in the second half of the night after people rest. Request operations are not only affected by the time of day, but also by seasonality. For example, in seasons with suitable weather or long holidays, people's outdoor activities will increase, and the probability of taking photos will increase. For object storage services, the concurrency of each request type of the service is different in different seasons and cycles. It is difficult to predict the accurate current limit value using manual or simple calculations, so the LSTM model is introduced.
[0170] Since it is necessary to support seasonality, prediction of concurrent requests of different types at different time points, it is necessary to collect long-term request log data, including at least one year of data, so that data of all seasons can be included. Training based on this data set can complete seasonal prediction. Collect historical request data, including timestamp, request type, and concurrent volume. The parameter representation method of the request operation type is the same as that of the resource consumption prediction. Different servers perform their own data collection and training.
[0171] During the model training process, input: time, request operation type; output: concurrency of request operation type; algorithm: LSTM.
[0172] The concurrent volume of request operation types is recorded in the server at regular intervals and the data is collected. Model training is performed based on the collected data. The trained LSTM model can be used to predict the concurrent volume of each request type at a certain point in time on the server.
[0173] Step 3: Based on the resource utilization prediction model and the request type concurrency prediction model, configure the existing limited flow configuration in real time.
[0174] Since the number of concurrent requests received by the service is constantly changing, the amount of current limiting cannot be fixed and needs to be set at regular intervals. First, based on the concurrent request prediction model, the current concurrent request volume is predicted; then based on the resource utilization prediction model, the resource consumption of the request type is predicted; finally, based on the concurrent request volume multiplied by the resource consumption of the request type, the consumption of each hardware resource is calculated. The following are the upper limit target values for each resource:
[0175] CPU: Usage is capped at 80%.
[0176] Memory: Usage is capped at 80%.
[0177] Disk I / O: Usage limit is 70%.
[0178] Network I / O: Usage is capped at 80%.
[0179] If the predicted resource consumption is below the target, the number of request types will be proportionally increased by the ratio between the target value corresponding to the hardware resource with the highest resource utilization and the hardware resource with the highest resource utilization. If the predicted resource consumption is above the target, the number of request types will be proportionally reduced by the ratio between the target value corresponding to the hardware resource with the highest resource utilization and the hardware resource with the highest resource utilization.
[0180] The calculated number of request types is used as the number of current limits and set in the current limit configuration of the service to limit the concurrency of each request type. This application combines the resource consumption prediction of each request type on different servers with the prediction of each request type at different times. Based on the results of the two predictions, the current limit configuration actually required is calculated to solve the problem of different current limit configurations on different servers and at different time points.
[0181] The above-mentioned object storage service flow limiting method based on machine learning predicts the consumption of server resources by each request type, predicts the concurrency of each request type in different seasons and at different times, and combines the two machine learning prediction results to adjust the server flow limiting configuration in real time, so that server resources can be used reasonably, thereby improving server resource utilization and achieving the purpose of precise flow limiting.
[0182] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0183] Based on the same inventive concept, the embodiment of the present application also provides a request operation current limiting device for implementing the request operation current limiting method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more request operation current limiting device embodiments provided below can refer to the limitations of the request operation current limiting method above, and will not be repeated here.
[0184] In an exemplary embodiment, Figure 7 As shown, a request operation current limiting device is provided, including: a type acquisition module 710, a first prediction module 720, a second prediction module 730, a value determination module 740 and a current limiting processing module 750, wherein:
[0185] The type acquisition module 710 is used to acquire the type of the request operation for the target server at the current time.
[0186] The first prediction module 720 is used to input the current time and the request operation type into the concurrency prediction model corresponding to the target server to obtain the predicted concurrency corresponding to the request operation type.
[0187] The second prediction module 730 is used to input the request operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the request operation type.
[0188] The value determination module 740 is used to determine the target quantity limit value of the target server for the requested operation type at the current time according to the difference between the predicted resource usage rate and the target resource usage rate of the target server.
[0189] The current limiting processing module 750 is used to perform current limiting processing on the concurrency of the request operation type according to the target quantity limit value.
[0190] In an exemplary embodiment, the second prediction module 730 is also used to determine a feature vector corresponding to the requested operation type and the predicted concurrency; input the feature vector into a resource utilization prediction model corresponding to the target server to obtain an initial resource utilization corresponding to the requested operation type; multiply the predicted concurrency and the initial resource utilization to obtain a predicted resource utilization corresponding to the requested operation type.
[0191] In an exemplary embodiment, the predicted resource usage rate includes a plurality of predicted sub-resource usage rates, and the target resource usage rate includes a target sub-resource usage rate corresponding to each predicted sub-resource usage rate;
[0192] The numerical determination module 740 is also used to filter out the maximum predicted sub-resource usage rate from each predicted sub-resource usage rate; determine the quantity update ratio based on the ratio between the target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate and the maximum predicted sub-resource usage rate; and update the preset quantity limit value of the target server for the requested operation type at the current time according to the quantity update ratio to obtain the target quantity limit value.
[0193] In an exemplary embodiment, the quantity update ratio is a quantity enlargement ratio or a quantity reduction ratio;
[0194] The numerical determination module 740 is also used to determine the ratio as the quantity enlargement ratio when each predicted sub-resource utilization rate is less than the corresponding target sub-resource utilization rate; and to determine the ratio as the quantity reduction ratio when each predicted sub-resource utilization rate is greater than the corresponding target sub-resource utilization rate.
[0195] In an exemplary embodiment, the request operation current limiting device also includes a first training module, which is used to obtain the sample request operation type for the target server at the sample time, and the actual concurrency corresponding to the sample request operation type; the sample time and the sample request operation type are input into the concurrency prediction model to be trained to obtain the predicted concurrency corresponding to the sample request operation type; according to the difference between the predicted concurrency corresponding to the sample request operation type and the actual concurrency, the concurrency prediction model to be trained is iteratively trained to obtain the concurrency prediction model corresponding to the target server.
[0196] In an exemplary embodiment, the request operation current limiting device also includes a second training module, which is used to obtain the sample request operation type for the target server at the sample time, as well as the actual concurrency and actual resource utilization corresponding to the sample request operation type; the sample request operation type and the actual concurrency are input into the resource utilization prediction model to be trained to obtain the predicted resource utilization corresponding to the sample request operation type; according to the difference between the predicted resource utilization corresponding to the sample request operation type and the actual resource utilization, the resource utilization prediction model to be trained is iteratively trained to obtain the resource utilization prediction model corresponding to the target server.
[0197] Each module in the above-mentioned request operation current limiting device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0198] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, a request operation current limiting method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0199] Those skilled in the art will understand that Figure 8The 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.
[0200] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0201] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0202] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0203] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0204] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0205] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A request operation current limiting method, characterized in that: The method comprises: Get the request operation type for the target server at the current time; Input the current time and the request operation type into a concurrency prediction model corresponding to the target server to obtain a predicted concurrency corresponding to the request operation type; Inputting the requested operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the requested operation type; Determining a target quantity limit value of the target server for the requested operation type at the current time according to a difference between the predicted resource usage rate and a target resource usage rate of the target server; According to the target quantity limit value, the concurrency of the request operation type is limited.
2. The method according to claim 1, characterized in that: The step of inputting the request operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the request operation type includes: Determine a feature vector corresponding to the request operation type and the predicted concurrency; Inputting the feature vector into a resource usage prediction model corresponding to the target server to obtain an initial resource usage corresponding to the requested operation type; The predicted concurrency and the initial resource usage are multiplied to obtain the predicted resource usage corresponding to the requested operation type.
3. The method according to claim 1, characterized in that The predicted resource usage rate includes a plurality of predicted sub-resource usage rates, and the target resource usage rate includes a target sub-resource usage rate corresponding to each predicted sub-resource usage rate; The determining, according to the difference between the predicted resource usage rate and the target resource usage rate of the target server, a target quantity limit value of the target server for the requested operation type at the current time includes: Filtering out the maximum predicted sub-resource usage rate from each predicted sub-resource usage rate; Determining a quantity update ratio according to a ratio between a target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate and the maximum predicted sub-resource usage rate; According to the quantity update ratio, the preset quantity limit value of the target server for the requested operation type at the current time is updated to obtain the target quantity limit value.
4. The method according to claim 3, characterized in that The quantity update ratio is a quantity enlargement ratio or a quantity reduction ratio; The determining the quantity update ratio according to the ratio between the target sub-resource usage rate corresponding to the maximum predicted sub-resource usage rate and the maximum predicted sub-resource usage rate includes: In the case where each predicted sub-resource usage rate is less than the corresponding target sub-resource usage rate, determining the ratio as the quantity magnification ratio; In the case where each predicted sub-resource usage rate is greater than the corresponding target sub-resource usage rate, the ratio is determined as the quantity reduction ratio.
5. The method according to any one of claims 1 to 4, characterized in that: The concurrency prediction model corresponding to the target server is trained in the following way: Obtaining a sample request operation type for the target server at a sample time, and an actual concurrency corresponding to the sample request operation type; Input the sample time and the sample request operation type into the concurrency prediction model to be trained to obtain the predicted concurrency corresponding to the sample request operation type; According to the difference between the predicted concurrency corresponding to the sample request operation type and the actual concurrency, the concurrency prediction model to be trained is iteratively trained to obtain a concurrency prediction model corresponding to the target server.
6. The method according to any one of claims 1 to 4, characterized in that: The resource usage prediction model corresponding to the target server is trained in the following way: Acquire a sample request operation type for the target server at a sample time, and an actual concurrency and an actual resource usage rate corresponding to the sample request operation type; Inputting the sample request operation type and the actual concurrency into the resource usage prediction model to be trained to obtain the predicted resource usage corresponding to the sample request operation type; According to the difference between the predicted resource utilization rate corresponding to the sample request operation type and the actual resource utilization rate, the resource utilization rate prediction model to be trained is iteratively trained to obtain a resource utilization rate prediction model corresponding to the target server.
7. A request operation current limiting device, characterized in that: The device comprises: A type acquisition module is used to obtain the type of request operation for the target server at the current time; A first prediction module, configured to input the current time and the request operation type into a concurrency prediction model corresponding to the target server to obtain a predicted concurrency corresponding to the request operation type; A second prediction module is used to input the request operation type and the predicted concurrency into a resource usage prediction model corresponding to the target server to obtain a predicted resource usage corresponding to the request operation type; a value determination module, configured to determine a target quantity limit value of the target server for the requested operation type at the current time according to a difference between the predicted resource usage rate and the target resource usage rate of the target server; The current limiting processing module is used to perform current limiting processing on the concurrency of the request operation type according to the target quantity limit value.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.