Short-term photovoltaic generating capacity prediction method

By constructing a hybrid model of CNN-GRU-SE and IPSO-GRU components, and combining weather images and meteorological data, the problems of single data features and insufficient model generalization in photovoltaic power generation forecasting are solved, achieving more accurate short-term power generation forecasting and improving the stability and efficiency of the power grid system.

CN121507679APending Publication Date: 2026-02-10JINQIANMAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511325776.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing photovoltaic power generation prediction methods suffer from problems such as limited data characteristics and insufficient model generalization ability, resulting in the randomness and volatility of power generation having a significant impact on the stability of the power grid system.

Method used

A hybrid attention-based model is constructed, consisting of CNN-GRU-SE and IPSO-GRU components. By combining weather images and meteorological data, the CNN module extracts image features, the GRU network captures temporal dependencies, and the SE module implements a channel attention mechanism to improve prediction accuracy.

Benefits of technology

It improves the accuracy of photovoltaic power generation forecasting, reduces the impact of power generation randomness and volatility on the power grid system, and enhances the system's stability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121507679A_ABST
    Figure CN121507679A_ABST
Patent Text Reader

Abstract

The invention discloses a short-term photovoltaic generating capacity prediction method. The method comprises the following steps: constructing an attention-based hybrid model consisting of a CNN-GRU-SE component for processing weather image data and an IPSO-GRU component for processing meteorological data and based on IPSO optimization; training and testing the attention-based hybrid model by adopting a training data set; and acquiring meteorological data and weather image data of the photovoltaic power plant at the current moment, and predicting the short-term power generation power of the photovoltaic power plant in the next period of time through the trained attention-based hybrid model. According to the method, the spatial feature extraction capability of the convolutional neural network and the time sequence feature prediction capability of the GRU are fused, so that space and time modes can be effectively learned from input data, and the performance is improved compared with that of a single model.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202410600529.0 and the application date is May 15, 2024. The subject matter of the original application is "A method and apparatus for predicting short-term photovoltaic power generation". Technical Field

[0002] This application relates to the field of photovoltaic power generation technology, specifically to a method for predicting short-term photovoltaic power generation. Background Technology

[0003] Solar photovoltaic (PV) power generation refers to a power generation technology that directly converts solar energy into electrical energy using photovoltaic modules. Solar PV is a novel and promising comprehensive energy utilization method with advantages such as low environmental pollution, no air or water pollution, no noise pollution, adaptability to local conditions, and low installation costs. Accurately predicting the electricity generated during PV power generation can significantly reduce the impact of the randomness and volatility of power generation on the stability of the power grid system, facilitating its balanced operation and optimized dispatch, and reducing operating costs. However, PV power generation is affected by many factors, such as season, weather, global solar radiation, and wind speed, and is prone to significant fluctuations under different weather conditions. Its power generation is characterized by randomness, volatility, and intermittency, making PV power generation forecasting a complex task. Because short-term solar PV power generation forecasting is an important aspect of optimizing renewable energy systems and the operation and control of the electricity market, many cities have increased their demand for short-term solar PV power generation forecasting and its effective use in renewable energy applications.

[0004] Although many methods exist for predicting photovoltaic (PV) power generation, most are based on traditional recurrent neural networks and their variants, which suffer from limitations such as limited data features and insufficient model generalization ability. Therefore, how to more accurately predict short-term solar PV power generation and reduce the impact of the randomness and volatility of power generation on grid system stability has become a pressing technical problem in this field. Summary of the Invention

[0005] In view of the above problems, this application provides a method and apparatus for predicting short-term photovoltaic power generation, which improves the accuracy of the above-mentioned prediction of short-term solar photovoltaic power generation, so as to reduce the impact of the randomness and volatility of power generation on the stability of the power grid system.

[0006] To achieve the above objectives, a short-term photovoltaic power generation prediction method is provided, comprising the following steps:

[0007] A hybrid attention-based model is constructed, consisting of a CNN-GRU-SE component for processing weather image data and an IPSO-GRU component based on IPSO optimization for processing meteorological data; the weather image data is image data acquired by an all-sky imager, and the meteorological data includes any one or more of temperature, humidity, wind speed, and solar radiation;

[0008] The power generation data, meteorological data, and weather image data of the photovoltaic power plant are collected, and the meteorological data and weather image data are preprocessed and feature selected to obtain a training dataset.

[0009] The attention-based hybrid model is trained and tested using the training dataset.

