A distributed photovoltaic power generation amount prediction method, system, storage medium and device

CN122549640APending Publication Date: 2026-08-11GUANGDONG POWER TRANSMISSION & TRANSFORMATION ENG
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-02
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

然而,这些现有方案在模型架构层面采用固定深度计算,使得模型难以从高维时序数据中精准提取最具预测价值的信息

Benefits of technology

[0022] The embodiments of this invention have the following beneficial effects: First, the preprocessing of meteorological time-series data generates a high-quality key feature matrix, laying a data foundation for subsequent accurate prediction. Based on this, the recurrent neural network layer employs iterative gating units and a stopping decision mechanism, which can dynamically adjust the computational depth of each time step according to the complexity of the input data. In complex scenarios such as sudden weather changes, it fully extracts deep-level time-series features through multiple iterations, while avoiding redundant computation in simple scenarios, thereby improving feature extraction capabilities while optimizing computational efficiency. Furthermore, the attention mechanism layer introduces correlation coefficients calculated based on historical data to construct weighting factors, enabling the model to specifically strengthen the contribution of highly correlated feature dimensions such as irradiance when calculating attention scores, effectively improving the identification of key information. Simultaneously, through parallel computation and weighted merging of multiple attention heads, differentiated fusion of multi-dimensional time-series features is achieved, further enhancing the expressive power of the features. Finally, the fully connected layer maps the weighted feature matrix rich in time-series dependencies and key feature information into the prediction result. Through the progressive synergistic effect of the above-mentioned data preprocessing, dynamic time series extraction, key feature enhancement, and multi-head differentiated fusion, this invention significantly improves the accuracy and stability of photovoltaic power generation prediction, especially showing stronger generalization ability and robustness under complex meteorological conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122549640A_ABST
    Figure CN122549640A_ABST
Patent Text Reader

Abstract

This invention discloses a method for predicting distributed photovoltaic (PV) power generation, comprising: acquiring meteorological time-series data for a target period; preprocessing to generate a key feature matrix; and inputting the data into a deep learning prediction model to obtain a predicted PV power generation value. The model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected sequentially. The recurrent neural network layer performs multiple calculations at each time step using iterative gating units: initially using the hidden state of the previous time step as input, and subsequently using the result of the previous calculation as input; a stopping decision mechanism dynamically determines the number of calculations, forming a deep temporal feature matrix. The attention mechanism layer maps the deep temporal feature matrix to obtain a weighted feature matrix, and the fully connected layer maps the weighted feature matrix to a predicted PV power generation value and outputs it. This method achieves adaptive adjustment of the computational depth and accurate extraction of key features, thereby enabling accurate prediction of distributed PV power generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system technology, and in particular to a method, system, storage medium and device for predicting distributed photovoltaic power generation. Background Technology

[0002] Amid the global energy transition, distributed photovoltaic (PV) power generation has gained widespread application due to its flexibility and cleanliness. However, PV power output is significantly affected by meteorological factors such as irradiance, temperature, and weather type, exhibiting strong fluctuations, intermittency, and uncertainty, posing a severe challenge to grid power balance, safe and stable operation, and economic dispatch. To address this challenge, high-precision short-term PV power generation forecasting technology has become crucial for supporting the intelligent operation of PV power plants and grid-friendly integration.

[0003] Existing technologies typically employ statistical models based on historical data or machine learning models for prediction. In recent years, deep learning models, such as Long Short-Term Memory (LSTM) networks and their variants (e.g., bidirectional LSTM), have demonstrated significant potential in photovoltaic forecasting due to their powerful ability to capture temporal features. However, these existing solutions utilize fixed-depth computation at the model architecture level, making it difficult for the models to accurately extract the most predictive information from high-dimensional time-series data. Summary of the Invention

[0004] Therefore, it is necessary to propose a method for predicting distributed photovoltaic power generation to address the above problems.

[0005] A method for predicting distributed photovoltaic power generation, the method comprising the following steps: Obtain meteorological time-series data for the target period of the distributed photovoltaic power station to be predicted; The meteorological time series data for the target period are preprocessed to generate a key feature matrix for the target period; The key feature matrix of the target time period is input into a pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station to be predicted during the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes an iterative gating unit. This iterative gating unit sequentially extracts features from the key feature matrix of the target time period to obtain the input features for each time step. At each time step, the current input features are calculated multiple times. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process. The hidden states from each calculation are weighted and fused to form the deep temporal feature of the current time step. The deep temporal features of all time steps are arranged chronologically to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix. Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix into a predicted value of photovoltaic power generation and outputs it.

