PSO-IWOA-DLSTM-based edge server energy consumption prediction method
By combining PSO, IWOA and DLSTM to optimize the edge server energy consumption prediction model and using wavelet transform for feature extraction, the problem of low prediction accuracy of edge server energy consumption in the prior art is solved, and high-accuracy energy consumption prediction is achieved.
Patent Information
- Application Number
- CN202510085746.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-13
AI Technical Summary
When predicting the energy consumption time series data of edge servers, the prior art is prone to fall into local optimal solution and slow convergence speed, resulting in the prediction accuracy and performance not reaching the ideal state.
Using methods based on particle swarm algorithm (PSO), improved whale optimization algorithm (IWOA) and deep long short-term memory neural network (DLSTM), the initial weight threshold and hyperparameters of the edge server energy consumption prediction model are optimized, and feature extraction is combined with wavelet transformation.
The robustness and prediction accuracy of the edge server energy consumption prediction model are improved, the problems of local optimal solution and slow convergence speed are overcome, and high accuracy prediction of edge server energy consumption time series data is achieved.
Smart Images

Figure CN119990188A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of energy consumption prediction, and specifically relates to an edge server energy consumption prediction method based on a particle swarm optimization algorithm (PSO), an improved whale optimization algorithm (IWOA) and a deep long short-term memory neural network (DLSTM). Background Art
[0002] In recent years, with the rapid development and iteration of 5G, Internet of Things, and cloud computing technologies, the number of Internet applications and smart devices has shown a blowout growth. Mobile edge computing, as an extended architecture of mobile cloud computing, is becoming an important part of 5G key technologies. Mobile edge computing allows us to deploy servers closer to users geographically, provide computing power close to various types of terminal devices, and sink these computing capabilities to new smart base stations to meet their large-scale near-field computing needs. While meeting basic computing processing capabilities, it can significantly reduce the transmission delay of large-scale data in the channel.
[0003] In actual applications, edge servers are deployed in a distributed manner and have a large number of them, resulting in high overall energy consumption, which not only increases operating costs, but also puts pressure on the environment, prompting all sectors to pay attention to sustainable development and energy conservation and emission reduction. Excessive energy consumption levels will also reduce server performance, increase service delays, and fail to meet the stringent requirements of mobile edge computing scenarios for low latency. In this context, edge server energy consumption prediction has become an important research topic. Accurately predicting the energy consumption level of edge servers is not only crucial to ensuring the stable and efficient operation of edge servers, but also a key support for ensuring the smoothness of intelligent interaction, timeliness of data processing, and promoting intelligent transformation in the industry. In addition, energy consumption prediction can also provide an important basis for the design, operation management, and maintenance of edge servers, helping to achieve intelligent management.
[0004] At present, there are many methods for energy consumption prediction, including statistical analysis based on historical data, machine learning algorithms, and Internet of Things technology. However, since edge server energy consumption data is periodic sequence data and has the characteristics of nonlinearity, randomness, and suddenness, the current prediction methods have limitations, such as being prone to falling into local optimal solutions and slow convergence, resulting in the prediction accuracy and performance failing to reach the ideal state.
[0005] Therefore, how to improve the parameter optimization effect of the edge server energy consumption prediction model to improve the prediction accuracy and performance of the model has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] The present invention aims to solve one of the technical problems existing in the related art at least to a certain extent.
[0007] The purpose of the present invention is to provide an edge server energy consumption prediction method based on PSO-IWOA-DLSTM to predict the changing trend of edge server energy consumption data and solve the problem that the traditional prediction method has low prediction accuracy for edge server energy consumption time series data with periodicity and large fluctuations.
[0008] In order to achieve the above-mentioned object, the present invention provides, on one hand, a method for predicting energy consumption of an edge server based on PSO-IWOA-DLSTM, comprising the steps of:
[0009] S100, collecting the original edge server energy consumption time series data, and preprocessing it to decompose it into multiple subsequences;
[0010] S200, constructing edge server energy consumption prediction models based on the DLSTM framework according to the obtained multiple subsequences;
[0011] S300, optimizing the initial weight threshold of the edge server energy consumption prediction model using the PSO algorithm;
[0012] S400, optimizing the hyper parameters of the edge server energy consumption prediction model using the IWOA algorithm;
[0013] S500: Output multiple predicted subsequences using the optimized edge server energy consumption prediction model, and reconstruct them into future edge server energy consumption data as prediction results.
[0014] A further preferred technical solution of the present invention is that step S100 specifically includes:
[0015] S110, collecting time series data of energy consumption of original edge servers;
[0016] S120, using wavelet transform to perform feature extraction on the original edge server energy consumption time series data, decomposing the original edge server energy consumption time series data into approximate components and detail components, and then decomposing the approximate components layer by layer, and finally obtaining one approximate component and several detail components, each component as a subsequence;
[0017] S130: performing data normalization processing on the subsequences obtained by decomposition.
[0018] Preferably, in step S120, the original edge server energy consumption time series data is set as one-dimensional discrete data x(n), and discrete wavelet is selected for data decomposition. The wavelet transform is expressed as:
[0019]
[0020] Where W(a,b) is the wavelet coefficient, which represents the signal component at scale a and displacement b; x(n) is the original edge server energy consumption time series data; ψ a,b (n) is the wavelet basis function.
[0021] Wavelet transform can decompose edge server energy consumption time series data into signal components at different scales, capture different characteristics of the signal, establish prediction models for components with different characteristics, and then perform wavelet reconstruction, which can effectively improve the prediction accuracy of the model. Data normalization can convert data of different scales, different units, and different ranges into a unified standard range to eliminate the dimensional differences between the data, thereby improving the convergence speed of the prediction model and enhancing the stability of the model.
[0022] Preferably, in step S130, each subsequence data is mapped to the interval [0,1] using the Min-Max normalization method, and the specific method is:
[0023] First, calculate the maximum and minimum values of the data in each subsequence, denoted as X max and X min ; Then subtract X from each data in the subsequence data min , then divided by X max -X min , complete the data normalization of the current subsequence.
[0024] Preferably, the edge server energy consumption prediction model based on the DLSTM framework constructed in step S200 includes multiple LSTM units. The LSTM unit memorizes data through the control unit of the input gate, the forget gate and the output gate. At each moment, the LSTM unit receives two kinds of external information through three gates, which are the current input state x t and the hidden state h at the previous moment t-1 , and an internal information, which is the memory cell state c at the previous moment t-1 ;
[0025] Input Gate i t After the input is processed by the nonlinear function, it is combined with the forget gate f t The processing results of the memory unit state are superimposed to obtain a new memory unit state c t ; Finally, through the calculation of nonlinear function and output gate o t The final output h of the LSTM unit is obtained by controlling t ; expressed as:
[0026] i t =σ(W xi x t+W hi h t-1 +W ci c t-1 +b i );
[0027] f t =σ(W xf x t +W hf h t-1 +W cf c t-1 +b f );
[0028] c t =f t c t-1 +i t tanh(W xc x t +W hc h t-1 +b c );
[0029] o t =σ(W xo x t +W ho h t-1 +W co c t +b o );
[0030] h t =o t tanh(c t );
[0031] Among them, W xc , W xi , W xf , W xo is the input signal x t The associated weight matrix; W hc , W hi , W hf , W ho is the hidden layer output signal h t The associated weight matrix; W ci , W cf , W co Output vector c for the connected neuron activation function t The diagonal matrix of the sum gate function; b i , b c , b f , b o is the bias vector; σ is the activation function.
[0032] DLSTM effectively captures long-term dependencies in sequence data through its gating mechanism and learns sequence features with long time intervals. At the same time, DLSTM can learn higher-level features, so that information can be transferred between different layers and can capture time dependencies at different levels; secondly, the deep structure can better analyze nonlinear relationships and adapt to complex and diverse data sets, thereby further improving the prediction accuracy of edge server energy consumption data.
[0033] Preferably, the initial weight threshold of the edge server energy consumption prediction model is optimized by using the PSO algorithm in step S300, and the specific method is:
[0034] S310, initializing parameters, including population size, maximum number of iterations, boundary of particle position, range of particle velocity and acceleration factor;
[0035] S320, population initialization, randomly generating a particle population, each particle individual represents a weight threshold combination of a DLSTM neural network;
[0036] S330, calculating the fitness value of each particle, sorting the fitness of all particles, and selecting the historical optimal position of the particle and the global optimal particle;
[0037] S340, iteration starts, each iteration uses the historical optimal position of the particle and the global optimal particle to update the speed and position of the current particle, establishes an edge server energy consumption prediction model based on the updated particle position, and calculates the fitness value of the particle based on the prediction result of the model;
[0038] S350, after reaching the maximum number of iterations or the target fitness value, the iteration is stopped, the optimal particle is decoded, and the initial weight threshold of the optimized edge server energy consumption prediction model is obtained.
[0039] The particle swarm algorithm (PSO) is used to optimize the initial weight threshold of DLSTM. Since the performance of the DLSTM neural network is greatly affected by the setting of the initial weight and threshold, the particle swarm algorithm can search the model parameter space, find a better initial parameter configuration, and improve the performance of the model. The initial parameter configuration optimized by the particle swarm algorithm can accelerate the convergence of the DLSTM model, and can learn the laws of edge server energy data more quickly within the same number of iterations, thereby improving training efficiency. At the same time, the particle swarm algorithm has the property of global search, which can help the model avoid falling into a local optimal solution.
[0040] Preferably, in step S400, the hyper parameters of the edge server energy consumption prediction model are optimized by using the IWOA algorithm; the specific method is:
[0041] S410, determining the hyperparameters to be optimized, which are the time window, the number of hidden layer nodes, and the number of hidden layer layers, and initializing the parameters, including the hyperparameter optimization range, the number of whales, and the number of iterations;
[0042] S420, initializing the whale population, randomly generating a specified number of whales, and the position of each whale represents a hyperparameter combination;
[0043] S430, determining the fitness function as the mean square error MSE, and calculating the fitness value of each individual whale according to the fitness function;
[0044] S440, start iteration, and in each iteration, continuously update the position of the whale according to the surrounding prey, rotation search and random search in the algorithm, and establish and train the edge server energy consumption prediction model according to the position;
[0045] The encirclement operation is expressed as:
[0046]
[0047] Among them, X is the current whale position, X * is the global optimal position, t is the number of iterations, D is the step size, A and C are coefficient matrices;
[0048] When |A|<1, a random search is performed, expressed as:
[0049]
[0050] Among them, X rand is the random whale position;
[0051] When |A|≥1, a rotation search is performed, expressed as:
[0052]
[0053] Among them, p is a random number between [0,1], b is a constant that changes the rotation shape, and l is a random number between [-1,1]. and Represents adaptive weight, which is a nonlinear weight;
[0054] S450. When the maximum number of iterations is reached, the algorithm iteration is completed, the optimal whale position is decoded, and its corresponding hyperparameters are output.
[0055] The particle swarm optimization (PSO) and improved whale optimization algorithm (IWOA) optimize the initial weight threshold and hyperparameters of the neural network model. They can efficiently explore complex parameter combinations and find the model configuration with the best performance. They can also overcome the problem that the model prediction process is prone to fall into local optimal solutions and slow convergence.
[0056] On the other hand, the present invention provides a non-transitory computer-readable storage medium having computer instructions stored thereon, which enable a computer to execute the above-mentioned edge server energy consumption prediction method based on PSO-IWOA-DLSTM.
[0057] Another aspect of the present invention provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus, and the processor calls the logic instructions in the memory to execute the above-mentioned edge server energy consumption prediction method based on PSO-IWOA-DLSTM.
[0058] On the other hand, the present invention provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer executes the above-mentioned edge server energy consumption prediction method based on PSO-IWOA-DLSTM.
[0059] Beneficial effects: The present invention not only solves the problem that the traditional prediction method has low prediction accuracy for edge server energy consumption time series data with periodicity and large fluctuations, but also uses wavelet transform to extract features from the original edge server energy consumption data, capturing signal characteristics from approximate components and detail components at different scales; the particle swarm algorithm and improved whale optimization algorithm are used to optimize the initial weight threshold and hyperparameters of the DLSTM neural network, overcoming the problem of falling into local optimal solutions, slow convergence speed and instability during model prediction, and further improving the model robustness and prediction accuracy. The prediction method can extract the characteristic changes of edge server energy consumption data, and finally realize the high-accuracy prediction and analysis of edge server energy consumption time series data, and more accurately predict the change trend of edge server energy consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a flow chart of the edge server energy consumption prediction method based on PSO-IWOA-DLSTM of the present invention;
[0061] Figure 2 A schematic diagram of a wavelet transform decomposition tree in the edge server energy consumption prediction method based on PSO-IWOA-DLSTM of the present invention;
[0062] Figure 3 It is a DLSTM network structure diagram in the edge server energy consumption prediction method based on PSO-IWOA-DLSTM of the present invention;
[0063] Figure 4This is a structural diagram of the LSTM unit in the edge server energy consumption prediction method based on PSO-IWOA-DLSTM of the present invention;
[0064] Figure 5 The DLSTM flow chart for optimizing the whale optimization algorithm in the edge server energy consumption prediction method based on PSO-IWOA-DLSTM of the present invention is provided;
[0065] Figure 6 This is a CPU utilization prediction result diagram in an embodiment of the present invention;
[0066] Figure 7 This is a diagram of memory utilization prediction results in an embodiment of the present invention. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments, and they should not be understood as limitations on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In the description of the present invention, it should be understood that the terms used are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0068] Combine the following Figure 1-Figure 7 The present invention describes an edge server energy consumption prediction method based on PSO-IWOA-DLSTM.
[0069] Embodiment 1: This embodiment provides an edge server energy consumption prediction method based on PSO-IWOA-DLSTM.
[0070] like Figure 1 As shown, the steps include:
[0071] S100, collecting time series data of energy consumption of original edge servers;
[0072] S200, extracting features from the original data using wavelet transform;
[0073] S300, performing data normalization processing on the edge server energy consumption data subsequence after wavelet decomposition;
[0074] S400, constructing edge server energy consumption prediction models based on the DLSTM framework according to the obtained multiple subsequences;
[0075] S500, optimizing the initial weight threshold of the edge server energy consumption prediction model using the PSO algorithm;
[0076] S600, optimizing hyper parameters of the edge server energy consumption prediction model using the IWOA algorithm;
[0077] S700: Output multiple predicted subsequences using the optimized edge server energy consumption prediction model, and reconstruct them into future edge server energy consumption data as prediction results.
[0078] Detailed description of each of the above steps:
[0079] Step S100 obtains the original edge server energy consumption time series data, including but not limited to CPU utilization, memory utilization, disk I / O and other indicators. When training the model, a network public data set is used to collect data through the OpenStack cloud platform, and the collection time interval is 1 hour.
[0080] Step S200 uses wavelet transform to extract features from the original data. Based on the discreteness of the edge server energy consumption time series data, discrete wavelet is selected to decompose the data.
[0081] For a one-dimensional discrete signal x(n), its wavelet transform can be expressed as:
[0082]
[0083] Where W(a,b) is the wavelet coefficient, which represents the signal component at scale a and displacement b; x(n) is the original edge server energy consumption time series data; ψ a,b (n) is the wavelet basis function. The original edge server energy consumption time series data is decomposed into approximate components (low-frequency parts) and detail components (high-frequency parts) by wavelet transform. The approximate components can be further decomposed into lower-frequency approximate components and higher-frequency detail components by further wavelet transform, forming a decomposition tree, such as Figure 2 shown.
[0084] In this embodiment, the db3 wavelet function is selected to perform wavelet transform, and the decomposition level is 3. After decomposition, 1 approximate component and 3 detail components are obtained.
[0085] Step S300 performs data normalization on the edge server energy consumption data subsequence after wavelet decomposition. According to the characteristics of the edge server energy consumption data, the Min-Max normalization method is selected to map each subsequence data to the [0,1] interval. The specific method is: first calculate the maximum and minimum values of the data in each subsequence, and record them as X max and X min ; Then subtract X from each data in the subsequence data min , then divided by X max -X min, that is, the data normalization of the current subsequence is completed.
[0086] Step S400 is to construct edge server energy consumption prediction models based on the DLSTM framework according to the obtained multiple subsequences. The DLSTM network structure is as follows: Figure 3 As shown in Figure 1, DLSTM can learn the time dependency in the edge server energy consumption data and mine the time series characteristics of the edge server energy consumption data. LSTM realizes data memory through the control unit of input gate, forget gate and output gate. The unit structure is as follows: Figure 4 As shown in the figure, the specific workflow is as follows: At each moment, the LSTM unit receives two kinds of external information through three gates: the current input state x t and the hidden state h at the previous moment t-1 In addition to this external information, each gate also receives an internal information input, which is the memory cell state c at the previous moment. t-1 Each gate processes these input information and determines whether to activate according to its logic function. t After the input is processed by the nonlinear function, it is combined with the forget gate f t The processing results of the memory unit state are superimposed to obtain a new memory unit state c t ; Finally, through the calculation of nonlinear function and output gate o t The final output h of the LSTM unit is obtained by controlling t .
[0087] The working process of the LSTM unit is expressed as:
[0088] i t =σ(W xi x t +W hi h t-1 +W ci c t-1 +b i );
[0089] f t =σ(W xf x t +W hf h t-1 +W cf c t-1 +b f );
[0090] c t =f t c t-1 +i t tanh(W xc x t +W hc h t-1+b c );
[0091] o t =σ(W xo x t +W ho h t-1 +W co c t +b o );
[0092] h t =o t tanh(c t );
[0093] Among them, W xc , W xi , W xf , W xo is the input signal x t The associated weight matrix; W hc , W hi , W hf , W ho is the hidden layer output signal h t The associated weight matrix; W ci , W cf , W co Output vector c for the connected neuron activation function t The diagonal matrix of the sum gate function; b i , b c , b f , b o is the bias vector; σ is the activation function.
[0094] Step S500 uses the PSO algorithm to optimize the initial weight threshold of the edge server energy consumption prediction model. The specific method is:
[0095] S510, initializing parameters, including population size, maximum number of iterations, boundary of particle position, range of particle velocity and acceleration factor;
[0096] S520, population initialization, randomly generating a particle population, each particle individual represents a weight threshold combination of a DLSTM neural network;
[0097] S530, calculating the fitness value of each particle, sorting the fitness of all particles, and selecting the historical optimal position of the particle and the global optimal particle;
[0098] S540, iteration starts, each iteration uses the historical optimal position of the particle and the global optimal particle to update the speed and position of the current particle, establishes an edge server energy consumption prediction model according to the updated particle position, and calculates the fitness value of the particle according to the prediction result of the model;
[0099] S550, after reaching the maximum number of iterations or the target fitness value, the iteration is stopped, the optimal particle is decoded, and the initial weight threshold of the optimized edge server energy consumption prediction model is obtained.
[0100] Step S600 is to optimize the hyper parameters of the edge server energy consumption prediction model using the IWOA algorithm. Figure 5 As shown, the specific method is:
[0101] S610, determining the hyperparameters to be optimized, which are the time window, the number of hidden layer nodes, and the number of hidden layer layers, and initializing the parameters, including the hyperparameter optimization range, the number of whales, and the number of iterations;
[0102] S620, initializing the whale population, randomly generating a specified number of whales, and the position of each whale represents a hyperparameter combination;
[0103] S630, determining the fitness function as the mean square error MSE, and calculating the fitness value of each individual whale according to the fitness function;
[0104] S640, start iteration, and in each iteration, continuously update the position of the whale according to the surrounding prey, rotation search and random search in the algorithm, and establish and train the edge server energy consumption prediction model according to the position;
[0105] The encirclement operation is expressed as:
[0106]
[0107] Among them, X is the current whale position, X * is the global optimal position, t is the number of iterations, D is the step size, A and C are coefficient matrices;
[0108] When |A|<1, a random search is performed, expressed as:
[0109]
[0110] Among them, X rand is the random whale position;
[0111] When |A|≥1, a rotation search is performed, expressed as:
[0112]
[0113] Among them, p is a random number between [0,1], b is a constant that changes the rotation shape, and l is a random number between [-1,1]. and Represents adaptive weight, which is a nonlinear weight;
[0114] S650: When the maximum number of iterations is reached, the algorithm iteration is completed, the optimal whale position is decoded, and its corresponding hyperparameters are output.
[0115] Step S700 uses the optimized edge server energy consumption prediction model to output multiple predicted subsequences, and then obtains the final edge server energy consumption data prediction result through wavelet reconstruction.
[0116] The data set is divided into a training set and a test set in a ratio of 8:2. The final prediction results on the test set are as follows: Figure 6 and Figure 7 The mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE) are used as evaluation indicators, and the error comparison of different models is shown in Table 1. The calculation formulas are:
[0117]
[0118] N is the number of data samples, y predictive is the predicted value, y true is the actual value.
[0119] Table 1 Comparison of prediction performance of different models
[0120]
[0121] It is proved that the present invention not only solves the problem that the traditional prediction method has low prediction accuracy for edge server energy consumption time series data with periodicity and large fluctuations, but also uses wavelet transform to extract features from the original edge server energy consumption data, capturing signal characteristics from approximate components and detail components at different scales; the initial weight threshold and hyperparameters of the DLSTM neural network are optimized by particle swarm algorithm and improved whale optimization algorithm respectively, overcoming the problem of falling into local optimal solution, slow convergence speed and instability in the model prediction process, and further improving the model robustness and prediction accuracy. The prediction method can extract the characteristic changes of edge server energy consumption data, and finally realizes the high-accuracy prediction and analysis of edge server energy consumption time series data, and more accurately predicts the change trend of edge server energy consumption.
[0122] Embodiment 2: This embodiment provides a non-transitory computer-readable storage medium on which computer instructions are stored. The computer instructions enable a computer to execute a method for predicting energy consumption of an edge server based on PSO-IWOA-DLSTM. The method comprises the following steps:
[0123] S100, collecting time series data of energy consumption of original edge servers;
[0124] S200, extracting features from the original data using wavelet transform;
[0125] S300, performing data normalization processing on the edge server energy consumption data subsequence after wavelet decomposition;
[0126] S400, constructing edge server energy consumption prediction models based on the DLSTM framework according to the obtained multiple subsequences;
[0127] S500, optimizing the initial weight threshold of the edge server energy consumption prediction model using the PSO algorithm;
[0128] S600, optimizing hyper parameters of the edge server energy consumption prediction model using the IWOA algorithm;
[0129] S700: Output multiple predicted subsequences using the optimized edge server energy consumption prediction model, and reconstruct them into future edge server energy consumption data as prediction results.
[0130] Embodiment 3: This embodiment provides an electronic device, which may include: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. The processor may call the logic instructions in the memory to execute the edge server energy consumption prediction method based on PSO-IWOA-DLSTM, and the method includes the following steps:
[0131] S100, collecting time series data of energy consumption of original edge servers;
[0132] S200, extracting features from the original data using wavelet transform;
[0133] S300, performing data normalization processing on the edge server energy consumption data subsequence after wavelet decomposition;
[0134] S400, constructing edge server energy consumption prediction models based on the DLSTM framework according to the obtained multiple subsequences;
[0135] S500, optimizing the initial weight threshold of the edge server energy consumption prediction model using the PSO algorithm;
[0136] S600, optimizing hyper parameters of the edge server energy consumption prediction model using the IWOA algorithm;
[0137] S700: Output multiple predicted subsequences using the optimized edge server energy consumption prediction model, and reconstruct them into future edge server energy consumption data as prediction results.
[0138] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, an edge server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0139] Embodiment 4: This embodiment provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute an edge server energy consumption prediction method based on PSO-IWOA-DLSTM. The method includes the following steps:
[0140] S100, collecting time series data of energy consumption of original edge servers;
[0141] S200, extracting features from the original data using wavelet transform;
[0142] S300, performing data normalization processing on the edge server energy consumption data subsequence after wavelet decomposition;
[0143] S400, constructing edge server energy consumption prediction models based on the DLSTM framework according to the obtained multiple subsequences;
[0144] S500, optimizing the initial weight threshold of the edge server energy consumption prediction model using the PSO algorithm;
[0145] S600, optimizing hyper parameters of the edge server energy consumption prediction model using the IWOA algorithm;
[0146] S700: Output multiple predicted subsequences using the optimized edge server energy consumption prediction model, and reconstruct them into future edge server energy consumption data as prediction results.
[0147] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, an edge server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting energy consumption of edge servers based on PSO-IWOA-DLSTM, characterized in that: Includes steps: S100, collecting the original edge server energy consumption time series data, and preprocessing it to decompose it into multiple subsequences; S200, constructing edge server energy consumption prediction models based on the DLSTM framework according to the obtained multiple subsequences; S300, optimizing the initial weight threshold of the edge server energy consumption prediction model using the PSO algorithm; S400, optimizing the hyper parameters of the edge server energy consumption prediction model using the IWOA algorithm; S500: Output multiple predicted subsequences using the optimized edge server energy consumption prediction model, and reconstruct them into future edge server energy consumption data as prediction results.
2. The edge server energy consumption prediction method based on PSO-IWOA-DLSTM according to claim 1 is characterized in that: Step S100 specifically includes: S110, collecting time series data of energy consumption of original edge servers; S120, using wavelet transform to perform feature extraction on the original edge server energy consumption time series data, decomposing the original edge server energy consumption time series data into approximate components and detail components, and then decomposing the approximate components layer by layer, and finally obtaining one approximate component and several detail components, each component as a subsequence; S130: performing data normalization processing on the subsequences obtained by decomposition.
3. The edge server energy consumption prediction method based on PSO-IWOA-DLSTM according to claim 2 is characterized in that: In step S120, the original edge server energy consumption time series data is set as one-dimensional discrete data x(n), and discrete wavelet is selected for data decomposition. The wavelet transform is expressed as: Where W(a,b) is the wavelet coefficient, which represents the signal component at scale a and displacement b; x(n) is the original edge server energy consumption time series data; ψ a,b (n) is the wavelet basis function.
4. The edge server energy consumption prediction method based on PSO-IWOA-DLSTM according to claim 3 is characterized in that: In step S130, the Min-Max normalization method is used to map each subsequence data to the interval [0,1]. The specific method is: First, calculate the maximum and minimum values of the data in each subsequence, denoted as X max and X min ; Then subtract X from each data in the subsequence data min , then divided by X max -X min , complete the data normalization of the current subsequence.
5. The edge server energy consumption prediction method based on PSO-IWOA-DLSTM according to claim 1 is characterized in that: The edge server energy consumption prediction model based on the DLSTM framework constructed in step S200 includes multiple LSTM units. The LSTM unit memorizes data through the control unit of the input gate, the forget gate and the output gate. At each moment, the LSTM unit receives two kinds of external information through three gates, namely, the current input state x t and the hidden state h at the previous moment t-1 , and an internal information, which is the memory cell state c at the previous moment t-1 ; Input Gate i t After the input is processed by the nonlinear function, it is combined with the forget gate f t The processing results of the memory unit state are superimposed to obtain a new memory unit state c t ; Finally, through the calculation of nonlinear function and output gate o t The final output h of the LSTM unit is obtained by controlling t ; expressed as: i t =σ(W xi x t +W hi h t-1 +W ci c t-1 +b i ); f t =σ(W xf x t +W hf h t-1 +W cf c t-1 +b f ); c t =f t c t-1 +i t tanh(W xc x t +W hc h t-1 +b c ); o t =σ(W xo x t +W ho h t-1 +W co c t +b o ); h t =o t fishy t ); Among them, W xc , W xi , W xf , W xo is the input signal x t The associated weight matrix; W hc , W hi , W hf , W ho is the hidden layer output signal h t The associated weight matrix; W ci , W cf , W co Output vector c for the connected neuron activation function t The diagonal matrix of the sum gate function; b i , b c , b f , b o is the bias vector; σ is the activation function.
6. The edge server energy consumption prediction method based on PSO-IWOA-DLSTM according to claim 1 is characterized in that: The PSO algorithm is used to optimize the initial weight threshold of the edge server energy consumption prediction model in step S300. The specific method is: S310, initializing parameters, including population size, maximum number of iterations, boundary of particle position, range of particle velocity and acceleration factor; S320, population initialization, randomly generating a particle population, each particle individual represents a weight threshold combination of a DLSTM neural network; S330, calculating the fitness value of each particle, sorting the fitness of all particles, and selecting the historical optimal position of the particle and the global optimal particle; S340, iteration starts, each iteration uses the historical optimal position of the particle and the global optimal particle to update the speed and position of the current particle, establishes an edge server energy consumption prediction model based on the updated particle position, and calculates the fitness value of the particle based on the prediction result of the model; S350, after reaching the maximum number of iterations or the target fitness value, the iteration is stopped, the optimal particle is decoded, and the initial weight threshold of the optimized edge server energy consumption prediction model is obtained.
7. The edge server energy consumption prediction method based on PSO-IWOA-DLSTM according to claim 1 is characterized in that: Step S400 uses the IWOA algorithm to optimize the hyper parameters of the edge server energy consumption prediction model; the specific method is: S410, determining the hyperparameters to be optimized, which are the time window, the number of hidden layer nodes, and the number of hidden layer layers, and initializing the parameters, including the hyperparameter optimization range, the number of whales, and the number of iterations; S420, initializing the whale population, randomly generating a specified number of whales, and the position of each whale represents a hyperparameter combination; S430, determining the fitness function as the mean square error MSE, and calculating the fitness value of each individual whale according to the fitness function; S440, start iteration, and in each iteration, continuously update the position of the whale according to the surrounding prey, rotation search and random search in the algorithm, and establish and train the edge server energy consumption prediction model according to the position; The encirclement operation is expressed as: Among them, X is the current whale position, X * is the global optimal position, t is the number of iterations, D is the step size, A and C are coefficient matrices; When |A|<1, a random search is performed, expressed as: Among them, X rand is the random whale position; When |A|≥1, a rotation search is performed, expressed as: Among them, p is a random number between [0,1], b is a constant that changes the rotation shape, and l is a random number between [-1,1]. and Represents adaptive weight, which is a nonlinear weight; S450. When the maximum number of iterations is reached, the algorithm iteration is completed, the optimal whale position is decoded, and its corresponding hyperparameters are output.
8. A non-transitory computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and the computer instructions enable the computer to execute the edge server energy consumption prediction method based on PSO-IWOA-DLSTM as described in any one of claims 1-7.
9. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus, and the processor calls the logic instructions in the memory to execute the edge server energy consumption prediction method based on PSO-IWOA-DLSTM as described in any one of claims 1-7.
10. A computer program product, characterized in that The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer executes the edge server energy consumption prediction method based on PSO-IWOA-DLSTM as described in any one of claims 1 to 7.