[0010] The system acquires the current meteorological data and weather image data of the photovoltaic power plant, and uses the trained attention-based hybrid model to predict the short-term power generation of the photovoltaic power plant in the coming period.

[0011] The CNN-GRU-SE component includes a CNN module, a GRU network, and an SE module.

[0012] The CNN module for extracting image features includes a convolutional layer using ReLU as the activation function, a batch normalization layer, a MaxPooling layer for reducing the dimensionality of the data and highlighting the most important features, a Dropout layer, and a Flattern layer for converting multidimensional output into a one-dimensional format.

[0013] The GRU network is used to arrange the features extracted by the CNN module and use them as input to capture the internal dynamic change rules and temporal relationships of the data;

[0014] The SE module is used to clarify the interdependencies between different feature channels within the hybrid model in order to implement a channel-based attention mechanism.

[0015] To address the aforementioned technical problems, this application also provides another technical solution:

[0016] A short-term photovoltaic power generation prediction device, comprising:

[0017] The attention-based hybrid model consists of a CNN-GRU-SE component for processing weather image data and an IPSO-GRU component optimized based on IPSO for processing meteorological data. The weather image data is image data acquired by an all-sky imager, and the meteorological data includes any one or more of temperature, humidity, wind speed, and solar radiation.

[0018] The data acquisition module is used to collect power generation data, meteorological data, and weather image data from the photovoltaic power plant, and to preprocess and select features from the meteorological data and weather image data to obtain a training dataset.

[0019] A training module is used to train and test the attention-based hybrid model using the training dataset;

[0020] The prediction module is used to acquire the meteorological data and weather image data of the photovoltaic power plant at the current moment, and predict the short-term power generation of the photovoltaic power plant in the next period of time through the trained attention-based hybrid model.

[0021] The CNN-GRU-SE component includes a CNN module, a GRU network, and an SE module.

[0022] The CNN module for extracting image features includes a convolutional layer using ReLU as the activation function, a batch normalization layer, a MaxPooling layer for reducing the dimensionality of the data and highlighting the most important features, a Dropout layer, and a Flattern layer for converting multidimensional output into a one-dimensional format.

[0023] The GRU network, or GRU neural network model, is used to arrange the features extracted by the CNN module and use them as input to capture the internal dynamic change rules and temporal relationships of the data.

[0024] The SE module is used to clarify the interdependencies between different feature channels within the hybrid model in order to implement a channel-based attention mechanism.

[0025] Unlike existing technologies, CNN neural networks can effectively extract spatial features from datasets, while GRU neural networks have the ability to extract temporal features, enabling them to discover patterns in photovoltaic power generation data. The aforementioned short-term photovoltaic power generation prediction method integrates the spatial feature extraction capabilities of convolutional neural networks and the temporal feature prediction capabilities of GRU, allowing for the effective learning of spatial and temporal patterns from input data, thus improving performance compared to single models. This model can also benefit from using high-resolution images as input data, not only by adding convolutional layers to process the input images in greater detail but also by using denser datasets for model training. This model is widely applicable to the accurate prediction of power generation from photovoltaic power plants and power systems, helping system operators plan and manage load and power generation, reduce costs, and improve overall system efficiency.

[0026] The above description of the invention is merely an overview of the technical solution of this application. In order to enable those skilled in the art to better understand the technical solution of this application and to implement it based on the description and drawings, and to make the above-mentioned objectives and other objectives, features and advantages of this application easier to understand, the following description is provided in conjunction with the specific embodiments and drawings of this application. Attached Figure Description

[0027] The accompanying drawings are only used to illustrate the principles, implementation methods, applications, features, and effects of specific embodiments of the present invention and other related contents, and should not be considered as limitations on this application.

[0028] In the accompanying drawings of the instruction manual:

[0029] Figure 1 A flowchart illustrating the short-term photovoltaic power generation prediction method described in the specific implementation method;

[0030] Figure 2 This is a schematic diagram of weather image data collected by the all-sky imager in a specific implementation embodiment;

[0031] Figure 3 This is a block diagram of the short-term photovoltaic power generation prediction device described in a specific implementation.

[0032] Figure 4 A flowchart illustrating the short-term photovoltaic power generation prediction method described in the specific implementation method;

[0033] Figure 5 A flowchart illustrating the short-term photovoltaic power generation prediction method in another specific embodiment;

[0034] The reference numerals used in the above figures are explained as follows:

[0035] 300. Short-term photovoltaic power generation prediction device; 301. Hybrid model; 302. Data acquisition module; 303. Training module; 304. Prediction module; Detailed Implementation

[0036] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.

[0037] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.

[0038] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit this application.

[0039] In the description of this application, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " in this document generally indicates that the preceding and following objects have an "or" logical relationship.

[0040] In this application, terms such as “first” and “second” are used only to distinguish one entity or operation from another, and do not necessarily require or imply any actual quantity, hierarchy or order relationship between these entities or operations.

[0041] Without further limitations, the use of terms such as “comprising,” “including,” “having,” or other similar open-ended expressions in this application is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes the stated elements, such that a process, method, or product that includes a list of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such a process, method, or product.

[0042] Similar to the understanding in the Examination Guidelines, in this application, expressions such as "greater than," "less than," and "exceeding" are understood to exclude the stated number; expressions such as "above," "below," and "within" are understood to include the stated number. Furthermore, in the description of the embodiments in this application, "multiple" means two or more (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups" and "multiple times," unless otherwise explicitly specified.

[0043] In the description of the embodiments of this application, the space-related expressions used, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "vertical," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential," indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or drawings. They are only for the purpose of describing the specific embodiments of this application or for the reader's understanding, and do not indicate or imply that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.

[0044] Unless otherwise expressly specified or limited, the terms "installation," "connection," "linking," "fixing," and "setting," as used in the description of the embodiments of this application, should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two components or the interaction between two components. For those skilled in the art to which this application pertains, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0045] Please see Figures 1 to 5 This embodiment provides a method and apparatus for predicting short-term photovoltaic power generation. This method and apparatus can be applied to predicting the short-term power generation of solar photovoltaic power plants. For example, it can predict the power generation and output over the next 15 minutes or half an hour.

[0046] Please refer to Figure 1 A short-term photovoltaic power generation prediction method includes the following steps:

[0047] S101. Construct an attention-based hybrid model consisting of a CNN-GRU-SE component for processing weather image data and an IPSO-GRU component for processing meteorological data based on IPSO optimization.

[0048] S102. Collect the power generation data, meteorological data, and weather image data of the photovoltaic power plant, and preprocess and select features from the meteorological data and weather image data to obtain a training dataset;

[0049] S103. The attention-based hybrid model is trained and tested using the training dataset.

[0050] S104. Obtain the meteorological data and weather image data of the photovoltaic power plant at the current moment, and predict the short-term power generation of the photovoltaic power plant in the next period of time through the trained attention-based hybrid model.

[0051] In step S101, the weather image data is image data acquired by an all-sky imager, specifically hemispherical weather image data, and the meteorological data includes any one or more of temperature, humidity, wind speed, and solar radiation.

[0052] Furthermore, in step S101, the CNN-GRU-SE component includes a CNN module, a GRU network, and an SE module. The CNN module, used for extracting image features, includes a convolutional layer using ReLU as the activation function, a batch normalization layer, a MaxPooling layer for reducing data dimensionality and highlighting the most important features, a Dropout layer, and a Flattern layer for converting multidimensional output into a one-dimensional format. The GRU network is used to arrange the features extracted by the CNN module as input to capture the internal dynamic change rules and temporal relationships of the data. The SE module is used to clarify the interdependencies between different feature channels within the hybrid model to achieve a channel-based attention mechanism.

[0053] Building the CNN-GRU-SE component for processing weather image data includes the following steps:

[0054] A CNN module for extracting image features is constructed, and the CNN module includes the following:

[0055] A convolutional layer using 32 filters with a kernel size of (3*3) and ReLU as the activation function;

[0056] Batch normalization layers were added to enhance model stability and overall performance. By reducing internal covariate bias, the input distribution of network layers becomes more stable, thus accelerating training convergence. Sensitivity to initialization was reduced. Standardizing input data reduced the dependence on parameter initialization quality, improving the robustness of model training.

[0057] A 2x2 MaxPooling layer is used to reduce the dimensionality of the data and highlight the most important features. Pooling layers effectively reduce the size of the parameter matrix, thus reducing the number of parameters in the final connected layers. Simultaneously, pooling layers expand the receptive field of the convolutional layers, extracting more global network features.

[0058] A Dropout layer designed to prevent the model from overfitting;

[0059] A Flattern layer that converts multidimensional output into a one-dimensional format;

[0060] The GRU network construction also includes the following:

[0061] The GRU network is a good variant of LSTM. The calculation formula for the GRU network is as follows:

[0062] z t =σ(W z ·[h t-1 x t ]);

[0063] r t =σ(W r ·[h t-1 x t ]);

[0064]

[0065] Where, x t h represents the current state. t-1 Let z represent the previous hidden state, σ be the sigmoid activation function, and z be the z-axis. t It's an update gate, used to filter information, W z The retention process used to control the input of new and old information at time t, r t It's a reset door, used to filter information, W r Used to control the degree to which input information is retained at each position at time t-1. It is the state candidate set at the current moment.

[0066] In the proposed model, a two-layer GRU network structure arranges the features extracted by the CNN module and uses them as input, fully capturing the internal dynamic changes and temporal relationships of the data. The GRU network can capture the temporal dependencies and dynamic changes in a data sequence; that is, the data at a later time point depends on the data at previous time points. Assuming there are a total of i time steps, the GRU network at time step t... t The hidden state output is shown below:

[0067] h t =GRU(P t , h′ t-1 );

[0068] Where GRU() represents the entire forward computation process of the GRU architecture, P t It is the input of the second GRU layer at time step t, h' t-1 It is the output of the hidden state of the second GRU layer at the previous time step.

[0069] Furthermore, the attention-based SE module includes the following steps:

[0070] The SE module consists of three parts: squeeze operation, excitation operation, and scaling operation. Its purpose is to realize a channel-based attention mechanism by explicitly modeling the interdependencies between different feature channels.

[0071] The first step is the squeezing operation, which involves global pooling of the input features. Each feature channel is squeezed into a real number, called a channel descriptor, representing the statistical information of the corresponding channel. This is typically implemented using global average pooling, and the unweighted feature map U is summed and averaged to obtain a multi-dimensional vector Z, whose nth element z... n The calculation is as follows:

[0072]

[0073] Among them, z n H represents the nth element, and H and W represent the width and height of the feature map, respectively. n It is the feature vector of the nth channel in the input features. n (i, k) is u n The elements in the i-th row and k-th column.

[0074] The activation operation uses two fully connected (FC) layers to fully learn the descriptor of each channel and explore the relationships between different feature channels. Under the activation operation, each feature channel is dynamically weighted through a corresponding activation function. The characteristics of this process are as follows:

[0075]

[0076] Where σ and δ represent the sigmoid and ReLU activation functions, respectively, W1 and W2 are the weight parameters of the two FC layers, and s is a vector representing the weight of each channel in the feature map U.

[0077] Finally, the final output of the SE module is obtained through scaling operations, where the weight vector s and the unweighted input feature map U are multiplied according to their respective channels. The output of the nth channel is calculated as follows:

[0078]

[0079] in This is the final total output, s n It is the weight of the nth feature channel.

[0080] In the proposed model, a channel attention module based on the Squeeze-and-Excitation (SE) module is integrated with a CNN-GRU hybrid network to enhance the influence of important features and avoid feature redundancy. The SE module introduces a channel attention mechanism, allowing the neural network to focus more on features important to the current task. The SE module uses a weight matrix to assign different weights to different positions of the data from the perspective of the channel domain, thereby obtaining more important feature information.

[0081] Under squeezing and excitation operations, the weights of the GRU network's hidden state output at different time steps can be adaptively learned. For the output h of the GRU network at time step t... t The final result is obtained after weighting by the channel attention module.

[0082] Finally, the weighted hidden state outputs of the GRU network under different conditions are concatenated into a vector using the Flattern operation, represented as follows: The output layer takes a vector as input and uses the sigmoid activation function to calculate the power generation prediction result through a fully connected (FC) layer. The Flattern operation, also known as tensor flattening, outputs a flattened array, allowing the time steps to be concatenated into a vector. The output y of the attention-based CNN-GRU is shown below:

[0083]

[0084] In this embodiment, historical power generation data and meteorological data are collected and preprocessed according to the following steps:

[0085] Reducing the resolution of the acquired hemispherical high-resolution weather image data to 64*64 pixels reduces the memory requirements for image storage and allows for faster model training with less memory. Furthermore, converting the images to grayscale further reduces the memory required for image storage and simplifies the analysis of visual features used by the model for prediction. Although reducing the image resolution and converting to grayscale might seem to result in significant information loss, this did not significantly affect the model's prediction accuracy for future photovoltaic power generation. Even in these lower-resolution images, key details such as cloud cover extent, cloud location, and the direction and speed of cloud movement are preserved. This lower resolution allows the model to effectively predict energy generation by preserving key image features. Moreover, the lower-resolution images help minimize noise and irrelevant cloud details that could interfere with the model, allowing it to focus on the most relevant information. Therefore, by reducing the amount of data processed during training, training efficiency is improved, resulting in shorter training time and increased overall efficiency.

