Cloud computing resource migration method and device, electronic equipment and storage medium

By constructing a prediction model to predict the demand trend of cloud computing resource and selecting reasonable migration targets, the problem of unreasonable resource migration decisions in the existing technology is solved, and resource utilization efficiency and adaptability are improved.

CN119690656APending Publication Date: 2025-03-25CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411746501.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

Existing cloud computing resource migration strategies cannot accurately predict future resource requirements, resulting in unreasonable migration decisions and affect resource utilization efficiency and application performance.

Method used

By obtaining resource usage data of virtual machines, building prediction models (such as ARIMA and LSTM models), predict resource demand trends, and selecting reasonable migration targets based on the trend, migrating cloud computing resources to the appropriate host host.

Benefits of technology

It improves the utilization efficiency of cloud computing resources, reduces the performance decline caused by migration, and adapts to user needs and dynamic changes in cloud environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690656A_ABST
    Figure CN119690656A_ABST
Patent Text Reader

Abstract

The invention discloses a cloud computing resource migration method and device, electronic equipment and a storage medium, and relates to the technical field of cloud computing, and the method comprises the following steps: obtaining resource use data of a plurality of virtual machines; constructing a prediction model based on the resource use data; predicting a resource demand trend for cloud computing in each virtual machine by using the prediction model; selecting a migration target of the cloud computing resources from each virtual machine according to the resource demand trend; and migrating the cloud computing resources to the migration target according to the resource demand trend. According to the method, the prediction model is constructed based on the resource use data of the virtual machine, the future resource demand trend is predicted through the prediction model, then the reasonable migration target is selected, the cloud computing resources are migrated to the migration target according to the resource demand trend, and the resource utilization of cloud computing can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a cloud computing resource migration method, device, electronic device and storage medium. Background Art

[0002] Cloud computing is a leading technology in the current IT industry that can provide users with computing resources on demand, and users only need to pay for the resources actually used. However, due to the dynamic changes in user needs and the complexity and uncertainty of the cloud environment, how to effectively manage and allocate cloud computing resources has always been a major challenge. In particular, in some cases, due to the increase or decrease in demand, it is necessary to migrate virtual machines, that is, migrate virtual machines from one physical machine (or host host) to another physical machine to better utilize resources, while also minimizing the impact of performance degradation caused by migration.

[0003] Existing resource migration strategies usually make decisions based on current resource usage, but often cannot accurately predict future demand, which may lead to unreasonable migration decisions. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to propose a cloud computing resource migration method, device, electronic device and storage medium to reasonably migrate cloud computing resources and improve utilization efficiency.

[0005] To achieve the above object, an embodiment of the present application provides a cloud computing resource migration method, which includes the following steps:

[0006] Get resource usage data for multiple virtual machines;

[0007] constructing a prediction model based on the resource usage data;

[0008] Predicting resource demand trends for cloud computing in each of the virtual machines using the prediction model;

[0009] Selecting a migration target of cloud computing resources from each of the virtual machines according to the resource demand trend;

[0010] The cloud computing resources are migrated to the migration target according to the resource demand trend.

[0011] In some embodiments, obtaining resource usage data of multiple virtual machines includes the following steps:

[0012] The resource usage data is periodically obtained from the multiple virtual machines of the cloud computing platform through a monitoring system or an application program interface; wherein the resource usage data includes the CPU usage rate, memory usage rate, disk IO data and network IO data of each virtual machine.

[0013] In some embodiments, constructing a prediction model based on the resource usage data comprises the following steps:

[0014] Dividing the resource usage data into time series data corresponding to each virtual machine at each time point;

[0015] Dividing the time series data into a training set and a test set;

[0016] Using the training set to train the ARIMA model and the LSTM model respectively, so that the ARIMA model and the LSTM model respectively generate resource usage prediction values ​​according to the historical time series data;

[0017] Generate the resource usage prediction value corresponding to each of the time points in the test set by using the trained ARIMA model and the LSTM model;

[0018] The prediction accuracy of the trained ARIMA model and the LSTM model is determined according to the resource usage prediction value generated by the test set, and then the corresponding prediction weights are assigned to the ARIMA model and the LSTM model according to the prediction accuracy; wherein the ARIMA model and the LSTM model that are trained and assigned the prediction weights are used as the prediction models.

[0019] In some embodiments, the predicting resource demand trend of cloud computing in each of the virtual machines using the prediction model includes the following steps:

[0020] Input the time series data of several time points closest to the current time point into the trained ARIMA model and the LSTM model respectively, and obtain a first resource usage prediction value and a second resource usage prediction value accordingly;

[0021] According to the prediction weights of the ARIMA model and the LSTM model, a weighted average of the first resource usage prediction value and the second resource usage prediction value is taken as the resource demand trend.

[0022] In some embodiments, the step of selecting a migration target of cloud computing resources from each of the virtual machines according to the resource demand trend comprises the following steps:

[0023] Determining whether the resource demand trend exceeds a total resource threshold of a host host of each of the virtual machines;

