Resource prediction method and device based on NeuralProphet, and storage medium

Through the resource prediction method based on NeuralProphet and combined with the CNN-LSTM-Attention model, the accuracy problem of container cloud resource utilization prediction is solved, the robustness and prediction performance of the model are improved, and the parameter adjustment process is simplified.

CN120066678APending Publication Date: 2025-05-30GUILIN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510125578.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-27
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

How to accurately predict the utilization rate of container cloud resources, improve the utilization rate of server resources, reduce resource consumption, and ensure service quality.

Method used

The resource prediction method based on NeuralProphet is adopted to obtain container cloud historical load data, perform data preprocessing and decomposition, and use the CNN-LSTM-Attention model to predict, evaluate and output error evaluation results.

Benefits of technology

It improves the interpretability of container cloud historical load data and the robustness of the model, reduces the impact of noise and outliers on the prediction results, simplifies the user's parameter adjustment process, and achieves more accurate resource utilization prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066678A_ABST
    Figure CN120066678A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing, in particular to a resource prediction method and device based on NeuralProphet, and a storage medium. Comprising the steps that container cloud historical load data are decomposed through a NeuralProphet model to obtain multiple decomposition components, the multiple decomposition components and the container cloud historical load data are integrated to form new time sequence data, compared with a traditional time sequence decomposition method, the interpretability of the container cloud historical load data is improved, and the time sequence decomposition efficiency is improved. And non-stationary components of the container cloud historical load data are removed, so that the container cloud historical load data are more suitable for modeling and prediction. The obtained new time sequence data is combined with the CNN-LSTM-Attention model, the features of the new time sequence data are analyzed from multiple dimensions, non-linear, multi-periodic and complex modes in the new time sequence data are effectively dealt with, meanwhile, by adjusting contribution of each decomposition component, the robustness and prediction performance of the model are further improved, and the prediction efficiency is improved. The influence of noise and abnormal values on the prediction result is reduced, and the user parameter adjustment process is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud computing, and particularly to a resource prediction method, device, and storage medium based on NeuralProphet. Background Art

[0002] In today's world, various application programs emerge in an endless stream, complex business environments are common, and maintenance costs remain high. Therefore, cloud computing has emerged and developed vigorously. As a technology for allocating computing resources on demand, it has become the main support method for Internet applications and has received extensive attention for its flexible resource management, high scalability, and economy.

[0003] With the development of computers and the increase in computer users, the data and information to be processed have grown exponentially, and the consumption of server resources is too high. As an emerging technology in cloud computing technology, containerization technology has also developed rapidly, but container cloud resources face the problem of how to efficiently manage and optimize resource utilization. Resource requirements are highly dynamic and uncertain. If the resource utilization rate can be predicted and resource management and allocation can be carried out in advance, the resource consumption can be effectively reduced, the resource utilization rate of the server can be improved, and the service quality can be guaranteed. Therefore, how to accurately predict historical load data is crucial for container cloud resource configuration. Summary of the Invention

[0004] To solve the above technical problems, the present invention provides a resource prediction method, device, and storage medium based on NeuralProphet.

[0005] To achieve the above object, the present invention provides a resource prediction method based on NeuralProphet, including:

[0006] Obtain container cloud historical load data and process it to obtain first time series data;

[0007] Perform data preprocessing on the first time series data to obtain second time series data;

[0008] Perform prediction decomposition on the second time series data based on the NeuralProphet model to obtain multiple decomposition components;

[0009] Integrate and integrate the multiple decomposition components with the container cloud historical load data to obtain new time series data;

[0010] Build a CNN-LSTM-Attention model, input the new time series data into the CNN-LSTM-Attention model to divide the data set, train the CNN-LSTM-Attention model based on the divided data set, use the CNN model and the LSTM model to output corresponding multi-dimensional vectors, and obtain the output vector of the CNN-LSTM-Attention model according to the attention weights;

[0011] Predict the usage rate of container cloud load data at the current moment based on the output vector of the trained CNN-LSTM-Attention model, and evaluate and output the error evaluation result.

[0012] Optionally, the steps of obtaining the second time series data by data preprocessing include:

[0013] Obtain the first time series data, check the first time series data and fill in the missing data values to obtain complete first time series data;

[0014] Normalize the complete first time series data to obtain convergent first time series data;

[0015] Aggregate the convergent first time series data using the sliding window method to obtain the second time series data.

[0016] Optionally, the multiple decomposition components include: one or several of a trend term, a seasonal term, a holiday module, a future regression module, an autoregressive module, and a lag regression module.

[0017] Optionally, the steps of performing predictive decomposition on the second time series data to obtain multiple decomposition components include:

[0018] Convert the format of the second time series data to form a timestamp column and a target value column;

[0019] Import the timestamp column and the target value column formed by format conversion into the NeuralProphet model, and initialize the NeuralProphet model;

[0020] Model the trend term, add a polynomial function form to represent the non-linear relationship in the time series;

[0021] Model the seasonal term, model it through Fourier series to capture the periodic fluctuations in the time series;

[0022] Input the timestamp column and target value column formed by converting the second time series data format into the modeled NeuralProphet model, and search for the best hyperparameter combination of the model through Bayesian optimization;