[0006] In the above scheme, the preprocessing of the meteorological time-series data for the target period to generate a key feature matrix for the target period specifically includes: The meteorological time series data for the target period are processed by outlier removal and missing value filling. Weather clustering is performed using irradiance data at preset time intervals as features to generate multiple weather type labels; and the weather type labels are then converted into numerical weather label vectors. Key meteorological features with a correlation higher than a preset threshold with historical power generation were selected from the processed historical meteorological time-series data. The numerical weather label vector and the key meteorological features are aligned and concatenated according to time series to form the key feature matrix for the target time period.

[0007] In the above scheme, the output of the forget gate of the iterative gating unit in the nth calculation at time step t is determined by the following formula:

[0008] in, Let be the output value of the forget gate at time step t and the nth iteration. Here is the weight matrix for the forget gate. This represents the final depth temporal feature at time step t-1. This is the input feature vector at time step t, which is the t-th row vector in the key feature matrix of the target time period. Here, n represents the bias term for the forget gate, and n is the number of iterations. This represents the hidden state during the (n-1)th iteration; According to the time step t Hidden states in all iterations of 1 Determine the final depth temporal features at time step t-1 .

[0009] In the above scheme, the stopping decision mechanism is determined by calculating the stopping probability for each calculation: The stopping probability is:

[0010] in, This refers to the hidden state at the nth iteration. It is the bias vector; The preset weight matrix; When the cumulative stopping probability When the preset threshold is reached, the iterative calculation at the current time step is stopped.

[0011] In the above scheme, the step of calculating the attention score based on the query matrix, key matrix, and relevance coefficient, and then weighting the value matrix using the attention score to obtain the output of the attention head, specifically includes: A feature correlation weight factor matrix Λ is constructed based on the correlation coefficients between various meteorological characteristics and power generation in the historical data of the distributed photovoltaic power station. Calculate the attention score based on the query matrix, key matrix, and relevance coefficient:

[0012] in, Let i be the query matrix for the i-th attention head. Let i be the key matrix of the i-th attention head. This is the correlation coefficient feature correlation weight factor matrix. The feature dimensions of the query matrix and the key matrix; Normalize the attention score into attention weights:

[0013] in, The attention score is the i-th score. The value matrix is ​​weighted and summed based on the attention weights to obtain the output of the i-th attention head:

[0014] in, Let be the value matrix of the i-th attention head. Let i be the attention weight matrix. This is the output of the i-th attention head.

[0015] In the above scheme, the step of merging the outputs of each attention head to obtain a weighted feature matrix includes: The outputs of each attention point are combined with their corresponding weights and then concatenated to form the weighted feature matrix:

[0016] in, To output the projection matrix, Let i be the weight corresponding to the i-th attention head. This is the weighted characteristic matrix.

[0017] In the above scheme, the fully connected layer maps the weighted feature matrix to a predicted value of photovoltaic power generation and outputs it, specifically including: The predicted value of photovoltaic power generation is determined using the following formula:

[0018] in, This is a series of predicted photovoltaic power generation values ​​for the target period. For the weighted characteristic matrix, , These are the weight matrix and bias vector of the fully connected layer, respectively. It is a linear rectification activation function.

[0019] This application also proposes a distributed photovoltaic power generation prediction system, which includes: a data acquisition unit, a data processing unit, and a deep model prediction unit; The data acquisition unit is used to acquire meteorological time series data of the target period of the distributed photovoltaic power station to be predicted; The data processing unit is used to preprocess the meteorological time series data of the target time period to generate a key feature matrix of the target time period; The deep model prediction unit is used to input the key feature matrix of the target time period into a pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station to be predicted in the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes an iterative gating unit, which sequentially extracts features from the key feature matrix to obtain the input features for each time step, and performs multiple calculations on the current input features at each time step. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process, and the hidden states from each calculation are weighted and fused to form the deep temporal feature for the current time step. The deep temporal features from all time steps are arranged in chronological order to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix. Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix into a predicted value of photovoltaic power generation and outputs it.