[0024] If so, the CPU usage rate, memory usage rate, disk IO data and network IO data of each of the host hosts are used as the resource attribute values; wherein the reciprocal of the CPU usage rate and the memory usage rate is taken as the resource attribute value;

[0025] The migration target is selected from each of the host hosts according to each of the resource attribute values.

[0026] In some embodiments, selecting the migration target from each of the host hosts according to each of the resource attribute values ​​comprises the following steps:

[0027] Setting an initial decision matrix according to each of the resource attribute values;

[0028] Normalizing each of the resource attribute values ​​in the initial decision matrix to obtain a standardized decision matrix;

[0029] A weighted normative matrix is ​​constructed according to the attribute weights of each of the resource attribute values ​​and the normative decision matrix;

[0030] Determine, according to the weighted norm matrix, the maximum value of the resource attribute value corresponding to the CPU usage rate and the maximum value of the resource attribute value corresponding to the memory usage rate as a positive ideal solution;

[0031] Determine, according to the weighted norm matrix, a minimum value of the resource attribute value corresponding to the CPU usage rate and a minimum value of the resource attribute value corresponding to the memory usage rate as a negative ideal solution;

[0032] The migration target is selected based on a first distance between the current host host and the host host corresponding to the positive ideal solution, and a second distance between the current host host and the host host corresponding to the negative ideal solution; wherein the current host host is the host host where the cloud computing resources that need to be migrated are currently located.

[0033] In some embodiments, selecting the migration target according to a first distance between the current host host and the host host corresponding to the positive ideal solution, and a second distance between the current host host and the host host corresponding to the negative ideal solution, comprises the following steps:

[0034] Calculate the first distance according to each of the resource attribute values ​​of the current host host and the positive ideal solution;

[0035] Calculating the second distance according to each of the resource attribute values ​​of the current host host and the negative ideal solution;

[0036] Calculate evaluation values ​​of the positive ideal solution and the negative ideal solution corresponding to the host host according to the first distance and the second distance;

[0037] The host host with the largest evaluation value is selected as the migration target.

[0038] To achieve the above object, another aspect of an embodiment of the present application provides a cloud computing resource migration device, the device comprising:

[0039] A data acquisition unit, used to acquire resource usage data of multiple virtual machines;

[0040] A model building unit, configured to build a prediction model based on the resource usage data;

[0041] A trend prediction unit, used for predicting resource demand trends for cloud computing in each of the virtual machines using the prediction model;

[0042] A target selection unit, configured to select a migration target of cloud computing resources from each of the virtual machines according to the resource demand trend;

[0043] A resource migration unit is used to migrate the cloud computing resources to the migration target according to the resource demand trend.

[0044] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned cloud computing resource migration method when executing the computer program.

[0045] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned cloud computing resource migration method is implemented.

[0046] The embodiments of the present application include at least the following beneficial effects:

[0047] This application can obtain resource usage data of multiple virtual machines; build a prediction model based on the resource usage data; use the prediction model to predict the resource demand trend of cloud computing in each virtual machine; select a migration target for cloud computing resources from each virtual machine based on the resource demand trend; and migrate cloud computing resources to the migration target based on the resource demand trend. This application builds a prediction model based on the resource usage data of virtual machines, and then predicts the future resource demand trend through the prediction model, and then selects a reasonable migration target, and then migrates cloud computing resources to the migration target based on the resource demand trend, which can effectively improve the resource utilization of cloud computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0049] Figure 1 A schematic diagram of a process flow of a cloud computing resource migration method provided in an embodiment of the present application;

[0050] Figure 2 A flowchart of the steps of S110 provided in an embodiment of the present application;

[0051] Figure 3 A flowchart of the steps of S120 provided in an embodiment of the present application;

[0052] Figure 4 A flowchart of the steps of S130 provided in an embodiment of the present application;

[0053] Figure 5 A flowchart of the steps of S133 provided in the embodiment of the present application;

[0054] Figure 6 A flowchart of the steps of S1336 provided in an embodiment of the present application;

[0055] Figure 7 An example flow chart of a cloud computing resource migration method provided in an embodiment of the present application;

[0056] Figure 8 A flowchart for creating a prediction model provided in an embodiment of the present application;

[0057] Fig. 9 A flowchart for selecting a migration target server provided in an embodiment of the present application;

[0058] Fig.10 A schematic diagram of the structure of a cloud computing resource migration device provided in an embodiment of the present application;

[0059] Fig.11 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0061] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0062] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0064] Before describing the embodiments of the present application in detail, some terms and related technologies involved in the embodiments of the present application are first described. The terms and related technologies involved in the embodiments of the present application are subject to the following explanations:

[0065] ARIMA model (Auto-Regressive Moving Average Model): Auto-regressive moving average model, a type of time series analysis.

[0066] LSTM (Long Short-Term Memory) model: The long short-term memory network is a time recurrent neural network, which is specially designed to solve the long-term dependency problem of general RNN (recurrent neural network). All RNNs have a chain form of repeated neural network modules.