[0023] Train the NeuralProphet model using the hyperparameter combination;

[0024] Based on the trained NeuralProphet model, perform fitting prediction on the cloud resource time series data, and output the decomposition components of each module. The Neural Prophet decomposition result is:

[0025]

[0026] A(t) = AR-Net(y(t - 1), y(t - 2), …, y(t - p))

[0027]

[0028] where t is the time point, T(t) is the trend term, α 0 is the initial growth rate, β 0 is the offset, is the change point; S(t) is the seasonal term, N f is the order of the Fourier series, n f is the order, P is the seasonal period, a n and b n are the Fourier coefficients; E(t) is the holiday module; F(t) is the future regression module; A(t) is the autoregressive module, AR-Net is the autoregressive feedforward neural network, y(t - p) is the true value, p is the lag order; L(t) is the lag regression module.

[0029] Optionally, the steps of integrating and combining multiple said decomposition components with the container cloud historical load data to obtain new time series data include:

[0030] Extract the trend term, seasonal term, and autoregression in the decomposition components; integrate multiple said decomposition components with the container cloud historical load data, and merge multiple said decomposition components with the container cloud historical load data at the same time node to form a new composite time series data. The new composite time series data Y(t) is: Y(t) = αT(t) + βS(t) + γA(t) + δR(t), where α, β, γ, δ are all weight coefficients, T(t) is the trend term, S(t) is the seasonal term, A(t) is the autoregression, R(t) is the container cloud historical load data, and Y(t) is the new composite time series data;

[0031] Initial weight setting, adjusting the weight coefficient through a dynamic programming optimization algorithm to obtain composite time series data. The calculation formula for dynamically adjusting the weight coefficient is as follows:

[0032]

[0033] where N is the total number of data, t i is the i-th time point, Y pred is the predicted value, and Y true is the true value;

[0034] After normalizing the composite time series data, divide the composite time series data into a training set and a test set, and finally obtain new time series data.

[0035] Optionally, the steps to obtain the output vector of the CNN-LSTM-Attention model include:

[0036] Construct a two-layer convolutional neural network model and add a max-pooling layer after each convolutional layer. Input the new time series data into the two-layer CNN model for CNN model feature extraction, and output it to the two-layer long short-term memory network model. Among them, the first convolutional layer of the two-layer CNN model is:

[0037] Conv1(Y(t), filters = 16, kernel size = 3),

[0038] The second convolutional layer is:

[0039] Conv1(Conv1_output, filters = 32, kernel size = 3);

[0040] where Conv1 represents a one-dimensional convolutional operation, filters is the convolutional kernel, and kernel size is the convolutional kernel size;

[0041] Construct a two-layer long short-term memory network model. Input the extracted CNN model features into the two-layer LSTM model, learn and capture the long-term dependencies in the new time series data based on the two-layer LSTM model, and output the LSTM feature representation to the attention layer;

[0042] Construct an attention layer. Input the LSTM feature representation into the attention layer and calculate the attention weights of the LSTM feature representation. The calculation formula for the attention weights is:

[0043]

[0044] where, is the attention score between the current time t and time k, v T is the weight vector, ω q and ω k are the weight matrices, the attention weights

[0045] The output vector of the CNN-LSTM-Attention model is obtained by weighted summation, and the formula for calculating the output vector is: where ω c is the weight matrix, is the output vector, h is the hidden state, h k is the hidden state at the k-th time step, h t is the hidden state at time point t.

[0046] Optionally, the error evaluation result uses the coefficient of determination, root mean square error, and mean absolute percentage error to evaluate the accuracy of the prediction result, and the evaluation formula is:

[0047] where R 2 is the coefficient of determination, RMSE is the root mean square error, MAE is the mean absolute percentage error, Y i is the actual value at the i-th time, is the predicted value at the i-th time, and N is the total number of data.

[0048] The present invention also provides a container cloud resource prediction device based on the NeuralProphet model, including:

[0049] An acquisition module, which acquires container cloud historical load data and processes it to obtain first time series data;

[0050] A data preprocessing module, which preprocesses the first time series data to obtain second time series data;

[0051] A decomposition module, which performs prediction decomposition on the second time series data based on the NeuralProphet model to obtain multiple decomposition components;

[0052] An integration module, which integrates and integrates multiple decomposition components with the container cloud historical load data to obtain new time series data;

[0053] An output module, which constructs a CNN-LSTM-Attention model, inputs the new time series data into the CNN-LSTM-Attention model, and obtains the output vector of the CNN-LSTM-Attention model;

[0054] A prediction module predicts the usage rate of container cloud load data at the current moment, evaluates and outputs an error evaluation result.

[0055] The present invention also provides a computing device, which includes: at least one processor, a memory, and an input / output unit; wherein, the memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the method as described above.

[0056] The present invention also provides a computer-readable storage medium, which includes instructions that, when running on a computer, cause the computer to execute the method as described above.

[0057] In summary, the advantages and beneficial effects of the present invention are as follows:

