Cloud load prediction method and device

By decomposing cloud load into short-term and long-term characteristics and combining a prediction model with GRU and self-attention mechanisms, the resource waste problem of Kubernetes resource scheduling strategies under dynamic loads is solved, achieving more accurate resource management and more efficient load prediction.

CN119271348APending Publication Date: 2025-01-07SHENZHEN INST OF ADVANCED TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411239344.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

Traditional Kubernetes resource scheduling strategies are prone to resource waste and service quality degradation when faced with highly dynamic and unpredictable workloads. Existing prediction models are insufficient in the comprehensive analysis of long-term and short-term load characteristics and feature extraction, making it difficult to adapt to diverse and heterogeneous workloads.

Method used

The data is divided into short-term features, long-term features and residual components using a time series decomposition method. Combined with a prediction model using GRU and self-attention mechanism, a multilayer perceptron is used for comprehensive prediction to generate cloud load prediction results for cloud cluster resource management.

Benefits of technology

It improves the accuracy of load forecasting and the efficiency of resource scheduling, reduces resource waste, optimizes system performance, enhances the understanding of load time changes, and enables smarter and more adaptive elastic scaling decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271348A_ABST
    Figure CN119271348A_ABST
Patent Text Reader

Abstract

The invention discloses a cloud load prediction method and device, and is applied to the technical field of cloud server resource management, and the method comprises the steps: obtaining original time series data, and carrying out the preprocessing of the original time series data, and obtaining the preprocessing data; decomposing the preprocessed data to obtain short-term features, long-term features and preset residual components; inputting the short-term features into a pre-constructed short-term prediction model, and outputting short-term information; inputting the long-term features into a pre-constructed long-term prediction model, and outputting long-term information; inputting the short-term information, the long-term information and the preset residual component into a multi-layer perceptron to obtain a prediction result; the prediction result is used for automatic resource expansion decision of the cloud cluster resource management system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud server resource management, and in particular to a cloud load prediction method and device. Background Art

[0002] With the continuous evolution of cloud native and microservice architecture, containerization technology has become an indispensable part of modern software development and deployment. As a leading open source container orchestration platform, Kubernetes (K8s for short) has been recognized and adopted by many top technology companies in the world, such as Amazon, Google, and Microsoft, for its ability to automatically deploy, manage, and scale container applications. This platform not only optimizes the development process, but also improves the availability and scalability of applications through its efficient resource management strategy. However, traditional K8s resource schedulers mainly adopt reactive strategies, that is, making resource allocation decisions based on the current system status. This approach performs well in dealing with static or predictable load changes, but in the face of highly dynamic and uncertain working environments, it may lead to insufficient or excessive resource allocation, thus affecting the stability and efficiency of services. To solve this problem, more and more enterprises and technology developers are beginning to explore predictive expansion strategies. This strategy not only analyzes the current system load, but also integrates historical data and various prediction models to predict possible future load changes, so as to prepare for resource allocation and adjustment in advance.

[0003] The main advantage of predictive expansion is that it can predict future resource needs and allocate resources in advance, effectively avoiding resource shortages or service interruptions caused by sudden load increases. In addition, this method can also dynamically adjust resources based on the prediction results to maximize resource utilization efficiency and reduce unnecessary resource waste, thereby ensuring service quality while reducing operating costs.

[0004] Although predictive scaling offers many potential benefits, it still faces some challenges in practical applications. Existing predictive models often need to handle complex and variable workloads, which places higher demands on the accuracy and robustness of the models. In addition, the workload characteristics in different applications and environments may vary greatly, which requires the model to be able to adapt to this high heterogeneity.

[0005] Therefore, in order to overcome these defects, the present application proposes a cloud load prediction method and device. Summary of the invention

[0006] The purpose of this application is to provide a cloud load prediction method and device to solve the above-mentioned problems.

[0007] To achieve the above objectives, this application provides the following technical solutions:

[0008] The present application provides a cloud load prediction method, comprising:

[0009] Acquire original time series data, and preprocess the original time series data to obtain preprocessed data;

[0010] Decomposing the preprocessed data to obtain short-term features, long-term features and preset residual components;

[0011] Input the short-term features into a pre-built short-term prediction model to output short-term information; input the long-term features into a pre-built long-term prediction model to output long-term information;

[0012] The short-term information, the long-term information and the preset residual component are input into a multi-layer perceptron to obtain a prediction result; the prediction result is used for automatic resource expansion decision-making of a cloud cluster resource management system.

[0013] Furthermore, in the step of obtaining the original time series data and preprocessing the original time series data to obtain the preprocessed data, the following steps are specifically included:

[0014] The Z score is used to normalize the original time series data, and the calculation formula is:

[0015]

[0016] Where X is the original time series data; n is the number of data points; μ is the mean value of the original time series data; σ is the standard deviation of the original time series data; and Z is the standardized data value, i.e., the preprocessed data.

[0017] Furthermore, the step of inputting the short-term features into a pre-built short-term prediction model and outputting short-term information specifically includes the following steps:

[0018] Using the GRU algorithm as the short-term prediction model;

[0019] The short-term features are input into a one-dimensional convolution; the convolved features are then input into a two-layer GRU network;