[0020] This application also proposes a readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the following steps: Obtain meteorological time-series data for the target period of the distributed photovoltaic power station to be predicted; The meteorological time series data for the target period are preprocessed to generate a key feature matrix for the target period; The key feature matrix of the target time period is input into a pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station to be predicted during the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes an iterative gating unit. This iterative gating unit sequentially extracts features from the key feature matrix of the target time period to obtain the input features for each time step. At each time step, the current input features are calculated multiple times. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process. The hidden states from each calculation are weighted and fused to form the deep temporal feature of the current time step. The deep temporal features of all time steps are arranged chronologically to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix. Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix into a predicted value of photovoltaic power generation and outputs it.

[0021] This application also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, and the computer program is processed by the processor in the following steps: Obtain meteorological time-series data for the target period of the distributed photovoltaic power station to be predicted; The meteorological time series data for the target period are preprocessed to generate a key feature matrix for the target period; The key feature matrix of the target time period is input into a pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station to be predicted during the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes an iterative gating unit. This iterative gating unit sequentially extracts features from the key feature matrix of the target time period to obtain the input features for each time step. At each time step, the current input features are calculated multiple times. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process. The hidden states from each calculation are weighted and fused to form the deep temporal feature of the current time step. The deep temporal features of all time steps are arranged chronologically to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix. Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix into a predicted value of photovoltaic power generation and outputs it.

[0022] The embodiments of this invention have the following beneficial effects: First, the preprocessing of meteorological time-series data generates a high-quality key feature matrix, laying a data foundation for subsequent accurate prediction. Based on this, the recurrent neural network layer employs iterative gating units and a stopping decision mechanism, which can dynamically adjust the computational depth of each time step according to the complexity of the input data. In complex scenarios such as sudden weather changes, it fully extracts deep-level time-series features through multiple iterations, while avoiding redundant computation in simple scenarios, thereby improving feature extraction capabilities while optimizing computational efficiency. Furthermore, the attention mechanism layer introduces correlation coefficients calculated based on historical data to construct weighting factors, enabling the model to specifically strengthen the contribution of highly correlated feature dimensions such as irradiance when calculating attention scores, effectively improving the identification of key information. Simultaneously, through parallel computation and weighted merging of multiple attention heads, differentiated fusion of multi-dimensional time-series features is achieved, further enhancing the expressive power of the features. Finally, the fully connected layer maps the weighted feature matrix rich in time-series dependencies and key feature information into the prediction result. Through the progressive synergistic effect of the above-mentioned data preprocessing, dynamic time series extraction, key feature enhancement, and multi-head differentiated fusion, this invention significantly improves the accuracy and stability of photovoltaic power generation prediction, especially showing stronger generalization ability and robustness under complex meteorological conditions. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] in: Figure 1 This is a schematic diagram of a distributed photovoltaic power generation prediction method in one embodiment. Detailed Implementation

[0025] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the invention; however, it will be apparent to those skilled in the art that the invention may be practiced without one or more of these details; in other instances, certain technical features well-known in the art have not been described in order to avoid confusion with the invention. It should be understood that the invention can be practiced in different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided to make the disclosure thorough and complete and to fully convey the scope of the invention to those skilled in the art. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. When used herein, the singular forms “a,” “an,” and “the” are also intended to include the plural forms, unless the context clearly indicates otherwise. The terms “comprising” and / or “including,” when used in this specification, identify the presence of said features, integers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups. When used herein, the term “and / or” includes any and all combinations of the associated listed items.

[0027] To fully understand the present invention, a detailed structure will be presented in the following description in order to illustrate the technical solution proposed by the present invention; optional embodiments of the present invention are described in detail below, however, in addition to these detailed descriptions, the present invention may have other embodiments.

[0028] like Figure 1As shown, in one embodiment, a method for predicting distributed photovoltaic power generation is provided. This method includes steps S101 to S103, which are detailed below: S101. Obtain meteorological time series data for the target period of the distributed photovoltaic power station to be predicted; Specifically, the meteorological time-series data for the target period includes meteorological characteristics such as irradiance, temperature, humidity, wind speed, and air pressure within that period. The data collection interval can be set to 15 minutes. Collecting this data ensures that the prediction model can obtain environmental information strongly correlated with power generation, laying a data foundation for subsequent accurate predictions.

