Edge server load prediction method and system based on multi-scale time-frequency analysis
Through the combination of multi-scale time-frequency analysis and LWMSPformer model, dynamic chunking and Transformer encoder, the problem of capturing multi-scale features and long-term dependencies in edge server load prediction is solved, and high-precision and low-cost load prediction is achieved, which improves resource utilization and system stability.
Patent Information
- Application Number
- CN202510516578.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-08-01
AI Technical Summary
The prior art is difficult to accurately capture the multi-scale characteristics and long-term dependencies of edge server loads, and the computational complexity is high, resulting in insufficient load prediction accuracy and low resource utilization.
The edge server load prediction method based on multi-scale time-frequency analysis is adopted. By constructing a fragment size candidate set, dynamic fragment blocking is performed using a fragment size selector, and features are extracted by LWMSPformer model and Transformer encoder, dynamic time-aware convolution generates local and global features for load prediction.
It improves the accuracy and adaptability of load prediction, reduces computing costs, can better cope with the dynamic changes in edge server load, and improves resource utilization and system stability.
Smart Images

Figure CN120407181A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of edge servers, and specifically to an edge server load prediction method and system based on multi-scale time-frequency analysis. Background Art
[0002] With the rapid development of cloud computing, Internet of Things (IoT), artificial intelligence (AI) and 5G technologies, edge computing has emerged as a decentralized computing paradigm and plays a key role in supporting low-latency and high-performance applications. However, edge server clusters face many challenges in resource management. The load status of servers is affected by various factors, including changes in user access patterns, task scheduling strategies, resource competition, and system failures. The dynamic changes of these factors make the server load exhibit highly non-linear and time-varying characteristics, resulting in a significant increase in the complexity of load prediction. Traditional load prediction methods rely on empirical rules or statistical modeling and are difficult to accurately capture complex temporal dependencies and multi-scale features. In addition, the resource allocation of edge server clusters needs to be dynamically adjusted according to the real-time load conditions to improve the utilization rate of computing resources, reduce energy consumption, and ensure service quality.
[0003] For the server load prediction task, scholars at home and abroad have proposed various methods to solve this problem, including autoregressive integrated moving average (ARIMA), long short-term memory network (LSTM), convolutional neural network (CNN), and combined models. Although the carefully designed prediction models are suitable for dealing with the server load prediction problem, these conventional methods still face many challenges. For example, traditional statistical models are difficult to handle long-term dependencies, while the LSTM-based models, although having certain temporal modeling capabilities, still have limitations in capturing multi-scale features and dealing with long-term dependency problems. In addition, deep learning models are often sensitive to hyperparameters and have high computational costs, making it difficult to be efficiently deployed in resource-constrained environments. In recent years, time series modeling methods based on self-attention mechanism (Transformer) have made significant progress. The Transformer architecture has a global attention mechanism and performs excellently in capturing long-range dependencies and modeling complex temporal features. In addition, the proposal of time-frequency analysis technology, multi-scale feature extraction idea, and segment chunking idea also provides a new direction for improving the accuracy and stability of load prediction. Therefore, in order to better cope with the dynamic changes of server load, improve resource utilization rate and system stability, there is an urgent need for a load prediction method that combines multiple advanced technologies to achieve more accurate and efficient server load prediction.
[0004] The current research work is mainly divided into two categories: one is to use traditional statistical analysis and regression methods for server load prediction, which models based on the historical data of the server load sequence and is suitable for short-term prediction, but it is difficult to capture long-term dependencies and non-linear relationships; the other is to use deep learning models to extract features and predict the load of the server load data set, which often relies on a single model structure or technology and is difficult to comprehensively capture the multi-scale features of the server load data; in addition, most traditional methods do not fully utilize the frequency domain features of the data and lack effective processing of irregularly sampled server load data, making it difficult to adapt to the uneven distribution of server load data, and the computational complexity is relatively high, which limits its real-time prediction ability.
[0005] Therefore, the present invention aims to design a load prediction method for an irregularly sampled server load data set, based on time-frequency analysis and multi-scale segment chunking technology, to solve the problems of insufficient prediction accuracy and high computational complexity in the prior art. Summary of the Invention
[0006] The object of the present invention is to propose an edge server load prediction method and system based on multi-scale time-frequency analysis. By constructing a candidate set of segment sizes, using a segment size selector to select multiple segment sizes for dynamic segment chunking, and extracting features from multiple scales, the accuracy of server load prediction is effectively improved, and the dynamic changes of edge server load are better handled.
[0007] The technical solution adopted by the present invention is: an edge server load prediction method based on multi-scale time-frequency analysis, including the following steps:
[0008] S1. Calculate the weights of each resource of the edge server based on data-driven and analytic hierarchy process, and perform weighted fusion to obtain load data;
[0009] S2. Build an LWMSPformer model, extract the periodic time span of the load data X based on the Lomb-Scargle spectral analysis method, and combine the wavelet decomposition technology to extract the trend time span and mutation time span of the load data to generate a candidate set of segment sizes;
[0010] S3. Perform batch processing on the load data to obtain input data, perform periodic decomposition and trend decomposition on the input data, calculate the fitness of the input data with each segment size in the candidate set of segment sizes, and select the top 3 segment sizes with the highest weights as 3 scales to divide the input data into dynamic segments with the same time span and variable number of data points;
[0011] S4. Perform continuous-time embedding on each dynamic segment, combine the time information with the input data, generate a low-dimensional latent embedding of local features through dynamic time-aware convolution, and then input it into the Transformer encoder after adding position encoding to extract global features, obtaining fused features containing local and global features at each scale;
[0012] S5. Weightedly aggregate the fused features of each scale through a multi-scale aggregator, flatten the multi-dimensional feature tensor after multi-scale aggregation, and input it into the prediction layer to output the load prediction value of the edge server under a certain future time span.
[0013] As a preferred solution, use the optuna framework to optimize hyperparameters and select the optimal model parameters.
[0014] As a preferred solution, step S1 includes the following sub-steps:
[0015] Calculate the standard deviation of server resources and the correlation coefficients between various resources to obtain the information content of each resource;
[0016] According to the information content of each resource, construct a pairwise judgment matrix between various resources, solve the eigenvector corresponding to the maximum eigenvalue of the matrix, normalize it to obtain the weight of each resource, and perform a consistency test;
[0017] Weightedly sum the weights of each resource after passing the consistency test and the corresponding resource data to obtain the load value of the edge server at each moment, and model the load data of the edge server.
[0018] As a preferred solution, step S2 includes the following sub-steps:
[0019] For the irregularly sampled load data, calculate the power spectral density by fitting a multi-frequency sine / cosine wave function, screen the high-power frequencies, and infer the periodic time span;
[0020] Perform wavelet decomposition on the load data using the Daubechies4 wavelet basis, calculate the time interval of trend change through inflection point detection, and take the median as the trend time span; set an amplitude threshold to mark the mutation interval and count the mutation time span;
[0021] Integrate the periodic time span, trend time span, and mutation time span to generate a candidate set T of segment sizes.
[0022] As a preferred solution, in step S3, based on Lomb-Scargle spectral analysis, the frequency information of the input data is extracted, and the frequencies with relatively large power are screened to retain the periodic components; the remaining part is used to extract the trend through multi-core moving average, and the trend components are weighted and fused; the periodic components, trend components and input data are combined, and fused data is generated through linear mapping, and its fitness with the fragment size candidate set is calculated to generate importance weights.
[0023] As a preferred solution, step S4 includes the following sub-steps:
[0024] Encode the time information into a vector function, including a linear term for expressing non-periodic changes and a sine term for expressing periodic changes;
[0025] Concatenate the time embedding vector of each dynamic fragment with the input data to generate a fragment observation value;
[0026] Through a dynamic time-aware convolutional network, use a meta-filter to adaptively generate filter parameters matching the data volume, and perform convolutional operations on the fragment observation values to generate the latent embedding of the dynamic fragment;
[0027] Introduce a fragment mask in the latent embedding to obtain a low-dimensional latent embedding that retains cross-time semantic information;
[0028] Based on the low-dimensional latent embedding, after adding position encoding, the input embedding of the Transformer encoder obtained is transformed into a query matrix, a key matrix and a value matrix through a linear layer, and then input into the multi-head attention module to capture the relationships between different dynamic fragments.
[0029] As a preferred solution, the resources of the server include the values of CPU utilization, memory utilization, the number of incoming network packets, the number of outgoing network packets, and disk space utilization.
[0030] A system for implementing an edge server load prediction method based on multi-scale time-frequency analysis, including:
[0031] A load data modeling module: used to calculate the load data of the edge server through data-driven and analytic hierarchy process;
[0032] A fragment candidate set generator: used to analyze the load data to generate a fragment size candidate set;
[0033] A multi-scale feature fusion module: used to obtain dynamic fragments at multiple scales according to the input data and the fragment size candidate set, obtain local features within each dynamic fragment and global features between dynamic fragments at each scale, and aggregate local features and global features at multiple scales to obtain a multi-dimensional feature tensor;
[0034] Flattening and Prediction Module: It is used to output the predicted load value of the edge server under a certain future time span according to the multi-dimensional feature tensor.
[0035] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0036] The present invention can achieve better prediction accuracy on irregularly sampled server load data than traditional methods based on statistical modeling and deep learning, and overcomes the disadvantages of traditional methods that rely on regular sampling, are difficult to effectively model time-frequency characteristics, and have high computational complexity. Based on the multi-scale dynamic segment partitioning technology, a more suitable segment size for the data itself is selected through the segment size candidate set and the segment size selector for data partitioning, which can effectively focus on multiple characteristics of the load data such as periodicity, trend, and mutation characteristics. At the same time, the dynamic time-aware convolutional network can more accurately extract the local features of irregularly sampled server load data, and combine the Transformer encoder to extract the global features between blocks, so as to take into account local detail information, overall trend information, and long-term dependence relationships, improve the adaptability and generalization ability of the model, reduce the computational cost at the same time, and have stronger prediction ability. It is an efficient and feasible solution for server load prediction in the edge computing environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0038] Figure 1 It is a schematic flow chart of the present invention;
[0039] Figure 2 It is a schematic framework diagram of the present invention;
[0040] Figure 3 It is a schematic diagram of the LWMSPformer model architecture of the present invention;
[0041] Figure 4 It is a schematic diagram of the comparison test between the predicted value and the load value;
[0042] Figure 5 It is a schematic diagram of the comparison of the evaluation indexes of each model. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] Hereinafter, the present invention will be specifically described through exemplary embodiments. However, it should be understood that without further description, the elements, structures, and features in one embodiment can also be beneficially combined into other embodiments.
[0044] It should be noted that: Unless otherwise defined, the technical terms or scientific terms used in this article should have the ordinary meanings understood by those with ordinary skills in the field to which the present invention belongs. The words such as "a", "an", or "the" used in the specification and claims of this patent application for invention do not express a limitation of quantity, but rather indicate the existence of at least one; the "first", "second", and "third" used in this article should not be regarded as a limitation on the order of components, but only to distinguish different components; words such as "comprising" or "including" indicate that the elements or objects appearing before "comprising" or "including" cover the elements or objects listed after "comprising" or "including" and their equivalents, but do not exclude other elements or objects with the same functions.
[0045] To more clearly describe the specific structural composition of the edge server load prediction method and system based on multi-scale time-frequency analysis, in combination with the attached Figures 1-5 Describe this embodiment:
[0046] As Figures 1-3 shown, the edge server load prediction method based on multi-scale time-frequency analysis includes the following steps:
[0047] S1. Calculate the weight ω′ of each resource of the edge server based on data-driven and analytic hierarchy process, and weighted fusion to obtain the load data X;
[0048] This step combines data-driven and analytic hierarchy process to calculate the importance weights of the characteristics of each resource on the server, and models the load data X of the server; among them, the analytic hierarchy process often determines the relative importance between the characteristics of each resource based on subjective experience, constructs a pairwise comparison matrix, and calculates the maximum eigenvalue of the pairwise comparison matrix and its corresponding eigenvector, and normalizes the eigenvector to obtain the weight vector of the characteristics of each resource; by combining the data-driven method, the amount of information of each resource can be calculated according to the standard deviation and correlation coefficient between each resource, and the importance degree of each resource can be represented by the amount of information, and a pairwise comparison matrix can be constructed according to the amount of information, which can reduce the interference of subjective factors and more scientifically reflect the importance degree of each resource in the actual situation; specifically includes the following sub-steps:
[0049] S101. Calculate the standard deviation σ = (σ1, σ2,..., σ n ) and the correlation coefficient r between resources of the edge server. The standard deviation can reflect the dispersion degree of each resource, and the correlation coefficient can reflect the similarity of each resource. Then, calculate the amount of information I of each resource based on the standard deviation and correlation coefficient of each resource. The amount of information represents the influence degree of the resource on the load of the server. Therefore, the objective importance of the index can be measured by the size of the amount of information I, which is defined as:
[0050]
[0051] Among them, σ j represents the standard deviation of resource j, N represents the number of data of each resource in the dataset, x j,i represents the i-th data value of resource j, x u,i represents the i-th data value of resource u, represents the mean value of resource j, represents the mean value of resource u, r u,j represents the correlation between resource u and resource j, n represents the number of resources. In this method, there are 5 kinds of resources in total, so n is 5, I j represents the information amount of resource j;
[0052] S102. According to the information amount I of each resource calculated in S101, construct a pairwise judgment matrix A between each resource. This matrix records the proportional relationship of importance between each resource. By solving the maximum eigenvalue λ max of the corresponding eigenvector ω, after normalization, the weight ω′ of each resource is obtained, and a consistency test is performed to ensure the rationality of the judgment, which is defined as:
[0053] Aω = λ max ω
[0054]
[0055] Among them, ω = (ω cpu , ω mem , ω net_in , ω net_out , ω disk ) T is the eigenvector corresponding to the maximum eigenvalue λ max , representing the relative importance degree of different resource characteristics, ω j represents the importance degree of resource j, ω' j is the result after ω j is normalized, representing the weight of resource j. There are 5 kinds of resources in this dataset. Therefore, the weights of each resource are expressed as ω′ = (ω′ cpu , ω′ mem , ω′ net_in , ω′ net_out , ω′ disk ). CI is the consistency index, and RI is the random consistency index, which depends on the order n of the pairwise judgment matrix A (n represents the number of resources). If CR < 0.1, it is considered that the consistency of the pairwise judgment matrix is acceptable; otherwise, the pairwise judgment matrix needs to be adjusted again;
[0056] S103. Sum the weighted resources ω′ and the corresponding resource data after passing the consistency test to obtain the load value of the edge server at each moment. Model the load data X of the edge server as X = (x1, x2, …, x i , …, x N ), where x i is defined as:
[0057] x i = ω′ cpu ·x cpu,i + ω′ mem ·x mem,i + ω′ net_in ·x net_in,i + ω′ net_out ·x net_out,i + ω′ disk ·x disk,i
[0058] where x i represents the load value of the i-th data, and x cpu,i , x mem,i , x net_in,i , x net_out,i , x disk,i represent the CPU utilization rate, memory utilization rate, number of incoming network packets, number of outgoing network packets, and disk space utilization rate of the i-th data respectively. This method realizes the effective combination of data-driven and analytic hierarchy process, making the calculation of the server load value based on objective resource data. This combination method can more accurately reflect the actual load situation of the server at different moments and provide more reliable data support for subsequent load prediction tasks.
[0059] S2. Build the LWMSPformer model, extract the periodic time span of the load data X based on the Lomb-Scargle spectral analysis method, and combine the wavelet decomposition technology to extract the trend time span (trend duration) and mutation time span (mutation behavior duration) of the load data X to generate a candidate set T of segment sizes;
[0060] Step S2 includes the following sub-steps:
[0061] S201. For the irregularly sampled server load data X = (x1, x2, …, x i , …, x N ) after load modeling, use the Lomb-Scargle spectral analysis method to analyze the periodic characteristics of the data. By fitting the data to a function of the superposition of multiple sine waves and cosine waves with different frequencies, calculate the goodness of fit between the data and the function at different frequencies to obtain the power spectral density of the data. By identifying the frequency point with the highest power, further infer the most likely periodicity of the data, which is defined as:
[0062] x i ≈Acos(2πft i )+Bsin(2πft i )
[0063]
[0064] Among them, the first formula fits the load data into a superposition function of sine wave and cosine wave based on the candidate frequency f. f is the candidate frequency, and a series of f values are selected at a certain step within a general frequency range. A and B are fitting coefficients, which are determined by minimizing the sum of squared residuals, and their role is to make the fitting function as close as possible to the original data. t i represents the timestamp corresponding to the i-th data, τ is the time offset, which is used to eliminate the influence of time offset on period estimation, t i -τ represents the moment after removing the time deviation, P(f) represents the relative power magnitude of the frequency component in the data, which reflects the goodness of fit between the data and the function at the candidate frequency f. Finally, the top K candidate frequencies [f1, f2,..., f K with the largest relative power are selected, and the corresponding period time spans [T1, T2,…, T K are obtained;
[0065] S202. Perform wavelet decomposition on the load data X using the Daubechies4 wavelet basis, calculate the time interval of trend change through inflection point detection, and take the median as the trend time span; set the amplitude threshold to mark the mutation interval and count the mutation time span;
[0066] The essence of wavelet decomposition is to perform convolution operations on the signal through low-pass and high-pass filters and then perform downsampling. Among them, the low-pass and high-pass filters act like filters. The low-pass filter allows low-frequency signals to pass through, blocks or weakens high-frequency signals, and is used to obtain low-frequency components. The low-frequency components can represent the trend characteristics of the data. The high-pass filter allows high-frequency signals to pass through, blocks or weakens low-frequency signals, and is used to obtain high-frequency components. The high-frequency components can reflect the mutation data information of the data;
[0067] This step uses the Daubechies4 wavelet basis to perform J-layer wavelet decomposition on the load data X = (x1, x2,…, x i ,…, x N ). The first layer of wavelet decomposition divides the load data into a low-frequency component and a high-frequency component. Then, for each subsequent layer of wavelet decomposition, it is performed on the low-frequency component again, dividing it into a low-frequency component and a high-frequency component. After J-layer wavelet decomposition, the low-frequency component D J of the J-th layer and the high-frequency components H J = (H1, H2,…, Hj , …, H J ); The low - frequency component and high - frequency component after the first - layer decomposition are defined as:
[0068]
[0069] Among them, D1[k] represents the low - frequency component after the first - layer wavelet decomposition, H1[k] represents the high - frequency component after the first - layer wavelet decomposition, m represents the m - th filter. Since the db4 wavelet basis is used, the total number of m is 4, k represents the index of downsampling after wavelet decomposition, 2k - m represents moving the calculation window 2 points each time to achieve downsampling, x 2k-m represents the (2k - m) - th data in the load data X, d and h are the coefficients of the low - pass filter and high - pass filter respectively. In the db4 wavelet basis,
[0070] After the first layer, each subsequent layer performs wavelet decomposition on the low - frequency component of the previous layer, which is defined as:
[0071]
[0072] Among them, D j [k] represents the low - frequency component obtained after the j - th layer wavelet decomposition, H j [k] represents the high - frequency component obtained after the j - th layer wavelet decomposition, represents the (2k - m) - th data in the low - frequency component of the (j - 1) - th layer. Through wavelet decomposition, for the low - frequency component D J of the J - th layer, inflection - point detection is performed by comparing the values of adjacent data points in the low - frequency component. For example, for the i - th data point D J [x i , if D J [x i-1 <D J [x i and D J [x i >D J [x i+1 , then D J [x i is a local maximum point. All local maximum points and local minimum points are found according to the inflection - point detection. The time indices of adjacent local maximum points and minimum points are differenced to obtain the time interval of trend change, and then the median T trend of all intervals is taken as the trend time span; For the high - frequency component H j, a magnitude threshold λ is set, and the data points in the high-frequency component that are greater than the threshold λ are marked as mutation points, and the other parts are considered as noise parts. The continuous time points marked as mutation points form an interval, constituting a complete mutation time period. Denote the starting time index as t start , and the ending time index as t end , then the time span of the mutation data is T mut = t end - t start + 1, and a total of J mutation time spans are obtained
[0073] S203. Integrate the cycle time span, trend time span, and mutation time span to generate a candidate set of segment sizes
[0074] S3. Perform batch processing on the load data X to obtain the input data X input , for the input data X input perform periodic decomposition and trend decomposition, calculate the fitness of the input data X input with each segment size in the candidate set of segment sizes T, and select the top 3 segment sizes with the highest weights as 3 scales to divide the input data X input into dynamic segments with consistent time spans and variable numbers of data points
[0075] During the model training process, usually batch processing is performed on the load data X, and each time a fixed batch of data is selected as the input data to be input into the model for training. Define the input data as X input , this method performs periodic decomposition and trend decomposition on the input data X input to obtain the characteristic information of the input data, and calculate the fitness weights of each segment size in the module - candidate set of segment sizes according to the characteristic information of the input data, used to select the most suitable segment size for the input data to perform segment division; first use the Lomb - Scargle spectral analysis method to extract the frequency information of irregularly sampled data, select the top k frequencies according to the relative power magnitude, and through the ILombScargle(·) method only retain the periodic part X input of the input data X sea , where A and φ represent the amplitude and phase respectively; for the remaining part X rem = X - X sea perform trend decomposition, use different average pooling kernels for moving average to extract the trend pattern, and for the results obtained by different kernels, use weighted summation to obtain the trend part data in X rem , denoted as X trend , defined as:
[0076]
[0077] where is the pooling function with the \(i\)-th kernel, \(M\) corresponds to the number of pooling kernels, and Softmax(L(·)) controls the weights of the results of different kernels. Then \(X\) sea and \(X\) trend are added to the original input \(X\), and through the linear mapping Linear(·), they are transformed and merged along the time dimension to obtain \(X\) trans = Linear([\(X\), \(X\) sea , \(X\) trend ); for the merged fusion data \(X\) trans , calculate the degree of fit of each candidate size to the fusion data, that is, obtain the importance weights of each candidate size; defined as:
[0078] \(R(X\) trans ) = Softmax(\(\omega\) r [\(X\) trans ||E(T)] + \(\varepsilon\)·Softplus(\(X\) trans \(\omega\) noise ))), \(\varepsilon\)~N(0,1)
[0079] where, E(T) represents storing the representation vectors in the fragment size candidate set T in the embedding matrix E, \(\omega\) r and \(\omega\) noise are learnable weight parameters, \(\varepsilon\) is the noise coefficient that controls the influence of noise, Softplus(·) is a smooth activation function, Softmax(·) is responsible for calculating the weight values of each element in the brackets, and the sum of these element weight values is 1, \(R(X\) trans ) represents the calculated importance weight values of each candidate fragment size; according to this importance weight value, select the top 3 candidate fragment sizes as the 3 scales of multi-scale division, and represent their weight value set as
[0080] Divide the input data \(X\) input into non-overlapping fragments according to the fragment sizes selected in step one. Each fragment size will divide the input data into multiple fragments, and the fragments divided by the same fragment size have the same fragment window size with the same time span. However, since the sampling of irregular time series data is uneven, the number of observed data \(s\) included within the same time span is inconsistent, so it is called a dynamic fragment; through this method of fragment division, each fragment size divides the input data \(X\) input into \(P\) blocks of dynamic fragments with continuous observed values Fragments divided by different fragment sizes have different local semantic information, so this method can effectively capture local semantic information of multiple different scales.
[0081] S4. For each dynamic segment perform continuous-time embedding, combine the time information with the input data X input and generate a low-dimensional latent embedding of local features through dynamic time-aware convolution Then add the positional encoding PE 1:P and input it into the Transformer encoder to extract global features, obtaining fused features containing local and global features at each scale;
[0082] Specifically, it includes the following steps:
[0083] S401. At each scale, after converting the input data into a series of segments, each segment needs to be encoded into a latent embedding to capture the local semantic information in the time series; before that, in order to enable the model to better understand the time characteristics in the data, the method of continuous-time embedding is adopted to convert the time information into a vector representation through a conversion function, defined as:
[0084]
[0085] where θ(t i ) represents the embedding representation of the timestamp t i , D t represents the dimension of the embedding, d represents the d-th dimension, ω d , α d are learnable parameters, representing frequency and phase shift respectively. The reason for designing two sets of functions is that the time series data itself has both non-periodic and periodic characteristics. Through the combination of these two functions, the time information can be comprehensively encoded, where the linear term is used to capture the non-periodic changes of time, and the sine term is used to capture the periodic changes of time;
[0086] For each segment, through the concatenation operation, the time embedding and the input data are combined to obtain the input observation value in the segment For example, for the p-th segment, where represents the i-th value of the p-th segment after dividing the input data X input into multiple segments, s represents the number of observed data in the current segment. Then, a dynamic time-aware convolutional network is introduced to capture the local feature information, and a meta-filter is used to generate the time-aware convolutional filter, adaptively generating the filter parameters. The parameters of the filter can be transformed according to the number of observed data in the segment, defined as:
[0087]
[0088] where, F d(·) is a meta-filter that can be instantiated by a learnable neural network and is responsible for generating z i The response in the d-th dimension, exp(·) represents the exponential function with the natural constant e as the base, and f d is the time-aware convolutional filter generated in the d-th dimension, which is generated based on each time step of the input sequence, is consistent with the length of the input sequence, and through a normalization operation, normalizes the generated filter parameters along the time dimension, ensuring consistent scaling of the convolution results for sequences of different lengths;
[0089] Finally, for each filter f d , the observation value z i at each time step in this segment is dot-producted with the transpose of the filter f d to generate the latent embedding of this segment; defined as:
[0090]
[0091] where g p represents the latent embedding of the p-th segment, and f d [i] T represents the transposed result after processing the i-th data using the filter f d . Considering that in the case of sparse time series or high time resolution (short time span of the segment), some segments may have no observations, therefore, a segment mask m p is additionally added to the segment embedding to obtain the final latent embedding If the segment has observations, then m p = 1, otherwise 0; this process encodes the local features of the time series into a low-dimensional latent embedding while retaining the semantic information across time;
[0092] S402. Use the low-dimensional latent embedding G 1:P as the input data of the Transformer to model the global dependencies of the irregular time series data; first, add a positional encoding PE 1:P to the low-dimensional latent embedding G 1:P to represent the time order between segments, and obtain the input embedding X global = G 1:p + PE 1:P ; then transform the input embedding X global into a query matrix Q, a key matrix K, and a value matrix V through a linear layer, and input them into the multi-head attention module to capture the relationships between different said dynamic segments defined as:
[0093] Q = Xglobal ω Q , K = X global ω K , V = X global ω V
[0094]
[0095] head i = Attention(Q, K, V), i = 1, 2,..., h
[0096] MultiHead(Q, K, V) = Concat(head1, head2,... head h )ω o
[0097] where ω Q , ω K , ω V represents the weight of the linear layer, Attention(Q, K, V) represents the attention weight between the query matrix Q, key matrix K, and value matrix V calculated, d k represents the feature dimension of each head, QK T is the dot product of the transpose of the query matrix and the key matrix, representing the correlation between positions in the sequence, is the scaling factor used to prevent the dot product value from being too large, head i represents the attention weight calculated by the i-th head, ω o is the linear mapping matrix of the final output, h represents the number of attention heads, Concat(·) represents combining the attention weights of multiple heads, MultiHead(Q, K, V) represents the output result after the query matrix Q, key matrix K, and value matrix V pass through the multi-head attention module. After multi-head attention, a two-layer fully connected feed-forward network FFN(·) is connected, which is used for further non-linear transformation of the features and is defined as:
[0098]
[0099] where represents the result of layer normalization LayerNorm(·) after residual connection between the data processed by the multi-head attention module and the input data, FFN(·) represents the calculation of the feed-forward network, represents the weight matrix of the feed-forward network, represents the bias of the feed-forward network, ReLU(·) is an activation function used to introduce non-linear features, X outDenote the final output feature at this scale. Since the input data contains local feature information, the finally output feature is a unified representation that implicitly fuses local features and global features. After the multi-head attention and after the feed-forward network, layer normalization operations are respectively added to normalize the features at each time step, and residual connections are applied to stabilize the training of the model and alleviate the problem of gradient disappearance.
[0100] S403. Each scale will obtain the fused feature of local features and global features at this scale through S401 and S402. The multi-scale aggregator first executes the transformation function T i (·) to align the time dimensions of different scales. Then, according to the weight values of the 3 candidate segment sizes selected in the first step, the aggregator performs weighted aggregation on the feature information finally obtained at each scale with the corresponding weights to obtain the final output of this layer, which is defined as:
[0101]
[0102] where denotes the weight value of the i-th segment size, denotes the final output feature at the i-th segment size (i.e., the i-th scale), and T i (·) is a linear transformation function used to align the feature information obtained from multiple scales in the time dimension, so that the feature information obtained from different scales can be processed subsequently under a relatively unified standard. X final denotes the multi-dimensional feature tensor after multi-scale aggregation.
[0103] S5. By using the multi-scale aggregator to perform weighted aggregation on the fused features of each scale, the multi-dimensional feature tensor X final after multi-scale aggregation is flattened and input into the prediction layer to output the load prediction value of the edge server under a certain future time span;
[0104] S501. For the multi-dimensional feature tensor X final output by the last multi-scale feature fusion block, the flattening layer converts it into a one-dimensional vector z so that it can be input into the subsequent fully connected layer for prediction, which is defined as z = Flatten(X final )ω f , where ω f is a learnable weight matrix, and Flatten(·) means combining the feature number dimension and the channel dimension of the tensor into a one-dimensional vector;
[0105] S502. Due to the irregular time-series data, its sampling timestamps are not equally spaced, resulting in differences in the amount of data within a fixed time period. Therefore, unlike conventional time-series data, it is not possible to simply define the number of future data points based on the number of historical data points. However, it is possible to consider the time span and define that each time, based on the historical data within a time span of T seq to predict the data within a future time span of T pre . Define a variable q j to indicate the j-th value within the time period T pre . Define the prediction query as Q n represents the number of predicted values included in T pre .
[0106] S503. When a flattened one-dimensional feature vector and a set of prediction queries are given, through y j = MLP([z||φ(q j )]), for each prediction query q j , obtain the corresponding predicted value, where φ(q j ) represents the embedding representation of the prediction query q j . MLP() represents the calculation of a multi-layer perceptron, which is divided into two layers. The weight of the first layer is ω1, and the activation function is ReLU. The weight of the second layer is ω2, and the predicted value y j corresponding to this query is obtained. The results of all prediction queries are combined to obtain the final prediction result
[0107] S6. Use the optuna framework to optimize hyperparameters and select the optimal model parameters;
[0108] Use the optuna hyperparameter optimization framework to perform hyperparameter optimization on the main hyperparameters such as the learning rate, batch size, number of encoder layers, hidden layer dimension, and number of heads in the multi-head attention mechanism. Before the model is formally trained, determine several groups of optimal hyperparameter combinations for model training, and select the Mean Absolute Error (MAE), Root Mean Square Error (MSE), and Mean Absolute Percentage Error (MAPE) as evaluation metrics.
[0109] S601. First, define an objective function. This function takes a trial object as a parameter and defines a hyperparameter search space through this object. In each trial, the trial object selects a set of hyperparameter combinations. The objective function trains the LWMSPformer model based on this set of hyperparameter combinations and returns the model loss value to evaluate the quality of this set of hyperparameter combinations. The Optuna hyperparameter optimization framework dynamically adjusts the search strategy according to the tree-structured Parzen estimator algorithm, so that the selected hyperparameter combinations can quickly approach the optimal hyperparameter combinations.
[0110] S602. Save the 5 sets of hyperparameter combinations with the smallest model loss values during the trial process as alternative hyperparameter combinations. Use each saved set of hyperparameter combinations to train the LWMSPformer model respectively. During the training process, first set the initial best loss to 1000. Verify the model performance with the validation dataset every 5 rounds, calculate the mean absolute error of the current round in the validation dataset, and compare it with the previously saved best loss. If the calculated mean absolute error is less than the best loss, set the best loss to the mean absolute error value of this round and save the model parameters of this round.
[0111] S603. Train each set of hyperparameter combinations for 100 rounds. After the training is completed, select the model parameters of the optimal round saved and test them on the test set. Evaluate the generalization ability and prediction accuracy of the model according to the mean square error loss and mean absolute error loss calculated on the test set. Select the model parameters of the optimal round trained with the set of hyperparameter combinations with the best evaluation result as the best model trained in this patent.
[0112] A system for an edge server load prediction method based on multi-scale time-frequency analysis, including:
[0113] A load data modeling module: used to calculate the load data X of the edge server through data-driven and analytic hierarchy process.
[0114] LWMSPformer model construction: including a segment candidate set generator, a segment candidate set generator, and a multi-scale feature fusion module;
[0115] A segment candidate set generator: based on the Lomb-Scargle spectral analysis method and wavelet decomposition technology, obtain information such as the periodicity, trend, and mutation data position of the time series data, and construct a segment size candidate set T;
[0116] Multi-scale Feature Fusion Module: It adopts a mode of three-layer multi-scale feature fusion block residual connection. In each layer of the feature fusion block, first, the multi-scale selector extracts the periodic and trend features of the input data of this layer, and then calculates the fitness with each candidate size in the candidate set of fragment sizes generated by the first module. The top 3 adapted fragment sizes are selected as the 3 scales of this layer to divide the input data. Secondly, the local features and global features are extracted through the dynamic time-aware convolutional network and the Transformer encoder respectively. Finally, the features of multiple scales are aggregated by the multi-scale aggregator to form a multi-dimensional feature tensor X. final , which is residually connected to the input data of this layer and used as the input of the next layer;
[0117] Flattening and Prediction Module: For the multi-dimensional feature tensor X output by the last layer of the multi-scale feature fusion block final , after converting it into a one-dimensional vector, it is put into the prediction layer MLP together with the prediction query to output the load prediction value of the edge server under a certain future time span;
[0118] Model Training and Hyperparameter Tuning: It includes hyperparameter optimization, model training and model evaluation.
[0119] The present invention uses the Pycharm simulation experiment platform and refers to the Alibaba cluster dataset cluster-trace-v2018 for experimental simulation; in the experiment, two key evaluation criteria are set to measure the effectiveness of the proposed method; first, the accuracy of the prediction model is verified by means of the fitting curve of the predicted value and the true value on the test set; second, the Mean Absolute Error (MAE), Root Mean Square Error (MSE) and Mean Absolute Percentage Error (MAPE) are selected as evaluation indicators to evaluate the performance of the prediction model from the aspects of prediction accuracy and error fluctuation degree.
[0120] The comparison experiment results of the predicted value and the load value are as Figure 4 shown. The black dashed curve represents the actual load value of server m_1932 on the test set, the red solid curve represents the predicted value of the server m_1932 on the test set by the model of this method, and the blue dashed curve represents the predicted value of the Crossformer model on the server m_1932 on the test set. The results show that the predicted value of the model of this method on the test set is more fitted to the actual server load value, can better capture the data trend and mutation data, and can maintain a stable and relatively accurate prediction distribution under different time nodes and load conditions, effectively reducing the dispersion degree of the prediction results and effectively improving the reliability and practicability of the server load prediction.
[0121] The evaluation metrics of each model are as Figure 5 shown. The Dlinear model based on linear transformation, the Crossformer model based on Transformer, the PatchTST based on the traditional fragment chunking idea, and the FreTS model based on MLP are selected for comparative experiments. The experimental results show that the RMSE, MAE, and MAPE loss function values obtained by the model of this method on the test set are all lower than those of the comparative models. This not only indicates that this model performs excellently in converging to a stable prediction state, but also the loss function is always controlled within a small range, which fully demonstrates that this model has excellent prediction accuracy in the server load prediction task.
[0122] The parts not detailed in the above embodiments are prior art.
[0123] It should be noted that although the present invention has been described through the above embodiments, the present invention can also have many other embodiments. Without departing from the spirit and scope of the present invention, those skilled in the art can obviously make various corresponding changes and deformations to the present invention, but these changes and deformations should all fall within the scope protected by the appended claims of the present invention and their equivalents.
Claims
1. Edge server load prediction method based on multi-scale time-frequency analysis, characterized in that It includes the following steps: S1. Calculate the weights of each resource of the edge server based on data-driven and the analytic hierarchy process, and perform weighted fusion to obtain load data; S2. Build an LWMSPformer model, extract the periodic time span of the load data based on the Lomb-Scargle spectral analysis method, combine with the wavelet decomposition technology to extract the trend time span and mutation time span of the load data, and generate a candidate set of segment sizes; S3. Perform batch processing on the load data to obtain input data, perform periodic decomposition and trend decomposition on the input data, calculate the fitness of the input data with each segment size in the candidate set of segment sizes, and select the top 3 segment sizes with the highest weights as 3 scales to divide the input data into dynamic segments with consistent time spans and variable numbers of data points; S4. Perform continuous time embedding on each dynamic segment, combine the time information with the input data, generate a low-dimensional latent embedding of local features through dynamic time-aware convolution, and then input it into the Transformer encoder after adding position encoding to extract global features, obtaining fusion features containing local features and global features at each scale; S5. Weightedly aggregate the fused features of each scale through a multi-scale aggregator, and the multi-dimension feature tensor X after multi-scale aggregation final is flattened and input into a prediction layer to output the load prediction value of the edge server under a certain future time span.
2. The edge server load prediction method based on multi-scale time-frequency analysis according to claim 1, wherein: Use the optuna framework to optimize hyperparameters and select the optimal model parameters.
3. The edge server load prediction method based on multi-scale time-frequency analysis according to claim 1, characterized in that Step S1 includes the following sub-steps: Calculate the standard deviation of the server resources and the correlation coefficients between each resource to obtain the information amount of each resource; According to the information amount of each resource, construct a pairwise judgment matrix between each resource, solve the eigenvector corresponding to the maximum eigenvalue of the pairwise judgment matrix, perform normalization to obtain the weight of each resource, and perform consistency test; Sum the weights of each resource after passing the consistency test and the corresponding resource data with weights to obtain the load value of the edge server at each moment, and model the load data of the edge server.
4. The edge server load prediction method based on multi-scale time-frequency analysis according to claim 1, wherein: Step S2 includes the following sub-steps: For the irregularly sampled load data, calculate the power spectral density by fitting a multi-frequency sine / cosine wave function, screen the high-power frequencies, and infer the periodic time span; Perform wavelet decomposition on the load data using the Daubechies4 wavelet basis, calculate the time interval of the trend change through inflection point detection, and take the median as the trend time span; Set an amplitude threshold to mark the mutation interval and count the mutation time span; Integrate the periodic time span, trend time span, and mutation time span to generate a candidate set of segment sizes.
5. The edge server load prediction method based on multi-scale time-frequency analysis according to claim 1, characterized in that: In step S3, extract the frequency information of the input data based on the Lomb-Scargle spectral analysis, and screen the frequencies with relatively large power to retain the periodic components; The remaining part extracts the trend through multi-core moving average and performs weighted fusion of the trend components; Combine the periodic component, trend component, and input data, generate fusion data through linear mapping, calculate its fitness with the candidate set of segment sizes, and generate importance weights.
6. The edge server load prediction method based on multi-scale time-frequency analysis according to claim 1, characterized in that: Step S4 includes the following sub-steps: Encode the time information into a vector function, including a linear term for expressing non-periodic changes and a sine term for expressing periodic changes; Concatenate the time embedding vector of each dynamic segment with the input data to generate a segment observation value; Using a dynamic time-aware convolutional network, adaptively generate filter parameters that match the amount of data using meta-filters, and perform a convolution operation on the segment observations to generate a latent embedding of the dynamic segment; Introduce a segment mask into the latent embedding to obtain a low-dimensional latent embedding that retains cross-time semantic information; Based on the low-dimensional latent embedding, after adding positional encoding, the input embedding of the Transformer encoder obtained is transformed into a query matrix, a key matrix, and a value matrix through a linear layer, and then input into the multi-head attention module to capture the relationships between different dynamic segments.
7. The edge server load prediction method based on multi-scale time-frequency analysis according to claim 1, characterized in that: The resources of the server include the values of CPU utilization, memory utilization, the number of incoming network packets, the number of outgoing network packets, and disk space utilization.
8. A system for implementing the edge server load prediction method based on multi-scale time-frequency analysis according to claim 1, characterized in that, Including: Load data modeling module: used to calculate the load data of the edge server through data-driven and analytic hierarchy process; Segment candidate set generator: used to analyze the load data to generate a segment size candidate set; Multi-scale feature fusion module: used to obtain dynamic segments of multiple scales according to the input data and the segment size candidate set, obtain local features within each dynamic segment and global features between dynamic segments at each scale, and aggregate local features and global features of multiple scales to obtain a multi-dimensional feature tensor; Flattening and prediction module: used to output the load prediction value of the edge server under a certain future time span according to the multi-dimensional feature tensor.