Cloud resource prediction algorithm based on GC-LSTM neural network model
Through the cloud resource prediction algorithm based on the GC-LSTM neural network model, the real-time and accuracy issues of cloud resource scheduling are solved, efficient resource scheduling and utilization are achieved, and maintenance costs are reduced.
Patent Information
- Application Number
- CN202311693371.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2043-12-11
AI Technical Summary
Existing cloud resource prediction models are difficult to achieve real-time and accuracy, resulting in improper resource scheduling, which may lead to service level agreement breaches, reduced service quality and user churn. In addition, the computational complexity of existing models makes it difficult to ensure real-time performance.
A GC-LSTM neural network model is used to acquire and normalize historical time series data, construct input data sets and labels, train the GC-LSTM neural network, use the GC layer and LSTM layer to learn time series data, and output prediction results to achieve resource utilization prediction.
It achieves advance prediction and scheduling of cloud resources, improves resource utilization, reduces maintenance costs, ensures high elasticity and high availability of resources, simplifies the model training process and improves the real-time performance of predictions.
Smart Images

Figure CN117785443B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to cloud computing technology, in particular to a cloud resource prediction algorithm based on a GC-LSTM neural network model. BACKGROUND
[0002] Cloud computing is a service model that allocates computing resources on demand through a network. The computing resources include servers, databases, storage, platforms, architectures and applications. With the popularization of cloud computing applications, reasonable allocation and scheduling of resources have become the core and focus of cloud computing problem research. The ultra-fast development of cloud computing technology puts forward higher requirements for the real-time and accuracy of resource scheduling. At present, it is difficult to achieve zero-time delay response based on real-time resource scheduling, and resource scheduling may also appear waiting starvation due to insufficient reserved resources. Therefore, with the help of a resource prediction model, the resource request situation in the future period of time can be predicted, so as to facilitate advance hardware planning, resource relocation, guarantee expansion demand under traffic flood, and help improve the high availability and high elasticity performance of cloud computing services. With the help of the prediction model, resources that may be shelved in the future period of time can be predicted in time, so as to release the resources that are not needed in time, further reduce resource waste and reduce maintenance cost.
[0003] The application with the publication number CN113886454A and the title of a cloud resource prediction method based on LSTM-RBF simultaneously establishes two models: LSTM and RBF to make predictions, and then uses a BP neural network to replace the traditional weight search method to make a hybrid prediction of the prediction values of LSTM and RBF, and finally outputs a hybrid prediction result. Although this multi-model fusion prediction method can respectively exert the advantages of LSTM and RBF, it is very time-consuming when training the neural network, and because of the large structural difference between the two network models, the model may not converge when training the network. The application with the publication number CN112785051A and the title of a cloud resource prediction method based on the combination of EMD and TCN decomposes the original sequence into multiple IMF and a residual component Res by using EMD, arranges the data set in time sequence, inputs the data set into the TCN network model for training, and finally uses the trained TCN model to predict the cloud resource load to be predicted. The extended convolution is used in the TCN network to expand the receptive field and further capture long-time dependent information, but TCN needs more memory than LSTM because each sequence is processed by multiple expansion layers. The application with the publication number CN111274530B and the title of a container cloud resource prediction method uses a proportional-integral-derivative (PID) algorithm and an adaptive moment estimation method (ADAM) to respectively calculate the output weight matrix of the feature nodes and the enhanced nodes in the establishment of a dense width learning model, so as to complete the training of the dense width learning model.
[0004] Currently, the prediction and scheduling of cloud resources mainly faces the following two problems:
[0005] (1) The allocation and scheduling of cloud resources are difficult to achieve real-time, and if there is a sudden shortage of resources, it may lead to service level agreement (SLA) violation, quality of service (QoS) reduction, and ultimately even cause user dissatisfaction and user loss and economic loss. If the utilization of resources can be predicted in advance, the phenomenon of resource shortage can be effectively prevented.
[0006] (2) It has been proposed and proved that the reasonable scheduling and allocation of cloud resources based on the prediction results is an effective method to solve the cloud resource scheduling, but the existing prediction models based on cloud resources are few, and the application is not mature, and because the calculation of part of the model is too complex, the real-time of the prediction is difficult to guarantee. SUMMARY
[0007] The purpose of the present application is to provide a cloud resource prediction algorithm based on a GC-LSTM neural network model. On the one hand, it can be used to predict the demand of customers for resources in advance, plan hardware, and move resources to ensure the expansion demand under the traffic flood and optimize the customer's cloud experience; on the other hand, it can predict the over-provisioning of resources in advance, reduce resource waste and save maintenance costs.
[0008] The present application proposes a cloud resource prediction method based on a GC-LSTM neural network model to solve the technical problems existing in the prior art, comprising:
[0009] Obtain a training data set, wherein the training data set is a matrix composed of historical time series data of resource utilization rate of each host in the cloud resource pool after normalization operation;
[0010] Organize the training data set and make input data set and label for training GC-LSTM neural network model, divide the training data set into N input data sets and labels, 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 at the next moment of the input data set;
[0011] Build a GC-LSTM neural network model, wherein the GC-LSTM neural network model comprises an input layer, a GC layer, a pooling layer, a Flatten layer, and an LSTM layer;
[0012] Train the GC-LSTM neural network using the training data set, wherein the training data set is composed of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training;
[0013] The real-time collected resource utilization data is input into the trained GC-LSTM neural network for prediction, and a prediction result is output, wherein the prediction result is a resource utilization of a next time sequence;
[0014] According to the prediction result, the cloud resource management center allocates and schedules the cloud resources in advance based on the resource utilization of the next time sequence.
[0015] The obtaining of the training data set comprises:
[0016] The historical time sequence data of the resource utilization of each host in the cloud resource pool is collected, and a resource utilization time sequence matrix of each host in a time period T is obtained as The matrix X is normalized, and the normalization calculation formula is:
[0017]
[0018] wherein, is the normalized data, x t is the original input data, x min min(x1:x T ), min(a:b) represents taking the minimum value of all numbers from a to b, x max max(x1:x T ), max(a:b) represents taking the maximum value of all numbers from a to b;
[0019] The matrix is obtained through the normalization operation.
[0020] The training data set is sorted and prepared as an input data set and a label for the GC-LSTM neural network model training, comprising:
[0021] The training data set is converted into N labeled supervised learning data sets, the labeled supervised learning data set is divided into N input data sets and labels, wherein N is the number of input data sets and labels, the value of N is determined according to the training data set in the time period T, the label is the resource utilization of the next moment of the input data set, and the label is used to train the GC-LSTM neural network model to calculate the loss function value; the resource utilization of the historical time period is used as the input data of the training GC-LSTM neural network model, and the resource utilization of the next time t+m is used as the label, so that the sorted GC-LSTM neural network model input data and label are obtained as:
[0022]
[0023]
[0024] wherein is a subset of the input data is a subset of the training data set, and 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 sequence, and the subset length is a fixed value, is a label, representing the resource utilization rate at the next time t+m after the input data.
[0025] The process of constructing the GC-LSTM neural network model comprises:
[0026] In the GC-LSTM neural network model, the input is a tensor composed of multiple input subsets divided, and the output is a tensor composed of predicted values corresponding to the subsets;
[0027] Let the tensor input into the GC layer be z, and the output obtained after the first convolutional layer L1 is:
[0028]
[0029] wherein represents a one-dimensional convolution with a channel number c, which is commonly used for convolution of sequence data, and δ represents a rectified linear unit (ReLU) activation function. The output obtained after the second convolutional layer L2 is:
[0030]
[0031] After multiple convolutional layers and activation, the nonlinearity of the model is increased;
[0032] In order to obtain the weight of different channels in the time sequence data, so as to further adjust the importance of the feature channels, a one-dimensional convolution (GC, Gated convolution) method based on gating is proposed here: one-dimensional global maximum pooling is performed on the features output by the second convolutional layer, and the output of L3 is:
[0033]
[0034] wherein G maxpool (·) represents the operation of global maximum pooling, and σ represents the Sigmiod activation function, which further maps the value of the global feature to the range of 0-1, and then performs broadcast multiplication with the original feature. Here, the Sigmiod function is regarded as a gate, which reweights the channels in the original feature, so as to obtain the importance of different channel features according to the features themselves. The output after reweighting is:
[0035]
[0036] The output of L4 is obtained by a one-dimensional convolution of the features again:
[0037]
[0038] which is the output of the GC layer;
[0039] In order to reduce the dimensionality of the GC layer output features and reduce the amount of calculation and parameters, a pooling layer is used to reduce the dimensionality, and the output of L5 is:
[0040] z d = G maxpool (z o )
[0041] In order to input the LSTM (Long short-term memory) layer to further construct the relationship between the features in time sequence, a Flatten layer is used to flatten the tensor output after pooling to one dimension, which is used to align the input format of the LSTM layer;
[0042] The LSTM layer learns the time correlation of the feature tensor transmitted by the Flatten layer; since RNN is affected by short-term memory, if a time sequence is long enough (for example, the sampling time of cloud host resource utilization is one year of data), it will be difficult to further transmit information from earlier times to later times, that is, important information in the early time period may be missed in the final prediction; Therefore, LSTM is used in this model to obtain long-range relationships in time sequence; LSTM can learn long-term dependent information and effectively solve the problems of gradient disappearance and gradient explosion in RNN, and adjust the information flow; The output of the last LSTM layer can obtain the prediction result, wherein the prediction result is the resource utilization of the next time sequence.
[0043] The GC-LSTM neural network model is trained using a training data set, including:
[0044] During the training process, the parameters in the neural network model are optimized by back propagation, wherein the loss function is the root mean square error:
[0045]
[0046] The root mean square error RMSE is used to measure the deviation between the predicted value and the true label, wherein represents the i-th cloud resource utilization sample corresponding predicted value, The real value corresponding to the actual i-th cloud resource utilization sample is represented by n, and the sample number is represented by n; with the superposition of the number of training times, the parameters in the network are updated by the gradient descent method (SGD) to optimize the target loss function RMSE to the minimum and stable state, at this time the corresponding network model reaches convergence.
[0047] The real-time collected resource utilization data is input into the trained GC-LSTM neural network for prediction, including:
[0048] The trained GC-LSTM neural network model and parameters are saved, 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, and the prediction result is output, and the prediction result is the resource utilization of the next time sequence.
[0049] The cloud resource management center allocates and schedules the cloud resources in advance based on the resource utilization of the next time sequence, including:
[0050] According to the resource utilization of the next time sequence predicted by the GC-LSTM neural network model, the cloud resource management center can allocate and schedule the cloud resources in advance, which is beneficial to improve the resource utilization, and also can release the unused resources in advance, and further reduce the maintenance cost.
[0051] The present application aims at the technical problems existing in the prior art, and proposes a cloud resource prediction system based on a GC-LSTM neural network model, the system comprising:
[0052] The data set acquisition module is used for acquiring a training data set, wherein the training data set is a matrix composed of historical time sequence data of resource utilization of each host in a cloud resource pool after normalization operation;
[0053] The input data and label module is used for arranging and making the input data and label for training the GC-LSTM neural network model, dividing the training data set into N input data sets and labels, and 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 of the next time of the input data set.
[0054] The GC-LSTM neural network model module is used for constructing a GC-LSTM neural network model, wherein the GC-LSTM neural network model comprises an input layer, a GC layer, a pooling layer, a Flatten layer and an LSTM layer.
[0055] The GC-LSTM neural network block is trained for training the GC-LSTM neural network by using a training data set, wherein the training data set is composed of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training.
[0056] The prediction module is configured to input the real-time collected resource utilization data into the trained GC-LSTM neural network for prediction, and output a prediction result, which is a next time sequence of resource utilization.
[0057] The response module is configured to, according to the prediction result, perform early allocation and scheduling of cloud resources based on the next time sequence of resource utilization.
[0058] The electronic device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement the steps in the cloud resource prediction method based on the GC-LSTM neural network model.
[0059] The readable storage medium stores a computer program, and the computer program is adapted to be loaded by a processor to execute the steps in the cloud resource prediction method based on the GC-LSTM neural network model.
[0060] Compared with the prior art, the advantages and beneficial effects of the present application are:
[0061] 1) The present application constructs a neural network in machine learning, and trains the neural network by using existing sample data, so that the predicted next time sequence of resource utilization is more accurate than the traditional method, and valuable data basis can be provided for resource scheduling and allocation adjustment.
[0062] 2) The method disclosed by the present application can fully utilize the advantage of LSTM in capturing long-time dependent information, and a GC (Gated convolution) layer is constructed to learn the implicit relationship in time sequence data.
[0063] 3) The GC-LSTM neural network model disclosed by the present application is relatively simple, easy to train, and converges quickly during training, and has better effect.
[0064] 4) The model disclosed by the present application is simple and has less parameters, which can guarantee the real-time performance of the prediction result and has practical feasibility. BRIEF DESCRIPTION OF DRAWINGS
[0065] Figure 1 is a flowchart of the cloud resource prediction method based on the GC-LSTM neural network model provided by an embodiment of the present application;
[0066] Figure 2 is a schematic diagram of a cloud resource prediction method based on a GC-LSTM neural network model according to an embodiment of the present application;
[0067] Figure 3 is a schematic diagram of a GC-LSTM neural network model structure constructed by a cloud resource prediction method based on a GC-LSTM neural network model according to an embodiment of the present application;
[0068] Figure 4 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;
[0069] Figure 5 is a schematic diagram of an electronic device structure according to an embodiment of the present application;
[0070] Figure 6 is a schematic diagram of a computer readable storage medium structure according to an embodiment of the present application. DETAILED DESCRIPTION
[0071] In order to make the person skilled in the art better understand the technical solutions in the present application, the technical solutions of the present application will be further described below in combination with the drawings and specific embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, not all.
[0072] Embodiments and other aspects of the present application will be described in greater detail below with reference to the accompanying drawings. In these descriptions and drawings, some specific implementations of embodiments of the present application are specifically disclosed to represent some ways of embodying principles of embodiments of the present application, but it should be understood that the scope of embodiments of the present application is not limited thereto. On the contrary, embodiments of the present application include all changes, modifications and equivalents falling within the spirit and scope of the appended claims.
[0073] Figure 2 The cloud resource prediction method based on the GC-LSTM neural network model described in the present application is given. In this embodiment, resource prediction is performed in two stages: the first stage is the training stage: the GC-LSTM neural network is trained by the obtained historical time series data, and the parameters of the GC-LSTM neural network are updated with the iteration of the training rounds. After the model converges, enter the second stage (prediction stage): the GC-LSTM neural network loads the trained parameter model to predict the results by obtaining real-time sampling data. Finally, based on the predicted results, resource scheduling and allocation can be performed in advance to maximize the flexibility and availability of resources.
[0074] Embodiment 1
[0075] Figure 1is a cloud resource prediction method based on a GC-LSTM neural network model provided by an embodiment of the present application, as shown in the flowchart. Figure 1 The steps of the cloud resource prediction method based on the GC-LSTM neural network model include:
[0076] Obtain a training data set, wherein the training data set is obtained by normalizing a matrix composed of historical time series data of resource utilization rate of each host in a cloud resource pool;
[0077] Organize the training data set and make input data sets and labels for training the GC-LSTM neural network model, divide the training data set into N input data sets and labels, 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 at the next time of the input data set;
[0078] Build 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;
[0079] Train the GC-LSTM neural network using the training data set, wherein the training data set is composed of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training;
[0080] Input the real-time collected resource utilization rate data into the trained GC-LSTM neural network for prediction, and output the prediction result, wherein the prediction result is the resource utilization rate at the next time sequence;
[0081] According to the prediction result, the cloud resource management center allocates and schedules the cloud resources in advance based on the resource utilization rate at the next time sequence.
[0082] Obtain the training data set, wherein the training data set is obtained by normalizing a matrix composed of historical time series data of resource utilization rate of each host in a cloud resource pool:
[0083] Collect historical time series data of resource utilization rate of each host in a cloud resource pool, and obtain a resource utilization rate time series matrix of each host in a time period T as Normalize the matrix X, and the normalization calculation formula is:
[0084]
[0085] wherein, is the normalized data, x t is the original input data, x min = min(x1:x T), min(a:b) represents taking the minimum value of all numbers from a to b, x max = max(x1:x T ), max(a:b) represents taking the maximum value of all numbers from a to b;
[0086] The matrix obtained by the normalization operation is As the training data set of the GC-LSTM neural network model.
[0087] The training data set is arranged and prepared as an input data set and a label for training the GC-LSTM neural network model, which includes:
[0088] The training data set is converted into N labeled supervised learning data sets, and the labeled supervised learning data set is divided into N input data sets and labels, where N is the number of input data sets and labels, and the value of N is determined according to the time period T of the training data set , the label is the resource utilization rate at the next time of the input data set, and the label is used to train the GC-LSTM neural network model to calculate the loss function value; the resource utilization rate of the historical time period is used as the input data of the training GC-LSTM neural network model, and the resource utilization rate of the next time t+m is used as the label, so that the arranged GC-LSTM neural network model input data and label are obtained as:
[0089]
[0090]
[0091] Wherein is a subset of , the input data is a subset of the training data set, and 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 time sequence, and the subset length is a fixed value, is a label, which represents the resource utilization rate at the next time t+m of the input data.
[0092] The GC-LSTM neural network model includes:
[0093] In the GC-LSTM neural network model, the input is The divided multiple input subsets constitute a tensor, and the output is a tensor composed of predicted values corresponding to the subsets; the GC-LSTM neural network model is composed of five parts: an input layer, a GC layer, a pooling layer, a Flatten layer, and an LSTM layer. Gated convolution (GC) is used to obtain the weights of different channels in time series data to further adjust the importance of feature channels; the pooling layer is used to reduce the dimensionality of the GC layer output features to reduce the amount of calculation and parameters; the Flatten layer flattens the tensor output after pooling to one dimension to align with the input format of the LSTM layer; the LSTM layer is used to learn the time correlation of the feature tensor transmitted by the Flatten layer; a generalization form of tensor multi-dimensional array, representing matrix data of input subsets, used to represent input data, intermediate features, and output results in neural networks.
[0094] As shown in the GC-LSTM neural network model structure diagram constructed, the specific steps are as follows: Figure 3
[0095] The GC layer, as an encoder part, is composed of three one-dimensional convolution layers, and a gating mechanism is added to learn the implicit relationship in time series data.
[0096] Specifically, let the input tensor of this layer be z, and the output obtained after the first convolution layer L1 is:
[0097]
[0098] where represents one-dimensional convolution with channel number c, which is commonly used for convolution of sequence data, and δ represents the rectified linear unit (ReLU) activation function. The output after the second convolution layer L2 is:
[0099]
[0100] After multiple convolution layers and activation, the non-linear ability of the model can be increased. In order to obtain the weights of different channels in time series data to further adjust the importance of feature channels, a one-dimensional convolution (GC) based on gating is proposed here: one-dimensional global maximum pooling is performed on the features output by the second convolution layer, and the output of L3 is:
[0101]
[0102] where G maxpool (·) represents the operation of global maximum pooling, and represents the Sigmiod activation function, which further maps the value of the output global feature to the range of 0-1, and then is multiplied by the broadcast with the original feature. Here, the Sigmiod function can be regarded as a gate that re-scales the channels in the original feature, so as to obtain the importance of different channel features according to the feature itself. The output after re-scaling is:
[0103]
[0104] The output of L4 is obtained by passing the feature through a one-dimensional convolution again:
[0105]
[0106] That is, the output of the GC layer.
[0107] Then, in order to reduce the dimension of the output feature of the GC layer and reduce the calculation amount and parameters, a pooling layer is used here to reduce the dimension, and the output of L5 is obtained:
[0108] z d =G maxpool (z o )
[0109] In order to input the LSTM (Long short-term memory) layer to further construct the relationship between the features in time sequence, a Flatten layer is used to flatten the tensor output after the pooling to one dimension, which is used to align the input format of the LSTM layer.
[0110] The LSTM layer learns the time correlation of the feature tensor transmitted by the Flatten layer. Since RNN is affected by short-term memory, if a time sequence is long enough (for example, the sampling time of cloud host resource utilization is one year of data), it will be difficult to further transmit information from the earlier time to the later time step, that is, important information in the early time period may be missed in the last prediction. Therefore, LSTM is used in the model to obtain long-range relationships in time sequence. LSTM can learn long-term dependent information and effectively solve the problems of gradient disappearance and gradient explosion in RNN, and adjust the information flow. The output of the last LSTM layer can obtain the prediction result, wherein the prediction result is the resource utilization of the next time sequence.
[0111] The training of the GC-LSTM neural network model using the training data set comprises:
[0112] N input data sets are sequentially input into the GC-LSTM neural network model for training; in the training process, the parameters in the neural network model are optimized by back propagation, wherein the loss function is the root mean square error:
[0113]
[0114] The root mean square error (RMSE) is used to measure the deviation between the predicted value and the true label, wherein represents the i-th cloud resource utilization sample corresponding predicted value, represents the actual true value corresponding to the i-th cloud resource utilization sample, and n represents the number of samples; with the superposition of the number of training times, the parameters in the network are updated by the gradient descent method (SGD) so that the target loss function RMSE is optimized to the minimum and stable state, at which time the corresponding network model reaches convergence.
[0115] The real-time collected resource utilization data is input into the trained GC-LSTM neural network for prediction, including:
[0116] The trained GC-LSTM neural network model and parameters are saved, 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, and the prediction result is output, which is the resource utilization of the next time sequence.
[0117] The cloud resource management center allocates and schedules the cloud resources in advance based on the resource utilization of the next time sequence, including:
[0118] According to the resource utilization of the next time sequence predicted by the GC-LSTM neural network model, the cloud resource management center can allocate and schedule the cloud resources in advance, which is beneficial to improve the resource utilization, and also can release the unused resources in advance, further reducing the maintenance cost.
[0119] Embodiment 2
[0120] Figure 4 The cloud resource prediction system based on the GC-LSTM neural network model provided by an embodiment of the present application is shown in the figure, and the system comprises:
[0121] The data set acquisition module is used to:
[0122] The training data set is obtained by normalizing the matrix composed of the historical time sequence data of the resource utilization of each host in the cloud resource pool;
[0123] The input data and label module is used to:
[0124] The training data set is collated and input data set and label are made for training the GC-LSTM neural network model, the training data set is divided into N input data sets and labels, 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 at the next time of the input data set;
[0125] The GC-LSTM neural network model module is constructed, and the GC-LSTM neural network model is constructed, wherein the GC-LSTM neural network model is composed of five parts: an input layer, a GC layer, a pooling layer, a Flatten layer and an LSTM layer.
[0126] The GC-LSTM neural network block is trained, and the GC-LSTM neural network is trained by using the training data set, wherein the training data set is composed of N input data sets, and the N input data sets are sequentially input into the GC-LSTM neural network model for training.
[0127] The prediction module is used for inputting the real-time collected resource utilization rate data into the trained GC-LSTM neural network for prediction, and outputting a prediction result, wherein the prediction result is the resource utilization rate of the next time sequence.
[0128] The response module is used for distributing and scheduling the cloud resources in advance based on the resource utilization rate of the next time sequence according to the prediction result.
[0129] Embodiment 3
[0130] Figure 5 It is an electronic device structure schematic diagram provided by an embodiment of the application. As shown in Figure 5 According to another aspect of the application, an electronic device 500 is also provided. The electronic device 500 can include one or more processors and one or more memories. The memory stores computer readable code which, when executed by the one or more processors, can perform a cloud computer full-link latency measurement method.
[0131] The method or system according to the embodiments of the application can also be implemented by means of Figure 5 The architecture of the electronic device is shown. As Figure 5As shown, the electronic device 500 can 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, can store a cloud resource prediction method based on a GC-LSTM neural network model provided in the present application. A cloud computer full-link latency measurement method can for example include: obtaining a training data set, wherein the training data set is obtained after normalization operation by collecting historical time series data of resource utilization rate of each host in the cloud resource pool; organizing the training data set and making input data set and label for training GC-LSTM neural network model, dividing the training data set into N input data sets and labels, 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 at the next time of the input data set; 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 is composed 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 real-time collected resource utilization rate data into the trained GC-LSTM neural network for prediction, and outputting the prediction result, wherein the prediction result is the resource utilization rate of the next time sequence; based on the prediction result, the cloud resource management center allocates and schedules the cloud resources in advance based on the resource utilization rate of the next time sequence. Further, the electronic device 500 can also include a user interface 508. Of course, Figure 5 The architecture shown is only exemplary, and when implementing different devices, some components shown can be omitted Figure 5 One or more components in the electronic device shown.
[0132] Embodiment 4
[0133] Figure 6 is a computer readable storage medium structure schematic diagram provided by an embodiment of the present application. As Figure 6As shown, the computer readable storage medium 600 stores computer readable instructions according to an embodiment of the present application. When the computer readable instructions are run by a processor, a cloud resource prediction method based on a GC-LSTM neural network model according to an embodiment of the present application described above with reference to the accompanying drawings can be executed. The storage medium 600 includes, but is not limited to, for example, volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM), cache memory, and the like. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, and the like.
[0134] It should be understood that the methods and apparatuses, devices of the present application are implemented in many ways. For example, the methods and apparatuses, devices of the present application can be implemented by software, hardware, firmware, or any combination of software, hardware, firmware. The above order of steps for the method is only for illustration, and the steps of the method of the present application are not limited to the above specifically described order, unless otherwise specifically described. In addition, in some embodiments, the present application can also be implemented as programs recorded in recording media, which include machine readable instructions for implementing the method according to the present application. Therefore, the present application also covers the recording media storing the programs for executing the method according to the present application.
[0135] In addition, the part of the above technical solutions provided in the embodiments of the present application which is consistent with the implementation principle of the corresponding technical solutions in the prior art is not described in detail to avoid excessive repetition.
[0136] The specific embodiments described above further illustrate the purposes, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A cloud resource prediction method based on the 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; 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. 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; 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; 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; Based on the prediction results, the cloud resource management center allocates and schedules cloud resources in advance based on the resource utilization rate of the next time series; The process of building 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, 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 commonly used for convolution of sequence data. δ represents the rectified linear unit 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 method is proposed here: the features output by the second convolutional 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, 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: 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 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 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, it will be difficult to transmit information from an earlier time step 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-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, which is the resource utilization rate 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 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, ..., 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 dataset 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 said arranging the training data set and preparing the input data set and labels for training the GC-LSTM neural network model includes: 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 from the historical time period t to 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: 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.
4. The cloud resource prediction method based on the GC-LSTM neural network model according to claim 1, 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, 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.
5. The cloud resource prediction method based on the GC-LSTM neural network model according to claim 1, characterized in that: Inputting the real-time collected resource utilization data into the trained GC-LSTM neural network for prediction includes: 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.
6. 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 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.
7. A cloud resource prediction system based on the 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 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 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. 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. 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. 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; 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. The process of building 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, 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 commonly used for convolution of sequence data. δ represents the rectified linear unit 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 method is proposed here: the features output by the second convolutional 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, 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: 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 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 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, it will be difficult to transmit information from an earlier time step 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-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, which is the resource utilization rate of the next time series.
8. 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 in the cloud resource prediction method based on the GC-LSTM neural network model as described in any one of claims 1 to 6 are implemented.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which 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 as described in any one of claims 1 to 6.
Citation Information
Patent Citations
A method for predicting container cloud resources
CN111274530B
Cloud resource prediction method based on combination of EMD and TCN
CN112785051A
Cloud resource prediction method based on LSTM-RBF
CN113886454A
Cloud resource prediction method and system based on stacking time convolutional network
CN117785445A