Application deployment method, cloud management platform, computing device cluster and storage medium
By predicting the resource usage and operation performance of the application on the cloud management platform and determining the best deployment node, the problem of inefficiency of cloud computing service providers in resource utilization and user experience is solved, and higher resource utilization and improvement are achieved Good user experience.
Patent Information
- Application Number
- CN202311278777.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-07-31
- Filing Date
- 2023-09-28
- Publication Date
- 2025-02-14
AI Technical Summary
Cloud computing service providers find it difficult to balance resource utilization and user experience, especially inefficient in application deployment and resource scheduling.
By predicting the maximum resource usage of the application in the target period on the cloud management platform, and based on multiple sets of prediction information and resource allocation information, the target deployment node of the application is determined from multiple candidate nodes. This approach considers the application deployed on nodes that have shorter runtime and/or lower average instruction cycles to improve resource utilization and user experience.
It improves the overall resource utilization rate of cloud service manufacturers, reduces resource waste, improves resource scheduling efficiency, shortens the average resource scheduling time, and thus improves user experience.
Smart Images

Figure CN119449593A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to an application deployment method, a cloud management platform, a computing device cluster, and a storage medium. Background Art
[0002] Cloud computing is an Internet-based computing model that provides computing resources to users in an on-demand, flexible and scalable manner. Compared with traditional local computing, cloud computing transfers computing power from local devices to remote data centers, and enables sharing and access to resources through the Internet. Users can obtain computing resources on the cloud as needed without owning and maintaining actual physical devices.
[0003] With the development of cloud computing technology, more and more enterprises or individual users choose to deploy applications on private or public clouds, which requires reasonable allocation of resources for applications. For cloud computing service providers, they need to meet the resource requirements of various applications to ensure the user experience of cloud applications. At the same time, in order to reduce resource usage costs and support more users' applications on the cloud, cloud computing service providers also hope to improve the overall utilization of cloud computing resources. Therefore, it is necessary to provide a resource scheduling method that can take into account both resource utilization and user experience. Summary of the invention
[0004] The present application provides an application deployment method, a cloud management platform, a computing device cluster and a storage medium, which can take into account both resource utilization and user experience.
[0005] In the first aspect, the present application provides an application deployment method, which is applied to a cloud management platform, and the cloud management platform is used to manage infrastructure, on which user-deployed applications run. Specifically, the cloud management platform predicts the predicted maximum resource usage of the application within a target period, and predicts multiple groups of prediction information corresponding to multiple candidate nodes. Then, the cloud management platform determines the target deployment node of the application from multiple candidate nodes based on the predicted maximum resource usage, multiple groups of prediction information and resource allocation information. Among them, the target candidate node is any one of the multiple candidate nodes, the target candidate node is a server or virtual machine in the above-mentioned infrastructure, and the prediction information corresponding to the target candidate node includes the predicted application running time and / or the predicted average number of instruction cycles for deploying the application on the target candidate node within the target period. The resource allocation information is used to indicate the resource allocation of the above-mentioned multiple candidate nodes.
[0006] It can be seen that this solution determines the target deployment node of the application based on the predicted maximum resource usage of the application in the target time period, the resource allocation of each candidate node, the predicted application running time and / or the predicted average number of instruction cycles of the application deployed on each candidate node.
[0007] On the one hand, when determining the target deployment node of an application (a user of the cloud service provider), the cloud management platform of the cloud service provider considers the predicted maximum resource usage of the application and the resource allocation of each candidate node, which helps to improve the overall resource utilization of the cloud service provider and reduce resource waste. On the other hand, if the predicted running time of the application deployed on each candidate node is considered when determining the target deployment node, in the hope of deploying the application on a node with a shorter running time, it will help to improve the resource scheduling efficiency of the cloud service provider, shorten the average resource scheduling time, and thus improve the user experience of the cloud service provider. If the predicted average instruction cycles of the application deployed on each candidate node are considered when determining the target deployment node, in the hope of deploying the application on a node with a smaller average instruction cycles (CPI), it will help to improve the response rate of the application, thereby improving the user experience. Therefore, this solution can not only ensure a higher resource utilization rate, reduce resource waste, but also improve the user experience.
[0008] Based on the first aspect, in a possible implementation scheme, the above-mentioned predicted maximum resource usage corresponds to one or more of processor resources, memory resources, and disk resources. That is to say, the above-mentioned predicted maximum resource usage may include the maximum usage of one or more different resource types (optional) of the application within the target time period, such as the maximum usage of processor resources, the maximum usage of memory resources, and the maximum usage of disk resources. One or more of the maximum usage is not specifically limited here. In actual application scenarios, the cloud management platform can determine one or more resource types for the application based on the resource usage characteristics of the application, and then predict the maximum usage of the application for these one or more resource types within the target time period, so as to determine the target deployment node of the application.
[0009] Based on the first aspect, in a possible implementation scheme, the above-mentioned processor resources include one or more of central processing unit resources, neural network processor resources, graphics processor resources, and data processor resources.
[0010] Based on the first aspect, in a possible implementation scheme, multiple resource allocation rates corresponding to multiple candidate nodes can be determined based on the above-mentioned predicted maximum resource usage and resource allocation information, and then the scores of the above-mentioned multiple candidate nodes are respectively determined according to the above-mentioned multiple resource allocation rates and multiple groups of prediction information, and then the candidate node with the highest score among the above-mentioned multiple candidate nodes is determined as the target deployment node of the application. Among them, the resource allocation rate corresponding to the target candidate node is the resource allocation rate when the target candidate node allocates resources to the application according to the predicted maximum resource usage. It can be seen that this scheme expects to deploy the application on a node that shortens its running time and / or has a lower CPI value, and expects the deployment node of the application to achieve higher resource utilization.
[0011] Based on the first aspect, in a possible implementation scheme, the score of the target candidate node is a value obtained by subtracting at least one of the predicted application runtime or the predicted average instruction cycle number from the resource allocation rate corresponding to the target candidate node.
[0012] Based on the first aspect, in a possible implementation scheme, multiple candidate nodes may be determined from multiple nodes based on the predicted maximum resource usage and available resources of multiple nodes in a basic setting.
[0013] That is to say, the cloud management platform can first determine multiple candidate nodes from multiple nodes according to preset rules (not specifically limited here), narrow the prediction range, and then predict multiple sets of prediction information corresponding to the multiple candidate nodes to determine the target deployment node of the application, so as to deploy the application to the target node for operation. Among them, the above multiple nodes belong to the infrastructure managed by the cloud management platform, and the above multiple candidate nodes can be some or all of the above multiple nodes.
[0014] Based on the first aspect, in a possible implementation scheme, the application belongs to a first application type, and the resource usage interval to which the predicted maximum resource usage belongs can be obtained based on the resource prediction model corresponding to the first application type, and then the predicted maximum resource usage is determined based on the resource usage interval to which the predicted maximum resource usage belongs. The resource usage interval is one of multiple preset resource usage intervals.
[0015] In this solution, the output of the resource prediction model is not the specific value of the maximum resource usage, but the range of the maximum resource usage. In other words, the resource prediction model is a classification model, which can avoid the problem of overfitting in training due to the model's training data set being too narrow (such as following a long-tail distribution), which helps to improve the model's prediction accuracy.
[0016] Based on the first aspect, in a possible implementation scheme, based on one or more information including the resource application amount of the application, the application name, the application identifier, the historical resource usage indicators, the resource utilization rates of the multiple candidate nodes, and the resource prediction model corresponding to the first application type, the resource usage interval to which the predicted maximum resource usage belongs is predicted, wherein the historical resource usage indicators include one or more of the historical maximum resource utilization rate, the preset percentile resource utilization rate, the historical maximum resource usage, and the preset percentile resource usage.
[0017] It should be understood that since the application resource usage in cloud computing scenarios has multiple dimensions (multiple resource types, multiple resource usage indicators) and a high rate of change, this solution makes predictions based on multiple resource usage indicators, which helps to improve prediction accuracy.
[0018] Based on the first aspect, in a possible implementation scheme, the application belongs to a first application type, and the time series data of the resource usage of the application in the historical period corresponding to the target period can be obtained, and then the predicted maximum resource usage can be obtained based on the time series data and the resource prediction model corresponding to the first application type.
[0019] In this solution, if the resource usage of an application has a certain periodicity, you can consider using the time series data of the application's historical resource usage for prediction, thereby improving the prediction accuracy.
[0020] Based on the first aspect, in a possible implementation scheme, the predicted average number of instruction cycles for deploying the application on the target candidate node within the target time period can be predicted based on the predicted maximum resource usage, the resource utilization (or resource usage) of the target candidate node and the number of requests per second corresponding to the application.
[0021] In the second aspect, the present application also provides a cloud management platform for managing infrastructure, on which user-deployed applications run. The cloud management platform includes a prediction module and a determination module. The prediction module is used to predict the predicted maximum resource usage of the application within a target time period, and is also used to predict multiple groups of prediction information corresponding to multiple candidate nodes, wherein the target candidate node is any one of the multiple candidate nodes, and the prediction information corresponding to the target candidate node includes the predicted application runtime and / or the predicted average number of instruction cycles for deploying the application on the target candidate node within the target time period. The determination module is used to determine the target deployment node of the application from multiple candidate nodes based on the predicted maximum resource usage, multiple groups of prediction information and resource allocation information, wherein the resource allocation information is used to indicate the resource allocation of multiple candidate nodes.
[0022] The cloud management platform may also include more or fewer modules, which are not specifically limited here. The cloud management platform in the second aspect is specifically used to execute the method in any implementation scheme of the first aspect, which can be seen in the above introduction and will not be repeated here.
[0023] In a third aspect, the present application further provides a computing device cluster, comprising at least one computing device, each computing device comprising a processor and a memory. The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method of any implementation scheme in the first aspect.
[0024] In a fourth aspect, the present application further provides a computer-readable storage medium comprising computer program instructions. When the above-mentioned computer program instructions are executed by a computing device cluster (including at least one computing device), the computing device cluster executes a method as in any implementation scheme in the first aspect.
[0025] In a fifth aspect, the present application further provides a computer program product comprising instructions. When the instructions are executed by a computing device cluster (including at least one computing device), the computing device cluster executes the method of any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.
[0027] Figure 1 It is a schematic diagram of the architecture of a cloud environment provided in an embodiment of the present application;
[0028] Figure 2 It is a flowchart of an application deployment method provided in an embodiment of the present application;
[0029] Figure 3 It is a normalized CPI data distribution scatter plot provided in an embodiment of the present application;
[0030] Figure 4 is a schematic diagram of a confusion matrix provided in an embodiment of the present application;
[0031] Figure 5 It is a schematic diagram of a process for determining a target deployment node for an application provided by an embodiment of the present application;
[0032] Figure 6 It is a structural diagram of a cloud management platform 200 provided in an embodiment of the present application;
[0033] Figure 7 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0034] Figure 8 is a schematic diagram of a computing device cluster provided in an embodiment of the present application;
[0035] Fig. 9 It is a schematic diagram of interaction between computing devices through a network provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to facilitate understanding of the technical solutions in the embodiments of the present application, some terms and concepts involved in the embodiments are briefly introduced below.
[0037] 1. Average number of instruction cycles (cycles per instruction, CPI)
[0038] CPI refers to the average number of clock cycles required to execute an instruction. It is used to measure the instruction-level performance of a computer or processor and is an easily accessible hardware-level indicator. The lower the CPI value, the fewer clock cycles are required on average to execute each instruction, which means the processor is more efficient in executing instructions. Conversely, a higher CPI value means the more clock cycles are required on average to execute each instruction, which means the processor is less efficient in executing instructions.
[0039] 2. Requests per second (RPS):
[0040] RPS is a common indicator used to measure application performance, indicating the number of requests processed by the application per second.
[0041] 3. Resource allocation rate
[0042] A node (such as a server or virtual machine) may have one or more types of resources, such as a central processing unit (CPU), memory, disk, etc. The resource allocation rate of a node for a certain type of resource refers to the value obtained by dividing the allocated amount of the resource of this type on the node (allocated to applications / computing tasks) by the total amount of the resource of this type on the node.
[0043] 4. Time Series Data
[0044] Time series data, also known as time series (TS) data, refers to a series of data sampled at a certain time interval (such as 1 second, 2 minutes, etc.) and arranged in chronological order.
[0045] See also Figure 1 , Figure 1 It is a schematic diagram of the architecture of a cloud environment provided in an embodiment of the present application, including an infrastructure 100 and a cloud management platform 200.
[0046] The infrastructure 100 is used to provide cloud computing resources (such as computing, storage, network and other resources), and user applications can be deployed and run on the infrastructure 100. Figure 1 As shown, the infrastructure 100 includes multiple nodes, each of which can be a server or a virtual machine, or can be in other forms. Optionally, the multiple nodes can belong to one or more cloud data centers, each of which includes at least one server, and each server can include one or more virtual machines, or can include no virtual machines.
[0047] Taking the node as a server as an example, the infrastructure 100 may include one or more types of servers, and different server types have certain differences in hardware configuration. For example, servers may be general-purpose servers, computing servers, storage servers, and other types. For servers in high performance computing (HPC) scenarios, multiple central processing units (CPUs) are generally configured. For servers in scenarios such as artificial intelligence (AI) or heterogeneous computing power, they are not only configured with CPUs, but may also be configured with coprocessors such as graphics processing units (GPUs), neural network processing units (NPUs), and data processing units (DPUs). In addition to the above-mentioned server types, there may be other ways of dividing server types, which are not specifically limited in the embodiments of the present application.
[0048] The cloud management platform 200 is used to manage the cloud service provider's infrastructure 100. The cloud management platform 200 can provide an access interface (such as an interface or an application programming interface (API)) to interact with the cloud service provider's users (or tenants / customers). Users can send application deployment requests to the cloud management platform 200, and the cloud management platform 200 will then deploy the application to a suitable node in the infrastructure 100 for execution.
[0049] Based on the above content, an embodiment of the application deployment method provided by the present application is introduced below.
[0050] See also Figure 2 , Figure 2 is a flow chart of an application deployment method provided in an embodiment of the present application, the method is used to Figure 1 The cloud management platform 200 includes steps S201 to S203.
[0051] S201. Predict and obtain the predicted maximum resource usage to be applied in a target time period.
[0052] The above application can be one or more applications to be deployed, or Figure 1An application deployed by a user running on the infrastructure 100. For the sake of ease of description, the above application will be referred to as the first application hereinafter. Regarding the type of the first application, the embodiment of the present application does not specifically limit this, and it can be a traditional application or a cloud-native application. For example, the first application can be an application of the type of map, online shopping mall, online video, online game, online banking, cloud conference, email or database. The first application can be a containerized application or pod under Kubernetes. Among them, Kubernetes, referred to as K8s, is an open source container cluster management system for automatically deploying, expanding and managing containerized applications. Pod is an abstract concept in K8s. A pod contains a group of application containers and the resources shared by these containers. A pod always runs on a node. A node is a machine that performs specific work, which can be a virtual machine or a physical machine.
[0053] The target period is a certain period of time. The length of the target period (such as 1 hour, one day or one week), the date of the target period, etc., are not specifically limited in the embodiments of the present application and can be selected according to the prediction requirements of the actual application scenario.
[0054] The predicted maximum resource usage refers to the predicted value of the maximum usage of one or more resources (recorded as target resource types) by the first application during the target period. Optionally, the target resource type may include one or more resource types such as processor resources, memory resources, and disk resources, and the processor resources may include one or more CPU resources, NPU resources, GPU resources, and DPU resources.
[0055] The embodiment of the present application does not specifically limit the method for determining the target resource type corresponding to the first application. For example, the target resource type can be determined according to the business scenario of the first application, the main resource type used, etc., or can be actively specified by the user.
[0056] For example, assuming that the first application is used to provide artificial intelligence computing services, and the main resources it uses are CPU resources, then the CPU resources can be used as the target resource type of the first application, and the maximum usage of CPU resources by the first application during the target time period can be predicted (i.e., the predicted maximum resource usage).
[0057] For another example, assuming that the first application is used to provide database services, the main resource types it uses include CPU resources and disk resources. Therefore, CPU resources and disk resources can be used as the target resource types of the first application, and then the maximum usage of CPU resources and disk resources by the first application during the target time period can be predicted (i.e., the predicted maximum resource usage).
[0058] The specific prediction method for the above-mentioned maximum resource usage is introduced below.
[0059] In a first implementation, the resource usage interval to which the predicted maximum resource usage belongs can be predicted based on a resource prediction model corresponding to the first application type, and then the predicted maximum resource usage is determined based on the resource usage interval to which the predicted maximum resource usage belongs.
[0060] Among them, the above resource usage interval is one of multiple preset resource usage intervals. The first application belongs to the above first application type, the first application type is a certain application type, and the first application type includes at least one application. The application type here can be divided according to the prediction needs of the actual application scenario, and the embodiment of the present application does not make specific limitations. For example, different application types such as travel applications and entertainment applications can be divided, and then a corresponding resource prediction model can be trained for different application types. Applications belonging to the same application type can all be predicted using the same resource prediction model.
[0061] Regarding the input data, output data and model type of the above-mentioned resource prediction model, the embodiments of this application do not make specific restrictions, and can be reasonably set according to the needs of the actual application scenario. For example, the resource prediction model can adopt machine learning models such as random forest, XGBoost, long short-term memory network (Long-Short Term Memory, LSTM), which are not specifically limited in the embodiments of this application. Among them, the advantages of XGBoost are low model overhead, light model, convenient online deployment, and low training cost. Compared with deep learning models, it has lower computing power requirements and is convenient for real-time updates.
[0062] It should be understood that if the training data of the resource prediction model conforms to the long-tail distribution characteristics, if a regression model is used as the resource prediction model, overfitting is likely to occur during the model training process, which will greatly reduce the generalization performance of the model. Among them, the long-tail distribution is an example of uneven data distribution, that is, a few categories have a large number of data samples, while most categories have only a small number of data samples. Therefore, a classification model is used as a resource prediction model here. The resource prediction model predicts the resource usage interval (i.e., interval prediction) rather than the specific resource usage value, thereby enhancing the generalization ability of the model.
[0063] For example, suppose a resource prediction model is trained with a data set that contains the historical resource usage of multiple applications belonging to the first application type. By analyzing the data distribution of the data set, it is found that the data set follows the characteristics of a long-tail distribution. For example, application A belongs to the first application type. By analyzing the historical resource usage of application A, it is found that 75% of the 95th percentile CPU utilization of application A is below 5%, and it can be determined that it meets the long-tail distribution. Because the data set follows the characteristics of a long-tail distribution, this relatively narrow data distribution makes the model training at risk of overfitting, which may lead to problems such as low prediction results or low accuracy.
[0064] Therefore, in order to avoid overfitting, the point-like resource usage values can be relaxed into resource usage intervals, and then the classification model can be used as the resource prediction model to predict the resource usage intervals, thereby converting the regression problem into a classification problem, which helps to enhance the generalization ability and prediction accuracy of the model. For example, the CPU resource usage can be divided into multiple different preset resource usage intervals (the division method is not specifically limited), such as [0,2], (2,4], (4,6], (6,8], (8,10], where the unit of the preset resource usage interval can be the number of CPU cores or the number of virtual CPUs (i.e., vCPUs), and then the resource prediction model can predict the interval in which the predicted maximum resource usage of the CPU resource of the first application during the target time period is located. Similarly, the memory resource usage can also be divided into multiple different preset resource usage intervals, such as [0GB,4GB], (4GB,8GB], and (8GB,16GB], and then the resource prediction model can predict the interval in which the predicted maximum resource usage of the memory resource of the first application during the target time period is located.
[0065] Optionally, if the input data of the resource prediction model includes the CPU resource application amount (set by the user), the model may not directly predict the predicted maximum resource usage corresponding to the CPU resource, but may predict the maximum CPU utilization. Similarly, the CPU utilization may also be divided into multiple different intervals, such as [0%, 20%], (20%, 40%], (40%, 60%], (60%, 80%], [80%, 100%], and then the resource prediction model is used to predict the interval in which the maximum CPU utilization of the first application is located during the target period, and the upper limit of the interval in which the maximum CPU utilization is located is used as the predicted maximum CPU utilization, and then the product of the above-mentioned CPU resource application amount and the predicted maximum CPU utilization is used as the predicted maximum resource usage of the CPU resource for the first application.
[0066] In order to verify the prediction effect of the above resource prediction model, the prediction accuracy, overestimation rate, underestimation rate and other indicators of the resource prediction model can also be evaluated. For example, Figure 4 An example of a 5×5 confusion matrix (also called an error matrix) is given, which represents the corresponding relationship between the prediction results of the resource prediction model for the CPU utilization interval of applications belonging to the first application type and the actual CPU utilization interval. Each row of the matrix represents an actual CPU resource utilization interval, and each column of the matrix represents the CPU resource utilization interval predicted by the model. The proportion of the sum of the values on the diagonal of the matrix in the sum of the values of the entire matrix represents the prediction accuracy of the resource prediction model, which is 64%. The proportion of the sum of the values on the upper right of the diagonal of the matrix in the sum of the values of the entire matrix represents the overestimation rate of the resource prediction model, which is 34%. The proportion of the sum of the values on the lower left of the diagonal of the matrix in the sum of the values of the entire matrix represents the underestimation rate of the resource prediction model, which is 1%.
[0067] Optionally, in order to further avoid overfitting during the training process of the resource prediction model, the data in the data set can be uniformly sampled, that is, the data of all preset resource usage intervals are extracted as evenly as possible for model training, so that the probability of each preset resource usage interval being selected is equal / similar, thereby avoiding the problem of overfitting of the model caused by simply using the full amount of data in the data set for training. For example, different preset resource usage intervals are sampled as much as possible for model training. For a preset resource usage interval with insufficient data (such as less than the preset value), the data in the interval can be fully extracted for model training. For a preset resource usage interval with sufficient data (such as greater than or equal to the preset value), the preset value of data can be extracted from the interval for model training, thereby improving the generalization ability and prediction accuracy of the model.
[0068] Optionally, the resource usage interval (i.e., output data) to which the above-mentioned predicted maximum resource usage belongs can be predicted based on one or more of the resource application amount of the first application (corresponding to one or more resource types such as CPU, memory, disk, etc.), application name, application identifier (identifier, ID), historical resource usage indicators, resource utilization or resource allocation of multiple candidate nodes and other information (i.e., input data) and the resource prediction model corresponding to the first application type. Among them, the historical resource usage indicators include one or more of the historical maximum resource utilization, the preset percentile resource utilization (such as 95th percentile CPU utilization, 90th percentile CPU utilization, 95th percentile memory utilization, etc.), the historical maximum resource usage, and the preset percentile resource usage. It should be understood that since the resource usage in the cloud computing scenario has multiple dimensions (multiple resource types, multiple resource usage indicators), high change rate and other characteristics, the embodiment of the present application is based on multiple resource usage indicators for prediction, which helps to improve the prediction accuracy.
[0069] Optionally, considering the execution efficiency, the trained resource prediction model can be encapsulated into a Python module, and then provide real-time resource usage prediction services to the cloud management platform 200 in the form of function calls / application programming interface (API), thereby avoiding the communication overhead caused by network transmission.
[0070] In the second implementation scheme, the time series data of the resource usage of the first application in the historical period corresponding to the target period can be obtained, and then the predicted maximum resource usage is predicted based on the time series data and the resource prediction model corresponding to the first application type to which the first application belongs. Among them, the time series data is time series (TS) data, which refers to a series of data sampled at a certain time interval (such as 1 second, 2 minutes, etc.) and arranged in chronological order. The time series data of the resource usage is the time series data obtained by sampling the resource usage of the application (which may correspond to one or more resource types) at a certain time interval.
[0071] For example, suppose a resource prediction model is trained with a data set that includes time series data of historical resource usage of multiple applications belonging to the first application type. By analyzing the data set, it is found that the historical resource usage of applications belonging to the first application type has a certain periodicity (such as peaks / troughs in resource usage at regular intervals, and relatively stable resource usage at other times), then the LSTM model can be used as a resource prediction model for training. Among them, the gating mechanism of LSTM enables it to effectively capture and utilize long-term dependencies, and has good performance when processing long sequence data, so it is suitable for scenarios that need to process time series data.
[0072] The construction of the above LSTM model includes defining the structure and parameter settings of the model, and a deep learning framework (such as TensorFlow, Keras, PyTorch, etc.) can be used to build the LSTM model. The structure of the model includes the number of LSTM layers, the number of hidden units in each layer, and possible other layers (such as fully connected layers, Dropout layers, etc.). In addition, a suitable loss function and optimizer can also be selected, which is not specifically limited in the embodiments of this application.
[0073] In order to enable the LSTM model to be trained using the above dataset, the dataset can be divided into an input sequence and a corresponding target sequence. The input sequence is a time series data consisting of the resource usage of an application in a series of continuous time steps (including one or more time steps), and the target sequence is a time series data consisting of the resource usage of the application in the next one or more time steps corresponding to the input sequence (which can be set according to the prediction requirements of the actual application scenario). In order to evaluate the performance of the model, the dataset can be further divided into a training set, a validation set, and a test set. The dataset can usually be divided into the above three subsets in chronological order. The training set is used for model training, the validation set is used to tune the model's hyperparameters and monitor the training process, and the test set is used to evaluate the model's generalization ability. I will not introduce it in detail here.
[0074] Then, the LSTM model is trained using the training set. During the training process, the input sequence in the training set is input into the LSTM model. The LSTM model outputs the predicted value of the resource usage for the next one or more time steps corresponding to the input sequence. The predicted value is then compared with the target sequence to calculate the loss value. With the goal of minimizing the loss function, the weights of the LSTM model are updated through the back propagation algorithm and optimizer to improve the prediction accuracy of the model. After multiple iterations, the model training is completed. During the training process, the validation set can also be used to tune the hyperparameters of the LSTM model, such as the learning rate, batch size, number of LSTM layers, and number of hidden units. By monitoring the performance indicators on the validation set (such as loss value and accuracy), the best hyperparameter configuration can be selected to obtain better model performance. The test set can also be used to evaluate the generalization ability of the trained LSTM model, which will not be introduced in detail here.
[0075] Subsequently, the trained LSTM model can be used to predict the predicted maximum resource usage of the first application in the target period. For example, the time series data of the resource usage of the first application in the historical period corresponding to the target period can be used as input data and input into the LSTM model, and then the LSTM model outputs the time series data of the predicted resource usage of the first application in the target period, and then the maximum value in the time series data can be used as the predicted maximum resource usage of the first application in the target period.
[0076] S202. Predict and obtain multiple groups of prediction information corresponding to multiple candidate nodes one by one, wherein the target candidate node is any one of the above-mentioned multiple candidate nodes, and the prediction information corresponding to the target candidate node includes the predicted application running time and / or the predicted average number of instruction cycles of deploying the above-mentioned application on the target candidate node within the target time period.
[0077] The above application in step S202 corresponds to the first application described in step S201.
[0078] The candidate nodes are introduced in detail below.
[0079] like Figure 1 As shown, Figure 1 The infrastructure 100 includes multiple nodes, and the multiple candidate nodes in step S202 may be part or all of the multiple nodes. The cloud management platform 200 may determine multiple candidate nodes for the first application from the multiple nodes of the infrastructure 100 based on a certain preset rule, and the embodiment of the present application does not specifically limit the preset rule.
[0080] Optionally, the cloud management platform 200 may determine multiple candidate nodes from the multiple nodes based on the predicted maximum resource usage in step S201 and the available resource amounts of the multiple nodes. The available resource amount of each node refers to the remaining resource amount or the allocatable resource amount of the node, which can be calculated by subtracting the allocated resource amount of the node from the total resource amount of the node.
[0081] For example, the cloud management platform 200 can obtain the resource allocation information of all nodes in the infrastructure 100 to determine the resource allocation of each node in the infrastructure 100. The resource allocation includes the total amount of resources, the amount of allocated resources, the amount of available resources, and other information of each node. If the resource allocation information only includes the total amount of resources and the amount of allocated resources for each node for various resource types, then the available amount of resources for CPU resources of each node can be calculated by referring to formula (1), and the available amount of resources for memory resources of each node can be calculated by referring to formula (2):
[0082] cpu_available=cpu_sum–cpu_alloc (1)
[0083] Among them, cpu_available is the available resource amount of CPU resources of a certain node in the infrastructure 100, cpu_sum is the total resource amount of CPU resources of the node, and cpu_alloc is the allocated resource amount of CPU resources of the node.
[0084] mem_available=mem_sum–mem_alloc (2)
[0085] Among them, mem_available is the available resource amount of memory resources of a certain node in the infrastructure 100, mem_sum is the total resource amount of memory resources of the node, and mem_alloc is the allocated resource amount of memory resources of the node.
[0086] Similarly, you can also calculate the available resources of the node for other resource types besides CPU resources and memory resources, such as the available resources of computing disk resources and GPU resources, which will not be introduced in detail here.
[0087] Then, the cloud management platform 200 can compare the available resources of each node in the infrastructure 100 with the predicted maximum resource usage of the first application, and use the nodes that can meet the predicted maximum resource usage of the first application as candidate nodes. For example, assuming that the target resource type of the first application is CPU resources, if the available resources of a certain node for CPU resources are greater than or equal to the predicted maximum resource usage of the first application for CPU resources, then the node can be used as one of the candidate nodes of the first application and added to the candidate node list. Assuming that the target resource types of the first application are CPU resources and memory resources, if the available resources of a certain node for CPU resources are greater than or equal to the predicted maximum resource usage of the first application for CPU resources, and the available resources of the node for memory resources are greater than or equal to the predicted maximum resource usage of the first application for memory resources, then the node can be used as one of the candidate nodes of the first application.
[0088] It should be understood that in addition to determining candidate nodes based on the available resources of the node, one or more factors such as geographic location, latency, price, performance, etc. can also be combined to determine corresponding candidate nodes for the first application, and the embodiments of the present application do not make specific limitations.
[0089] For example, a portion of nodes in the infrastructure 100 that can meet the predicted maximum resource usage of the first application and have lower resource prices can be used as candidate nodes to save user costs; or, nodes in the infrastructure 100 that can meet the predicted maximum resource usage of the first application and are located in a user-specified geographic location can be determined as candidate nodes.
[0090] The prediction information corresponding to the candidate nodes is introduced below.
[0091] As can be seen from the foregoing introduction, the target candidate node is any one of the multiple candidate nodes, and the prediction information corresponding to the target candidate node includes the predicted application runtime and / or predicted average instruction cycles of deploying the first application on the target candidate node within the target period. In other words, the above-mentioned predicted application runtime corresponding to the target candidate node refers to the predicted value of the application runtime of deploying the first application on the target candidate node within the target period, and the above-mentioned predicted average instruction cycles corresponding to the target candidate node refers to the predicted value of the average instruction cycles (cycles per instruction, CPI) of deploying the first application on the target candidate node within the target period.
[0092] Optionally, the predicted application runtime corresponding to the target candidate node can be predicted by a prediction model. The specific type of the prediction model is not specifically limited in the embodiments of the present application. Optionally, the above prediction model can be any resource prediction model in step S201, that is, the resource prediction model in step S201 can be used to predict the predicted maximum resource usage of the first application within the target time period, and can also be used to predict the predicted application runtime of deploying the first application on the target candidate node within the target time period, that is, the output data of the resource prediction model can include the predicted maximum resource usage and the predicted application runtime. For other contents of the resource prediction model, please refer to the introduction in step S201, which will not be repeated here.
[0093] Optionally, the predicted average instruction cycles for deploying the first application on the target candidate node within the target period can be obtained based on the predicted maximum resource usage in step S201, the resource utilization rate (or resource usage) of the target candidate node, and the RPS corresponding to the first application. The RPS here can be the average or maximum value of the number of requests per second of the first application within the historical period (which can be set), which is not specifically limited in the embodiments of the present application.
[0094] For example, the predicted maximum resource usage of the first application in the target time period, the resource utilization rate of the target candidate node, and the number of requests per second corresponding to the first application can be input into the performance prediction model, and then the model outputs the predicted average number of instruction cycles corresponding to the target candidate node. Regarding the type of performance prediction model, the embodiment of the present application does not make specific restrictions, such as the performance prediction model can be constructed using a decision tree, a neural network, etc.
[0095] It should be understood that before using the performance prediction model to perform the above prediction process, the performance prediction model needs to be trained. Optionally, a corresponding resource prediction model can be trained for different application types, and applications belonging to the same application type can all use the same performance prediction model for prediction, or only one performance prediction model is trained, and all applications can be predicted based on the performance prediction model, and there is no specific limitation on the classification of application types.
[0096] Assuming that a performance prediction model is sequenced separately for each application type, the historical resource usage of each application belonging to the first application type for its target resource type (which may include one or more resources, such as CPU resources, memory resources, etc.) at time t can be obtained, and the resource utilization of the node where the application is deployed at time t for the target resource type and the number of requests per second of the application at time t can be obtained, and then the performance prediction model corresponding to the first application type is trained based on the above information obtained.
[0097] The number of requests per second of the application at time t can be calculated using the following formula (3):
[0098]
[0099] Among them, CPI h (t) is the CPI value of node h at time t, where node h is a node in the infrastructure 100 and is a node where an application belonging to the first application type is deployed at time t. k is the number of clock cycles of the application deployed on node h at time k, C j is the number of clock cycles of the application deployed on node h at time j, I k is the number of instructions of the application deployed on node h at time k, I j is the number of instructions of the application deployed on node h at time j. k -C j It represents the increment of the number of clock cycles from time j to time k (the length of the time period can be set). k -I j represents the increment of the number of instructions from time j to time k, t∈[j,k]. In other words, formula (3) takes the average number of clock cycles required for all instructions executed from time j to time k as the CPI value corresponding to time t.
[0100] After data collection is completed, the historical resource usage of each application belonging to the first application type at time t, the resource utilization rate of the node where the application is deployed at time t, and the number of requests per second of the application at time t are input into the performance prediction model. The model outputs a CPI prediction value, which is compared with the target value (i.e., the actual CPI value of the application at time t, which can be calculated by formula (3)) to calculate the loss value, and then the weight of the LSTM model is updated according to the loss value to improve the prediction accuracy. After multiple iterations, the training of the performance prediction model is completed.
[0101] Then, the trained LSTM model can be used to make the following predictions: the predicted maximum resource usage corresponding to the first application (see the introduction to step S201), the current resource utilization of the target candidate node, and the number of requests per second corresponding to the first application are input into the trained LSTM model, and the output of the model is used as the predicted average number of instruction cycles for deploying the first application on the target candidate node within the target period. Among them, the current resource utilization of the target candidate node corresponds to one or more resource types, which may include one or more resource types such as CPU resources, memory resources, and disk resources. The number of requests per second corresponding to the first application can be the historical average of the number of requests per second of the first application, and the historical maximum number of requests per second of the first application can also be used. It can also be actively specified by the user, and the embodiments of the present application are not specifically limited.
[0102] It should be understood that when the collected CPI data set is relatively narrowly distributed, using a regression model as a performance prediction model for training is prone to overfitting. In order to avoid overfitting of the model, in some embodiments, the point-like CPI value can also be relaxed into a CPI interval, and a classification model can be used as a performance prediction model to predict the interval where the CPI value is located, thereby converting the regression problem into a classification problem, which helps to enhance the generalization ability and prediction accuracy of the performance prediction model.
[0103] For example, the CPI data in the CPI dataset can be normalized. Figure 3 An example of a normalized CPI data distribution scatter plot is given (the horizontal axis is RPS, and the vertical axis is the normalized CPI value). It can be seen that the CPI value is mainly distributed between 0.1 and 0.3, and the data distribution is relatively narrow. If a regression model is used for prediction, overfitting problems are likely to occur. Therefore, a classification model can be used as a performance prediction model to divide the normalized CPI data into multiple different CPI intervals (the division method is not specifically limited), and then the performance prediction model can be used to predict the interval where the CPI value is located. The final prediction value can be the interval mean or maximum value.
[0104] In the training process of the above performance prediction model, in order to further avoid overfitting, the CPI data in the CPI data set can also be uniformly sampled, that is, the data of all CPI intervals are extracted as evenly as possible for model training, and the probability of each CPI interval being selected is equal / similar, thereby avoiding the problem of overfitting of the performance prediction model caused by simply using the full amount of data in the data set for training.
[0105] It should also be noted that the embodiment of the present application does not specifically limit the execution order of steps S201 and S202. Steps S201 and S202 can be executed successively, such as executing step S201 first and then step S202, or executing step S202 first and then step S202. Steps S201 and S202 can also be executed in parallel.
[0106] S203: Determine a target deployment node for the application from multiple candidate nodes based on the predicted maximum resource usage, multiple groups of prediction information, and resource allocation information, wherein the resource allocation information is used to indicate resource allocation conditions of the multiple candidate nodes.
[0107] The resource allocation information may be stored in the cloud management platform 200 in the form of a node resource allocation table or other forms. The cloud management platform 200 may collect the resource usage of each node in the infrastructure 100 and then maintain and update the local resource allocation table.
[0108] For example, Table 1 shows the format of a node resource allocation table. Each row in the table represents the resource allocation of a node, including the node's CPU resource allocation, memory resource allocation, total CPU resource, total memory resource, etc. Taking the node worker1 in the table as an example, the record information in Table 1 indicates that worker1's current CPU resource allocation is 1.2, memory resource allocation is 1000, total CPU resource is 4, and total memory resource is 8000.
[0109] Table 1 Node resource allocation table
[0110] node CPU resource allocation Memory resource allocation Total CPU resources Total memory resources worker1 1.2 1000 4 8000 ... ... ... ... ...
[0111] Optionally, the cloud management platform 200 first determines a plurality of resource allocation rates corresponding to a plurality of candidate nodes based on the above-mentioned predicted maximum resource usage and resource allocation information, wherein the resource allocation rate corresponding to the target candidate node refers to the resource allocation rate when the target candidate node allocates resources to the first application according to the predicted maximum resource usage. Then, the cloud management platform 200 determines the scores of the plurality of candidate nodes respectively according to the above-mentioned plurality of resource allocation rates and the plurality of groups of prediction information, and then determines the candidate node with the highest score as the target deployment node of the first application. Among them, the above-mentioned plurality of groups of prediction information correspond one-to-one to the plurality of candidate nodes, and the resource prediction information corresponding to the target candidate node includes at least one of the predicted application running time or the predicted average number of instruction cycles for deploying the first application on the target candidate node within the target time period. The plurality of groups of prediction information can be predicted by the method described in step S202, which will not be described in detail here.
[0112] It should be understood that the shorter the application's runtime, the shorter the time the application occupies the resources of the nodes in the infrastructure 100, the earlier the resources are released, and the infrastructure 100 has more idle resources that can be allocated to subsequent applications to be scheduled, so that the cloud management platform 200 can allocate other applications to be scheduled to suitable nodes in the infrastructure 100 more quickly, thereby shortening the average waiting time for various applications to be scheduled to wait for resource allocation (i.e., shortening the average resource scheduling time), thereby improving the overall service quality of cloud computing vendors and improving user experience. The average number of instruction cycles is a performance indicator at the processor level, which is highly correlated with application throughput and request latency of delay-sensitive applications. CPI can measure the response speed / operation efficiency of the application. The smaller the average number of instruction cycles of the application, the faster the application response speed and the shorter the request latency, which helps to improve the user experience. Therefore, the embodiment of the present application expects to deploy the first application on a node that has a shorter runtime and / or a lower CPI value.
[0113] Based on the above requirements, in one embodiment, the resource allocation rate corresponding to the target candidate node and the predicted application runtime (or predicted average instruction cycle number) can be weighted summed to obtain the score of the target candidate node. The resource allocation rate corresponding to the target candidate node, the predicted application runtime and the predicted average instruction cycle number can also be weighted summed to obtain the score of the target candidate node. The weight of the above-mentioned weighted summation can be set and adjusted according to the actual application scenario, and the embodiment of the present application is not specifically limited. For example, the weight corresponding to the resource allocation rate can be set to a positive number, and the weight corresponding to the predicted application runtime and the predicted average instruction cycle number are all set to a negative number. It should be understood that in addition to using the mathematical operation method of weighted summation to calculate the score of each candidate node, other mathematical operation methods can also be used, such as using the ratio of the resource allocation rate of the target candidate node to the predicted application runtime as the score of the target candidate node.
[0114] In another embodiment, no weight may be set, and the value obtained by subtracting at least one of the predicted application runtime or the predicted average instruction cycle number from the resource allocation rate corresponding to the target candidate node is directly used as the score of the target candidate node.
[0115] For example, assuming that the target resource type of the first application is CPU resources, and the resource information of the candidate node h only includes the predicted application running time corresponding to the candidate node h, the score of the candidate node h can be calculated based on formula (4):
[0116]
[0117] The candidate node h is any one of the multiple candidate nodes of the first application, cpu_alloc h is the amount of CPU resources allocated to candidate node h, cpu_sum h is the total amount of CPU resources for candidate node h. t It is the predicted maximum resource usage of the CPU resources by the first application, that is, the predicted value of the maximum usage of the CPU resources by the first application in the target time period, which can be predicted by the method in step S201 and will not be described in detail here. Represents the candidate node h according to cpu_alloc t The CPU resource allocation rate when allocating resources to the first application. running_time is the predicted application running time corresponding to the candidate node h, that is, assuming that the first application is deployed on the candidate node h within the target period, the predicted value of the running time of the first application in this case can be predicted by the method in step S202, which is not repeated here.
[0118] For another example, assuming that the target resource types of the first application include CPU resources and memory resources, and the resource information of the candidate node h only includes the predicted application running time corresponding to the candidate node h, the score of the candidate node h can be calculated based on formula (5):
[0119]
[0120] Among them, mem_alloc h is the amount of memory resources allocated to candidate node h, mem_sum h is the total amount of memory resources for candidate node h. mem_alloc t It is the predicted maximum resource usage of the first application for memory resources, that is, the predicted value of the maximum usage of the first application for memory resources in the target time period, which can be predicted by the method in step S201 and will not be repeated here. Represents the candidate node h according to mem_alloc t The memory resource allocation ratio when allocating resources to the first application. For other parameters in formula (5), reference can be made to the relevant introduction of formula (4), which will not be described here.
[0121] It should be noted that in formula (5) and In addition to the multiplication method, other calculation methods such as summation or weighted summation may also be used, which is not specifically limited in the embodiments of the present application.
[0122] For another example, assuming that the target resource type of the first application is CPU resources, and the resource information of the candidate node h includes the predicted application running time and the predicted average instruction cycle number corresponding to the candidate node h, the score of the candidate node h can be calculated based on formula (6):
[0123]
[0124] Among them, CPI h is the predicted average instruction cycle number corresponding to the candidate node h, that is, assuming that the first application is deployed on the candidate node h within the target period, the predicted value of the average instruction cycle number of the first application in this case can be predicted by the method in step S202, which is not repeated here. The other parameters in formula (6) can refer to the relevant introduction of formula (5), which is not repeated here.
[0125] For another example, assuming that the target resource types of the first application include CPU resources and memory resources, and the resource information of the candidate node h includes the predicted application running time and the predicted average instruction cycle number corresponding to the candidate node h, the score of the candidate node h can be calculated based on formula (7):
[0126]
[0127] The parameters in formula (7) can refer to the relevant introduction of the previous formulas (4) to (6), which will not be repeated here.
[0128] Next, combine Figure 5 ,right Figure 2 The application deployment method provided is described with specific examples.
[0129] like Figure 5As shown, the infrastructure 100 includes multiple nodes (nodes 1 to n are taken as examples in the figure), and each node has a certain amount of basic resources (such as CPU, memory, disk, etc.). The cloud management platform 200 is used to manage the infrastructure 100. It collects the resource usage of each node in the infrastructure 100 (which may include total resources, allocated resources, remaining resources, resource utilization, etc.) in a unified manner, thereby obtaining resource usage information of each node in the infrastructure 100, and the cloud management platform 200 can also update the recorded resource usage information (such as periodic or irregular updates).
[0130] For a certain application of the user, the cloud management platform 200 can select a corresponding model according to the application type of the application (refer to the resource prediction model and performance prediction model in steps S201 and S202), and obtain the predicted maximum resource usage of the application based on the selected model prediction. It can also obtain information such as the predicted application running time and / or the predicted average number of instruction cycles of the application on each node based on the model prediction.
[0131] Then, based on the above information obtained by prediction, the cloud management platform 200 scores the nodes in the infrastructure 100 (refer to the relevant introduction in step S203), and then determines the target deployment node for the application from the infrastructure 100, and then schedules the application to run on the target deployment node. The target deployment node provides the application with the required resources to ensure the performance of the application. Correspondingly, the cloud management platform 200 can also update the recorded resource usage information, indicating that part of the resources in the target deployment node have been allocated (allocated to the application), and as the application runs on the target deployment node, the resource utilization of the target deployment node (such as CPU utilization, memory utilization, etc.) may also change. At this time, the cloud management platform 200 will also update the resource usage information. When the application is finished running, the target deployment node can also release the resources previously allocated to the application. At this time, the cloud management platform 200 will also update the resource usage information.
[0132] In summary, the embodiment of the present application determines the target deployment node of the first application based on the predicted maximum resource usage of the application in the target period, the resource allocation of each candidate node, the predicted application running time and / or the predicted average instruction cycle number of the application deployed on each candidate node. On the one hand, the cloud management platform 200 of the cloud service provider considers the predicted maximum resource usage of the application and the resource allocation of each candidate node when determining the target deployment node, which helps to improve the overall resource utilization of the cloud service provider and reduce resource waste. On the other hand, if the predicted running time of the application deployed on each candidate node is considered when determining the target deployment node, in order to expect to deploy the application on a node with a shorter running time, it helps to improve the resource scheduling efficiency of the cloud service provider, shorten the average resource scheduling time, and thus improve the user experience of the cloud service provider. If the predicted average instruction cycle number of the application deployed on each candidate node is considered when determining the target deployment node, in order to expect to deploy the application on a node with a smaller CPI, it helps to improve the response rate of the application, thereby improving the user experience. Therefore, the application deployment method of the embodiment of the present application can not only ensure a higher resource utilization rate, reduce resource waste, but also improve the user experience.
[0133] See also Figure 6 , Figure 6 It is a structural diagram of a cloud management platform 200 provided in an embodiment of the present application, including a prediction module 201 and a determination module 202.
[0134] The prediction module 201 is used to predict the predicted maximum resource usage of the application within the target time period, and is also used to predict multiple groups of prediction information corresponding to multiple candidate nodes, wherein the target candidate node is any one of the multiple candidate nodes, and the prediction information corresponding to the target candidate node includes the predicted application running time and / or the predicted average number of instruction cycles when the application is deployed on the target candidate node within the target time period.
[0135] The determination module 202 is used to determine the target deployment node of the application from multiple candidate nodes based on the predicted maximum resource usage, multiple groups of prediction information and resource allocation information, wherein the resource allocation information is used to indicate the resource allocation status of the multiple candidate nodes.
[0136] Optionally, the predicted maximum resource usage corresponds to one or more of processor resources, memory resources, and disk resources.
[0137] Optionally, the above-mentioned processor resources include one or more of central processing unit resources, neural network processor resources, graphics processor resources, and data processor resources.
[0138] Optionally, the determination module 202 is specifically used to: determine multiple resource allocation rates corresponding to multiple candidate nodes one by one based on the predicted maximum resource usage and resource allocation information, wherein the resource allocation rate corresponding to the target candidate node is the resource allocation rate when the target candidate node allocates resources to the application according to the predicted maximum resource usage; determine the scores of the multiple candidate nodes according to the multiple resource allocation rates and the multiple groups of prediction information, and determine the candidate node with the highest score among the multiple candidate nodes as the target deployment node of the application.
[0139] Optionally, the score of the target candidate node is a value obtained by subtracting at least one of the predicted application running time or the predicted average instruction cycle number from the resource allocation rate corresponding to the target candidate node.
[0140] Optionally, the determination module 202 is further configured to: determine a plurality of candidate nodes from the plurality of nodes based on the predicted maximum resource usage and available resource amounts of the plurality of nodes.
[0141] Optionally, the application belongs to a first application type, and the prediction module 201 is specifically used to: obtain a resource usage interval to which the predicted maximum resource usage belongs based on a resource prediction model corresponding to the first application type, wherein the resource usage interval is one of multiple preset resource usage intervals; and determine the predicted maximum resource usage based on the resource usage interval to which the predicted maximum resource usage belongs.
[0142] Optionally, the prediction module 201 is specifically used to: predict the resource usage range to which the predicted maximum resource usage belongs based on one or more information including the application's resource application amount, application name, application identifier, historical resource usage indicators, resource utilization rates of multiple candidate nodes, and a resource prediction model corresponding to the first application type, wherein the historical resource usage indicators include one or more of the historical maximum resource utilization rate and the preset percentile resource utilization rate.
[0143] Optionally, the application belongs to the first application type, and the prediction module 201 is specifically used to: obtain time series data of resource usage of the application in a historical period corresponding to the target period; and obtain the predicted maximum resource usage based on the time series data and a resource prediction model corresponding to the first application type.
[0144] Optionally, the prediction module 201 is specifically used to: predict the predicted average number of instruction cycles for deploying the application on the target candidate node within the target time period based on the predicted maximum resource usage, the resource utilization of the target candidate node and the number of requests per second corresponding to the application.
[0145] It should be noted that the above prediction module 201 and determination module 202 can be implemented by software or hardware. For example, the following takes the prediction module 201 as an example to introduce the implementation of the prediction module 201. Similarly, the implementation of the above other modules can refer to the implementation of the prediction module 201.
[0146] As an example of a software functional unit, the prediction module 201 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the prediction module 201 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0147] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0148] As an example of a hardware functional unit, the prediction module 201 may include at least one computing device, such as a server, etc. Alternatively, the prediction module 201 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0149] The multiple computing devices included in the prediction module 201 can be distributed in the same region or in different regions. The multiple computing devices included in the prediction module 201 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the prediction module 201 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0150] It should be noted that, in other embodiments, both the prediction module 201 and the determination module 202 can be used to execute Figure 2 The steps in the application deployment method of each of the above modules can be specified as needed, and they are implemented respectively. Figure 2 The different steps in the application deployment method are used to implement all the functions of the cloud management platform 200.
[0151] It should also be noted that Figure 6 The cloud management platform 200 may correspond to Figure 1 The cloud management platform 200 is used to implement Figure 2 For details on how to deploy the application, please refer to the above description and will not be repeated here. Figure 6 The cloud management platform 200 is only used as an example to illustrate the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the cloud management platform 200 can be divided into other different functional modules to complete all or part of the functions described above.
[0152] See also Figure 7 The present application also provides a computing device 700, including a bus 702, a processor 704, a memory 706, and a communication interface 708. The processor 704, the memory 706, and the communication interface 708 communicate with each other through the bus 702. The computing device 700 can be a server, a terminal device, etc. It should be understood that the present application does not limit the number of processors and memories in the computing device 700.
[0153] The bus 702 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7The bus 702 may include a path for transmitting information between various components of the computing device 700 (eg, the memory 706, the processor 704, and the communication interface 708).
[0154] The processor 704 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0155] The memory 706 may include a volatile memory, such as a random access memory (RAM). The processor 704 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0156] The memory 706 stores executable program codes. The processor 704 executes the executable program codes to respectively implement Figure 6 The functions of the prediction module 201 and the determination module 202 in Figure 2 The application deployment method.
[0157] The communication interface 708 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 700 and other devices or communication networks.
[0158] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0159] like Figure 8 As shown, the computing device cluster includes at least one computing device 700. The memory 706 in one or more computing devices 700 in the computing device cluster may store the same Figure 2 Instructions for application deployment methods.
[0160] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store a memory for executing Figure 2 In other words, the combination of one or more computing devices 700 can jointly execute the instructions for implementing Figure 2 Instructions for application deployment methods.
[0161] It should be noted that the memory 706 in different computing devices 700 in the computing device cluster may store different instructions, which are respectively used to execute Figure 6 That is, the instructions stored in the memory 706 of different computing devices 700 can implement some functions of the cloud management platform 200. Figure 6 The functions of one or more modules in the prediction module 201 and the determination module 202.
[0162] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig. 9 A possible implementation is shown. Fig. 9 As shown, two computing devices 700A and 700B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device. In this type of possible implementation, the memory 706 in the computing device 700A stores instructions for executing the functions of the prediction module 201. At the same time, the memory 706 in the computing device 700B stores instructions for executing the functions of the determination module 202.
[0163] It should be understood that Fig. 9 The functions of the computing device 700A shown in FIG. 7 may also be jointly completed by multiple computing devices 700. Similarly, the functions of the computing device 700B may also be jointly completed by multiple computing devices 700.
[0164] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Fig. 9 The difference is that the memory 706 in one or more computing devices 700 in the computing device cluster may store the same memory for executing Figure 2 Instructions for application deployment methods.
[0165] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store a memory for executing Figure 2 In other words, the combination of one or more computing devices 700 can jointly execute the instructions for executing Figure 2Instructions for application deployment methods.
[0166] The present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct a computing device cluster (including at least one computing device 700) to execute Figure 2 The application deployment method.
[0167] The present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device (such as computing device 700) or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes Figure 2 The application deployment method.
[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. An application deployment method, characterized in that: The method is applied to a cloud management platform, the cloud management platform is used to manage infrastructure, and an application deployed by a user runs on the infrastructure. The method includes: Predicting and obtaining the predicted maximum resource usage of the application within the target time period; Predicting and obtaining multiple groups of prediction information corresponding to multiple candidate nodes one by one, wherein the target candidate node is any one of the multiple candidate nodes, and the prediction information corresponding to the target candidate node includes the predicted application running time and / or the predicted average number of instruction cycles of deploying the application on the target candidate node within the target time period; A target deployment node for the application is determined from the multiple candidate nodes based on the predicted maximum resource usage, the multiple groups of prediction information, and resource allocation information, wherein the resource allocation information is used to indicate resource allocation conditions of the multiple candidate nodes.
2. The method according to claim 1, characterized in that The predicted maximum resource usage corresponds to one or more of processor resources, memory resources, and disk resources.
3. The method according to claim 2, characterized in that The processor resources include one or more of central processing unit resources, neural network processor resources, graphics processor resources, and data processor resources.
4. The method according to any one of claims 1 to 3, characterized in that The determining the target deployment node of the application from the multiple candidate nodes based on the predicted maximum resource usage, the multiple groups of prediction information and the resource allocation information includes: Determine a plurality of resource allocation rates corresponding to the plurality of candidate nodes one by one based on the predicted maximum resource usage and the resource allocation information, wherein the resource allocation rate corresponding to the target candidate node is the resource allocation rate when the target candidate node allocates resources to the application according to the predicted maximum resource usage; The scores of the multiple candidate nodes are respectively determined according to the multiple resource allocation rates and the multiple groups of prediction information, and the candidate node with the highest score among the multiple candidate nodes is determined as the target deployment node of the application.
5. The method according to claim 4, characterized in that The score of the target candidate node is a value obtained by subtracting at least one of the predicted application running time or the predicted average instruction cycle number from the resource allocation rate corresponding to the target candidate node.
6. The method according to any one of claims 1 to 5, characterized in that Before the prediction obtains a plurality of sets of prediction information corresponding one-to-one to a plurality of candidate nodes, the method further includes: Based on the predicted maximum resource usage and available resource amounts of the multiple nodes, the multiple candidate nodes are determined from the multiple nodes.
7. The method according to any one of claims 1 to 6, characterized in that The application belongs to the first application type, and the prediction obtains the predicted maximum resource usage of the application in the target time period, including: obtaining, based on the resource prediction model corresponding to the first application type, a resource usage interval to which the predicted maximum resource usage belongs, wherein the resource usage interval is one of a plurality of preset resource usage intervals; The predicted maximum resource usage is determined based on the resource usage interval to which the predicted maximum resource usage belongs.
8. The method according to claim 7, characterized in that The obtaining, according to the resource prediction model corresponding to the first application type, a resource usage interval to which the predicted maximum resource usage belongs, includes: Based on one or more information including the resource application amount of the application, the application name, the application identifier, the historical resource usage index, the resource utilization rate of the multiple candidate nodes, and the resource prediction model corresponding to the first application type, the resource usage interval to which the predicted maximum resource usage belongs is predicted, wherein the historical resource usage index includes one or more of the historical maximum resource utilization rate, the preset percentile resource utilization rate, the historical maximum resource usage, and the preset percentile resource usage.
9. The method according to any one of claims 1 to 6, characterized in that The application belongs to the first application type, and the prediction obtains the predicted maximum resource usage of the application in the target time period, including: Obtaining time series data of resource usage of the application in a historical period corresponding to the target period; The predicted maximum resource usage is obtained according to the time series data and a resource prediction model corresponding to the first application type.
10. The method according to any one of claims 1 to 9, characterized in that The prediction obtains multiple sets of prediction information corresponding to multiple candidate nodes one by one, including: The predicted average number of instruction cycles for deploying the application on the target candidate node within the target time period is predicted based on the predicted maximum resource usage, the resource utilization rate of the target candidate node and the number of requests per second corresponding to the application.
11. A cloud management platform, characterized in that: The cloud management platform is used to manage infrastructure, on which applications deployed by users run. The cloud management platform includes: A prediction module is used to predict the maximum resource usage of the application within the target period; The prediction module is further used to predict and obtain multiple groups of prediction information corresponding to multiple candidate nodes one by one, wherein the multiple candidate nodes are part or all of the multiple nodes, the target candidate node is any one of the multiple candidate nodes, and the prediction information corresponding to the target candidate node includes the predicted application running time and / or the predicted average instruction cycle number of the application deployed on the target candidate node within the target time period; A determination module is used to determine the target deployment node of the application from the multiple candidate nodes based on the predicted maximum resource usage, the multiple groups of prediction information and resource allocation information, wherein the resource allocation information is used to indicate the resource allocation status of the multiple candidate nodes.
12. The scheduler according to claim 11, characterized in that The predicted maximum resource usage corresponds to one or more of processor resources, memory resources, and disk resources.
13. The scheduler according to claim 12, characterized in that: The processor resources include one or more of central processing unit resources, neural network processor resources, graphics processor resources, and data processor resources.
14. The scheduler according to any one of claims 11 to 13, characterized in that: The determination module is specifically used for: Determine a plurality of resource allocation rates corresponding to the plurality of candidate nodes one by one based on the predicted maximum resource usage and the resource allocation information, wherein the resource allocation rate corresponding to the target candidate node is the resource allocation rate when the target candidate node allocates resources to the application according to the predicted maximum resource usage; The scores of the multiple candidate nodes are respectively determined according to the multiple resource allocation rates and the multiple groups of prediction information, and the candidate node with the highest score among the multiple candidate nodes is determined as the target deployment node of the application.
15. The scheduler according to claim 14, characterized in that: The score of the target candidate node is a value obtained by subtracting at least one of the predicted application running time or the predicted average instruction cycle number from the resource allocation rate corresponding to the target candidate node.
16. The scheduler according to any one of claims 11 to 15, characterized in that: The determining module is also used for: The plurality of candidate nodes are determined from the plurality of nodes based on the predicted maximum resource usage and available resource amounts of the plurality of nodes.
17. The scheduler according to any one of claims 11 to 16, characterized in that: The application belongs to the first application type, and the prediction module is specifically used for: obtaining, based on the resource prediction model corresponding to the first application type, a resource usage interval to which the predicted maximum resource usage belongs, wherein the resource usage interval is one of a plurality of preset resource usage intervals; The predicted maximum resource usage is determined based on the resource usage interval to which the predicted maximum resource usage belongs.
18. The scheduler according to claim 17, characterized in that: The prediction module is specifically used for: Based on one or more information including the resource application amount of the application, the application name, the application identifier, the historical resource usage index, the resource utilization rates of the multiple candidate nodes, and the resource prediction model corresponding to the first application type, the resource usage range to which the predicted maximum resource usage belongs is predicted, wherein the historical resource usage index includes one or more of the historical maximum resource utilization rate and the preset percentile resource utilization rate.
19. The scheduler according to any one of claims 11 to 16, characterized in that: The application belongs to the first application type, and the prediction module is specifically used for: Obtaining time series data of resource usage of the application in a historical period corresponding to the target period; The predicted maximum resource usage is obtained according to the time series data and a resource prediction model corresponding to the first application type.
20. The scheduler according to any one of claims 11 to 19, characterized in that: The prediction module is specifically used for: The predicted average number of instruction cycles for deploying the application on the target candidate node within the target time period is predicted based on the predicted maximum resource usage, the resource utilization rate of the target candidate node and the number of requests per second corresponding to the application.
21. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 10.
22. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 10.
23. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 10.
Citation Information
Cited By
WEB application accelerated access method based on cloud computer
CN120561396A
Application processing method and apparatus, and electronic device
CN122672984A