[0086] The collected meteorological data undergoes preprocessing to make it suitable for learning. This stage includes data normalization, most commonly data standardization, and splitting the data into training, validation, and test sets. Data normalization improves the model's learning efficiency in feature detection, while data splitting helps evaluate model performance and generalization ability across different datasets. Furthermore, the data in the database must be converted into time-series data sequences suitable for GRU network analysis. GRU networks can process data containing time-series information, remember previous input information during training, and handle data with dependencies. Therefore, in this embodiment, continuous time-series data should be collected, rather than discontinuous (single-point) data.

[0087] Collected poor data, such as data from equipment malfunctions, undergoes manual preprocessing to reduce the impact of data quality on prediction accuracy. Poor data mainly includes empty data points, zero data points, outlier step sizes, and continuous constant values. Different preprocessing methods are typically used for different types of poor data. During data preprocessing, isolated outliers are treated as individual bad data points.

[0088] The data was analyzed and filtered for features. Since a large amount of meteorological data was collected, some of it may not contribute much to the predicted variables and may only become noise affecting the prediction results. Therefore, the Pearson correlation coefficient was used to analyze the feature data with the strongest correlation to power generation and to exclude some feature values ​​with weak correlation that have almost no contribution to the prediction results.

[0089] A hybrid model was constructed, consisting of a CNN-GRU-SE component for processing weather imagery data and an IPSO-GRU component based on IPSO optimization for processing meteorological data, to predict the power output of a photovoltaic (PV) power plant. The model processes a series of hemispherical sky images and corresponding meteorological data on PV power generation over the previous 45 minutes, with the goal of predicting power generation 15 minutes after the last time point.

[0090] In one embodiment, the IPSO-GRU-based component includes the following:

[0091] An improved particle swarm optimization (IPSO) algorithm is used to optimize the parameters of the GRU network, including:

[0092] Initialize the particle population and determine parameters such as particle position, particle size, and particle boundary.

[0093] When particle position is used as network parameter, the loss function obtained by the neural network is used as particle fitness, and the mean square error between the true value and the predicted value is used as the training loss function.

[0094] Based on the current best fitness value or the historical best fitness value of the individual in the current iteration, save the position of the particle with the best fitness value.

[0095] The process involves multiple iterations, using the particle position with the best historical fitness as the initial weights for the GRU network.

[0096] The attention-based CNN-GRU model further includes the following steps:

[0097] The feature vectors output by the CNN-GRU-SE component and the feature vectors output by the IPSO-GRU component are combined side-by-side and then input into a fully connected layer for final prediction, resulting in the predicted data for photovoltaic power generation. The fully connected layer is a neural network layer (with multiple neural nodes) that connects the features after final feature merging, thus combining the features to obtain the final predicted value.

[0098] like Figure 3 As shown, in one embodiment, a short-term photovoltaic power generation prediction device 300 is provided, which includes an attention-based hybrid model 301, a data acquisition module 302, a training module 303, and a prediction module 304.

[0099] The attention-based hybrid model 301 consists of a CNN-GRU-SE component for processing weather image data and an IPSO-GRU component for processing meteorological data optimized by IPSO. The weather image data is image data acquired by an all-sky imager, and the meteorological data includes any one or more of temperature, humidity, wind speed, and solar radiation.

[0100] The data acquisition module 302 is used to collect power generation data, meteorological data, and weather image data from the photovoltaic power plant, and to preprocess and select features from the meteorological data and weather image data to obtain a training dataset. The training module 303 is used to train and test the attention-based hybrid model using the training dataset. The prediction module 304 is used to acquire the current meteorological data and weather image data of the photovoltaic power plant, and to predict the short-term power generation of the photovoltaic power plant in the coming period using the trained attention-based hybrid model.

[0101] The CNN-GRU-SE component comprises a CNN module, a GRU network, and an SE module. The CNN module, used for extracting image features, includes a convolutional layer using ReLU as the activation function, a batch normalization layer, a MaxPooling layer to reduce data dimensionality and highlight the most important features, a Dropout layer, and a Flattern layer to convert the multidimensional output into a one-dimensional format. The GRU network arranges the features extracted by the CNN module as input to capture the internal dynamic rules and temporal relationships of the data. The SE module defines the interdependencies between different feature channels within the hybrid model to implement a channel-based attention mechanism.

