TCN-Transformer-based renewable energy power grid load prediction method and device

By introducing the TCN-Transformer model in the grid load prediction, the local and global characteristics of the time series are extracted, and combined with renewable energy output and electricity price characteristics, the limitations of the existing technology in dealing with complex time series and highly dynamic loads are solved, and high-precision load prediction is achieved.

CN119994847AActive Publication Date: 2025-05-13ECONOMIC & TECH RES INST OF HUBEI ELECTRIC POWER COMPANY SGCC

Patent Information

Application Number
CN202411828547.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-05-13
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

The prior art has limitations in dealing with complex time series characteristics and high fluctuation and high dynamic new energy load characteristics, making it difficult to achieve high-precision load prediction.

Method used

Using the TCN-Transformer-based method, local features are extracted through the time convolution network, and global features are extracted using the multi-head self-attention mechanism of the Transformer network, and combined with dynamic features such as renewable energy output and electricity price to build a load prediction model.

Benefits of technology

It significantly improves the accuracy and reliability of load prediction and can more effectively support the scheduling needs of a high proportion of renewable energy grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119994847A_ABST
    Figure CN119994847A_ABST
Patent Text Reader

Abstract

The invention discloses a TCN-Transform-based renewable energy power grid load prediction method and device. The method comprises the steps of constructing a data set containing historical load data, meteorological data, renewable energy output data and electricity price data of a renewable energy power grid; inputting the data set into a time convolutional network, and extracting local features in a time sequence by using an expanded convolutional layer; inputting local features in the time sequence into a Transform network, and extracting global features in the time sequence by using a multi-head self-attention mechanism; and the local features extracted by the time convolution network and the global features extracted by the Transform network are fused, a renewable energy power grid load prediction model is constructed, and a load prediction value at a future time point is generated. According to the method, the local and global time sequence features are extracted, and dynamic features such as renewable energy output and electricity price are combined, so that the precision and reliability of load prediction are improved, and the scheduling requirement of a high-proportion renewable energy power grid is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power systems, and in particular to a method and device for predicting load of a renewable energy power grid based on TCN-Transformer. Background Art

[0002] With the continuous growth of renewable energy installed capacity, the impact of new energy sources such as photovoltaics and wind power on the load characteristics of the power grid is becoming increasingly significant. Accurate load forecasting is the basis for power grid dispatching and operation, and can effectively ensure the safety and economy of the power grid. However, traditional load forecasting methods have certain limitations when dealing with complex time series characteristics: (1) Traditional statistical methods: such as regression analysis, Markov chain, etc. These methods are simple and easy to use, but have limited fitting capabilities when dealing with nonlinear problems and are difficult to cope with the fluctuation characteristics of renewable energy output. (2) Artificial intelligence methods: Models such as support vector machines (SVM) and artificial neural networks (ANN) have good prediction accuracy, but are sensitive to outliers in the input data and are difficult to adapt to the highly volatile and dynamic characteristics of new energy loads.

[0003] In recent years, attention mechanisms have been introduced into the field of load forecasting, which significantly improves the forecasting performance by capturing the dependencies of global time series. However, existing research focuses on traditional power grids, ignoring the impact of dynamic factors such as renewable energy output and time-of-use electricity prices on load characteristics. Therefore, in order to meet the short-term load forecasting needs of power grids with a high proportion of renewable energy, an efficient forecasting method that can comprehensively consider multiple dynamic factors is urgently needed. Summary of the invention

[0004] The purpose of the present invention is to overcome the above-mentioned defects and problems existing in the prior art, and to provide a method and device for renewable energy power grid load forecasting based on TCN-Transformer, which can improve the accuracy and reliability of load forecasting by extracting local and global time series characteristics and combining dynamic characteristics such as renewable energy output and electricity price, so as to meet the scheduling needs of power grids with a high proportion of renewable energy.

[0005] To achieve the above objectives, the technical solution of the present invention is: a renewable energy grid load forecasting method based on TCN-Transformer, comprising:

[0006] Construct a dataset containing historical load data, meteorological data, renewable energy output data, and electricity price data of renewable energy grids;

[0007] The dataset is fed into a temporal convolutional network and the dilated convolutional layer is used to extract local features in the time series.