[0029] S102. Preprocess the meteorological time series data for the target period to generate the key feature matrix for the target period; In some embodiments, the meteorological time-series data for the target time period are preprocessed to generate a key feature matrix for the target time period, specifically including: Outlier deletion and missing value filling are performed on the meteorological time series data for the target period. Weather clustering is performed using irradiance data at preset time intervals as features to generate multiple weather type labels; and the weather type labels are then converted into numerical weather label vectors. Key meteorological features with a correlation higher than a preset threshold with historical power generation were selected from the processed historical meteorological time-series data. Numerical weather label vectors and key meteorological features are aligned and concatenated according to time series to form a key feature matrix for the target time period.

[0030] Preferably, the numerical weather label vector is determined according to the following method: Outlier deletion and missing value filling are performed on the meteorological time series data for the target period. Weather clustering is performed using irradiance in meteorological time series data of the target time period at a preset time interval as a feature, and the weather type is divided into three categories: sunny, cloudy and rainy / snowy, which serve as category labels. The category labels are converted into numerical weather label vectors, where sunny, cloudy, and rainy / snowy days correspond to different three-dimensional numerical vectors.

[0031] Preferably, near-zero outliers are removed using physical identification methods. Specifically, the interquartile range (IQR) method is used to identify discrete outliers, as shown in the following formula:

[0032]

[0033]

[0034] Q1 is the first quartile, Q2 is the median, and Q3 is the third quartile. Data points falling outside the Up and Low quartiles are considered outliers.

[0035] Preferably, based on the KNN algorithm, similar samples are calculated using Mahalanobis distance, as shown in the following formula:

[0036] Where d is the Mahalanobis distance, S -1 The inverse of the sample covariance matrix is ​​used to fill in missing values ​​using a weighted average.

[0037] Preferably, weather types are defined using irradiance at 15-minute intervals, with K=3. The Euclidean distance formula is as follows, and weather clustering is performed on the irradiance data:

[0038] Where xi and yi are the coordinates of point x and y in the i-th dimension, respectively, and n is the spatial dimension.

[0039] Preferably, key meteorological features are determined according to the following methods: A meteorological feature matrix is ​​determined based on the preprocessed meteorological time series data for the target period. The meteorological features include irradiance, temperature, humidity, wind speed, and air pressure. Convert the corresponding historical power generation sequence into a power generation vector; Calculate the correlation coefficient between each meteorological characteristic and the power generation vector using the following formula:

[0040] in, Let be the correlation coefficient between the i-th meteorological feature and power generation, where i is the index of the meteorological feature, N is the total length of the time series, and K is the index of the sample points in the time series. Let be the value of the ith meteorological feature in the k-th sample point. Let i be the average value of the i-th meteorological feature across all sample points. This represents the average power generation. This represents the photovoltaic power generation value corresponding to the k-th sample point; The correlation coefficients between all meteorological features and the power generation vector are sorted from largest to smallest, and the top m features are selected as key meteorological features.

[0041] S103. Input the key feature matrix of the target time period into the pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station to be predicted in the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes iterative gating units. These units sequentially extract features from the key feature matrix of the target time period, obtaining the input features for each time step. At each time step, the current input features are calculated multiple times. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process. The hidden states from each calculation are weighted and fused to form the deep temporal feature for the current time step. The deep temporal features from all time steps are arranged chronologically to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix; Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are then merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix to the predicted value of photovoltaic power generation and outputs it.

[0042] Specifically, the recurrent neural network layer uses iterative gating units to perform multiple calculations on the input features at each time step: initially, it uses the hidden state from the previous time step as input to establish temporal dependencies; subsequently, it uses the result of the previous calculation as input to deepen feature extraction. A stopping decision mechanism dynamically determines the number of calculations at each time step based on the convergence of the hidden states. In complex scenarios such as sudden weather changes, multiple iterations fully mine deep temporal features; in simple scenarios such as clear weather, early stopping avoids computational redundancy. The hidden states from each calculation are weighted and fused, comprehensively utilizing the information extracted from multiple iterations. This layer achieves an adaptive balance between prediction accuracy and computational efficiency, effectively improving the model's adaptability to meteorological scenarios of varying complexity.

[0043] The attention mechanism layer maps the deep temporal feature matrix to different representation subspaces through multiple attention heads, capturing multi-dimensional temporal dependencies in parallel. A weight factor matrix is ​​constructed based on the correlation coefficient between meteorological features and power generation calculated from historical data, and this matrix is ​​introduced into the similarity calculation between the query matrix and the key matrix, giving higher weights to highly correlated feature dimensions such as irradiance in the attention score. The value matrix is ​​weighted using the attention score, allowing the model to focus on information from key time steps and key feature dimensions. The outputs of each attention head are merged to achieve differentiated fusion of multi-dimensional features. This layer significantly improves the model's ability to identify key meteorological features, enhancing the stability and accuracy of the prediction results.

