Methods, apparatus, equipment and storage media for resource scheduling
By using load prediction and capacity models to predict and analyze resource scheduling in cloud data centers, the complexity and lag issues of resource scheduling in cloud data centers are solved, making resource scheduling simple and efficient and improving resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE ONLINE SERVICES CO LTD
- Filing Date
- 2021-04-02
- Publication Date
- 2026-05-05
AI Technical Summary
In existing technologies, the resource scheduling methods of cloud data centers are complex and have lag, resulting in low resource utilization and an inability to effectively schedule and manage various business service resources.
By pre-setting load prediction and capacity models, the QPS metric data of the target business service is directly predicted and analyzed to determine the number of Pods required within the predicted time period, and resources are scheduled according to resource usage conditions to achieve reasonable and convenient scheduling of container resources.
It improves resource scheduling efficiency, enhances the overall resource utilization of the service, simplifies the resource scheduling process, and avoids the need for differentiated analysis of business service types.
Smart Images

Figure CN115185649B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and in particular relates to a method, apparatus, device and computer storage medium for resource scheduling. Background Technology
[0002] With the development of cloud computing technology and the improvement of cloud service capabilities, deploying business systems to cloud data centers or cloud platforms can help operators better integrate and manage business service resources.
[0003] Typically, cloud data centers integrate different services using virtualization technologies such as virtual machines and containers. By scheduling and managing container resources, the resource utilization of cloud data centers can be guaranteed to a certain extent. However, the resource scheduling methods in these technologies have some drawbacks, such as complex task scheduling and certain lags in scheduling execution. These shortcomings can lead to ineffective scheduling and management of various business service resources, negatively impacting overall resource utilization. Summary of the Invention
[0004] This application provides a method, apparatus, device, and computer storage medium for resource scheduling, which makes resource scheduling more reasonable and convenient, improves resource scheduling efficiency, and thus enhances the overall resource utilization rate of the service.
[0005] In a first aspect, embodiments of this application provide a resource scheduling method, including:
[0006] Get the first query rate (QPS) per second for the target business service to be predicted within a preset first time period;
[0007] Based on the first QPS, a second QPS for a preset prediction time period is determined using a preset load prediction model;
[0008] Based on the second QPS, the number of first Pods corresponding to the second QPS is determined using a preset capacity model, wherein the preset capacity model is trained and determined based on sample data of the business services.
[0009] Based on the first number of Pods and preset resource usage conditions, schedule the resources of the target business service.
[0010] Optionally, before determining the second QPS for the prediction period based on the first QPS using a preset load prediction model, the method further includes:
[0011] When the storage device is detected to not store the target service, the third QPS of the target service is obtained for a preset second time period, wherein the preset second time period includes the preset first time period.
[0012] Based on the third QPS and the preset load prediction algorithm, a load prediction model is trained as the preset load prediction model.
[0013] Optionally, the preset capacity model includes a first feature recognition model and a second feature recognition model; the step of determining the number of first Pods corresponding to the second QPS using the preset capacity model based on the second QPS includes:
[0014] The second QPS is input into the first feature recognition model of the preset capacity model to obtain the first feature information of the second QPS;
[0015] The second QPS is input into the second feature recognition model of the preset capacity model to obtain the second feature information of the second QPS;
[0016] Based on the first feature information and the second feature information, determine the resource usage corresponding to the second QPS;
[0017] Based on the resource usage and the preset container resource quota information, the number of first Pods corresponding to the second QPS is calculated.
[0018] Optionally, the first feature recognition model includes a neural network model; the second feature recognition model includes a linear regression model.
[0019] Optionally, the preset resource usage conditions include a preset upper limit threshold and a lower limit threshold for the number of Pods corresponding to the target resource usage. The step of scheduling resources for the target service based on the first number of Pods and the preset resource usage conditions includes:
[0020] When the number of the first Pods is greater than or equal to the upper limit threshold of the number of Pods, the resources of the target business service are expanded.
[0021] When the number of the first Pods is less than the lower limit threshold of the number of Pods, the resources of the target business service are scaled down.
[0022] Optionally, when the number of the first Pods is greater than or equal to the upper limit threshold for the number of Pods, the resource expansion for the target business service includes:
[0023] When the number of the first Pods is greater than or equal to the preset upper limit threshold for the number of Pods to be expanded, the resources of the target service are expanded according to the preset upper limit threshold for the number of Pods to be expanded.
[0024] Optionally, when the number of the first Pods is less than the lower limit threshold for the number of Pods, the resources of the target service are scaled down, including:
[0025] When the number of the first Pods is less than the preset lower limit threshold for the number of Pods to be scaled down, the resources of the target service are scaled down according to the preset lower limit threshold for the number of Pods to be scaled down.
[0026] Optionally, the resources for scheduling the target service further include:
[0027] Obtain the preset scheduling start time, which includes the expansion start time and the reduction start time;
[0028] The resources of the target service are scheduled according to the preset scheduling start time.
[0029] Optionally, the resources for scheduling the target service further include:
[0030] Obtain the scheduling priority level of the target service;
[0031] The resources of the target service are scheduled according to the scheduling priority level.
[0032] Optionally, the method further includes:
[0033] The number of second Pods in real time is determined based on the real-time resource usage and preset container resource quota information.
[0034] Based on the second number of Pods and the preset resource usage conditions, schedule the resources of the target business service.
[0035] Secondly, embodiments of this application provide a resource scheduling apparatus, the apparatus comprising:
[0036] The acquisition module is used to acquire the first query rate (QPS) per second of the target business service to be predicted within a preset first time period.
[0037] The first determining module is used to determine the second QPS for a preset prediction time period based on the first QPS using a preset load prediction model;
[0038] The second determining module is used to determine the number of first Pods corresponding to the second QPS based on the second QPS and using a preset capacity model, wherein the preset capacity model is determined by training based on sample data of the business service.
[0039] The scheduling module is used to schedule the resources of the target business service according to the first number of Pods and preset resource usage conditions.
[0040] Thirdly, embodiments of this application provide a resource scheduling device, the device including: a processor and a memory storing computer program instructions;
[0041] When the processor executes the computer program instructions, it implements the resource scheduling method as described in the first aspect and optionally in the first aspect.
[0042] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the resource scheduling method described in the first aspect and optionally in the first aspect.
[0043] The resource scheduling method, apparatus, device, and computer storage medium of this application embodiment can perform load prediction analysis on the QPS of a target service using a preset load prediction model to obtain a second QPS for the predicted time period. Then, a preset capacity model is used to perform capacity identification analysis on the second QPS to obtain a first POD number corresponding to the second QPS, i.e., the number of PODs required for the target service within the predicted time period. Finally, based on the first POD number and preset resource control conditions, the resources of the service are scheduled. Therefore, based on the solution of this application, without analyzing and distinguishing the type of the target service, the scheduling strategy can be determined directly by predicting and analyzing the obtained target service QPS index data, thus achieving effective container resource scheduling. Resource scheduling is more reasonable and convenient, improving resource scheduling efficiency and thereby enhancing the overall resource utilization of the service. Attached Figure Description
[0044] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a flowchart illustrating a resource scheduling method provided in some embodiments of this application;
[0046] Figure 2 This is a flowchart illustrating the process of determining the number of first Pods in a resource scheduling method provided in some embodiments of this application;
[0047] Figure 3 This is a schematic diagram illustrating the determination of a preset capacity model in a resource scheduling method provided in some embodiments of this application;
[0048] Figure 4 This is a schematic diagram of the process of scheduling target business service resources in the resource scheduling method provided in some embodiments of this application;
[0049] Figure 5 This is a schematic diagram of a cloud platform architecture in which the resource scheduling method provided in some embodiments of this application is applied;
[0050] Figure 6This is a schematic diagram of the load prediction model provided in some embodiments of this application;
[0051] Figure 7 This is a schematic diagram illustrating the process of determining scaling up or down in the resource scheduling method provided in some embodiments of this application;
[0052] Figure 8 This is a schematic diagram of a resource scheduling apparatus provided in some embodiments of this application;
[0053] Figure 9 This is a schematic diagram of the hardware structure of a resource scheduling device provided in some embodiments of this application. Detailed Implementation
[0054] The features and exemplary embodiments of various aspects of this application will now be described in detail. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain this application and are not configured to limit this application. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples of this application.
[0055] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0056] In relevant technical solutions, container resource scheduling mainly utilizes intervention in the allocation of online and offline resources to achieve dynamic balance between them, thereby improving overall resource utilization and reducing investment costs. First, it's necessary to identify whether a business service belongs to the online or offline service type. Then, based on the analysis of business load monitoring data, it's determined whether the service is periodic, further assessing the service's resource usage. Based on this assessment, resource scheduling is performed, ultimately achieving a dynamic balance between online and offline service resources.
[0057] However, the typical approach is to determine the type of business service by monitoring and comparing read / write requests and response time thresholds. This method offers some tolerance for errors when differentiating business types. Furthermore, there needs to be a corresponding safeguard plan for incorrectly identified data, which is often cumbersome and has poor practical effectiveness. Additionally, the calculation of resource usage for periodic online services, non-periodic online services, and offline services is primarily based on resource usage prediction and load forecasting. This requires separate forecasting for all types of business services, making the prediction and resource scheduling processes quite complex.
[0058] To address the problems in the prior art, embodiments of this application provide a method, apparatus, device, and computer storage medium for resource scheduling, which enables resource scheduling to be more rational and convenient, improves resource scheduling efficiency, and thereby enhances the overall resource utilization rate of the service.
[0059] The following description, with reference to the accompanying drawings, describes a resource scheduling method, apparatus, device, and computer storage medium according to embodiments of this application. It should be noted that these embodiments are not intended to limit the scope of this application.
[0060] The resource scheduling method provided in the embodiments of this application will be described below.
[0061] Figure 1 This is a flowchart illustrating a resource scheduling method provided in some embodiments of this application. For example... Figure 1 As shown in some embodiments of this application, the resource scheduling method may include the following steps:
[0062] S101: Obtain the first QPS of the target business service to be predicted for the preset first time period.
[0063] The target business services may include application systems. Examples include mobile app systems, billing systems, customer relationship management systems, business data application systems, and so on.
[0064] The query rate per second (QPS) of the target business service can be determined based on pre-acquired target business service logs or service request volume data.
[0065] In some embodiments of this application, the preset first time period can be the current time period. The obtained first query rate per second (QPS) can be the QPS obtained in the current time period.
[0066] S102: Based on the first QPS, use a preset load prediction model to determine the second QPS for a preset prediction time period.
[0067] For example, the preset prediction time period can be a future time period after the preset first time period. For instance, if the preset first time period is from 5:00 PM to 6:30 PM, the preset prediction time period can be from 7:00 PM to 8:00 PM.
[0068] The pre-defined load prediction model can be trained and determined using historical performance metrics data of the target business service. For example, performance metrics may include QPS data and average response time data.
[0069] In some embodiments of this application, before determining the second QPS of the prediction period based on the first QPS using a preset load prediction model, information about the target service to be predicted can be obtained, and it can be detected whether the storage device has already stored the target service.
[0070] When the storage device is not found to be storing the target service, the third QPS of the target service within a preset second time period is obtained. The preset second time period includes the preset first time period. Based on the third QPS and a preset load prediction algorithm, a load prediction model is trained as the preset load prediction model.
[0071] Storage devices may include storage devices of systems or servers that perform resource scheduling methods, such as database servers.
[0072] The second preset time period can be a historical time period that includes the first preset time period. The third QPS can be historical QPS sample data for the target business service.
[0073] Preset load prediction algorithms may include the Holt-Winters algorithm and the Long Short-Term Memory (LSTM) algorithm.
[0074] In some embodiments of this application, when obtaining historical sample data of the target business service and training the load prediction model, the model can first be trained using candidate preset load prediction algorithms. Then, the load prediction algorithm with the smallest model error index is selected as the load prediction model algorithm. The load prediction model is trained according to this load prediction model algorithm, and the trained load prediction model is used as the preset load prediction model.
[0075] S103: Based on the second QPS, use the preset capacity model to determine the number of first Pods corresponding to the second QPS.
[0076] The preset capacity model is determined by training on sample data of the target business service. The sample data of the target business service may include timestamps, QPS, the number of Pods corresponding to the service, service resource utilization (CPU utilization and memory utilization) or service resource usage (CPU usage and memory usage), and container quotas.
[0077] A Pod is the smallest and simplest unit that can be created and deployed in Kubernetes. Kubernetes is a container orchestration engine that supports automated deployment, massive scalability, and containerized application management. A Pod represents a unit of deployment: a single instance of an application in Kubernetes, which may consist of resources shared by a single container or multiple containers. A Pod can include one or more containers. Resource management generally involves managing the compute resources of Pods.
[0078] S104: Based on the first Pod number and preset resource usage conditions, schedule resources for the target business service.
[0079] In summary, the resource scheduling method of this application embodiment can perform load prediction analysis on the QPS of the target service using a preset load prediction model to obtain a second QPS for the predicted time period. Then, a preset capacity model is used to perform capacity identification analysis on the second QPS to obtain a first POD number corresponding to the second QPS, i.e., the number of PODs required for the target service within the predicted time period. Finally, resources for the service are scheduled based on the first POD number and preset resource control conditions.
[0080] Therefore, based on the solution of this application, without analyzing and distinguishing the type of target business service, the scheduling strategy can be determined by directly predicting and analyzing the QPS index data of the acquired target business service, which can achieve effective container resource scheduling. Resource scheduling is more reasonable and convenient, improving resource scheduling efficiency and thus improving the overall resource utilization of the service.
[0081] In some embodiments of this application, the preset capacity model may include a first feature recognition model and a second feature recognition model, such as... Figure 2 As shown, Figure 2 This is a flowchart illustrating the process of determining the number of first Pods in a resource scheduling method provided in some embodiments of this application. Determining the number of first Pods corresponding to the second QPS can be implemented in step S103 as follows:
[0082] S201: Input the second QPS into the first feature recognition model of the preset capacity model to obtain the first feature information of the second QPS.
[0083] In some embodiments of this application, the first feature recognition model may include a neural network model. The first feature information may be the correspondence between the second QPS and CPU and memory resource usage.
[0084] S202: Input the second QPS into the second feature recognition model of the preset capacity model to obtain the second feature information of the second QPS.
[0085] The second feature recognition model can include a linear regression model. The second feature information can be the correspondence between the second QPS and CPU and memory resource usage.
[0086] S203: Determine the resource usage corresponding to the second QPS based on the first feature information and the second feature information.
[0087] The resource usage corresponding to the second QPS can be the CPU and memory resource usage required under the input second QPS.
[0088] S204: Calculate the number of Pods corresponding to the second QPS based on resource usage and preset container resource quota information.
[0089] The preset container resource quota information may include the preset CPU target utilization, container CPU quota, and memory target utilization and container memory quota. The number of Pods corresponding to the second QPS can be calculated using the following formula (1):
[0090] Number of Pods = MAX(CPU resource usage required ÷ (CPU target utilization × container CPU quota), Memory resource usage required ÷ (Memory target utilization × container memory quota)) (1)
[0091] In some embodiments of this application, such as Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the determination of a preset capacity model in a resource scheduling method provided in some embodiments of this application. The preset capacity model is determined by training based on sample data of the target service. The process of determining the preset capacity model may include:
[0092] First, obtain sample data of the target business service and perform data preprocessing.
[0093] Then, the neural network model is trained to determine its characteristics. For example, the neural network model can be a feedforward neural network.
[0094] The neural network model is trained using resource usage data under different load gradients. This neural network model can be a four-layer model. The structure of the neural network may include: an input layer with one neuron for input sample data X; an output layer with one neuron for outputting resource usage Y; and two hidden layers, each with 64 neurons. In a fully connected neural network, each neuron is connected to neurons in the next layer, and each connection is associated with a weight. The weights can be determined through iterative training of the model.
[0095] During training, the neural network receives input data and initializes weights. After calculating each input vector, it generates a prediction result, which is then compared to the actual result. The difference between the two is the error term, which is used for backpropagation to correct the weights in the network. The rate at which the weights are updated is called the learning rate, which is typically a value between 0 and 1. Training of the neural network model is complete when a preset training termination condition is met. The preset training termination condition may include the error falling below a preset threshold or reaching the maximum number of training iterations.
[0096] By using a trained neural network model, the correlation between the second QPS and CPU and memory resource usage can be obtained.
[0097] Next, establish a linear regression model. Linear regression fits the linear relationship between input and output variables by establishing a linear equation on the observed data. If there is more than one input variable, multiple linear regression is used to fit the relationship. For example, the linear regression model can be a univariate linear regression model. Use the linear regression model to fit the sample data, that is, the linear relationship between service request volume and resource usage. As shown in formula (2):
[0098] L s =wx+b (2)
[0099] L s denoted by , where x represents the input sample data, and w and b represent the weighting coefficients.
[0100] The established linear regression model can be used to obtain the correspondence between the second QPS and the usage of CPU and memory resources.
[0101] Finally, the neural network and linear regression model are combined to determine the model weights and thus establish the final capacity model.
[0102] A combined capacity model based on a neural network model and a linear regression model is established, and the trained neural network model is N. s The weights are w1, and the linear regression model is L. s The weight is w2. The combined capacity model formula (3) is:
[0103] F s =w1*N s +w2*L s (3)
[0104] By combining neural network models and linear regression models, a predefined capacity model can be constructed.
[0105] In some embodiments of this application, the root mean square error (RMSE) can be used as the standard for measuring the prediction results of the capacity model, which is more sensitive to outliers. It is understood that other error calculation methods, such as RMSE, can be selected according to actual needs.
[0106] In summary, in this embodiment, the preset capacity model can be a capacity identification model combining a neural network model and a linear regression model, which can more accurately identify and determine the correspondence between the QPS and the number of Pods for the target business service. Based on this, the required number of Pods for the target business service can be predicted more accurately, improving the efficiency and rationality of resource scheduling, thereby improving the overall resource utilization of the service system.
[0107] In some embodiments of this application, the preset resource usage conditions include a preset upper limit threshold and a preset lower limit threshold for the number of Pods corresponding to the target resource usage. The operation of scheduling resources for the target service includes either expanding or shrinking the resources of the target service.
[0108] like Figure 4 As shown, Figure 4 This is a schematic diagram of the process of scheduling target service resources in the resource scheduling method provided in some embodiments of this application. S104 in the foregoing embodiments can be implemented as follows:
[0109] S401: Compare the first Pod with the upper and lower thresholds for the number of Pods.
[0110] S402: When the number of the first Pod is greater than or equal to the upper limit threshold of the number of Pods, the resources of the target business service are expanded.
[0111] In some embodiments of this application, when the first number of Pods is greater than or equal to the upper limit threshold for the number of Pods, and it is determined that a resource expansion operation will be performed, a preset upper limit threshold for the number of Pods to be expanded can also be obtained; and the first number of Pods is compared with the preset upper limit threshold for the number of Pods to be expanded.
[0112] When the number of the first Pod is greater than or equal to the preset upper limit threshold for the number of Pods to be expanded, the resources of the target business service are expanded according to the preset upper limit threshold for the number of Pods to be expanded.
[0113] When the number of the first Pod is less than the preset upper limit threshold for the number of Pods to be expanded, the resources of the target business service are expanded according to the number of the first Pod.
[0114] S403: When the number of the first Pod is less than the lower limit threshold of the number of Pods, the resources of the target business service are scaled down.
[0115] In some embodiments of this application, when the first number of Pods is less than the lower limit threshold for the number of Pods and it is determined that a resource scaling-down operation will be performed, a preset lower limit threshold for the number of Pods to be scaled down can also be obtained; and the first number of Pods is compared with the preset lower limit threshold for the number of Pods to be scaled down.
[0116] When the number of the first Pod is less than the preset lower limit threshold for the number of Pods to be scaled down, the resources of the target business service are scaled down according to the preset lower limit threshold for the number of Pods to be scaled down.
[0117] When the number of the first Pod is greater than or equal to the preset lower limit threshold for the number of Pods to be scaled down, the resources of the target business service are scaled down according to the number of the first Pod.
[0118] In some embodiments of this application, scheduling resources for the target service further includes:
[0119] Obtain the preset scheduling start time, which includes the expansion start time and the reduction start time.
[0120] Based on the expansion start time, initiate resource expansion for the target business services.
[0121] Based on the scaling-down start time, initiate resource scaling-down for the target business service.
[0122] The capacity expansion start time can be set earlier than the preset prediction time period. For example, if the preset prediction time period is 18:00 to 19:00, the capacity expansion start time can be set to 17:50.
[0123] The scaling down start time can be set to a time later than the start time of the preset prediction period. For example, if the preset prediction period is from 6 PM to 7 PM, the scaling down start time can be set to 6:15 PM.
[0124] Based on this, performing the expansion operation of the target business service in advance, or the reduction operation of the target business service in a delayed manner, can further ensure the stability of the target business service operation while effectively achieving resource scheduling.
[0125] In some embodiments of this application, scheduling resources for the target service further includes:
[0126] Obtain the scheduling priority level of the target service. Based on the scheduling priority level, schedule the resources for the target service.
[0127] If the target service has a high scheduling priority, then the resources of that target service can be scheduled first.
[0128] In some embodiments of this application, the resource scheduling method further includes:
[0129] The number of second Pods in real time is determined based on the obtained real-time resource usage and preset container resource quota information.
[0130] Based on the number of second Pods and preset resource usage conditions, schedule resources for the target business service.
[0131] Preset container resource quota information may include preset CPU target utilization, container CPU quota, memory target utilization, container memory quota, etc.
[0132] If the number of Pods required for the target service cannot be predicted using the load prediction model and capacity model, or if corresponding scaling decisions cannot be obtained, the real-time resource usage and preset container resource quota information can be used to calculate the real-time second number of Pods. Based on the real-time second number of Pods and the preset resource usage conditions in the aforementioned embodiments, a resource scheduling strategy is determined. This resource scheduling strategy is then used to scale up or down the target service. This approach avoids resource scheduling even when predictions are distorted, ensuring the stability of the target service.
[0133] To clearly illustrate the resource scheduling method of this application embodiment, the resource scheduling method will now be described in detail with reference to application scenarios.
[0134] Figure 5 This is a schematic diagram of a cloud platform architecture in which the resource scheduling method provided in some embodiments of this application is applied. For example... Figure 5 As shown, the cloud platform system 100 may include a functional module 110, a log platform 120, a monitoring system 130, a data storage 140, an ElasticSearch 150, and an object storage 160.
[0135] In some embodiments of this application, functional module 110 may include management and control, regulation and execution, application profiling, data acquisition, and evaluation modules. Data storage 140 may include MySQL and Redis.
[0136] In some embodiments of this application, management control mainly performs functions such as access control, cluster management, service management, regulation management, configuration management, and scheduled tasks.
[0137] The control and execution module can obtain historical monitoring data for corresponding periods from ElasticSearch, and analyze the application service system and hosts according to rules based on the monitoring data to determine whether to perform operations such as scaling up, scaling down, or migration.
[0138] Application profiling or service profiling can analyze the application's resource usage, load profile, application type, application priority, and other information based on historical data of the application service system using corresponding algorithms, providing support for subsequent application deployment, service classification, and scenario analysis.
[0139] To meet the requirements of larger scale, automation, and scalability, the data acquisition module can use Prometheus + node-exporter to acquire data from large-scale server clusters and integrate the acquired data into ElasticSearch.
[0140] The evaluation module can use algorithms to compare and analyze historical and predicted data, and correct model errors based on the comparison and analysis results to ensure the accuracy of model predictions.
[0141] In some embodiments of this application, the resource scheduling method first performs load forecasting on the target service to be forecasted. Specifically, based on a preset load forecasting model, a first QPS forecast of the target service to be forecasted for a preset first time period is obtained to obtain the forecast result.
[0142] In some embodiments of this application, such as Figure 6 As shown, Figure 6 This is a schematic flowchart illustrating the load prediction model provided in some embodiments of this application. The load prediction model process in this resource scheduling method includes the following steps:
[0143] S61: Obtain data on the target business service to be predicted.
[0144] For example, data on the target business service to be predicted can be obtained from MySQL.
[0145] S62: Determine if the data has been obtained.
[0146] S63: Call the functional module interface to obtain all information data of the target business service to be predicted.
[0147] S64: The optimal algorithm for selecting the model.
[0148] Here, the candidate algorithms may include the Holt-Winter algorithm and the LSTM algorithm.
[0149] S65: Save the target business services to be predicted.
[0150] For example, the target business service to be predicted can be saved in MySQL.
[0151] S66: Use a preset load forecasting model for forecasting.
[0152] S67: Output the prediction results.
[0153] The output prediction results can be used for capacity prediction and identification. The prediction results can also be saved to Elasticsearch. The prediction results may include a second QPS corresponding to the prediction time period.
[0154] The pseudocode for the load forecasting process is as follows, where the data to be forecasted is the target business service:
[0155] (1) Obtain the data of the object to be predicted and parse it into a prediction object. The structure of the object to be predicted is predict_object:
[0156]
[0157] (2) Check if the object to be predicted already exists in the MySQL table of the profiling module. If it exists, return the complete information of the object to be predicted. The complete information structure of the object to be predicted is as follows:
[0158] If it does not exist, it means that the prediction object is a new prediction object. In this case, the relevant interface of the main module is called to obtain the relevant data of the service. The complete information structure of the relevant data is as follows:
[0159]
[0160]
[0161] (3) If the object to be predicted exists in the mysql table of the portrait module in step (2), then the model object is constructed using the two attribute values of algorithm and modelParams.
[0162] If the object to be predicted does not exist in the mysql table of the portrait module in step (2), then the algorithm selection program is executed to obtain the optimal prediction algorithm model for the object to be predicted.
[0163] Step (3) Obtain the algorithm model and use the time period data corresponding to History_data_long to form input_data.
[0164] Using input_data as input to the algorithm model, predicting future Forcast_long index values, and processing the model's output predictions into {time, value} format.
[0165] Store the prediction results in Elasticsearch (ES).
[0166] Next, based on the load forecast results, the number of Pods corresponding to the second QPS can be determined using a preset capacity model. It can be understood that the preset capacity model can be used to obtain the required number of Pods corresponding to the load QPS during the forecast period.
[0167] Then, the first number of Pods is compared with the upper and lower thresholds for the number of Pods corresponding to the target resource usage. Based on the comparison results, resources for the target business service are scheduled. Figure 7 This is a schematic diagram illustrating the process of determining scaling up or down in the resource scheduling method provided in some embodiments of this application. For example... Figure 7 As shown, the specific comparison process includes the following steps:
[0168] When the number of the first Pod is greater than or equal to the upper limit threshold for the number of Pods, the resources for the target business service are expanded. Then, the preset upper limit threshold for the number of Pods to be expanded is obtained; the number of the first Pod is compared with the preset upper limit threshold for the number of Pods to be expanded.
[0169] When the number of the first Pod is greater than or equal to the preset upper limit threshold for the number of Pods to be expanded, the resources of the target business service are expanded according to the preset upper limit threshold for the number of Pods to be expanded.
[0170] When the number of the first Pod is less than the preset upper limit threshold for the number of Pods to be expanded, the resources of the target business service are expanded according to the number of the first Pod.
[0171] When the number of the first Pod is less than the lower limit threshold of the number of Pods, the resources of the target business service are scaled down.
[0172] Then, obtain the preset lower limit threshold for the number of Pods to be scaled down, and compare the first number of Pods with the preset lower limit threshold for the number of Pods to be scaled down.
[0173] When the number of the first Pod is less than the preset lower limit threshold for the number of Pods to be scaled down, the resources of the target business service are scaled down according to the preset lower limit threshold for the number of Pods to be scaled down.
[0174] When the number of the first Pod is greater than or equal to the preset lower limit threshold for the number of Pods to be scaled down, the resources of the target business service are scaled down according to the number of the first Pod.
[0175] Furthermore, in some embodiments of this application, if the corresponding scaling up / down decision cannot be obtained through the load prediction model and capacity model, a resource regulation method that calculates real-time resource usage can be used to scale up or down the service.
[0176] Based on the acquired real-time resource usage and preset container resource quota information, the real-time number of the second Pod is determined. Resources for the target service are then scheduled based on the second Pod number and preset resource usage conditions. Specifically, the second Pod number can be compared with the upper and lower thresholds for the number of Pods corresponding to the target resource usage. The second Pod number is the real-time number of Pods calculated using the acquired real-time resource usage and preset container resource quota information.
[0177] When the number of the second Pod is greater than or equal to the maximum Pod count threshold, the resources for the target business service are scaled up. Then, the preset maximum Pod count threshold for scaling up is obtained; the number of the second Pod is compared with the preset maximum Pod count threshold for scaling up.
[0178] When the number of second Pods is greater than or equal to the preset upper limit threshold for the number of Pods to be expanded, the resources of the target business service are expanded according to the preset upper limit threshold for the number of Pods to be expanded.
[0179] When the number of second Pods is less than the preset upper limit threshold for the number of Pods to be expanded, the resources of the target business service are expanded according to the number of second Pods.
[0180] When the number of second Pods is less than the lower limit threshold of the number of Pods, the resources for the target business service are scaled down.
[0181] Then, obtain the preset lower limit threshold for the number of Pods to be scaled down; compare the second number of Pods with the preset lower limit threshold for the number of Pods to be scaled down.
[0182] When the number of second Pods is less than the preset lower limit threshold for the number of Pods to be scaled down, the resources of the target business service are scaled down according to the preset lower limit threshold for the number of Pods to be scaled down.
[0183] When the number of second Pods is greater than or equal to the preset lower limit threshold for the number of Pods to be scaled down, the resources of the target business service are scaled down according to the number of second Pods.
[0184] In some embodiments of this application, after obtaining the first number of Pods and the second number of Pods, the larger of the first number of Pods and the second number of Pods can be selected and compared with the upper limit threshold and the lower limit threshold of the number of Pods corresponding to the target resource usage to determine the scheduling strategy for the target business service.
[0185] Preset container resource quota information may include preset CPU target utilization, container CPU quota, and memory target utilization and container memory quota.
[0186] In some embodiments of this application, for preset container resource quota data, the following percentile parameters need to be set first:
[0187] Target CPU utilization targetCPUPercent = 0.6
[0188] The target CPU utilization lower bound (lowerBoundCPUPercent) is 0.5.
[0189] The target CPU utilization upper bound CPUPercent = 0.95
[0190] Target memory utilization targetMemoryPeaksPercent = 0.6
[0191] The target memory utilization lower bound (lowerBoundMemoryPeaksPercent) is 0.5.
[0192] The upper bound of the target memory utilization rate is 0.95.
[0193] Remove the lowest data rate: eraseDataPercent = 0.25
[0194] Minimum CPU quota minCpuQuata = 0.5
[0195] Minimum memory quota minMemQuata = 1
[0196] The target utilization rate is the desired utilization rate. The quota obtained using this parameter will bring the final resource utilization rate close to this value. The lower and upper bounds of the target utilization rate are the upper and lower bounds of the desired final resource utilization rate. The minimum data removal rate involves sorting the data and removing a certain percentage of data. The default value is 25%, which removes 1 / 4 of the data, equivalent to removing the data from the 6 hours with the lowest load in a 24-hour period. The minimum CPU and memory quotas are the minimum values set by the user. The final calculated quota value will be greater than this value. The percentile calculation method involves sorting the data and calculating the corresponding cumulative percentiles. The value corresponding to a certain percentile is called the percentile of that percentile. For example, the value at position p% is called the p-th percentile. Users can modify the default values of the above parameters according to their actual needs. The solution will provide the target, lower, and upper bound resource recommendation values based on the percentages in the above parameters.
[0197] Secondly, obtain historical data of the container.
[0198] Historical data includes the following: timestamp, container CPU resource usage (cores), container memory usage (GB), number of containers, container CPU request quota (cores), and container memory request quota (GB); the data format is as follows: 2020-01-01 12:05:00,0.023312,0.2341,10,0.5,2. The retrieved data should be at least 7 days long.
[0199] Next, calculate the target total resource usage.
[0200] The total resource consumption is calculated based on the historical data obtained in the previous step. The calculation formula (4) is as follows:
[0201]
[0202] n represents the number of pods, Ri represents the average resource usage of the i-th pod, and r represents the target resource utilization rate. Substituting the CPU and memory data into the above formula yields the target total CPU resource usage and the target total memory resource usage.
[0203] Next, resource consumption is calculated based on historical container data.
[0204] CPU resource usage calculation: First, process the original resource usage data, sort the obtained container CPU resource usage data, and remove the lowest-ranked erase Data Percent% data points. Then process the resource usage, and the calculation formula is resource usage = original resource * (1 + margin Fraction), where the default recommended margin Fraction is 0.15. Let the target resource utilization rate be r, where r is targetCPUPercent, lowerBoundCPUPercent, and upperBoundCPUPercent respectively. Substituting these into the following formula will give the recommended CPU quota value, the lower limit of the CPU quota, and the upper limit of the CPU quota. The calculation formula (5) for resource consumption area is
[0205] S=(R1+R2+…+Rn)*timespan (5)
[0206] Rn represents the resource usage at the nth time point, and timespan represents the time interval in each data point. The final target resource usage of the container is obtained using the following formula (6):
[0207] St=S / r / timespan / n=(R1+R2+…+Rn) / r / n (6)
[0208] Use the target resource usage of this container as the recommended CPU quota;
[0209] Memory resource usage calculation: First, process the original memory resource usage data. Resource usage = original resource * (1 + marginFraction). Here, the default recommended marginFraction is 0.15. Let the target resource utilization rate be r. Here, r is taken as targetMemPercent, lowerBoundMemPercent, and upperBoundMemPercent respectively. Substituting them into the above formulas (5) and (6), we can obtain the recommended value of memory quota, the lower bound value of memory quota, and the upper bound value of memory quota.
[0210] The larger of the calculated recommended CPU and memory quotas and the user-defined minimum quota will be used as the recommended container resource quota. The recommended container resource quota includes a target recommended value, a lower recommended bound, and an upper recommended bound. An alert will be issued if the current user's quota is lower than the lower recommended bound or higher than the upper recommended bound.
[0211] Divide the target resource usage by the recommended container resource quota and round up to get the number of pods corresponding to the target resource usage.
[0212] The fluctuation data can be obtained based on the recommended container resource quota and the number of PODs. For example, if the fluctuation is less than 20% for 7 consecutive days, the recommended container resource quota and the number of PODs can be adjusted directly according to the corresponding quota suggestions to achieve effective resource scheduling and improve overall resource utilization.
[0213] In some embodiments of this application, to ensure the accuracy of the model prediction results for the preset load prediction model and capacity model, the load prediction model is periodically updated and trained using newly added and historical load index data. The resource scheduling strategy generated based on the prediction results and preset resource usage conditions is also evaluated to correct model errors and further ensure the reliability of the model prediction results.
[0214] Based on the resource scheduling method provided in the above embodiments, this application also provides specific implementations of a resource scheduling apparatus. Please refer to the following embodiments.
[0215] Figure 8 This is a schematic diagram of a resource scheduling apparatus provided in some embodiments of this application. For example... Figure 8 As shown, in some embodiments of this application, the resource scheduling apparatus includes:
[0216] The acquisition module 801 is used to acquire the first query rate per second (QPS) of the target business service to be predicted in a preset first time period.
[0217] The first determining module 802 is used to determine the second QPS for a preset prediction time period based on the first QPS and using a preset load prediction model.
[0218] The second determining module 803 is used to determine the number of first Pods corresponding to the second QPS based on the second QPS and using a preset capacity model, wherein the preset capacity model is determined by training based on sample data of the business service.
[0219] The scheduling module 804 is used to schedule the resources of the target business service according to the first number of Pods and preset resource usage conditions.
[0220] In summary, the resource scheduling method of this application embodiment can be used to execute the resource scheduling method in the foregoing embodiments. This method utilizes a preset load prediction model to perform load prediction analysis on the QPS of the target service, obtaining a second QPS for the predicted time period. Then, a preset capacity model is used to perform capacity identification analysis on the second QPS, obtaining a first POD number corresponding to the second QPS, i.e., the number of PODs required by the target service within the predicted time period. Finally, based on the first POD number and preset resource control conditions, the resources of the service are scheduled. Therefore, based on the solution of this application, without analyzing and distinguishing the type of the target service, the scheduling strategy can be determined directly by predicting and analyzing the obtained target service QPS index data, thus achieving effective container resource scheduling. Resource scheduling is more reasonable and convenient, improving resource scheduling efficiency and ultimately enhancing the overall resource utilization of the service.
[0221] In some embodiments of this application, the resource scheduling device is further configured to, before determining the second QPS of the prediction time period based on the first QPS using a preset load prediction model, when it is detected that the storage device does not store the target service, obtain the third QPS of the preset second time period of the target service, wherein the preset second time period includes the preset first time period; and train the load prediction model as the preset load prediction model based on the third QPS and the preset load prediction algorithm.
[0222] In some embodiments of this application, the preset capacity model includes a first feature recognition model and a second feature recognition model.
[0223] The second determining module 803 is further configured to input the second QPS into the first feature recognition model of the preset capacity model to obtain the first feature information of the second QPS; input the second QPS into the second feature recognition model of the preset capacity model to obtain the second feature information of the second QPS; determine the resource usage corresponding to the second QPS based on the first feature information and the second feature information; and calculate the first Pod number corresponding to the second QPS based on the resource usage and the preset container resource quota information.
[0224] The first feature recognition model includes a neural network model; the second feature recognition model includes a linear regression model.
[0225] In some embodiments of this application, the preset resource usage conditions include a preset upper limit threshold and a lower limit threshold for the number of Pods corresponding to the target resource usage.
[0226] In some embodiments of this application, the scheduling module 804 is further configured to expand the resources of the target business service when the number of the first Pods is greater than or equal to the upper limit threshold of the number of Pods; and to shrink the resources of the target business service when the number of the first Pods is less than the lower limit threshold of the number of Pods.
[0227] In some embodiments of this application, the scheduling module 804 is further configured to expand the resources of the target business service according to the preset upper limit threshold for the number of expanded Pods when the number of the first Pods is greater than or equal to the preset upper limit threshold for the number of expanded Pods.
[0228] In some embodiments of this application, the scheduling module 804 is further configured to reduce the resource size of the target business service according to the preset lower limit threshold for the number of Pods to be reduced when the number of the first Pods is less than the preset lower limit threshold for the number of Pods to be reduced.
[0229] In some embodiments of this application, the scheduling module 804 is further configured to obtain a preset scheduling start time, which includes a capacity expansion start time and a capacity reduction start time; and to schedule the resources of the target service according to the preset scheduling start time.
[0230] In some embodiments of this application, the scheduling module 804 is further configured to obtain the scheduling priority level of the target service; and schedule the resources of the target service according to the scheduling priority level.
[0231] In some embodiments of this application, the resource scheduling device is further configured to determine the real-time number of second Pods based on the acquired real-time resource usage and preset container resource quota information; and to schedule resources for the target service based on the number of second Pods and preset resource usage conditions.
[0232] Figure 8 The various modules / units in the device shown in the figure number (corresponding to the device) have the ability to implement Figures 1 to 4 , Figure 6 and Figure 7 The functions of each step in the process and their corresponding technical effects are described in detail here for the sake of brevity.
[0233] Based on the resource scheduling method provided in the above embodiments, this application also provides specific implementation methods for resource scheduling devices. Please refer to the following embodiments.
[0234] Figure 9A schematic diagram of the hardware structure of the resource scheduling device provided in an embodiment of this application is shown.
[0235] The resource scheduling device may include a processor 901 and a memory 902 storing computer program instructions.
[0236] Specifically, the processor 901 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0237] Memory 902 may include a large-capacity memory for data or instructions. For example, and not limitingly, memory 902 may include a hard disk drive (HDD), a floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 902 may include removable or non-removable (or fixed) media. Where appropriate, memory 902 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 902 is a non-volatile solid-state memory. In a particular embodiment, memory 902 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0238] The processor 901 implements any of the resource scheduling methods described in the above embodiments by reading and executing computer program instructions stored in the memory 902.
[0239] In one example, the resource scheduling device may also include a communication interface 903 and a bus 910. For example, Figure 9 As shown, the processor 901, memory 902, and communication interface 903 are connected through bus 910 and complete communication with each other.
[0240] The communication interface 903 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0241] Bus 910 includes hardware, software, or both, that couples components of a resource-scheduled device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 910 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.
[0242] The resource scheduling device can execute the resource scheduling method in the embodiments of this application, thereby achieving a combination Figures 1 to 4 , Figure 6 and Figure 7 Describes the resource scheduling method.
[0243] Furthermore, in conjunction with the resource scheduling methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the resource scheduling methods in the above embodiments.
[0244] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0245] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0246] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0247] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0248] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A resource scheduling method, characterized in that, include: Get the first query rate (QPS) per second for the target business service to be predicted within a preset first time period; Based on the first QPS, a second QPS for a preset prediction time period is determined using a preset load prediction model; Based on the second QPS, the number of first Pods corresponding to the second QPS is determined using a preset capacity model, wherein the preset capacity model is trained and determined based on sample data of the business services. Based on the first number of Pods and preset resource usage conditions, schedule the resources of the target business service; The preset capacity model includes a first feature recognition model and a second feature recognition model, and the first feature recognition model and the second feature recognition model are weighted and calculated; wherein, the first feature recognition model includes a neural network model; the second feature recognition model includes a linear regression model; the step of determining the number of first Pods corresponding to the second QPS using the preset capacity model based on the second QPS includes: The second QPS is input into the first feature recognition model of the preset capacity model to obtain the first feature information of the second QPS; wherein, the first feature information includes the correspondence between the second QPS identified by the first feature recognition model and the CPU and memory resource usage; The second QPS is input into the second feature recognition model of the preset capacity model to obtain the second feature information of the second QPS; wherein, the second feature information includes the correspondence between the second QPS identified by the second feature recognition model and the CPU and memory resource usage; Based on the first feature information and the second feature information, determine the resource usage corresponding to the second QPS; Based on the resource usage and the preset container resource quota information, the number of first Pods corresponding to the second QPS is calculated.
2. The method according to claim 1, characterized in that, Before determining the second QPS for the prediction period based on the first QPS using a preset load prediction model, the method further includes: When the storage device is detected to not store the target service, the third QPS of the target service is obtained for a preset second time period, wherein the preset second time period includes the preset first time period. Based on the third QPS and the preset load prediction algorithm, a load prediction model is trained as the preset load prediction model.
3. The method according to claim 1, characterized in that, The preset resource usage conditions include a preset upper limit threshold and a preset lower limit threshold for the number of Pods corresponding to the target resource usage. The step of scheduling resources for the target service based on the first number of Pods and the preset resource usage conditions includes: When the number of the first Pods is greater than or equal to the upper limit threshold of the number of Pods, the resources of the target business service are expanded. When the number of the first Pods is less than the lower limit threshold of the number of Pods, the resources of the target business service are scaled down.
4. The method according to claim 3, characterized in that, The step of scaling up resources for the target service when the number of the first Pods is greater than or equal to the upper limit threshold of the number of Pods includes: When the number of the first Pods is greater than or equal to the preset upper limit threshold for the number of Pods to be expanded, the resources of the target service are expanded according to the preset upper limit threshold for the number of Pods to be expanded.
5. The method according to claim 3, characterized in that, When the number of the first Pods is less than the lower limit threshold for the number of Pods, the resources for the target service are scaled down, including: When the number of the first Pods is less than the preset lower limit threshold for the number of Pods to be scaled down, the resources of the target service are scaled down according to the preset lower limit threshold for the number of Pods to be scaled down.
6. The method according to any one of claims 1-5, characterized in that, The method of scheduling the resources for the target service also includes: Obtain the preset scheduling start time, which includes the expansion start time and the reduction start time; The resources of the target service are scheduled according to the preset scheduling start time.
7. The method according to claim 6, characterized in that, The method of scheduling the resources for the target service also includes: Obtain the scheduling priority level of the target service; The resources of the target service are scheduled according to the scheduling priority level.
8. The method according to claim 1, characterized in that, The method further includes: The number of second Pods in real time is determined based on the real-time resource usage and preset container resource quota information. Based on the second number of Pods and the preset resource usage conditions, schedule the resources of the target business service.
9. A resource scheduling apparatus, characterized in that, The device includes: The acquisition module is used to acquire the first query rate (QPS) per second of the target business service to be predicted within a preset first time period. The first determining module is used to determine the second QPS for a preset prediction time period based on the first QPS using a preset load prediction model; The second determining module is used to determine the number of first Pods corresponding to the second QPS based on the second QPS and using a preset capacity model, wherein the preset capacity model is determined by training based on sample data of the business service. The scheduling module is used to schedule the resources of the target business service according to the first number of Pods and preset resource usage conditions; The preset capacity model includes a first feature recognition model and a second feature recognition model, and the first feature recognition model and the second feature recognition model are weighted and calculated; wherein, the first feature recognition model includes a neural network model; the second feature recognition model includes a linear regression model; the step of determining the number of first Pods corresponding to the second QPS using the preset capacity model based on the second QPS includes: The second QPS is input into the first feature recognition model of the preset capacity model to obtain the first feature information of the second QPS; wherein, the first feature information includes the correspondence between the second QPS identified by the first feature recognition model and the CPU and memory resource usage; The second QPS is input into the second feature recognition model of the preset capacity model to obtain the second feature information of the second QPS; wherein, the second feature information includes the correspondence between the second QPS identified by the second feature recognition model and the CPU and memory resource usage; Based on the first feature information and the second feature information, determine the resource usage corresponding to the second QPS; Based on the resource usage and the preset container resource quota information, the number of first Pods corresponding to the second QPS is calculated.
10. A resource scheduling device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the resource scheduling method as described in any one of claims 1 to 8.
11. A computer storage medium, characterized in that, The computer storage medium stores computer program instructions, which, when executed by a processor, implement the resource scheduling method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Resource occupation prediction method and system
CN105392154A
Regulation method and device for virtual machine resources and cloud platform
CN109412841A
Container resource scheduling method and device and computer readable storage medium
CN109753356A