[0067] Cloud computing is a leading technology in the current IT industry. It can provide users with on-demand computing resources, such as storage space, CPU, etc., and users only need to pay for the resources actually used. However, due to the dynamic changes in user needs and the complexity and uncertainty of the cloud environment, how to effectively manage and allocate these computing resources has always been a major challenge. In particular, sometimes, due to the increase or decrease in demand, it is necessary to migrate virtual machines, that is, migrate virtual machines from one physical machine to another, in order to better utilize resources, while also minimizing the impact of performance degradation caused by migration.

[0068] Traditional resource migration strategies usually make decisions based on current resource usage, such as current CPU usage, memory usage, etc., but this method often cannot accurately predict future demand, which may lead to unreasonable migration decisions. For example, if a virtual machine is migrated to a server that is not currently fully utilized, but the resource usage of this server increases sharply in a short period of time, then this migration may lead to a waste of resources and may even cause a decline in application performance. Therefore, it is of great significance to study the reasonable migration of cloud computing resources, especially to use prediction technology to predict future resource demand and formulate migration strategies accordingly.

[0069] The technical problems solved by this application may include how to accurately predict future cloud computing resource demands, and how to formulate effective and reasonable resource migration strategies based on this.

[0070] In this application, we first collect and analyze the application workload and virtual machine performance indicator data, establish a prediction model, and predict the future cloud computing resource demand; then select the appropriate migration target based on the predicted resource demand trend; and finally decide whether to migrate resources. This method can more accurately predict future resource demand and formulate a more efficient resource migration strategy, thereby improving the resource utilization efficiency in the cloud computing environment and ensuring the performance of applications.

[0071] Therefore, the embodiments of the present application provide a cloud computing resource migration method, device, electronic device and storage medium. The technical solution of the present application includes: obtaining resource usage data of multiple virtual machines; building a prediction model based on the resource usage data; using the prediction model to predict resource demand trends for cloud computing in each virtual machine; selecting a migration target for cloud computing resources from each virtual machine based on the resource demand trend; and migrating cloud computing resources to the migration target based on the resource demand trend. The present application builds a prediction model based on the resource usage data of the virtual machine, and then predicts the future resource demand trend through the prediction model, and then selects a reasonable migration target, and then migrates the cloud computing resources to the migration target based on the resource demand trend, which can effectively improve the resource utilization of cloud computing.

[0072] The embodiment of the present application provides a cloud computing resource migration method, which relates to the field of cloud computing technology. The cloud computing resource migration method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements a cloud computing resource migration method, etc., but is not limited to the above forms.

[0073] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0074] Reference Figure 1 The present application embodiment provides a cloud computing resource migration method, which may include but is not limited to S100 to S140, as follows:

[0075] S100: Obtain resource usage data of multiple virtual machines.

[0076] By way of example, the resource usage data may include application workload and virtual machine performance data.

[0077] Furthermore, S100 may include:

[0078] The resource usage data is periodically obtained from the multiple virtual machines of the cloud computing platform through a monitoring system or an application program interface; wherein the resource usage data includes the CPU usage rate, memory usage rate, disk IO data and network IO data of each virtual machine.

[0079] In one example, data collection obtains resource usage data of all virtual machines from a monitoring system or an API interface every 5 minutes; and obtains CPU usage, memory usage, disk IO, and network IO data of each virtual machine.

[0080] S110: Constructing a prediction model based on the resource usage data.

[0081] Specifically, the prediction model of this embodiment can predict future resource demand trends, that is, resource usage data at several time points are input into the prediction model, and then the prediction model can predict resource demand at the next several time points.

[0082] Reference Figure 2 , S110 may further include S111 to S115:

[0083] S111: Divide the resource usage data into time series data corresponding to each virtual machine at each time point;

[0084] S112: Divide the time series data into a training set and a test set;

[0085] S113: using the training set to train the ARIMA model and the LSTM model respectively, so that the ARIMA model and the LSTM model respectively generate resource usage prediction values ​​according to the historical time series data;

[0086] S114: Generate the resource usage prediction value corresponding to each of the time points in the test set by using the trained ARIMA model and the LSTM model;

[0087] S115: Determine the prediction accuracy of the trained ARIMA model and the LSTM model according to the resource usage prediction value generated by using the test set, and then assign corresponding prediction weights to the ARIMA model and the LSTM model according to the prediction accuracy; wherein the ARIMA model and the LSTM model after training and assigned the prediction weights are used as the prediction models.

[0088] In some optional implementations, the prediction model is created by combining the ARIMA model with the LSTM model, and performing weighted averaging on their prediction results; specifically, the method includes:

[0089] Divide the time series data of each virtual machine into a training set and a test set, with 80% of the data used as the training set and 20% of the data used as the test set;

[0090] Train the ARIMA model based on the training set. The ARIMA model predicts future values ​​based on past time series data.

[0091] Train an LSTM model based on the same training set;

[0092] For each time point in the test set, the ARIMA model and LSTM model are used to generate forecast values;

