Machine room energy consumption prediction method based on recurrent neural network codec
Through the method based on recurrent neural network codec, the problem that traditional computer room energy consumption prediction methods are difficult to capture nonlinear relationships and time dependence is solved, achieving higher prediction accuracy and more effective energy management.
Patent Information
- Application Number
- CN202411556758.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-28
AI Technical Summary
Traditional computer room energy consumption prediction methods are difficult to capture complex nonlinear relationships and time dependencies, resulting in limited prediction accuracy.
The computer room energy consumption prediction method based on recurrent neural network codec is adopted. By acquiring and preprocessing historical energy consumption data, the LSTM model is trained to generate accurate prediction results.
It improves the accuracy of computer room energy consumption prediction, can effectively capture the time dependence relationship in time series data, meets the needs in actual applications, and overcomes the limitations of traditional prediction technology.
Smart Images

Figure CN119539522A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing and prediction analysis, and in particular to a method for predicting energy consumption of a computer room based on a recurrent neural network codec. Background Art
[0002] Computer room usually refers to a dedicated space used for centralized management, storage and processing of large computer systems and related equipment. Computer rooms are usually equipped with high-performance servers, network equipment, storage equipment and necessary supporting infrastructure, such as cooling systems, power supply systems and security monitoring systems. According to different functions and scales, computer rooms can be divided into data centers, server rooms, communication rooms, etc. Computer room energy consumption refers to the power consumption of all equipment in the computer room during operation, including servers, network equipment, storage systems, air conditioners, lighting, etc.
[0003] The energy consumption of a computer room directly affects the operating cost of the computer room. Higher energy consumption means higher electricity bills. Accurately predicting and managing the energy consumption of a computer room is crucial to reducing operating costs. The energy consumption of a computer room is closely related to carbon emissions. By reducing energy consumption, environmental impact can be reduced and sustainable development can be promoted. Understanding the energy consumption of a computer room can help operators evaluate the efficiency and life cycle of equipment. By optimizing energy consumption, the service life of equipment can be extended and overall performance improved. Changes in the energy consumption of a computer room may affect the performance and stability of equipment. High energy consumption is often associated with increased risk of equipment overload and failure, so monitoring energy consumption is a key factor in ensuring system reliability. In the context of modern information technology, the monitoring and analysis of energy consumption in a computer room provides a data foundation for intelligent operation and maintenance. By leveraging big data and artificial intelligence technologies, real-time monitoring and intelligent optimization of energy consumption in a computer room can be achieved. With increasingly stringent policy supervision on energy use, the management of energy consumption in a computer room has also become an important part of corporate compliance. Traditional methods for predicting energy consumption in a computer room, such as statistical models and time series analysis, often have difficulty capturing complex nonlinear relationships and time dependencies, and their prediction accuracy is limited. Summary of the invention
[0004] In view of this, the purpose of the present invention is to propose a method for predicting energy consumption of a computer room based on a recurrent neural network codec.
[0005] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0006] The present application provides a method for predicting energy consumption of a computer room based on a recurrent neural network codec, comprising:
[0007] Obtaining energy consumption information of a first computer room within a first preset time period, the energy consumption information of the first computer room including at least one of a total energy consumption value of the first computer room, a first ambient temperature value, a first ambient humidity value, a first air conditioning energy consumption value, and a first equipment energy consumption value collected at a first preset frequency;
[0008] Preprocessing the energy consumption information of the first computer room to obtain a first data set;
[0009] Input the first data set into the trained LSTM model;
[0010] The encoder of the LSTM model generates a first context vector according to the first data set;
[0011] The decoder of the LSTM model generates and displays a first prediction result for a second preset time period according to the first context vector;
[0012] The LSTM model is trained in the following way:
[0013] Acquire historical computer room energy consumption information, where the historical computer room energy consumption information includes at least one of a historical total computer room energy consumption value, a historical ambient temperature value, a historical ambient humidity value, a historical air conditioning energy consumption value, and a historical equipment energy consumption value collected at a first preset frequency;
[0014] Preprocess the historical computer room energy consumption information and sort it in chronological order to obtain a time series data set;
[0015] Divide the time series data set into a training set and a test set, and build an LSTM model, which includes an encoder and a decoder;
[0016] The training set is input into the encoder, the encoder generates a second context vector according to the training set, and the decoder generates a first training result according to the second context vector, wherein the first training result includes a first training energy consumption value;
[0017] Determine whether the LSTM model is trained according to the first training result, and if so, input the test set into the LSTM model to obtain a first test result, wherein the first test result includes a first test energy consumption value;
[0018] Determine whether the LSTM model meets the prediction criteria based on the first test result;
[0019] If not, the parameters of the LSTM model are adjusted until the LSTM model meets the prediction criteria.
[0020] In some embodiments, the time series data set includes feature information of a plurality of first preset steps, which is recorded as first feature information, each first feature information includes a plurality of first feature values, the encoder includes a first LSTM unit, and the first LSTM unit includes a first input gate, a first forget gate, and a first output gate;
[0021] The training set is input to the encoder, and the encoder generates a second context vector according to the training set, including:
[0022] The first LSTM unit processes the first feature information one by one in chronological order to obtain a first hidden state and a first cell state corresponding to each first feature information;
[0023] A first hidden state corresponding to the first feature information of the last first preset step length is selected as the second context vector.
[0024] In some embodiments, the first LSTM unit processes the first feature information one by one in chronological order to obtain the first hidden state and the first cell state corresponding to each first feature information, including:
[0025] For each first feature information, perform the following steps:
[0026] Reading the first feature information corresponding to the current first preset step length, concatenating the first initial input value of the first feature information with the first hidden state of the first feature information of the previous first preset step length to obtain a first final input value of the first feature information;
[0027] Calculating an activation value of a first input gate, an activation value of a first forget gate, and an activation value of a first output gate according to the first final input value;
[0028] Updating a first cell state of first feature information;
[0029] A first hidden state of the first feature information is calculated according to the activation value of the first input gate, the activation value of the first forget gate, the activation value of the first output gate, and the first cell state of the first feature information.
[0030] In some embodiments, the decoder includes a second LSTM unit, the second LSTM unit includes a second input gate, a second forget gate, and a second output gate, the first training result includes a plurality of feature information of a second preset step length, which is recorded as second feature information, and each second feature information includes a plurality of second feature values;
[0031] The decoder generates a first training result according to the second context vector, including:
[0032] The second LSTM unit generates second feature information one by one in chronological order according to the second context vector to obtain a second hidden state and a second cell state corresponding to each second feature information;
[0033] The second context vector is the second hidden state of the first second feature information, and the second cell state of the first second feature information is initialized to zero.
[0034] In some embodiments, the second LSTM unit generates the second feature information one by one in chronological order according to the second context vector to obtain the second hidden state and the second cell state corresponding to each second feature information, including:
[0035] For each second feature information, perform the following steps:
[0036] Reading an output value of the second feature information corresponding to the previous second preset step length as a second initial input value of the second feature information corresponding to the current second preset step length, and concatenating the second initial input value with the second context vector to obtain a second final input value of the second feature information;
[0037] Calculating an activation value of a second input gate, an activation value of a second forget gate, and an activation value of a second output gate according to the second final input value;
[0038] Updating a second cell state of second feature information;
[0039] The second hidden state of the second feature information is calculated according to the activation value of the second input gate, the activation value of the second forget gate, the activation value of the second output gate, and the second cell state of the second feature information.
[0040] In some embodiments, determining whether the LSTM model is trained according to the first training result includes:
[0041] Calculate the loss value of the first training result in the loss function according to the number of training rounds, and the loss function is a mean square error function;
[0042] Construct a trend curve of loss value;
[0043] Get the early stopping threshold. When the trend change curve is within the early stopping threshold range, it means that the LSTM model training is complete.
[0044] In some embodiments, the prediction criterion is the root mean square error.
[0045] In some embodiments, preprocessing includes at least one of data cleaning, linear interpolation, and normalization.
[0046] In some embodiments, the first computer room energy consumption information further includes a second ambient temperature prediction value and a second ambient humidity prediction value within a second preset time period.
[0047] In some embodiments, the time series data set is divided into a training set and a test set in a ratio of 8:2.
[0048] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0049] Recurrent Neural Networks (LSTM) are good at modeling time series data and can effectively capture the temporal dependencies in the energy consumption data of the computer room, thereby improving the accuracy of the prediction. Building the LSTM model as a codec architecture can better extract the spatiotemporal characteristics of the input data and generate accurate prediction results. By effectively utilizing the training set and test set, combined with loss function optimization and prediction standard evaluation, it can be ensured that the developed LSTM model has good generalization performance. Using the LSTM codec architecture, combined with the preprocessing of historical computer room energy consumption data and model training evaluation, a method that can accurately predict future computer room energy consumption can meet the needs of practical applications. This method is expected to overcome the limitations of traditional prediction techniques and improve the efficiency of computer room energy management. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 This is the first schematic diagram of the LSTM model;
[0052] Figure 2 This is the second schematic diagram of the LSTM model. DETAILED DESCRIPTION
[0053] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0054] This embodiment provides a method for predicting energy consumption of a computer room based on a recurrent neural network codec, including:
[0055] Obtaining energy consumption information of a first computer room within a first preset time period, the energy consumption information of the first computer room including at least one of a total energy consumption value of the first computer room, a first ambient temperature value, a first ambient humidity value, a first air conditioning energy consumption value, and a first equipment energy consumption value collected at a first preset frequency;
[0056] Preprocessing the energy consumption information of the first computer room to obtain a first data set;
[0057] Input the first data set into the trained LSTM model;
[0058] The encoder of the LSTM model generates a first context vector according to the first data set;
[0059] The decoder of the LSTM model generates and displays a first prediction result for a second preset time period according to the first context vector;
[0060] The LSTM model is trained in the following way:
[0061] Acquire historical computer room energy consumption information, where the historical computer room energy consumption information includes at least one of a historical total computer room energy consumption value, a historical ambient temperature value, a historical ambient humidity value, a historical air conditioning energy consumption value, and a historical equipment energy consumption value collected at a first preset frequency;
[0062] Preprocess the historical computer room energy consumption information and sort it in chronological order to obtain a time series data set;
[0063] Divide the time series data set into a training set and a test set, and build an LSTM model, which includes an encoder and a decoder;
[0064] The training set is input into the encoder, the encoder generates a second context vector according to the training set, and the decoder generates a first training result according to the second context vector, wherein the first training result includes a first training energy consumption value;
[0065] Determine whether the LSTM model is trained according to the first training result, and if so, input the test set into the LSTM model to obtain a first test result, wherein the first test result includes a first test energy consumption value;
[0066] Determine whether the LSTM model meets the prediction criteria based on the first test result;
[0067] If not, the parameters of the LSTM model are adjusted until the LSTM model meets the prediction criteria.
[0068] See also Figure 1 , Long short-term memory (LSTM) is a deep learning model commonly used to process sequence data. It consists of multiple repeated LSTM units, each of which is usually composed of an input gate, a forget gate, and an output gate. When a new input Xt is received at each time step t, the input gate will evaluate the importance of the current information and decide whether to retain it. If the forget gate is closed, the cell state ct-1 of the previous time step will be discarded. The role of the output gate is to determine which part of the cell state ct needs to be propagated to the output state ht. In all three gates, the S-shaped activation function σ is used, and the result range is [0, 1] to allow the gate to be in a semi-open state. ht can specify whether to transmit to the next layer. When used again, ht and ct will be sent to the LSTM unit.
[0069] The LSTM model is constructed based on the above LSTM unit structure. The LSTM model directly stacks two LSTM layers. The time steps of the two LSTM layers are equal to the time steps of the input data. The output of the LSTM unit at each time step of the first LSTM layer is directly used as the input of the second LSTM layer. The output of the second LSTM layer at the last time step is connected with two fully connected layers to reduce the computational dimension and generate a time series.
[0070] However, when using a single LSTM model to predict a longer sequence, the prediction error at each step will increase as the prediction step length increases, resulting in a large deviation between the predicted sequence and the original sequence. The ED structure is a model framework in deep learning. It can effectively solve this problem by encoding a long sequence into a vector representation through an encoder and using a decoder to interpret and predict the vector.
[0071] See also Figure 2 , LSTM is integrated into the ED framework to build an LSTM-ED model. In the encoding phase, when the encoder reads a vector, the LSTM unit will generate a temporary encoding vector. The encoding process will be repeated N times so that all input vectors enter the LSTM to produce their corresponding encoding vectors. The input of the decoding phase is a vector that merges the final encoding vector and the output result of the previous LSTM. Since the temperature and humidity information of future moments is continuously fed in the sequential recursive process of LSTM-ED, the continuity of the energy consumption prediction process is maintained, and a more stable and less volatile output result can be produced.
[0072] Based on the above, LSTM is a time recurrent neural network widely used for time series modeling. It can learn long-term (static) and short-term (dynamic) dependencies in time series and overcome the shortcomings of gradient explosion or gradient disappearance of recurrent networks. The core of LSTM unit is the "gate" unit, including forget gate unit, input gate unit and output gate unit, which control the flow of information through learnable weights and bias coefficients.
[0073] The calculation steps of the LSTM unit are as follows:
[0074] (1) Concatenate the memory vector H of the previous moment t-1 and the input vector I at the current moment t
[0075] X t =H t-1 +I t ;
[0076] Among them, X t is the concatenated feature vector.
[0077] (2) Calculate the output vector of the core gate of the model.
[0078] Y t =f c (W c ·X t +b c );
[0079] Among them, Y t and f c Respectively represent the output vector and activation function of the core gate of the model. c and b c They represent the connection weight matrix and bias vector of the core gate respectively.
[0080] (3) Calculate the output vectors corresponding to the input gate, forget gate, and output gate respectively
[0081] G i =f g (W i ·X t +b i );
[0082] G f =f g (W f ·X t +b f );
[0083] G o =f g (W o ·X t +b o );
[0084] Among them, G i , G f , G o Represent the output vectors of the model input gate, forget gate, and output gate respectively.
[0085] (W i , W f , W o ) and (b i , b f , b o ) represent the weight matrix and bias vector of the three gates respectively. g Represents an activation function whose output value is between 0 and 1.
[0086] (4) Update the long-term memory unit state vector
[0087] Y′ t =G i ·Y t
[0088] C′ t =G f ·C t-1 ;
[0089] C t =Y′ t +C′ t
[0090] Among them, Y′ t is the original output of LSTM, C′ t is to store the memory cell state C at the previous moment t-1 Output value G through the forget gate f Corrected memory unit state vector. C t is the updated state vector of the long-term memory unit, which will be reused by the LSTM unit in the next cycle. In this step, the state vector of the long-term memory unit acquires new information and forgets the old information.
[0091] (5) Calculate the output vector of the LSTM unit
[0092] H t =f c (C t )·G o ;
[0093] Among them, H t is the output vector of the LSTM unit. c Represents the activation function, which is the same as the activation function of the core gate. The activation function can obtain stable output results after the LSTM unit is reused many times. Output gate vector G o It can control whether the LSTM unit should generate results. In addition, the state of the memory unit in this step is not affected by the activation function f c Therefore, the original output Y′ of this LSTM unit can be kept t No change occurs during the next reuse.
[0094] Codec means encoder Encoder and decoder Decoder, and the principles of encoder and decoder are as follows:
[0095] The goal of sequence-to-sequence learning is to learn a sequence Y based on the previous observations. t-j+1 , …, Y t , simulating the next sequence that is most likely to occur It can be described as the following formula:
[0096]
[0097] Where Yt is the observed data with time step t, k is the length of the prediction sequence, and j is the length of the observation sequence.
[0098] The Encoder part is responsible for refining various information related to the input sequence and temporarily storing it in the context value:
[0099]
[0100] Then, the Decoder part decodes the refined context value into the expected value;
[0101]
[0102] In this embodiment, the collected data is cleaned to remove outliers and missing values. Taking the historical energy consumption information of the computer room as an example, the air conditioning energy consumption, equipment energy consumption, indoor temperature, indoor humidity, total energy consumption data of the computer room, and the temperature and humidity of the weather forecast for the next 24 hours are collected hourly. The collected data belongs to time series data, and the outliers and missing values can be filled using the linear interpolation method.
[0103] The input data includes the air conditioning energy consumption / equipment energy consumption / computer room temperature / computer room humidity in the past 24 hours, and the temperature and humidity of the weather forecast for the next 24 hours.
[0104] The output data is the total energy consumption data of the computer room predicted for the next 24 hours.
[0105] Normalization is performed to ensure that the dimensions of each feature are consistent.
[0106] The formula for normalization is defined as follows:
[0107]
[0108] Where x is the original data value, μ is the mean of the data, σ is the standard deviation of the data, and x ' It is the standardized data value, that is, the data value after normalization.
[0109] Split the time series dataset into training and testing sets.
[0110] The data set is directly divided into training set and test set in a ratio of 8:2, and stratified sampling is usually used to ensure the consistency of data distribution.
[0111] When building the LSTM model, set the parameters such as the number of LSTM layers and units of the Encoder and Decoder.
[0112] The Encoder receives the air conditioning energy consumption / equipment energy consumption / room temperature / room humidity of the past 24 hours, and the temperature and humidity of the weather forecast for the next 24 hours. Therefore, 24 LSTM layers are set to receive 24 hours of data and output data with a length of 24 time steps.
[0113] The decoder accepts the data output by the encoder with a length of 24 time steps and sets the number of LSTM layers to 24. In the decoder stage, the output state of each time step contains a high-dimensional prediction of the energy consumption of the computer room.
[0114] To reduce the dimensionality, two fully connected layers (64 nodes and 32 nodes) are used in each time step. In the final output layer, the model outputs the energy consumption sequence of the computer room for the next 24 hours.
[0115] Specify the corresponding activation function and loss function. In the LSTM layer, Tanh is usually used as the activation function. For the output layer, since you are performing a regression task (predicting the total energy consumption of the computer room in the next 24 hours), you can use a linear activation function.
[0116] For the computer room energy consumption prediction task, the selected loss function is the root mean square error (RMSE). RMSE punishes larger errors more severely, so when evaluating the accuracy of model prediction, RMSE can better reflect the performance of the model.
[0117] Use the training set data to train the model:
[0118] Set the number of training epochs to 100 and the batch size to 32.
[0119] Monitor the changes in loss values during training and adjust hyperparameters such as learning rate in a timely manner:
[0120] During model training, the learning rate is decreased exponentially. Decreasing the learning rate can help approach the optimal solution faster in the early stages of training, while reducing the learning rate when approaching the optimal solution can allow the model to adjust parameters more finely, thereby achieving better convergence.
[0121] Use the validation set to validate the model to prevent overfitting:
[0122] If the loss on the validation set starts to rise while the loss on the training set is still falling, this usually means that the model is starting to overfit. At this point, you should stop training and take steps to prevent overfitting.
[0123] The evaluation function of the model is RMSE. The root mean square error (RMSE) is the square root of the average of the squares of the errors between the predicted value and the actual value. It measures the accuracy of the model's prediction. The smaller the value, the better the prediction performance of the model. The specific formula is as follows:
[0124]
[0125] Where: N is the number of samples. j is the ith actual value. is the i-th predicted value.
[0126] That is, the LSTM encoder accepts the input sequence of the past 24 hours (such as energy consumption, temperature and humidity, etc.) and gradually encodes it into a context vector of fixed length. During the encoding process, the LSTM unit will continuously learn the patterns and dependencies in the sequence and integrate them into the context vector. In this way, the encoder can compress long sequence data into a high-dimensional representation, retaining the long-term dependency information in the sequence. The LSTM decoder takes the context vector output by the encoder as input and gradually generates a sequence of energy consumption forecasts for the next 24 hours. At each time step, the decoder combines the prediction output of the previous moment with the current context vector, and generates a new prediction through the calculation of the LSTM unit. In this recursive prediction process, the LSTM unit can capture the short-term dynamic dependencies in the sequence data and generate more coherent and stable prediction results.
[0127] This embodiment uses a recurrent neural network (LSTM) that is good at modeling time series data, which can effectively capture the time dependency in the computer room energy consumption data, thereby improving the accuracy of the prediction. The LSTM model is constructed as a codec architecture, which can better extract the spatiotemporal characteristics of the input data and generate accurate prediction results. Through the effective use of the training set and the test set, combined with the loss function optimization and the prediction standard evaluation, it can be ensured that the developed LSTM model has good generalization performance. Using the LSTM codec architecture, combined with the preprocessing of the historical computer room energy consumption data and the model training evaluation, a method for accurately predicting the future computer room energy consumption can be used to meet the needs of practical applications. This method is expected to overcome the limitations of traditional prediction techniques and improve the efficiency of computer room energy management.
[0128] In some embodiments, the time series data set includes feature information of a plurality of first preset steps, which is recorded as first feature information, each first feature information includes a plurality of first feature values, the encoder includes a first LSTM unit, and the first LSTM unit includes a first input gate, a first forget gate, and a first output gate;
[0129] The training set is input to the encoder, and the encoder generates a second context vector according to the training set, including:
[0130] The first LSTM unit processes the first feature information one by one in chronological order to obtain a first hidden state and a first cell state corresponding to each first feature information;
[0131] A first hidden state corresponding to the first feature information of the last first preset step length is selected as the second context vector.
[0132] In some embodiments, the first LSTM unit processes the first feature information one by one in chronological order to obtain the first hidden state and the first cell state corresponding to each first feature information, including:
[0133] For each first feature information, perform the following steps:
[0134] Reading the first feature information corresponding to the current first preset step length, concatenating the first initial input value of the first feature information with the first hidden state of the first feature information of the previous first preset step length to obtain a first final input value of the first feature information;
[0135] Calculating an activation value of a first input gate, an activation value of a first forget gate, and an activation value of a first output gate according to the first final input value;
[0136] Updating a first cell state of first feature information;
[0137] A first hidden state of the first feature information is calculated according to the activation value of the first input gate, the activation value of the first forget gate, the activation value of the first output gate, and the first cell state of the first feature information.
[0138] In the encoder-decoder structure, the encoder uses an LSTM network to gradually encode the time series data and convert it into a fixed-length context vector.
[0139] First, the encoder receives time series data within the past 24 hours. Taking the first feature information in the training set as an example, the first feature value of the first feature information is such as air conditioning energy consumption, equipment energy consumption, temperature in the computer room, humidity in the computer room, and weather forecast for the next 24 hours (temperature and humidity, etc.).
[0140] Assume that the number of first preset steps of the input data is 24, and each first preset step contains multiple features. The encoder will process the data of these 24 first preset steps step by step.
[0141] The encoder uses the first LSTM unit inside, and the number of layers of the first LSTM unit can be multiple. Each first LSTM unit contains the first input gate, the first forget gate, and the first output gate, which control the flow of information. The first input gate determines the importance of the current input information. The first forget gate determines which information in the previous state is forgotten. The first output gate determines which information to output.
[0142] The encoder reads the input data of each first preset step size step by step. Assume that at the first preset step size t, the input is The encoder status includes:
[0143] The first hidden state h′ t-1 : Indicates the memory of the previous first preset step.
[0144] The first cell state c′ t-1 : Indicates the state of long-term memory.
[0145] The input of the current first preset step length and the first hidden state h′ of the previous first preset step length t-1 Stitched together to form a new input
[0146] Update the first cell state and the first hidden state through the LSTM calculation formula:
[0147] Calculate the activation values corresponding to the first input gate, the first forget gate, and the first output gate.
[0148] Update the first cell state c′ t .
[0149] Calculate the first hidden state h′ t .
[0150] After processing 24 first preset steps, the encoder will generate the last hidden state h′ of the first preset step T as the second context vector.
[0151] The output of the encoder is a second context vector h′ of fixed length T Although the input data is of length 24, the dimension of the output second context vector is fixed (usually determined by the number of cells in the first LSTM unit), which allows the decoder to rely only on this second context vector when generating predictions.
[0152] This second context vector contains key information and features in the input sequence, representing the comprehensive information of the past 24 hours of data. This compressed form enables the decoder to effectively use past information for future predictions.
[0153] The second context vector h′ generated by the encoder is a fixed length T This second context vector will be used as the input to the decoder to help it generate energy consumption forecasts for the next 24 hours. The decoder will use this second context vector to recursively generate the output sequence.
[0154] By using the LSTM network to gradually encode time series data, the encoder can effectively extract and summarize past information and convert it into a second context vector of fixed length. This second context vector contains all the important information related to the current prediction task, providing a solid foundation for the subsequent decoding process, thereby achieving more accurate future room energy consumption prediction.
[0155] In some embodiments, the decoder includes a second LSTM unit, the second LSTM unit includes a second input gate, a second forget gate, and a second output gate, the first training result includes a plurality of feature information of a second preset step length, which is recorded as second feature information, and each second feature information includes a plurality of second feature values;
[0156] The decoder generates a first training result according to the second context vector, including:
[0157] The second LSTM unit generates second feature information one by one in chronological order according to the second context vector to obtain a second hidden state and a second cell state corresponding to each second feature information;
[0158] The second context vector is the second hidden state of the first second feature information, and the second cell state of the first second feature information is initialized to zero.
[0159] In some embodiments, the second LSTM unit generates the second feature information one by one in chronological order according to the second context vector to obtain the second hidden state and the second cell state corresponding to each second feature information, including:
[0160] For each second feature information, perform the following steps:
[0161] Reading an output value of the second feature information corresponding to the previous second preset step length as a second initial input value of the second feature information corresponding to the current second preset step length, and concatenating the second initial input value with the second context vector to obtain a second final input value of the second feature information;
[0162] Calculating an activation value of a second input gate, an activation value of a second forget gate, and an activation value of a second output gate according to the second final input value;
[0163] Updating a second cell state of second feature information;
[0164] The second hidden state of the second feature information is calculated according to the activation value of the second input gate, the activation value of the second forget gate, the activation value of the second output gate, and the second cell state of the second feature information.
[0165] In the encoder-decoder structure, the main task of the decoder is to gradually generate the target sequence, i.e., the second feature information, based on the second context vector generated by the encoder and the previous output. In the specific application of computer room energy consumption prediction, the decoder is mainly responsible for predicting the total energy consumption of the computer room in the next 24 hours.
[0166] Specifically, the input of the decoder is the fixed-length second context vector h′ generated by the encoder T , which contains the key information of environmental data in the past 24 hours.
[0167] At the beginning of the decoder, the second context vector h′ is usually used. T As the initial second hidden state h"0, the second cell state c"0 is usually also initialized to zero.
[0168] The decoder generates the future output sequence step by step. Assuming that the energy consumption data of the computer room needs to be predicted for the next 24 hours, the decoder will generate a prediction value at every second preset step.
[0169] Processing of the second preset step size t:
[0170] At every second preset step t, the decoder receives the following input:
[0171] The output of the previous second preset step (predicted value) (A specific start marker or initial prediction value may be used instead on the first iteration).
[0172] The second context vector h′ T .
[0173] Concatenate the output of the previous second preset step length and the second context vector together to form a new input
[0174] The decoder uses the second LSTM unit inside, and the number of layers of the second LSTM unit can be multiple. Each second LSTM unit contains a second input gate, a second forget gate, and a second output gate, which control the flow of information. The second input gate determines the importance of the current input information. The second forget gate determines which information in the previous state is forgotten. The second output gate determines which information to output.
[0175] At each second preset step, the decoder generates a second hidden state h" according to the received input and the second hidden state h" of the previous second preset step. t-1 and the second cell state c" t-1Update the current second cell state c" t and the second hidden state h" t .
[0176] The output of the decoder at each second preset step is the predicted value of the current second preset step This value indicates the energy consumption forecast of the computer room at a certain point in the future.
[0177] The second hidden state h" of the second LSTM unit t Mapped to the target output space through a fully connected layer (usually a linear layer) to generate a predicted value.
[0178] At the last second preset step, the decoder will generate a sequence of room energy consumption forecasts for the next 24 hours.
[0179] The decoder generation process is cyclic. At each second preset step, the decoder output Will be used as input for the next second preset step And this process continues for 24 second preset steps until the prediction of energy consumption for the next 24 hours is completed.
[0180] During training, the output of the decoder can be compared with the actual target sequence and the prediction error can be calculated through a loss function (such as root mean square error). Through the back-propagation algorithm, the weights of the second LSTM unit are updated.
[0181] During training, the decoder can use true value sequences as input instead of predictions generated by the model, which can speed up convergence and improve prediction accuracy.
[0182] The decoder plays an important role in the encoder-decoder structure. It provides an accurate prediction of future room energy consumption by gradually generating output sequences, leveraging context vectors and previous prediction results. Through the gating mechanism and recursive processing capabilities of the second LSTM unit, the decoder can effectively capture dynamic changes in time series data and achieve efficient and accurate predictions.
[0183] In some embodiments, determining whether the LSTM model is trained according to the first training result includes:
[0184] Calculate the loss value of the first training result in the loss function according to the number of training rounds, and the loss function is a mean square error function;
[0185] Construct a trend change curve of loss value;
[0186] Get the early stopping threshold. When the trend change curve is within the early stopping threshold range, it means that the LSTM model training is complete.
[0187] During the training process, the mean square error (MSE) is used as the loss function, and the training loss value is calculated according to the first training result.
[0188] MSE can reflect the average difference between the predicted value and the true value. The formula is:
[0189]
[0190] Among them, k i is the true value, is the model prediction value, and n is the number of training samples.
[0191] As the number of training rounds increases, record the loss value of each training round. Plot these loss values into a curve graph to observe the changing trend of the loss value. Usually, as the training progresses, the loss value will gradually decrease until it stabilizes.
[0192] During the training process, set an early stopping threshold to determine whether the model has been trained. The early stopping threshold can be a fixed loss value or a percentage of loss value improvement. For example, the early stopping threshold can be set to 0.01, that is, when the loss value improvement is less than 1%, the model is considered to have been trained. Monitor the change curve of the loss value. If the curve is within the early stopping threshold range in multiple training rounds, the LSTM model can be considered to have been trained. This means that the model can no longer significantly improve performance by continuing training, and further training may lead to overfitting.
[0193] This example uses MSE as the loss function, observes the trend of the training loss value, and sets an early stopping threshold. When the loss value curve stabilizes within the threshold range, it is determined that the LSTM model has been trained. This method can help stop training in time and avoid overfitting, thereby obtaining an LSTM prediction model with good performance.
[0194] In some embodiments, the prediction criterion is the root mean square error.
[0195] In some embodiments, preprocessing includes at least one of data cleaning, linear interpolation, and normalization.
[0196] In some embodiments, the first computer room energy consumption information further includes a second ambient temperature prediction value and a second ambient humidity prediction value within a second preset time period.
[0197] In some embodiments, the time series data set is divided into a training set and a test set in a ratio of 8:2.
[0198] Recurrent Neural Networks (LSTM) are good at modeling time series data and can effectively capture the temporal dependencies in the energy consumption data of the computer room, thereby improving the accuracy of the prediction. Building the LSTM model as a codec architecture can better extract the spatiotemporal characteristics of the input data and generate accurate prediction results. By effectively utilizing the training set and test set, combined with loss function optimization and prediction standard evaluation, it can be ensured that the developed LSTM model has good generalization performance. Using the LSTM codec architecture, combined with the preprocessing of historical computer room energy consumption data and model training evaluation, a method that can accurately predict future computer room energy consumption can meet the needs of practical applications. This method is expected to overcome the limitations of traditional prediction techniques and improve the efficiency of computer room energy management.
[0199] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0200] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or 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 for a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of 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 codes.
[0201] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for predicting energy consumption in a computer room based on a recurrent neural network codec, characterized in that: include: Obtaining energy consumption information of a first computer room within a first preset time period, wherein the energy consumption information of the first computer room includes at least one of a total energy consumption value of the first computer room, a first ambient temperature value, a first ambient humidity value, a first air conditioning energy consumption value, and a first equipment energy consumption value collected at a first preset frequency; Preprocessing the energy consumption information of the first computer room to obtain a first data set; Inputting the first data set into the trained LSTM model; The encoder of the LSTM model generates a first context vector according to the first data set; The decoder of the LSTM model generates and displays a first prediction result for a second preset time period according to the first context vector; The LSTM model is trained in the following way: Acquire historical computer room energy consumption information, wherein the historical computer room energy consumption information includes at least one of a historical total computer room energy consumption value, a historical ambient temperature value, a historical ambient humidity value, a historical air conditioning energy consumption value, and a historical equipment energy consumption value collected at a first preset frequency; Preprocessing the historical computer room energy consumption information and arranging it in chronological order to obtain a time series data set; Divide the time series data set into a training set and a test set, and construct an LSTM model, wherein the LSTM model includes an encoder and a decoder; Inputting the training set into the encoder, the encoder generating a second context vector according to the training set, and the decoder generating a first training result according to the second context vector, wherein the first training result includes a first training energy consumption value; Determine whether the LSTM model is trained according to the first training result, and if so, input a test set into the LSTM model to obtain a first test result, wherein the first test result includes a first test energy consumption value; Determine whether the LSTM model meets the prediction criteria according to the first test result; If not, the parameters of the LSTM model are adjusted until the LSTM model meets the prediction criteria.
2. The method for predicting energy consumption of a computer room based on a recurrent neural network codec according to claim 1, characterized in that: The time series data set includes feature information of a plurality of first preset steps, which are recorded as first feature information, each of which includes a plurality of first feature values, and the encoder includes a first LSTM unit, and the first LSTM unit includes a first input gate, a first forget gate, and a first output gate; Inputting the training set into the encoder, wherein the encoder generates a second context vector according to the training set comprises: The first LSTM unit processes the first feature information one by one in chronological order to obtain a first hidden state and a first cell state corresponding to each first feature information; A first hidden state corresponding to the first feature information of the last first preset step length is selected as the second context vector.
3. The method for predicting energy consumption of a computer room based on a recurrent neural network codec according to claim 2 is characterized in that: The first LSTM unit processes the first feature information one by one in chronological order to obtain a first hidden state and a first cell state corresponding to each first feature information, including: For each of the first feature information, perform the following steps: Reading the first feature information corresponding to the current first preset step length, concatenating a first initial input value of the first feature information with a first hidden state of the first feature information of the previous first preset step length to obtain a first final input value of the first feature information; Calculating an activation value of the first input gate, an activation value of the first forget gate, and an activation value of the first output gate according to the first final input value; Updating a first cell state of the first feature information; The first hidden state of the first feature information is calculated according to the activation value of the first input gate, the activation value of the first forget gate, the activation value of the first output gate, and the first cell state of the first feature information.
4. The method for predicting energy consumption of a computer room based on a recurrent neural network codec according to claim 1, characterized in that: The decoder includes a second LSTM unit, the second LSTM unit includes a second input gate, a second forget gate and a second output gate, the first training result includes a plurality of feature information of a second preset step length, which is recorded as second feature information, and each of the second feature information includes a plurality of second feature values; The decoder generates a first training result according to the second context vector, comprising: The second LSTM unit generates the second feature information one by one in chronological order according to the second context vector to obtain a second hidden state and a second cell state corresponding to each second feature information; The second context vector is a second hidden state of the first second feature information, and the second cell state of the first second feature information is initialized to zero.
5. The method for predicting energy consumption of a computer room based on a recurrent neural network codec according to claim 4 is characterized in that: The second LSTM unit generates the second feature information one by one in chronological order according to the second context vector to obtain a second hidden state and a second cell state corresponding to each second feature information, including: For each of the second feature information, perform the following steps: Reading an output value of the second feature information corresponding to the previous second preset step length as a second initial input value of the second feature information corresponding to the current second preset step length, and concatenating the second initial input value with the second context vector to obtain a second final input value of the second feature information; Calculating an activation value of the second input gate, an activation value of the second forget gate, and an activation value of the second output gate according to the second final input value; Updating a second cell state of the second feature information; The second hidden state of the second feature information is calculated according to the activation value of the second input gate, the activation value of the second forget gate, the activation value of the second output gate, and the second cell state of the second feature information.
6. The method for predicting energy consumption of a computer room based on a recurrent neural network codec according to claim 1, characterized in that: Judging whether the LSTM model has been trained according to the first training result includes: Calculating a loss value of the first training result in a loss function according to the number of training rounds, where the loss function is a mean square error function; Constructing a trend change curve of the loss value; An early stopping threshold is obtained. When the trend change curve is within the early stopping threshold range, it indicates that the LSTM model training is completed.
7. The method for predicting energy consumption of a computer room based on a recurrent neural network codec according to claim 1, characterized in that: The prediction criterion is the root mean square error.
8. The method for predicting energy consumption of a computer room based on a recurrent neural network codec according to claim 1, characterized in that: The preprocessing includes at least one of data cleaning, linear interpolation and normalization.
9. The method for predicting energy consumption of a computer room based on a recurrent neural network codec according to claim 1, characterized in that: The first computer room energy consumption information also includes a second ambient temperature prediction value and a second ambient humidity prediction value within a second preset time period.
10. The method for predicting energy consumption of a computer room based on a recurrent neural network codec according to claim 1, characterized in that: The time series data set is divided into the training set and the test set in a ratio of 8:2.