[0058] The present invention provides a resource prediction method, device, and storage medium based on NeuralProphet. The resource prediction method based on NeuralProphet includes: obtaining container cloud historical load data and processing it to obtain first time series data; data preprocessing, performing data preprocessing on the first time series data to obtain second time series data; performing prediction decomposition on the second time series data based on the NeuralProphet model to obtain multiple decomposition components; integrating and integrating the multiple decomposition components with the container cloud historical load data to obtain new time series data; constructing a CNN-LSTM-Attention model, inputting the new time series data into the CNN-LSTM-Attention model to obtain an output vector of the CNN-LSTM-Attention model; predicting the usage rate of container cloud load data at the current moment, evaluating and outputting an error evaluation result.

[0059] In the present invention, the container cloud historical load data is decomposed by the NeuralProphet model to obtain multiple decomposition components, and the multiple decomposition components are then integrated and integrated with the container cloud historical load data to form the new time series data. Compared with traditional time series decomposition methods, it not only improves the interpretability of the container cloud historical load data, but also makes the container cloud historical load data more suitable for modeling and prediction by removing the non-stationary components of the container cloud historical load data. Combining the obtained new time series data with the CNN-LSTM-Attention model to analyze the characteristics of the new time series data from multiple dimensions, effectively coping with the non-linearity, multi-periodicity, and complex patterns in the new time series data. At the same time, the automated weight optimization mechanism ensures that the contributions of each decomposition component in the integration are dynamically adjusted, further improving the robustness and prediction performance of the CNN-LSTM-Attention model, reducing the influence of noise and outliers on the prediction results, and simplifying the user's parameter tuning process. Brief Description of the Drawings

[0060] Figure 1 The figure shows a schematic flowchart of a resource prediction method based on NeuralProphet provided by an embodiment of the present invention;

[0061] Figure 2 The figure shows a schematic flowchart of training a NeuralProphet model using a hyperparameter combination of a resource prediction method based on NeuralProphet provided by an embodiment of the present invention. Detailed Description of the Embodiments

[0062] For the convenience of understanding by those skilled in the art, the present invention will be further described in detail below with reference to specific embodiments.

[0063] The present invention provides a resource prediction method, device, and storage medium based on NeuralProphet, as Figure 1 shown, including:

[0064] Step S10: Obtain container cloud historical load data and process it to obtain first time series data;

[0065] Step S20: Perform data preprocessing on the first time series data to obtain second time series data;

[0066] Step S30: Perform predictive decomposition on the second time series data based on the NeuralProphet model to obtain multiple decomposition components;

[0067] Step S40: Integrate and combine the multiple decomposition components with the container cloud historical load data to obtain new time series data;

[0068] Step S50: Construct a CNN-LSTM-Attention model, input the new time series data into the CNN-LSTM-Attention model to divide the data set, train the CNN-LSTM-Attention model based on the divided data set, output corresponding multi-dimensional vectors using the CNN model and the LSTM model, and obtain the output vector of the CNN-LSTM-Attention model according to the attention weights;

[0069] Step S60: Predict the usage rate of the container cloud load data at the current moment based on the output vector of the trained CNN-LSTM-Attention model, and evaluate and output an error evaluation result.

[0070] Specifically, execute step S10 to obtain container cloud historical load data and process it to obtain first time series data.

[0071] After the container cloud platform is deployed, use the monitoring system to monitor and obtain the historical load data of the container cloud. Based on the historical load data of the container cloud, understand the performance and resource usage of the container cloud at different time periods.

[0072] In an embodiment of the present invention, the historical load data of the container cloud is the CPU utilization rate.

[0073] In other embodiments, the historical load data of the container cloud is the memory usage, storage usage, response time, or other suitable historical load data of the container cloud.

[0074] In an embodiment of the present invention, the monitoring system uses Grafana for real-time monitoring and collecting the load data of the container cloud.

[0075] In other embodiments, the monitoring tool uses the Kubernetes API, Prometheus, or other suitable monitoring systems to collect the historical load data of the collector cloud.

[0076] In an embodiment of the present invention, the steps of obtaining the historical load data of the container cloud and processing it to obtain the first time series data include:

[0077] Step S11, use the monitoring system and set the data collection frequency for the monitoring system, obtain the historical load data of the container cloud, and store the obtained historical load data of the container cloud.

[0078] In an embodiment of the present invention, the data collection frequency of the monitoring system is set to obtain the historical load data of the container cloud every ten seconds.

[0079] In other embodiments, the time interval for the monitoring system to obtain the historical load data of the container cloud is greater than ten seconds or less than ten seconds, and it is specifically adjusted according to the actual situation.

[0080] When the time interval for the monitoring system to obtain the historical load data of the container cloud once is less than ten seconds, the resolution of the obtained historical load data of the container cloud is higher than the resolution of the set ten-second time interval.

[0081] In an embodiment of the present invention, the obtained historical load data of the container cloud is stored in a built-in database or a time series database for subsequent analysis and backtracking. The time series databases include Prometheus and InfluxDB.

[0082] Step S12, create a recording rule, pre-calculate the historical load data of the container cloud, and generate the first time series data.

