A load prediction method for cloud working
By using a time-convolutional encoder based on the TS2Vec model and a dynamic resource allocation strategy, the problem of insufficient adaptability in traditional cloud workload prediction methods is solved, achieving higher accuracy and flexibility in load prediction, optimizing cloud resource management, and improving system reliability and responsiveness.
Patent Information
- Application Number
- CN202411417066.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-10-11
AI Technical Summary
Traditional cloud workload forecasting methods struggle to adapt quickly to uncertain changes driven by user demand, neglect the correlation between variables, exhibit long-term workload pattern forgetting, and lack real-time adaptability, leading to inefficient resource allocation and increased costs.
A time convolutional encoder based on the TS2Vec model is adopted, which combines variable-independent predictors and variable-dependent predictors. By monitoring and dynamically adjusting the predictor weights in real time, resource allocation is optimized. By utilizing sliding windows and standardized data processing, the capture of short-term and long-term patterns is enhanced, and resource allocation is dynamically adjusted to adapt to load changes.
It improved the accuracy and adaptability of load forecasting, optimized resource management, enhanced system reliability and responsiveness, ensured that resource utilization was within a reasonable range, and met service quality requirements.
Smart Images

Figure CN119376934B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing technology, and in particular to a method for load prediction in cloud operations. Background Technology
[0002] The rapid adoption of cloud computing is primarily attributed to its efficient hardware and software services. Its appeal lies in its ability to provide a shared, virtualized, configurable pool of computing resources over the internet, enabling dynamic allocation and scaling of resources based on demand—a practice known as on-demand computing or pay-as-you-go billing. This approach improves operational efficiency and reduces the need for capital-intensive IT investments.
[0003] To optimize resource allocation and comply with Quality of Service (QoS) standards outlined in Service Level Agreements (SLAs), cloud providers need to employ more accurate forecasting methods to predict peak workloads within specific timeframes. This helps in efficiently handling new service requests and providing the necessary server resources to meet user demands. Essentially, workload forecasting in the cloud can be conceptualized as a time-series forecasting problem, using timestamped historical workload records to predict future workload patterns.
[0004] However, traditional forecasting methods often struggle to adapt quickly to uncertain changes driven by user demand, leading to underestimation or overestimation of resource allocation. This can increase risk and cost due to service disruptions or resource waste. Therefore, more advanced and adaptive forecasting techniques are crucial for effectively managing the complexities of cloud workload fluctuations.
[0005] Given the limitations of traditional prediction methods, significant progress has been made in time series prediction methods based on deep learning in recent years. Examples include recurrent neural networks that excel at capturing sequential dependencies and temporal convolutional networks (TCNs) that provide parallelism and better handling of long-term dependencies, as well as more recent Transformer-based models that offer superior scalability and performance by focusing on the relevant parts of the input sequence.
[0006] However, using these predictive models in cloud systems still presents other limitations. First, these models primarily focus on univariate prediction or independent prediction of each variable, rarely considering correlations between variables, such as CPU and memory usage. Second, these models exhibit a tendency to forget long-term workload patterns and suffer from the vanishing gradient problem, which reduces their reliability over longer periods.
[0007] Furthermore, due to the dynamic nature of cloud workloads, they struggle to adapt to short-term changes, leading to forecast latency. Existing state-of-the-art time series forecasting models exhibit significant lags in both decreases and increases. This is because these methods rely heavily on historical data and static models, lacking the real-time adaptability and online learning optimization required for modern cloud environments. Consequently, this lag results in inefficient resource allocation, potentially causing service slowdowns during periods of high demand and unnecessary costs during periods of low demand. Summary of the Invention
[0008] The purpose of this invention is to provide a load prediction method for cloud operations, addressing the shortcomings of existing technologies.
[0009] The objective of this invention is achieved through the following technical solution: a load prediction method for cloud operations, comprising:
[0010] Acquire historical load data of cloud operations and preprocess it, then individually mark the data of the last time step of each sequence;
[0011] Using preprocessed historical load data and data from the last time step of each sequence, a temporal convolutional encoder based on the TS2Vec model is trained to obtain an independent predictor and a dependent predictor, respectively. The outputs of these two predictors are then weighted and summed to obtain the load prediction for cloud jobs.
[0012] Furthermore, the preprocessing includes resampling, standardization, denoising, and partitioning the data using a sliding window.
[0013] Furthermore, the TS2Vec-based temporal convolutional encoder includes a first linear mapping layer, a timestamp masking module, an dilated convolutional neural network module, and a second linear mapping layer.
[0014] The first linear mapping layer is used to map the signal of each timestamp into a high-dimensional vector;
[0015] The timestamp masking module is used to generate a context view and enhance the understanding of the context by randomly selecting timestamps and masking the corresponding high-dimensional vectors;
[0016] The dilated convolutional neural network module is used to extract the contextual representation of each timestamp;
[0017] The second linear mapping layer is used to map the context representation of each timestamp to a representation vector of the time series.
[0018] Furthermore, each layer in the temporal convolutional encoder based on the TS2Vec model uses an adapter to balance historical patterns with future trends by independently adjusting each layer's adapter, while using an exponential moving average to smooth the data.
[0019] Furthermore, it also includes a strategy of dynamically adjusting the predictor weights, with the weight update rules as follows:
[0020]
[0021] Among them, w t,i η is the weight of the i-th predictor at timestamp t. t The learning rate is N, and the number of predictors is N=2 in this patent. t,i The value represents the size of the loss function at time t for the i-th predictor.
[0022] Furthermore, the accuracy of the predictions is assessed by comparing the actual usage of cloud resources in real time with the prediction results; and the variable-independent predictor and variable-dependent predictor are updated with the latest load data and monitoring results.
[0023] Furthermore, it also includes: optimizing resource utilization based on predicted workload;
[0024] The optimization of resource utilization based on predicted workload includes:
[0025] Through the adaptive factor α t Dynamically adjust resource allocation and make corrections based on whether the current resource utilization rate is overestimated or underestimated;
[0026] When the resource utilization rate is overestimated (i.e., exceeds the upper limit Uu), the allocated resources are reduced.
[0027]
[0028] When the resource utilization rate is underestimated (i.e., less than the lower limit Ul), and the allocated resources are increased, then:
[0029]
[0030] Δ is the monitoring interval, λ is a parameter in the range (0,1), Ua is the actual allocated resource amount, and Umax is the maximum utilization rate.
[0031] The present invention also provides a load prediction device for cloud operations, including one or more processors, for implementing the above-described load prediction method for cloud operations.
[0032] The present invention also provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, is used to implement the above-described load prediction method for cloud operations.
[0033] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described load prediction method for cloud operations.
[0034] Compared with existing technologies, the beneficial effects of this invention are: improved workload prediction accuracy, enhanced workload adaptability and flexibility, optimized cloud resource management, and improved system reliability and responsiveness. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart of a load prediction method for cloud operations provided by an embodiment of the present invention.
[0037] Figure 2 This is a schematic diagram of a sliding window for data processing provided in an embodiment of the present invention.
[0038] Figure 3 This is a schematic diagram of a temporal convolutional encoder provided in an embodiment of the present invention.
[0039] Figure 4 This is a schematic diagram of a hardware structure provided in an embodiment of the present invention. Detailed Implementation
[0040] The present invention will now be described in detail with reference to the accompanying drawings. Unless otherwise specified, the features of the following embodiments and implementations can be combined with each other.
[0041] Traditional load forecasting struggles to adapt to uncertain demand changes, ignores correlations between variables, suffers from long-term pattern forgetting and gradient vanishing problems, struggles to adapt to short-term changes, and relies on historical data and static models. This invention provides a load forecasting method for cloud environments that can be seamlessly integrated into commercial cloud resource management systems. It is specifically designed for resource allocation and management in the complex and dynamic environment of cloud systems. Figure 1 As shown, it includes the following steps:
[0042] (1) Obtain historical load data of cloud operations and preprocess it, and mark the data of the last time step of each sequence separately;
[0043] Specifically, step (1) includes the following sub-steps:
[0044] (1.1) First, collect the necessary time series data in the dataset, including CPU utilization, memory utilization, normalized memory bandwidth, cache miss rate per thousand instructions, normalized inbound / outbound network traffic and disk I / O percentage, etc. To ensure the reliability of the data, prioritize machines with high utilization and fewer missing values.
[0045] (1.2) For datasets with irregular original data collection intervals, it is necessary to resample the time series data to uniform time intervals, such as 1-minute intervals, to ensure the regularity of the data, which will help stabilize the training of the subsequent model.
[0046] (1.3) Next, the collected data is standardized to ensure that the scales of different features are consistent. In addition, denoising techniques are applied to reduce noise in the time series.
[0047] (1.4) such as Figure 2 As shown, a sliding window is used to divide the data into several time series of the same length, and the data of the last time step of each series is marked separately.
[0048] (2) Use the preprocessed historical load data and the data of the last time step of each sequence to train the temporal convolutional encoder based on the TS2Vec model to obtain the variable independent predictor and the variable dependent predictor respectively. The outputs of the two predictors are weighted and summed to obtain the load prediction of cloud work.
[0049] Specifically, a time convolutional encoder based on the TS2Vec model is trained using several time series of the same length and the data from the last time step of each series, respectively, to obtain an independent variable predictor and a dependent variable predictor. One predicts the variable independently, while the other considers the dependencies between variables.
[0050] In one embodiment, such as Figure 3 As shown, where L is the time span, D is the hidden layer dimension of the model, and H represents the prediction time span; the TS2Vec-based temporal convolutional encoder includes a first linear mapping layer, a timestamp masking module, a dilated convolutional neural network module, and a second linear mapping layer; specifically:
[0051] The first linear mapping layer maps the signal at each timestamp to a high-dimensional vector. Next, a timestamp masking module generates a context view and enhances the model's contextual understanding by randomly selecting timestamps and masking the corresponding high-dimensional vectors; this is an introduction of a timestamp masking strategy to improve robustness. Subsequently, an dilated convolutional neural network module extracts the contextual representation of each timestamp. The convolutional layers expand the receptive field by introducing dilation parameters, creating fixed intervals ("gaps") between kernel elements during convolution operations. This dilation design captures a wider range of context without increasing kernel size or reducing resolution. Finally, a second linear mapping layer maps the contextual representation of each timestamp to a time-series representation vector.
[0052] In one embodiment, each layer in the TS2Vec-based temporal convolutional encoder uses an adapter. By independently adjusting each layer's adapter, historical patterns and future trends are balanced, while exponential moving averages are used to smooth the data and reduce fluctuation interference.
[0053] In one embodiment, the AdamW optimizer is used during training to prevent overfitting by decoupling weight decay and to ensure stability using an adaptive learning rate mechanism. During training, increasingly larger weights are assigned to well-performing predictors, while increasingly smaller weights are assigned to poorly performing predictors. The weight update rule is as follows:
[0054]
[0055] Where w t,i The weight is the weight of the i-th predictor at the timestamp, η is the learning rate, and N is the number of predictors. In this embodiment, N = 2, L t,i The magnitude of the loss function at time t for the i-th predictor is easily proven in this algorithm. i specifically refers to the predictor whose weights need to be calculated, and j is used to represent accumulation, so that the better-performing predictor is given a larger weight to optimize performance.
[0056] In one embodiment, prediction and resource management are key aspects of cloud system resource management. Through workload prediction and dynamic resource allocation, resource utilization can be effectively optimized, ensuring stable system operation. Specifically:
[0057] The above-mentioned cloud workload prediction method is used to predict real-time workloads. By combining historical and current workload data, it predicts future variables such as CPU utilization, memory utilization, normalized memory bandwidth, cache miss rate per thousand instructions, normalized inbound / outbound network traffic, and disk I / O percentage. By integrating the results of the two predictors, it can better capture changes in short-term and long-term patterns, thereby improving the accuracy of prediction.
[0058] In one embodiment, the accuracy of the prediction is evaluated by comparing the actual usage of cloud resources in real time (i.e., recording the peak utilization of each variable) with the prediction results. If the accuracy is lower than a preset threshold, the variable-independent predictor and variable-dependent predictor are updated with the latest load data and monitoring results, or updated periodically, to ensure their effectiveness in long-term workload prediction.
[0059] In one embodiment, resource utilization is optimized based on predicted workload to ensure resource allocation remains within a specified range, thereby optimizing resource utilization efficiency and guaranteeing service quality. Specifically, this is achieved through an adaptive factor α. t Dynamically adjust resource allocation based on whether the current resource utilization rate is overestimated or underestimated: if overestimated (i.e., the resource utilization rate exceeds the upper limit Uu), reduce the allocated resources, then:
[0060]
[0061] Δ is the monitoring interval, and λ is a parameter ranging from (0,1), representing the impact of the previous timestamp record on the next adjustment. If λ is set to 0.5, it is not a limitation; those skilled in the art should understand that the value of λ can be adjusted according to the actual situation. The adjustment formula reduces the adaptive factor α based on the actual allocated resource amount Ua and the maximum utilization rate of the record Umax. t This reduces future resource allocation. If the resource utilization rate is underestimated at time tu (i.e., less than the lower limit Ul), then:
[0062]
[0063] Through this dynamic adjustment mechanism, resource utilization can be maintained within a predetermined range [Ul, Uu], effectively reducing overestimation and underestimation in resource allocation. This method optimizes resource efficiency while ensuring the system meets Service Level Agreement (SLA) requirements, achieving a balance between resource utilization and service assurance.
[0064] Corresponding to the aforementioned embodiment of a load prediction method for cloud operations, the present invention also provides an embodiment of a load prediction device for cloud operations.
[0065] See Figure 4 The present invention provides a load prediction device for cloud operations, comprising one or more processors, for implementing a load prediction method for cloud operations as described in the above embodiments.
[0066] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0067] An embodiment of the cloud workload prediction device of the present invention can be applied to any device with data processing capabilities, such as a computer. The device embodiment can be implemented in software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of any data processing device loading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 4 The diagram shown is a hardware structure diagram of any data processing-capable device in which a cloud-based load prediction device of the present invention is located, except... Figure 4 In addition to the processor, memory, network interface, and non-volatile memory shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.
[0068] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0069] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0070] This invention also provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a cloud workload prediction method as described in the above embodiments.
[0071] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described load prediction method for cloud operations.
[0072] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0073] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0074] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0075] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0076] The above embodiments are only used to illustrate the design concept and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made based on the principles and design ideas disclosed in the present invention are within the protection scope of the present invention.
Claims
1. A load prediction method for cloud operations, characterized in that, include: Acquire historical load data of cloud operations and preprocess it, then individually mark the data of the last time step of each sequence; The TS2Vec model-based temporal convolutional encoder was trained using preprocessed historical load data and the data from the last time step of each sequence, respectively, to obtain an independent variable predictor and a dependent variable predictor. The outputs of the two predictors were weighted and summed to obtain the load prediction for cloud work. The TS2Vec-based temporal convolutional encoder includes a first linear mapping layer, a timestamp masking module, an dilated convolutional neural network module, and a second linear mapping layer. The first linear mapping layer is used to map the signal of each timestamp into a high-dimensional vector; The timestamp masking module is used to generate a context view and enhance the understanding of the context by randomly selecting timestamps and masking the corresponding high-dimensional vectors; The dilated convolutional neural network module is used to extract the contextual representation of each timestamp; The second linear mapping layer is used to map the context representation of each timestamp to a representation vector of the time series.
2. The method according to claim 1, characterized in that, The preprocessing includes resampling, standardization, denoising, and partitioning the data using a sliding window.
3. The method according to claim 1, characterized in that, Each layer in the TS2Vec-based temporal convolutional encoder uses an adapter. By independently adjusting the adapter of each layer, historical patterns and future trends are balanced, while exponential moving averages are used to smooth the data.
4. The method according to claim 1, characterized in that, It also includes a strategy of dynamically adjusting predictor weights, with the weight update rules as follows: ; in, It is the weight of the i-th predictor at timestamp t. This is the learning rate, and N is the number of predictors, where N=2. The value represents the size of the loss function at time t for the i-th predictor.
5. The method according to claim 1, characterized in that, The accuracy of the predictions is assessed by comparing the actual usage of cloud resources in real time with the prediction results; and the variable-independent predictor and variable-dependent predictor are updated with the latest load data and monitoring results.
6. The method according to claim 1, characterized in that, Also includes: Optimize resource utilization based on predicted workload; The optimization of resource utilization based on predicted workload includes: Through adaptive factors Dynamically adjust resource allocation and make corrections based on whether the current resource utilization rate is overestimated or underestimated; Overestimation occurs when resource utilization exceeds the upper limit. If the allocated resources are reduced, then: ; When the resource utilization rate is underestimated (i.e., less than the lower limit Ul), and the allocated resources are increased, then: ; ∆ is the monitoring interval, and λ is a parameter in the range (0, 1). This refers to the actual amount of resources allocated. That is the maximum utilization rate.
7. A load prediction device for cloud operations, characterized in that, It includes one or more processors for implementing a load prediction method for cloud operations according to any one of claims 1-6.
8. A computer-readable storage medium having a program stored thereon, characterized in that, When executed by the processor, the program is used to implement a load prediction method for cloud operations according to any one of claims 1-6.
9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements a load prediction method for cloud operations as described in any one of claims 1-6.
Citation Information
Patent Citations
Cloud server load prediction method based on signal decomposition and hybrid model
CN117389824A
Registration generation method and system for cloud workload prediction
CN117931426A