Cloud host scheduling method and device, program product and storage medium
By predicting cloud host demand using a network model based on AttnLSTM and combining it with host cost-effectiveness, the procurement and deployment of cloud hosts are optimized, solving the problems of inaccurate scheduling and resource waste in existing technologies, and achieving efficient resource utilization and system stability.
Patent Information
- Application Number
- CN202511797601.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-02-10
AI Technical Summary
Existing cloud server scheduling methods cannot provide optimal scheduling results, especially when dealing with large-scale or dynamically changing cloud server environments, and suffer from problems such as high computational complexity, resource waste, and inaccurate scheduling.
By acquiring historical demand data for cloud servers, using first-order network models such as AttnLSTM to predict future demand, and combining this with the host's cost-effectiveness, we can optimize host procurement and deployment decisions. We can also use data analysis techniques to classify and optimize host migration.
It improved the accuracy of cloud server scheduling and resource utilization, reduced resource waste, optimized procurement decisions, and enhanced system stability and efficiency.
Smart Images

Figure CN121509522A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing big data edge computing, and particularly relates to a cloud host scheduling method, device, program product and storage medium. BACKGROUND
[0002] The prior art cloud host scheduling method is as follows, one is a cloud host scheduling method based on a genetic algorithm, the genetic algorithm can effectively handle complex cloud host scheduling problems through global optimization search. Its good adaptability makes it applicable to virtualization environments of different scales and types, and it can effectively cope with dynamic changes in workloads and resource allocation. Another is a cloud host scheduling method based on a heuristic algorithm, the heuristic algorithm is usually computationally efficient and can find a scheduling scheme close to the optimal solution in a limited time. Its simple and intuitive design makes it easy to implement and adjust in practical applications, especially in cases where the scale is small or the requirement for computing resources is low, it performs well. However, the cloud host scheduling scheme of the prior art cannot provide the best scheduling effect. SUMMARY
[0003] To solve the above technical problems, the embodiments of the present application provide a cloud host scheduling method, device, program product and storage medium, which can provide a basis for improving the accuracy of cloud host scheduling.
[0004] The cloud host scheduling method provided by the present application comprises: obtaining a historical demand data set of the cloud host; inputting the historical demand data set into a first network model to obtain a demand prediction result of the cloud host through the first network model; determining the type of the host to which the cloud host is to be deployed according to the demand prediction result; obtaining a performance-price ratio value set of all hosts corresponding to the type, and determining the host to which the cloud host is to be deployed according to the performance-price ratio value set.
[0005] The cloud host scheduling device provided by the present application comprises a processor and a memory, the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the above cloud host scheduling method.
[0006] The computer program product provided by the present application comprises a computer program, which realizes the above cloud host scheduling method when executed by a processor.
[0007] The computer readable storage medium provided by the present application is used to store a computer program, which makes a computer execute the above cloud host scheduling method.
[0008] In the technical solution of the present application, the historical demand data set of the cloud host is obtained; the historical demand data set is input into the first network model, and the demand prediction result of the cloud host is obtained through the first network model; the type of the host for purchasing and deploying the cloud host is determined according to the demand prediction result; the performance-price ratio value set of all hosts corresponding to the type is obtained, and the host for purchasing and deploying the cloud host is determined according to the performance-price ratio value set. In this way, the demand of the future cloud host can be predicted according to the historical demand data of the cloud host through the first network model, the accuracy of the prediction result is improved, the host for purchasing is determined in combination with the performance-price ratio of the host meeting the demand, the decision of purchasing the host is significantly optimized, resource waste is reduced, and a basis for improving the accuracy of cloud host scheduling is provided. BRIEF DESCRIPTION OF DRAWINGS
[0009] The accompanying drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The schematic embodiments of the present application and the description thereof are used to explain the present application, and do not constitute an improper limitation on the present application.
[0010] Figure 1 is a flow schematic diagram of the cloud host scheduling method provided by the embodiment of the present application; Figure 2 is a schematic diagram of the cloud host and the host provided by the embodiment of the present application; Figure 3 is a schematic diagram of the AttnLSTM structure provided by the embodiment of the present application; Figure 4 is a schematic diagram of the single-node deployment cloud host deployment selection node method provided by the embodiment of the present application; Figure 5 is a schematic diagram of the structure composition of the cloud host scheduling device provided by the embodiment of the present application; Figure 6 is a schematic structural diagram of a cloud host scheduling device provided by the embodiment of the present application; Figure 7 is a schematic structural diagram of a chip according to the embodiment of the present application. DETAILED DESCRIPTION
[0011] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0012] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. It is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. It should also be noted that the terms "first, second, third" used in the embodiments of this application are merely for distinguishing similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0013] The term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship. It should also be understood that "instruction" mentioned in the embodiments of this application can be a direct instruction, an indirect instruction, or an indication of a related relationship. For example, A instructing B can mean that A directly instructs B, for example, B can be obtained through A; it can also mean that A indirectly instructs B, for example, A instructs C, B can be obtained through C; or it can mean that there is a related relationship between A and B. It should also be understood that "correspondence" mentioned in the embodiments of this application can mean that there is a direct or indirect correspondence between two things, or an related relationship between two things, or an instructing and being instructed, or a configuring and being configured relationship, etc. It should also be understood that... To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and they all fall within the protection scope of the embodiments of this application.
[0014] Existing methods for cloud server scheduling include one based on genetic algorithms. Genetic algorithms can effectively handle complex cloud server scheduling problems through global optimization search. Their good adaptability makes them suitable for virtualization environments of different sizes and types, and they can effectively cope with dynamically changing workloads and resource configurations. However, the computational complexity of genetic algorithm-based cloud server scheduling methods is high because genetic algorithms involve a large number of individuals and complex crossover and mutation operations, which can lead to high computational costs, especially when dealing with large-scale problems. Although they can find good solutions, genetic algorithms do not guarantee finding the globally optimal solution, but rather seek approximate solutions that satisfy the optimization objective.
[0015] Another approach is cloud server scheduling based on heuristic algorithms. Heuristic algorithms are typically computationally efficient, capable of finding a scheduling scheme close to the optimal solution within a limited time. Their simple and intuitive design makes them easy to implement and adjust in practical applications, especially performing well in scenarios with small processing scales or low computational resource requirements. However, heuristic-based cloud server scheduling methods generally cannot guarantee finding the global optimum because the search process is limited by heuristic rules or strategies, potentially getting stuck in local optima. Furthermore, due to the lack of global optimization capabilities, they may not provide optimal scheduling results for complex cloud server environments or dynamically changing workloads.
[0016] Therefore, how to achieve the best scheduling effect for cloud servers becomes a problem that needs to be considered. To this end, the following technical solutions are proposed according to embodiments of this application.
[0017] To facilitate understanding of the technical solutions of the embodiments of this application, the technical solutions of this application are described in detail below through specific embodiments. The above-mentioned related technologies are optional solutions and can be arbitrarily combined with the technical solutions of the embodiments of this application, all of which fall within the protection scope of the embodiments of this application. The embodiments of this application include at least some of the following contents.
[0018] It should be noted that cloud server scheduling includes cloud server deployment and cloud server migration, as well as other cloud server-related operations.
[0019] Figure 1 This is a flowchart illustrating the cloud host scheduling method provided in the embodiments of this application, as shown below. Figure 1 As shown, the cloud host scheduling method includes the following steps: Step 101: Obtain the historical demand data set for cloud servers.
[0020] Step 102: Input the historical demand data set into the first network model, and obtain the demand prediction results of the cloud host through the first network model.
[0021] Step 103: Determine the type of host machine to purchase and deploy the cloud server based on the demand forecast results.
[0022] Step 104: Obtain the set of cost-effectiveness values for all host machines corresponding to the type, and determine the host machine to purchase and deploy the cloud server based on the cost-effectiveness value set.
[0023] In some implementations, when the current host machine capacity cannot meet the user's cloud server needs, it is necessary to purchase additional host machines for cloud server deployment. Specifically, a historical demand data set for cloud servers is obtained and input into a first network model. The first network model then predicts the cloud server demand, determining the type of host machine to purchase for deployment based on the demand prediction. A set of cost-effectiveness values for all host machines corresponding to each type is then obtained, and the host machine to be purchased is determined based on this cost-effectiveness value set. In this way, the first network model accurately predicts cloud server demand, significantly optimizing host machine procurement decisions, reducing resource waste, and providing a foundation for improving the accuracy of cloud server scheduling.
[0024] In some implementations, the historical demand data set of cloud servers is the CPU and memory ratio of cloud servers on previous days, wherein the CPU and memory ratio is calculated as shown in equation (1): (1) in, Indicates the ratio of CPU to memory. Indicates the number of cores. This indicates the memory size. The specific unit of memory is not limited in this application, but in practical applications, it must remain consistent when used as input to the first network model.
[0025] In some implementations, before obtaining the historical demand data set for cloud servers, the method further includes: obtaining historical rental requests for cloud servers, wherein the historical rental requests include the number of CPU cores and the memory size of the requested cloud servers each day. Therefore, determining the historical demand data set for cloud servers based on historical rental requests means obtaining the daily CPU and memory ratio of the cloud servers.
[0026] In some implementations, the daily cloud server CPU and memory ratio is the ratio of the sum of the number of cloud server CPU cores requested in all daily rental requests to the sum of the number of cloud server memory requested in all daily rental requests.
[0027] In some implementations, after obtaining the cloud server rental requests of previous days, the CPU and memory ratio of the cloud server for each day is obtained. Specifically, the CPU and memory ratio of the cloud server of previous days is input into the first network model, and the first network model determines the demand forecast result of the cloud server for the current day based on the CPU and memory ratio of the cloud server of previous days.
[0028] It is understandable that the demand forecast result is the CPU and memory ratio of the cloud server on that day, where "that day" refers to the day to be forecasted.
[0029] In some implementations, the type of host machine to be purchased and deployed for cloud servers is determined based on demand forecasts, specifically the CPU and memory ratio of cloud servers on that day.
[0030] In some implementations, the method further includes: obtaining the number of CPU cores and / or memory of the host machine; and determining the type of the host machine based on the number of CPU cores and / or memory.
[0031] In some implementations, the number of CPU cores and / or memory of the host machine to be purchased is obtained, and the CPU and memory ratio of each host machine is calculated according to Equation (1), that is, the CPU and memory of the host machine are divided to obtain the CPU and memory ratio, and the type of host machine is determined based on the CPU and memory ratio of each host machine.
[0032] In some implementations, the host machine is classified into three types: CPU-based host machine, general-purpose host machine, and memory-based host machine. A host machine is classified as a CPU-based host machine when its CPU-to-memory ratio is greater than a first threshold; as a memory-based host machine when its CPU-to-memory ratio is less than a second threshold; and as a general-purpose host machine when its CPU-to-memory ratio is less than or equal to the first threshold and greater than or equal to the second threshold. It is understood that the first threshold is greater than the second threshold, and the specific determination of the first and second thresholds can be made according to actual circumstances; this application does not impose specific limitations on this.
[0033] In some implementations, for multiple candidate host machines to be purchased, after calculating the CPU and memory ratios of the multiple candidate host machines, the multiple candidate host machines are sorted from largest to smallest CPU and memory ratios, and the multiple candidate host machines are divided into three equal parts, namely, CPU-type host machines, general-purpose host machines, and memory-type host machines.
[0034] In some implementations, after obtaining the type of host machine to be purchased, the cost-performance ratio set of all host machines corresponding to the type to be selected is obtained, and the host machine to be finally purchased and deployed as a cloud host is determined based on the cost-performance ratio set.
[0035] In some implementations, the host machine's cost-effectiveness is calculated as shown in equation (2): (2) in, Indicating cost-effectiveness, Indicates the number of cores. Indicates memory size. Indicates the ratio of CPU to memory. express The median of This indicates the price of the host machine. Among them, For multiple host machines corresponding to a given host type of the median.
[0036] In some implementations, after obtaining the set of host machine cost-effectiveness values, the cost-effectiveness values in the set are sorted from high to low, and the host machine with the highest cost-effectiveness that meets the requirements is selected for purchase.
[0037] It is understandable that the number of CPU cores, memory size, and price of the host machine were taken into account when calculating the cost-effectiveness.
[0038] In some implementations, the first network model includes a Long Short-Term Memory (LSTM) neural network module and an attention mechanism module, the attention mechanism module being used to determine the weight of each historical demand data in the historical demand data set.
[0039] In some implementations, the first network prediction model needs to be trained before using it to predict the demand forecast for cloud hosts. Specifically, the first network model is trained using past daily cloud host rental requests and the CPU and memory ratios for that day are predicted to determine which type of host to purchase: a CPU-based host, a general-purpose host, or a memory-based host.
[0040] In some implementations, the first network model is an AttnLSTM network model, which is based on a Long Short-Term Memory (LSTM) neural network with self-attention added after each time step. That is, the first network model includes a Long Short-Term Memory (LSTM) neural network module and an attention mechanism module.
[0041] In some implementations, the first network model predicts the CPU and memory ratio of the cloud host as shown in equation (3): (3) in, This represents the CPU and memory ratio of the host machine purchased in the (i+1)th transaction, which is also the predicted demand for cloud servers on that day. This is the CPU and memory ratio of the daily cloud server demand in the past, which is also a set of historical demand data.
[0042] In some implementations, AttnLSTM can compute a weighted average of the inputs at each time step to make the model more effective at handling long-term dependencies. The self-attention layer is placed after the LSTM layer so that the LSTM can generate a sequence of hidden states, and then the self-attention layer can compute an attention score based on these time-step inputs. The formula for calculating the attention score is shown in equation (4): (4) in, Input for calculating the current time step t With input at all time steps i Attention score or similarity between them. It is a query matrix. It is the key matrix, and T is the transpose. Calculate the square root of a given number. It is the dimension of the key. Here, This serves as the input to the network model, specifically the CPU and memory ratio of the cloud server's daily requirements.
[0043] In some implementations, after the attention score is calculated, the attention weight needs to be calculated based on the attention score. The attention weight for all time steps i is obtained by performing a softmax operation on the attention scores of all time steps i. The calculation method is shown in Equation (5): (5) in, Input for the current time step t Attention weights.
[0044] In some implementations, the final output, i.e. the prediction result, is obtained by weighted summation, as shown in equation (6): (6) in, This represents the output at the current time step t, which is also the prediction result. It is attention weight. It is the value at the i-th time step, which is the aforementioned .
[0045] In some implementations, after obtaining the prediction results of the first network model, the type of host machine to be purchased is determined, the CE of all host machines corresponding to that type is calculated, and the host machine is selected for purchase based on the sorting, allowing a certain CE error.
[0046] In some implementations, the method further includes: obtaining the available CPU and available memory of each of the multiple nodes in the host machine, and obtaining the type of the cloud host to be deployed; determining the deployment node of the cloud host to be deployed based on the type of the cloud host to be deployed and the available CPU and available memory of each node.
[0047] In some implementations, for cloud host deployment, when there are multiple nodes in the host machine, the available CPU and available memory of each of the multiple nodes in the host machine are first obtained, that is, the available resources of each node in the host machine, and then the type of cloud host to be deployed is obtained; the deployment node of the cloud host to be deployed is determined according to the type of cloud host to be deployed and the available CPU and available memory of each node.
[0048] In some implementations, the method for determining the type of cloud host is the same as that for determining the type of host machine. The CPU and memory of the cloud host to be deployed are obtained, and the CPU-to-memory ratio of the cloud host to be deployed is calculated using equation (1). Then, the type of cloud host to be deployed is determined based on the CPU-to-memory ratio of the cloud host to be deployed.
[0049] In some implementations, after obtaining the CPU to memory ratio of the cloud host to be deployed, the CPU to memory ratio is compared with a third threshold and a fourth threshold to determine the type of cloud host to be deployed. Specifically, if the CPU to memory ratio of the cloud host to be deployed is greater than the third threshold, the cloud host to be deployed is a CPU-based cloud host; if the CPU to memory ratio of the cloud host to be deployed is less than the fourth threshold, the cloud host to be deployed is a memory-based cloud host; and if the CPU to memory ratio of the cloud host to be deployed is less than or equal to the third threshold and greater than or equal to the fourth threshold, the cloud host to be deployed is a general-purpose cloud host. It is understood that the third threshold is greater than the fourth threshold, and the specific determination of the third and fourth thresholds can be based on actual circumstances; this application does not impose specific limitations on this.
[0050] In some implementations, for a first node among multiple nodes, the node where the cloud host is deployed is determined based on the type of the cloud host to be deployed and the available CPU and available memory of each node, including: when the available CPU and available memory of the first node are both greater than the available CPU and available memory of the other nodes among the multiple nodes, the cloud host to be deployed is determined to be deployed on the first node; when the available CPU or available memory of the first node is greater than the available CPU or available memory of the other nodes among the multiple nodes, the deployment node of the cloud host is determined based on the type of the cloud host to be deployed.
[0051] In some implementations, for multiple nodes in the host machine, if the number of available CPU cores and the available memory size of the first node are both greater than the number of available CPU cores and the available memory size of the other nodes, then the cloud host to be deployed is deployed on the first node. If the number of available CPU cores of the first node is greater than the number of available CPU cores of the other nodes or the available memory size of the first node is greater than the available memory size of the other nodes, then the deployment node of the cloud host is determined according to the type of the cloud host to be deployed.
[0052] In some implementations, the deployment node of the cloud host is determined according to the type of the cloud host to be deployed, including: when the type of cloud host is a CPU-based cloud host or a general-purpose CPU cloud host, a host node with a large number of available CPU cores is selected; when the type of cloud host is a memory-based cloud host, a host node with a large amount of available memory is selected.
[0053] In some implementations, the host machine includes two nodes because a dual-node cloud server deployment might result in one of the host machine nodes being insufficient, necessitating the purchase of additional host machines. When deploying cloud servers, if a balanced placement (i.e., single-node deployment) is chosen, the selection is based on the CPU-based, general-purpose, or memory-based configuration. If both available CPU and available memory in host node 1 are greater than those in host node 2, the cloud server is deployed on node 1. If both available CPU and available memory in host node 1 are less than those in host node 2, the cloud server is deployed on node 2. If only one of available CPU or available memory is greater in host node 1, the selection is based on whether the cloud server is CPU-based, general-purpose, or memory-based. For CPU-based and general-purpose cloud servers, the host node with the greater available CPU is selected; for memory-based cloud servers, the host node with the greater available memory is selected.
[0054] In some implementations, the method further includes: obtaining available CPU resources of multiple host machines; sorting the multiple host machines according to the available CPU resources to obtain a first order of the multiple host machines; and migrating cloud hosts deployed in the multiple host machines according to the first order.
[0055] In some implementations, because there are requests to unsubscribe from cloud servers in the daily requests, the available CPU and memory on the host machine include not only the resources of undeployed cloud servers but also the resources included in the unsubscription requests. Therefore, the host machine can continue deploying cloud servers. To centralize cloud server deployment and achieve efficient scheduling, the order of host machines is determined based on their resources, enabling the migration of some cloud servers. This allows for more centralized cloud server deployment and improves host machine resource utilization.
[0056] In some implementations, the available CPU resources of multiple host machines are obtained, and the available CPU resources of the multiple host machines are sorted from low to high to obtain the first order of the multiple host machines, that is, the sorted list of host machines. The cloud hosts deployed in the first host machine are migrated to the remaining host machines by traversing from the last to the front of the sorted list until there are no cloud hosts deployed in the first host machine, or the daily migration limit or resource limit is reached.
[0057] Understandably, the first host machine is the one with the least available CPU resources. It should also be understood that only the cloud servers within the first host machine are being migrated.
[0058] In some implementations, the method further includes: obtaining a resource list of multiple host machines after migration; determining whether the resource list meets the cloud host deployment requirements; and if the cloud host deployment requirements are not met, determining that host machines need to be purchased.
[0059] In some implementations, after migrating cloud hosts each day, the cloud host rental requests for the next day are deployed by iterating through the list of migrated host machines. That is, the cloud hosts for the next day are deployed on host machines that can meet the rental requests for cloud hosts on that day. If at least one cloud host cannot be deployed, that is, if there are no host machines with available resources to meet the rental requests for cloud hosts on that day, then a host machine is purchased and deployed on the purchased host machine.
[0060] As is understandable, the method of purchasing a host machine is as described above, and will not be repeated here.
[0061] The technical solution of this application embodiment involves obtaining a historical demand data set for cloud servers; inputting the historical demand data set into a first network model, and using the first network model to predict the demand forecast results for cloud servers; determining the type of host machine to be purchased and deployed for the cloud servers based on the demand forecast results; obtaining a set of cost-effectiveness values for all host machines corresponding to the type; and determining the host machine to be purchased and deployed for the cloud servers based on the cost-effectiveness value set. In this way, the demand for cloud servers can be predicted based on the historical demand data of cloud servers using the first network model, improving the accuracy of the prediction results. Combining the cost-effectiveness of host machines that meet the demand, the host machine to be purchased is determined, significantly optimizing the host machine procurement decision, reducing resource waste, and providing a foundation for improving the accuracy of cloud server scheduling.
[0062] Based on the foregoing embodiments, the cloud host scheduling method provided in the embodiments of this application will be further described.
[0063] This application implements a cloud server scheduling strategy based on data analysis. This embodiment deeply analyzes historical request data of cloud servers and, with the help of deep learning algorithms, accurately predicts the type of host machine that will need to be purchased in the future, thereby significantly improving the scientific rigor and foresight of host machine procurement decisions. During the deployment of cloud servers, intelligent selection is performed based on the remaining space of the host machine, aiming to achieve efficient resource allocation and comprehensive optimization of system performance. Furthermore, during the cloud server migration process, advanced fragmentation sorting technology is used to select suitable host machines for deployment from smallest to largest, further simplifying the migration process. In summary, this application embodiment not only significantly reduces computational costs but also explores the optimal solution path from complex data.
[0064] This application implements a cloud host scheduling method based on data analysis. The purpose of this method is to solve the problem of how to purchase and deploy the host machine at the lowest possible cost when the cloud host is deployed on the host machine. Figure 2This is a schematic diagram of a cloud host and a host machine provided in an embodiment of this application. The required resources for the host machine and the cloud host machine include at least the following: Host machine: Model, number of CPUs, memory size, price, daily energy consumption; Each host machine has two NUMA nodes, and the two nodes share the host machine's CPU and memory equally.
[0065] Cloud server: model, required CPU, required memory, single-node deployment or dual-node deployment.
[0066] There are n types of host machines available for purchase and m types of cloud servers available for users to rent. Within x days, there are multiple rental and cancellation requests each day. When no cloud servers are deployed on a host machine, the host machine can be shut down to reduce daily energy consumption. Furthermore, at the end of each day, a 5% migration of the host machine can be performed to ensure its utilization rate.
[0067] This application embodiment categorizes host machines before purchase, classifying them into three types: CPU-based, general-purpose, and memory-based. During each host machine purchase, data analytics are used to evaluate CPU performance, memory capacity, and price, and the AttnLSTM model is employed to select the most cost-effective option. The AttnLSTM model can more effectively process time-series data, capture long-term dependencies, and accurately predict changing trends in host machine requirements. During the deployment phase, data analytics are also used to optimize cloud server configurations. Furthermore, to maintain high host machine utilization, a 5% or less host machine migration is implemented daily.
[0068] Specifically, the embodiments of this application include the following: 1. Classify host machines First, the CPU and memory of the host machine are divided to obtain the CPU to memory ratio, as shown in Equation (1). Based on R, the host machine is divided into three equal parts, corresponding to CPU-type host machine, general-purpose host machine, and memory-type host machine respectively.
[0069] 2. Host demand forecasting and efficient procurement strategies based on historical leasing data Before purchasing a host machine, it is necessary to sort the cost-effectiveness of CPU-based host machines, general-purpose host machines, and memory-based host machines. Sort them from high to low according to formula (2).
[0070] When the host capacity is insufficient to deploy the current cloud host and a new host needs to be purchased, a deep learning model can be trained using the previous daily rental requests for cloud hosts and the CPU and memory ratio of the day can be predicted to determine which type of host to purchase: CPU-type host, general-purpose host, or memory-type host, as shown in Equation (3).
[0071] AttnLSTM is based on Long Short-Term Memory (LSTM) neural networks, with self-attention added after each time step. Figure 3 This is a schematic diagram of the AttnLSTM structure provided in the embodiments of this application, as shown below. Figure 3 As shown, AttnLSTM can compute a weighted average of the inputs at each time step, making the model more effective at handling long-term dependencies. Placing the self-attention layer after the LSTM layer allows the LSTM to generate a sequence of hidden states, such as... Figure 3 In Then, the self-attention layer can calculate the attention score based on these time-step inputs and hidden state sequences, where the input of the model is... Figure 3 In The formula for calculating the attention score is shown in Equation (4). The attention weight is then calculated using Equation (5). The attention weight is obtained by performing a softmax operation on the attention scores at all time steps i. Finally, the weighted sum is calculated to obtain the final output, as shown in Equation (6). After obtaining the prediction results, the host type is selected from the three types: CPU-type host, general-purpose host, and memory-type host. The CE of the host type is calculated, and the host is selected and purchased according to the sorting, allowing for a certain CE error.
[0072] 3. Cloud server deployment methods Because a dual-node cloud server deployment might result in insufficient nodes on one side of the host machine, a new host machine is purchased. When deploying the cloud server using a balanced placement (i.e., single-node deployment), the choice between CPU-based, general-purpose, and memory-based deployments is based on the CPU-to-memory ratio. If both available CPU and available memory in host node 1 are greater than those in host node 2, the server is deployed on node 1. If both available CPU and available memory in host node 1 are less than those in host node 2, the server is deployed on node 2. If only one of available CPU or available memory is greater in host node 1, the choice depends on whether the cloud server is CPU-based, general-purpose, or memory-based. For CPU-based and general-purpose deployments, the host node with the greater available CPU is selected; for memory-based deployments, the host node with the greater available memory is selected.
[0073] Figure 4 This is a schematic diagram of the single-node deployment cloud host deployment node selection method provided in this application embodiment, as shown in the figure, including the following steps: Step 401: Select the deployment node.
[0074] Step 402: Determine if the available CPU for node 1 is greater than that for node 2.
[0075] Here, node 1 and node 2 are nodes of the host machine. If the available CPU of host machine node 1 is greater than the available CPU of host machine node 2, then proceed to step 403; otherwise, proceed to step 407.
[0076] Step 403: Determine the available memory and whether node 1 is greater than node 2.
[0077] If the available memory of host node 1 is greater than the available memory of host node 2, then proceed to step 404; otherwise, proceed to step 405.
[0078] Step 404: Node 1.
[0079] In other words, if the available memory and available CPU of host node 1 are both greater than the available memory and available CPU of host node 2, then the cloud host will be deployed on host node 1. Alternatively, if the available CPU of host node 1 is greater than the available CPU of node 2, but the available memory of node 1 is less than the available memory of node 2, and the cloud host is not a memory-based cloud host, then the cloud host will be deployed on node 1.
[0080] Step 405: Determine whether the cloud server is a memory-based cloud server.
[0081] If the cloud server is a memory-based cloud server, proceed to step 406; otherwise, proceed to step 404.
[0082] Step 406: Node 2.
[0083] In other words, if the available CPU of host node 1 is greater than the available CPU of node 2, but the available memory of node 1 is less than the available memory of node 2, then if the cloud host is a memory-based cloud host, the cloud host will be deployed on node 2.
[0084] Step 407: Determine the available memory and whether node 1 is greater than node 2.
[0085] If the available memory of host node 1 is greater than the available memory of host node 2, then proceed to step 408; otherwise, proceed to step 409.
[0086] Step 408: Determine whether the cloud server is a memory-based cloud server.
[0087] If the cloud server is a memory-based cloud server, proceed to step 410; otherwise, proceed to step 409.
[0088] Step 409: Node 2.
[0089] In other words, if the available CPU and available memory of host node 1 are both less than those of host node 2, then the cloud host will be deployed on host node 2. Alternatively, if the available CPU of host node 1 is less than that of host node 2, and the available memory of host node 1 is greater than that of node 2, and if the cloud host is not a memory-based cloud host, then the cloud host will be deployed on node 2.
[0090] Step 410: Node 1.
[0091] The available CPU of host node 1 is less than that of host node 2, and the available memory of host node 1 is greater than that of node 2. If the cloud host is a memory-based cloud host, then the cloud host is deployed on node 1.
[0092] 4. Cloud server migration Because there are requests to unsubscribe from cloud servers in the daily requests, the available CPU and memory on the host machine can still be used for cloud server deployment. Before the daily migration, all host machines are sorted from lowest to highest available CPU, resulting in a sorted list of host machines. The first host machine in this sorted list can be migrated. The cloud servers on the first host machine are then iterated through from the last host in the sorted list backwards until the host machine is empty or the daily migration limit is reached.
[0093] 5. Cloud Server Deployment Selection After the cloud server is migrated, the cloud server rental request for the next day can be deployed by iterating through the host list generated after the migration until the last host is reached. If the last host still cannot meet the deployment requirements, a host will be purchased and deployed on the purchased host.
[0094] It should be noted that when predicting the CPU and memory requirements of cloud hosts on a given day, the model is not limited to the one described above. Traditional machine learning models or even the CPU and memory requirements from the previous day can also be used as the prediction result. This application does not impose specific limitations on this. Furthermore, the deployment scheme can deploy the dual-node cloud hosts separately, eliminating the need for a comprehensive assessment of the available CPU and memory resources of both host nodes. This comprehensive assessment is necessary to prevent resource waste due to insufficient space for the dual-node cloud hosts caused by unbalanced CPU and memory resources, necessitating the purchase of new host machines. Additionally, the migration scheme can use the last host machine deployed that day as the target for migration.
[0095] This application proposes a cloud server scheduling method based on data analysis, specifically including: Before purchasing a host machine, using data analysis to guide the purchase decision. The AttnLSTM model is used to predict the CPU and memory resources required for cloud server requests on a given day. The AttnLSTM model has advantages in processing time-series data and capturing long-term dependencies, enabling it to accurately predict changing trends in host machine demand. Based on the AttnLSTM prediction results, the most suitable host machine type is selected for purchase. The advantage of using AttnLSTM lies in its powerful sequence modeling capabilities, which can improve the accuracy of demand forecasting, thereby optimizing procurement decisions and reducing resource waste. The cloud server deployment scheme uses data analysis to comprehensively evaluate the available CPU and memory resources of two host machine nodes and selects the most suitable node for deployment based on the type of cloud server (CPU-based, general-purpose, memory-based), thereby optimizing resource utilization and performance. This enhances system stability and fault tolerance, and improves the efficiency of operation and maintenance management. The cloud server migration scheme uses data analysis to sort host machines by available CPU from low to high, selecting the first host machine for migration. Then, the migration process iterates backward from the last host in the host list until the host is empty or the daily migration limit is reached. This approach optimizes the migration process by sorting by CPU resources, ensuring that migration operations comply with resource utilization and constraints.
[0096] The technical advantages of this application's embodiments are as follows: Before purchasing host machines, we employ data analysis methods to optimize procurement decisions. The AttnLSTM model is used to predict the CPU and memory requirements of cloud host requests for the day. The AttnLSTM model not only effectively processes time-series data but also captures long-term dependencies, thus accurately predicting the changing trends of host machine requirements. The most suitable host machine type is selected for purchase based on the AttnLSTM prediction results. The core advantage of AttnLSTM lies in its superior sequence modeling capabilities, making demand forecasting more accurate, significantly optimizing procurement decisions, reducing resource waste, and improving overall efficiency. Furthermore, accurate resource forecasting and a reasonable deployment plan help maintain high service availability and avoid service interruptions due to insufficient resources. This method not only optimizes resource allocation and improves return on investment but also ensures service stability and reliability through efficient management, making host machine purchases more scientific and reasonable. Through data analysis of cloud host deployment plans, by comprehensively evaluating the available CPU and memory resources of two host machine nodes, the most suitable node is selected for deployment based on the cloud host type. This method optimizes resource utilization and performance, enhances system stability and fault tolerance, and improves the efficiency of operation and maintenance management. This strategy effectively improves the accuracy of resource allocation, reduces resource waste, and ensures the efficient operation and reliability of the system. The cloud host migration solution uses data analysis to sort host machines by available CPU from low to high, effectively optimizing the migration process. It selects the first host machine for migration to ensure rational resource utilization, and then iterates backward from that host until the migration conditions or daily limits are met. This method improves migration efficiency, reduces resource waste, ensures that migration operations comply with resource constraints and utilization conditions, and enhances the flexibility and effectiveness of overall resource scheduling.
[0097] This application proposes a cloud server scheduling method based on data analysis, which has broad market application prospects and can provide an efficient and intelligent solution to resource scheduling problems. This method uses advanced data analysis technology to dynamically optimize and schedule cloud server resources, maximizing resource utilization and minimizing costs. Its core innovation lies in using data-driven intelligent algorithms to perform real-time analysis and prediction of cloud servers, thereby optimizing resource allocation and improving the overall performance and stability of the system. Specifically, this cloud server scheduling method can be applied to cloud computing resource management platforms to improve service quality and user experience while reducing operating costs. Furthermore, to meet the needs of various industries, this scheduling method can provide customers with efficient and intelligent cloud computing service solutions. In addition, the efficient resource scheduling method provided in this application can also be applied to application systems such as social entertainment, online classes, and remote work. Thus, this method not only significantly reduces host machine procurement expenses but also effectively reduces energy consumption, thereby improving overall operational efficiency and economic benefits.
[0098] Figure 5 This is a schematic diagram of the structural composition of the cloud host scheduling device provided in the embodiments of this application, as shown below. Figure 5 As shown, the cloud host scheduling device includes: Acquisition unit 501 is used to acquire the historical demand data set of the cloud host; Prediction unit 502 is used to input the historical demand data set into the first network model and obtain the demand prediction result of the cloud host through the first network model; The determining unit 503 is used to determine the type of host machine to purchase and deploy cloud servers based on the demand prediction results; The acquisition unit 501 is used to acquire a set of cost-performance values for all host machines corresponding to the type; The determining unit 503 is used to determine the host machine for purchasing and deploying cloud hosts based on the set of cost-effectiveness values.
[0099] In some implementations, the acquisition unit 501 is used to acquire the available CPU and available memory of each of the multiple nodes in the host machine, and to acquire the type of the cloud host to be deployed; the determination unit 503 is used to determine the deployment node of the cloud host to be deployed based on the type of the cloud host to be deployed and the available CPU and available memory of each node.
[0100] In some implementations, for the first node among the plurality of nodes, the determining unit 503 is configured to determine that the cloud host to be deployed is deployed on the first node when the available CPU and available memory of the first node are both greater than the available CPU and available memory of the other nodes among the plurality of nodes excluding the first node; and to determine the deployment node of the cloud host according to the type of the cloud host to be deployed when the available CPU or available memory of the first node is greater than the available CPU or available memory of the other nodes among the plurality of nodes excluding the first node.
[0101] In some embodiments, the acquisition unit 501 is used to acquire available CPU resources of multiple host machines; the device further includes: a migration unit 504; the migration unit 504 is used to sort the multiple host machines according to the available CPU resources to obtain a first order of the multiple host machines; and migrate the cloud hosts deployed in the multiple host machines according to the first order.
[0102] In some embodiments, the acquisition unit 501 is used to acquire a resource list of multiple host machines after migration; the device further includes: a judgment unit 505; the judgment unit 505 is used to determine whether the cloud host deployment requirements are met based on the resource list; the determination unit 503 is used to determine that a host machine needs to be purchased if the cloud host deployment requirements are not met.
[0103] In some embodiments, the acquisition unit 501 is used to acquire the number of CPU cores and / or memory of the host machine; the determination unit 503 is used to determine the type of the host machine based on the number of CPU cores and / or memory.
[0104] In some implementations, the first network model includes a Long Short-Term Memory (LSTM) neural network module and an attention mechanism module, wherein the attention mechanism module is used to determine the weight of each historical demand data in the historical demand data set.
[0105] Those skilled in the art should understand that Figure 5 The functions of each unit in the cloud host scheduling device shown can be understood by referring to the relevant descriptions of the aforementioned methods. Figure 5 The functions of each unit in the cloud host scheduling device shown can be implemented through programs running on the processor or through specific logic circuits.
[0106] Figure 6 This is a schematic structural diagram of a cloud host scheduling device 600 provided in an embodiment of this application. Figure 6 The cloud host scheduling device 600 shown includes a processor 610, which can call and run computer programs from memory to implement the methods in the embodiments of this application.
[0107] Optionally, such as Figure 6 As shown, the cloud host scheduling device 600 may further include a memory 620. The processor 610 can retrieve and run computer programs from the memory 620 to implement the methods described in this embodiment.
[0108] The memory 620 can be a separate device independent of the processor 610, or it can be integrated into the processor 610.
[0109] Optionally, such as Figure 6 As shown, the cloud host scheduling device 600 may also include a transceiver 630. The processor 610 can control the transceiver 630 to communicate with other devices. Specifically, it can send information or data to other devices or receive information or data sent by other devices.
[0110] The transceiver 630 may include a transmitter and a receiver. The transceiver 630 may further include antennas, and the number of antennas may be one or more.
[0111] The cloud host scheduling device 600 can implement the corresponding processes implemented by the cloud host scheduling device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.
[0112] Figure 7 This is a schematic structural diagram of the chip according to an embodiment of this application. Figure 7 The chip 700 shown includes a processor 710, which can call and run computer programs from memory to implement the methods in the embodiments of this application.
[0113] Optionally, such as Figure 7 As shown, chip 700 may further include memory 720. Processor 710 can retrieve and run computer programs from memory 720 to implement the methods described in this embodiment.
[0114] The memory 720 can be a separate device independent of the processor 710, or it can be integrated into the processor 710.
[0115] Optionally, the chip 700 may also include an input interface 730. The processor 710 can control the input interface 730 to communicate with other devices or chips; specifically, it can acquire information or data sent by other devices or chips.
[0116] Optionally, the chip 700 may also include an output interface 740. The processor 710 can control the output interface 740 to communicate with other devices or chips, specifically, to output information or data to other devices or chips.
[0117] This chip can implement the corresponding processes implemented by the cloud host scheduling device in the various methods of the embodiments of this application, which will not be described in detail here for the sake of brevity.
[0118] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0119] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0120] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0121] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0122] This application also provides a computer program product, including a computer program.
[0123] When executed by a processor, the computer program implements the corresponding processes of the cloud host scheduling device in the various methods of the embodiments of this application, which will not be described in detail here for the sake of brevity.
[0124] This application also provides a computer-readable storage medium for storing computer programs.
[0125] The computer program causes the computer to execute the corresponding processes implemented by the cloud host scheduling device in the various methods of the embodiments of this application, which will not be described in detail here for the sake of brevity.
[0126] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0130] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0131] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0132] The preferred embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application. Moreover, without conflict, the various embodiments and / or the technical features in the various embodiments described in this application can be arbitrarily combined with the prior art, and the resulting technical solutions should also fall within the protection scope of this application.
[0133] It should be understood that in the various method embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0134] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A cloud server scheduling method, characterized in that, The method includes: Obtain the historical demand data set for cloud servers; The historical demand data set is input into the first network model, and the demand prediction result of the cloud host is obtained through the first network model. The type of host machine to purchase and deploy cloud servers will be determined based on the demand forecast results. Obtain the set of cost-performance ratio values for all host machines corresponding to the type, and determine the host machine to purchase and deploy the cloud host based on the set of cost-performance ratio values.
2. The method according to claim 1, characterized in that, The method further includes: Obtain the available CPU and available memory of each node in the host machine, and obtain the type of cloud host to be deployed; The deployment node of the cloud host to be deployed is determined based on the type of the cloud host to be deployed and the available CPU and available memory of each node.
3. The method according to claim 2, characterized in that, For the first node among the plurality of nodes, determining the node where the cloud host is deployed based on the type of the cloud host to be deployed and the available CPU and available memory of each node includes: When the available CPU and available memory of the first node are both greater than the available CPU and available memory of the other nodes among the plurality of nodes excluding the first node, it is determined that the cloud host to be deployed is deployed on the first node. When the available CPU or available memory of the first node is greater than the available CPU or available memory of the other nodes among the plurality of nodes excluding the first node, the deployment node of the cloud host is determined according to the type of the cloud host to be deployed.
4. The method according to claim 1, characterized in that, The method further includes: Obtain available CPU resources from multiple host machines; The multiple host machines are sorted according to the available CPU resources to obtain a first order of the multiple host machines; Migrate the cloud hosts deployed in the plurality of host machines according to the first order.
5. The method according to claim 4, characterized in that, The method further includes: Obtain the resource list of multiple host machines after migration; Determine whether the cloud server deployment requirements are met based on the resource list; If the cloud server deployment requirements cannot be met, then it is necessary to purchase a host machine.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Obtain the number of CPU cores and / or memory of the host machine; The host machine type is determined based on the number of CPU cores and / or memory.
7. The method according to any one of claims 1 to 5, characterized in that, The first network model includes a Long Short-Term Memory (LSTM) neural network module and an attention mechanism module, wherein the attention mechanism module is used to determine the weight of each historical demand data in the historical demand data set.
8. A cloud server scheduling device, characterized in that, include: A processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory to perform the method as described in any one of claims 1 to 7.
9. A computer program product, characterized in that, include: A computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 1 to 7.