[0020] Through the ReLU activation function, regularization and dense layers, short-term information is generated as output.

[0021] Furthermore, the GRU algorithm also includes:

[0022] Assume that at time step t, select the short-term feature x of the input t , past hidden state h t-1 and the parameter W of the short-term forecast model;

[0023] Calculate the update gate z for the current time stept , reset gate r t and candidate hidden states

[0024] z t =σ(W z ·[h t-1 ,x t ])

[0025] r t =σ(W r ·[h t-1 ,x t ])

[0026]

[0027] Where σ is the Sigmoid function; ⊙ is element-wise multiplication; [·] is matrix multiplication; and tanh is the hyperbolic tangent function, expressed as:

[0028]

[0029] Based on the update gate z t and candidate hidden states Calculate the current hidden state h t , the formula is:

[0030]

[0031] The update gate z t Control the past hidden state h t-1 and candidate hidden states balance between.

[0032] Furthermore, the step of inputting the long-term features into a pre-built long-term prediction model and outputting long-term information specifically includes the following steps:

[0033] The original time series data is converted into a high-dimensional vector representation through an embedding layer, which includes two parts: value embedding and time embedding; wherein the value embedding is the numerical value in the time series, and the time embedding is used to capture the time information;

[0034] After the input is embedded, the self-attention mechanism is used to model long time series;

[0035] Extract local features and patterns in long time series through multi-scale convolution modules;

[0036] The embedded long time series is processed by stacking several encoder layers to extract feature information of the long time series; a prediction result is generated by a decoder layer; wherein the encoder layer includes a self-attention mechanism, a multi-scale convolution module, a residual connection and a normalization layer;

[0037] After the encoder layer output, the intermediate states of the long time series are sparsely processed;

[0038] The prediction results generated by the decoder layer are mapped to the predicted time series values ​​through the fully connected layer to output long-term information.

[0039] Furthermore, the long-term prediction model also includes:

[0040] In the self-attention mechanism, the attention score matrix is ​​calculated for each attention head i, and the formula is:

[0041]

[0042] Where Q i , K i and V i are the query, key, and value matrices of the i-th head respectively; d k is the dimension of the key vector;

[0043] By introducing the sparse induction mechanism, the relationship between the query and the key is obtained. The specific formula is:

[0044]

[0045] Where M(q i ,K) is the function for calculating the attention score; q i is the query vector, measuring the similarity between the query and the key; K is the key vector set, i.e., the key in the attention mechanism; k i is an element in the key vector set, with length L K ;

[0046] The feature representation of the next layer is generated through convolution, activation and maximum pooling operations. The specific formula is:

[0047]

[0048] in is the feature representation of the j+1 layer at time step t, obtained through convolution operation, exponential linear unit activation function and maximum pooling operation; is the feature representation of layer j at time step t, where AB is the preset slice or subset selection.

[0049] Furthermore, the multilayer perceptron includes: an input layer composed of a plurality of neurons, and an output layer composed of a plurality of neurons and a hidden layer; wherein both the input layer and the output layer adopt a ReLU activation function.

[0050] The present application provides a cloud load prediction device, comprising:

[0051] Preprocessing module: obtains original time series data, and preprocesses the original time series data to obtain preprocessed data;

[0052] Decomposition module: decomposes the preprocessed data to obtain short-term features, long-term features and preset residual components;

[0053] Prediction module: input the short-term features into a pre-built short-term prediction model and output short-term information; input the long-term features into a pre-built long-term prediction model and output long-term information;

[0054] Output module: input the short-term information, the long-term information and the preset residual component into a multi-layer perceptron to obtain a prediction result; the prediction result is used for automatic resource expansion decision-making of the cloud cluster resource management system.

[0055] The present application provides a device, which includes a processor and a memory coupled to the processor, wherein the memory stores program instructions for implementing a cloud load prediction method; the processor is used to execute the program instructions stored in the memory to implement a cloud load prediction.

[0056] The present application provides a storage medium storing program instructions executable by a processor, wherein the program instructions are used to execute a cloud load prediction method.

[0057] The present application provides a cloud load prediction method and device, which has the following beneficial effects:

[0058] (1) This application decomposes the original time series data into short-term features, long-term features, and preset residual components; helps the prediction model capture information in long-term and short-term time series; and integrates long-term and short-term time series information to more comprehensively understand the temporal changes of cloud workloads, thereby achieving more intelligent and adaptive elastic expansion decisions;

[0059] (2) Through accurate load prediction and resource scheduling, this application aims to reduce resource waste, optimize system performance, and improve service quality, thereby meeting user needs and supporting the sustainable development of the cloud platform; it enhances the comprehensive understanding of load time changes, making elastic expansion decisions more intelligent and adaptable;

[0060] (3) Through innovative data processing and multi-layer perceptron (MLP) algorithms, it can provide accurate resource demand forecasts in different forecasting scenarios to support more effective resource management and scheduling strategies;

[0061] (4) The effectiveness and usability of several baseline methods were evaluated through real traces and test platforms. The results showed that the method proposed in this application has significant effects in reducing service level objective (SLO) violations and improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 A schematic diagram of a flow chart of a cloud load prediction method according to Embodiment 1 of the present application;