[0008] The local features in the time series are input into the Transformer network, and the global features in the time series are extracted using the multi-head self-attention mechanism;

[0009] The local features extracted by the temporal convolutional network and the global features extracted by the Transformer network are fused to build a renewable energy power grid load forecasting model and generate load forecast values ​​at future time points.

[0010] The formula for the dilated convolutional layer is:

[0011]

[0012] Where y(t) is the output of the convolution operation; D is the size of the convolution kernel; w(i) is the weight of the i-th convolution kernel; x(td·i) is the sequence element input at time step t; and d is the dilation rate.

[0013] The mathematical representation of the multi-head attention mechanism is:

[0014]

[0015] Where Q, K, and V represent query, key, and value vectors, respectively; k is the dimension of the key vector; head i is the attention weight of the i-th single attention head; are the learnable weight matrices corresponding to Q, K, and V of the i-th single attention head; W o is the weight matrix.

[0016] The attention formula is modified by introducing a mask matrix:

[0017]

[0018] In the formula, Q i , K i 、V i are the query, key and value vectors of the i-th single attention head respectively; M is the mask matrix.

[0019] The renewable energy grid load forecasting model is optimized through the following loss function:

[0020]

[0021] Where L(θ) is the calculated value of the loss function; MSE is the difference between the predicted value and the true value; y i and are the true value and predicted value of the i-th sample respectively; γ is a hyperparameter; k is the total number of samples; D KL is the difference between the true distribution and the predicted distribution; Yi is the true distribution of the target; is the predicted distribution.

[0022] The hyperparameters of the renewable energy grid load forecasting model are obtained by the following method:

[0023] Set the number of channels, dilation factor, kernel size, learning rate, and dropout rate of the temporal convolutional network, as well as the hidden layer dimension, number of encoder layers, and number of heads of the multi-head attention mechanism of the Transformer network;

[0024] The grid search method is used to obtain the optimal combination of all parameters: the number of channels of the temporal convolutional network is set to [32, 64], the dilation factor is set to 2, the convolution kernel size is set to 3, the learning rate is set to 0.0003, and the drop rate is set to 0.2; the hidden layer dimension of the Transformer network is set to 128, the number of encoder layers is set to 2, and the number of heads of the multi-head attention mechanism is set to 2.

[0025] The mean absolute percentage error, root mean square error, determination coefficient and mean absolute error are used as the percentage error between the predicted value and the true value:

[0026]

[0027] Where MAPE is the mean absolute percentage error; k is the total number of predicted samples; yi is the true value of the i-th sample; is the predicted value of the i-th sample; RMSE is the root mean square error; R 2 is the coefficient of determination; is the average of the true values; MAE is the mean absolute error.

[0028] A renewable energy grid load forecasting device based on TCN-Transformer, which is applied to the above-mentioned method, comprises:

[0029] A data set construction module is used to construct a data set containing historical load data of renewable energy power grids, meteorological data, renewable energy output data and electricity price data;

[0030] The local feature acquisition module is used to input the data set into the temporal convolutional network and use the dilated convolutional layer to extract local features in the time series;

[0031] The global feature acquisition module is used to input the local features in the time series into the Transformer network and extract the global features in the time series using the multi-head self-attention mechanism;

[0032] The load forecast value acquisition module is used to fuse the local features extracted by the temporal convolutional network and the global features extracted by the Transformer network, build a renewable energy power grid load forecasting model, and generate load forecast values ​​at future time points.

[0033] A renewable energy grid load forecasting device based on TCN-Transformer, comprising a memory and a processor;

[0034] The memory is used to store computer program code and transmit the computer program code to the processor;

[0035] The processor is used to execute the method according to the instructions in the computer program code.

[0036] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0037] Compared with the prior art, the present invention has the following beneficial effects:

[0038] In a TCN-Transformer-based renewable energy grid load forecasting method and device of the present invention, the historical load, meteorological data, renewable energy output and time-of-use electricity price information of the renewable energy grid are first collected; then a temporal convolutional network is used to extract local features, and the receptive field is expanded by dilated convolution; then the Transformer network is used to extract global time series features through a multi-head self-attention mechanism, and a masked self-attention mechanism is introduced to limit the access to future time step data to ensure that the prediction logic only relies on historical data; finally, the local features extracted by TCN and the global features extracted by Transformer are fused to generate load forecast values ​​at future time points; in addition, a composite loss function combining mean square error and KL divergence is used to optimize model performance, and the model hyperparameters are optimized by grid search to further improve the accuracy and efficiency of load forecasting. This method comprehensively considers dynamic features such as renewable energy output and time-of-use electricity price. In a high proportion of renewable energy scenarios, the prediction accuracy is significantly improved, which can effectively support grid dispatching and operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 The present invention is a flow chart of a method for predicting load of a renewable energy power grid based on TCN-Transformer.

[0040] Figure 2 It is a schematic diagram of a framework of a renewable energy grid load prediction model in an embodiment of the present invention.

[0041] Figure 3Schematic diagram of the structure of the masked self-attention mechanism in an embodiment of the present invention.

[0042] Figure 4 It is a comparison chart of prediction results for working days and holidays in an embodiment of the present invention.

[0043] Figure 5 It is a comparison chart of prediction results of special holidays in an embodiment of the present invention.

[0044] Figure 6 It is a structural block diagram of a renewable energy power grid load prediction device based on TCN-Transformer of the present invention.

[0045] Figure 7 It is a structural block diagram of a renewable energy power grid load forecasting device based on TCN-Transformer of the present invention. DETAILED DESCRIPTION

[0046] The present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0047] See also Figure 1 The present invention provides a renewable energy power grid load forecasting method based on TCN-Transformer, comprising:

[0048] S1. Construct a dataset containing historical load data, meteorological data, renewable energy output data, and electricity price data of renewable energy power grids.

[0049] First, as the proportion of renewable energy increases, relevant policies support renewable energy power generation technology, and the correlation between changes in load demand and renewable energy output becomes increasingly significant. Therefore, it is particularly important to consider the impact of renewable energy output in load forecasting. Secondly, the correlation analysis of the time-of-use electricity price curve and the load curve shows that the electricity price and load have a strong correlation, so we consider adding these two factors to help the forecasting model better capture the load characteristics of the renewable energy power grid and improve the accuracy of the forecast.

[0050] The data set also includes day type data, which includes holidays, working days, and special holidays (such as Spring Festival, May Day, etc.).

[0051] The above data are normalized, outliers are filled, and training and test data sets are generated through sliding windows to meet the input requirements of the time series model. Sliding windows are a common data processing method suitable for time series forecasting. Time series data is cut into multiple continuous time segments according to the window length, so that predictions can be made based on historical data. The window data will be updated every time it moves forward a fixed step by moving on the time axis by rolling the window. In this way, the combined data is updated to generate a data set, thereby supporting the training and testing of the short-term load forecasting model.

[0052] S2. Input the dataset into the Temporal Convolutional Network (TCN) and use the dilated convolutional layer to extract local features in the time series.

[0053] Temporal Convolutional Network (TCN) mainly consists of dilated convolutional layers and residual modules. The dilated convolutional layers are used to extract local features in the sequence, and the residual modules help capture long-term dependencies in the sequence, solve the gradient vanishing problem of traditional convolutional neural network (CNN) networks, and improve training efficiency.

[0054] A single residual module consists of two parallel convolution branches, each of which contains a dilated convolution layer, layer normalization, ReLU activation function, and Dropout layer in sequence; ReLU makes the network nonlinear, and Dropout prevents overfitting by discarding some neurons. At the same time, the module uses a 1×1 convolution kernel to add the input element by element to the output of the convolution branch through a residual connection. This structure enhances the training efficiency and generalization ability of the model.

[0055] S3. Input the local features in the time series into the Transformer network, and use the multi-head self-attention mechanism to extract the global features in the time series.

[0056] Transformer is a neural network architecture based on the self-attention mechanism. Its design concept is based on the self-attention mechanism, which calculates the dependency relationship between each position in the input sequence and other positions, so that the model can flexibly capture the relationship between different positions when processing long sequence tasks, and will not lose information relevance due to the input features being too long. The self-attention mechanism can be expressed as Transformer consisting of three parts: encoder, decoder, and positional encoding. The encoder converts the input sequence into a potential representation, and the decoder uses these potential representations to generate the target output. The positional encoding is used to add position information to each vector in the input sequence, thereby effectively modeling long-distance dependencies. Through the multi-head self-attention mechanism, the model can focus on different features in different subspaces when processing sequences, enhancing the ability to capture sequence information.