[0093] The two sets of results are combined and weighted average is used to obtain the final prediction result.

[0094] S120: Predict resource demand trends for cloud computing in each of the virtual machines using the prediction model.

[0095] It is understandable that in this embodiment, resource usage data at several consecutive time points may be input into the prediction model, and then the prediction model predicts the cloud computing resource requirements of each virtual machine at the next several time points.

[0096] Reference Figure 3 , S120 may further include:

[0097] S121: inputting the time series data of several time points closest to the current time point into the trained ARIMA model and the LSTM model respectively, and obtaining a first resource usage prediction value and a second resource usage prediction value correspondingly;

[0098] S122: Taking a weighted average of the first resource usage prediction value and the second resource usage prediction value according to the prediction weights of the ARIMA model and the LSTM model as the resource demand trend.

[0099] The resource usage data of several time points closest to the current time point are input into the prediction model, and then the prediction results are integrated and averaged to obtain the final resource demand trend. The specific operation is to assign different weights to the ARIMA model and LSTM model according to the accuracy of the previous model test, and perform weighted averaging on the prediction results.

[0100] During the forecast period, the above steps are repeated to use the forecast model to forecast resource requirements for the next forecast period.

[0101] S130: Selecting a migration target of cloud computing resources from each of the virtual machines according to the resource demand trend.

[0102] Specifically, each virtual machine of this embodiment may exist in each host host, and each host host may include at least one virtual machine. Optionally, the host host of this embodiment may be a server.

[0103] Reference Figure 4 , S131 may further include S131 to S133:

[0104] S131: Determine whether the resource demand trend exceeds the total resource threshold of the host host of each virtual machine; optionally, the total resource threshold of this embodiment may be 80%, that is, when the resource demand trend exceeds 80% of the total resources of the host host, it may be considered that cloud computing resources need to be migrated;

[0105] S132: If yes, then taking the CPU usage rate, memory usage rate, disk IO data and network IO data of each of the host hosts as the resource attribute value; wherein the reciprocal of the CPU usage rate and the memory usage rate is taken as the resource attribute value;

[0106] S133: Selecting the migration target from each of the host hosts according to each of the resource attribute values.

[0107] In one example, the step of selecting a migration target may include:

[0108] Each candidate server is regarded as a solution, and the resource utilization rate of the server is regarded as a column of attribute values ​​of each solution. Considering the CPU and memory utilization rate of the server, each server has two attributes;

[0109] When selecting a target server, the freer the server's resources are, the better. Therefore, the CPU and memory usage are extremely small attributes, so they are positively oriented.

[0110] The CPU and memory usage rates are both non-negative numbers, and are positively converted using the inverse method:

[0111]

[0112] Among them, x i Indicates the CPU usage or memory usage before forwarding. Indicates the normalized CPU usage or memory usage.

[0113] Assume that there are m candidate servers in the data center: Consider two determining attributes of each server: CPU and memory usage;

[0114] All cost attributes in each solution are converted into benefit attributes by the inverse method, so that all attributes in the solution are converted into benefit attributes; each alternative solution is evaluated based on CPU and memory usage.

[0115] Reference Figure 5 S133 selects the migration target from each of the host hosts according to each of the resource attribute values, which may more specifically include S1331 to S1336:

[0116] S1331: setting an initial decision matrix according to each of the resource attribute values;

[0117] S1332: Normalizing each of the resource attribute values ​​in the initial decision matrix to obtain a standardized decision matrix;

[0118] S1333: constructing a weighted normative matrix according to the attribute weights of the resource attribute values ​​and the normative decision matrix;

[0119] S1334: Determine, according to the weighted norm matrix, a maximum value of the resource attribute value corresponding to the CPU usage rate and a maximum value of the resource attribute value corresponding to the memory usage rate as a positive ideal solution;

[0120] S1335: Determine, according to the weighted norm matrix, a minimum value of the resource attribute value corresponding to the CPU usage and a minimum value of the resource attribute value corresponding to the memory usage as a negative ideal solution;

[0121] S1336: Select the migration target based on a first distance between the current host host and the host host corresponding to the positive ideal solution, and a second distance between the current host host and the host host corresponding to the negative ideal solution; wherein the current host host is the host host where the cloud computing resources that need to be migrated are currently located.

[0122] In an example, the specific steps for selecting a migration target are as follows:

[0123] (1) Set the initial decision matrix to be A = (a ij ) m·n , m represents the number of candidate servers, n represents the number of attributes considered by the server, including CPU, network, and network resource utilization;

[0124] (2) The resource utilization rate of the server belongs to the cost attribute. The server resource utilization rate is positively converted into a benefit attribute by taking the inverse method to obtain the standardized decision matrix;

[0125] (3) Considering the different weights of different resources, set weights w for each attribute of the server j , construct the weighted normative matrix V = (v ij ) m*n ;

[0126] (4) The constructed weighted normalized matrix V = (v ij ) m*n After that, according to v ij Construct positive and negative ideal solutions;

