Edge cloud load prediction method and device, equipment and storage medium
By acquiring the static and dynamic correlations of containers in the edge cloud, a multi-step temporal convolutional network-attention mechanism model is constructed, which solves the problem of ignoring the correlation between sites and the collaborative relationship between containers in edge cloud load prediction, and achieves higher accuracy and better generalization of load prediction.
Patent Information
- Application Number
- CN202511798532.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies fail to adequately consider the correlation between edge sites and the collaborative relationships between containers in edge cloud load forecasting, resulting in insufficient forecast accuracy and generalization ability.
By acquiring the static and dynamic correlations between containers in the edge cloud, candidate containers related to the target container are selected, and a multi-step temporal convolutional network-attention mechanism model is constructed to make predictions in combination with the container's load time series.
It improves the accuracy and generalization ability of container load prediction in edge cloud environments, enabling it to more accurately capture the temporal characteristics of load sequences and adapt to complex nonlinear changes.
Smart Images

Figure CN121644384A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to an edge cloud load prediction method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] With the rapid development of Internet of Things and communication technologies, edge computing has gradually become an important extension form of cloud computing. Edge cloud is a typical distributed system, which deploys computing, storage and network resources at network nodes close to user side, thereby significantly reducing communication latency, improving service response speed, and enhancing the flexibility of the overall system. Under this architecture, how to effectively predict the load changes of edge cloud has become a core problem that needs to be solved in resource scheduling and system management.
[0003] For edge cloud load change prediction, related technologies can be roughly divided into two categories: one is the traditional TSF (Time Series Forecasting, TSF) method, and the other is the prediction method based on deep learning. However, related technologies have the problem of limited prediction accuracy. SUMMARY
[0004] Therefore, it is necessary to provide an edge cloud load prediction method, device, computer equipment, computer readable storage medium and computer program product to solve the above technical problems.
[0005] In a first aspect, the present application provides an edge cloud load prediction method, which comprises:
[0006] Obtaining the static correlation between containers in the edge cloud; based on the static correlation, determining candidate containers that are statically correlated with a target container to be predicted;
[0007] Obtaining the dynamic correlation between the target container and each candidate container; based on the dynamic correlation, determining a set number of containers from the candidate containers as associated containers of the target container;
[0008] Obtaining the load time series of the target container and the associated containers respectively, and constructing input features of a model based on a plurality of the load time series;
[0009] Inputting the input features into a pre-trained load prediction model, and obtaining a load prediction result of the target container based on the output of the load prediction model; wherein the load prediction model is a multi-step time convolution network-attention mechanism model.
[0010] In one of the embodiments, the static correlation between the containers is obtained by the following method:
[0011] Obtain static indicator data for each container in the edge cloud, and determine the static correlation between containers based on the static indicator data;
[0012] The dynamic correlation between the target container and each candidate container is obtained through the following method:
[0013] Obtain the load time series of the target container and each candidate container, and determine the dynamic correlation between the target container and each candidate container based on the load time series.
[0014] In one embodiment, the static metric data of the container includes global static metric data and local static metric data. The global static metric data includes the static metric data of the edge site to which the container belongs, and the local static metric data includes the static metric data of the application to which the container belongs, the server to which the container belongs, and / or the container itself.
[0015] Determining the static correlation between containers based on the static indicator data includes:
[0016] For both the first and second containers, the initial static correlation is set to 0.
[0017] Traverse each of the static indicator data. If the first container and the second container meet the preset association conditions on the currently traversed static indicator data, then the static correlation between the first container and the second container is incremented by 1. Otherwise, the static correlation between the first container and the second container remains unchanged.
[0018] After traversing all the static index data, the static correlation between the first container and the second container is obtained.
[0019] In one embodiment, the load time series of the container is a time series that includes the container's CPU utilization and memory usage;
[0020] The step of determining the dynamic correlation between the target container and each candidate container based on the load time series includes:
[0021] By using at least two different Dynamic Time Warping (DTW) algorithms, the DTW distance between the load time series of the target container and the load time series of each candidate container is calculated, resulting in at least two DTW distances.
[0022] The at least two DTW distances are weighted and normalized to obtain the dynamic correlation between the target container and each candidate container.
[0023] In one embodiment, the load prediction model is composed of multiple Temporal Convolutional Network (TCN) blocks stacked together. Each TCN block contains a core convolutional layer and an attention mechanism, and the core convolutional layer is configured with the characteristics of causal convolution, dilated convolution, and depthwise separable convolution.
[0024] The outputs of multiple TCN blocks are fused through a three-branch process using global average pooling, global max pooling, and the features from the last time step, achieving multi-scale feature integration. Finally, the load prediction result is output through a fully connected layer.
[0025] In one embodiment, the step of inputting the input features into a pre-trained load prediction model and obtaining the load prediction result of the target container based on the output of the load prediction model includes:
[0026] The input features are input into a pre-trained load prediction model. Temporal features of the input features are extracted through the core convolutional layers of multiple TCN blocks in the load prediction model. Important time steps are weighted through an attention mechanism. Based on the output features of multiple TCN blocks, the integrated features are obtained by fusing global average pooling, global max pooling, and the features of the last time step through three branches. The integrated features are input into the fully connected layer of the load prediction model. The load prediction result of the target container in the future time step is output through the fully connected layer.
[0027] In one embodiment, the method further includes:
[0028] Obtain raw monitoring data from each container in the edge cloud, and perform at least one of the following preprocessing steps on the raw monitoring data. The preprocessed monitoring data is then used to train the load prediction model or to construct the input features of the model:
[0029] Fill data gaps using the mean fill method;
[0030] Truncation or padding is performed to ensure that the processed monitoring data of each container are within the same time window;
[0031] Redundant information is removed, and key features are retained; the key features include one or more of the following: container number, timestamp, CPU utilization, memory utilization, edge site number, and microservice number.
[0032] Secondly, this application also provides an edge cloud load prediction device, the device comprising:
[0033] The static correlation filtering module is used to obtain the static correlation between containers in the edge cloud; based on the static correlation, candidate containers that are statically correlated with the target container to be predicted are determined.
[0034] The associated container determination module is used to obtain the dynamic correlation between the target container and each candidate container; based on the dynamic correlation, it determines a set number of containers from the candidate containers as associated containers of the target container;
[0035] An input feature construction module is used to obtain the load time series of the target container and the associated container respectively, and construct the input features of the model based on the multiple load time series;
[0036] The prediction module is used to input the input features into a pre-trained load prediction model and obtain the load prediction result of the target container based on the output of the load prediction model; wherein, the load prediction model is a multi-step temporal convolutional network-attention mechanism model.
[0037] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the foregoing claims.
[0038] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0039] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the above claims.
[0040] The aforementioned edge cloud load prediction method, apparatus, computer equipment, computer-readable storage medium, and computer program product employ a multi-step temporal convolutional network-attention mechanism model to predict the load of target containers in the edge cloud. When constructing input features, it fully considers the complex operating environment and high load volatility of containers in the edge cloud. By combining the static and dynamic correlations between containers, it obtains several associated containers with the highest correlation to the target container. These, along with the target container, constitute the input features of the load prediction model (multi-step temporal convolutional network-attention mechanism model). Therefore, this load prediction model can capture the temporal characteristics of container load sequences and adapt to the complex nonlinear changes in container load in the edge cloud environment. This is beneficial for improving the accuracy and generalization ability of container load prediction in the edge cloud environment, thereby improving the overall load prediction accuracy of the edge cloud. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart illustrating an edge cloud load prediction method in one embodiment;
[0043] Figure 2 This is a flowchart illustrating the edge cloud load prediction method in another embodiment;
[0044] Figure 3 This is a structural block diagram of an edge cloud load prediction device in one embodiment;
[0045] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0047] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0048] Cloud platforms possess the most powerful computing capabilities and massive data storage. Edge clouds are managed by cloud platforms, which can remotely issue instructions to them, determining which container groups to deploy on which edge nodes (also known as edge sites) and monitoring the health of all edge nodes. Edge clouds are smaller in scale but closer to customers (users), enabling rapid response to local needs.
[0049] In the edge cloud, multiple container groups can be deployed to accomplish different tasks (such as running a website, a background service for an app, or a data analytics program). A container group typically consists of multiple containers that collaborate to complete a single service. For example, an e-commerce application container group might include: a web server container responsible for the front end, an application container responsible for business logic, and a database container responsible for data. In other words, the container group runs on the edge cloud, which provides the necessary computing, storage, and network resources for its operation.
[0050] Because different edge sites may exhibit certain correlations—for example, servers deployed by the same service provider at different edge sites may display similar day-night patterns—and because edge cloud applications are mostly containerized microservice architectures with close collaboration between multiple containers, load forecasting for edge clouds can help the system predict resource demands, enabling advance resource allocation and dynamic optimization, thereby improving the operational efficiency and stability of the edge cloud platform. Therefore, effectively predicting load changes in edge clouds has become a core issue that urgently needs to be addressed in resource scheduling and system management.
[0051] In related technologies, load forecasting for edge clouds is generally categorized as a time series forecasting (TSF) problem, which can be broadly divided into two types: traditional TSF methods and deep learning-based forecasting methods. A typical example of a traditional method is the Autoregressive Integrated Moving Average (ARIMA) model. While this type of method can account for the non-stationarity of time series data to some extent, it lacks effective modeling capabilities for complex nonlinear load patterns, thus limiting its prediction accuracy in highly dynamic scenarios. In contrast, deep learning-based methods demonstrate stronger adaptability and performance in load forecasting. Common neural network models include Recurrent Neural Networks (RNNs), Gated Recurrent Units (GRUs), Transformer-based forecasting models, and Temporal Convolutional Networks (TCNs). These methods can effectively characterize the changing patterns of load data through more complex feature extraction and temporal modeling mechanisms. For example, some research combines Convolutional Neural Networks (CNNs) with GRU models to simultaneously leverage the advantages of convolutional structures in feature extraction and the ability of GRUs in modeling time dependencies, thereby improving prediction performance. Other research proposes a Transformer-based load prediction framework that captures long-term trends in workloads to achieve predictions across multiple time steps and supports resource providers in developing reasonable resource reservation and scheduling schemes.
[0052] Load forecasting methods for edge clouds mainly focus on deep learning-based time series modeling techniques, with typical methods including:
[0053] 1. CNN-Long Short-Term Memory (LSTM) combined model: This model uses CNN to extract local features from the load data and LSTM to model temporal dependencies to predict edge cloud loads. While this method can capture the temporal features of the load sequence to some extent, it suffers from gradient vanishing and computational inefficiency in certain prediction scenarios.
[0054] 2. CNN-GRU Combined Model: This method uses CNN for feature extraction and introduces GRU to model temporal correlation. However, its prediction accuracy remains limited when facing complex nonlinear load changes.
[0055] 3. Informer-based prediction framework: This method demonstrates strong advantages in long-term series prediction tasks. Its core idea is to improve the ability to capture long-term dependencies through a sparse attention mechanism while reducing the computational complexity of the model. However, in edge cloud scenarios, this method is insufficient in fitting short-term sudden fluctuations in load and is highly dependent on the model training data.
[0056] In summary, the relevant technologies for edge cloud load prediction still suffer from the following common problems:
[0057] 1. Ignoring the correlation between different edge sites: Most studies only focus on the load characteristics of individual edge nodes, without considering the potential connections between sites. For example, servers deployed by the same service provider at different edge sites may exhibit similar day-night patterns. If this correlation information is ignored, the prediction results are often only suboptimal.
[0058] 2. Lack of modeling for inter-container collaboration: Edge cloud applications are mostly containerized microservice architectures, with close collaboration between multiple containers. If predictions are made based solely on historical data from individual containers while ignoring the interaction characteristics between container groups, it will be difficult to accurately depict overall load changes.
[0059] 3. Insufficient generalization and adaptability of prediction models: The edge cloud environment is highly dynamic, and the load data exhibits significant nonlinearity and burstiness. Traditional statistical methods struggle to handle this complex pattern, while existing deep learning methods still fall short in terms of balancing short- and long-term features and model generalization ability.
[0060] In summary, existing technologies for edge cloud load forecasting fail to adequately consider the load characteristics of edge clouds and do not fully leverage the correlations between sites and containers. Both the forecasting results and generalization capabilities need improvement. Therefore, a novel edge cloud load forecasting method is urgently needed to further enhance forecasting accuracy.
[0061] Based on this, this application proposes an edge cloud load prediction method tailored to the characteristics of edge clouds. This method mainly consists of two stages: the first stage is the input data construction stage, which considers the workload behavior of container groups and focuses on feature modeling of container group load behavior; the second stage is the prediction stage based on an improved TCN model, which mainly predicts future load based on the improved TCN model. By considering the load characteristics of edge clouds and improving the time-series modeling capability of TCN, the load prediction accuracy is effectively improved.
[0062] The edge cloud load prediction method provided in this application can be applied to an edge cloud environment. The edge cloud can include one or more edge sites, which can communicate with each other. A data storage system can store the data that the server needs to process. The data storage system can be integrated on the edge site or located on a central cloud or other network server. An edge site can be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. Furthermore, the edge cloud can communicate with the central cloud.
[0063] In one exemplary embodiment, such as Figure 1 As shown, an edge cloud load prediction method is provided. Taking the application of this method to an edge site or a monitoring server of an edge site as an example, the method includes the following steps 101 to 104.
[0064] Step 101: Obtain the static correlation between containers in the edge cloud; based on the static correlation, determine candidate containers that are statically correlated with the target container to be predicted.
[0065] Static correlation refers to the strength of association calculated based on the inherent attributes of a container (such as its application and image version), which does not change over time. The target container to be predicted can be any container in the edge cloud, while candidate containers refer to a set of containers that are similar to the target container in static attributes and are therefore considered to have a potential association with the workload.
[0066] Optionally, static tags for all containers can be obtained by querying the metadata of the container orchestration system. Then, the static relevance between each pair of containers is calculated using predefined rules (such as determining whether two containers have the same application tag). Finally, all containers whose static relevance to the target container exceeds a preset threshold are identified as candidate containers, and there may be multiple candidate containers.
[0067] Step 102: Obtain the dynamic correlation between the target container and each candidate container; based on the dynamic correlation, determine a set number of containers from multiple candidate containers as associated containers of the target container.
[0068] Dynamic correlation refers to the correlation strength that changes over time, calculated based on the temporal similarity of container runtime load data (such as CPU and memory usage). Associated containers are the Top-K containers selected from the candidate containers that are most similar to the target container in terms of dynamic load behavior. The value of K can be preset, for example, 3.
[0069] For example, load time series of the target container and all candidate containers over a past period are collected, and then a dynamic time warping algorithm is used to calculate the similarity between the target container and the load series of each candidate container. Subsequently, the similarity scores are sorted from high to low, and the K candidate containers with the highest rankings are selected as the final associated containers of the target container.
[0070] Step 103: Obtain the load time series of the target container and the associated container respectively, and construct the input features of the model based on the multiple load time series.
[0071] The input feature of the model is a multidimensional tensor. The construction process may include: aligning and normalizing the load time series of the target container and all associated containers, and then concatenating them according to the channel dimension to form a feature tensor that contains the historical load information of the target container and its associated containers. Providing this multidimensional tensor to the model helps the model output more accurate prediction results.
[0072] Step 104: Input the input features into a pre-trained load prediction model, and obtain the load prediction result of the target container based on the output of the load prediction model; wherein, the load prediction model is a multi-step temporal convolutional network-attention mechanism model.
[0073] In this embodiment, the load prediction model is a deep learning model based on a temporal convolutional network and integrating an attention mechanism. It can perform multi-step predictions simultaneously, and the output of the model is a sequence of load prediction values for the target container at one or more future time points.
[0074] Based on the load prediction results of one or more target containers, the load situation of the server or edge cloud site to which the target container belongs at future points in time can be obtained, which is beneficial to adjust the computing, storage and network resources of the target container, the server and / or edge cloud site in advance.
[0075] The aforementioned edge cloud load prediction method first uses static correlation for preliminary screening, and then uses dynamic correlation for precise screening, thereby accurately identifying the associated container groups that have strong collaborative working relationships with the target container. Based on this, the group load characteristics are input into an improved TCN model, namely the Multi-Step Temporal Convolutional Network with Attention Mechanism (MSTCN-AM), which achieves accurate modeling of the collaborative working patterns of container groups. This effectively solves the technical problems in related technologies where models ignore the correlation between edge sites and lack modeling of collaborative relationships between containers when predicting load, thus improving the accuracy and generalization ability of load prediction in edge clouds.
[0076] The following provides an exemplary description of the specific methods for obtaining static and dynamic correlations involved in the embodiments of this application.
[0077] In one embodiment, the static dependency between containers can be obtained by the following method:
[0078] Obtain static indicator data for each container in the edge cloud, and determine the static correlation between containers based on the static indicator data.
[0079] Optionally, static metric data can be retrieved from the container orchestration platform's metadata interface and stored in a local database. The relevance determination module reads this data and calculates it according to predefined logical rules (e.g., if two containers belong to the same application field, then 1 point is awarded), ultimately generating a static relevance score for each pair of containers.
[0080] In another embodiment, the dynamic correlation between the target container and each candidate container can be obtained by the following method:
[0081] Obtain the load time series of the target container and each candidate container, and determine the dynamic correlation between the target container and each candidate container based on the load time series.
[0082] Optionally, the monitoring system can continuously collect CPU utilization and memory usage of each container to obtain load-related time series. The dynamic analysis module extracts the series within a specified time window, and based on the time series, uses a dynamic time warping algorithm to calculate pairwise similarity. The output of this algorithm is a quantitative indicator of the dynamic correlation between containers.
[0083] The above methods for calculating static and dynamic correlations combine coarse and fine screening by distinguishing between static and dynamic levels of correlation. Static correlations quickly narrow down the search range of associated containers and improve overall efficiency, while dynamic correlations ensure that the finally selected associated containers are indeed related to the target container in terms of runtime behavior, thereby improving the accuracy of model input feature construction and laying a data foundation for solving the problem of insufficient generalization of prediction models.
[0084] In one exemplary embodiment, the specific calculation process for determining the static correlation between containers based on static index data is further explained below.
[0085] For example, the static metric data of a container may include global static metric data and local static metric data. Global static metric data may include static metric data of the edge site to which the container belongs; local static metric data may include static metric data of the application to which the container belongs, the server to which the container belongs, and / or the container itself, etc.
[0086] The process of determining the static correlation between containers based on static indicator data may include the following steps:
[0087] For the first container (i.e. the target container) and the second container (i.e. any other container to be compared), the initial static correlation is set to 0.
[0088] Iterate through each of the static indicator data. For the currently traversed static indicator (e.g., "belonging to an application"), determine whether the first container and the second container meet the preset association conditions for this indicator (e.g., whether the values of the "belonging to an application" field of the two are exactly the same). If the preset association conditions are met, the static correlation between the first container and the second container is incremented by 1 (i.e., a scoring system); otherwise, the static correlation between the first container and the second container remains unchanged.
[0089] After traversing all the preset static indicator data, the final cumulative score is the static correlation between the first container and the second container.
[0090] It should be noted that the preset association conditions for different indicators can be different or the same. For example, the preset association condition for the "Application" indicator can be whether the values are exactly the same, while the preset association condition for the "Container Resource Limit Specifications" indicator can be whether the similarity is higher than a set threshold.
[0091] In the above method, the abstract static correlation is transformed into quantifiable and computable specific steps through a traversal scoring mechanism. This rule-based calculation method is transparent and efficient, and can quickly identify container groups with similar deployment and service backgrounds in a large number of containers. It provides a reliable candidate set for subsequent more refined dynamic analysis and effectively supports the overall solution's ability to solve the problem of ignoring the correlation between sites.
[0092] The following section will further explain the specific calculation process for determining dynamic correlation based on load time series.
[0093] In one embodiment, the container load time series is a time series that includes the container's CPU utilization and memory usage. Optionally, this series can be collected and reported by a monitoring agent deployed on an edge node at a fixed frequency (e.g., every 10 seconds). It is understood that, in addition to CPU utilization and memory usage, the container load time series may also include other container load-related metrics, such as network inbound / outbound traffic, etc., without limitation.
[0094] For example, the process of determining the dynamic correlation between a target container and candidate containers based on the load time series of containers may include the following steps:
[0095] Using at least two different dynamic time warping algorithms, the DTW distance between the load time series of the target container and the load time series of each candidate container is calculated, resulting in at least two DTW distances. These at least two DTW distances are then weighted and normalized to obtain the dynamic correlation between the target container and each candidate container.
[0096] Among them, at least two DTW algorithms can be the standard DTW algorithm and the optimized FastDTW algorithm. Standard DTW is computationally accurate but time-consuming, while FastDTW is computationally fast and provides approximate results. The two algorithms can be used to measure the similarity of sequences from different dimensions.
[0097] Specifically, different DTW distances can be normalized to the [0,1] interval first. Then, weights are assigned to them according to the characteristics of the algorithm. For example, the standard DTW result is more authoritative and is given a higher weight (e.g., 0.6 or 0.7), while the FastDTW result, as a fast supplement, is given a relatively smaller weight (e.g., 0.4 or 0.3). Finally, the weighted sum is calculated and the result is mapped to the dynamic relevance. For example, 1 minus the weighted distance sum is the dynamic relevance between the target container and the corresponding candidate container.
[0098] The aforementioned method for calculating dynamic correlation employs a hybrid DTW strategy with weighted normalization, achieving both computational accuracy and robustness. This allows for a more comprehensive capture of complex similarity patterns in container loads over time, avoiding the biases that may exist with a single algorithm. This ensures the reliability of the dynamic correlation assessment results and provides crucial support for accurately identifying truly correlated containers and ultimately improving load prediction accuracy.
[0099] The specific network structure of the load prediction model is explained below.
[0100] In one embodiment, the load prediction model is specifically a multi-step temporal convolutional network-attention mechanism model, which consists of multiple stacked temporal convolutional network (TCN) blocks, forming a deep encoder structure. Each TCN block contains a core convolutional layer and an attention mechanism module (AM).
[0101] The core convolutional layer is not a traditional standard convolution, but innovatively combines the features of causal convolution, dilated convolution, and depthwise separable convolution. Causal convolution ensures that the model does not peek into future information during prediction by padding the left side, strictly adhering to temporal causality. Dilated convolution, through an exponentially increasing dilation coefficient, enables high-level TCN blocks to have a large receptive field, effectively capturing long-range dependencies in the load sequence. Depthwise separable convolution decouples spatial (temporal) feature learning from inter-channel feature fusion, significantly reducing the number of computational parameters without significantly sacrificing the model's expressive power, thus improving the model's deployment and inference efficiency in resource-constrained scenarios.
[0102] In this embodiment, after feature extraction is completed for multiple TCN blocks, the model does not simply use the features from the last time step for prediction. Instead, it performs a three-branch fusion on the output sequence of the TCN blocks, specifically including: global average pooling to capture the overall load level and long-term trend represented by the sequence; global max pooling to capture peak load and burst event features in the sequence; and the features from the last time step to retain the latest state and instantaneous dynamics of the load. The feature vectors from these three branches are concatenated to form a comprehensive multi-scale integrated feature, which is finally mapped to the load prediction results for one or more future time steps through the fully connected layer of the model.
[0103] The load prediction model architecture of this application combines the advantages of TCN in processing long sequences with the ability of attention mechanisms to focus on key information, and comprehensively utilizes different characteristics of the load through a multi-scale feature fusion strategy. This model architecture can simultaneously capture the long-term evolution patterns, short-term burst patterns, and latest state of the load in the edge cloud environment, significantly enhancing the model's fitting ability and prediction accuracy for complex and nonlinear loads in edge clouds, and effectively solving the problems of insufficient generalization and adaptability of prediction models in related technologies.
[0104] Based on the foregoing explanation of the load prediction model architecture, the following section further explains the specific forward propagation process of inputting input features into the load prediction model and obtaining the prediction results.
[0105] In one embodiment, the aforementioned inputting of the input features into a pre-trained load prediction model, and obtaining the load prediction result of the target container based on the output of the load prediction model, may include the following specific steps:
[0106] Temporal Feature Extraction and Weighting: The constructed input feature tensor is fed into the pre-trained load prediction model. This tensor is first processed through multiple stacked TCN blocks in the model. Within each TCN block, the core convolutional layer is responsible for extracting temporal features at different levels from the input sequence, with lower layers capturing short-term local patterns and higher layers capturing long-term global patterns. Subsequently, the attention mechanism module scores the importance of these temporal features at different time steps and weights the features at key time steps, thereby enhancing the model's attention to critical events such as load mutations.
[0107] Multi-scale feature integration: After processing all TCN blocks, a high-level output feature sequence is obtained. Based on this feature sequence, a three-branch fusion is performed to achieve multi-scale feature integration: global average pooling is performed on each feature channel of the sequence to obtain a feature vector representing the overall background; global max pooling is performed to obtain a feature vector representing the peak event; and the feature vector of the last time step of the sequence is extracted to obtain a feature vector representing the latest state. These three feature vectors are concatenated to form the final integrated feature.
[0108] Load prediction output: The integrated features obtained above are input into the fully connected layer at the end of the load prediction model. The fully connected layer acts as a regressor, mapping the high-dimensional integrated features to the target-dimensional output space, and outputting the load prediction results of the target container at one or more future time steps.
[0109] Through the above-described model reasoning process from input to output, the rich time-series information extracted from the load data is ensured to be fully and efficiently utilized. Through the extraction-weighting-fusion-mapping process, it is finally transformed into accurate multi-step prediction values, thus achieving effective prediction of edge cloud load dynamics.
[0110] In one exemplary embodiment, the data preprocessing steps, which are crucial before model training and feature construction, are described. Correspondingly, the load prediction method of this application embodiment further includes a data preprocessing procedure, comprising: acquiring raw monitoring data of each container in the edge cloud, and performing at least one of the following preprocessing steps on the raw monitoring data, wherein the preprocessed monitoring data is used for training the load prediction model or for constructing the input features of the model:
[0111] Data imputation: Data gaps are filled using the mean imputation method. Due to network jitter or acquisition agent failure, the original monitoring data may contain missing values. In one embodiment, the calculated mean of the indicator at adjacent time points can be used for imputation, which can maintain the overall data distribution while ensuring the continuity of the time series.
[0112] Sequence alignment: Truncation or padding (such as prefix zero padding) is performed to ensure that the processed monitoring data of each container are within the same time window. This ensures that the tensors input to the model have consistent length in the time dimension, meeting the requirements of batch processing and model structure.
[0113] Feature engineering involves removing redundant information from the collected data and retaining key predefined features. These key features may include one or more of the following: container ID, timestamp, CPU utilization, memory utilization, edge site ID, and microservice ID. This process aims to reduce dimensionality and focus, removing fields irrelevant to load prediction while retaining the most critical influencing factors and contextual information, thereby improving model training efficiency and generalization performance.
[0114] The above-mentioned systematic preprocessing process transforms raw, messy, and incomplete monitoring data into clean, orderly, and high-quality modeling data. This process is the foundation for the effective operation of subsequent algorithms, reduces noise interference, standardizes data, and provides a guarantee for the model to learn the real load patterns. It improves the robustness and accuracy of the entire load prediction scheme from the data source.
[0115] Based on one or more of the above embodiments, to better illustrate the edge cloud load prediction method based on the improved TCN model of this application, a more detailed description is provided below. The entire process can be divided into two stages. The first stage is the input data construction stage considering the workload behavior of container groups, which mainly focuses on feature modeling of the load behavior of container groups; the second stage is the prediction stage based on the improved TCN model, which mainly predicts the future load based on the improved TCN model.
[0116] The following is a detailed introduction to these two stages.
[0117] (a) First phase: Constructing input data considering the workload behavior of container groups.
[0118] In edge cloud environments, the first step in load forecasting is constructing a suitable input dataset. Due to the complex operating environment and high load volatility of containers in edge clouds, directly using raw monitoring data often leads to unstable forecast results. Therefore, this application proposes an input data construction method that considers the workload behavior of container groups. This method mainly includes four steps: data preprocessing, calculation of static container correlations, calculation of dynamic container correlations, and construction of the final input tensor.
[0119] Step 1.1: Data Preprocessing
[0120] Load data collected from edge sites generally suffers from heterogeneity, resulting in diversity and complexity from load data originating from different devices and nodes. Furthermore, data sampling can be affected by factors such as network latency, sensor errors, and inconsistent sampling frequencies, leading to inaccurate and unstable load data, and even instances of delayed or missing data reporting. Directly inputting this raw data into the model can easily introduce noise and reduce prediction accuracy.
[0121] Therefore, this application preprocesses the data before it enters the next stage, mainly including the following steps.
[0122] (1) Missing value imputation: The missing load data in the dataset is filled with the mean imputation method to ensure the continuity of time series;
[0123] (2) Timestamp alignment: The load data of different containers is truncated and padded to ensure that the time series is within the same time window;
[0124] (3) Feature selection: Remove redundant information and retain only key features such as container_id, timestamp, cpu_utilization, memory_utilization, site_id and msinstanceid for subsequent model training and prediction.
[0125] Step 1.2: Calculation of Container Static Dependence
[0126] Load forecasting relies not only on historical data for individual containers but also on the inherent relationships between different containers. In edge cloud scenarios, containers often exhibit similar operating patterns due to business logic. To quantify these relationships, this application combines a global view and a local view of the edge cloud to measure the static correlation between different containers.
[0127] As shown in Table 1-1, metrics can include the application logic to which the container belongs, input data, image information, resource requirements, and the geographical distribution and network latency of the edge site. Among them, the global view of the edge cloud is mainly reflected in the static metrics of the edge site, while the local view is mainly reflected in the static metrics related to the individual container itself, such as the application, container, and / or server, which are mainly related to the individual container itself.
[0128] By processing the above metrics, the static correlation between the target container and other containers can be obtained.
[0129] Table 1-1: Static Indicators (i.e., Metrics) of Containers
[0130]
[0131] The static correlation between two containers can be obtained based on the metrics used to measure the relationship between them. Assume that a certain static correlation metric for each container is calculated using formula (1-1).
[0132] (1-1)
[0133] In the formula: Characterization container The Each metric value.
[0134] The formula for calculating the static correlation between containers is shown in (1-2).
[0135] (1-2)
[0136] In the formula: Characterizes the acceptable static correlation threshold; Characterizing the first The metrics are quantification factors for each metric. The static correlation threshold can be determined based on the number of containers in each edge cloud and the data used to calculate dynamic correlations. It primarily serves as an initial screening tool, reducing the time spent calculating dynamic correlations. For example, if the number of containers or the amount of data used to calculate dynamic correlations is large, the static correlation threshold can be determined by filtering the remaining data to a preset percentage (e.g., 10%), thus facilitating subsequent dynamic correlation calculations. The metric factor mainly reflects the importance of different metrics to the static correlation between containers. For instance, application-type metrics have a higher proportion and can be around 0.4, while edge site-type metrics have a lower proportion and can be around 0.1.
[0137] When the static correlation between containers is greater than or equal to the preset static correlation threshold, it can be preliminarily considered that there is a correlation between containers. Such containers are identified as candidate containers, thus narrowing down the scope of subsequent dynamic correlation calculations between containers.
[0138] Step 1.3: Calculation of Container Dynamic Dependencies
[0139] Static correlation reflects the static characteristics of containers, but container load is essentially a type of time series data. Load sequences from different containers may exhibit similar time dependencies and variation patterns. To measure the correlation between different sequences, this application employs the Dynamic Time Warping (DTW) algorithm and its variants to calculate the similarity between sequences.
[0140] Container load characterization refers to the activity level of a container, which can be measured by metrics such as CPU utilization, memory usage, and network I / O (including network input and output traffic). Assuming these metrics are recorded every second (or minute) and arranged chronologically, we obtain a set of time-series data for the container. Recording continuously for 5 seconds might yield a data set like this:
[0141] [Time Point: Load Value]
[0142] 13:00:01:15%
[0143] 13:00:02:18%
[0144] 13:00:03:55%
[0145] 13:00:04:90%
[0146] 13:00:05:95%
[0147] This data shows that the container suddenly became very busy starting in the third second, with a sharp increase in CPU load. Therefore, time-series data on container load is a continuous record of how the resource usage of a container (or a group of containers) changes over time.
[0148] Suppose we have containers A and B, and we want to know if there's a correlation between their load states. For example, do they become busy at the same time? One possible approach is to align the two load curves on the time axis and then calculate the difference point by point.
[0149] In one embodiment of this application, three DTW algorithms are used to calculate the dynamic correlation between sequences, as shown in Tables 1-2.
[0150] Table 1-2 Implementation methods of different DTW algorithms
[0151]
[0152] The key to the DTW algorithm lies in its ability to intelligently stretch or compress the timeline to find the optimal matching method for two sequences, thereby calculating their true shape similarity. In an edge cloud scenario, container A might start processing requests at 12:00, causing a surge in load, while container B (another instance providing the same service) might only start processing requests at 12:00:30, also experiencing a surge in load. A direct comparison reveals that their peak loads are misaligned, but DTW can detect that their load increase, peak, and subsequent decline follow the same pattern. This indicates that they are driven by the same external event (such as a surge in user requests), meaning that containers A and B are correlated.
[0153] The DTW library, custom DTW functions, and the FastDTW library are all toolkits for implementing the above DTW concepts, and they all follow the basic logic as follows:
[0154] Input: Pass two load sequences to the library function, for example:
[0155] Sequence A = [15, 18, 55, 90, 95] (5-minute load of container A)
[0156] Sequence B = [10, 60, 85, 80, 15] (5-minute load of container B)
[0157] Internal calculation: The library function internally constructs a distance matrix and calculates the distance (e.g., Euclidean distance, i.e., numerical difference) between every point in sequence A and every point in sequence B. Then, it uses a dynamic programming algorithm to find a path from the bottom left corner to the top right corner of the matrix that minimizes the sum of the distances between all points on this path. This optimal path represents the best alignment.
[0158] Output: The library function ultimately returns the minimum cumulative distance, which is the DTW distance between sequence A and sequence B. This DTW distance value is a measure of the similarity between container A and container B. The smaller the value, the more similar the load characteristics of container A and container B are; the larger the value, the less similar the load characteristics of container A and container B are.
[0159] The standard DTW library implements the most classic and accurate DTW algorithm, but it is computationally intensive and has high time complexity. When the sequence is very long (e.g., recording 24 hours of load data), the computation is slow. The FastDTW library employs a multi-scale optimization method, first coarsely calculating the matching path of the sequence at low resolution, and then gradually refining it, thus greatly reducing the computational load. Its computation speed is very fast, with almost linear time complexity, making it very suitable for processing long sequence data generated in load monitoring scenarios.
[0160] In this embodiment, the custom part of the custom DTW function is not limited, as long as it differs from the standard DTW library function and the FastDTW library function in the specific process of calculating the DTW distance. For example, the custom part of the custom DTW function mainly includes the addition of multi-dimensional feature engineering and intelligent distance measurement to accurately capture the dynamic characteristics of cloud load. Multi-dimensional feature engineering transforms the original load data into a feature vector with added trend values; intelligent distance measurement includes: 1) feature weighting, assigning different importance to different load indicators; 2) trend awareness, considering both the current value and the changing trend; 3) comprehensive calculation, balancing feature distance and trend distance.
[0161] Subsequently, by weighting and normalizing the results of different DTW algorithms, the dynamic correlation ranking among containers can be obtained.
[0162] Based on the custom DTW function in the above example, since the custom DTW function takes into account the characteristics of edge cloud load more, in one embodiment, the weight of the calculation result corresponding to the custom DTW function can be greater than the weight of the calculation results of the other two DTW functions. For example, the weight allocation of the calculation results of the three algorithms can be: DTW-1 calculation result: 0.3; DTW-2 calculation result: 0.4; DTW-3 calculation result: 0.3.
[0163] The above approach first collects historical load time-series data for each container (e.g., web container, database container) within each container group. Then, it uses various DTW library functions to calculate the DTW distance between load sequences of different containers. If the DTW distance of the load curves of several containers is found to be very small (i.e., very similar), it indicates a collaborative working relationship between them (e.g., when one is busy, the other also becomes busy). Finally, when building the predictive model, the load data of these collaboratively related containers can be used together as input features to more accurately predict the future load of the entire container group.
[0164] Step 1.4: Input data construction.
[0165] After obtaining the correlation between the target container and other containers, in one embodiment of this application, the three containers with the highest correlation are selected and together with the target container form the input feature set. The load time series of each container is transformed to construct a 4*1 input tensor, and the data is reshaped to meet the input requirements of subsequent models.
[0166] The 4x1 input tensor can be understood as a (4, 1) matrix containing processed sample data used as input to the model. The four rows represent four different load characteristics of a container at a single point in time, such as: row 1: CPU utilization; row 2: memory usage; row 3: network input traffic; row 4: network output traffic.
[0167] Therefore, a 4x1 tensor can describe the load state of a container at a specific moment. For example, suppose at time t, the state of a container is: CPU utilization: 55%; memory usage: 1.2GB; network input traffic: 100Kbps; network output traffic: 150Kbps. Then, its corresponding 4x1 input tensor is:
[0168] [[55.],
[0169] [1.2],
[0170] [100.] [150.]
[0172] Reshaping and transforming data can be understood as the step of converting the original data into a format acceptable to the prediction model. To illustrate this step, an example will be used below.
[0173] Step 1: Start with the original time series.
[0174] Suppose we monitor a target container A and its three most relevant containers (B, C, D), recording the four characteristics mentioned above for each container over three time steps (t-2, t-1, t). The goal is to predict the load of container A at the next time step t+1. The original data logically looks like this (numerical examples only):
[0175] Time step t-2:
[0176] Container A: [CPU=10, MEM=0.5, NET_IN=50, NET_OUT=60]
[0177] Container B: [20, 0.8, 80, 90]
[0178] Container C: [15, 0.6, 60, 70]
[0179] Container D: [25, 1.0, 100, 110]
[0180] Time step t-1:
[0181] Container A: [30, 0.9, 120, 130]
[0182] Container B: [40, 1.1, 150, 160]
[0183] Container C: [35, 1.0, 130, 140]
[0184] Container D: [45, 1.3, 170, 180]
[0185] Time step t (current moment):
[0186] Container A: [50, 1.5, 200, 220]
[0187] Container B: [60, 1.7, 250, 270]
[0188] Container C: [55, 1.6, 230, 250]
[0189] Container D: [65, 1.9, 280, 300]
[0190] Step 2: Construct a 4*1 tensor for each time point.
[0191] As explained in Part 1, the data for each container at each time point is transformed into a 4*1 matrix. At time t, the tensor of container A is [
[50] , [1.5],
[200] ,
[220] ]; at time t, the tensor of container B is [
[60] , [1.7],
[250] ,
[270] ], and so on for containers C and D.
[0192] Step 3: Reshaping and Deformation – Constructing a 3D Tensor.
[0193] Load forecasting models require viewing a historical sequence at once to make predictions. Therefore, data from multiple consecutive time steps needs to be packaged together. Selecting a time window: For example, selecting data from the three most recent time steps (t-2, t-1, t) as input. Combining the data: Combining all 4*1 tensors of these four containers across the three time steps into a large, three-dimensional tensor. The shape of this three-dimensional tensor is typically: (sequence length, number of features, number of containers) or (number of containers, number of features, sequence length), depending on the model definition. Assuming it is: (sequence length, number of features, number of containers), where the meanings of the dimensions are as follows.
[0194] Sequence length: Indicates how long of historical data to look at. In this example, it is 3, i.e. (t-2, t-1, t).
[0195] Number of features: Indicates how many features each container has. In this example, there are 4 features (CPU, MEM, NET_IN, NET_OUT).
[0196] Number of containers: Indicates the total number of containers considered. In this example, there are 4 containers (A, B, C, D).
[0197] Reshaping result: The original data is finally reshaped into a three-dimensional tensor with a shape of (3, 4, 4). This (3, 4, 4) three-dimensional tensor is the feature set that is finally input to the prediction model. It fully contains the multi-dimensional load information of the target container and its related containers in the recent period.
[0198] As can be seen, the 4*1 tensor represents the load state of a single container at a single moment. Reshaping and deformation is the process of packaging the original data containing multiple features from multiple containers across multiple consecutive historical moments into a three-dimensional tensor through permutation and combination. Through such data preparation, the load prediction model can simultaneously learn the patterns of load changes from the time dimension (sequence length = 3), the feature dimension (number of features = 4), and the spatial dimension (number of containers = 4, reflecting the collaborative relationship between containers), thereby making more accurate predictions.
[0199] (ii) Second stage: Load prediction based on the improved TCN model.
[0200] This stage uses the constructed input features as a foundation to complete the training and inference of the load prediction model. The core idea is to introduce deep separable convolution, attention mechanism, and multi-scale feature fusion technology on the basis of TCN structure to build a multi-step temporal convolutional network-attention mechanism model MSTCN-AM. This enables the model to automatically capture long-term and short-term dependencies and key time segments in historical sequences, so as to better adapt to the complex and highly volatile characteristics of load patterns in edge cloud scenarios.
[0201] Step 2.1, Model Design Ideas
[0202] The MSTCN-AM model uses TCN as its core, and the model is composed of multiple stacked TCN blocks. Each block contains a core convolutional layer and an attention mechanism (AM), which can efficiently capture the long-short-term dependencies and complex internal correlations of sequences. After the TCN output, multi-scale feature integration is achieved through global average pooling, global max pooling, and feature fusion at the last time step. Finally, the model outputs multi-step predictions through a fully connected layer.
[0203] After processing through multiple TCN blocks, the model obtains a rich feature sequence. Assuming the input is data from the past 100 time points, the final TCN layer might output a 100*64 feature matrix (i.e., 100 time points, each with 64 feature channels). Therefore, the MSTCN-AM model's approach is as follows:
[0204] Last time step features: Take the features of the last time step (the 100th point) of the feature sequence. This represents the latest and most current state of the system. It contains the most direct information about recent events and is crucial for predicting what is about to happen.
[0205] Global average pooling: This method averages each feature channel across the 100 time steps, resulting in 64 averages for 64 feature channels. This captures stable, long-term trends and background levels throughout the entire time window, smoothing out short-term fluctuations and reflecting the overall tone.
[0206] Global max pooling: This method takes the maximum value for each feature channel across 100 time steps. With 64 feature channels, this results in 64 maximum values. This captures the most significant and anomalous burst signals in the sequence. In load forecasting, this often corresponds to crucial information about peak loads or sudden traffic surges, making it essential for predicting potential future peaks.
[0207] By fusing the features obtained from global average pooling, global max pooling, and the last time step feature, the features obtained from global average pooling, global max pooling, and the last time step feature can be concatenated together to obtain a fused feature vector that simultaneously contains long-term background (global average), key events (global max), and the latest state (last time step). The fused feature vector is then fed into a fully connected layer, which comprehensively considers all information and finally outputs predicted values for multiple future time points, thereby improving prediction accuracy.
[0208] In the design of the core convolutional layer, this application combines the ideas of dilated causal convolution in TCN with the efficiency of depthwise separable convolution. This layer combines the characteristics of causal convolution, dilated convolution, and depthwise separable convolution. It uses left-side padding (in the direction of past time) to ensure the causality of temporal modeling and avoid the leakage of future information; while inserting holes in the convolutional kernel expands the receptive field to capture long-range dependencies; and the combination of the characteristics of depthwise separable convolution improves feature extraction capabilities while maintaining computational efficiency. Through this design, this application inherits the efficiency of TCN in temporal modeling and enhances the accuracy and robustness of the model in complex load prediction scenarios.
[0209] Causal convolution and left padding are crucial in time series forecasting. To ensure the model can only use information prior to time t when predicting time t, it must not peek at future data; otherwise, the model would be unusable in reality. Causal convolution achieves this by strictly padding from the left (in the direction of past time). For example, to compute the first output, it adds several zeros to the left of the sequence (called padding) to ensure the convolution operation does not access future data on the right.
[0210] Dilated convolution addresses the limitation of traditional convolutions, which require stacking numerous layers to capture long-range dependencies, resulting in large, difficult-to-train models. Dilated convolutions, however, insert gaps between elements of the kernel. For example, a 3x1 kernel with a dilation factor of 2 effectively covers five input elements. This allows for exponential growth of the receptive field with only a few layers, easily capturing long-range dependencies.
[0211] Among them, depthwise separable convolution: Standard convolution simultaneously fuses cross-channel and temporal information, resulting in high computational cost. Depthwise separable convolution, however, decomposes standard convolution into two independent steps: depthwise convolution is specifically responsible for analyzing patterns within a single feature channel, while pointwise convolution is specifically responsible for fusing conclusions from different feature channels, cross-referencing and synthesizing different feature channels. This division of labor significantly reduces computational cost and the number of parameters, making the model lighter and faster, while in most cases not sacrificing or even improving feature extraction capabilities.
[0212] Therefore, the MSTCN-AM model of this application integrates the most recent time information, average and peak information of the sequence through a three-branch fusion strategy at the output end, realizing multi-scale feature extraction and making the prediction more robust and comprehensive. At the core layer, by combining causal convolution, dilated convolution and depthwise separable convolution, a powerful feature extractor is created that can capture both long-term and short-term dependencies, strictly adhere to the temporal causality law, and is computationally efficient. The MSTCN-AM model design based on the embodiments of this application solves the challenges of nonlinearity, burstiness and the need for long-range dependency modeling of edge cloud loads, which is beneficial to improving the prediction accuracy of edge cloud loads. The improved TCN prediction algorithm is shown in Table 2-1.
[0213] Table 2-1: Improved TCN Prediction Algorithm
[0214]
[0215] Step 2.2, Training Process
[0216] (1) Data preprocessing
[0217] In order to improve the distribution offset in edge cloud load data and eliminate scale differences between different features, this application adopts standardization operations on the input data, such as one or more of the aforementioned preprocessing operations.
[0218] Meanwhile, to enhance the ability to capture time series information, lag features, sliding window statistical features, and difference features are added to the input sequence.
[0219] Among them, lag features reflect the historical inertia and delay effects of the system, using past values of the time series as new features. In the edge cloud load prediction scenario of this application, lag features are mainly added based on factors such as the impact of past CPU load on current resource allocation decisions and the delay effects of memory cache accumulation. The lag features added in this application may include lag_1 (the state at the previous moment, i.e., the most recent history) and lag_5 (the state 5 time units ago, i.e., the short-term pattern), etc.
[0220] Among these features, the sliding window statistical characteristics can reflect the short-term behavioral patterns and stability of load series. For example, the rolling mean can be used to characterize the trend direction; rolling_mean_3 can be used to calculate the average state of the most recent three time points, reflecting the instantaneous trend of load-related data. Similarly, the rolling standard deviation can be used to reflect the volatility of load-related data.
[0221] Among them, differential features can reflect the instantaneous rate of change of load-related data. For example, the difference between the current moment and the previous moment can reflect instantaneous changes, while the difference between the current moment and the previous few moments can reflect cumulative changes.
[0222] (2) Set training parameters
[0223] The load prediction model in this application adopts an improved TCN structure, and the key parameters include: batch size, kernel size, dropout ratio, etc.
[0224] The Batch_size setting depends on the data size and hardware resources, and can be 64, 16, or 32. A smaller convolutional kernel, such as 3 or 5, can be selected to capture fine-grained temporal features. The Dropout ratio can be set between 0.1 and 0.5. Understandably, the specific values of these parameters can be adjusted according to actual conditions, and this application does not impose any restrictions on this.
[0225] (3) Model training
[0226] The dataset was divided into training and test sets in an 8:2 ratio, with the training set further split into 15% for validation. The Hubey loss function was used, which overcomes the shortcomings of Mean Absolute Error (MAE) and Mean Square Error (MSE). It not only maintains a continuous derivative but also leverages the decreasing gradient of MSE with error to obtain a more accurate minimum, and exhibits better robustness to outliers.
[0227] Step 2.3: Model performs prediction
[0228] The trained model is used to predict the input data. The predicted values need to be restored to the original scale through inverse normalization. Ultimately, the system can output multi-step future container load predictions, supporting edge cloud resource scheduling.
[0229] To verify the effectiveness of the MSTCN-AM proposed in this application, ablation experiments were conducted using both the traditional TCN model and the MSTCN-AM model in a multi-step prediction task. CNN-LSTM and CNN-GRU, among other load prediction models, were used as control groups. The MSTCN-AM model achieved optimal MSE and MAE metrics at different prediction step sizes, demonstrating significantly improved prediction accuracy compared to the traditional TCN model. Furthermore, compared to CNN-LSTM and CNN-GRU models, the MSTCN-AM model exhibited higher accuracy on the edge-cloud dataset.
[0230] Step 2.4, Effect Verification
[0231] To verify the effectiveness of introducing relevant containers in this application: First, introducing different numbers of relevant containers significantly affects prediction accuracy. Initially, prediction accuracy increases with the number of relevant containers, but gradually decreases when the number becomes excessive. This may be because the increased complexity of the input features leads to greater difficulty in model training, resulting in decreased accuracy. This indicates that the number of relevant containers has a significant impact on model accuracy. Therefore, when using this method, the optimal number of relevant containers needs to be determined in advance through experiments to obtain the best prediction results.
[0232] To verify the effectiveness of the edge cloud load prediction method proposed in this application: compared with load prediction methods based on CNN-LSTM, CNN-GRU and Infomer, the load prediction method based on the MSTCN-AM model proposed in this application can achieve the best results under different prediction step sizes, demonstrating the superiority of the method in edge cloud load prediction tasks.
[0233] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0234] Based on the same inventive concept, this application also provides an edge cloud load forecasting device for implementing the edge cloud load forecasting method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more edge cloud load forecasting device embodiments provided below can be found in the limitations of the edge cloud load forecasting method described above, and will not be repeated here.
[0235] In one exemplary embodiment, such as Figure 3 As shown, an edge cloud load prediction device is provided, comprising:
[0236] The static correlation filtering module 301 is used to obtain the static correlation between containers in the edge cloud; and based on the static correlation, determine the candidate containers that are statically correlated with the target container to be predicted.
[0237] The associated container determination module 302 is used to obtain the dynamic correlation between the target container and each candidate container; based on the dynamic correlation, it determines a set number of containers from the candidate containers as associated containers of the target container;
[0238] The input feature construction module 303 is used to obtain the load time series of the target container and the associated container respectively, and construct the input features of the model based on the multiple load time series;
[0239] The prediction module 304 is used to input the input features into a pre-trained load prediction model and obtain the load prediction result of the target container based on the output of the load prediction model; wherein, the load prediction model is a multi-step temporal convolutional network-attention mechanism model.
[0240] In an exemplary embodiment, the static correlation filtering module 301 is further configured to: obtain static indicator data of each container in the edge cloud, and determine the static correlation between containers based on the static indicator data;
[0241] The associated container determination module 302 is further configured to: obtain the load time series of the target container and each candidate container, and determine the dynamic correlation between the target container and each candidate container based on the load time series.
[0242] In an exemplary embodiment, the static metric data of the container includes global static metric data and local static metric data. The global static metric data includes static metric data of the application, server, and edge site to which the container belongs, and the local static metric data includes the static metric data of the container itself.
[0243] The static correlation filtering module 301 is further configured to: set the initial static correlation degree to 0 for the first container and the second container; traverse each of the static indicator data, and if the first container and the second container meet the preset correlation conditions on the currently traversed static indicator data, then the static correlation degree between the first container and the second container is incremented by 1; otherwise, the static correlation degree between the first container and the second container remains unchanged; and obtain the static correlation degree between the first container and the second container after traversing all the static indicator data.
[0244] In one exemplary embodiment, the load time series of the container is a time series that includes the container's CPU utilization and memory usage;
[0245] The associated container determination module 302 is further configured to: calculate the DTW distance between the load time series of the target container and the load time series of each candidate container using at least two different Dynamic Time Warping (DTW) algorithms, to obtain at least two DTW distances; and perform weighted normalization on the at least two DTW distances to obtain the dynamic correlation between the target container and each candidate container.
[0246] In an exemplary embodiment, the load prediction model is composed of multiple Temporal Convolutional Network (TCN) blocks stacked together. Each TCN block contains a core convolutional layer and an attention mechanism. The core convolutional layer is configured with the characteristics of causal convolution, dilated convolution, and depthwise separable convolution. The outputs of the multiple TCN blocks are fused in three branches through global average pooling, global max pooling, and the features of the last time step to achieve multi-scale feature integration. Finally, the load prediction result is output through a fully connected layer.
[0247] In an exemplary embodiment, the prediction module 304 is specifically configured to: input the input features into a pre-trained load prediction model; extract temporal features of the input features through the core convolutional layers of multiple TCN blocks in the load prediction model; weight important time steps through an attention mechanism; obtain integrated features based on the output features of multiple TCN blocks through a three-branch fusion of global average pooling, global max pooling, and features from the last time step; input the integrated features into the fully connected layer of the load prediction model; and output the load prediction result of the target container in future time steps through the fully connected layer.
[0248] In one exemplary embodiment, the edge cloud load prediction device further includes a preprocessing module for:
[0249] Obtain raw monitoring data from each container in the edge cloud, and perform at least one of the following preprocessing steps on the raw monitoring data. The preprocessed monitoring data is then used to train the load prediction model or to construct the input features of the model:
[0250] Fill data gaps using the mean fill method;
[0251] Truncation or padding is performed to ensure that the processed monitoring data of each container are within the same time window;
[0252] Redundant information is removed, and key features are retained; the key features include one or more of the following: container number, timestamp, CPU utilization, memory utilization, edge site number, and microservice number.
[0253] Each module in the aforementioned edge cloud load prediction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0254] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data related to load forecasting. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an edge cloud load forecasting method.
[0255] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0256] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the load prediction method of any of the above embodiments.
[0257] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the load prediction method of any of the above embodiments.
[0258] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0259] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0260] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0261] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An edge cloud load prediction method, characterized in that, The method comprises: obtaining static correlations between containers in an edge cloud; based on the static correlations, determining candidate containers statically correlated with a target container to be predicted; obtaining dynamic correlations between the target container and each candidate container; based on the dynamic correlations, determining a set number of containers from the candidate containers as associated containers of the target container; obtaining load time series of the target container and the associated containers respectively, and constructing input features of a model based on the load time series; inputting the input features into a pre-trained load prediction model, and obtaining a load prediction result of the target container based on an output of the load prediction model; wherein the load prediction model is a multi-step time convolution network-attention mechanism model.
2. The method of claim 1, wherein: the static correlations between the containers are obtained by: obtaining static index data of each container in the edge cloud, and determining the static correlations between the containers based on the static index data; the dynamic correlations between the target container and each candidate container are obtained by: obtaining load time series of the target container and each candidate container respectively, and determining the dynamic correlations between the target container and each candidate container based on the load time series.
3. The method of claim 2, wherein, the static index data of the container includes global static index data and local static index data, the global static index data includes static index data of a corresponding edge site, and the local static index data includes static index data of an application to which the container belongs, a server to which the container belongs, and / or the container itself; determining the static correlations between the containers based on the static index data comprises: setting an initial static correlation between a first container and a second container to 0; traversing each of the static index data, if the first container and the second container satisfy a preset association condition on a currently traversed static index data, increasing the static correlation between the first container and the second container by 1, otherwise, keeping the static correlation between the first container and the second container unchanged; after traversing all the static index data, obtaining the static correlation between the first container and the second container.
4. The method of claim 2, wherein, the load time series of the container is a time series including CPU usage and memory usage of the container; determining the dynamic correlations between the target container and each candidate container based on the load time series comprises: calculating DTW distances between the load time series of the target container and the load time series of each candidate container by at least two different dynamic time warping (DTW) algorithms, to obtain at least two DTW distances; performing weighted normalization on the at least two DTW distances to obtain the dynamic correlation between the target container and each candidate container.
5. The method of claim 1, wherein: the load prediction model is stacked by a plurality of time convolution network (TCN) blocks, each TCN block includes a core convolution layer and an attention mechanism, and the core convolution layer is set in combination with characteristics of causal convolution, dilated convolution and depthwise separable convolution. The outputs of the plurality of TCN blocks are fused by three branches of global average pooling, global maximum pooling and last time step features to realize multi-scale feature integration, and finally a load prediction result is output through a fully connected layer.
6. The method of claim 5, wherein, The input feature is input into a pre-trained load prediction model, and based on the output of the load prediction model, a load prediction result of the target container is obtained. The input feature is input into a pre-trained load prediction model, and based on the output of the load prediction model, a load prediction result of the target container is obtained.
7. The method according to any one of claims 1 to 6, characterized in that, The method further comprises: Obtaining original monitoring data of each container in the edge cloud, and performing at least one of the following preprocessing on the original monitoring data, and the preprocessed monitoring data is used as an input feature for training of the load prediction model or construction of the model: Filling data holes by using mean filling method; Cutting or filling to make the processed monitoring data of each container in the same time window; Eliminating redundant information and retaining preset key features; the key features include one or more of container number, timestamp, CPU utilization, memory utilization, edge site number and microservice number.
8. An edge cloud load prediction apparatus, characterized by comprising: The device comprises: A static association screening module configured to obtain static correlations between containers in the edge cloud, and determine candidate containers statically correlated with a target container to be predicted based on the static correlations; An associated container determination module configured to obtain dynamic correlations between the target container and each candidate container, and determine a set number of containers from the candidate containers as associated containers of the target container based on the dynamic correlations; An input feature construction module configured to obtain load time series of the target container and the associated containers respectively, and construct an input feature of a model based on a plurality of the load time series; A prediction module configured to input the input feature into a pre-trained load prediction model, and obtain a load prediction result of the target container based on an output of the load prediction model; wherein the load prediction model is a multi-step time convolution network-attention mechanism model. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to realize the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method of any one of claims 1 to 7.