[0063] Figure 2 This is a schematic diagram of the architecture of a cloud load prediction method according to Embodiment 1 of the present application;

[0064] Figure 3 This is a schematic diagram of modal decomposition of Example 1 of the present application;

[0065] Figure 4 This is a schematic diagram of the architecture of the short-term prediction model of Example 1 of the present application;

[0066] Figure 5 This is a schematic diagram of the average response time comparison in the experiment of Example 1 of the present application;

[0067] Figure 6 This is a schematic diagram comparing CPU allocation in the experiment of Example 1 of the present application;

[0068] Figure 7 This is a schematic diagram of the structure of a cloud load prediction device according to Embodiment 2 of the present application;

[0069] Figure 8 This is a schematic diagram of the device structure of Example 3 of the present application;

[0070] Fig. 9 This is a schematic diagram of the storage medium structure of Example 4 of the present application. DETAILED DESCRIPTION

[0071] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0072] The following is an analysis of the resource scheduling solution based on prediction in the prior art in combination with related technologies.

[0073] In the field of cloud computing, with the rise of cloud native and microservice architecture, containerization technology has become the key to software development and deployment. As a leading open source container orchestration platform, Kubernetes (K8s) has greatly improved the efficiency of automatic deployment, expansion and management of application containers. However, due to the high variability and unpredictability of cloud service loads, traditional reactive resource scheduling strategies face challenges in dynamic environments, resulting in resource waste and reduced service quality. Therefore, more and more research and practice have begun to explore prediction-based resource scheduling methods, aiming to predict future resource requirements by analyzing historical data and trends, and achieve more refined and efficient resource management to adapt to evolving application scenarios and load requirements. Many researchers have conducted extensive discussions on workload prediction, which can be divided into three categories: prediction based on traditional machine learning models, prediction based on neural network models, and prediction based on attention mechanism models.

[0074] Models based on traditional machine learning: A lot of research has been devoted to improving the accuracy and efficiency of cloud workload prediction using traditional machine learning models. Prassanna et al. [1] proposed a new virtual machine consolidation technique NMT-FOLS, which uses an adaptive regression Holt-Winters workload predictor to identify workload states and uses the prediction results to assign user-requested tasks to the best virtual machines. Xie et al. [2] proposed a hybrid model of ARIMA and triple exponential smoothing that accurately predicts linear and nonlinear relationships in container resource load series. The weights of the two different models are selected based on the sum of squares of their prediction errors over a period of time. Biswas et al. [3] proposed a new linear regression model to predict future CPU utilization, which is described by a straight line and a mean point. The algorithm reduces energy consumption and SLA default rate in cloud data centers. Kholidy et al. [4] developed a novel swarm intelligence-based prediction method that uses particle swarm optimization to select the best features from the dataset and estimate the parameters of the prediction algorithm. Righi et al. [5] proposed an active elastic model called Proliot. Proliot’s contribution is to use mathematical formal methods to predict the behavior of IoT loads through ARIMA and weighted moving average, thus being able to predict expansion operations in advance.

[0075] Neural network-based models: Traditional machine learning methods perform poorly in dealing with the complex characteristics of cloud workloads. To capture these characteristics more effectively, researchers have turned to more advanced learning methods, among which deep learning is particularly prominent, especially in dealing with large-scale, high-dimensional data and nonlinear relationships. Dogani et al. [6] proposed an innovative method that uses bidirectional GRU and discrete wavelet transform to improve the accuracy of host workload prediction. Xu et al. [7] proposed an esDNN algorithm for cloud workload prediction, which overcomes the problems of gradient vanishing and exploding by updating the gates of GRU to adapt to workload changes. Ruan et al. [8] proposed a workload prediction method based on deep learning, named CrystalLP, which uses long short-term memory (LSTM) networks. Ouhame et al. [9] proposed a model combining convolutional neural network (CNN) and LSTM for predicting multivariate workloads. The model first uses the vector autoregression method to analyze the input data and filter out linear correlations in multivariate data. Then, the residual data is calculated and input into the CNN layer to extract the complex features of each virtual machine usage component.

[0076] Models based on attention mechanism: Attention mechanism is a new research field based on neural networks in recent years, which has achieved remarkable success. The core of attention mechanism is to focus resources on the key components of time series input while filtering out irrelevant information. Therefore, attention mechanism can enhance the ability of the model to capture the dynamic changes of time series data, thereby improving the performance of time series analysis and prediction tasks. Zhou et al.

[10] designed an efficient Transformer model for long-series time series prediction, named Informer. It adopts ProbSparse self-attention mechanism, self-attention distillation by reducing cascade layer input, and generative decoder to significantly improve the inference speed of long-series prediction. Zerveas et al.

[11] introduced a new framework for multivariate time series representation learning based on Transformer encoder architecture. The framework combines unsupervised pre-training scheme and provides significant performance improvement over fully supervised learning in downstream tasks. Wang et al.

[12] proposed a new method for time series prediction using Transformer and multi-scale CNN. The method includes multi-scale extraction and multi-dimensional fusion framework. Wu et al.

[13] designed Autoformer as a new decomposition architecture with an autocorrelation mechanism, which breaks the conventional preprocessing of time series decomposition and transforms it into a basic building block of deep models. This design gives Autoformer the ability to progressively decompose complex time series.

