A method and system for predicting energy consumption of refrigeration system based on deep learning
By applying the ANFormer model based on the multi-head attention mechanism and generative adversarial network in the cold storage refrigeration system, the problem of insufficient energy consumption prediction accuracy and stability in the existing technology is solved, and more efficient energy consumption prediction and stronger energy consumption prediction are achieved. Generalizability, suitable for a variety of cold storage environments.
Patent Information
- Application Number
- CN202410977217.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Existing deep learning-based cold storage refrigeration system energy consumption prediction models have problems such as low accuracy, weak stability, and insufficient generalization. It is difficult to effectively capture long-term series features, and the error accumulation in the training process is serious, resulting in insufficient prediction accuracy. high.
An energy consumption prediction model based on multi-head attention mechanism and generative adversarial network is proposed. The ANFormer model is combined with Window Encoder and Decoder, and the self-attention mechanism and position coding are used to process data in the time window to reduce error accumulation and improve the generalization of the model. scalability and robustness.
It improves the accuracy and stability of energy consumption prediction, is suitable for energy consumption prediction in high-temperature and low-temperature libraries, provides more reliable decision support, and reduces energy waste and unnecessary energy consumption.
Smart Images

Figure CN118568681B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and system for predicting energy consumption of a refrigeration system based on deep learning, and belongs to the technical field of machine learning algorithms. Background Art
[0002] As a key node in the entire cold chain, the cold storage refrigeration system plays an irreplaceable role in the storage and preservation of cold chain commodities. With the rapid development of cold chain warehousing represented by cold storage refrigeration systems, the greenhouse gas emissions generated by direct and indirect energy consumption are increasing, accounting for about 2.5% of the total greenhouse gas emissions in the world. For example, the energy consumption of building cooling aimed at improving indoor air quality exceeds 60% of the total building energy consumption; the annual energy consumption of cold chain refrigeration aimed at improving people's quality of life is about 11% of the global total energy consumption. Moreover, energy consumption is directly related to cost. The high energy consumption of cold storage refrigeration systems and the high cost problems they bring have become bottlenecks that restrict the rapid development of the cold storage industry. Therefore, studying the energy consumption prediction method of cold storage refrigeration systems and providing guidance and suggestions for the design and energy-saving operation of cold storage refrigeration systems have important practical significance for saving energy, reducing the production costs of cold storage enterprises, and improving economic benefits.
[0003] In recent years, in order to solve the problem of energy consumption prediction of cold storage refrigeration system, the academic community has carried out a lot of research work. At present, most scholars' research on energy consumption prediction of cold storage refrigeration system mainly focuses on building physical models based on thermodynamic calculations and data models based on machine learning.
[0004] Regarding the deep learning method based on the attention mechanism, Haixue Wu et al. (see: Wu H, Xu J, Wang J, et al. Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting [J]. Advances in Neural Information Processing Systems, 2021, 34: 22419-22430.) proposed a decomposition structure, which embeds sequence decomposition blocks as internal operators, gradually aggregates the long-term trend part of the medium-term forecast, and constructs an Autoformer prediction model, which can better complete the prediction of long-term energy consumption series; Haoyi Zhou et al. (see: Zhou H, Zhang S, Peng J, et al. Informer: Beyond efficient transformer for long sequence time-series forecasting [C] / / Proceedings of the AAAI conference on artificial intelligence. 2021, 35 (12): 11106-11115.) designed an efficient transformation-based LSTF model Informer, which can effectively process ultra-long input sequences and greatly improve the inference speed of long sequence prediction; Tian Zhou et al. (See: Zhou T, Ma Z, Wen Q, et al. Fedformer: Frequency enhanced decomposed transformer for long-term series forecasting [C] / / International Conference on Machine Learning. PMLR, 2022: 27268-27286.) proposed combining Transformer and seasonal trend decomposition methods, where the decomposition method captures the global profile of the time series, while Transformers capture more detailed structures. Its efficiency is higher than that of the standard Transformer, and its complexity is linear in the length of the sequence.
[0005] Machine learning and deep learning methods are widely used in energy consumption forecasting. The advantages of this method are simple model construction and good generalization. However, artificial intelligence prediction models also have the following disadvantages. First, a single model may have poor prediction accuracy when dealing with complex problems; second, the prediction results are not interpretable, and the optimization of cold storage energy-saving design and control is limited; finally, it is difficult to capture the characteristics of long time series based on models and optimization models such as LSTM, RNN and Transformer, and the error accumulation in the training process is serious, resulting in low accuracy in predicting energy consumption data for long time series. Summary of the invention
[0006] In view of the shortcomings of the prior art, the present invention proposes a method and system for predicting energy consumption of a refrigeration system based on deep learning;
[0007] The present invention proposes an energy consumption prediction model based on a multi-head attention mechanism and a generative adversarial network. The present invention conducted a verification experiment on the data of two cold storage refrigeration systems to test the effectiveness of the energy consumption prediction model for the refrigeration system energy consumption prediction scenario. The present invention proposes a generative adversarial feedback mechanism to standardize the energy consumption prediction model. Experiments show that this method reduces error accumulation and improves the generalization and robustness of the model. The present invention solves the problems of low accuracy, weak stability, and insufficient generalization of existing models. Finally, two sets of data from high-temperature and low-temperature cold storages were used to verify the effectiveness of the energy consumption prediction model of the present invention.
[0008] The present invention also proposes a refrigeration system energy consumption prediction system based on deep learning.
[0009] The technical solution of the present invention is:
[0010] A method for predicting energy consumption of a refrigeration system based on deep learning, comprising:
[0011] Build and train energy consumption prediction models;
[0012] After preprocessing the time series to be predicted, the energy consumption prediction of the refrigeration system is realized through the trained energy consumption prediction model;
[0013] Among them, in the energy consumption prediction model, the sequence data including the original time series data and the target time series data are taken as the input sequence, and are processed and converted into hidden representations to capture the patterns and features in the sequence; relevant information is captured to obtain the predicted value of energy consumption.
[0014] Preferably, according to the present invention, for a data set including time series information and corresponding observation values, the time series information is a timestamp sequence of observation / data point size T: ; Among them, the data point corresponding to each timestamp t is , and ∀t has , R represents the real number field, m represents the vector The number of real values in; when m=1, the timestamp series is a univariate time series;
[0015] The energy consumption prediction problem of the refrigeration system is defined as: given a training timestamp sequence X, for any length and the unknown test time series has the same modality as the training timestamp series , predict the trend and specific value of energy consumption y in several future time steps; that is, predict ,in, Represents the energy consumption between time t-1 and time t.
[0016] Preferably, according to the present invention, preprocessing includes normalization and missing value filling operations.
[0017] Further preferably, the normalization formula is as follows:
[0018] ;
[0019] in, is the current value of a certain attribute of a certain node, min(X) is the minimum value of the attribute of all nodes, and max(X) is the maximum value of the attribute of all nodes. is a constant.
[0020] Preferably, according to the present invention, the energy consumption prediction model, namely the ANFormer model, includes two Window Encoder models, two Encoders, and three Decoders;
[0021] The two Window Encoder models include a first Window Encoder and a second Window Encoder; the two Encoders include a first Encoder and a second Encoder; the three Decoders include a first Decoder, a second Decoder and a third Decoder;
[0022] The Window Encoder model is used to convert the input sequence data into a hidden representation. It captures important information and features in the data by processing the input sequence data through a Transformer encoder. The Encoder is responsible for encoding the complete source sequence to capture relevant information in the input sequence. The Encoder's encoded output enters the Window Encoder, making it easier for the Window Encoder to learn high-quality feature information. During training, the Decoder is responsible for calculating the loss between the generated sequence and the true target sequence while generating the target sequence, and adjusting the model parameters through back propagation to minimize the loss. In the test phase, the hidden representation output by the encoder is input into the Decoder and converted to obtain the target prediction sequence.
[0023] Further preferably, the Window Encoder model uses a self-attention mechanism to process data within a time window; position encoding is added to the input data;
[0024] The input data of the Window Encoder model is a time series data with multiple features, including historical power consumption data, cold storage status and timestamp information. The input data is first divided into a series of fixed-length time windows. Each time window includes continuous data segments. After the window is divided, the data of each time window is encoded through the embedding layer.
[0025] Next, the vector sequence processed by the embedding layer is passed to the Transformer encoder, namely WindowEncoder; for Window Encoder, position encoding is applied to the input window Input Window to obtain I2;
[0026] The Window Encoder will do the following:
[0027] ;
[0028] ;
[0029] ;
[0030] ;
[0031] Among them, I i Represents the input of the i-th encoder, MultiHeadAtt(I2, I2, I2) represents the multi-head self-attention operation of the input matrix I2, and + represents matrix addition; Window Encoder converts the entire sequence The encoding is used as the value and key, and the encoded input window is used as the query matrix for attention operation; then a Layer Norm layer is used for normalization operation; the multi-head attention layer that follows represents the output of the first Window Encoder And the one obtained by Layer Norm The multi-head self-attention operation is performed to obtain ;at last, and After a Layer Norm layer is normalized, we get .
[0032] Preferably, according to the present invention, the energy consumption prediction of the refrigeration system is realized by using a trained energy consumption prediction model; comprising:
[0033] Initial energy consumption prediction stage: The first Window Encoder uses context-based attention to convert the input window W into a compressed representation , the compressed representation Through the first Decoder An output is obtained, and the output of the first Decoder is used as the input of the second WindowEncoder and the second Decoder, and the output obtained is the preliminary energy consumption prediction result Output1;
[0034] Final energy consumption prediction stage: The output Output1 and the deviation of the input are connected to the input window W and input into the first Window Encoder and the third Decoder to obtain the final prediction data of timestamp t+1, that is, the final energy consumption prediction result Output2.
[0035] Preferably, according to the present invention, the goal of the second decoder is to reduce the difference between the predicted data and the real data, and the goal of the third decoder is to amplify the difference between the predicted data and the real data. Therefore, the training goal of the energy consumption prediction model is:
[0036] ;
[0037] Among them, Decoder2 is the second Decoder, and Decoder 3 is the third Decoder;
[0038] The loss function L of the energy consumption prediction model is:
[0039] ;
[0040] Among them, Output1 is the preliminary energy consumption prediction, Output2 is the final energy consumption prediction result, and n represents the nth iteration in the training process. is a hyperparameter that approaches 1 on the right.
[0041] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of a method for predicting energy consumption of a refrigeration system based on deep learning when executing the computer program.
[0042] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for predicting energy consumption of a refrigeration system based on deep learning.
[0043] A refrigeration system energy consumption prediction system based on deep learning, comprising:
[0044] The energy consumption prediction model building and training module is configured to: build and train the energy consumption prediction model;
[0045] The energy consumption prediction module is configured as follows: after preprocessing the time series to be predicted, the energy consumption prediction of the refrigeration system is realized through the trained energy consumption prediction model; wherein, in the energy consumption prediction model, the sequence data including the original time series data and the target time series data are used as the input sequence, and are processed and converted into hidden representations to capture the patterns and features in the sequence; relevant information is captured to obtain the predicted value of energy consumption.
[0046] The beneficial effects of the present invention are:
[0047] 1. The energy consumption prediction model of the present invention has high prediction accuracy for the energy consumption of the refrigeration system, can effectively guide the operation of the system, and avoid energy waste and unnecessary energy consumption.
[0048] 2. The energy consumption prediction model of the present invention has strong generalization ability and is suitable for energy consumption prediction of high-temperature storage and low-temperature storage. It can be better applied in actual scenarios and provide reliable support for decision-making. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram of the network architecture of the ANFormer model of the present invention;
[0050] Figure 2 It is a schematic diagram of the results including the real energy consumption value and the predicted energy consumption value obtained after the data set in the embodiment of the present invention is run in the ANFormer model of the present invention;
[0051] Figure 3 It is a schematic diagram of the results including the actual energy consumption value and the predicted energy consumption value obtained after the data of the high temperature system in the embodiment of the present invention is run in the ANFormer model of the present invention. DETAILED DESCRIPTION
[0052] The present invention will be further defined below in conjunction with the accompanying drawings and embodiments, but is not limited thereto.
[0053] Example 1
[0054] A method for predicting energy consumption of a refrigeration system based on deep learning, comprising:
[0055] Build and train energy consumption prediction models;
[0056] After preprocessing the time series to be predicted, the energy consumption prediction of the refrigeration system is realized through the trained energy consumption prediction model;
[0057] Among them, in the energy consumption prediction model, the sequence data including the original time series data and the target time series data are taken as the input sequence, and processed and converted into hidden representation to capture the patterns and features in the sequence; the decoder takes the output of the encoder as input, captures relevant information through the FeedForward layer, and finally obtains the predicted value of energy consumption after passing through the sigmoid layer.
[0058] Example 2
[0059] The method for predicting energy consumption of a refrigeration system based on deep learning according to Example 1 is different in that:
[0060] Energy consumption prediction is very helpful for energy-saving control of refrigeration systems. Consider a dataset containing time series information and corresponding observations of 119 parameters of a cold storage at each timestamp (such as compressor, condenser, fan, indoor and outdoor temperature, etc.). The time series information is a timestamp sequence with an observation / data point size of T: ; Among them, the data point corresponding to each timestamp t is , and ∀t has , R represents the real number field, m represents the vector The number of real values in; when m=1, the timestamp series is a univariate time series;
[0061] The present invention defines a prediction problem, which is a regression problem.
[0062] The energy consumption prediction problem of the refrigeration system is defined as: given a training timestamp sequence X, for any length and the unknown test time series has the same modality as the training timestamp series , predict the trend and specific value of energy consumption y in several future time steps; that is, predict ,in, Represents the energy consumption between time t-1 and time t.
[0063] Preprocessing, including normalization and missing value filling operations. Before formal training, the training data has been preprocessed to improve the adaptability of the energy consumption prediction model to different data conditions.
[0064] This embodiment uses the historical operating data of low-temperature cold storage in East China as the experimental data set. The experimental data set has 119 parameters that affect the energy consumption of the refrigeration system, including the operating parameters of the main cold storage components such as compressors, condensers, and fans, as well as environmental parameters such as indoor and outdoor temperatures. The energy consumption value that needs to be predicted in this embodiment is one of these 119 parameters. Since the obtained data is heterogeneous, in order to eliminate the influence of dimensions, the data is normalized. In order to avoid the model learning too much variables with large values, and insufficient training of variables with small values, which affects the model effect. Here, all the acquired data are standardized using the maximum and minimum normalization method.
[0065] The normalization formula is as follows:
[0066] ;
[0067] in, is the current value of a certain attribute of a certain node, min(X) is the minimum value of the attribute of all nodes, and max(X) is the maximum value of the attribute of all nodes. Is a constant. Prevents the denominator of the normalized formula from being zero. If an attribute is a Boolean value, normalize it to 0 or 1. The values of the standardized data are between [0, 1].
[0068] The energy consumption prediction model, namely the ANFormer model, includes two Window Encoder models, two Encoders, and three Decoders;
[0069] The two Window Encoder models include the first Window Encoder ( Figure 1 Window Encoder 1), the second Window Encoder ( Figure 1 The two encoders include the first encoder ( Figure 1 Encoder 1) and the second Encoder ( Figure 1 The three decoders include the first decoder ( Figure 1 Decoder 1 in the second Decoder ( Figure 1 Decoder 2) and the third Decoder ( Figure 1 Decoder 3 in );
[0070] The Window Encoder model is an important component in the ANFormer model. The Window Encoder model is used to convert the input sequence data into hidden representations for subsequent prediction tasks. The input sequence data is processed by the Transformer encoder to capture important information and features in the data; the Encoder is responsible for encoding the complete source sequence to capture relevant information in the input sequence, and the Encoder's encoding output enters the Window Encoder, making it easier for the Window Encoder to learn high-quality feature information; during training, the Decoder is responsible for calculating the loss between the generated sequence and the true target sequence while generating the target sequence, and adjusting the model parameters through back propagation to minimize the loss; in the test phase, the hidden representation output by the encoder is input into the Decoder and converted to obtain the target prediction sequence.
[0071] like Figure 1 As shown in the figure, Window Encoder plays a connecting role in the model and is a bridge connecting the entire model. The Window Encoder model uses a self-attention mechanism to process data within a time window; this attention mechanism can help the model focus on the important parts of the time series data and capture the dependencies between different time steps, thereby better encoding the information of the time series. In order to help the model understand the order and temporal relationship of the time series data, position encodings are added to the input data; these position encodings can provide information about the position of the data on the time axis, allowing the model to better understand the order of the time series data. Therefore, the Window Encoder model can effectively process time series and capture the temporal correlations and patterns in the data.
[0072] The input data of the Window Encoder model is a time series data including multiple features, including historical power consumption data, cold storage status (such as suction temperature, evaporation pressure, exhaust temperature, exhaust pressure, etc.) and timestamp information; in order to better capture the local patterns and time dependencies in the sequence data, the input data is first divided into a series of fixed-length time windows; each time window includes continuous data fragments, which usually have a certain overlap to ensure that important time information is not missed. After the window is divided, the data of each time window is encoded through the embedding layer; the role of the embedding layer is to convert the original feature representation into a continuous vector representation, which helps the model better understand the input data and reduces the dimension of the feature space.
[0073] Next, the vector sequence processed by the embedding layer is passed to the Transformer encoder, namely WindowEncoder; for Window Encoder, position encoding is applied to the input window Input Window to obtain I2;
[0074] The self-attention mechanism in the Window Encoder is modified to mask out data at subsequent positions. The purpose of this modification is to prevent the decoder from exploiting information from future timestamp values to decode the current data point during training. Since all data Input Window and src are provided at the same time, this modification makes parallel training possible. The Window Encoder will do the following:
[0075] ;
[0076] ;
[0077] ;
[0078] ;
[0079] Among them, I i Represents the input of the i-th encoder, MultiHeadAtt(I2, I2, I2) represents the multi-head self-attention operation of the input matrix I2, and + represents matrix addition; Window Encoder converts the entire sequence The encoding of is used as the value and key, and the encoded input window is used as the query matrix for attention operation; as shown in the above formula, we get Here, multi-head attention with mask is applied to hide the window sequence of future timestamps in the same batch of inputs; because the present invention provides the complete input sequence to the model until the tth timestamp as input, it allows the model to encapsulate and utilize a larger context compared to the bounded, limited context in the prior art. Next, a Layer Norm layer is used for normalization; the multi-head attention layer that follows represents the output of the first Window Encoder And the one obtained by Layer Norm The multi-head self-attention operation is performed to obtain ;at last, and After a Layer Norm layer is normalized, we get The window encoder focuses on processing sequence data within the time window and capturing the correlations therein, while the first encoder is the initial processor in the model, responsible for preliminary encoding or processing of the initial input data.
[0080] The energy consumption prediction of the refrigeration system is realized through the trained energy consumption prediction model; including:
[0081] Initial energy consumption prediction stage: The first Window Encoder uses context-based attention to convert the input window W into a compressed representation , the compressed representation Through the first Decoder An output is obtained. In order to better learn the sequence, the output of the first Decoder is used as the input of the second Window Encoder and the second Decoder, and the output is the preliminary energy consumption prediction result Output1; thus, the observation data of the previous timestamp t is used as input through two encoders and decoders with the same architecture, and the output is the data prediction of timestamp t+1.
[0082] Final energy consumption prediction stage: connect the output Output1 and the input deviation to the input window W and input them into the first Window Encoder and the third Decoder to obtain the final prediction data of timestamp t+1, which is the final energy consumption prediction result Output2. The purpose of using the deviation of the first step as a prerequisite for modifying the weight in the second step is to give a higher neural network activation to a specific input subsequence in order to extract short-term time trends. The advantage of using two-step autoregressive reasoning is that adversarial training can improve versatility and make the model more stable to the input sequence.
[0083] The energy consumption prediction model is an adversarial model. The goal of the second decoder is to reduce the difference between the predicted data and the real data, and the goal of the third decoder is to amplify the difference between the predicted data and the real data. Therefore, the training objectives of the energy consumption prediction model are:
[0084] ;
[0085] Among them, Decoder2 is the second Decoder, and Decoder 3 is the third Decoder;
[0086] To achieve this, the loss function L of the energy consumption prediction model is:
[0087] ;
[0088] In order to stabilize the training, a higher weight is given to the loss in the initial energy consumption prediction stage, i.e. , giving a lower weight to the adversarial loss in the final energy consumption prediction stage, i.e. As the predictions of the initial energy consumption prediction phase get closer to the input, the adversarial loss weights are gradually increased.
[0089] Energy consumption prediction is a regression problem. The mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE) and prediction result table are used to evaluate the model performance. The smaller the MSE, RMSE and MAE, the better the model prediction effect. MSE and RMSE are sensitive to outliers, while MAE is relatively less sensitive to outliers. These indicators can effectively show the difference between the predicted energy consumption value and the actual energy consumption value, and intuitively show the accuracy of the prediction.
[0090] In this embodiment, 80% of the training set samples are used for training and 20% for testing. The training samples are trained for 50 epochs on the ANFormer model, and then the test samples are used for testing. In the training process, the loss value after the first epoch is about 0.056430. As the number of training epochs increases, the loss decreases continuously. After the 50th epoch, the loss value is about 0.000686. The result diagram containing the actual energy consumption value and the predicted energy consumption value obtained after the data set is run in the model is as follows: Figure 2 shown. Figure 2 In the figure, the blue line represents the actual value of energy consumption, the orange line represents the predicted value of energy consumption obtained by the ANFormer model in this embodiment, the horizontal axis represents the samples used for testing (a total of 1200), and the vertical axis represents the value after normalization of energy consumption. Figure 2 It can be seen that both the prediction of energy consumption value and the prediction of the trend of overall energy consumption changing over time are quite impressive and the prediction quality is good.
[0091] The MSE value obtained on the ANFormer model is about 0.018746, the RMSE value is about 0.136916, and the MAE value is about 0.077449. From the index values, the energy consumption predicted by the ANFormer model has a high accuracy and a small prediction error, and the effect achieved in energy consumption prediction is relatively ideal.
[0092] To evaluate the performance of the ANFormer model, it is compared with seven multivariate time series forecasting methods, namely FreTS, Linear, Dlinear (see: Zeng A, Chen M, Zhang L, et al. Are transformers effective for time series forecasting?[C] / / Proceedings of theAAAI conference on artificial intelligence. 2023, 37(9): 11121-11128.), Nlinear, Transformer, AutoFormer (see: Wu H, Xu J, Wang J, et al. Autoformer: Decomposition transformerswith auto-correlation for long-termseries forecasting[J]. Advances in NeuralInformation Processing Systems,2021, 34: 22419-22430.) and Informer (see: Zhou H, Zhang S, Peng J, et al. Informer: Beyond efficient transformer for longsequence time-seriesforecasting[C] / / Proceedings of the AAAI conference on artificial intelligence.2021, 35(12): 11106-11115.).
[0093] The FreTS model is simple and effective. It is based on word frequency statistics and does not require complex mathematical models. It is widely used in data mining tasks, but it has some limitations when processing text, such as being easily affected by noise. The Linear model is limited by the assumption of linear relationships, has limited ability to fit complex data patterns, requires feature engineering to extract effective features, and is sensitive to outliers. DLinear is a linear model that is not easy to capture more complex nonlinear relationships. At the same time, the data dimension of our refrigeration system is relatively high. Using DLinear may make the model too complex and prone to overfitting. Although the NLinear model can capture nonlinear relationships in time series well, its use is often restricted due to its high data requirements, risk of overfitting, and poor parameter interpretability. The Transformer model has the disadvantages of high computing resource requirements and difficulty in processing long sequences. AutoFormer has potential advantages in optimizing the Transformer architecture, and the Informer model performs well in time series prediction tasks, but both models have the characteristics of high computing cost and insufficient generalization ability, making it difficult for them to achieve excellent performance in energy consumption prediction.
[0094] The above seven models are trained and tested on the same refrigeration data set, and the running results of each model are shown in Table 1.
[0095] Table 1. Results of each model after training and testing on the refrigeration dataset.
[0096] Model MSE RMSE MAE ANFormer 0.01874587 0.13691556 0.07744891 FreTS 0.01934974 0.13910334 0.05126724 DLinear 0.02088637 0.14452116 0.05594395 NLinear 0.02183413 0.14776376 0.05455883 Transformer 0.77160442 0.87841017 0.39935496 AutoFormer 0.60904908 0.78041597 0.38407141 Informer 0.89623386 0.94669629 0.43386963 Linear 0.73062575 0.85476649 0.37735114
[0097] As can be seen from Table 1, the MSE and RMSE values of the ANFormer model are better than those of the FreTS, DLinear and NLinear models, but the MAE value is worse than them. Compared with the Linear, Transformer, AutoFormer and Informer models, the three index values of the ANFormer model are much better than their values. Compared with the FreTS model, the MSE index of the ANFormer model is optimized by about 3.12%, and the MAE index value is about 51.07% worse than the FreTS model. Compared with the DLinear model, the MSE index of the ANFormer model is optimized by about 10.25%, and the MAE index value is about 38.44% worse than the DLinear model. Compared with the NLinear model, the MSE index of the ANFormer model is optimized by about 14.14%, and the MAE index value is about 41.95% worse than the NLinear model. Compared with the other four models, ANFormer's MSE index value is about 97.57% better than Transformer, about 96.92% better than AutoFormer, about 97.91% better than Informer, and about 97.43% better than Linear. The RMSE index value is about 84.41% better than Transformer, about 82.46% better than AutoFormer, about 85.54% better than Informer, and about 83.98% better than Linear. The MAE index value is about 80.61% better than Transformer, about 79.83% better than AutoFormer, about 82.15% better than Informer, and about 79.48% better than Linear.
[0098] Lower MSE and RMSE indicate that the model is more sensitive to large error values because they penalize the square of the error. This shows that the ANFormer model is more effective in dealing with outliers than the FreTS, DLinear, and NLinear models, has better robustness, and has a higher ability to generalize to new data. At the same time, lower MSE and RMSE reflect that the ANFormer model has better overall prediction performance because they measure the squared difference between the model's predicted value and the true value.
[0099] The ANFormer model is far superior to the Linear, Transformer, AutoFormer and Informer models in terms of prediction effect, outlier processing, and generalization ability.
[0100] In order to verify the generalization of the ANFormer model, not only cold storage data but also high temperature system data were used for energy consumption prediction. The result diagram containing the actual energy consumption value and the predicted energy consumption value after the data set was run in the ANFormer model is as follows: Figure 3 The effect is also ideal.
[0101] In addition, the present invention also uses the data of the high-temperature cold storage system for training and testing on seven multivariate time series prediction models, namely FreTS, Linear, DLinear, Nlinear, Transformer, AutoFormer and Informer. The data set of the high-temperature cold storage includes 162 parameters, and the final operation results of each model are shown in Table 2.
[0102] Table 2 Results of each model after training and testing using data from a high-temperature cold storage system;
[0103] Model MSE RMSE MAE DAFormer 0.02288168 0.15126692 0.06324994 DLinear 0.04466644 0.21134435 0.09811158 NLinear 0.04528746 0.21280849 0.09498367 Transformer 0.08222475 0.28674859 0.16187391 AutoFormer 0.04621442 0.21497540 0.11125834 Informer 0.09257044 0.30425391 0.16816224 Linear 0.04707908 0.21697715 0.10347084
[0104] As can be seen from Table 2, the MSE, RMSE, and MAE values of the ANFormer model are lower than those of the other seven models. This shows that the ANFormer model performs well in energy consumption prediction, has a small prediction error, and has good stability and generalization.
[0105] In summary, the present invention proposes an energy consumption prediction model (ANFormer) based on an adversarial network and a Transformer network, which can predict the trend and specific value of energy consumption in several future time steps. The ANFormer model encodes and models the input sequence through a self-attention mechanism and a feedforward neural network. This enables the model to use the time dependency and feature information in the sequence to predict the target variable in the future time step. The ANFormer model has achieved relatively ideal results in both numerical prediction and trend prediction of energy consumption, and its MSE, RMSE and MAE index values and the accuracy and generalization of energy consumption prediction are excellent. Accurate prediction of the energy consumption of the refrigeration system can help the energy-saving and environmentally friendly design of the refrigeration system and reduce the operating costs of the enterprise. Therefore, the ANFormer model has very good application and promotion value.
[0106] Example 3
[0107] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the deep learning-based refrigeration system energy consumption prediction method described in Example 1 or 2 are implemented.
[0108] Example 4
[0109] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the deep learning-based refrigeration system energy consumption prediction method described in Example 1 or 2.
[0110] Example 5
[0111] A refrigeration system energy consumption prediction system based on deep learning, comprising:
[0112] The energy consumption prediction model building and training module is configured to: build and train the energy consumption prediction model;
[0113] The energy consumption prediction module is configured as follows: after preprocessing the time series to be predicted, the energy consumption prediction of the refrigeration system is realized through the trained energy consumption prediction model; wherein, in the energy consumption prediction model, the sequence data including the original time series data and the target time series data are taken as the input sequence, and are processed and converted into hidden representations to capture the patterns and features in the sequence; the decoder takes the output of the encoder as input, captures relevant information through the FeedForward layer, and finally obtains the predicted value of energy consumption after passing through the sigmoid layer.
Claims
1. A method for predicting energy consumption of a refrigeration system based on deep learning, characterized in that: include: Build and train energy consumption prediction models; After preprocessing the time series to be predicted, the energy consumption prediction of the refrigeration system is realized through the trained energy consumption prediction model; Among them, in the energy consumption prediction model, the sequence data including the original time series data and the target time series data are used as the input sequence, and are processed and converted into hidden representations to capture the patterns and features in the sequence; Capture relevant information and obtain predicted values for energy consumption; The energy consumption prediction model, namely the ANFormer model, includes two Window Encoder models, two Encoders, and three Decoders; The two Window Encoder models include a first Window Encoder and a second Window Encoder; the two Encoders include a first Encoder and a second Encoder; the three Decoders include a first Decoder, a second Decoder and a third Decoder; The Window Encoder model is used to convert the input sequence data into hidden representations. By processing the input sequence data through the Transformer encoder, important information and features in the data are captured. The Encoder is responsible for encoding the complete source sequence to capture relevant information in the input sequence. The Encoder's encoding output enters the Window Encoder, making it easier for the Window Encoder to learn high-quality feature information. During training, the Decoder is responsible for calculating the loss between the generated sequence and the true target sequence while generating the target sequence, and adjusting the model parameters through back propagation to minimize the loss. In the test phase, the hidden representation output by the encoder is input into the Decoder and converted to obtain the target prediction sequence. The input data of the Window Encoder model includes time series data with multiple features, including historical power consumption data, cold storage status, and timestamp information.
2. The method for predicting energy consumption of a refrigeration system based on deep learning according to claim 1, characterized in that: For a data set containing time series information and corresponding observations, the time series information is a timestamp sequence of observation / data point size T: X = {x1,...,x t ...,x T }; where the data point corresponding to each timestamp t is x t ,and There is x t ∈R m , R represents the real number field, m represents the vector x t The number of real values in; when m=1, the timestamp sequence is a univariate time series; The energy consumption prediction problem of the refrigeration system is defined as: given a training timestamp sequence X, for any length and the unknown test time series has the same modality as the training timestamp series Predict the trend and specific value of energy consumption y in several future time steps; that is, predict Among them, y t Represents the energy consumption between time t-1 and time t.
3. The method for predicting energy consumption of a refrigeration system based on deep learning according to claim 1, characterized in that: Preprocessing, including normalization and missing value filling operations.
4. The method for predicting energy consumption of a refrigeration system based on deep learning according to claim 3, characterized in that: Further preferably, the normalization formula is as follows: Among them, x t is the current value of a certain attribute of a node, min(X) is the minimum value of the attribute of all nodes, max(X) is the maximum value of the attribute of all nodes, ∈ * is a constant.
5. The method for predicting energy consumption of a refrigeration system based on deep learning according to claim 1, characterized in that: The Window Encoder model uses a self-attention mechanism to process data within a time window; adding position encoding to the input data; The input data is first divided into a series of fixed-length time windows; each time window includes a continuous data segment. After the window is divided, the data of each time window is encoded through the embedding layer; Next, the vector sequence processed by the embedding layer is passed to the Transformer encoder, namely WindowEncoder; for Window Encoder, position encoding is applied to the input window Input Window to obtain I2.
6. The method for predicting energy consumption of a refrigeration system based on deep learning according to claim 5, characterized in that: Window Encoder does the following: Among them, I i Represents the input of the i-th encoder, MultiHeadAtt(I2, I2, I2) represents the multi-head self-attention operation of the input matrix I2, and + represents matrix addition; Window Encoder converts the entire sequence The encoding is used as the value and key, and the encoded input window is used as the query matrix for attention operation; then a Layer Norm layer is used for normalization operation; the multi-head attention layer that follows represents the output of the first Window Encoder And the one obtained by Layer Norm The multi-head self-attention operation is performed to obtain at last, and After a Layer Norm layer is normalized, we get 7. The method for predicting energy consumption of a refrigeration system based on deep learning according to claim 1, characterized in that: The energy consumption prediction of the refrigeration system is realized through the trained energy consumption prediction model; including: Initial energy consumption prediction stage: The first Window Encoder uses context-based attention to convert the input window W into a compressed representation Compress the representation Through the first Decoder An output is obtained, and the output of the first Decoder is used as the input of the second Window Encoder and the second Decoder, and the output obtained is the preliminary energy consumption prediction result Output1; Final energy consumption prediction stage: The output Output1 and the deviation of the input are connected to the input window W and input into the first Window Encoder and the third Decoder to obtain the final prediction data of timestamp t+1, that is, the final energy consumption prediction result Output2.
8. The method for predicting energy consumption of a refrigeration system based on deep learning according to claim 1, characterized in that: The goal of the second decoder is to reduce the difference between the predicted data and the real data, and the goal of the third decoder is to amplify the difference between the predicted data and the real data. The training objectives of the energy consumption prediction model are: Among them, Decoder2 is the second Decoder, and Decoder 3 is the third Decoder; The loss function L of the energy consumption prediction model is: L=ε -n ||Output1-W||2+(1-ε -n )||Output2-W||2 Among them, Output1 is the preliminary energy consumption prediction, Output2 is the final energy consumption prediction result, n represents the nth iteration in the training process, and ε is a hyperparameter that is right-approximated to 1.
9. A refrigeration system energy consumption prediction system based on deep learning, characterized in that: include: The energy consumption prediction model building and training module is configured to: build and train the energy consumption prediction model; The energy consumption prediction module is configured to: pre-process the time series to be predicted, and then predict the energy consumption of the refrigeration system through the trained energy consumption prediction model; wherein, in the energy consumption prediction model, the sequence data including the original time series data and the target time series data are used as input sequences, and are processed and converted into hidden representations to capture patterns and features in the sequences; Capture relevant information and obtain predicted values for energy consumption; The energy consumption prediction model, namely the ANFormer model, includes two Window Encoder models, two Encoders, and three Decoders; The two Window Encoder models include a first Window Encoder and a second Window Encoder; the two Encoders include a first Encoder and a second Encoder; the three Decoders include a first Decoder, a second Decoder and a third Decoder; The Window Encoder model is used to convert the input sequence data into hidden representations. By processing the input sequence data through the Transformer encoder, important information and features in the data are captured. The Encoder is responsible for encoding the complete source sequence to capture relevant information in the input sequence. The Encoder's encoding output enters the Window Encoder, making it easier for the Window Encoder to learn high-quality feature information. During training, the Decoder is responsible for calculating the loss between the generated sequence and the true target sequence while generating the target sequence, and adjusting the model parameters through back propagation to minimize the loss. In the test phase, the hidden representation output by the encoder is input into the Decoder and converted to obtain the target prediction sequence. The input data of the Window Encoder model includes time series data with multiple features, including historical power consumption data, cold storage status, and timestamp information.