[0044] The fully connected layer performs a nonlinear transformation on the weighted feature matrix through one or more fully connected layers, converting the feature vectors rich in temporal dependencies and key feature information extracted by the attention mechanism layer into the final photovoltaic power generation prediction value. This layer realizes the regression mapping from deep features to specific numerical values, and can output single-point prediction values ​​or multi-step prediction sequences according to prediction needs, providing direct decision-making basis for photovoltaic power plant scheduling and grid operation.

[0045] In fact, this recurrent neural network layer is composed of iterative gating units. These units integrate core gating mechanisms such as forget gates, input gates, and output gates. Through these gating mechanisms, information is selectively passed and updated. The specific working principle is further explained below: Forget gate: Responsible for deciding which information to discard from the cell state passed from the previous time step. During iterative computation, the forget gate uses the final depth-series features of the previous time step, the input feature vector of the current time step, and the intermediate hidden states of the (n-1)th iteration to output a numerical vector between 0 and 1 through the Sigmoid activation function, which controls the degree of information retention.

[0046] Input gate: Responsible for determining which new information from the input feature vector at the current time step will be updated into the cell state. It typically consists of a sigmoid layer that determines which values ​​are updated, and a tanh layer that creates a new candidate value vector; the two work together to write the information.

[0047] Output gate: Responsible for determining the final output value based on the current cell state. The output gate uses a sigmoid layer to determine which parts of the cell state will be output as the hidden state for the current iteration.

[0048] Unlike traditional recurrent neural networks, the gating mechanism in this embodiment of the invention performs multiple iterative calculations within each time step: In the nth iteration of time step t, the forget gate and the input gate not only receive the input features at the current time, but also the intermediate hidden states generated in the (n-1)th iteration and the final features of the previous time step.

[0049] This iterative gating computation allows the model to repeatedly refine and extract features within the same time step. The stopping decision mechanism dynamically determines the number of gating computations based on the convergence of the hidden states, thereby adaptively adjusting the depth of feature extraction.

[0050] In summary, this recurrent neural network layer, through an iterative gating unit containing forget gates, input gates, and output gates, achieves accurate capture of long-term and short-term dependencies in meteorological time-series data, and also has the ability to dynamically adjust the computation depth according to data complexity.

[0051] In some embodiments, the output of the forget gate of the iterative gating unit in the nth calculation at time step t is determined by the following formula:

[0052] in, Let be the output value of the forget gate at time step t and the nth iteration. Here is the weight matrix for the forget gate. This represents the final depth temporal feature at time step t-1. This is the input feature vector at time step t, which is the t-th row vector in the key feature matrix of the target time period. Here, n represents the bias term for the forget gate, and n is the number of iterations. This represents the hidden state during the (n-1)th iteration; Based on time step t Hidden states in all iterations of 1 Determine the final depth temporal features at time step t-1 .

[0053] In some embodiments, the stopping decision mechanism is determined by calculating the stopping probability for each calculation: The stopping probability is:

[0054] in, This refers to the hidden state at the nth iteration. It is the bias vector; The preset weight matrix; When the cumulative stopping probability When the preset threshold is reached, the iterative calculation at the current time step is stopped.

[0055] In some embodiments, an attention score is calculated based on the query matrix, the key matrix, and the relevance coefficient. The attention score is then used to weight the value matrix to obtain the output of the attention head, specifically including: A feature correlation weight factor matrix Λ is constructed based on the correlation coefficients between various meteorological characteristics and power generation in historical data of distributed photovoltaic power stations. Calculate the attention score based on the query matrix, key matrix, and relevance coefficient:

[0056] in, Let i be the query matrix for the i-th attention head. Let i be the key matrix of the i-th attention head. This is the correlation coefficient feature correlation weight factor matrix. The feature dimensions of the query matrix and the key matrix; Normalize the attention score into attention weights:

[0057] in, The attention score is the i-th score. The value matrix is ​​weighted and summed based on the attention weights to obtain the output of the i-th attention head:

[0058] in, Let be the value matrix of the i-th attention head. Let i be the attention weight matrix. This is the output of the i-th attention head.