[0077] [1]Prassanna J,Venkataraman N.Adaptive regressive holt-wintersworkload prediction and firefly optimized lottery scheduling for loadbalancing in cloud[J].Wireless Networks,2021,27(8):5597-5615.

[0078] [2]Xie Y,Jin M,Zou Z,et al.Real-time prediction of docker containerresource load based on a hybrid model of ARIMA and triple exponentialsmoothing[J].IEEE Transactions on Cloud Computing,2020,10(2):1386-1401.

[0079] [3]Biswas N K,Banerjee S,Biswas U,et al.An approach towardsdevelopment of new linear regression prediction model for reduced energyconsumption and SLA violation in the domain of green cloud computing[J].Sustainable Energy Technologies and Assessments,2021,45:101087.

[0080] [4]Kholidy H A.An intelligent swarm based prediction approach forpredicting cloudcomputing user resource needs[J].Computer Communications,2020,151:133-144.

[0081] [5]da Rosa Righi R,Correa E,Gomes M M,et al.Enhancing performance ofIoTapplications with load prediction and cloud elasticity[J].FutureGeneration Computer Systems,2020,109:689-701.

[0082] [6]Dogani J,Khunjush F,Seydali M.Host load prediction in cloudcomputing with discretewavelet transformation(dwt)and bidirectional gatedrecurrent unit(bigru)network[J].ComputerCommunications,2023,198:157-174.

[0083] [7]Xu M,Song C,Wu H,et al.esDNN:deep neural network basedmultivariate workloadprediction in cloud computing environments[J].ACMTransactions on Internet Technology(TOIT),2022,22(3):1-24.

[0084] [8]Ruan L,Bai Y,Li S,et al.Workload time series prediction in storagesystems:a deeplearning based approach[J].Cluster Computing,2023:1-11.

[0085] [9]Ouhame S,Hadi Y,Ullah A.An efficient forecasting approach forresource utilization incloud data center using CNN-LSTM model[J].NeuralComputing and Applications,2021,33(16):10043-10055.

[0086]

[10] Zhou H, Zhang S, Peng J, et al. Informer: Beyond efficient transformer for long sequence time-series forecasting[C] / / Proceedings of the AAAI Conference on artificial intelligence. 2021, 35(12): 11106-11115.

[0087]

[11] Zerveas G, Jayaraman S, Patel D, et al. A transformer-based framework for multivariate time series representation learning[C] / / Proceedings of the 27th ACM SIGKDD Conference on knowledge discovery & data mining. 2021: 2114-2124.

[0088]

[12] Wang Z, Guan Y. Multiscale convolutional neural-based transformer network for time series prediction[J]. Signal, Image and Video Processing, 2024, 18(2): 1015-1025.

[0089]

[13] Wu H, Xu J, Wang J, et al. Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting[J]. Advances in neural information processing systems, 2021, 34: 22419-22430.

[0090] Disadvantages existing in the prior art:

[0091] Limitations of reactive strategies: Traditional reactive resource scheduling strategies, such as the default Kubernetes scheduler, make decisions based mainly on the current system state. This strategy works well when dealing with static or highly predictable workloads, but its adaptability and efficiency are limited when faced with highly dynamic and unpredictable working environments, which can easily lead to resource waste and reduced service quality.

[0092] Limitations of forecasting models: Existing forecast-based expansion strategies focus on using historical data and trend analysis to predict future loads, but these methods often lack comprehensive analysis and integration of load characteristics at different time scales, making the models insufficient in accurately predicting long-term and short-term load changes.

[0093] Diversity and heterogeneity of workloads: In real production environments, the diversity and heterogeneity of workloads increase the complexity of prediction. A single prediction method is difficult to adapt to all scenarios, which limits the versatility and scalability of the model.

[0094] Insufficient feature extraction: Traditional forecasting methods have limitations when extracting features across different time series, resulting in insufficient comprehensive understanding of the workload, which affects the accuracy of the forecast and the effectiveness of resource scheduling.

[0095] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0096] Example 1

[0097] See also Figure 1 , is a flow chart of a cloud load prediction method according to Embodiment 1 of the present application; the steps include:

[0098] S1: Acquire original time series data, and preprocess the original time series data to obtain preprocessed data.

[0099] In this embodiment, the original time series data is obtained from the cloud cluster monitoring system, and the cloud cluster monitoring system records the usage of major resources, such as CPU, memory, disk and network.

[0100] The specific steps for preprocessing the original time series data are:

[0101] First, rows containing blank and abnormal data are removed from the original time series data, as these data may have a negative impact on the predicted data. Then the average value of each parameter with the same timestamp is calculated, represented as a time-ordered series X(x1, x2, ..., x t ), the time interval is fixed. Finally, the Z score is used to normalize the original time series data to improve the convergence speed and prediction accuracy of the model. The calculation formula is:

[0102]

[0103] Where X is the original time series data; n is the number of data points; μ is the mean value of the original time series data; σ is the standard deviation of the original time series data; and Z is the standardized data value, i.e., the preprocessed data.