[0057] S4. The local features extracted by the temporal convolutional network and the global features extracted by the Transformer network are integrated to build a renewable energy grid load forecasting model and generate load forecast values ​​at future time points.

[0058] In order to better extract local features and global features, the present invention proposes a TCN-Transformer load forecasting model composed of TCN and Transformer. First, the historical data set is input into the TCN layer. TCN uses dilated convolution to increase the receptive field of the network to obtain features of multiple time steps and perform convolution, which can effectively extract local features. The local features extracted by TCN are transmitted to Transformer to extract global features, and position encoding is added to ensure time order. Each layer consists of a self-attention mechanism and a feedback layer. The prediction model is as follows: Figure 2 shown.

[0059] Furthermore, TCN uses a dilated convolutional layer, which is a form of convolution that inserts gaps between convolution kernels. This operation enables the model to have a larger receptive field and can efficiently handle long-term dependencies without increasing computational complexity. The formula for the dilated convolutional layer is:

[0060]

[0061] Where y(t) is the output of the convolution operation; D is the size of the convolution kernel; w(i) is the weight of the i-th convolution kernel; x(td·i) is the sequence element input at time step t; d is the dilation rate, and the receptive field of the network is controlled by setting the dilation rate d.

[0062] Furthermore, the mathematical representation of the multi-head attention mechanism is:

[0063]

[0064] MH(Q,K,V)=Concat(head1,...,head h )W o ;

[0065] Where attention is calculated by the softmax normalization function; Q, K, V represent query, key, and value vectors respectively; d k is the dimension of the key vector; head i is the attention weight of the i-th single attention head; are the learnable weight matrices corresponding to Q, K, and B of the i-th single attention head; W o is the weight matrix.

[0066] Each attention head calculates the attention result independently, and then the results of all heads are concatenated and linearly transformed using the weight matrix W o Generate the final overall attention output.

[0067] Furthermore, the traditional self-attention mechanism can associate the features of each time step with the features of all time steps of the sequence data. Although this can capture long-term dependencies, it will be associated with the features of future time steps. Therefore, the present invention uses a masked self-attention mechanism to restrict access to future information and ensure the integrity of the prediction logic. The attention formula is modified by introducing a mask matrix:

[0068]

[0069] In the formula, Q i , K i 、V i are the query, key and value vectors of the i-th single attention head respectively; M is the mask matrix.

[0070] The mask matrix is ​​an upper triangular matrix, which means that the features of each time step are only associated with the data observed at the current time step, ensuring that the model only uses current and past data, which is consistent with the logic of the real prediction model. The structure of the mask self-attention mechanism is as follows Figure 3 shown.

[0071] Furthermore, KL divergence is used to measure the difference between the model prediction distribution and the actual distribution, thereby optimizing the capture of global characteristics by the renewable energy grid load forecasting model. The present invention adopts a supervised learning loss function based on KL divergence to help the TCN-Transformer model better mine the characteristics of time series and improve the ability to fit the changing trend. The loss function formula is:

[0072]

[0073] Where L(θ) is the calculated value of the loss function; MSE is the difference between the predicted value and the true value, which ensures the accuracy of the power load; y j and are the true value and predicted value of the i-th sample respectively; γ is a hyperparameter; k is the total number of samples; D KL is the difference between the real distribution and the predicted distribution, which helps the model better capture the load characteristics of the renewable energy grid; i is the true distribution of the target; is the predicted distribution.

[0074] KL divergence can also measure the degree of fit between two random distributions. The higher the similarity between two random distributions, the smaller their KL divergence. The above loss function can help the model improve its ability to learn global dependencies, and use the hyperparameter γ to control the impact of divergence on the overall loss.

[0075] Furthermore, the hyperparameters of the renewable energy grid load forecasting model are obtained by the following method:

[0076] Set the number of channels, dilation factor, kernel size, learning rate, and dropout rate of the temporal convolutional network, as well as the hidden layer dimension, number of encoder layers, and number of heads of the multi-head attention mechanism of the Transformer network;

[0077] The grid search method is used to obtain the optimal combination of all parameters: the number of channels of the temporal convolutional network is set to [32, 64], the dilation factor is set to 2, the convolution kernel size is set to 3, the learning rate is set to 0.0003, and the drop rate is set to 0.2; the hidden layer dimension of the Transformer network is set to 128, the number of encoder layers is set to 2, and the number of heads of the multi-head attention mechanism is set to 2.

[0078] By controlling the learning rate to control the training speed, the loss rate can prevent the model from overfitting. Under the condition of a fixed number of iterations (the number of iterations in the present invention is 100), the optimization is performed, and the grid search method is used to obtain the optimal combination of all parameters, fully exploring the performance of the model to further improve the accuracy and efficiency of load forecasting.

[0079] Furthermore, the mean absolute percentage error, root mean square error, determination coefficient and mean absolute error are used as the percentage error between the predicted value and the true value:

[0080]

[0081] Where MAPE is the mean absolute percentage error; k is the total number of predicted samples; y i is the true value of the i-th sample; is the predicted value of the i-th sample; RMSE is the root mean square error; R 2 is the coefficient of determination; is the average of the true values; MAE is the mean absolute error.

[0082] Among them, RMSE is very sensitive to the outliers of the prediction results and can measure the overall accuracy of the model prediction; MAPE can reflect the overall level of the entire prediction model. Since it is a percentage indicator, it is not affected by the data unit; R 2 It is used to evaluate the degree of fit of the regression model to the data and measure the fitting ability of the overall trend; MAE represents the mean absolute error between the predicted value and the true value, reflecting the overall error level of the prediction. In short, the smaller the values ​​of RMSE, MAPE, and MAE, the better the R 2 The larger the value of , the higher the prediction accuracy.

[0083] The data time range used covers January 2022 to August 2024, with a sampling interval of 15 minutes, including load power, meteorological, renewable energy output and electricity price data of 96 sampling points every day. In the experiment, 80% of the data was used for the training set and 20% for the test set. In order to ensure that the load forecasting model fully captures the time series characteristics and considers the periodicity and timing characteristics of the power load, the sampling data of the past 3 days is used as input, and the load data for the next 24 hours is predicted as output.

[0084] The TCN and Transformer fusion model was used and four control groups were set up. The models without considering the price and output of renewable energy, only considering the price of renewable energy, only considering the output of renewable energy, and considering the price and output of renewable energy were introduced as the method of the present invention for training. The load curve from May 19 to 21, 2024 (i.e., two working days and one holiday load curve) was selected for comparison of prediction results, with a total of 288 sampling points. The performance of the method of the present invention and other methods in load prediction on working days and holidays is compared, and the results show that Figure 4 And Table 1, Table 2.

[0085] Table 1 Errors of the model considering different influencing factors on weekdays

[0086]

[0087] Table 2 Errors of the model considering different influencing factors for holidays

[0088]

[0089] The analysis and comparison results show that when only the output factor of renewable energy is considered, the prediction performance of the model is improved, and the prediction error indicators on weekdays and holidays are reduced: RMSE, MAPE, and MAE are reduced by 6.9%, 1.6%, and 6.8% on weekdays, and by 2.4%, 7.2%, and 8.1% on holidays. Due to the large fluctuation of renewable energy output, the improvement of model performance by relying solely on this feature is still relatively limited. When the electricity price of renewable energy is further considered, the prediction accuracy of the model is significantly improved. Compared with only considering the output of renewable energy, the RMSE, MAPE, and MAE on weekdays are reduced by about 6.1%, 2.2%, and 2.8%, respectively; and on holidays, they are reduced by about 9.1%, 5.7%, and 6.8%, respectively. This shows that the introduction of electricity price factors has a significant improvement in the degree of model fitting. When the output and electricity price of renewable energy are considered comprehensively, the prediction accuracy of the model is further improved, and the performance is very significant. The error indicators RMSE, MAPE, and MAE on weekdays decreased by about 7.8%, 17.8%, and 18.1%, respectively; the corresponding indicators on holidays decreased by about 5.8%, 17.8%, and 17.7%, respectively. Overall, compared with completely ignoring the renewable energy factor, the model's fit R 2 The prediction performance of the proposed method is significantly better than that of other methods, both on weekdays and holidays, which fully verifies the effectiveness of the selected features and methods.

