Cloud resource prediction method and system based on GC-LSTM neural network model, electronic device, and readable storage medium
Through the cloud resource prediction method based on the GC-LSTM neural network model, the problem of difficulty in real-time and high accuracy of cloud resource prediction in the prior art is solved, and more accurate resource utilization prediction and optimized resource scheduling are achieved, thereby reducing maintenance costs.
Patent Information
- Application Number
- PCT/CN2024/135294
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-11
- Filing Date
- 2024-11-28
- Publication Date
- 2025-06-19
AI Technical Summary
Existing cloud resource prediction models are difficult to achieve real-time and high accuracy, making it difficult to achieve zero-delay response in resource scheduling, and insufficient resources may lead to service level agreement (SLA) defaults and resource waste.
The cloud resource prediction method based on the GC-LSTM neural network model is adopted. By acquiring and normalizing historical time series data, a neural network model including input layer, GC layer, pooling layer, Flatten layer and LSTM layer is constructed, and the model is trained to predict the resource utilization rate of the next time series.
It realizes more accurate resource utilization prediction, which can prevent resource inadequate resources in advance, optimize resource scheduling, reduce maintenance costs, and improve the high availability and high elasticity performance of cloud computing services.
Smart Images

Figure CN2024135294_19062025_PF_FP_ABST
Abstract
Description
Cloud resource prediction method, system, electronic device and readable storage medium based on GC-LSTM neural network model
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on December 11, 2023, with application number 202311693371.8 and invention name “Cloud Resource Prediction Algorithm Based on GC-LSTM Neural Network Model”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to cloud computing technology, and in particular to a cloud resource prediction method, system, electronic device and readable storage medium based on a GC-LSTM neural network model. Background Art
[0004] Cloud computing is a service model that allocates computing resources on demand over the network. Computing resources include servers, databases, storage, platforms, architectures, and applications. With the widespread adoption of cloud computing applications, the rational allocation and scheduling of resources has become a core and key focus of cloud computing research. The rapid development of cloud computing technology has placed higher demands on the real-time and accurate resource scheduling. Currently, resource scheduling based on actual demand is difficult to achieve zero-latency response, and resource scheduling can also lead to resource starvation due to insufficient reserved resources. Therefore, resource prediction models can be used to predict resource requests over a period of time, facilitating advance hardware planning and resource allocation, ensuring capacity expansion during peak traffic, and improving the high availability and resilience of cloud computing services. Predictive models can also predict resources that may be idle in the future, allowing for the timely release of unused resources, further reducing resource waste and lowering maintenance costs.
[0005] Publication number CN113886454A, titled "A Cloud Resource Prediction Method Based on LSTM-RBF," establishes two models simultaneously: an LSTM and an RBF model for separate predictions. A BP neural network is then used to perform a hybrid prediction of the LSTM and RBF predictions, replacing the traditional weight search method. This multi-model fusion prediction method, while leveraging the strengths of both LSTM and RBF, is very time-consuming to train the neural network. Furthermore, due to the significant structural differences between the two network models, convergence can be difficult during training. Publication number CN112785051A, titled "A Cloud Resource Prediction Method Based on the Combination of EMD and TCN," uses EMD to decompose the original sequence into multiple IMFs and a residual term (Res) component. These components are then arranged in time sequence to construct a dataset, which is then fed into a TCN network model for training. Finally, the trained TCN model is used to predict the cloud resource load to be predicted. This approach employs dilated convolutions in the TCN network to expand the receptive field and further capture long-term dependency information. However, TCN requires more memory than LSTM because each sequence is processed by multiple dilation layers. Publication number CN111274530B, titled "A Container Cloud Resource Prediction Method," uses a proportional-integral-derivative (PID) algorithm and an adaptive moment estimation method (ADAM) to calculate the output weight matrices of feature nodes and enhancement nodes, respectively, in establishing a dense wide learning model.
[0006] Currently, cloud resource prediction and scheduling mainly face the following two problems:
[0007] (1) Cloud resource allocation and scheduling is difficult to achieve in real time. If there is a sudden shortage of resources, it may lead to breach of the Service Level Agreement (SLA), degradation of the Quality of Service (QoS), and even user dissatisfaction, resulting in user churn and economic losses. If resource utilization can be predicted in advance, the phenomenon of resource shortage can be effectively prevented.
[0008] (2) Reasonable scheduling and allocation of cloud resources based on prediction results has been proposed and proven to be an effective method to solve cloud resource scheduling. However, there are few existing prediction models based on cloud resources, and their application is not yet mature. In addition, since the calculations of some models are too complex, the real-time performance of the prediction is difficult to guarantee. Summary of the Invention
[0009] The purpose of this application is to provide a cloud resource prediction method, system, electronic device, and readable storage medium based on a GC-LSTM neural network model. On the one hand, this method can be used to predict customer resource needs in advance, conduct hardware planning and resource allocation, ensure capacity expansion requirements during traffic peaks, and optimize customers' cloud experience. On the other hand, it can predict resource oversupply in advance, reduce resource waste, and save maintenance costs.
[0010] To address the technical problems existing in the prior art, this application proposes a cloud resource prediction method based on the GC-LSTM neural network model, including:
[0011] Obtain a training data set, wherein the training data set is obtained by collecting a matrix consisting of historical time series data of resource usage of each host in the cloud resource pool and performing a normalization operation;
[0012] Organize the training dataset and create input datasets and labels for training the GC-LSTM neural network model. Divide the training dataset into N input datasets and labels, where N is the number of input datasets and labels. The input dataset is a subset of the training dataset, and the label is the resource utilization of the input dataset at the next moment.
[0013] Construct a GC-LSTM neural network model, which includes an input layer, a GC layer, a pooling layer, a Flatten layer, and an LSTM layer;
[0014] The GC-LSTM neural network is trained using a training data set, where the training data set consists of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training;
[0015] Input the real-time collected resource utilization data into the trained GC-LSTM neural network for prediction and output the prediction result, where the prediction result is the resource utilization of the next time series;
[0016] According to the prediction results, the cloud resource management center allocates and schedules cloud resources in advance based on the resource utilization of the next time series.
[0017] The obtaining of the training data set comprises:
[0018] Collect the historical time series data of resource usage of each host in the cloud resource pool, and obtain the resource usage time series matrix of each host in time period T as X = {x1, x2, L, x T}, normalize the matrix X, and the normalization calculation formula is:
[0019] in, is the normalized data, x t is the original input data, x min =min(x1:x T ), min(a:b) means taking the minimum value of all numbers from a to b, x max =max(x1:x T ), max(a:b) means taking the maximum value of all numbers from a to b;
[0020] The matrix is obtained by normalization operation As a training dataset for the GC-LSTM neural network model.
[0021] The training data set is organized and used to prepare the input data set and labels for GC-LSTM neural network model training, including:
[0022] The training dataset is converted into N supervised learning datasets with labels. The supervised learning dataset with labels is to divide the training dataset into N input datasets and labels, where N is the number of input datasets and labels. The value of N is based on the training dataset. The time period T determines the resource utilization rate at the next moment of the input data set. The label is used to train the GC-LSTM neural network model and calculate the loss function value. The resource utilization rate in the historical time period t:t+m-1 is used as the input data for training the GC-LSTM neural network model, and the resource utilization rate at the next time t+m is used as the label. The input data and labels of the GC-LSTM neural network model after sorting are:
[0023] in for The input data is a subset of the training data set. The N input data sets are sequentially input into the GC-LSTM neural network model for training. m is the length of the subset of the intercepted time series, and the subset length is a fixed value. is a label, which indicates the resource usage rate at time t+m after the input data.
[0024] The process of building the GC-LSTM neural network model includes:
[0025] In the GC-LSTM neural network model, the input is The tensor is composed of multiple input subsets, and the output is a tensor composed of the predicted values corresponding to the subsets;
[0026] Let the tensor input to the GC layer be z, and the output after the first convolutional layer L1 is:
[0027] in represents a one-dimensional convolution with c channels, commonly used for convolution of sequence data, and δ represents the rectified linear unit (ReLU) activation function. The output of the second convolution layer L2 is:
[0028] Reactivation after multiple convolutional layers is used to increase the nonlinear ability of the model;
[0029] In order to obtain the weights of different channels in time series data and further adjust the importance of feature channels, a gated one-dimensional convolution (GC) method is proposed here: a one-dimensional global maximum pooling is performed on the features output by the second convolutional layer, and the output of L3 is obtained as follows:
[0030] Among them G maxpool (·) represents the global maximum pooling operation, and σ represents the Sigmiod activation function, which further maps the output global feature value to the range of 0 to 1, and then broadcasts and multiplies it with the original feature. Here, the Sigmiod function is regarded as a gate to recalibrate the channels in the original feature, thereby obtaining the importance of different channel features based on the feature itself. The output after recalibration is:
[0031] The feature is passed through a one-dimensional convolution again to get the output of L4:
[0032] This is the output of the GC layer;
[0033] In order to reduce the dimension of the GC layer output features and reduce the amount of calculation and parameters, the pooling layer is used to reduce the dimension. The output of L5 is: d =G maxpool (z o )
[0034] To further construct temporal relationships between features before inputting them into the LSTM (Long Short-Term Memory) layer, the Flatten layer is used to flatten the pooled output tensor to one dimension to align it with the LSTM layer's input format.
[0035] The LSTM layer learns the temporal correlation of the feature tensor passed in by the Flatten layer. Since RNN is affected by short-term memory, if a time series is long enough (for example, the sampling time of cloud host resource utilization data is one year), it will be difficult to transmit information from an earlier time to a later time step. In other words, important information from an earlier time period may be omitted in the final prediction. Therefore, LSTM is used in this model to obtain long-range relationships in time series. LSTM can learn long-term dependent information and effectively solve the problems of gradient vanishing and gradient exploding in RNN, and regulate information flow. The output of the last LSTM layer can be used to obtain the predicted result, where the predicted result is the resource utilization rate of the next time series.
[0036] The method of training the GC-LSTM neural network model using the training data set includes:
[0037] During the training process, back propagation is used to optimize the parameters in the neural network model, where the loss function is the root mean square error:
[0038] The root mean square error (RMSE) is used to measure the deviation between the predicted value and the true label. Represents the i-th cloud resource utilization sample The corresponding predicted value, represents the true value corresponding to the actual i-th cloud resource utilization sample, and n represents the number of samples. As the number of training times increases, the gradient descent method (SGD) is used to update the parameters in the network so that the target loss function RMSE is optimized to a minimum and stable state. At this time, the corresponding network model reaches convergence.
[0039] Inputting the real-time collected resource utilization data into the trained GC-LSTM neural network for prediction includes:
[0040] Save the trained GC-LSTM neural network model and parameters. Input the real-time collected resource utilization data as the input of the GC-LSTM neural network model. Call the trained GC-LSTM neural network model and load the trained parameters. Output the prediction result, which is the resource utilization of the next time series.
[0041] The cloud resource management center allocates and schedules cloud resources in advance based on the resource utilization rate of the next time series, including:
[0042] Based on the resource utilization rate of the next time series predicted by the GC-LSTM neural network model, the cloud resource management center can allocate and schedule cloud resources in advance, which is conducive to improving resource utilization. At the same time, it can also pre-release unused resources and further reduce maintenance costs.
[0043] To address the technical problems existing in the prior art, this application proposes a cloud resource prediction system based on a GC-LSTM neural network model. The system includes:
[0044] The data set acquisition module is used to acquire a training data set, wherein the training data set is obtained by collecting a matrix consisting of historical time series data of resource usage of each host in the cloud resource pool and performing a normalization operation;
[0045] The module for organizing and creating training input data and labels is used to organize the training dataset and create input datasets and labels for training the GC-LSTM neural network model. The training dataset is divided into N input datasets and labels, where N is the number of input datasets and labels. The input dataset is a subset of the training dataset, and the label is the resource utilization of the input dataset at the next moment.
[0046] Build a GC-LSTM neural network model module, which is used to build a GC-LSTM neural network model. The GC-LSTM neural network model includes an input layer, a GC layer, a pooling layer, a Flatten layer, and an LSTM layer.
[0047] The training GC-LSTM neural network block is used to train the GC-LSTM neural network using a training data set. The training data set consists of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training.
[0048] The prediction module is used to input the real-time collected resource utilization data into the trained GC-LSTM neural network for prediction and output the prediction result, which is the resource utilization of the next time series;
[0049] The response module is used to allocate and schedule cloud resources in advance based on the resource utilization of the next time series according to the prediction results.
[0050] The present application discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the cloud resource prediction method based on the GC-LSTM neural network model are implemented.
[0051] The present application discloses a readable storage medium storing a computer program, wherein the computer program is suitable for being loaded by a processor to execute the steps in the cloud resource prediction method based on the GC-LSTM neural network model.
[0052] Compared with the prior art, the advantages and beneficial effects of this application are:
[0053] 1) This application constructs a neural network through machine learning and trains the neural network with data from existing samples, so that the predicted resource utilization of the next time series is more accurate than that predicted by traditional methods, and can provide valuable data basis for resource scheduling and allocation adjustment.
[0054] 2) The method proposed in this application can give full play to the advantages of LSTM in capturing long-term dependency information, and at the same time construct a GC (Gated convolution) layer to learn implicit relationships in time series data.
[0055] 3) The proposed GC-LSTM neural network model is relatively simple, easy to train, and converges quickly during training, resulting in better results.
[0056] 4) The model proposed in this application is simple and has few parameters, which can ensure the real-time prediction results and is practical and feasible. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] FIG1 is a flowchart of a cloud resource prediction method based on a GC-LSTM neural network model provided by one embodiment of the present application;
[0058] FIG2 is a schematic diagram of a cloud resource prediction method based on a GC-LSTM neural network model provided by one embodiment of the present application;
[0059] FIG3 is a schematic diagram of the structure of a GC-LSTM neural network model constructed by a cloud resource prediction method based on a GC-LSTM neural network model according to an embodiment of the present application;
[0060] FIG4 is a schematic diagram of a cloud resource prediction system based on a GC-LSTM neural network model according to an embodiment of the present application;
[0061] FIG5 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application;
[0062] FIG6 is a schematic diagram of the structure of a computer-readable storage medium provided by an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make people in this technical field better understand the technical solution of this application, the technical solution of this application is further described below in conjunction with the drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0064] The embodiments and other aspects of the present application will be clarified with reference to the following description and drawings. In these descriptions and drawings, some specific implementations of the embodiments of the present application are specifically disclosed to illustrate some ways of implementing the principles of the embodiments of the present application, but it should be understood that the scope of the embodiments of the present application is not limited thereto. On the contrary, the embodiments of the present application include all changes, modifications and equivalents that fall within the spirit and scope of the appended claims.
[0065] Figure 2 shows an embodiment of the cloud resource prediction method based on the GC-LSTM neural network model described in this application. In this implementation example, resource prediction is carried out in two stages: the first stage is the training stage: the GC-LSTM neural network is trained by acquiring historical time series data, and its own parameters are continuously updated with the iteration of the number of training rounds. After the model converges, it enters the second stage (prediction stage): the GC-LSTM neural network loads the trained parameter model through the acquired real-time sampling data to predict the results. Finally, based on the predicted results, resources can be scheduled and allocated in advance to ensure the high elasticity and high availability of resources as much as possible.
[0066] Example 1
[0067] FIG1 is a flow chart of a cloud resource prediction method based on a GC-LSTM neural network model provided by one embodiment of the present application. As shown in FIG1 , the steps of the cloud resource prediction method based on a GC-LSTM neural network model include:
[0068] Obtain a training data set, wherein the training data set is obtained by collecting a matrix consisting of historical time series data of resource usage of each host in the cloud resource pool and performing a normalization operation;
[0069] Organize the training dataset and create input datasets and labels for training the GC-LSTM neural network model. Divide the training dataset into N input datasets and labels, where N is the number of input datasets and labels. The input dataset is a subset of the training dataset, and the label is the resource utilization of the input dataset at the next moment.
[0070] Construct a GC-LSTM neural network model, which includes an input layer, a GC layer, a pooling layer, a Flatten layer, and an LSTM layer;
[0071] The GC-LSTM neural network is trained using a training data set, where the training data set consists of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training;
[0072] Input the real-time collected resource utilization data into the trained GC-LSTM neural network for prediction and output the prediction result, where the prediction result is the resource utilization of the next time series;
[0073] According to the prediction results, the cloud resource management center allocates and schedules cloud resources in advance based on the resource utilization of the next time series.
[0074] The training data set is obtained by collecting a matrix consisting of historical time series data of resource usage of each host in the cloud resource pool and performing normalization operation:
[0075] Collect the historical time series data of resource usage of each host in the cloud resource pool, and obtain the resource usage time series matrix of each host in time period T as X = {x1, x2, L, x T}, normalize the matrix X, and the normalization calculation formula is:
[0076] in, is the normalized data, x t is the original input data, x min =min(x1:x T ), min(a:b) means taking the minimum value of all numbers from a to b, x max =max(x1:x T ), max(a:b) means taking the maximum value of all numbers from a to b;
[0077] The matrix is obtained by normalization operation As a training dataset for the GC-LSTM neural network model.
[0078] The said arranging of the training data set and producing the input data set and labels for GC-LSTM neural network model training includes:
[0079] The training dataset is converted into N supervised learning datasets with labels. The supervised learning dataset with labels is to divide the training dataset into N input datasets and labels, where N is the number of input datasets and labels. The value of N is based on the training dataset. The time period T determines the resource utilization rate at the next moment of the input data set. The label is used to train the GC-LSTM neural network model and calculate the loss function value. The resource utilization rate in the historical time period t:t+m-1 is used as the input data for training the GC-LSTM neural network model, and the resource utilization rate at the next time t+m is used as the label. The input data and labels of the GC-LSTM neural network model after sorting are:
[0080] in for The input data is a subset of the training data set. The N input data sets are sequentially input into the GC-LSTM neural network model for training. m is the length of the subset of the intercepted time series, and the subset length is a fixed value. is a label, which indicates the resource usage rate at time t+m after the input data.
[0081] The construction of the GC-LSTM neural network model includes:
[0082] In the GC-LSTM neural network model, the input is The GC-LSTM neural network model consists of five parts: input layer, GC layer, pooling layer, Flatten layer, and LSTM layer.
[0083] The gated one-dimensional convolution (GC) is used to obtain the weights of different channels in the time series data to further adjust the importance of the feature channels; the pooling layer is used to reduce the dimension of the output features of the GC layer to reduce the amount of calculation and parameters; the Flatten layer flattens the tensor output after pooling to one dimension for alignment with the input format of the LSTM layer; the LSTM layer is used to learn the time correlation of the feature tensor passed in by the Flatten layer; a generalized form of tensor multidimensional array, representing the matrix data of the input subset, is used to represent the input data, intermediate features and output results in the neural network.
[0084] As shown in Figure 3, the structure of the constructed GC-LSTM neural network model is as follows:
[0085] The GC layer, as the encoder part, consists of three one-dimensional convolutional layers, and a gating mechanism is added to learn the implicit relationships in time series data.
[0086] Specifically, let the tensor input to this layer be z, and the output after the first convolutional layer L1 is:
[0087] in represents a one-dimensional convolution with c channels, commonly used for convolution of sequence data, and δ represents the rectified linear unit (ReLU) activation function. The output of the second convolution layer L2 is:
[0088] Reactivating multiple convolutional layers can increase the nonlinearity of the model. To obtain the weights of different channels in time series data and further adjust the importance of feature channels, a gated one-dimensional convolution (GC) method is proposed here: a one-dimensional global maximum pooling is performed on the features output by the second convolutional layer, and the resulting L3 output is:
[0089] Among them G maxpool (·) represents the global maximum pooling operation, and σ represents the Sigmiod activation function, which further maps the output global feature value to the range of 0 to 1, and then broadcasts and multiplies it with the original feature. Here, the Sigmiod function can be regarded as a gate to recalibrate the channels in the original feature, thereby obtaining the importance of different channel features based on the feature itself. The output after recalibration is:
[0090] The feature is passed through a one-dimensional convolution again to get the output of L4:
[0091] This is the output of the GC layer.
[0092] Next, in order to reduce the dimension of the GC layer output features and reduce the amount of calculation and parameters, the pooling layer is used here to reduce the dimension. The output of L5 is: d =G maxpool (z o )
[0093] In order to input the LSTM (Long Short-Term Memory) layer to further construct the temporal relationship of features, the Flatten layer is used to flatten the tensor output after pooling to one dimension for alignment with the input format of the LSTM layer.
[0094] The LSTM layer learns the temporal dependencies of the feature tensor passed in by the Flatten layer. Because RNNs are affected by short-term memory, if a time series is long enough (for example, cloud server resource utilization data sampled over a year), it becomes difficult to propagate information from earlier time steps to later time steps. This means that important information from earlier time periods may be missed in the final prediction. Therefore, this model uses LSTM to capture long-range relationships in the time series. LSTM can learn long-term dependencies, effectively addressing the vanishing and exploding gradient problems in RNNs and regulating information flow. The output of the final LSTM layer provides the predicted result, which is the resource utilization rate for the next time series.
[0095] The method of training the GC-LSTM neural network model using the training data set includes:
[0096] N input data sets are sequentially fed into the GC-LSTM neural network model for training. During the training process, backpropagation is used to optimize the parameters in the neural network model. The loss function is the root mean square error:
[0097] The root mean square error (RMSE) is used to measure the deviation between the predicted value and the true label. Represents the i-th cloud resource utilization sample The corresponding predicted value, represents the true value corresponding to the actual i-th cloud resource utilization sample, and n represents the number of samples. As the number of training times increases, the gradient descent method (SGD) is used to update the parameters in the network so that the target loss function RMSE is optimized to a minimum and stable state. At this time, the corresponding network model reaches convergence.
[0098] Inputting the real-time collected resource utilization data into the trained GC-LSTM neural network for prediction includes:
[0099] Save the trained GC-LSTM neural network model and parameters. Input the real-time collected resource utilization data as the input of the GC-LSTM neural network model. Call the trained GC-LSTM neural network model and load the trained parameters. Output the prediction result, which is the resource utilization of the next time series.
[0100] The cloud resource management center allocates and schedules cloud resources in advance based on the resource utilization rate of the next time series, including:
[0101] Based on the resource utilization rate of the next time series predicted by the GC-LSTM neural network model, the cloud resource management center can allocate and schedule cloud resources in advance, which is conducive to improving resource utilization. At the same time, it can also pre-release unused resources and further reduce maintenance costs.
[0102] Example 2
[0103] FIG4 is a schematic diagram of a cloud resource prediction system based on a GC-LSTM neural network model provided by one embodiment of the present application. The system includes:
[0104] Get the dataset module for:
[0105] Obtain a training data set, wherein the training data set is obtained by collecting a matrix consisting of historical time series data of resource usage of each host in the cloud resource pool and performing a normalization operation;
[0106] Organize and create training input data and label modules for:
[0107] Organize the training dataset and create input datasets and labels for training the GC-LSTM neural network model. Divide the training dataset into N input datasets and labels, where N is the number of input datasets and labels. The input dataset is a subset of the training dataset, and the label is the resource utilization of the input dataset at the next moment.
[0108] Construct a GC-LSTM neural network model module to construct a GC-LSTM neural network model, wherein the GC-LSTM neural network model consists of five parts: input layer, GC layer, pooling layer, Flatten layer, and LSTM layer.
[0109] The training GC-LSTM neural network block is used to train the GC-LSTM neural network using a training data set. The training data set consists of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training.
[0110] The prediction module is used to input the real-time collected resource utilization data into the trained GC-LSTM neural network for prediction and output the prediction result, which is the resource utilization of the next time series;
[0111] The response module is used to allocate and schedule cloud resources in advance based on the resource utilization of the next time series according to the prediction results.
[0112] Example 3
[0113] Figure 5 is a schematic diagram of the structure of an electronic device provided by one embodiment of the present application. As shown in Figure 5, according to another aspect of the present application, an electronic device 500 is also provided. The electronic device 500 may include one or more processors and one or more memories. The memory stores computer-readable code, which, when executed by one or more processors, can execute a method for measuring the full-link latency of a cloud computer.
[0114] The method or system according to the embodiment of the present application can also be implemented with the aid of the architecture of the electronic device shown in FIG5 . As shown in FIG5 , the electronic device 500 may include a bus 501, one or more CPUs 502, a read-only memory (ROM) 503, a random access memory (RAM) 504, a communication port 505 connected to a network, an input / output component 506, a hard disk 507, etc. The storage device in the electronic device 500, such as the ROM 503 or the hard disk 507, may store a cloud resource prediction method based on a GC-LSTM neural network model provided in the present application. A method for measuring the full-link latency of a cloud computer may, for example, include: obtaining a training data set, wherein the training data set is obtained by collecting a matrix consisting of historical time series data of resource utilization of each host in a cloud resource pool and performing a normalization operation; organizing the training data set and producing an input data set and labels for training a GC-LSTM neural network model, dividing the training data set into N input data sets and labels, N being the number of input data sets and labels, wherein the input data set is a subset of the training data set, and the label is the resource utilization of the input data set at the next moment; constructing a GC-LSTM neural network model, wherein the GC-LSTM neural network model includes an input layer, a GC layer, a pooling layer, a Flatten layer, and an LSTM layer; training the GC-LSTM neural network using the training data set, wherein the training data set consists of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training; inputting the resource utilization data collected in real time into the trained GC-LSTM neural network for prediction, and outputting a prediction result, wherein the prediction result is the resource utilization of the next time series; based on the prediction result, the cloud resource management center allocates and schedules cloud resources in advance based on the resource utilization of the next time series. Optionally, the electronic device 500 may further include a user interface 508. Of course, the architecture shown in FIG5 is merely exemplary, and when implementing different devices, one or more components in the electronic device shown in FIG5 may be omitted according to actual needs.
[0115] Example 4
[0116] FIG6 is a schematic diagram of the structure of a computer-readable storage medium provided by an embodiment of the present application. As shown in FIG6 , a computer-readable storage medium 600 according to an embodiment of the present application is shown. Computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by the processor, a cloud resource prediction method based on a GC-LSTM neural network model according to an embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache). Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0117] It should be understood that the methods, apparatuses, and devices of the present application can be implemented in many ways. For example, the methods, apparatuses, and devices of the present application can be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps used for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present application can also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media that store programs for executing the method according to the present application.
[0118] In addition, the parts of the above technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0119] The above-described specific embodiments further illustrate the purpose, technical solutions, and beneficial effects of this application. It should be understood that the above description is merely a specific embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application shall be included within the scope of protection of this application.
Claims
1. A cloud resource prediction method based on GC-LSTM neural network model, characterized in that: The following steps are involved: Obtain a training data set, wherein the training data set is obtained by collecting a matrix consisting of historical time series data of resource usage of each host in the cloud resource pool and performing a normalization operation; The training data set is sorted and input data sets and labels are prepared for training the GC-LSTM neural network model. The training data set is divided into N input data sets and labels, where N is the number of input data sets and labels, wherein the input data set is a subset of the training data set, and the label is the resource utilization rate of the input data set at the next moment; Construct a GC-LSTM neural network model, where the GC-LSTM neural network model includes an input layer, a GC layer, a pooling layer, a Flatten layer, and an LSTM layer; The GC-LSTM neural network is trained using the training data set, wherein the training data set consists of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training; Input the resource utilization data collected in real time into the trained GC-LSTM neural network for prediction and output the prediction result, where the prediction result is the resource utilization of the next time series; According to the prediction results, the cloud resource management center allocates and schedules cloud resources in advance based on the resource utilization of the next time series.
2. The cloud resource prediction method based on the GC-LSTM neural network model according to claim 1, characterized in that: The obtaining of the training data set comprises: Collect the historical time series data of resource utilization of each host in the cloud resource pool, and obtain the resource utilization time series matrix of each host in time period T as X = {x1, x2, L, x T }, normalize the matrix X, and the normalization calculation formula is: in, is the normalized data, x t is the original input data, x min =min(x1:x T ), min(a:b) means taking the minimum value of all numbers from a to b, x max =max(x1:x T ), max(a:b) means taking the maximum value of all numbers from a to b; The matrix is obtained by normalization operation As a training data set for the GC-LSTM neural network model.
3. The cloud resource prediction method based on the GC-LSTM neural network model according to claim 1, characterized in that: The method of arranging the training data set and preparing the input data set and labels for GC-LSTM neural network model training includes: The training data set is converted into N supervised learning data sets with labels. The supervised learning data set with labels is to divide the training data set into N input data sets and labels, where N is the number of input data sets and labels. The value of N is based on the training data set. The resource utilization rate of the historical time period t:t+m-1 is used as the input data for training the GC-LSTM neural network model, and the resource utilization rate of the next time period t+m is used as the label. The input data and labels of the GC-LSTM neural network model are as follows: in for The input data is a subset of the training data set. The N input data sets are sequentially input into the GC-LSTM neural network model for training. m is the subset length of the intercepted time series, and the subset length is a fixed value. is a label, which indicates the resource usage rate at time t+m after the input data.
4. The cloud resource prediction method based on the GC-LSTM neural network model according to claim 1, characterized in that: The process of constructing the GC-LSTM neural network model includes: In the GC-LSTM neural network model, the input is The tensor is composed of multiple input subsets divided, and the output is a tensor composed of the predicted values corresponding to the subsets; Let the tensor input to the GC layer be z, and the output after the first convolutional layer L1 is: in Represents a one-dimensional convolution with c channels, which is often used for convolution of sequence data. δ represents the rectified linear unit (ReLU) activation function. The output of the second convolution layer L2 is: Reactivation after multiple convolutional layers is used to increase the nonlinear ability of the model; In order to obtain the weights of different channels in the time series data and further adjust the importance of the feature channels, a gated one-dimensional convolution (GC) method is proposed here: the features output by the second convolution layer are subjected to one-dimensional global maximum pooling, and the output of L3 is obtained as follows: Among them G maxpool (·) represents the global maximum pooling operation, σ represents the Sigmiod activation function, which further maps the value of the output global feature to the range of 0 to 1, and then broadcasts and multiplies it with the original feature. Here, the Sigmiod function is regarded as a gate to recalibrate the channels in the original feature, so as to obtain the importance of different channel features based on the feature itself. The output after recalibration is: The feature is passed through a one-dimensional convolution again to get the output of L4: This is the output of the GC layer; In order to reduce the dimension of the GC layer output features and reduce the amount of calculation and parameters, the pooling layer is used to reduce the dimension. The output of L5 is: z d =G maxpool (z o ) In order to input the LSTM (Long short-term memory) layer to further construct the temporal relationship of features, the Flatten layer is used to flatten the tensor output after pooling to one dimension for alignment with the input format of the LSTM layer; The LSTM layer learns the time correlation of the feature tensor passed in by the Flatten layer. Since RNN is affected by short-term memory, if a time series is long enough (for example, the sampling time of cloud host resource utilization is one year), it will be difficult to transmit information from an earlier time to a later time step, which means that important information from an earlier time period may be missed in the final prediction. Therefore, LSTM is used in this model to obtain long-term relationships in time series. LSTM can be used to learn long-term dependent information, effectively solve the problems of gradient disappearance and gradient explosion in RNN, and regulate information flow. The output of the last LSTM layer can be used to obtain the predicted result, which is the resource utilization rate of the next time series.
5. The cloud resource prediction method based on the GC-LSTM neural network model according to claim 4 is characterized in that: The method of training the GC-LSTM neural network model using the training data set includes: During the training process, back propagation is used to optimize the parameters in the neural network model, where the loss function is the root mean square error: The root mean square error RMSE is used to measure the deviation between the predicted value and the true label. Represents the i-th cloud resource utilization sample The corresponding predicted value is represents the true value corresponding to the actual i-th cloud resource utilization sample, and n represents the number of samples. With the accumulation of training times, the parameters in the network are updated through the gradient descent method (SGD) so that the target loss function RMSE is optimized to a minimum and stable state, and the corresponding network model reaches convergence.
6. The cloud resource prediction method based on the GC-LSTM neural network model according to claim 1, characterized in that: The step of inputting the real-time collected resource utilization data into the trained GC-LSTM neural network for prediction includes: The trained GC-LSTM neural network model and parameters are saved, and the real-time collected resource utilization data is input as the input of the GC-LSTM neural network model. The trained GC-LSTM neural network model is called and the trained parameters are loaded to output the prediction result, which is the resource utilization of the next time series.
7. The cloud resource prediction method based on the GC-LSTM neural network model according to claim 1, characterized in that: The cloud resource management center allocates and schedules cloud resources in advance based on the resource utilization rate of the next time series, including: Based on the resource utilization of the next time series predicted by the GC-LSTM neural network model, the cloud resource management center can allocate and schedule cloud resources in advance, which is conducive to improving resource utilization. At the same time, it can also release unused resources in advance and further reduce maintenance costs.
8. A cloud resource prediction system based on GC-LSTM neural network model, characterized in that: The system comprises: The data set acquisition module is used to acquire a training data set, wherein the training data set is acquired by collecting a matrix composed of historical time series data of resource usage of each host in the cloud resource pool and performing normalization operation; Arrange and create training input data and label module, which is used to arrange the training data set and create input data set and labels for training the GC-LSTM neural network model, and divide the training data set into N input data sets and labels, where N is the number of input data sets and labels, wherein the input data set is a subset of the training data set, and the label is the resource utilization rate of the input data set at the next moment; Construct a GC-LSTM neural network model module, which is used to construct a GC-LSTM neural network model. The GC-LSTM neural network model includes an input layer, a GC layer, a pooling layer, a Flatten layer, and an LSTM layer. A training GC-LSTM neural network block is used to train the GC-LSTM neural network using a training data set, wherein the training data set consists of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training; The prediction module is used to input the resource utilization data collected in real time into the trained GC-LSTM neural network for prediction and output the prediction result, which is the resource utilization of the next time series; The response module is used to allocate and schedule cloud resources in advance based on the resource utilization of the next time series according to the prediction results.
9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the cloud resource prediction method based on the GC-LSTM neural network model as described in any one of claims 1 to 7 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps of the cloud resource prediction method based on the GC-LSTM neural network model as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Cloud data center load prediction method based on LSTM (Long Short-Term Memory)
CN108170529A
Time series data prediction method and device based on CGA fusion model and computer equipment
CN114565149A
Cloud resource prediction algorithm based on GC-LSTM neural network model
CN117785443A
Cited By
Large-scale heterogeneous computing power cluster training and pushing acceleration method
CN120449929A
Power distribution network demand side response method, device, equipment and system
CN120749770A
Short message marketing effect optimization method and system based on multi-channel dynamic weight
CN120807020A
Dynamic task scheduling method and system for multi-machine collaborative operation industrial robot
CN120828426A
Machine tool operation state prediction method based on edge calculation
CN120949700A