[0104] See also Figure 2 , which is an architectural diagram of a cloud load prediction method of Example 1 of the present application. A cloud load prediction method proposed in the present application is called TempoScale. Among them, ① represents a server cluster, a prototype system is implemented, and a resource scheduler and resource monitoring tool are deployed to realize real-time monitoring and resource control of the server cluster. ② represents the TempoScale algorithm, which includes three steps: 1) data preprocessing and IMFs decomposition; 2) using different models to process intermediate results; 3) obtaining the final result through a multi-layer perceptron (MLP). It enhances the comprehensive understanding of the time changes of load, making the decision of elastic expansion more intelligent and adaptable.

[0105] S2: Decomposing the preprocessed data to obtain short-term features, long-term features and preset residual components.

[0106] In this embodiment, TempoScale uses the inherent advantages of modal decomposition in time series feature extraction to divide the preprocessed data into two IMFs and one RC. The two IMFs represent the long-term and short-term features of the time series data, respectively, and are subsequently used as inputs to subsequent models; the RC is the residual component.

[0107] The modal decomposition algorithm includes five steps: parameter initialization, generation of integration, calculation of integration mean, adaptive noise and screening process. Initialize the parameters to set the various parameters required by the algorithm; generate multiple integration test instances through empirical mode decomposition to evaluate the robustness of the algorithm under different data changes; calculate the integration mean and adaptive noise of each IMF to improve the accuracy of extracting the actual signal characteristics; the screening process iteratively extracts IMFs and separates the residual signal, and finally realizes the decomposition of the original time series data. Modal decomposition decomposes complex signals into IMFs, improves the clarity of signal analysis, and shows excellent locality in the time-frequency domain, which helps to explore the local characteristics of the signal more accurately.

[0108] S3: Input the short-term features into a pre-built short-term prediction model to output short-term information; input the long-term features into a pre-built long-term prediction model to output long-term information.

[0109] In this embodiment, the specific process of the short-term prediction model includes: using a GRU-based algorithm as the short-term prediction model; GRU is an RNN architecture designed to capture dependencies and patterns in time series data. The gating mechanism in GRU allows the network to selectively update and memorize information in hidden states, allowing it to focus on relevant information while avoiding long-term dependency problems that cause gradients to disappear or explode. This makes GRU very effective in capturing short-term patterns in time series data.

[0110] Assume that at time step t, select the short-term feature x of the input t , past hidden state h t-1 and the parameters W of the short-term prediction model; calculate the update gate z of the current time step t , reset gate r t and candidate hidden states

[0111] z t =σ(W z ·[h t-1 ,x t ])

[0112] r t =σ(W r ·[h t-1 ,x t ])

[0113]

[0114] Where σ is the Sigmoid function; ⊙ is element-wise multiplication; [·] is matrix multiplication; tanh is the hyperbolic tangent function, which is a nonlinear activation function, expressed as:

[0115]

[0116] Based on the update gate z t and candidate hidden states Calculate the current hidden state h t , the formula is:

[0117]

[0118] The update gate z t Control the past hidden state h t-1 and candidate hidden states Through this gating mechanism, GRU effectively captures short-term dependencies.

[0119] See also Figure 4 , is a schematic diagram of the architecture of the short-term prediction model of Example 1 of the present application. The GRU-based algorithm is used as the short-term prediction model:

[0120] The short-term features are input into a one-dimensional convolution network, which can extract short-term features from the original time series data and simulate the short-term correlation between the time series data and the subsequent trend. The convolved features are then input into a two-layer GRU network. Finally, through the ReLU activation function, regularization and dense layers, short-term information is generated as output, ensuring refined and optimized predictions based on the features and short-term correlations captured in the early stages of processing.

[0121] The specific process of the long-term prediction model includes: first, converting the original time series data into a high-dimensional vector representation through an embedding layer, which includes two parts: value embedding and time embedding; wherein value embedding is the numerical value in the time series, and time embedding is used to capture time information, such as periodic features such as days and months.

[0122] After the input is embedded, the self-attention mechanism is used to model long time series. Different from traditional self-attention, ProbSparse proposed in this application only retains a few key attention matrix entries, and selects the most influential attention scores through probabilistic sparsity, thereby reducing computational complexity and efficiently capturing important global dependencies in long sequences.

[0123] The long-term prediction model introduces a multi-scale convolution module in the encoder to extract local features and patterns in long time series. Capturing short-term and medium-term temporal dependencies through convolution kernels of different scales helps the long-term prediction model better understand multi-level temporal features.

[0124] The embedded long time series is processed by stacking several encoder layers to extract feature information of the long time series; the prediction result is generated by the decoder layer; wherein the encoder layer includes a self-attention mechanism, a multi-scale convolution module, a residual connection and a normalization layer.

[0125] The decoder layer is similar to the encoder layer and is used to process the input target sequence to generate prediction results. The decoder of the long-term prediction model introduces a simple and efficient decoding structure that focuses on the time points of important positions, thereby accelerating the prediction process.

[0126] After the encoder layer output, the long-term prediction model performs a distillation operation to sparse the intermediate states of the long time series. By discarding some redundant information, the computational efficiency of the long-term prediction model is further improved while maintaining the necessary global information.