[0090] In addition, in order to test the prediction effect of the method of the present invention under the special conditions of special holidays, the selected time period is from May 1st to May 3rd (during the May Day holiday). Figure 5 And Table 3, compares the performance of the method of the present invention and other methods in special holiday load forecasting.

[0091] Table 3 Errors of the model considering different influencing factors for special holidays

[0092]

[0093] By considering the renewable energy output or electricity price factors, RMSE, MAPE, and MAE are increased to 36.97, 1.21, and 29.00 and 29.73, 0.93, and 22.03, respectively, which has shown a high accuracy. However, the method of the present invention is further optimized, and RMSE, MAPE, and MAE are reduced to 28.50, 0.82, and 19.79, which is higher than that when the renewable energy factors are not considered.2 The improvement is about 3.2%, which shows that the method mentioned in the present invention performs better under special holiday data.

[0094] In summary, no matter it is a normal working day, holiday or special holiday, the TCN-Transformer model mentioned in the present invention that considers renewable energy output and electricity price factors is the best.

[0095] See also Figure 6 The present invention also provides a renewable energy power grid load forecasting device based on TCN-Transformer, which is applied to the above-mentioned renewable energy power grid load forecasting method based on TCN-Transformer, and the device includes:

[0096] A data set construction module is used to construct a data set containing historical load data of renewable energy power grids, meteorological data, renewable energy output data and electricity price data;

[0097] The local feature acquisition module is used to input the data set into the temporal convolutional network and use the dilated convolutional layer to extract local features in the time series;

[0098] The global feature acquisition module is used to input the local features in the time series into the Transformer network and extract the global features in the time series using the multi-head self-attention mechanism;

[0099] The load forecast value acquisition module is used to fuse the local features extracted by the temporal convolutional network and the global features extracted by the Transformer network, build a renewable energy power grid load forecasting model, and generate load forecast values ​​at future time points.

[0100] See also Figure 7 ,The present invention also provides a renewable energy grid load forecasting device based on TCN-Transformer, including a memory and a processor;

[0101] The memory is used to store computer program code and transmit the computer program code to the processor;

[0102] The processor is used to execute the above-mentioned renewable energy power grid load forecasting method based on TCN-Transformer according to the instructions in the computer program code.

[0103] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned renewable energy power grid load forecasting method based on TCN-Transformer is implemented.

[0104] Generally speaking, the computer instructions for implementing the method of the present invention may be carried in any combination of one or more computer-readable storage media. Non-transitory computer-readable storage media may include any computer-readable media, except for the signal itself that is temporarily propagating.

[0105] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EKROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0106] Computer program code for performing the operation of the present invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages, in particular, Python suitable for neural network computing and platform frameworks based on TensorFlow, PyTorch, etc. can be used. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer or to an external computer (for example, using an Internet service provider to connect via the Internet) through any type of network, including a local area network (LAN) or a wide area network (WAN).

[0107] The above-mentioned device and non-temporary computer-readable storage medium can refer to the specific description of a renewable energy grid load forecasting method based on TCN-Transformer and its beneficial effects, which will not be repeated here.

[0108] Although the embodiments of the present invention have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A renewable energy grid load forecasting method based on TCN-Transformer, characterized in that: include: Construct a dataset containing historical load data, meteorological data, renewable energy output data, and electricity price data of renewable energy grids; The dataset is fed into a temporal convolutional network and the dilated convolutional layer is used to extract local features in the time series. The local features in the time series are input into the Transformer network, and the global features in the time series are extracted using the multi-head self-attention mechanism; The local features extracted by the temporal convolutional network and the global features extracted by the Transformer network are fused to build a renewable energy power grid load forecasting model and generate load forecast values ​​at future time points.

