Short-term carbon emission prediction method and device, computer readable storage medium and product
By combining the short-term carbon emission prediction model of the gated cycle GRU and the fast Fourier transform FFT module, the time domain and frequency domain characteristics of the power carbon emission data are extracted, which solves the problem of insufficient accuracy of minute-level carbon emission prediction in the power industry and achieves It provides efficient carbon emission prediction and provides technical support for carbon emission reduction policies.
Patent Information
- Application Number
- CN202410616190.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-09-10
AI Technical Summary
Existing technology is difficult to achieve minute-level carbon emission predictions in the power industry, resulting in insufficient accuracy of carbon emission predictions.
The parallel gated cycle GRU module and the fast Fourier transform FFT module are combined with the short-term carbon emission prediction model of the fully connected layer to extract the time domain and frequency domain characteristics of the power carbon emission data and conduct minute-level predictions.
It has significantly improved the accuracy of carbon emission prediction, achieved minute-level carbon emission prediction in the power industry, and provided a technical basis for formulating accurate carbon emission reduction policies.
Smart Images

Figure CN118628121A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of carbon emission prediction in the electric power industry, and in particular to a short-term carbon emission prediction method, device, computer-readable storage medium and product. Background Art
[0002] Carbon emissions from the energy industry are one of the main sources of climate change and environmental pollution, and carbon emissions from the power industry account for a considerable proportion. Based on the requirements of existing strategies, new technologies need to be adopted to reduce carbon dioxide emissions from the power industry. This requires accurate prediction of carbon emissions from electricity. Through accurate carbon emission prediction, we can clearly understand the carbon dioxide emissions in different regions at different time periods and grasp their development trends.
[0003] In recent years, there have been relatively few studies on the prediction of carbon emissions from electricity. The prediction methods used in the carbon emission prediction work carried out in other industries such as construction and transportation are statistical methods and machine learning methods. The statistical methods mainly include integrated moving average autoregressive model, exponential smoothing method, etc. These methods are usually based on years and most of them are single variable predictions. Traditional machine learning requires manual selection of appropriate features and algorithms, data preprocessing and model tuning, which greatly increases the workload. Deep learning has shown great advantages in processing large-scale complex nonlinear data, and has gradually become the mainstream method in carbon emission prediction. However, the existing prediction methods based on deep learning cannot predict carbon emissions from electricity at the minute level, which leads to the need to improve the accuracy of carbon emission prediction. Summary of the invention
[0004] The purpose of the present invention is to provide a short-term carbon emission forecasting method, device, computer-readable storage medium and product, which can realize minute-level carbon emission forecasting in the power industry while ensuring the accuracy of the forecast results.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A short-term carbon emission prediction method, the method comprising:
[0007] Obtaining raw data of carbon emissions from electricity; the raw data of carbon emissions from electricity is carbon emission data collected every set minutes and the corresponding carbon emissions;
[0008] Preprocessing the raw data of power carbon emissions to obtain a time series of power carbon emissions; the preprocessing includes: missing value processing, normalization and segmentation;
[0009] The short-term carbon emission prediction model is trained using the time series of electric power carbon emission; the short-term carbon emission prediction model comprises: a parallel gated recurrent GRU module and a fast Fourier transform FFT module and a fully connected layer; the gated recurrent GRU module is used to extract the time domain features of the time series of electric power carbon emission; the fast Fourier transform FFT module is used to extract the frequency domain features of the time series of electric power carbon emission;
[0010] The trained short-term carbon emission prediction model is used to predict the original data of electricity carbon emissions to be predicted.
[0011] Optionally, the preprocessing of the raw data of electricity carbon emissions to obtain a time series of electricity carbon emissions specifically includes:
[0012] Delete and fill missing values in the original data of electricity carbon emissions;
[0013] Normalize the data after missing value processing;
[0014] The normalized data is divided into training set, validation set and test set according to the proportion.
[0015] Optionally, the gated recurrent GRU module uses two layers of connected cells; the two layers of cells transmit time domain features and output prediction results of the time domain features through a fully connected layer.
[0016] Optionally, the fast Fourier transform FFT module includes the following formula:
[0017] x=F -1 [F(x)×W];
[0018] Where x is the data sample, F is the fast Fourier transform, W is the randomly generated weight matrix, and F -1 is the inverse Fourier transform.
[0019] A computer device for implementing the short-term carbon emission prediction method; the computer device comprises: a power carbon emission time series construction unit, a model parameter setting unit, a model training unit and a power short-term carbon emission prediction unit;
[0020] The power carbon emission time series construction unit is used to obtain the original data of power carbon emission; pre-process the original data of power carbon emission to obtain the time series of power carbon emission;
[0021] The model parameter setting unit and the model training unit are used to train the short-term carbon emission prediction model using the time series of electricity carbon emission;
[0022] The prediction unit of short-term carbon emissions of electricity is used to predict the original data of carbon emissions of electricity to be predicted by using the trained short-term carbon emissions prediction model.
[0023] A computer-readable storage medium stores a computer program, which implements the short-term carbon emission prediction method when executed by a processor.
[0024] A computer program product comprises a computer program, which implements the short-term carbon emission prediction method when executed by a processor.
[0025] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: the present invention provides a short-term carbon emission prediction method, device, computer-readable storage medium and product, and the short-term carbon emission prediction model includes: a parallel gated recurrent unit module (Gate Recurrent Unit, GRU) and a fast Fourier transform module (Fast Fourier Transform, FFT) and a fully connected layer; the gated recurrent GRU module is used to extract the time domain characteristics of the time series of power carbon emissions; the fast Fourier transform module is used to extract the frequency domain characteristics of the time series of power carbon emissions; the preprocessed data is respectively input into the gated recurrent module in the time domain and the fast Fourier transform module in the frequency domain for parallel processing, and finally the time domain and frequency domain characteristics are integrated to output the final prediction result; the present invention integrates the time domain and frequency domain characteristics of the data through the short-term carbon emission prediction model, significantly improves the accuracy of carbon emission prediction, and realizes the minute-level prediction of power carbon emissions, providing a technical basis and reference for achieving the dual carbon goals and formulating accurate carbon emission reduction policies. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] 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 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.
[0027] Figure 1 A schematic diagram of a short-term carbon emission prediction method provided in Example 1 of the present invention;
[0028] Figure 2 Schematic diagram of the predicted experimental results;
[0029] Figure 3 A schematic diagram of the structure of a computer device provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The purpose of the present invention is to provide a short-term carbon emission forecasting method, device, computer-readable storage medium and product, which can realize minute-level carbon emission forecasting in the power industry while ensuring the accuracy of the forecast results.
[0032] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0033] Example 1
[0034] like Figure 1 As shown, the present invention provides a short-term carbon emission prediction method, the method comprising:
[0035] S101, obtaining the original data of carbon emissions from electricity; the original data of carbon emissions from electricity is the carbon emission data collected every set minutes and the corresponding carbon emissions; the source of the original data of carbon emissions from electricity is usually coal, oil, natural gas, large hydropower, batteries, nuclear energy, loads, etc., and its carbon emissions are collected, stored and transmitted through advanced measuring devices.
[0036] For example, relevant data is obtained from the official website of the California Electric System Operator in the United States. The download format is CSV and synthesized. The data is from February 1, 2023 to April 5, 2023, a total of 64 days, and data is collected every 5 minutes. The data sources include renewable energy, natural gas, large hydropower, imports, batteries, nuclear energy, coal, load, and carbon dioxide emissions.
[0037] S102, preprocessing the original data of power carbon emissions to obtain a time series of power carbon emissions; the preprocessing includes: missing value processing, normalization and segmentation;
[0038] S102 deletes and fills missing values in the original data of electricity carbon emissions;
[0039] Normalize the data after missing value processing; normalization makes the data have more consistent mean and variance, while reducing non-stationary information in the data; data normalization is done through the RevIN module, which normalizes the data; in the process of data normalization, first calculate each instance of the input data The mean and variance of are shown in formula (1) and (2):
[0040]
[0041]
[0042] Normalize based on the data variance and mean:
[0043]
[0044] In the formula, γ, β∈R K is the learned affine parameter vector.
[0045] The normalized data is divided into training set, validation set and test set in proportion. The training set is used to fit the data samples; the validation set is used to adjust the hyperparameters of the time-frequency prediction model; and the test set is used to verify the generalization performance of the time-frequency prediction model.
[0046] S103, using the time series of electricity carbon emissions to train a short-term carbon emission prediction model; the short-term carbon emission prediction model includes: a parallel gated recurrent GRU module and a fast Fourier transform FFT module and a fully connected layer; the gated recurrent GRU module is used to extract the time domain characteristics of the time series of electricity carbon emissions; the fast Fourier transform FFT module is used to extract the frequency domain characteristics of the time series of electricity carbon emissions; finally, the GRU-FFT short-term carbon emission prediction model is trained, verified and tested by integrating the information in the time domain and frequency domain to obtain the trained GRU-FFT short-term carbon emission prediction model.
[0047] The gated recurrent GRU module uses two layers of connected cells; the two layers of cells transmit time domain features and output the prediction results of the time domain features through the fully connected layer.
[0048] The gated recurrent GRU module contains two gated units: an update gate and a reset gate;
[0049] Update gate z t The operation is as follows:
[0050] z t =σ(W z ·[h t-1 ,x t ]) (4)
[0051] Reset gate t The operation is as follows:
[0052] r t =σ(W r ·[h t-1 ,x t ]) (5)
[0053] Cell Status:
[0054]
[0055]
[0056] In the formula, h t are the new cell vector, the hidden state vector, and W Z , W r , W are the weight matrices of the update gate, the reset gate, and the candidate hidden state, respectively. σ(·) is the sigmoid function, which is used to transform the data into a value in the range of 0-1, thus acting as a gating signal. tanh(·) is the activation function, which is used to scale the data to the range of -1 to 1. ⊙Multiply two matrices of the same type.
[0057] The Fast Fourier Transform (FFT) module first converts the preprocessed time domain data into a matrix in the frequency domain, and then multiplies the initialized weight matrix with the transformed matrix, and continuously updates the weight matrix through back propagation. The Fast Fourier Transform (FFT) module includes the following formula:
[0058] x=F -1 [F(x)×W];
[0059] Where x is the data sample, F is the fast Fourier transform, W is the randomly generated weight matrix, and F -1 is the inverse Fourier transform.
[0060] The gated recurrent GRU module is configured with bidirectional connections and consists of 2 layers, each with 64 nodes. The learning rate is set as a dynamic parameter, and the initial learning rate is 0.0001. During the experiment, small batch input was used for training, with 32 batches of data input each time, and the length of each batch of data was 96. The optimizer was the Adam learner, predicting different fields of view.
[0061] In order to enhance the distribution shift performance of the GRU-FFT short-term carbon emission prediction model, the last value of each set of preprocessed data is subtracted. X represents the sample data in the time domain, and A represents the last value of each set of data:
[0062] X=XX[-1],A=X[-1];
[0063] The preprocessed data is input into the GRU module and FFT module for parallel processing:
[0064] X→GRU→x i ,X→FFT→x f ;
[0065] Fusion GRU module prediction value xi And the predicted value x of the FFT module f :
[0066] x i +x f =X out ;
[0067] The last value in each group of data is superimposed and subtracted on the above basis:
[0068] X ou t=X out +A;
[0069] Denormalize the output values:
[0070] X out →Reverse RevIN→X out ;
[0071] According to the training set, the GRU-FFT short-term carbon emission prediction model is used to fit the data samples;
[0072] According to the validation set, the GRU-FFT short-term carbon emission prediction model is used to adjust the model's hyperparameters;
[0073] Based on the test set, the GRU-FFT short-term carbon emission prediction model is used to verify the generalization performance of the model;
[0074] The mean square error (MSE), mean absolute error (MAE), and root mean square error (RMSE) are output as evaluation indicators respectively:
[0075]
[0076]
[0077]
[0078] In the formula, yi represents the true value of the i-th data sample, Represents the corresponding predicted value, and n represents the number of samples. The smaller the values of MSE, MAE, and RMSE, the closer the predicted results of the model are to the true values, and the better the performance of the model.
[0079] S104, using the trained short-term carbon emission prediction model to predict the original data of the electricity carbon emission to be predicted.
[0080] The trained short-term carbon emission prediction model is used to predict the electricity carbon emissions in the above-mentioned areas in the short term. The short-term time scale is 5 minutes, and different horizons are predicted {3, 6, 12, 24}.
[0081] In order to more intuitively reflect the performance of the time-frequency combined prediction model provided by the present invention, the embodiment of the present invention selects five prediction models including bidirectional long short-term memory network (BiLSTM), long short-term memory model (LSTM), gated recurrent unit (GRU), bidirectional gated recurrent unit (BGRU), and temporal convolutional network (TCN) for comparative analysis on a 5-minute prediction time scale, as shown in Tables 1 and 2.
[0082] Table 1 Comparison results of prediction performance MSE and MAE of different prediction models
[0083]
[0084]
[0085] Table 2 Comparison results of prediction performance RMSE of different prediction models
[0086]
[0087] By observing the data in Table 1 and Table 2, it can be seen that the proposed GRU-FFT short-term carbon emission prediction model outperforms all the comparison models in carbon emission prediction. This shows that the model can well capture the periodic changes and frequency domain characteristics in the data. In the comparison model, it can also be observed that GRU performs better than LSTM in short-term prediction. Although both LSTM and GRU use gating units to solve the long-term dependency problem, the gating mechanism of LSTM is more complex than that of GRU. This shows that the GRU model is better than the LSTM model in capturing the characteristics of carbon emission time series data. Compared with other models, the convolution-based TCN network model has the worst prediction performance. This shows that the TCN model is not as good as the recurrent neural network in capturing the periodicity of data. The GRU-FFT short-term carbon emission prediction model is compared with the comparison model, where the MSE improvement rate is 47.37%~76.28%, the MAE improvement rate is 35.16%~62.32%, and the RMSE improvement rate is 30.36%~54.20%.
[0088] To visualize the predicted experimental results, 12 prediction windows were selected, such as Figure 3 As shown. Figure 3 It can be observed that the prediction results of the GRU-FFT short-term carbon emission prediction model fit the overall emission distribution well, and have better prediction results than other models. This shows that the GRU-FFT short-term carbon emission prediction model is better than other comparative models in short-term prediction, indicating that the model captures the changes in frequency better.
[0089] In summary, the GRU-FFT short-term carbon emission prediction model performs well in short-term carbon emission prediction. Within different time spans, the model has strong generalization ability, good stability and predictive ability, and can effectively capture the periodicity and frequency domain characteristics of the data.
[0090] The present invention proposes a new short-term carbon emission prediction model, which integrates the characteristics of the time domain and frequency domain of the data, significantly improving the accuracy of carbon emission prediction. At the same time, the model directly processes the original data without complicated data cleaning. The present invention proposes a frequency domain feature extraction method that can effectively capture frequency domain information and extract global frequency domain features. The present invention realizes minute-level prediction of electricity carbon emissions, providing a technical basis and reference for the formulation of accurate carbon emission reduction policies.
[0091] Example 2
[0092] like Figure 2 As shown, a computer device provided by the present invention is used to implement a short-term carbon emission prediction method described in Example 1; the computer device includes: an electric power carbon emission time series construction unit, a model parameter setting unit, a model training unit, and an electric power short-term carbon emission prediction unit; the model parameter setting unit is connected to the electric power carbon emission time series construction unit to set the parameters of the short-term carbon emission prediction model;
[0093] The model training unit is connected to the model parameter setting unit to train, verify and test the short-term carbon emission prediction model with set parameters;
[0094] The prediction unit of short-term carbon emissions of electricity is connected to the model training unit to predict the trained short-term carbon emissions prediction model and obtain the prediction results within the prediction time period.
[0095] The power carbon emission time series construction unit is used to obtain the original data of power carbon emission; pre-process the original data of power carbon emission to obtain the time series of power carbon emission;
[0096] The model parameter setting unit and the model training unit are used to train the short-term carbon emission prediction model using the time series of electricity carbon emissions; the model parameter setting unit sets the parameters of time-frequency prediction, determines the number of layers and the number of neurons in each layer, and initializes parameters, such as weights and biases in the neural network. The model training unit uses the training set of electricity carbon emissions to fit the data samples according to the set parameters, uses the verification set of electricity carbon emissions to adjust the hyperparameters of the model, and uses the test set of electricity carbon emissions to verify the generalization performance of the model, thereby obtaining the trained short-term carbon emission prediction model.
[0097] The prediction unit of short-term carbon emissions of electricity is used to predict the original data of carbon emissions of electricity to be predicted by using the trained short-term carbon emissions prediction model.
[0098] The model parameter setting unit process includes:
[0099] Select the neural network module that processes data in the time domain, such as the convolutional neural network GCN, long short-term memory network LSTM, recurrent neural network RNN, etc.; select the Fourier transform module that processes data in the frequency domain, such as discrete Fourier transform DFT, fast Fourier transform FFT, etc.
[0100] Set parameters for the selected time domain and frequency domain modules respectively, determine the number of layers and the number of neurons in each layer, and initialize parameters, such as weights and biases in the neural network.
[0101] The process of model training unit includes:
[0102] Design appropriate loss functions according to specific tasks, such as cross entropy loss for classification tasks, mean square error loss for regression tasks, etc.
[0103] Choose a suitable optimization algorithm (such as SGD, Adam, etc.) to update the weights and biases of the model.
[0104] Use the training set data to train the model, calculate the output through forward propagation, and then update the model parameters through back propagation.
[0105] During the training process, validation sets are used regularly to evaluate the performance of the model to prevent overfitting, and hyperparameters such as learning rate, batch size, and regularization parameters are adjusted to optimize model performance.
[0106] After model training and parameter selection are completed, the test set is used to evaluate the model's generalization ability for unknown data to ensure that the model has good predictive ability in practical applications.
[0107] In the system provided by the present invention, a power carbon emission time series construction unit, a model parameter setting unit, a model training unit and a prediction unit for power short-term carbon emission are sequentially connected. The power carbon emission time series construction unit provides data processed by the time-frequency prediction model; the model parameter setting unit sets the parameters of the time-frequency prediction model; the model training unit trains the time-frequency prediction model with set parameters; and the prediction unit for power short-term carbon emission predicts the trained time-frequency prediction model. The present invention integrates the time domain and frequency domain characteristics of power carbon emission data, significantly improving the accuracy of short-term carbon emission prediction.
[0108] Example 3
[0109] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements a short-term carbon emission prediction method in Example 1.
[0110] Example 4
[0111] A computer program product includes a computer program, which implements a short-term carbon emission prediction method in embodiment 1 when executed by a processor.
[0112] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present invention may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided by the present invention may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0113] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0114] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A short-term carbon emission prediction method, characterized in that: The method comprises: Obtaining raw data of carbon emissions from electricity; the raw data of carbon emissions from electricity is carbon emission data collected every set minutes and the corresponding carbon emissions; Preprocessing the raw data of power carbon emissions to obtain a time series of power carbon emissions; the preprocessing includes: missing value processing, normalization and segmentation; The short-term carbon emission prediction model is trained using the time series of electric power carbon emission; the short-term carbon emission prediction model comprises: a parallel gated recurrent GRU module and a fast Fourier transform FFT module and a fully connected layer; the gated recurrent GRU module is used to extract the time domain features of the time series of electric power carbon emission; the fast Fourier transform FFT module is used to extract the frequency domain features of the time series of electric power carbon emission; The trained short-term carbon emission prediction model is used to predict the original data of electricity carbon emissions to be predicted.
2. A short-term carbon emission prediction method according to claim 1, characterized in that: The preprocessing of the raw data of power carbon emissions to obtain the time series of power carbon emissions specifically includes: Delete and fill missing values in the original data of electricity carbon emissions; Normalize the data after missing value processing; The normalized data is divided into training set, validation set and test set according to the proportion.
3. A short-term carbon emission prediction method according to claim 1, characterized in that: The gated recurrent GRU module uses two layers of connected cells; the two layers of cells transmit time domain features and output the prediction results of the time domain features through the fully connected layer.
4. A short-term carbon emission prediction method according to claim 1, characterized in that: The Fast Fourier Transform FFT module includes the following formula: x=F -1 [F(x)×W]; Where x is the data sample, F is the fast Fourier transform, W is the randomly generated weight matrix, and F -1 is the inverse Fourier transform.
5. A computer device, used to implement a short-term carbon emission prediction method according to any one of claims 1 to 4; the computer device comprises: Power carbon emission time series construction unit, model parameter setting unit, model training unit and power short-term carbon emission prediction unit; The power carbon emission time series construction unit is used to obtain the original data of power carbon emission; pre-process the original data of power carbon emission to obtain the time series of power carbon emission; The model parameter setting unit and the model training unit are used to train the short-term carbon emission prediction model using the time series of electricity carbon emission; The prediction unit of short-term carbon emissions of electricity is used to predict the original data of carbon emissions of electricity to be predicted by using the trained short-term carbon emissions prediction model.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the short-term carbon emission prediction method described in any one of claims 1 to 4 is implemented.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the short-term carbon emission prediction method described in any one of claims 1 to 4 is implemented.
Citation Information
Cited By
Long-time sequence prediction method based on channel independence and bidirectional normalization
CN119226718A
Long-term series prediction methods based on channel independence and bidirectional normalization
CN119226718B
Carbon emission prediction method and device based on data enhancement and time-frequency fusion comparison
CN119941267A