[0127] The prediction results generated by the decoder layer are mapped to the predicted time series values ​​through the fully connected layer to output long-term information.

[0128] Furthermore, attention-based methods usually perform well in dealing with long time series prediction problems, because the attention mechanism enables the model to better focus on different parts of the time series, thereby more effectively capturing long-term dependencies. In the self-attention mechanism, each element in the sequence interacts with other elements to calculate weights. Specifically, for each attention head i, the attention score matrix is ​​calculated, and the calculation formula is:

[0129]

[0130] Where Q i , K i and V i are the query, key, and value matrices of the i-th head respectively; d k is the dimension of the key vector; the attention mechanism determines the contribution of each element by calculating the attention weight. In this way, the long-term prediction model can dynamically adjust the weight according to the specific content of the input sequence and better capture the long-term dependencies and important patterns in the sequence.

[0131] However, transformer-based models need to address significant time and resource consumption issues. Many methods have been proposed to improve the performance and speed of attention-based models, reduce memory usage, and make them applicable to a wider range of time series prediction problems. For example, the original self-attention mechanism requires fully connected calculations for the entire input sequence, which may result in excessive computational costs for long sequences. As shown in the following formula, ProbSparse self-attention solves this problem by introducing a sparse induction mechanism, selectively interacting only with a subset of input positions based on probability, thereby maintaining model performance to a certain extent while reducing computational complexity. This application obtains the relationship between queries and keys by introducing a sparse induction mechanism. The specific formula is:

[0132]

[0133] Where M(q i ,K) is the function for calculating the attention score; q i is the query vector, measuring the similarity between the query and the key; K is the key vector set, i.e., the key in the attention mechanism; k i is an element in the key vector set, with length L K ; This equation is designed to efficiently calculate the attention score.

[0134] The feature representation of the next layer is generated through convolution, activation and maximum pooling operations. The specific formula is:

[0135]

[0136] in is the feature representation of the j+1 layer at time step t, obtained through convolution operation, exponential linear unit activation function and maximum pooling operation; the maximum pooling operation selects the maximum value of each channel of the input tensor according to the specified window size, and the exponential linear unit activation function has a non-zero gradient in the negative region to alleviate the gradient vanishing problem. The convolution operation uses the convolution kernel to convolve the input tensor to generate the output tensor; is the feature representation of the jth layer at time step t, where AB is a preset slice or subset selection. Each operation can control the feature extraction process of the model by adjusting parameters. Applying this mechanism to TempoScale can solve the problem of long sequence prediction and help improve the performance of transformer-based models while reducing time and memory overhead.

[0137] S4: Inputting the short-term information, the long-term information and the preset residual component into a multi-layer perceptron to obtain a prediction result; the prediction result is used for automatic resource expansion decision-making of a cloud cluster resource management system.

[0138] In this embodiment, the short-term information and long-term information output by the short-term prediction model and the long-term prediction model, as well as the residual components obtained by decomposition, are input into a multilayer perceptron (MLP) together to obtain prediction results for resource expansion. Nonlinear transformations and more advanced feature representations are introduced into the MLP, making the model more flexible in capturing complex relationships between inputs and enhancing the model's understanding and generalization capabilities. The multilayer perceptron includes: an input layer consisting of 144 neurons, an output layer consisting of 48 neurons and 4 hidden layers, wherein the 4 hidden layers have 192, 240, 240 and 192 neurons respectively; wherein the input layer and the output layer both use the ReLU activation function.

[0139] The final prediction results are input into the resource management system of the cloud cluster for automatic resource expansion. This step involves using the output of the model to make resource management decisions to determine whether to allocate additional resources or remove excess resources. This enables smarter and more efficient resource allocation and optimizes the performance of the entire system.

[0140] Specifically, the experiment was conducted using the TempoScale method proposed in this application.

[0141] method ARIMA esDNN Informer TempoScale MSE 0.000099 0.000085 0.000073 0.000069 MAPE 0.049752 0.047577 0.048178 0.044682 R2 0.359305 0.400834 0.358701 0.365229

[0142] The above table shows the prediction results of ARIMA, esDNN, Informer and TempoScale of this application on Alibaba's 2022 data tracking, which are evaluated using mean square error (MSE), coefficient of determination (R2) and mean absolute percentage error (MAPE), and the best value of each indicator has been highlighted. The evaluation indicators are calculated based on each forecast cycle, and the results shown are denormalized. The data shows that TempoScale, the method proposed in this application, outperforms other methods in both MSE and MAPE. Specifically, in terms of MSE, TempoScale is 30.43% higher than ARIMA, 18.78% higher than esDNN, and 5.80% higher than Informer. In terms of MAPE, TempoScale is 10.19% higher than ARIMA, 6.08% higher than esDNN, and 7.26% higher than Informer. The above results show that TempoScale shows higher accuracy and reliability in predicting Alibaba Cloud workload data.