[0127] (5) Construct the negative ideal solution in the same way;

[0128] (6) Compare the distance between the server and the positive and negative ideal solutions to select the optimal server;

[0129] (7) The evaluation value of the server is calculated based on the distance between the server and the positive ideal solution and the negative ideal solution.

[0130] Reference Figure 6 S1336 selects the migration target according to a first distance between the current host host and the host host corresponding to the positive ideal solution, and a second distance between the current host host and the host host corresponding to the negative ideal solution, which may further include S13361-S13364:

[0131] S13361: Calculate the first distance according to each resource attribute value of the current host host and the positive ideal solution;

[0132] S13362: Calculate the second distance according to each resource attribute value of the current host host and the negative ideal solution;

[0133] S13363: Calculate evaluation values ​​of the positive ideal solution and the negative ideal solution corresponding to the host host according to the first distance and the second distance;

[0134] S13364: Select the host host with the largest evaluation value as the migration target.

[0135] In one example, the optimal server is selected by comparing the distances between the server and the positive and negative ideal solutions. The first distance between the server and the positive ideal solution is calculated according to the following two expressions: And the second distance between the server and the negative ideal solution The distance in this embodiment may adopt the Euclidean distance:

[0136]

[0137]

[0138] If the resource utilization rate of a server is closer to the positive ideal solution and farther from the negative ideal solution, the server is considered to be more optimal.

[0139] The server's evaluation value S is calculated based on the distance between the server and the positive ideal solution and the negative ideal solution according to the following expression:i . S i The larger the value, the closer the server is to the positive ideal solution and the farther it is from the negative ideal solution.

[0140]

[0141] When the distance between the server and the ideal solution When it is equal to 0, the server is the positive ideal solution, S i Take the maximum value 1; when the distance between the server and the negative ideal solution When it is equal to 0, the server is a negative ideal solution, S i The minimum value is 0. The larger the evaluation value calculated by the server, the more CPU and memory resources the server has remaining. The server with the largest evaluation value is selected as the target server.

[0142] Compared with considering a single resource, this embodiment comprehensively considers CPU and memory, and by calculating the two resources, it can be found that the larger the evaluation value calculated by the server, the more CPU and memory resources the server has remaining, and the server with the largest evaluation value is selected as the target server. Compared with considering a single resource, this solution comprehensively considers CPU and memory, and by calculating the two resources, it can find the most idle server, thus better achieving the purpose of data center load balancing.

[0143] S140: Migrating the cloud computing resources to the migration target according to the resource demand trend.

[0144] Specifically, this embodiment can migrate cloud computing resources from the current host host to a host host corresponding to the migration target.

[0145] Next, the solution of the embodiment of the present application will be introduced and explained in detail with reference to specific application examples.

[0146] like Figure 7 As shown, this embodiment provides an example flow chart of a cloud computing resource migration method. The steps of this embodiment may include:

[0147] S1. Data collection: collects application workload and virtual machine performance data, including the virtual machine's CPU usage, memory usage, disk IO, and network IO.

[0148] Set a scheduled task to obtain resource usage data of all virtual machines from the monitoring system or API interface at regular intervals (for example, every 5 minutes). The specific sampling interval can be set according to the characteristics and requirements of the application.

[0149] By calling the monitoring system or API interface method or function, you can obtain the CPU usage, memory usage, disk IO, network IO and other data of each virtual machine. These data are usually returned in the form of values, for example, CPU usage can be expressed as a percentage between 0 and 100.

[0150] S2. Create a forecasting model and use the collected data to build a forecasting model. This method combines the forecasts of multiple models to obtain more accurate forecast results. For example, use multiple time series models (such as ARIMA, LSTM) and average or weighted average their forecast results. Figure 8 The flowchart of creating a prediction model is shown, and the steps of creating a prediction model may include:

[0151] S201, divide the time series data of each virtual machine into a training set and a test set. The training set is used to train the model, while the test set is used to evaluate the prediction performance of the model. Select a certain time ratio to divide, 80% of the data as the training set, and 20% of the data as the test set.

[0152] S202: Train an ARIMA model based on the training set. The ARIMA model predicts future values ​​based on past time series data.

[0153] First, train an ARIMA model based on the training set. The p, d, and q parameters of the model need to be selected. This process usually requires training and validating the model on different parameter combinations to find the best parameters. After training, the ARIMA model can predict future values ​​based on past time series data.

[0154] The ARIMA(p,d,q) model is a mixture of AR(p), I(d), and MA(q). The mathematical form is as follows:

[0155] AR(p) Model:

[0156] MA(q) model: μ+ε(t)+Σθ(i)ε(ti), i=[1,...,q];

[0157] I(d) model: The original time series is differentiated by order d to obtain a new time series.

[0158] The prediction formula of the ARIMA model is as follows:

[0159]

[0160] Among them: p is the order of the autocorrelation part, d is the order of the difference, q is the order of the moving average part, c is the constant term, Autocorrelation coefficient, θ(i) moving average coefficient, ε(t) error term.