[0059] In some embodiments, the outputs of each attention head are merged to obtain a weighted feature matrix, including: The outputs of each attention point are combined with their corresponding weights and then concatenated to form a weighted feature matrix:

[0060] in, To output the projection matrix, Let i be the weight corresponding to the i-th attention head. This is the weighted characteristic matrix.

[0061] In some embodiments, the fully connected layer maps the weighted feature matrix to a predicted value of photovoltaic power generation and outputs it, specifically including: The predicted value of photovoltaic power generation is determined using the following formula:

[0062] in, This is a series of predicted photovoltaic power generation values ​​for the target period. For the weighted characteristic matrix, , These are the weight matrix and bias vector of the fully connected layer, respectively. It is a linear rectification activation function.

[0063] In some embodiments, focusing on minimizing supply-demand imbalance, network loss, investment cost, and voltage deviation, a unified objective function is constructed using a weighted summation method. The weights are determined through the Analytic Hierarchy Process (AHP), satisfying the following conditions: , The formula is as follows:

[0064] The sub-objective functions include: (1) Minimize the supply-demand gap (Improve the local consumption rate of photovoltaic power)

[0065] To optimize the total number of time periods (e.g., 24 hours, with a step size of 15 minutes) ), Rated power of the regional power grid (unit: kW, used for normalization); for Forecasted photovoltaic power generation for the time period (output from the DEGWO-ActBiLSTM-MHSA model, in kW); for Time-period regional load demand (obtained through historical data and load forecasting models, in kW).

[0066] (2) Minimize network loss (Reduce power grid transmission losses) Based on the active power loss model of the IEEE 33-bus system branch.

[0067] in, This is the set of branches for the IEEE 33-node system (32 branches in total). , for Time-of-day branch Active / reactive power (units are kW and kVar); for Time period nodes The actual voltage (in kV); branch road The resistance (in Ω).

[0068] (3) Minimize investment costs (Balancing technology and economy) Considering the annualized cost over the entire lifecycle of photovoltaic and grid-connected equipment:

[0069] in, Base cost (in ten thousand yuan, used for normalization); The unit investment cost of photovoltaic modules (in yuan / kW); Photovoltaic installed capacity (unit: kW); Unit investment cost of grid-connected equipment (inverter, transformer, cable) (unit: yuan / kW); Rated capacity of grid-connected equipment (unit: kW); The annual interest rate is 4.35%, which is the industry standard. The equipment's service life is taken as 25 years. The annual maintenance cost is 2% of the total initial investment.

[0070] (4) Minimize voltage deviation (Ensuring stable grid voltage) It meets the voltage tolerance requirements of the national standard GB / T 12325-2022.

[0071] in, This represents the total number of nodes in the IEEE 33-node system (33 nodes). The rated voltage of the power grid is 10kV. for Time period nodes The actual voltage (in kV).

[0072] The core constraints are: 1. Power balance constraints (power grid supply and demand balance)

[0073] in, The total active power injected by all photovoltaic power sources during a given period is equal to the sum of the total regional load demand and the total grid loss.

[0074] 2. Capacity constraints (safe operation of equipment)

[0075] in, For the first The maximum output of a single photovoltaic unit (equal to the installed capacity). For the first The rated capacity of each grid-connected device should be considered to avoid overloading.

[0076] 3. Voltage constraint (meets national standards)

[0077] Note: All node voltages must be stable within ±5% of the rated voltage to avoid equipment damage or power outages caused by voltage exceeding limits.

[0078] 4. Grid connection point constraints (adapted to IEEE 33-node system) .

[0079] Furthermore, a hybrid distributed chaotic mapping combined with a dual-population collaborative formula is used to output the optimal grid connection point and capacity.

[0080] ); in, The position of the i-th particle in the j-th dimension in the t-th iteration (j=1 is the grid connection point, j=2 is the grid capacity) is initially generated by the mixed chaotic mapping and subsequently inherits the results of the previous round; The updated position is calculated using a formula; The Pareto optimal solution is obtained by coordinating the two populations to find the globally optimal position. The adaptive perturbation weights (0.5-1.2) are dynamically adjusted during the iteration phase. The reference benchmark is the preset preferred node for the access point, and the capacity is the minimum of the predicted value and the upper limit of the power grid. The result is a random number in the (0,1) range, generated by a mixed chaotic mapping.