[0143] In order to further demonstrate the capabilities of the proposed method and develop an efficient automatic scaling solution, the methods including ARIMA, esDNN, Informer and TempoScale are integrated into a prototype system based on K8s for evaluation. First, Locust is used to simulate workload changes in a real cluster environment, and the elastic scaling system integrated with the workload prediction method is used to evaluate the effectiveness of the method in cost management and performance improvement. Focusing on the vertical scaling of containers, the prediction cycle is 12 minutes. Vertical scaling involves adjusting the resource configuration of a single instance, such as increasing the CPU quota or memory limit of a container. The number of scaling operations is based on the prediction of CPU usage. Improve system performance by minimizing response time and avoiding SLO violations while keeping the total resource budget unchanged.

[0144] See also Figure 5 , is a schematic diagram of the comparison of average response time in the experiment of Example 1 of the present application; Figure 6 This is a schematic diagram of the comparison of CPU allocation in the experiment of Example 1 of the present application, in milli-cores (m), a unit of measurement commonly used to specify the amount of CPU resources available to applications or containers in cloud computing and containerized environments. These graphs include CPU allocation, average response time, and runtime workload size. In addition, QPS values ​​are also plotted on the secondary axis of each graph for direct comparison. It can be observed from the figure that in the initial stable workload stage, all four methods maintained system stability with relatively low average response times. However, in the long term, workload peaks and changes lead to varying degrees of increase in response time. It is worth noting that TempoScale has a lower performance impact, while ARIMA shows the worst performance.

[0145] Finally, the response time and SLO violation rate are compared as shown in the following table:

[0146]

[0147]

[0148] CPU budget and usage are measured in m·s, representing the product of time and resource usage, and experiments are conducted under the same resource budget to compare resource usage. The TempoScale method of this application has an average response time of 76.09 milliseconds, which is the best performance. It is 31.15% higher than ARIMA, 15.81% higher than esDNN, and 5.58% higher than Informer. As for the SLO violation rate, user acceptance may vary depending on the specific application scenario and business needs. Generally, most users expect fast response times and high-performance services, so shorter SLOs are generally considered ideal. Here, two SLO targets are set, 200 milliseconds and 250 milliseconds, to reflect these expectations. When the SLO is set to 200 milliseconds, TempoScale has a violation rate of 4.58%, which is 6.11% lower than ARIMA, 3.48% lower than esDNN, and 4.03% lower than Informer.

[0149] Based on the above results, it can be concluded that TempoScale has a performance improvement of more than 30% compared to more primitive forecasting algorithms such as ARIMA. TempoScale also performs 5-10% better than recently proposed innovative algorithms such as Informer and esDNN. In addition, the optimization method proposed by TempoScale will also help enterprises improve efficiency and promote the development of various scenarios in the cloud.

[0150] In summary, Example 1 of the present application reveals the periodic and trend changes in resource demand through long-term trend analysis, which not only helps to understand past behavior patterns, but also predicts possible demand changes in the future, and provides data support for long-term resource planning. In this way, a more proactive and predictive resource management strategy can be implemented to reduce the waste of resources caused by emergencies. Secondly, short-term fluctuation analysis is used to cope with rapidly changing workloads to ensure that the system can respond quickly when faced with short-term load peaks. This short-term prediction capability makes the system more flexible and agile in resource allocation, and effectively improves the system's ability to handle emergencies. In general, by comprehensively considering long-term and short-term time series characteristics, not only the accuracy of load forecasting is improved, but also the efficiency of resource allocation is optimized, providing a more efficient and economical solution for dynamic resource management in cloud computing environments.

[0151] Example 2

[0152] See also Figure 7 , is a schematic diagram of the structure of a cloud load prediction device in Example 2 of the present application; the specific contents include:

[0153] Preprocessing module: obtains original time series data, and preprocesses the original time series data to obtain preprocessed data;

[0154] Decomposition module: decomposes the preprocessed data to obtain short-term features, long-term features and preset residual components;

[0155] Prediction module: input the short-term features into a pre-built short-term prediction model and output short-term information; input the long-term features into a pre-built long-term prediction model and output long-term information;

[0156] Output module: input the short-term information, the long-term information and the preset residual component into a multi-layer perceptron to obtain a prediction result; the prediction result is used for automatic resource expansion decision-making of the cloud cluster resource management system.

[0157] Example 3

[0158] See also Figure 8 , is a schematic diagram of the device structure of Embodiment 3 of the present application. The device 50 includes a processor 51 and a memory 52 coupled to the processor 51 .

[0159] The memory 52 stores program instructions for implementing the above-mentioned cloud load prediction method.

[0160] The processor 51 is used to execute program instructions stored in the memory 52 to implement a cloud load prediction.

[0161] The processor 51 may also be referred to as a CPU (Central Processing Unit).

[0162] The processor 51 may be an integrated circuit chip with signal processing capabilities. The processor 51 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0163] Example 4

[0164] See also Fig. 9, which is a schematic diagram of the structure of the storage medium of Example 4 of the present application. The storage medium of the embodiment of the present application stores a program file 61 that can implement all the above methods, wherein the program file 61 can be stored in the above storage medium in the form of a software product, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or a computer, a server, a mobile phone, a tablet, and other devices.

[0165] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0166] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

[0167] Although the embodiments of the present application have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the appended claims and their equivalents.

[0168] Of course, the present invention may have many other implementations. Based on this implementation, other implementations obtained by ordinary technicians in this field without any creative work are all within the scope of protection of the present invention.

Claims