[0161] S203. Train an LSTM model based on the same training set.

[0162] The LSTM structure consists of a cell, an input gate, an output gate, and a forget gate. The functions of the input gate, output gate, and forget gate are to control the input, output, and retention of information about the cell state, respectively. LSTM avoids the vanishing gradient problem through a special addition operation.

[0163] S204. For each time point in the test set, the ARIMA model and the LSTM model are used to generate prediction values. The two sets of results are combined and weighted average is used to obtain the final prediction result:

[0164] Final Prediction=(ARIMA Prediction+LSTM Prediction) / 2.

[0165] S3, resource trend forecasting, using forecasting models to predict future resource demand trends.

[0166] Resource trend forecasts include:

[0167] For time series forecasting models, the input is usually a recent time series data. For example, if the model used is ARIMA (p, d, q), then the data of the most recent p time points are required as input. If you want to predict the data of the next n time points, you need the data of the most recent n time points.

[0168] The input data prepared in step 1 is input into the models of this embodiment (including ARIMA model and LSTM model). Each model will generate its predicted future resource demand.

[0169] Integrated prediction results: Average the prediction results of each model to get the final resource demand trend. The specific operation is to take the average of the prediction results of each model or give different weights to each model according to the accuracy of the previous model test and perform weighted averaging.

[0170] Repeat the above steps: Repeat the above steps within the forecast period (for example, every hour or every day) and use the model to predict the resource demand within the next forecast period.

[0171] S4. Migration target selection: select the migration target based on the predicted resource demand and decide whether resource migration is needed based on the predicted resource demand trend.

[0172] First, you need to know the total resources of each physical host (also called host host, server), such as the total number of CPU cores, the total size of memory, and the maximum values ​​of disk IO and network IO.

[0173] Next, this embodiment will compare the predicted resource requirements of the virtual machine with the available resources of the physical host where it is located. If the predicted future CPU usage of a virtual machine will exceed the total number of CPU cores of the physical host, or its disk IO will exceed the maximum disk IO of the physical host, then this embodiment can determine that the virtual machine may cause a resource bottleneck in the future and should be migrated to another physical host. Set a threshold, such as when the predicted resource usage reaches 80% of the total resources of the physical host, it will warn that a resource bottleneck may occur and it needs to be moved.

[0174] Each candidate server is regarded as a solution, and the resource utilization rate of the server is regarded as a column of attribute values ​​of each solution. Considering the CPU and memory utilization rate of the server, each server has two attributes;

[0175] When selecting a target server, the freer the server's resources are, the better. Therefore, the CPU and memory usage are extremely small attributes, so they are positively oriented.

[0176] The CPU and memory usage rates are both non-negative numbers, and are positively converted using the inverse method:

[0177]

[0178] Among them, x i Indicates the CPU usage or memory usage before forwarding. Indicates the normalized CPU usage or memory usage.

[0179] Assume that there are m candidate servers in the data center: A1, ..., A m Consider two attributes for each server: CPU and memory usage. Convert all cost attributes in each solution to benefit attributes by inverse calculation, then all attributes in the solution are converted to benefit attributes; evaluate each alternative solution based on CPU and memory usage. Fig. 9 The flowchart for selecting the migration target server is shown in the figure. The specific steps for selecting the migration target server are as follows:

[0180] S401, set the decision matrix to be A=(a ij ) m·n , m represents the number of candidate servers, n represents the number of attributes considered by the server, including CPU, network, and network resource utilization;

[0181]

[0182] a ij Represents the utilization rate of a resource of the server numbered i. If only the server CPU and memory utilization rate are considered, then n = 2, a i0 ,a i1 Respectively represent the CPU and memory usage of the server numbered i.

[0183] S402, the resource utilization rate of the server belongs to the cost attribute. According to formula (1), the server resource utilization rate is positively converted into a benefit attribute by taking the inverse, and then the attribute value is normalized to obtain the normalized decision matrix R = (r ij ) m·n , normalized as shown in formula (4).

[0184]

[0185] S403: Considering the different weights of different resources, attribute weights w are set for each attribute of the server. j , construct a weighted standard matrix V = (v ij ) m*n ; where v ij The calculation of is shown in formula (5):

[0186] v ij =r ij *w j ,i=1,2,…m; j=1,2,…,n (5)

[0187] The greater the weight of the server resource, the greater the attribute value obtained after calculation of the resource. Assuming that all resources of the server are given equal weight, the obtained v ij Equal to r ij In this embodiment, the step of constructing a weighted normalized matrix can be omitted.

[0188] S404, construct a weighted standard matrix V = (v ij ) m*n After that, according to v ij Construct positive ideal solutions and negative ideal solutions; compare the CPU attributes of m servers and select the maximum value Represents the value with the minimum CPU usage among all candidate servers; then selects the value with the lowest memory usage among m servers That is v i2 The maximum value among them. The combination of the two selected values ​​is the positive ideal solution A + As shown in formula (6).

[0189]