2. The renewable energy grid load forecasting method based on TCN-Transformer according to claim 1 is characterized in that: The formula for the dilated convolutional layer is: Where y(t) is the output of the convolution operation; D is the size of the convolution kernel; w(i) is the weight of the i-th convolution kernel; x(td·i) is the sequence element input at time step t; and d is the dilation rate.

3. The renewable energy grid load forecasting method based on TCN-Transformer according to claim 1 is characterized in that: The mathematical representation of the multi-head attention mechanism is: MH(Q,K,V)=Concat(head1,...,head h )W o ; Where Q, K, and V represent query, key, and value vectors respectively; k is the dimension of the key vector; head i is the attention weight of the i-th single attention head; are the learnable weight matrices corresponding to Q, K, and V of the i-th single attention head; W o is the weight matrix.

4. The renewable energy grid load forecasting method based on TCN-Transformer according to claim 3 is characterized in that: The attention formula is modified by introducing a mask matrix: In the formula, Q i , K i 、V i are the query, key and value vectors of the i-th single attention head respectively; M is the mask matrix.

5. The renewable energy grid load forecasting method based on TCN-Transformer according to claim 1 is characterized in that: The renewable energy grid load forecasting model is optimized through the following loss function: Where L(θ) is the calculated value of the loss function; MSE is the difference between the predicted value and the true value; y i and are the true value and predicted value of the i-th sample respectively; γ is a hyperparameter; k is the total number of samples; D KL is the difference between the true distribution and the predicted distribution; Y i is the true distribution of the target; is the predicted distribution.

6. The renewable energy grid load forecasting method based on TCN-Transformer according to claim 1 is characterized in that: The hyperparameters of the renewable energy grid load forecasting model are obtained by the following method: Set the number of channels, dilation factor, kernel size, learning rate, and dropout rate of the temporal convolutional network, as well as the hidden layer dimension, number of encoder layers, and number of heads of the multi-head attention mechanism of the Transformer network; The grid search method is used to obtain the optimal combination of all parameters: the number of channels of the temporal convolutional network is set to [32, 64], the dilation factor is set to 2, the convolution kernel size is set to 3, the learning rate is set to 0.0003, and the drop rate is set to 0.2; the hidden layer dimension of the Transformer network is set to 128, the number of encoder layers is set to 2, and the number of heads of the multi-head attention mechanism is set to 2.

7. The renewable energy grid load forecasting method based on TCN-Transformer according to claim 1 is characterized in that: The mean absolute percentage error, root mean square error, determination coefficient and mean absolute error are used as the percentage error between the predicted value and the true value: Where MAPE is the mean absolute percentage error; k is the total number of predicted samples; y i is the true value of the i-th sample; is the predicted value of the i-th sample; RMSE is the root mean square error; R 2 is the coefficient of determination; is the average of the true values; MAE is the mean absolute error.

8. A renewable energy grid load forecasting device based on TCN-Transformer, characterized in that: The device is applied to the method described in any one of claims 1 to 7, and the device comprises: A data set construction module is used to construct a data set containing historical load data of renewable energy power grids, meteorological data, renewable energy output data and electricity price data; The local feature acquisition module is used to input the data set into the temporal convolutional network and use the dilated convolutional layer to extract local features in the time series; The global feature acquisition module is used to input the local features in the time series into the Transformer network and extract the global features in the time series using the multi-head self-attention mechanism; The load forecast value acquisition module is used to fuse the local features extracted by the temporal convolutional network and the global features extracted by the Transformer network, build a renewable energy power grid load forecasting model, and generate load forecast values ​​at future time points.

9. A renewable energy grid load forecasting device based on TCN-Transformer, characterized in that: including memory and processor; The memory is used to store computer program code and transmit the computer program code to the processor; The processor is configured to execute the method according to any one of claims 1 to 7 according to instructions in the computer program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Power load prediction method based on decomposition network

    CN115600640A

  • TCN-Transformer-based reservoir porosity prediction method

    CN118627659A

  • Extraction of instantaneous renewable generation from net load measurements of power distribution systems

    US20230307908A1

  • AU2020104000A4

Cited By

  • Language model training method and device, text processing method and device, equipment and medium

    CN120146200A

  • Model training method, electric load prediction method, equipment and storage medium

    CN120354380A