[0083] Create a recording rule to pre-compute the historical load data of the container cloud and save the pre-computed result as new time series data, i.e., the first time series data, which facilitates direct use of the pre-computed result during subsequent queries without the need for re-computation each time, thereby improving the query efficiency.

[0084] The recording rule is to summarize or sample the time series data stored within a specific number of arbitrary times over a past period at regular intervals.

[0085] In an embodiment of the present invention, the recording rule is to summarize the average CPU utilization rate over the past ten minutes every five minutes.

[0086] Execute step S20 to preprocess the first time series data to obtain the second time series data.

[0087] Through the data preprocessing, missing values and outliers in the first time series data are processed; the first time series data is normalized or standardized to scale the first time series data to a specific range of (0, 1), eliminating the scale differences between different features, accelerating the convergence rate of the first time series data, and improving the accuracy of the model; the first time series data at each time step is aggregated to reduce the short-term fluctuations in the first time series data, making the obtained second time series data curve smoother and better reflecting the overall trend of the historical load data of the container cloud.

[0088] In an embodiment of the present invention, preprocessing the first time series data includes one or several of filling in missing values, normalization processing, and processing time series data using the sliding window method, making the obtained second time series data curve smoother and better reflecting the overall trend of the data.

[0089] In an embodiment of the present invention, the steps of preprocessing the first time series data include:

[0090] Step S21, filling in missing values; obtaining the first time series data, checking the first time series data and filling in the missing data values to obtain complete first time series data.

[0091] In an embodiment of the present invention, linear spline interpolation is used to fill in the missing values in the first time series data to avoid data missing at some time points in the first time series data caused by machine or human factors. Among them, the linear spline interpolation calculation formula is:

[0092] Where x i ≤x≤x i+1 ;