[0190] S405, construct a negative ideal solution in the same way; select the value with the highest CPU usage among all servers That is, the smallest v i1 ; Then select the value with the highest memory usage That is, the smallest v i2 The combination of the selected values ​​is the negative ideal solution as shown in formula (7).

[0191]

[0192] S406: Compare the distances between the server and the positive and negative ideal solutions to select the optimal server. Calculate the first distance between the server and the positive ideal solution according to formula (8) and formula (9): And the second distance between the server and the negative ideal solution The distance in this embodiment may adopt the Euclidean distance:

[0193]

[0194] If the resource utilization rate of a server is closer to the positive ideal solution and farther from the negative ideal solution, the server is considered to be more optimal.

[0195] S407, calculate the evaluation value S of the server according to the distance between the server and the positive ideal solution and the negative ideal solution according to formula (10) i . S i The larger the value, the closer the server is to the positive ideal solution and the farther it is from the negative ideal solution.

[0196]

[0197] When the distance between the server and the ideal solution When it is equal to 0, the server is the positive ideal solution, S i Take the maximum value 1; when the distance between the server and the negative ideal solution When it is equal to 0, the server is a negative ideal solution, S i The minimum value is 0. The larger the evaluation value calculated by the server, the more CPU and memory resources the server has remaining. The server with the largest evaluation value is selected as the target server.

[0198] The beneficial effects of this embodiment include at least:

[0199] Improve resource utilization efficiency: Predicting future resource requirements through prediction models and formulating efficient and reasonable migration strategies will help achieve efficient utilization of resources in a cloud computing environment.

[0200] Adapt to dynamic changes: The policy can be dynamically adjusted based on predicted resource requirements, thereby adapting to dynamic changes in user needs and the cloud environment.

[0201] Reduce unnecessary migration: Predicting future resource requirements can avoid invalid or excessive resource migration, reduce performance losses caused by migration, and save the cost of resource migration.

[0202] Providing decision-making basis: Accurate prediction results and resource migration strategies can provide cloud computing service providers and data center administrators with powerful decision-making basis.

[0203] More specifically, this embodiment can also provide an experimental embodiment.

[0204] Taking the cloud computing platform built in the experiment as an example, the platform collects resource usage data of all virtual machines from the API interface every 5 minutes. The data obtained at this time are: the CPU usage of virtual machine 1 is 40%, the memory usage is 70%, the disk IO is 30Mbps, and the network IO is 10Mbps; the CPU usage of virtual machine 2 is 60%, the memory usage is 80%, the disk IO is 40Mbps, and the network IO is 20Mbps.

[0205] Then, the ARIMA model and LSTM model are used to model these data, with 80% of the historical data of virtual machines 1 and 2 as the training set and the remaining 20% ​​as the test set. After the model is trained, the two models are used to predict the test set, for example, predicting that the CPU usage of virtual machine 1 in the next 5 minutes will be 50%, the memory usage will be 75%, the disk IO will be 35Mbps, and the network IO will be 15Mbps; the CPU usage of virtual machine 2 will be 65%, the memory usage will be 90%, the disk IO will be 45Mbps, and the network IO will be 25Mbps.

[0206] After getting the prediction results, the system starts to select migration targets from the candidate servers. Assume there are three candidate servers, server A has a CPU usage of 30% and a memory usage of 50%; server B has a CPU usage of 50% and a memory usage of 70%; server C has a CPU usage of 70% and a memory usage of 90%. Through mathematical model calculation, the weights are set to w1 = 0.5, w2 = 0.5, and the evaluation values ​​of servers A, B, and C are calculated to be 1.5, 1.4, and 1.3 respectively. Therefore, server A is selected as the migration target.

[0207] By adopting the solution of this embodiment to migrate cloud computing resources, changes in resource demand can be predicted in advance, so that resources can be fully utilized and overall operating efficiency can be improved.

[0208] Reference Fig.10 The embodiment of the present application further provides a cloud computing resource migration device, which can implement the above-mentioned cloud computing resource migration method, and the device includes:

[0209] A data acquisition unit, used to acquire resource usage data of multiple virtual machines;

[0210] A model building unit, configured to build a prediction model based on the resource usage data;

[0211] A trend prediction unit, used for predicting resource demand trends for cloud computing in each of the virtual machines using the prediction model;

[0212] A target selection unit, configured to select a migration target of cloud computing resources from each of the virtual machines according to the resource demand trend;

[0213] A resource migration unit is used to migrate the cloud computing resources to the migration target according to the resource demand trend.

[0214] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0215] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned cloud computing resource migration method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.

[0216] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0217] See also Fig.11 , Fig.11 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0218] The processor 1101 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0219] The memory 1102 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 may store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes a cloud computing resource migration method in the embodiments of this application;

[0220] Input / output interface 1103, used to implement information input and output;

[0221] The communication interface 1104 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0222] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);

[0223] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .

[0224] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned cloud computing resource migration method is implemented.

