A regional thermal power generation capacity mid-long term prediction method and system
By constructing a prediction model based on a spatiotemporal attention mechanism, the problem of accuracy in medium- and long-term forecasting of regional thermal power generation was solved, the operational risks of thermal power enterprises were reduced, and more accurate forecasting of thermal power generation was achieved.
Patent Information
- Application Number
- CN202111489634.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2041-12-08
AI Technical Summary
Existing technologies cannot accurately predict regional thermal power generation in the medium to long term, leading to increased uncertainty and risk in the production and operation of thermal power enterprises.
A prediction model based on a spatiotemporal attention mechanism is adopted. The spatial attention module extracts the correlation between target type electricity and thermal power generation, while the temporal attention module treats thermal power generation as the electricity consumption gap. Combined with the correlation of key influencing factors, a prediction model is constructed and trained to predict future thermal power generation.
It enables reliable medium- and long-term forecasting of regional thermal power generation, reduces the operational risks of thermal power enterprises, and improves the accuracy of forecasting.
Smart Images

Figure CN114418168B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of energy, more particularly, to a regional thermal power generation medium and long-term prediction method and system. BACKGROUND
[0002] Under the guidance of the medium and long-term development goal of "carbon peak and carbon neutral", the requirement of energy structure optimization brings requirements for the healthy and green development of the power industry in the long run, and challenges for short-term operation, which is reflected in the new energy structure with random characteristics of new energy power generation full absorption, thermal power generation for power support and power guarantee, which needs to be based on the accurate prediction of power consumption and new energy power generation, so as to accurately arrange thermal power generation.
[0003] However, power consumption is mainly determined by the social and economic development environment, and has volatility with periodic changes in population structure and economic conditions. At the same time, new energy power generation is determined by climate and environmental conditions, and has obvious randomness. Therefore, the thermal power generation capacity has certain randomness and volatility, thereby bringing uncertainty to the production and operation of thermal power enterprises.
[0004] At present, the thermal power generation capacity is predicted according to historical data, without considering that thermal power generation is the gap between regional total power consumption and new energy power generation, so it is difficult to accurately predict the change rule of thermal power generation capacity under the constraint of actual power demand and new energy power generation.
[0005] Therefore, how to reliably predict the regional thermal power generation capacity in the medium and long term, thereby reducing the operation risk of thermal power enterprises, is a technical problem to be solved at present. SUMMARY
[0006] The present application discloses a regional thermal power generation medium and long-term prediction method, which solves the technical problem that the regional thermal power generation capacity cannot be accurately predicted in the medium and long term in the prior art.
[0007] The method comprises:
[0008] Based on a preset correlation analysis algorithm, the regional power historical data and the associated factor historical data are analyzed for correlation and a preset number of key influence factors are determined;
[0009] Sample data is generated according to the regional power historical data and the historical data of the key influence factors, and the sample data is divided into a training set, a test set and a verification set;
[0010] A prediction model based on space-time attention mechanism is constructed according to a space attention module, a time attention module and a prediction module;
[0011] training the prediction model based on the space-time attention mechanism based on the sample data, and obtaining a target prediction model after the training is completed; and predicting a future preset time length of thermal power generation prediction value based on the target prediction model;
[0012] The space attention module is configured to extract the correlation between the target type electric quantity and the thermal power generation based on a space attention mechanism, and the time attention module is configured to take the thermal power generation as an electricity consumption gap and extract the correlation between each of the key influence factors and the thermal power generation based on a time attention mechanism. The target type electric quantity includes regional social total electricity consumption, wind power generation, hydro power generation, photovoltaic power generation, natural gas power generation, and nuclear power generation. The electricity consumption gap = regional social total electricity consumption + export electricity consumption - wind power generation - hydro power generation - photovoltaic power generation - natural gas power generation - nuclear power generation - purchased electricity consumption.
[0013] In some embodiments of the present application, the prediction model based on the space-time attention mechanism is trained based on the sample data, specifically:
[0014] The space attention module is trained in a first stage based on the sample data;
[0015] The time attention module and the prediction module are trained in a second stage based on the sample data and the output of the space attention module;
[0016] The prediction model based on the space-time attention mechanism is optimized based on the accumulation of the sample data;
[0017] The first stage training and the second stage training are respectively iterated for a preset number of times.
[0018] In some embodiments of the present application, the space attention module includes a first space attention network, a first LSTM network, a second space attention network, and a second LSTM network. The space attention module is trained in a first stage based on the sample data, specifically:
[0019] The first group of vectors and the first group of state vectors are input into the first space attention network, and the output of the first space attention network is connected to the first LSTM network;
[0020] The second group of state vectors output by the first LSTM network, historical thermal power generation, and the third group of state vectors are input into the second space attention network, and the output of the second space attention network is connected to the second LSTM network, and the fourth group of state vectors output by the second LSTM network are obtained;
[0021] generating the first-stage state vector corresponding to the fourth group of state vectors after completing the preset number of iterations;
[0022] wherein the first group of vectors is generated according to all the key influence factors within a preset historical time length, the first group of state vectors is randomly generated at the first iteration and is obtained according to the feedback of the second group of state vectors in the subsequent iterations, and the third group of state vectors is randomly generated at the first iteration and is obtained according to the feedback of the fourth group of state vectors in the subsequent iterations.
[0023] In some embodiments of the present application, the time attention module and the prediction module are constituted by a time attention network, a third LSTM network and a fully connected layer, the time attention module and the prediction module are trained in the second stage based on the sample data and the output of the spatial attention module, specifically:
[0024] the first-stage state vector and a fifth group of state vectors are input into the time attention network, and the output of the time attention network is connected to the third LSTM network, and historical thermal power generation is input into the third LSTM network;
[0025] a sixth group of state vectors output by the third LSTM network is input into the fully connected layer, and a thermal power generation prediction value is output after nonlinear weighting based on the fully connected layer;
[0026] iterating for the preset number of times;
[0027] wherein the fifth group of state vectors is randomly generated at the first iteration and is obtained according to the feedback of the sixth group of state vectors in the subsequent iterations.
[0028] In some embodiments of the present application, the preset number of times is 3, the preset number is 10, the preset historical time length is 3 months, the dimension of the first group of vectors is 30, the dimensions of the first group of state vectors, the second group of state vectors, the third group of state vectors, the fourth group of state vectors, the first-stage state vector, the fifth group of state vectors and the sixth group of state vectors are 64, the dimension of the historical thermal power generation is 1, the historical thermal power generation corresponding to each iteration is different months, and the future preset time length is 1 month in the future.
[0029] In some embodiments of the present application, the key influence factors include regional total social electricity consumption, wind power generation, hydro power generation, photovoltaic power generation, nuclear power generation, natural gas power generation, GDP, population, air temperature and date.
[0030] In some embodiments of the present application, the regional power history data includes various types of power consumption data, various types of power generation data, grid dispatch power, grid non-dispatch power, purchased power and sold power, and the associated factor history data includes regional socio-economic development index data, regional climate and environment data, and power generation capacity data of various power generation types.
[0031] In some embodiments of the present application, the sample data is generated according to the regional power history data and the history data of the key influence factors, specifically, the regional power history data and the history data of the key influence factors are preprocessed, and the various types of power data are aligned with the various key influence factors to generate the sample data.
[0032] The preprocessing includes data cleaning, missing value processing, quantization encoding and normalization.
[0033] Correspondingly, the present application also provides a regional thermal power generation medium and long-term prediction system, which comprises:
[0034] a key influence factor determination module configured to perform correlation analysis on the regional power history data and the associated factor history data based on a preset correlation analysis algorithm and determine a preset number of key influence factors;
[0035] a sample generation module configured to generate sample data according to the regional power history data and the history data of the key influence factors, and divide the sample data into a training set, a test set and a verification set;
[0036] a model construction module configured to construct a prediction model based on a space attention module, a time attention module and a prediction module;
[0037] a model training module configured to train the prediction model based on the sample data, and obtain a target prediction model after the training is completed;
[0038] a prediction module configured to predict a thermal power generation prediction value for a future preset time length based on the target prediction model;
[0039] The space attention module is configured to extract the correlation between the target type power and the thermal power generation based on a space attention mechanism, the time attention module is configured to take the thermal power generation as a power consumption gap and extract the correlation between each of the key influence factors and the thermal power generation based on a time attention mechanism, and the target type power includes regional total power consumption, wind power, hydro power, photovoltaic power, natural gas power and nuclear power. The power consumption gap = regional total power consumption + sold power - wind power - hydro power - photovoltaic power - natural gas power - nuclear power - purchased power.
[0040] Accordingly, the present invention also proposes a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the regional thermal power generation medium- and long-term forecasting method as described above.
[0041] By applying the above technical solutions, a correlation analysis algorithm is used to analyze the historical data of regional power and related factors to determine a predetermined number of key influencing factors. Sample data is generated based on the historical data of regional power and key influencing factors, and the sample data is divided into training, testing, and validation sets. A prediction model based on a spatiotemporal attention mechanism is constructed using spatial attention, temporal attention, and prediction modules. The prediction model based on the spatiotemporal attention mechanism is trained based on the sample data, and a target prediction model is obtained after training. The target prediction model is used to predict the thermal power generation for a predetermined period in the future. The spatial attention module is used to extract the correlation between target type power and thermal power generation based on the spatial attention mechanism, and the temporal attention module is used to treat thermal power generation as a power consumption gap and extract the correlation between each key influencing factor and thermal power generation based on the temporal attention mechanism. This enables reliable medium- and long-term prediction of regional thermal power generation and reduces the operational risks of thermal power enterprises. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 A flowchart illustrating a method for medium- and long-term forecasting of regional thermal power generation proposed in an embodiment of the present invention is shown.
[0044] Figure 2 A flowchart illustrating a method for medium- and long-term forecasting of regional thermal power generation, according to another embodiment of the present invention, is shown.
[0045] Figure 3 A schematic diagram illustrating the principle of the prediction model based on the spatiotemporal attention mechanism in an embodiment of the present invention is shown;
[0046] Figure 4 A schematic diagram illustrating the principle of the spatial attention module in an embodiment of the present invention is shown;
[0047] Figure 5 A schematic diagram illustrating the principle of the time attention module and the prediction module in an embodiment of the present invention is shown;
[0048] Figure 6 This diagram illustrates the MAPE performance test results for thermal power generation prediction in an embodiment of the present invention.
[0049] Figure 7 A schematic diagram of a regional thermal power generation medium- and long-term prediction system proposed in an embodiment of the present invention is shown. Detailed Implementation
[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0051] This application provides a method for medium- and long-term prediction of regional thermal power generation. Based on the spatial attention mechanism, the method extracts the correlation between target type electricity and thermal power generation, takes thermal power generation as the electricity consumption gap, and extracts the correlation between each key influencing factor and thermal power generation based on the temporal attention mechanism. A prediction model based on the spatiotemporal attention mechanism is constructed to achieve more accurate medium- and long-term prediction of thermal power generation.
[0052] like Figure 1 As shown, the method includes the following steps:
[0053] Step S101: Based on a preset correlation analysis algorithm, perform correlation analysis on historical data of regional power and historical data of related factors, and determine a preset number of key influencing factors.
[0054] In this embodiment, the historical data of regional power and the historical data of related factors associated with the historical data of regional power are historical data within a preset time period (e.g., five years). The historical data of regional power and the historical data of related factors are collected in advance. The preset correlation analysis algorithm may include the Pearson algorithm, the Spearman algorithm, the Kendall algorithm, or a cross-correlation algorithm. Based on the preset correlation analysis algorithm, the correlation analysis of the historical data of regional power and the historical data of related factors is performed, and based on the correlation analysis results, a preset number of key influencing factors with strong correlations are selected from the historical data of related factors.
[0055] To improve the accuracy of predictions, in some embodiments of this application, the key influencing factors include total regional electricity consumption, wind power generation, hydropower generation, photovoltaic power generation, nuclear power generation, natural gas power generation, GDP, population, temperature, and date.
[0056] Those skilled in the art can flexibly select different key influencing factors according to actual needs, which does not affect the scope of protection of this application.
[0057] To improve the accuracy of predictions, in some embodiments of this application, the historical power data of the region includes various types of electricity consumption index data, various types of power generation data, power generation under unified grid dispatch, power generation not under unified grid dispatch, purchased power and sold power, and the historical data of related factors includes regional socio-economic development index data, regional climate and environmental data, and power generation capacity data of various power generation types.
[0058] In this embodiment, various electricity consumption indicators may include total regional electricity consumption, electricity consumption in the primary industry, electricity consumption in the secondary industry, electricity consumption in the tertiary industry, and electricity consumption by residents and public utilities. Various types of power generation data may include thermal power generation, hydropower generation, wind power generation, photovoltaic power generation, nuclear power generation, and natural gas power generation. Regional socio-economic development indicators include GDP and population. Regional climate and environmental data include sunlight intensity, sunshine duration, wind speed, wind direction, temperature, humidity, air pressure, rainfall, snowfall, and runoff. Power generation capacity data for each type of power generation includes installed capacity and reservoir capacity.
[0059] Those skilled in the art can flexibly select different regional power historical data and related factor historical data according to actual needs, which does not affect the scope of protection of this application.
[0060] Step S102: Generate sample data based on the historical power data of the region and the historical data of the key influencing factors, and divide the sample data into a training set, a test set and a verification set.
[0061] In this embodiment, the sample data is used to train the prediction model based on the spatiotemporal attention mechanism that is subsequently constructed. In order to facilitate training, the sample data is divided into a training set, a test set, and a verification set. Those skilled in the art can divide the sample data according to different proportions, which does not affect the scope of protection of this application.
[0062] In order to reliably generate sample data, in some embodiments of this application, sample data is generated based on the historical power data of the region and the historical data of the key influencing factors. Specifically, the historical power data of the region and the historical data of the key influencing factors are preprocessed, and the sample data is generated after aligning various types of power data with each key influencing factor.
[0063] The preprocessing includes data cleaning, missing value handling, quantization encoding, and normalization.
[0064] In this embodiment, in order to ensure the accuracy of the sample data, it is necessary to preprocess the historical data of regional power and the historical data of the key influencing factors. The preprocessing may include data cleaning, missing value handling, quantization coding and normalization. Then, the sample data is generated after aligning the various types of power data with the key influencing factors.
[0065] The specific processes of various preprocessing steps are existing technologies and will not be elaborated here.
[0066] Step S103: Construct a prediction model based on the spatiotemporal attention mechanism according to the spatial attention module, the temporal attention module, and the prediction module.
[0067] In this embodiment, the spatial attention module is used to extract the correlation between target type electricity consumption and thermal power generation based on the spatial attention mechanism. The target type electricity consumption includes total regional electricity consumption, wind power generation, hydropower generation, photovoltaic power generation, natural gas power generation, and nuclear power generation. The temporal attention module is used to treat thermal power generation as the electricity consumption gap and extract the correlation between each of the key influencing factors and thermal power generation based on the temporal attention mechanism. The electricity consumption gap = total regional electricity consumption + electricity sold outside the region - wind power generation - hydropower generation - photovoltaic power generation - natural gas power generation - nuclear power generation - purchased electricity. The prediction module can be a neural network with an LSTM or GRU structure. A prediction model based on the spatiotemporal attention mechanism can be constructed based on the spatial attention module, the temporal attention module, and the prediction module.
[0068] Step S104: Train the prediction model based on the spatiotemporal attention mechanism based on the sample data, and obtain the target prediction model after training is completed.
[0069] In this embodiment, sample data is input into a prediction model based on a spatiotemporal attention mechanism for training. After training, a target prediction model that can make medium- and long-term predictions of thermal power generation is obtained.
[0070] To improve prediction accuracy, in some embodiments of this application, the prediction model based on the spatiotemporal attention mechanism is trained based on the sample data, specifically as follows:
[0071] The spatial attention module is trained in the first stage based on the sample data.
[0072] The temporal attention module and the prediction module are trained in the second stage based on the sample data and the output of the spatial attention module.
[0073] The prediction model based on the spatiotemporal attention mechanism is optimized based on the accumulation of the sample data.
[0074] The first training phase and the second training phase are each iterated a preset number of times.
[0075] In this embodiment, the prediction model based on the spatiotemporal attention mechanism is divided into two parts and trained separately. The first part is the spatial attention module, which is trained in the first stage based on sample data. The second part is the temporal attention module and the prediction module, which are trained in the second stage based on sample data and the output of the spatial attention module. The first stage training and the second stage training are iterated a preset number of times, and then the prediction model based on the spatiotemporal attention mechanism can be optimized as sample data accumulates.
[0076] To improve prediction accuracy, in some embodiments of this application, the spatial attention module includes a first spatial attention network, a first LSTM network, a second spatial attention network, and a second LSTM network. The spatial attention module undergoes a first-stage training based on the sample data, specifically as follows:
[0077] Input the first set of vectors and the first set of state vectors into the first spatial attention network and connect the output of the first spatial attention network to the first LSTM network;
[0078] The second set of state vectors output by the first LSTM network, along with the historical thermal power generation and the third set of state vectors, are input into the second spatial attention network. The output of the second spatial attention network is then connected to the second LSTM network to obtain the fourth set of state vectors output by the second LSTM network.
[0079] After completing the preset number of iterations, a first-stage state vector corresponding to the fourth group of state vectors is generated.
[0080] In this embodiment, the first set of vectors is generated based on all the key influencing factors within a preset historical period (e.g., several months). The first set of state vectors is randomly generated during the first iteration and obtained from the feedback of the second set of state vectors in subsequent iterations. The third set of state vectors is randomly generated during the first iteration and obtained from the feedback of the fourth set of state vectors in subsequent iterations.
[0081] During the first stage of training, the first set of vectors and the first set of state vectors are first input into the first spatial attention network. Then, the output of the first spatial attention network is connected to the first LSTM network, which outputs the second set of state vectors. The second set of state vectors, historical thermal power generation, and the third set of state vectors are then input into the second spatial attention network. The output of the second spatial attention network is then connected to the second LSTM network, which outputs the fourth set of state vectors. After completing a preset number of iterations, the first-stage state vector corresponding to the fourth set of state vectors is generated.
[0082] It should be noted that the above embodiments are only one specific implementation scheme proposed in this application, and other methods for training the spatial attention module in the first stage based on sample data are all within the protection scope of this application.
[0083] To improve prediction accuracy, in some embodiments of this application, the temporal attention module and the prediction module are composed of a temporal attention network, a third LSTM network, and a fully connected layer. A second stage of training is performed on the temporal attention module and the prediction module based on the sample data and the output of the spatial attention module, specifically as follows:
[0084] The first stage state vector and the fifth group of state vectors are input into the time attention network, and the output of the time attention network is connected to the third LSTM network. The historical thermal power generation is also input into the third LSTM network.
[0085] The sixth set of state vectors output by the third LSTM network is input into the fully connected layer, and the predicted value of thermal power generation is output after nonlinear weighting based on the fully connected layer.
[0086] The iterations are performed according to the preset number of times.
[0087] In this embodiment, the fifth set of state vectors is randomly generated during the first iteration and obtained from the feedback of the sixth set of state vectors in subsequent iterations.
[0088] During the second stage of training, the first stage state vector and the fifth state vector output from the first stage training are first input into the time attention network, and the output of the time attention network is connected to the third LSTM network. The historical thermal power generation is also input into the third LSTM network. Then, the sixth set of state vectors output by the third LSTM network is input into the fully connected layer. Based on the fully connected layer, the thermal power generation prediction value is output after nonlinear weighting, and the process is iterated according to the preset number of times.
[0089] It should be noted that the above embodiments are only one specific implementation scheme proposed in this application. Other methods for second-stage training of the temporal attention module and prediction module based on sample data and the output of the spatial attention module are all within the protection scope of this application.
[0090] To improve the accuracy of prediction, in some embodiments of this application, the preset number of times is 3, the preset quantity is 10, the preset historical duration is 3 months, the dimension of the first group of vectors is 30, the dimension of the first group of state vectors, the second group of state vectors, the third group of state vectors, the fourth group of state vectors, the first stage state vector, the fifth group of state vectors, and the sixth group of state vectors is 64, the dimension of historical thermal power generation is 1, and each iteration corresponds to the historical thermal power generation of different months.
[0091] Step S105: Based on the target prediction model, predict the thermal power generation value for a preset time period in the future.
[0092] In this embodiment, the target prediction model obtained after training can predict the predicted value of thermal power generation over a preset period of time in the future.
[0093] In some embodiments of this application, the preset future duration is one month.
[0094] By applying the above technical solutions, a correlation analysis algorithm is used to analyze the historical data of regional power and related factors to determine a preset number of key influencing factors. Sample data is generated based on the historical data of regional power and the historical data of the key influencing factors, and the sample data is divided into training set, test set, and verification set. A prediction model based on a spatiotemporal attention mechanism is constructed based on a spatial attention module, a temporal attention module, and a prediction module. The prediction model based on the spatiotemporal attention mechanism is trained based on the sample data, and a target prediction model is obtained after training. The target prediction model is used to predict the thermal power generation value for a preset period of time in the future. The spatial attention module is used to extract the correlation between target type power and thermal power generation based on the spatial attention mechanism, and the temporal attention module is used to treat thermal power generation as a power consumption gap and extract the correlation between each key influencing factor and thermal power generation based on the temporal attention mechanism. This achieves reliable medium- and long-term prediction of regional thermal power generation and reduces the operational risks of thermal power enterprises.
[0095] To further illustrate the technical concept of this invention, the technical solution of this invention will now be described in conjunction with specific application scenarios.
[0096] To address the uncertainties and fluctuations inherent in thermal power generation as a source of regional electricity and power security, this application provides a medium- to long-term forecasting method for regional thermal power generation. Figure 2 As shown, it includes the following steps:
[0097] Step 1: Historical Data Collection
[0098] 1) Collection of historical electricity data in the region: total electricity consumption in the region, electricity consumption of the primary, secondary and tertiary industries, electricity consumption of residents and public utilities, and other electricity consumption indicators; data on various types of power generation, such as thermal power generation, hydropower generation, wind power generation, photovoltaic power generation, nuclear power generation, and natural gas power generation; power generation under the unified dispatch of the power grid and power generation not under the unified dispatch of the power grid; purchased electricity and sold electricity.
[0099] 2) Collection of historical data on factors related to regional electricity: Factors related to total regional electricity consumption, including regional socio-economic development indicators; factors related to new energy power generation, including various regional climate and environmental data such as solar intensity, sunshine duration, wind speed, wind direction, temperature, humidity, air pressure, rainfall, snowfall, and runoff, as well as power generation capacity data for various power generation types such as installed capacity and reservoir capacity.
[0100] Step Two: Correlation Analysis and Identification of Key Influencing Factors
[0101] 1) Using various linear and nonlinear correlation analysis tools such as Pearson, Spearman, Kendall, and cross-correlation, the correlation between the data of related factors and the regional power data is calculated;
[0102] 2) Screening key influencing factors for various electricity types: Based on the correlation calculation results, key influencing factors are determined. These include: total regional electricity consumption, wind power generation, hydropower generation, photovoltaic power generation, nuclear power generation, natural gas power generation, GDP, population, temperature, and date, totaling ten key influencing factors.
[0103] Step 3: Data Preprocessing and Sample Construction
[0104] 1) Data preprocessing: Data preprocessing includes cleaning, handling missing values, quantization and coding, and normalization;
[0105] 2) Sample Construction: Align various types of power data with key influencing factors to form sample data;
[0106] 3) Sample dataset partitioning: The sample data is partitioned into training set, test set and validation set.
[0107] Step 4: Construct a prediction model based on a spatiotemporal attention mechanism
[0108] 1) Using electricity consumption, wind power generation, hydropower generation, photovoltaic power generation, natural gas power generation, and nuclear power generation as constraints on thermal power generation, the spatial attention mechanism is used to extract the correlation between these electricity consumption and thermal power generation.
[0109] 2) Based on the positioning of thermal power generation as a source of electricity shortage and a guarantee of total social electricity consumption, a time attention mechanism is designed to extract the correlation between related factors and thermal power generation.
[0110] 3) Design a time variation law extraction module with LSTM or GRU structure to realize the prediction of thermal power generation.
[0111] Prediction models based on spatiotemporal attention mechanisms, such as Figure 3 As shown, it consists of three parts: a spatial attention module (including a first spatial attention network and a second spatial attention network), a temporal attention module, and a prediction module.
[0112] The specific structure of the spatial attention module is as follows: Figure 4 As shown, the specific structures of the temporal attention module and the prediction module are as follows: Figure 5 As shown.
[0113] Step 5: Model Training and Optimization
[0114] 1) First stage training: Spatial attention module training. For example... Figure 4 As shown, the spatial attention module consists of two spatial attention networks and two LSMT networks, and undergoes three iterations of training. The input to the first spatial attention network is a 30-dimensional vector (x) composed of 10-dimensional related elements from three consecutive months. 1,1 , ..., x 10,1 x 1,2 , ..., x 10,2 x 1,3 , ..., x 10,3 ) and the first set of 64-dimensional state vectors (h 1,0 , ..., h 64,0 ), where the first set of state vectors (h) 1,0 , ..., h 64,0 In the first iteration, the state vectors are generated through random initialization, while in the subsequent two iterations, the second set of state vectors (h) is generated by the output of the first LSTM network. 1,1 , ..., h 64,1 This is obtained through feedback. The input to the second spatial attention network consists of three parts: the first part is the 64-dimensional second set of state vectors (h) output by the first LSTM network. 1,1 , ..., h 64,1 The second part is the historical thermal power generation y nThe input for the nth iteration is the thermal power generation for the nth month; the third part is the 64-dimensional third group of state vectors (h 1,2 , ..., h 64,2 The value of the fourth set of state vectors (h) is generated randomly during the first iteration, and in the subsequent two iterations, it is generated by the output of the second LSTM network. 1,3 , ..., h 64,3 The state vector output by the spatial attention module in the m-th iteration is obtained through feedback. This state vector is saved as the first-stage state vector (s). 1,m , ..., s 64,m ), used for training the time attention module and prediction module in the second stage.
[0115] 2) Second stage training: Training of the time attention module and prediction module, also undergoing 3 iterations. For example... Figure 5 As shown, the input to the temporal attention network consists of two 64-dimensional state vectors, which are the first-stage state vectors output by the second LSTM network in the previous stage (s...). 1,m , ..., s 64,m ) and the fifth group of state vectors (h 1,4 , ..., h 64,4 In the first iteration, the fifth set of state vectors (h) 1,4 , ..., h 64,4 The sixth state vector (h) is generated through random initialization, and in the subsequent two iterations, it is generated by the output of the third LSTM network. 1,5 , ..., h 64,5 This is obtained through feedback. The input to the third LSTM network, in addition to the 64-dimensional vector (β1, ..., β2) output by the temporal attention network, is... 64 It also includes historical thermal power generation, and in the nth iteration, the thermal power generation y for the nth month is input. m The 64-dimensional sixth group of state vectors output by the third LSTM network is nonlinearly weighted through a fully connected layer to obtain the predicted value y4 of thermal power generation for the next month.
[0116] 3) Model optimization: As data accumulates, the model is updated and optimized.
[0117] The following describes the experimental results of this invention on a real dataset.
[0118] Electricity generation data for a certain province was collected for 65 months, from January 2015 to May 2020. The data for the first 53 months was used as the training set, and the data for the last 12 months was used as the test set. Three thermal power generation prediction schemes were compared:
[0119] Option 1 uses only thermal power generation and external influencing factors, including GDP, population, temperature, date, etc.
[0120] Option 2 uses thermal power generation as the electricity gap, which is calculated as the total social electricity consumption forecast minus the new energy power generation forecast minus the purchased electricity.
[0121] Scheme 3 is the prediction model based on the spatiotemporal attention mechanism proposed in this invention.
[0122] The predictive performance metric used is MAPE (Mean absolute percentage error), which is: Where y n This represents the nth actual thermal power generation. This represents the nth predicted thermal power generation, where N is the test set size. Test performance is shown in Table 1 and... Figure 6 As shown.
[0123] Table 1
[0124] Scheme 1 Scheme 2 Scheme 3 MAPE 11.70% 11.63% 10.77%
[0125] Therefore, it can be seen that Scheme 3, which corresponds to the present invention, has the best predictive performance. Thus, the experiment of the embodiment of the present invention is successful, and reliable medium- and long-term prediction of regional thermal power generation is achieved.
[0126] This application also proposes a medium- to long-term forecasting system for regional thermal power generation, such as... Figure 7 As shown, the system includes:
[0127] The key influencing factor determination module 701 is used to perform correlation analysis on regional power historical data and related factor historical data based on a preset correlation analysis algorithm and determine a preset number of key influencing factors.
[0128] The sample generation module 702 is used to generate sample data based on the historical power data of the region and the historical data of the key influencing factors, and to divide the sample data into a training set, a test set and a verification set.
[0129] Model building module 703 is used to build a prediction model based on the spatiotemporal attention mechanism based on the spatial attention module, the temporal attention module and the prediction module;
[0130] The model training module 704 is used to train the prediction model based on the spatiotemporal attention mechanism based on the sample data, and obtain the target prediction model after the training is completed.
[0131] Prediction module 705 is used to predict the thermal power generation value for a preset time period based on the target prediction model;
[0132] The spatial attention module is used to extract the correlation between target type electricity and thermal power generation based on the spatial attention mechanism. The temporal attention module is used to take thermal power generation as the electricity consumption gap and extract the correlation between each key influencing factor and thermal power generation based on the temporal attention mechanism. The target type electricity includes the total regional social electricity consumption, wind power generation, hydropower generation, photovoltaic power generation, natural gas power generation and nuclear power generation. The electricity consumption gap = total regional social electricity consumption + electricity sold outside the region - wind power generation - hydropower generation - photovoltaic power generation - natural gas power generation - nuclear power generation - purchased electricity.
[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for long-term prediction of regional thermal power generation, characterized in that, The method comprises: performing correlation analysis on regional power historical data and associated factor historical data based on a preset correlation analysis algorithm and determining a preset number of key influence factors; generating sample data from the regional power historical data and the key influence factor historical data, and dividing the sample data into a training set, a test set and a verification set; constructing a prediction model based on a space-time attention mechanism according to a space attention module, a time attention module and a prediction module; training the prediction model based on the space-time attention mechanism based on the sample data, and obtaining a target prediction model after training is completed; predicting a future preset time length of thermal power generation capacity prediction value based on the target prediction model; wherein the space attention module is used to extract the correlation between the target type electric quantity and the thermal power generation capacity based on the space attention mechanism, the time attention module is used to extract the correlation between each key influence factor and the thermal power generation capacity based on the time attention mechanism by taking the thermal power generation capacity as the electricity consumption gap, the target type electric quantity includes regional total social electricity consumption, wind power generation capacity, water power generation capacity, photovoltaic power generation capacity, natural gas power generation capacity and nuclear power generation capacity, and the electricity consumption gap = regional total social electricity consumption + export electricity consumption - wind power generation capacity - water power generation capacity - photovoltaic power generation capacity - natural gas power generation capacity - nuclear power generation capacity - purchased electricity consumption; training the prediction model based on the space-time attention mechanism based on the sample data, specifically: performing first stage training on the space attention module based on the sample data; performing second stage training on the time attention module and the prediction module based on the sample data and the output of the space attention module; optimizing the prediction model based on the space-time attention mechanism based on the accumulation of the sample data; wherein the first stage training and the second stage training are respectively iterated for a preset number of times; the key influence factors include regional total social electricity consumption, wind power generation capacity, water power generation capacity, photovoltaic power generation capacity, nuclear power generation capacity, natural gas power generation capacity, GDP, population, air temperature and date.
2. The method of claim 1, wherein, The space attention module comprises a first space attention network, a first LSTM network, a second space attention network and a second LSTM network, and the first stage training on the space attention module based on the sample data is specifically: inputting a first group of vectors and a first group of state vectors into the first space attention network and connecting the output of the first space attention network to the first LSTM network; inputting a second group of state vectors output by the first LSTM network, historical thermal power generation capacity and a third group of state vectors into the second space attention network, connecting the output of the second space attention network to the second LSTM network, and obtaining a fourth group of state vectors output by the second LSTM network; generating a first stage state vector corresponding to the fourth group of state vectors after the preset number of iterations is completed; The first group of vectors is generated according to all the key influence factors within a preset historical time length, the first group of state vectors is randomly generated at the first iteration and is obtained according to feedback of the second group of state vectors in subsequent iterations, and the third group of state vectors is randomly generated at the first iteration and is obtained according to feedback of the fourth group of state vectors in subsequent iterations.
3. The method of claim 2, wherein, The time attention module and the prediction module are constituted by a time attention network, a third LSTM network and a full connection layer, and the time attention module and the prediction module are trained in a second stage based on the sample data and the output of the spatial attention module, specifically as follows: The first group of state vectors and a fifth group of state vectors are input into the time attention network, and the output of the time attention network is connected to the third LSTM network, and historical thermal power generation is input into the third LSTM network; A sixth group of state vectors output by the third LSTM network is input into the full connection layer, and a thermal power generation prediction value is output after nonlinear weighting based on the full connection layer; The iteration is performed for a preset number of times; The fifth group of state vectors is randomly generated at the first iteration and is obtained according to feedback of the sixth group of state vectors in subsequent iterations.
4. The method of claim 3, wherein, The preset number of times is 3, the preset number is 10, the preset historical time length is 3 months, the dimension of the first group of vectors is 30, the dimensions of the first group of state vectors, the second group of state vectors, the third group of state vectors, the fourth group of state vectors, the first stage state vectors, the fifth group of state vectors and the sixth group of state vectors are 64, the dimension of historical thermal power generation is 1, the historical thermal power generation corresponding to each iteration is of different months, and the future preset time length is one month in the future.
5. The method of claim 1, wherein, The regional power historical data includes various types of power consumption index data, various types of power generation data, grid unified power, grid non-unified power, purchased power and sold power, and the associated factor historical data includes regional social and economic development index data, regional climate and environment data and power generation capacity data of each power generation type.
6. The method of claim 1, wherein, Sample data is generated according to the regional power historical data and the historical data of the key influence factors, specifically as follows: the regional power historical data and the historical data of the key influence factors are preprocessed, and the various types of power data are aligned with the various key influence factors to generate the sample data. The preprocessing includes data cleaning, missing value processing, quantization encoding and normalization.
7. A regional thermal power generation long-term forecasting system, characterized by, The system comprises: a key influence factor determination module configured to perform correlation analysis on the regional power historical data and the associated factor historical data based on a preset correlation analysis algorithm and determine a preset number of key influence factors; a sample generation module configured to generate sample data according to the regional power historical data and the historical data of the key influence factors, and divide the sample data into a training set, a test set and a verification set; a model construction module configured to construct a prediction model based on a spatial attention module, a time attention module and a prediction module; and a model training module configured to train the prediction model based on the training set, the test set and the verification set. The model training module is configured to train the prediction model based on the sample data, and obtain a target prediction model after the training is completed. The prediction module is configured to predict a future power generation value based on the target prediction model. The space attention module is configured to extract the correlation between the target type power and the thermal power generation based on the space attention mechanism, and the time attention module is configured to extract the correlation between the key influencing factors and the thermal power generation based on the time attention mechanism, taking the thermal power generation as the electricity consumption gap. The target type power includes regional total social electricity consumption, wind power, hydro power, photovoltaic power, natural gas power, and nuclear power. The electricity consumption gap = regional total social electricity consumption + electricity sold outside + wind power + hydro power + photovoltaic power + natural gas power + nuclear power - electricity purchased outside. The model training module is configured to train the prediction model based on the sample data, and obtain a target prediction model after the training is completed. The space attention module is configured to extract the correlation between the target type power and the thermal power generation based on the space attention mechanism, and the time attention module is configured to extract the correlation between the key influencing factors and the thermal power generation based on the time attention mechanism, taking the thermal power generation as the electricity consumption gap. The target type power includes regional total social electricity consumption, wind power, hydro power, photovoltaic power, natural gas power, and nuclear power. The electricity consumption gap = regional total social electricity consumption + electricity sold outside + wind power + hydro power + photovoltaic power + natural gas power + nuclear power - electricity purchased outside. The model training module is configured to train the prediction model based on the sample data, and obtain a target prediction model after the training is completed. The space attention module is configured to extract the correlation between the target type power and the thermal power generation based on the space attention mechanism, and the time attention module is configured to extract the correlation between the key influencing factors and the thermal power generation based on the time attention mechanism, taking the thermal power generation as the electricity consumption gap. The target type power includes regional total social electricity consumption, wind power, hydro power, photovoltaic power, natural gas power, and nuclear power. The electricity consumption gap = regional total social electricity consumption + electricity sold outside + wind power + hydro power + photovoltaic power + natural gas power + nuclear power - electricity purchased outside. The model training module is configured to train the prediction model based on the sample data, and obtain a target prediction model after the training is completed. The space attention module is configured to extract the correlation between the target type power and the thermal power generation based on the space attention mechanism, and the time attention module is configured to extract the correlation between the key influencing factors and the thermal power generation based on the time attention mechanism, taking the thermal power generation as the electricity consumption gap. The target type power includes regional total social electricity consumption, wind power, hydro power, photovoltaic power, natural gas power, and nuclear power. The electricity consumption gap = regional total social electricity consumption + electricity sold outside + wind power + hydro power + photovoltaic power + natural gas power + nuclear power - electricity purchased outside.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, which, when executed on the terminal device, cause the terminal device to perform the regional thermal power generation medium and long term prediction method according to any one of claims 1-6.
Citation Information
Patent Citations
Method and system for power supply prediction by variety
AU2020103555A4
Real-time control system and method for generating capacity of micro grid
CN106786789A