Search

CN-121769856-B - Photovoltaic power generation power prediction method, network structure and device based on two-stage attention mechanism

CN121769856BCN 121769856 BCN121769856 BCN 121769856BCN-121769856-B

Abstract

The invention discloses a photovoltaic power generation power prediction method, a network structure and a device based on a two-stage attention mechanism. The method comprises the steps of extracting feature attention vectors of input features of each time step in a window, weighting the input features and the feature attention vectors, obtaining a hidden state sequence of the weighted feature attention vectors in each time step in the window, calculating context information representing uncertainty or credibility of corresponding time step information according to the feature attention vectors, calculating time sequence attention weights of each time step in the window according to the hidden state sequence, the hidden state of the tail end of the window and the context information, weighting and converging the hidden state sequence according to the time sequence attention weights to obtain context vectors, and predicting photovoltaic power generation power of a target prediction time node according to the context vectors. The invention can simultaneously improve the prediction precision, the robustness and the interpretability.

Inventors

  • YAN YUAN
  • LI YUN
  • MA CHANGJIANG
  • WANG SHIQI

Assignees

  • 电子科技大学(深圳)高等研究院
  • 电子科技大学

Dates

Publication Date
20260508
Application Date
20260303

Claims (9)

  1. 1. The photovoltaic power generation power prediction method based on the two-stage attention mechanism is characterized by comprising the following steps of: extracting a characteristic attention vector of an input characteristic of each time step in a window, and weighting the input characteristic and the characteristic attention vector to obtain a weighted characteristic attention vector; acquiring a hidden state sequence of the weighted feature attention vector in each time step in a window to obtain dynamic evolution information used for representing a historical sequence; calculating context information representing uncertainty or credibility of corresponding time step information according to the characteristic attention vector; according to the hidden state sequence, the hidden state at the tail end of the window and the context information, calculating time sequence attention weights of all time steps in the window, and carrying out weighted aggregation on the hidden state sequence according to the time sequence attention weights to obtain a context vector; Predicting photovoltaic power generation power of a target prediction time node according to the context vector; The method comprises the steps of predicting photovoltaic power generation power of a target prediction time node by using a regression prediction head, taking prediction loss as main loss when training the regression prediction head, and carrying out optimization updating by combining a KL regular term, wherein the time sequence attention weight is adopted by the coefficient of the KL regular term, and gradient propagation is stopped.
  2. 2. The method for predicting photovoltaic power generation power based on a two-stage attention mechanism according to claim 1, wherein before extracting the feature attention vector of the input feature of each time step in the window, the method further comprises: and calculating the predicted contribution of the input feature to the photovoltaic power generation power of the target prediction node by taking the photovoltaic power generation power of the target prediction time node as a center, and generating feature priori distribution according to the predicted contribution.
  3. 3. The photovoltaic power generation power prediction method based on the two-stage attention mechanism according to claim 2, further comprising constraining the feature attention distribution by KL divergence regularization term with the feature prior distribution as a reference distribution.
  4. 4. The photovoltaic power generation power prediction method based on a two-stage attention mechanism according to claim 2, wherein the feature prior distribution is further determined according to a temperature parameter adaptively determined by a prior uncertainty index of a bayesian network, wherein the greater the prior uncertainty index is, the greater the temperature parameter is; the prior uncertainty index is obtained by resampling training data or repeatedly learning Bayesian network parameters by adopting a rolling window mode, counting the variance of a side coefficient matrix or the width of a confidence interval, Or, the prior uncertainty index is obtained by calculation according to node noise variance obtained by learning the continuous Gao Sibei phyllos network parameters.
  5. 5. The method for predicting photovoltaic power generation power based on a two-stage attention mechanism of claim 2, wherein the input features comprise a first input feature and a second input feature, the first input feature comprises photovoltaic power generation power of a target prediction time node corresponding to a previous node, and the second input feature comprises at least two of global irradiance, scattered irradiance, humidity, wind speed and air pressure.
  6. 6. The method for predicting photovoltaic power generation power based on a two-stage attention mechanism of claim 5, wherein the predicted contribution is predicted by a continuous Gao Sibei leaf network, and prior to predicting the predicted contribution, a forward edge between the photovoltaic power generation power of the target predicted time node and a first input feature is forced to exist by adopting a scoring search and combining structural constraints, and a reverse edge between the photovoltaic power generation power of the target predicted time node and a second input feature is forbidden.
  7. 7. The method for predicting photovoltaic power generation power based on a two-stage attention mechanism according to claim 6, wherein the prediction contribution is calculated by a total effect matrix based on a network coefficient matrix, and the network coefficient matrix is learned by a bayesian network structure according to the first input feature and the second input feature.
  8. 8. The photovoltaic power generation power prediction network structure based on the two-stage attention mechanism is characterized by being used for realizing the photovoltaic power generation power prediction method based on the two-stage attention mechanism, and comprises an input layer, a priori generation branch, a characteristic attention branch, a time sequence encoder, an upper-lower Wen Teyi time sequence attention branch, a time sequence convergence unit, a regression prediction branch and a KL regular loss bypass; The input layer, the characteristic attention branch, the time sequence encoder, the upper Wen Teyi time sequence attention branch, the lower Wen Teyi time sequence convergence unit and the regression prediction branch are sequentially connected, the input layer, the priori generation branch and the KL regular loss bypass are sequentially connected, and the upper Wen Teyi time sequence attention branch, the lower Wen Teyi time sequence attention branch and the regression prediction branch are both connected with the KL regular loss bypass.
  9. 9. A photovoltaic power generation power prediction apparatus based on a two-stage attention mechanism, which is configured to implement the photovoltaic power generation power prediction method based on a two-stage attention mechanism as set forth in any one of claims 1 to 7, and includes: the Bayesian network modeling module is used for calculating the prediction contribution of the input characteristic to the photovoltaic power generation power of the target prediction node by taking the photovoltaic power generation power of the target prediction time node as the center; the importance analysis and prior distribution generation module is used for generating feature prior distribution according to the prediction contribution; the feature attention module is used for extracting feature attention vectors of input features of each time step in the window, and weighting the input features and the feature attention vectors to obtain weighted feature attention vectors; The KAN time sequence coding module is used for obtaining the hidden state sequence of each time step of the weighted feature attention vector in the window and obtaining dynamic evolution information used for representing the historical sequence; The context information calculation module is used for calculating context information representing uncertainty or reliability of corresponding time step information according to the characteristic attention vector; The up-down Wen Teyi time sequence attention fusion module is used for calculating time sequence attention weights of all time steps in a window according to the hidden state sequence, the window tail end hidden state and the context information, and carrying out weighted aggregation on the hidden state sequence according to the time sequence attention weights to obtain a context vector; The prediction output module is used for predicting the photovoltaic power generation power of the target prediction time node according to the context vector, wherein a regression prediction head is used for predicting the photovoltaic power generation power of the target prediction time node, when the regression prediction head is trained, the prediction loss is used as a main loss and is combined with a KL regular term for optimization updating, and the time sequence attention weight is adopted by the coefficient of the KL regular term and gradient propagation is stopped.