[0093] Among them, S i (x) is a linear spline interpolation function, and the S i (x) in the interval [x i , x i+1 , x is the interval interpolation point, x i and x i+1 are the time indices of known data points, y i and y i+1 are the numerical values of known points on both sides of the interpolation point x, and i is a natural number not equal to 0.

[0094] Step S22, normalization processing; obtain the complete first time series data, and perform normalization processing on the complete first time series data to obtain convergent first time series data;

[0095] In the embodiment of the present invention, the complete first time series data after filling in the missing values is normalized by z-score standardization, and the complete first time series data is scaled to a specific range of (0, 1) to eliminate the scale difference between different features, accelerate the convergence speed, and improve the accuracy of the model. The z-score standardization calculation formula is:

[0096]

[0097] Among them, x i is the i-th data point, is the data mean value,

[0098] is the standard deviation, and i is a natural number not equal to 0.

[0099] Step S23, process the time series data by the sliding window method; obtain the convergent first time series data, and aggregate the convergent first time series data by the sliding window method to obtain the second time series data.

[0100] The sliding window method aggregates the convergent first time series data by using a window with a fixed size, reduces the short-term fluctuations in the convergent first time series data, makes the curve of the obtained second time series data smoother, and better reflects the overall trend of the time series data.

[0101] The time series data is X w = {x 1 , x i , …, x T}, w is the window size, then the input feature matrix and the output label vector can be expressed as:

[0102]

[0103] Among them, X w is the input feature matrix, x 1 , x i , x T , x w are all sequence values, and Y w is the output label vector.

[0104] Execute step S30 to perform predictive decomposition on the second time series data based on the NeuralProphet model to obtain multiple decomposition components.

[0105] In the embodiment of the present invention, the step of performing predictive decomposition on the second time series data based on the NeuralProphet model to obtain multiple decomposition components includes:

[0106] Step S31, data preparation; convert the format of the second time series data to form a timestamp ds column and a target value y column.

[0107] Convert the format of the second time series data to meet the input format requirements of the NeuralProphet model.

[0108] Step S32, model initialization; import the timestamp ds column and the target value y column formed by the format conversion into the NeuralProphet model and initialize the NeuralProphet model.

[0109] Step S33, trend term modeling; add a polynomial function form to represent the non-linear relationship in the time series.

[0110] The historical load data of the container cloud has complex and diverse non-linear changes. Through trend term modeling, on the basis of the original piecewise linear trend, adding a polynomial function form to represent the non-linear relationship in the time series can capture more flexible and diverse trend patterns.

[0111] In the embodiment of the present invention, the formula for the trend term modeling is:

[0112]

[0113] T(t) = T L (t) + T N (t).

[0114] Among them, t is the time point, T L (t) is the linear trend term, and T N (t) is the non-linear trend term, is the feature vector, ∈ 0 and ε 1 are the error terms, and α0 , α 1 are both bias terms.

[0115] Step S34, seasonal term modeling; modeling through Fourier series to capture the periodic fluctuations in the time series.

[0116] The Fourier series decomposes the second time series data into a series of sine and cosine functions to represent periodic fluctuations of different frequencies. The formula for seasonal term modeling is:

[0117]

[0118] where P is the period length, N f is the order of the Fourier terms, a n and b n are the Fourier coefficients, t is the time point, and n f is the order.

[0119] In the embodiments of the present invention, the trend term represents the long-term trend in the time series, and the seasonal term represents the periodic fluctuations in the time series. Steps S33 and S34 are not in a specific order and can be swapped according to actual needs.

[0120] Step S35, hyperparameter optimization; input the timestamp (ds) column and the target value (y) column formed by converting the format of the second time series data into the NeuralProphet model after modeling, and search for the best combination of hyperparameters of the model through Bayesian optimization.

[0121] Step S36, NeuralProphet model training; use the combination of hyperparameters to train the NeuralProphet model.

[0122] In the embodiments of the present invention, as Figure 2 shown, the step of using the combination of hyperparameters to train the NeuralProphet model includes:

[0123] Step S361, initialize parameters, and randomly generate a set of initial parameters x;

[0124] Step S362, define the objective function f(x);

[0125] Step S363, based on the defined objective function f(x), calculate the objective function value of each parameter x;

[0126] Step S364, set the interval threshold, and based on the set interval threshold and the objective function value, divide the parameters into a low-loss interval and a high-loss interval, where the low-loss interval contains the parameters with lower objective function values, and the high-loss interval contains the parameters with higher objective function values;

[0127] Step S365: Set the sampling ratios for the low-loss interval and the high-loss interval, and conduct a new round of sampling.

[0128] Step S366: Update the model, update the newly sampled parameters into the NeuralProphet model, and repeat the above steps until the preset number of iterations is reached or the optimal solution is found, thus completing the training of the NeuralProphet model.

[0129] In the embodiment of the present invention, the sampling ratio of the low-loss interval is greater than that of the high-loss interval to accelerate convergence.

[0130] Specifically, the steps of training the NeuralProphet model using the hyperparameter combination include:

[0131] Initialize parameters: Generate 100 initial parameters x, and the value range of the initial parameter x is [-10, 10].

[0132] Calculate the objective function value: Calculate the objective function value f(x) for each parameter x.

[0133] Construct the low-loss interval and the high-loss interval: Set the median as the threshold for constructing the low-loss interval and the high-loss interval, and construct the low-loss interval and the high-loss interval based on the median and the objective function value. The low-loss interval contains the parameters with objective function values much lower than the median, and the high-loss interval contains the parameters with objective function values higher than the median.

[0134] Conduct a new round of sampling to obtain newly sampled parameters. Set 80% of the new samples to come from the low-loss interval and 20% of the new samples to come from the high-loss interval.

[0135] Update the model, update the newly sampled parameters into the NeuralProphet model, and repeat the above steps until 100 iterations are reached or the optimal solution is found, thus completing the training of the NeuralProphet model.

[0136] Step S37: Fitting prediction; Based on the trained NeuralProphet model, perform fitting prediction on the second time series data, and output the decomposed components of each module of the NeuralProphet model. The multiple decomposed components of the Neural Prophet are:

[0137]

[0138] A(t) = AR-Net(y(t - 1), y(t - 2), …, y(t - p))

[0139] where t is the time point, T(t) is the trend term, α 0 is the initial growth rate, β 0 is the offset, is the change point of the function transpose; S(t) is the seasonal term, N f is the order of the Fourier series, P is the seasonal period, n f is the order, a n and b n are the Fourier coefficients; E(t) is the holiday module; F(t) is the future regression module; A(t) is the autoregressive module, AR-Net is the autoregressive feedforward neural network, y(t-p) is the true value, p is the lag order; L(t) is the lag regression module.

[0140] The NeuralProphet model can effectively perform predictive decomposition on the container cloud resource time series data, capture trends, seasonality, and other periodic changes, thereby providing more accurate prediction results.

[0141] Execute step S40, integrate multiple said decomposition components with the container cloud historical load data to obtain new time series data.

[0142] Extract multiple decomposition components, merge multiple decomposition components with the container cloud historical load data at the same time node to form a multi-variable, multi-feature composite time series data set; after normalization, divide the data set to obtain new time series data; design a neural network model based on the new time series data to extract features of local patterns and long-term and short-term dependencies in the new time series data, and finally predict the usage rate of container cloud load data at future moments;

[0143] In the embodiment of the present invention, the step of integrating multiple said decomposition components with the container cloud historical load data includes:

[0144] Step S41, combine multiple decomposition components with the container cloud historical load data;

[0145] Specifically, in step S411, extract the trend term T(t), seasonal term S(t), and autoregression A(t) in the decomposition components;

[0146] In the embodiment of the present invention, taking the trend term T(t), seasonal term S(t), and autoregression A(t) as examples, model the data.

[0147] Step S412, integrate multiple said decomposition components with the container cloud historical load data, merge multiple said decomposition components with the container cloud historical load data R(t) at the same time node to form a new composite time series data Y(t), and the new composite time series data Y(t) is:

[0148] Y(t) = αT(t) + βS(t) + γA(t) + δR(t)

[0149] Among them, α, β, γ, and δ are all weight coefficients.

[0150] This application integrates the decomposed trend term T(t), seasonal term S(t), autoregression A(t) with the original time series R(t), so that the characteristics of multiple decomposed components are amplified and fused. This integration can not only better capture the non-linear relationship in the original data and the composite time series Y(t) after complex integration, but also improve the data expression ability and the stability and robustness of the model.

[0151] Step S42, dynamically adjust the weight coefficients to obtain composite time series data;

[0152] Specifically, in step S421, initial weight setting, the weight coefficients of all multiple decomposed components are set to 1, and multiple decomposed components have the same importance.

[0153] Step S422, dynamic adjustment of weight coefficients, adjust the weight coefficients through the dynamic programming optimization algorithm to obtain composite time series data, optimize the accuracy of model prediction, improve the generalization ability, and minimize the loss function.

[0154] In the embodiment of the present invention, the calculation formula for dynamically adjusting the weight coefficients is:

[0155]

[0156] Among them, N is the total number of data, t i is the i-th time point, Y pred is the predicted value, Y true is the true value.

[0157] In the embodiment of the present invention, the dynamic programming optimization algorithm includes the gradient descent method or other suitable algorithms.

[0158] By dynamically adjusting the weight coefficients, it is ensured that the contributions of each decomposed component to the composite time series are optimally allocated, avoiding the excessive influence of a single component on the overall time series data. At the same time, the complexity of the container cloud historical load data is effectively reduced, the non-stationary part in the container cloud historical load data is removed, and the stationarity of the obtained composite time series data is improved. At the same time, the dynamic weight adjustment of each decomposed component enables the NeuralProphet model to flexibly respond to the changing characteristics in the container cloud historical load data, enhancing the adaptability and robustness of the NeuralProphet model.

[0159] Step S43: After normalizing the composite time series data, divide the composite time series into a training set and a test set, and finally obtain new time series data.

[0160] Specifically, in step S431 (normalization processing), normalize the composite time series data so that the numerical range of the composite time series data is between 0 and 1.

[0161] In the embodiment of the present invention, the method for normalizing the composite time series data is MinMax scaling or other suitable normalization methods.

[0162] Step S432 (dataset division): Divide the normalized composite time series data into a training set and a test set, and finally obtain new time series data.

[0163] In the embodiment of the present invention, the composite time series data is divided into a training set and a test set in chronological order, ensuring that the training set is in the front and the test set is in the back, so as to finally obtain new time series data for subsequent model training and evaluation.

[0164] Execute step S50: Build a CNN-LSTM-Attention model, input the new time series data into the CNN-LSTM-Attention model to divide the dataset, train the CNN-LSTM-Attention model based on the divided dataset, use the CNN model and the LSTM model to output corresponding multi-dimensional vectors, and obtain the output vector of the CNN-LSTM-Attention model according to the attention weights.

[0165] In the embodiment of the present invention, the steps for obtaining the output vector of the CNN-LSTM-Attention model include:

[0166] Step S51: Build a two-layer (16, 32) Convolutional Neural Network (CNN) model and add a MaxPooling1D layer after each convolutional layer. Input the new time series data into the two-layer CNN model for CNN model feature extraction and output it to the two-layer Long Short-Term Memory (LSTM) network model. Among them, the first convolutional layer of the two-layer CNN model is:

[0167] Conv1(Y(t), filters = 16, kernel size = 3)

[0168] The second convolutional layer is:

[0169] Conv1(Conv1_output, filters = 32, kernel size = 3).

[0170] Among them, Conv1 represents a one-dimensional convolution operation, filters is the convolution kernel, and kernel size is the convolution kernel size.

[0171] By adding a max pooling layer after each convolutional layer, the dimension is reduced, the computational amount is reduced, and at the same time, the most important features are retained; the local patterns and short-term dependencies in the new time series data are captured through the CNN features.

[0172] Step S52: Construct a long short-term memory network (LSTM) double-layer (32, 16) model, input the features of the extracted CNN model into the double-layer LSTM model, learn and capture the long-term dependencies in the time series based on the double-layer LSTM model, and output the LSTM feature representation to the attention layer.

[0173] In the embodiment of the present invention, the important historical information is better memorized and the long-term dependencies in the time series data are captured through the double-layer LSTM model, improving the expression ability and prediction accuracy of the double-layer LSTM model.

[0174] Step S53: Construct an attention layer, input the LSTM feature representation into the attention layer, and calculate the attention weights of the LSTM feature representation. Specifically, the calculation formula of the attention weights is as follows:

[0175]

[0176] Among them, is the attention score between the current time t and time k, v T is the weight vector, ω q and ω k are weight matrices; the attention weights are obtained after normalization by the Softmax function

[0177] Step S54: Obtain the output vector of the CNN-LSTM-Attention model through weighted summation. The formula for calculating the output vector is as follows:

[0178] Among them, ω c is the weight matrix, is the output vector, h is the hidden state h k is the hidden state at the k-th time step, h t is the hidden state at the current time point t.

[0179] In a neural network, the outputs of the CNN model and the LSTM model are multi-dimensional vectors. This output will be passed as input to the Attention layer to calculate the attention weights and the output vector after weighted summation, reducing the computational amount while also being able to extract the most critical features from a large amount of information, effectively solving the bottleneck problem in the processing of long sequence information by suppressing redundant information.

[0180] Execute step S60, predict the usage rate of container cloud load data at the current moment based on the output vector of the trained CNN-LSTM-Attention model, and evaluate and output the error evaluation result.

[0181] Step S61, use the trained CNN-LSTM-Attention model to input the container cloud historical load data to predict the usage rate of cloud containers at the current moment or future moments;

[0182] Specifically, in step S611, data preparation, obtain the container cloud historical load data;

[0183] Step S612, model inference, input the container cloud historical load data into the trained CNN-LSTM-Attention model for forward propagation to obtain the prediction result;

[0184] Step S613, output the prediction result, and the CNN-LSTM-Attention model outputs the usage rate of cloud resources at future moments.

[0185] Step S62, use the coefficient of determination R 2 , root mean square error RMSE, and mean absolute percentage error MAE to evaluate the accuracy of the prediction result. The evaluation formula is:

[0186]

[0187] Among them, R 2 is the coefficient of determination, RMSE is the root mean square error, MAE is the mean absolute percentage error, Y i is the actual value at the i-th moment, is the predicted value at the i-th moment, and n is the total number of data.

[0188] In this implementation case, the historical container cloud load data from Alibaba Cluster Data V2018 is used as the CPU utilization rate. At a 1-minute time interval, using the LSTM model, CNN-LSTM model, CNN-LSTM-Attention model, Neural Prophet, and the NeuralProphet-CNN-LSTM-Attention model provided by the present invention, the prediction results of the historical container cloud load data (i.e., CPU utilization rate) are obtained, as shown in Table 1. The coefficient of determination R 2 , the root mean square error RMSE, and the mean absolute error MAE are used as evaluation indicators. The coefficient of determination R 2 in the NeuralProphet-CNN-LSTM-Attention model provided by the present invention is close to 1, indicating that the fitting effect of the NeuralProphet-CNN-LSTM-Attention model is good. The root mean square error RMSE and the mean absolute error MAE are small, indicating that the difference between the predicted value and the actual value is small. Therefore, the NeuralProphet-CNN-LSTM-Attention model provided by the present invention can accurately predict the cloud platform resources.

[0189]

[0190]

[0191] Table 1

[0192] The embodiment of the present invention also provides a container cloud resource prediction device based on the NeuralProphet model, including:

[0193] An acquisition module that acquires the historical container cloud load data and processes it to obtain the first time series data;

[0194] A data preprocessing module that preprocesses the first time series data to obtain the second time series data;

[0195] A decomposition module that performs prediction decomposition on the second time series data based on the NeuralProphet model to obtain multiple decomposition components;

[0196] An integration module that integrates and integrates the multiple decomposition components with the historical container cloud load data to obtain new time series data;

[0197] An output module constructs a CNN-LSTM-Attention model, inputs the new time series data into the CNN-LSTM-Attention model to divide the data set, trains the CNN-LSTM-Attention model based on the divided data set, and obtains the output vector of the CNN-LSTM-Attention model.

[0198] A prediction module predicts the usage rate of container cloud load data at the current moment based on the output vector of the trained CNN-LSTM-Attention model and outputs an error evaluation result.

[0199] An embodiment of the present invention further provides a computing device, which includes at least one processor, a memory, and an input / output unit; wherein, the memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the method as described above.

[0200] An embodiment of the present invention further provides a computer-readable storage medium, which includes instructions that, when running on a computer, cause the computer to execute the method as described above.

[0201] Finally, it should be noted that any modification or equivalent replacement of some or all of the technical features carried out by relying on the device structure of the present invention and the technical solutions of the embodiments, as long as the essence does not deviate from the corresponding technical solutions of the present invention, falls within the patent scope of the device structure of the present invention and the embodiments.

Claims

1. A resource prediction method based on NeuralProphet, characterized in that: include: Obtain historical load data of the container cloud and process it to obtain first time series data; Performing data preprocessing on the first time series data to obtain second time series data; Performing predictive decomposition on the second time series data based on the NeuralProphet model to obtain multiple decomposition components; Integrate the plurality of decomposed components with the container cloud historical load data to obtain new time series data; Construct a CNN-LSTM-Attention model, input the new time series data into the CNN-LSTM-Attention model to divide the data set, train the CNN-LSTM-Attention model based on the divided data set, use the CNN model and the LSTM model to output the corresponding multidimensional vector, and obtain the output vector of the CNN-LSTM-Attention model according to the attention weight; The output vector of the trained CNN-LSTM-Attention model is used to predict the current container cloud load data usage rate, and the error evaluation result is evaluated and output.

2. A resource prediction method based on NeuralProphet as claimed in claim 1, characterized in that: The step of preprocessing the data to obtain the second time series data comprises: Acquire the first time series data, check the first time series data and fill in missing data values ​​to obtain complete first time series data; Normalizing the complete first time series data to obtain converged first time series data; The converged first time series data is aggregated using a sliding window method to obtain second time series data.

3. A resource prediction method based on NeuralProphet as claimed in claim 1, characterized in that: The multiple decomposition components include: one or more of: trend items, seasonal items, holiday modules, future regression modules, autoregression modules, and lagged regression modules.

4. A resource prediction method based on NeuralProphet as claimed in claim 1, characterized in that: The step of performing forecast decomposition on the second time series data to obtain a plurality of decomposition components comprises: Convert the second time series data into a timestamp column and a target value column; Import the timestamp column and the target value column into the NeuralProphet model after format conversion, and initialize the NeuralProphet model; Trend term modeling, adding polynomial function form to represent nonlinear relationships in time series; Seasonal term modeling, through Fourier series modeling, captures the periodic fluctuations in time series; Input the timestamp column and target value column converted from the second time series data format into the modeled NeuralProphet model, and search for the best hyperparameter combination of the model by Bayesian optimization; Use hyperparameter combinations to train NeuralProphet models; Based on the trained NeuralProphet model, the cloud resource time series data is fitted and predicted, and the decomposed components of each module are output. The Neural Prophet decomposition result is: A(t)=AR-Net(y(t-1),y(t-2),…,y(tp)) Among them, t is the time point, T(t) is the trend term, α0 is the initial growth rate, β0 is the offset, is the changing point of the function transposition; S(t) is the seasonal term, N f is the order of the Fourier series, P is the seasonal period, n f is the order, a n and b n is the Fourier coefficient; E(t) is the holiday module; F(t) is the future regression module; A(t) is the autoregressive module, AR-Net is the autoregressive feedforward neural network, y(tp) is the true value, p is the lag order; L(t) is the lag regression module.

5. A resource prediction method based on NeuralProphet as claimed in claim 3, characterized in that: The step of integrating the decomposed components with the container cloud historical load data to obtain new time series data includes: Extract the trend term, seasonal term and autoregression in the decomposed components; integrate the trend term, seasonal term and autoregression with the historical load data of the container cloud, merge multiple decomposed components with the historical load data of the container cloud at the same time node, and form a new composite time series data, wherein the new composite time series data Y(t) is: Y(t) = αT(t) + βS(t) + γA(t) + δR(t), wherein α, β, γ, δ are all weight coefficients, T(t) is the trend term, S(t) is the seasonal term, A(t) is the autoregression, R(t) is the historical load data of the container cloud, and Y(t) is the new composite time series data; Initial weight setting, adjusting weight coefficients through dynamic programming optimization algorithm, obtaining composite time series data, the calculation formula of the dynamically adjusted weight coefficients is: Where N is the total number of data, t i is the i-th time point, Y pred is the predicted value, Y true is the true value; After the composite time series data is normalized, the composite time series data is divided into a training set and a test set, and finally new time series data is obtained.

6. A resource prediction method based on NeuralProphet as claimed in claim 1, characterized in that: The steps of obtaining the output vector of the CNN-LSTM-Attention model include: Construct a convolutional neural network double-layer model and add a maximum pooling layer after each convolution layer, input the new time series data into the double-layer CNN model to extract the CNN model features, and output it to the long short-term memory network double-layer model, wherein the first convolution layer of the double-layer CNN model is: Conv1(Y(t),filters=16,kernel size =3), The second convolutional layer is: Conv1(Conv1_output,filters=32,kernel size =3); Among them, Conv1 represents a one-dimensional convolution operation, filters is the convolution kernel, kernel size is the convolution kernel size; Constructing a long short-term memory network double-layer model, inputting the extracted CNN model features into a double-layer LSTM model, learning and capturing the long-term dependencies in the new time series data based on the double-layer LSTM model, and outputting the LSTM feature representation to the attention layer; Construct an attention layer, input the LSTM feature representation into the attention layer, and calculate the attention weight of the LSTM feature representation. The calculation formula of the attention weight is: in, is the attention score between the current time t and time k, v T is the weight vector, ω q and ω k is the weight matrix, attention weight The output vector of the CNN-LSTM-Attention model is obtained by weighted summation. The formula for calculating the output vector is: Among them, ω c is the weight matrix, is the output vector, h is the hidden state h k is the hidden state of the kth time step, h t is the hidden state at the current time point t.

7. A resource prediction method based on NeuralProphet as claimed in claim 1, characterized in that: The error evaluation results use the determination coefficient, root mean square error and mean absolute percentage error to evaluate the accuracy of the prediction results. The evaluation formula is: Among them, R 2 is the coefficient of determination, RMSE is the root mean square error, MAE is the mean absolute percentage error, Y i is the actual value at the ith moment, is the predicted value at the i-th moment, and N is the total number of data.

8. A container cloud resource prediction device based on NeuralProphet model, characterized in that: include: An acquisition module obtains historical load data of the container cloud and processes it to obtain first time series data; A data preprocessing module performs data preprocessing on the first time series data to obtain second time series data; A decomposition module, which performs predictive decomposition on the second time series data based on a NeuralProphet model to obtain a plurality of decomposition components; An integration module integrates the plurality of decomposed components with the historical load data of the container cloud to obtain new time series data; The output module constructs a CNN-LSTM-Attention model, inputs the new time series data into the CNN-LSTM-Attention model, and obtains an output vector of the CNN-LSTM-Attention model; The prediction module predicts the current container cloud load data usage rate, evaluates and outputs the error evaluation results.

9. A computing device, comprising: At least one processor, a memory and an input-output unit; wherein the memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium comprising instructions, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Server resource allocation method and device, storage medium and electronic equipment

    CN120407197A

  • Time sequence set prediction method and system and storage medium

    CN120849827A