1. A cloud load prediction method, characterized in that: include: Acquire original time series data, and preprocess the original time series data to obtain preprocessed data; Decomposing the preprocessed data to obtain short-term features, long-term features and preset residual components; Input the short-term features into a pre-built short-term prediction model to output short-term information; input the long-term features into a pre-built long-term prediction model to output long-term information; The short-term information, the long-term information and the preset residual component are input into a multi-layer perceptron to obtain a prediction result; the prediction result is used for automatic resource expansion decision-making of a cloud cluster resource management system.

2. A cloud load prediction method according to claim 1, characterized in that: The step of obtaining the original time series data and preprocessing the original time series data to obtain the preprocessed data specifically includes the following steps: The Z score is used to normalize the original time series data, and the calculation formula is: Where X is the original time series data; n is the number of data points; μ is the mean value of the original time series data; σ is the standard deviation of the original time series data; and Z is the standardized data value, i.e., the preprocessed data.

3. A cloud load prediction method according to claim 1, characterized in that: The step of inputting the short-term features into a pre-built short-term prediction model and outputting short-term information specifically includes the following steps: Using the GRU algorithm as the short-term prediction model; The short-term features are input into a one-dimensional convolution; the convolved features are then input into a two-layer GRU network; Through the ReLU activation function, regularization and dense layers, short-term information is generated as output.

4. A cloud load prediction method according to claim 3, characterized in that: The GRU algorithm also includes: Assume that at time step t, select the short-term feature x of the input t , past hidden state h t-1 and the parameter W of the short-term forecast model; Calculate the update gate z for the current time step t , reset gate r t and candidate hidden states z t =(W z ·[h t-1 ,t]) r t =(W r ·[h t-1 ,t]) Where σ is the Sigmoid function; ⊙ is element-wise multiplication; [·] is matrix multiplication; and tanh is the hyperbolic tangent function, expressed as: Based on the update gate z t and candidate hidden states Calculate the current hidden state h t , the formula is: The update gate z t Control the past hidden state h t-1 and candidate hidden states balance between.

5. A cloud load prediction method according to claim 1, characterized in that: The step of inputting the long-term features into a pre-built long-term prediction model and outputting long-term information specifically includes the following steps: The original time series data is converted into a high-dimensional vector representation through an embedding layer, which includes two parts: value embedding and time embedding; The value embedding is the numerical value in the time series, and the time embedding is used to capture the time information; After the input is embedded, the self-attention mechanism is used to model long time series; Extract local features and patterns in long time series through multi-scale convolution modules; The embedded long time series is processed by stacking several encoder layers to extract feature information of the long time series; a prediction result is generated by a decoder layer; wherein the encoder layer includes a self-attention mechanism, a multi-scale convolution module, a residual connection and a normalization layer; After the encoder layer output, the intermediate states of the long time series are sparsely processed; The prediction results generated by the decoder layer are mapped to the predicted time series values ​​through the fully connected layer to output long-term information.

6. A cloud load prediction method according to claim 5, characterized in that: The long-term prediction model also includes: In the self-attention mechanism, the attention score matrix is ​​calculated for each attention head i, and the formula is: Where Q i , K i and V i are the query, key, and value matrices of the i-th head respectively; d k is the dimension of the key vector; By introducing the sparse induction mechanism, the relationship between the query and the key is obtained. The specific formula is: Where M(q i ,K) is the function for calculating the attention score; q i is the query vector, measuring the similarity between the query and the key; K is the key vector set, i.e., the key in the attention mechanism; k i is an element in the key vector set, with length L K ; The feature representation of the next layer is generated through convolution, activation and maximum pooling operations. The specific formula is: in is the feature representation of the j+1 layer at time step t, obtained through convolution operation, exponential linear unit activation function and maximum pooling operation; is the feature representation of layer j at time step t, where AB is the preset slice or subset selection.

7. A cloud load prediction method according to claim 1, characterized in that: The multilayer perceptron comprises: an input layer composed of a plurality of neurons, and an output layer composed of a plurality of neurons and a hidden layer; wherein both the input layer and the output layer adopt a ReLU activation function.

8. A device for a cloud load prediction method according to any one of claims 1 to 7, characterized in that: include: Preprocessing module: obtains original time series data, and preprocesses the original time series data to obtain preprocessed data; Decomposition module: decomposes the preprocessed data to obtain short-term features, long-term features and preset residual components; Prediction module: input the short-term features into a pre-built short-term prediction model and output short-term information; input the long-term features into a pre-built long-term prediction model and output long-term information; Output module: input the short-term information, the long-term information and the preset residual component into a multi-layer perceptron to obtain a prediction result; the prediction result is used for automatic resource expansion decision-making of the cloud cluster resource management system.

9. A device, characterized in that: The device includes a processor and a memory coupled to the processor, wherein the memory stores program instructions for implementing a cloud load prediction method as described in any one of claims 1-7; and the processor is used to execute the program instructions stored in the memory to implement a cloud load prediction.

10. A storage medium, characterized in that: Processor-executable program instructions are stored, and the program instructions are used to execute a cloud load prediction method as described in any one of claims 1-7.

Citation Information

Cited By

  • Load prediction method and device, program product and storage medium

    CN121579869A