Description

Photovoltaic power generation power prediction method, network structure and device based on two-stage attention mechanism Technical Field The invention relates to the technical field of photovoltaic power generation power prediction, in particular to a photovoltaic power generation power prediction method, a network structure and a device based on a two-stage attention mechanism. Background Photovoltaic power generation power prediction is an important foundation for power grid dispatching, energy storage coordination, digestion evaluation and power station operation optimization. However, the photovoltaic power generation is simultaneously influenced by multi-source environmental characteristics such as global irradiance, scattering irradiance, humidity, wind speed, air pressure and the like and coupling relation thereof, and has obvious autoregressive relation with historical power, so that the power sequence has the characteristics of strong nonlinearity, strong correlation, strong time variation, uncertainty and the like, and under the weather abrupt change working conditions such as rapid cloud cluster change and the like, the noise characteristics are more easily caused by short-time intense fluctuation of the power, and the prediction accuracy is influenced. When the existing model is used for a complex nonlinear system driven by multi-factor coupling and with the mapping relation frequently switched under different working conditions, the depth or width of the network is often required to be increased to improve the fitting capability, so that parameter expansion, over-fitting risk rise and interpretation are caused difficultly. Thus, there is a lack of network structural support that can provide a stronger nonlinear expression at the same time as the temporal coding and predictive regression phases and ease of interpretation. Based on the above-mentioned problems, a new photovoltaic power prediction scheme is needed to form a more complete interpretable link with the attention mechanism, so as to improve the robustness and interpretability of the model while ensuring the accuracy. Disclosure of Invention The invention aims to provide a photovoltaic power generation power prediction method, a network structure and a device based on a two-stage attention mechanism, so as to solve the technical problems. The preferred technical solutions of the technical solutions provided by the present invention can produce a plurality of technical effects described below. In order to achieve the above purpose, the present invention provides the following technical solutions: the invention provides a photovoltaic power generation power prediction method based on a two-stage attention mechanism, which comprises the following steps of: extracting a characteristic attention vector of an input characteristic of each time step in a window, and weighting the input characteristic and the characteristic attention vector to obtain a weighted characteristic attention vector; acquiring a hidden state sequence of the weighted feature attention vector in each time step in a window to obtain dynamic evolution information used for representing a historical sequence; calculating context information representing uncertainty or credibility of corresponding time step information according to the characteristic attention vector; according to the hidden state sequence, the hidden state at the tail end of the window and the context information, calculating time sequence attention weights of all time steps in the window, and carrying out weighted aggregation on the hidden state sequence according to the time sequence attention weights to obtain a context vector; and predicting the photovoltaic power generation power of the target prediction time node according to the context vector. In one or more embodiments, before extracting the feature attention vector of the input feature of each time step in the window, the method further includes: and calculating the predicted contribution of the input feature to the photovoltaic power generation power of the target prediction node by taking the photovoltaic power generation power of the target prediction time node as a center, and generating feature priori distribution according to the predicted contribution. In one or more embodiments, further comprising constraining the feature attention profile by a KL divergence regularization term using the feature prior profile as a reference profile. In one or more embodiments, the feature prior distribution is further determined according to a temperature parameter adaptively determined by a prior uncertainty indicator of a bayesian network, wherein the greater the prior uncertainty indicator, the greater the temperature parameter; the prior uncertainty index is obtained by resampling training data or repeatedly learning Bayesian network parameters by adopting a rolling window mode, counting the variance of a side coefficient matrix or the width of a conf