[0102] The SE module includes a squeezing operation, an excitation operation, and a scaling operation. The squeezing operation performs global pooling on the input features, squeezing each feature channel into a channel descriptor, which represents the statistical information of the corresponding feature channel. The excitation operation uses two fully connected (FC) layers to learn the channel descriptor for each feature channel and explores the relationships between different feature channels. Under the excitation operation, each feature channel is dynamically weighted through a corresponding activation function. The scaling operation obtains the final output of the SE module, in which the weight vector s and the unweighted input feature map U are multiplied according to their corresponding channels.

[0103] The output of the nth channel is calculated as follows:

[0104]

[0105] in This is the final total output, s n It is the weight of the nth feature channel;

[0106] Under the squeezing and excitation operations, the weights of the hidden state output of the GRU network at different time steps are adaptively learned. For the output h of the GRU network at time step t... t The final result is obtained after weighting by the channel attention module.

[0107] The weighted hidden state outputs of the GRU network under different conditions are concatenated into a vector using the Flattern operation, representing the result as follows: The output layer takes a vector as input and uses the sigmoid activation function to calculate the power generation prediction result through the fully connected (FC) layer; the output y of CNN-GRU-SE is shown below:

[0108]

[0109] Where σ represents the sigmoid activation function, and W is the weight parameter of the FC layer. is the vector obtained by the Flattern operation, and b is the bias parameter.

[0110] The IPSO-GRU component is used to optimize the GRU network parameters using an improved particle swarm optimization algorithm, including the following steps:

[0111] Initialize the particle population, determine particle positions, particle sizes, and particle boundaries;

[0112] When the particle position is used as a network parameter, the loss function obtained by the neural network is used as the particle fitness, and the mean square error between the true value and the predicted value (MSE) is used as the training loss function.

[0113] Based on the current best fitness value or the historical best fitness value of the individual in the current iteration, save the position of the particle with the best fitness value.

[0114] The process involves multiple iterations, using the particle position with the best historical fitness as the initial weights for the GRU network.

[0115] The prediction module is also used to combine the feature vectors output by the CNN-GRU-SE component and the feature vectors output by the IPSO-GRU component in parallel, and then input them into the fully connected layer for final prediction to obtain the short-term power generation of the photovoltaic power plant in the next period of time.

[0116] The short-term photovoltaic power generation prediction method described above is applicable to occasions requiring photovoltaic power generation prediction. The following detailed embodiments illustrate this method:

[0117] Please refer to Figure 4 In one embodiment of this application, a short-term photovoltaic power generation prediction method includes the following steps:

[0118] S1. Collect power generation data and meteorological data from photovoltaic power stations, as well as hemispherical weather image data, and perform preprocessing and feature selection;

[0119] S2. Optimize the training and testing of the dataset using the constructed attention-based CNN-GRU model;

[0120] S3. Obtain relevant data from the current power plant and predict power generation.

[0121] Please refer to Figure 5 In another embodiment, a CNN-GRU photovoltaic power generation prediction method based on an attention mechanism includes the following steps:

[0122] A hybrid model was constructed, consisting of a CNN-GRU-SE component for processing weather imagery data and an IPSO-GRU component based on IPSO optimization for processing meteorological data, to predict the power output of a photovoltaic (PV) power plant. The model processes a series of hemispherical sky images and corresponding meteorological data on PV power generation over the previous 45 minutes, with the goal of predicting power generation 15 minutes after the last time point.

[0123] The construction of the CNN-GRU-SE component for processing weather image data further includes the following steps:

[0124] A CNN module for extracting image features is constructed, and the CNN module includes the following:

[0125] A convolutional layer using 32 filters with a kernel size of (3*3) and ReLU as the activation function;

[0126] A batch normalization layer was added to enhance the model's stability and overall performance;

[0127] A MaxPooling layer of size (2*2) is designed to reduce the dimensionality of the data and highlight the most important features;

[0128] A Dropout layer designed to prevent the model from overfitting;

[0129] A Flattern layer that converts multidimensional output into a one-dimensional format;

[0130] The GRU network construction also includes the following:

[0131] The GRU network is a good variant of LSTM. The calculation formula for the GRU network is as follows:

[0132] z t =σ(W z ·[h t-1 x t ]);