[0081] 3. Iteration cutoff condition (any one of the following is sufficient) (1) Reach the maximum number of iterations (100-200 times); (2) The change in the objective function over 10-15 consecutive generations is less than 10. -5 ; (3) Each sub-target meets the preset accuracy (supply-demand difference f1≤0.05, etc.).

[0082] This application also proposes a distributed photovoltaic power generation prediction system, which includes: a data acquisition unit, a data processing unit, and a deep model prediction unit; The data acquisition unit is used to acquire meteorological time-series data for the target period of the distributed photovoltaic power station to be predicted; The data processing unit is used to preprocess the meteorological time series data for the target period and generate the key feature matrix for the target period. The deep model prediction unit is used to input the key feature matrix of the target time period into the pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station to be predicted in the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes iterative gating units. These units sequentially extract features from the key feature matrix to obtain the input features for each time step, and perform multiple calculations on the current input features at each time step. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process. The hidden states from each calculation are weighted and fused to form the deep temporal feature for the current time step. The deep temporal features from all time steps are arranged chronologically to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix; Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are then merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix to the predicted value of photovoltaic power generation and outputs it.

[0083] This application also proposes a readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the following steps: Obtain meteorological time-series data for the target period of the distributed photovoltaic power station to be predicted; Preprocess the meteorological time series data for the target period to generate a key feature matrix for the target period; Input the key feature matrix of the target time period into the pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station in the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes iterative gating units. These units sequentially extract features from the key feature matrix of the target time period, obtaining the input features for each time step. At each time step, the current input features are calculated multiple times. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process. The hidden states from each calculation are weighted and fused to form the deep temporal feature for the current time step. The deep temporal features from all time steps are arranged chronologically to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix; Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are then merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix to the predicted value of photovoltaic power generation and outputs it.

[0084] This application also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, and the computer program is processed by the processor in the following steps: Obtain meteorological time-series data for the target period of the distributed photovoltaic power station to be predicted; Preprocess the meteorological time series data for the target period to generate a key feature matrix for the target period; Input the key feature matrix of the target time period into the pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station in the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes iterative gating units. These units sequentially extract features from the key feature matrix of the target time period, obtaining the input features for each time step. At each time step, the current input features are calculated multiple times. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process. The hidden states from each calculation are weighted and fused to form the deep temporal feature for the current time step. The deep temporal features from all time steps are arranged chronologically to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix; Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are then merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix to the predicted value of photovoltaic power generation and outputs it.

[0085] Those skilled in the art will understand that implementing all or part of the processes in the above embodiments can be accomplished by instructing related hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0086] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0087] The embodiments described above are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application's patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. The embodiments disclosed above are merely preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, equivalent variations made according to the claims of this invention are still within the scope of this invention.

Claims

1. A distributed photovoltaic power generation amount prediction method characterized by comprising: The method includes: Obtain meteorological time-series data for the target period of the distributed photovoltaic power station to be predicted; The meteorological time series data for the target period are preprocessed to generate a key feature matrix for the target period; The key feature matrix of the target time period is input into a pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station to be predicted during the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes an iterative gating unit. This iterative gating unit sequentially extracts features from the key feature matrix of the target time period to obtain the input features for each time step. At each time step, the current input features are calculated multiple times. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process. The hidden states from each calculation are weighted and fused to form the deep temporal feature of the current time step. The deep temporal features of all time steps are arranged chronologically to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix. Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix into a predicted value of photovoltaic power generation and outputs it.

2. The method of claim 1, wherein, The preprocessing of the meteorological time-series data for the target time period to generate a key feature matrix for the target time period specifically includes: The meteorological time series data for the target period are processed by outlier removal and missing value filling. Weather clustering is performed using irradiance data at preset time intervals as features to generate multiple weather type labels; and the weather type labels are then converted into numerical weather label vectors. Key meteorological features with a correlation higher than a preset threshold with historical power generation were selected from the processed historical meteorological time-series data. The numerical weather label vector and the key meteorological features are aligned and concatenated according to time series to form the key feature matrix for the target time period.

3. The method of claim 2, wherein, In the nth calculation at time step t, the output of the forget gate of the iterative gating unit is determined by the following formula: in, Let be the output value of the forget gate at time step t and the nth iteration. Here is the weight matrix for the forget gate. This represents the final depth temporal feature at time step t-1. This is the input feature vector at time step t, which is the t-th row vector in the key feature matrix of the target time period. Here, n represents the bias term for the forget gate, and n is the number of iterations. This represents the hidden state during the (n-1)th iteration; According to the time step t Hidden states in all iterations of 1 Determine the final depth temporal features at time step t-1 .