[0225] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0226] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0227] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0228] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0229] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0230] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0231] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0232] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0233] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0234] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0235] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0236] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0237] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A cloud computing resource migration method, characterized in that: The method comprises the following steps: Get resource usage data for multiple virtual machines; constructing a prediction model based on the resource usage data; Predicting resource demand trends for cloud computing in each of the virtual machines using the prediction model; Selecting a migration target of cloud computing resources from each of the virtual machines according to the resource demand trend; The cloud computing resources are migrated to the migration target according to the resource demand trend.

2. A cloud computing resource migration method according to claim 1, characterized in that: The method of obtaining resource usage data of multiple virtual machines includes the following steps: The resource usage data is periodically obtained from the multiple virtual machines of the cloud computing platform through a monitoring system or an application program interface; wherein the resource usage data includes the CPU usage rate, memory usage rate, disk IO data and network IO data of each virtual machine.

3. A cloud computing resource migration method according to claim 1, characterized in that: The step of constructing a prediction model based on the resource usage data comprises the following steps: Dividing the resource usage data into time series data corresponding to each virtual machine at each time point; Dividing the time series data into a training set and a test set; Using the training set to train the ARIMA model and the LSTM model respectively, so that the ARIMA model and the LSTM model respectively generate resource usage prediction values ​​according to the historical time series data; Generate the resource usage prediction value corresponding to each of the time points in the test set by using the trained ARIMA model and the LSTM model; The prediction accuracy of the trained ARIMA model and the LSTM model is determined according to the resource usage prediction value generated by the test set, and then the corresponding prediction weights are assigned to the ARIMA model and the LSTM model according to the prediction accuracy; wherein the ARIMA model and the LSTM model that are trained and assigned the prediction weights are used as the prediction models.

4. A cloud computing resource migration method according to claim 3, characterized in that: The method of using the prediction model to predict the resource demand trend of cloud computing in each of the virtual machines comprises the following steps: Input the time series data of several time points closest to the current time point into the trained ARIMA model and the LSTM model respectively, and obtain a first resource usage prediction value and a second resource usage prediction value accordingly; According to the prediction weights of the ARIMA model and the LSTM model, a weighted average of the first resource usage prediction value and the second resource usage prediction value is taken as the resource demand trend.

5. The cloud computing resource migration method according to claim 1, characterized in that: The step of selecting a migration target of cloud computing resources from each of the virtual machines according to the resource demand trend comprises the following steps: Determining whether the resource demand trend exceeds a total resource threshold of a host host of each of the virtual machines; If so, the CPU usage rate, memory usage rate, disk IO data and network IO data of each of the host hosts are used as the resource attribute values; wherein the reciprocal of the CPU usage rate and the memory usage rate is taken as the resource attribute value; The migration target is selected from each of the host hosts according to each of the resource attribute values.

6. A cloud computing resource migration method according to claim 5, characterized in that: The step of selecting the migration target from each of the host hosts according to each of the resource attribute values ​​comprises the following steps: Setting an initial decision matrix according to each of the resource attribute values; Normalizing each of the resource attribute values ​​in the initial decision matrix to obtain a standardized decision matrix; A weighted normative matrix is ​​constructed according to the attribute weights of each of the resource attribute values ​​and the normative decision matrix; Determine, according to the weighted norm matrix, the maximum value of the resource attribute value corresponding to the CPU usage rate and the maximum value of the resource attribute value corresponding to the memory usage rate as a positive ideal solution; Determine, according to the weighted norm matrix, a minimum value of the resource attribute value corresponding to the CPU usage rate and a minimum value of the resource attribute value corresponding to the memory usage rate as a negative ideal solution; The migration target is selected based on a first distance between the current host host and the host host corresponding to the positive ideal solution, and a second distance between the current host host and the host host corresponding to the negative ideal solution; wherein the current host host is the host host where the cloud computing resources that need to be migrated are currently located.

7. A cloud computing resource migration method according to claim 6, characterized in that: The step of selecting the migration target according to the first distance between the current host host and the host host corresponding to the positive ideal solution, and the second distance between the current host host and the host host corresponding to the negative ideal solution, comprises the following steps: Calculate the first distance according to each of the resource attribute values ​​of the current host host and the positive ideal solution; Calculating the second distance according to each of the resource attribute values ​​of the current host host and the negative ideal solution; Calculate evaluation values ​​of the positive ideal solution and the negative ideal solution corresponding to the host host according to the first distance and the second distance; The host host with the largest evaluation value is selected as the migration target.

8. A cloud computing resource migration device, characterized in that: The device comprises: A data acquisition unit, used to acquire resource usage data of multiple virtual machines; A model building unit, configured to build a prediction model based on the resource usage data; A trend prediction unit, used for predicting resource demand trends for cloud computing in each of the virtual machines using the prediction model; A target selection unit, configured to select a migration target of cloud computing resources from each of the virtual machines according to the resource demand trend; A resource migration unit is used to migrate the cloud computing resources to the migration target according to the resource demand trend.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements a cloud computing resource migration method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, a cloud computing resource migration method according to any one of claims 1 to 7 is implemented.