[0133] r t =σ(W r ·[h t-1 x t ]);

[0134]

[0135] Where, x t h represents the current state. t-1 Let z represent the previous hidden state, σ be the sigmoid activation function, and z be the z-axis. t It's an update gate, used to filter information, W zUsed to control the degree to which new and old information is retained at time t; r t It's a reset door, used to filter information, W r Used to control the degree to which input information is retained at each position at time t-1. It is the state candidate set at the current moment.

[0136] In the proposed model, a multi-layered GRU network arranges the features extracted by the CNN module and uses them as input, fully capturing the internal dynamic rules and temporal relationships of the data. Assuming there are a total of i time steps, the GRU network at time step t... t The hidden state output is shown below.

[0137] h t =GRU(P t ,h' t-1 );

[0138] Where GRU() represents the entire forward computation process of the GRU architecture, P t It is the input of the second GRU layer at time step t, h' t-1 It is the output of the hidden state of the second GRU layer at the previous time step.

[0139] Furthermore, the attention-based SE module includes the following steps:

[0140] The SE module consists of three parts: squeeze operation, excitation operation, and scaling operation. Its purpose is to realize a channel-based attention mechanism by explicitly modeling the interdependencies between different feature channels.

[0141] The first step is the squeezing operation, which involves global pooling of the input features. Each feature channel is squeezed into a real number, called a channel descriptor, representing the statistical information of the corresponding channel. This is typically implemented using global average pooling, and the unweighted feature map U is summed and averaged to obtain a multi-dimensional vector Z, whose nth element z... n The calculation is as follows:

[0142]

[0143] Among them, z n H represents the nth element, and H and W represent the width and height of the feature map, respectively. n It is the feature vector of the nth channel in the input features. n (i, k) is u n The elements in the i-th row and k-th column.

[0144] The activation operation uses two fully connected (FC) layers to fully learn the descriptor of each channel and explore the relationships between different feature channels. Under the activation operation, each feature channel is dynamically weighted through a corresponding activation function. The characteristics of this process are as follows:

[0145]

[0146] Where σ and δ represent the sigmoid and ReLU activation functions, respectively, W1 and W2 are the weight parameters of the two FC layers, and s is a vector representing the weight of each channel in the feature map U.

[0147] Finally, the final output of the SE module is obtained through scaling operations, where the weight vector s and the unweighted input feature map U are multiplied according to their respective channels. The output of the nth channel is calculated as follows:

[0148]

[0149] in, This is the final total output, s n It is the weight of the nth feature channel.

[0150] In the proposed model, a channel attention module based on the SE module is integrated with a CNN-GRU hybrid network to enhance the influence of important features and avoid feature redundancy. Under the squeezing and excitation operations, the weights of the GRU hidden state output at different time steps can be adaptively learned. For the output h of the GRU network at time step t... t The final result is obtained after weighting by the channel attention module.

[0151] Finally, the weighted hidden state outputs of GRU under different conditions are concatenated into a vector using the Flattern operation, represented as follows: The output layer takes a vector as input and uses the sigmoid activation function to calculate the power generation prediction result through an FC layer. The output y of CNN-GRU-SE is shown below:

[0152]

[0153] In this embodiment, historical power generation data and meteorological data are first collected, including hemispherical weather image data and meteorological data such as solar irradiance, temperature, relative humidity, and air pressure. A CNN-GRU based on an attention mechanism is used to process the weather images to obtain feature vectors based on the hemispherical weather images. Simultaneously, a GRU network is used to process meteorological data such as solar irradiance. Then, the data features are fused together for final power generation prediction. This invention, based on the combination of CNN and GRU, not only effectively learns spatial and temporal patterns from the input data, significantly improving performance, but also incorporates weather image data to mitigate the impact of data anomalies caused by facility failures, avoiding the poor robustness of models that rely solely on meteorological observation data in traditional methods.

[0154] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.

Claims

1. A method for predicting short-term photovoltaic power generation, characterized in that, Includes the following steps: A hybrid attention-based model is constructed, consisting of a CNN-GRU-SE component for processing weather image data and an IPSO-GRU component based on IPSO optimization for processing meteorological data. Data on power generation from photovoltaic power plants, meteorological data, and weather image data are collected. The meteorological data and weather image data are preprocessed and feature-selected to obtain a training dataset. The attention-based hybrid model is trained and tested using the training dataset. The system acquires the current meteorological data and weather image data of the photovoltaic power plant, and uses the trained attention-based hybrid model to predict the short-term power generation of the photovoltaic power plant in the coming period. The CNN-GRU-SE component includes a CNN module, a GRU network, and an SE module. The CNN module for extracting image features includes a convolutional layer using ReLU as the activation function, a batch normalization layer, a MaxPooling layer for reducing the dimensionality of the data and highlighting the most important features, a Dropout layer, and a Flattern layer for converting multidimensional output into a one-dimensional format. The GRU network is used to arrange the features extracted by the CNN module and use them as input to capture the internal dynamic change rules and temporal relationships of the data; The SE module is used to clarify the interdependencies between different feature channels within the hybrid model in order to achieve a channel-based attention mechanism; The IPSO-GRU component is used to optimize the GRU network parameters using an improved particle swarm optimization algorithm, including the following steps: Initialize the particle population, determine particle positions, particle sizes, and particle boundaries; When the particle position is used as a network parameter, the loss function obtained by the neural network is used as the particle fitness, and the mean square error between the true value and the predicted value (MSE) is used as the training loss function. Based on the current best fitness value or the historical best fitness value of the individual in the current iteration, save the position of the particle with the best fitness value. Multiple iterations are performed, and the particle position with the best historical fitness is used as the initial weight of the GRU network; The prediction of short-term power generation of a photovoltaic power plant over a given period using the trained attention-based hybrid model includes: The feature vectors output by the CNN-GRU-SE component and the feature vectors output by the IPSO-GRU component are combined side by side and then input into the fully connected layer for final prediction to obtain the short-term power generation of the photovoltaic power plant in the next period of time. The fully connected layer is a neural network layer with multiple neural nodes, used to combine features to obtain the final predicted value.

2. The short-term photovoltaic power generation prediction method according to claim 1, characterized in that, The SE module includes squeeze operation, excitation operation, and scaling operation; The squeezing operation is used to perform global pooling on the input features, so that each feature channel is squeezed into a channel descriptor, which is used to represent the statistical information of the corresponding feature channel; The activation operation uses two fully connected (FC) layers to learn the channel descriptor for each feature channel and explore the relationships between different feature channels. Under the activation operation, each feature channel is dynamically weighted through a corresponding activation function. The scaling operation is used to obtain the final output of the SE module, in which the weight vector s and the unweighted input feature map U are multiplied according to their corresponding channels. The output of the nth channel is calculated as follows: in This is the final total output, s n It is the weight of the nth feature channel, u n It is the feature vector of the nth channel in the input features; Under the squeezing and excitation operations, the weights of the hidden state output of the GRU network at different time steps are adaptively learned. For the output h of the GRU network at time step t... t The final result is obtained after weighting by the channel attention module. The weighted hidden state output of the GRU network under different conditions is time-stepped through the Flattern operation. The lengths are concatenated into a vector, represented as: The output layer takes a vector as input and uses the sigmoid activation function to calculate the power generation prediction result through the fully connected (FC) layer; the output y of CNN-GRU-SE is shown below: Where σ represents the sigmoid activation function, and W is the weight parameter of the FC layer. is the vector obtained by the Flattern operation, and b is the bias parameter.

3. The short-term photovoltaic power generation prediction method according to claim 1, characterized in that, The GRU network is a good variant of LSTM, and the calculation formula for the GRU network is as follows: z t =σ(W z ·[h t-1 ,x t ]); r t =σ(W r ·[h t-1 ,x t ]); Where, x t h represents the current state. t-1 Let z represent the previous hidden state, σ be the sigmoid activation function, and z be the z-axis. t It's an update gate, used to filter information, using W. z To control the degree to which new and old information is retained at time t; r t It's a reset door, used to filter information, using W. r To control the degree to which input information is retained at each location at time t-1. It is the state candidate set at the current moment.

4. The short-term photovoltaic power generation prediction method according to claim 1, characterized in that, The preprocessing and feature selection of the meteorological data and the weather image data includes the following steps: The resolution of the collected high-definition weather image data was reduced to 64x64 pixels and converted into grayscale images; The collected meteorological data was normalized and then divided into training, validation, and test sets. Manually remove unwanted data from the meteorological data and the weather image data; the unwanted data includes empty data points, zero data points, abnormal step size values, and continuous constant values. The processed meteorological data and weather image data are subjected to feature analysis and screening, and the feature data with the strongest correlation to power generation is identified using the Pearson correlation coefficient.