4. The method for predicting distributed photovoltaic power generation according to claim 3, characterized in that, The stopping decision mechanism is determined by calculating the stopping probability for each calculation: The stopping probability is: in, This refers to the hidden state at the nth iteration. It is the bias vector; The preset weight matrix; When the cumulative stopping probability When the preset threshold is reached, the iterative calculation at the current time step is stopped.

5. The method for predicting distributed photovoltaic power generation according to claim 4, characterized in that, The process of calculating attention scores based on the query matrix, key matrix, and relevance coefficients, and then weighting the value matrix using these attention scores to obtain the output of the attention head, specifically includes: A feature correlation weight factor matrix Λ is constructed based on the correlation coefficients between various meteorological characteristics and power generation in the historical data of the distributed photovoltaic power station. Calculate the attention score based on the query matrix, key matrix, and relevance coefficient: in, Let i be the query matrix for the i-th attention head. Let i be the key matrix of the i-th attention head. This is the correlation coefficient feature correlation weight factor matrix. The feature dimensions of the query matrix and the key matrix; Normalize the attention score into attention weights: in, The attention score is the i-th score. The value matrix is ​​weighted and summed based on the attention weights to obtain the output of the i-th attention head: in, Let be the value matrix of the i-th attention head. Let i be the attention weight matrix. This is the output of the i-th attention head.

6. The method for predicting distributed photovoltaic power generation according to claim 5, characterized in that, The step of merging the outputs of each attention head to obtain a weighted feature matrix includes: The outputs of each attention point are combined with their corresponding weights and then concatenated to form the weighted feature matrix: in, To output the projection matrix, Let i be the weight corresponding to the i-th attention head. This is the weighted characteristic matrix.

7. The method for predicting distributed photovoltaic power generation according to claim 6, characterized in that, The fully connected layer maps the weighted feature matrix to a predicted value of photovoltaic power generation and outputs it, specifically including: The predicted value of photovoltaic power generation is determined using the following formula: in, This is a series of predicted photovoltaic power generation values ​​for the target period. For the weighted characteristic matrix, , These are the weight matrix and bias vector of the fully connected layer, respectively. It is a linear rectification activation function.

8. A distributed photovoltaic power generation prediction system, characterized in that, The system includes: a data acquisition unit, a data processing unit, and a deep model prediction unit; The data acquisition unit is used to acquire meteorological time series data of the target period of the distributed photovoltaic power station to be predicted; The data processing unit is used to preprocess the meteorological time series data of the target time period to generate a key feature matrix of the target time period; The deep model prediction unit is used to input the key feature matrix of the target time period into a pre-trained deep learning prediction model to obtain the predicted value of photovoltaic power generation of the distributed photovoltaic power station to be predicted in the target time period. The deep learning prediction model includes a recurrent neural network layer, an attention mechanism layer, and a fully connected layer connected in sequence. The recurrent neural network layer includes an iterative gating unit, which sequentially extracts features from the key feature matrix to obtain the input features for each time step, and performs multiple calculations on the current input features at each time step. The first calculation uses the hidden state from the previous time step as input, and subsequent calculations use the hidden state output from the previous calculation as input. A stopping decision mechanism determines the number of calculations for the current time step based on the convergence of the hidden states during the calculation process, and the hidden states from each calculation are weighted and fused to form the deep temporal feature for the current time step. The deep temporal features from all time steps are arranged in chronological order to form a deep temporal feature matrix, which is then output to the attention mechanism layer. The attention mechanism layer includes multiple attention heads, each of which maps the deep temporal feature matrix into a query matrix, a key matrix, and a value matrix. Attention scores are calculated based on the query matrix, key matrix, and relevance coefficients. The attention scores are then used to weight the value matrix to obtain the output of the attention head. The relevance coefficients are calculated from historical data of the distributed photovoltaic power station to be predicted. The outputs of each attention head are merged to obtain a weighted feature matrix, which is then output to the fully connected layer. The fully connected layer maps the weighted feature matrix into a predicted value of photovoltaic power generation and outputs it.

9. A readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the processor performs the steps of the method as described in any one of claims 1 to 7.

10. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 7.