Distributed photovoltaic power prediction method and system, electronic equipment and storage medium

Through the combination of wavelet packet decomposition and CNN/GRU, combined with genetic algorithms to optimize the fusion ratio parameters, the problem of low prediction accuracy of distributed photovoltaic power generation is solved, and more accurate photovoltaic power prediction is achieved, which improves the reliability of the power grid scheduling system and the stability and economy of the photovoltaic power generation system.

CN120471466APending Publication Date: 2025-08-12BEIJING TENGINEER AIOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510371348.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The existing photovoltaic power prediction methods are poor in dealing with the high nonlinearity and complexity of distributed photovoltaic power generation, especially under high volatility and complex environmental factors, which affects the stability and economics of the power grid.

Method used

Wavelet packet decomposition technology is used to map photovoltaic power generation data into time-frequency images, and prediction is combined with convolutional neural network (CNN) and gated cyclic unit network (GRU). Through weighted fusion calculation, genetic algorithms are used to optimize the fusion proportional parameters to capture complex spatio-temporal patterns in photovoltaic power data.

Benefits of technology

It significantly improves the accuracy and robustness of photovoltaic power prediction, especially in high volatility and complex environments, improves the grid load allocation efficiency, reduces energy waste, and ensures the stability and economics of photovoltaic power generation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471466A_ABST
    Figure CN120471466A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed photovoltaic power prediction method and system, an electronic device and a storage medium, and the method combines the time-frequency feature extraction capability of wavelet packet decomposition, the spatial feature extraction advantage of a convolutional neural network and the time sequence modeling capability of a gated loop unit network. The time-frequency fine decomposition of the wavelet packet decomposition provides high-discrimination spatial features for the CNN, the time sequence modeling of the GRU makes up for the neglect of the CNN on the long-term trend, the weighted fusion of the CNN and the GRU realizes the complementation of the CNN and the GRU, the complex space-time mode in the photovoltaic power data can be captured more accurately, and the accuracy of the photovoltaic power data is improved. Therefore, the accuracy and robustness of photovoltaic power prediction are greatly improved, particularly, the performance is more excellent when high volatility and complex environmental factors are dealt with, and more reliable photovoltaic power prediction support is provided for a power grid dispatching system, so that the power grid load allocation efficiency is improved, the energy waste is reduced, and the economic benefit is increased. And the stability and economy of the photovoltaic power generation system are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of distributed photovoltaic power generation, and in particular to a distributed photovoltaic power prediction method and system, electronic equipment, and a computer-readable storage medium. Background Art

[0002] In recent years, photovoltaic power generation (PV) as a sustainable energy source has garnered widespread attention from scholars both domestically and internationally. With continuous technological advancements and policy support, PV power has gradually become a vital component of the global energy mix. However, the intermittent and random nature of PV power generation results in significant fluctuations in its output power, posing significant challenges to grid stability and power dispatch. Accurate PV power forecasting can provide essential support for grid operation, helping power dispatch systems achieve more efficient load dispatch, reducing energy waste, and improving the quality of grid power pre-verification. Therefore, accurate PV power forecasting is crucial for the stability, economy, and safety of PV power generation. Currently, commonly used PV power forecasting methods include those based on physical models and statistical methods. While physico-model-based methods can reflect the fundamental laws of PV power generation, their accuracy is often low due to the complexity of multiple factors, such as light intensity and temperature. Traditional statistical forecasting methods, such as time series analysis and regression analysis, also suffer from poor prediction accuracy when dealing with highly nonlinear and complex distributed PV power data. Summary of the Invention

[0003] The present invention provides a distributed photovoltaic power prediction method and system, electronic equipment, and computer-readable storage medium, which can more accurately capture the complex spatiotemporal patterns in photovoltaic power data, thereby significantly improving the accuracy and robustness of photovoltaic power prediction, especially when dealing with high volatility and complex environmental factors. It provides more reliable photovoltaic power prediction support for the power grid dispatching system, thereby improving the efficiency of power grid load allocation, reducing energy waste, and ensuring the stability and economy of the photovoltaic power generation system.

[0004] According to one aspect of the present invention, a distributed photovoltaic power prediction method is provided, comprising the following contents:

[0005] Collect historical power data of distributed photovoltaic power generation and preprocess it;

[0006] The pre-processed historical power data is mapped into time-frequency images using wavelet packet decomposition;

[0007] Input the time-frequency image into the trained CNN network to obtain the first prediction result;

[0008] The pre-processed historical power data is input into the trained GRU network to obtain the second prediction result;

[0009] A weighted fusion calculation is performed based on the first prediction result and the second prediction result to obtain a power prediction result of distributed photovoltaics.

[0010] Furthermore, it also includes the following:

[0011] Solar irradiance data and temperature data are collected, and the fusion ratio parameters of the first prediction result and the second prediction result are calculated based on the solar irradiance data and temperature data. The fusion ratio parameters are optimized and solved using a genetic algorithm, and a weighted fusion calculation of the two prediction results is performed based on the optimal solution of the fusion ratio parameters.

[0012] Furthermore, the fusion ratio parameter is calculated based on the following formula:

[0013]

[0014] Among them, K represents the fusion ratio of the first prediction result, α and β represent the adjustment coefficients, σ 2 represents the irradiance variance, a T It represents the temperature change rate within the time interval, δ1 represents the irradiance variance threshold, and δ2 represents the temperature change rate threshold.

[0015] Furthermore, two thresholds are set based on historical data statistics. The specific setting process is: the irradiance variance and temperature change rate are combined into a two-dimensional feature vector, and the historical data are divided into two categories: sunny and cloudy days using a clustering algorithm. The average value of the cluster centers of the two categories is used as the threshold.

[0016] Furthermore, the latest solar irradiance data and temperature data are updated every preset time window, and the fusion ratio parameters are re-optimized using the latest data.

[0017] Furthermore, in the process of preprocessing the historical power data, the following formula is used to fill and replace abnormal values:

[0018]

[0019] Among them, z i represents the i-th outlier, Z i represents the filling value of the i-th outlier, z i-k represents the kth data before the i-th outlier, z i+k Represents the kth data after the i-th outlier.

[0020] Furthermore, the wavelet basis function used in the wavelet packet decomposition is the db9 wavelet.

[0021] In addition, the present invention also provides a distributed photovoltaic power prediction system, comprising:

[0022] Data preprocessing module, used to collect historical power data of distributed photovoltaic power generation and preprocess it;

[0023] A wavelet packet decomposition module is used to map the pre-processed historical power data into a time-frequency image using wavelet packet decomposition;

[0024] A first prediction module is used to input the time-frequency image into the trained CNN network to obtain a first prediction result;

[0025] The second prediction module is used to input the pre-processed historical power data into the trained GRU network to obtain a second prediction result;

[0026] The weighted fusion module is used to perform weighted fusion calculation based on the first prediction result and the second prediction result to obtain a power prediction result of distributed photovoltaic.

[0027] In addition, the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the steps of the above method by calling the computer program stored in the memory.

[0028] In addition, the present invention also provides a computer-readable storage medium for storing a computer program for power prediction of distributed photovoltaics, wherein the computer program executes the steps of the above-mentioned method when running on a computer.

[0029] The present invention has the following beneficial effects:

[0030] The distributed photovoltaic power prediction method of the present invention combines the time-frequency feature extraction capability of wavelet packet decomposition, the spatial feature extraction advantage of convolutional neural network and the time series modeling capability of gated recurrent unit network. The time-frequency fine decomposition of wavelet packet decomposition provides CNN with highly discriminative spatial features, while the time series modeling of GRU makes up for CNN's neglect of long-term trends. The weighted fusion of CNN and GRU achieves the complementarity between the two, which can more accurately capture the complex spatiotemporal patterns in photovoltaic power data, thereby greatly improving the accuracy and robustness of photovoltaic power prediction, especially when dealing with high volatility and complex environmental factors. It performs better and provides more reliable photovoltaic power prediction support for the power grid dispatching system, thereby improving the power grid load allocation efficiency, reducing energy waste, and ensuring the stability and economy of the photovoltaic power generation system.

[0031] In addition, the distributed photovoltaic power prediction system of the present invention also has the above advantages.

[0032] In addition to the above-described objects, features and advantages, the present invention has other objects, features and advantages. The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are intended to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:

[0034] Figure 1 This is a flow chart of a distributed photovoltaic power prediction method according to a preferred embodiment of the present application;

[0035] Figure 2 Schematic diagram of the structure of the three-layer wavelet packet decomposition tree in the preferred embodiment of the present application;

[0036] Figure 3 It is a structural diagram of the CNN network in the preferred embodiment of the present application;

[0037] Figure 4 It is a structural diagram of the GRU network in the preferred embodiment of the present application;

[0038] Figure 5 This is another flow chart of the distributed photovoltaic power prediction method according to the preferred embodiment of the present application;

[0039] Figure 6 This is a schematic diagram of the module structure of a distributed photovoltaic power prediction system according to another embodiment of the present application. DETAILED DESCRIPTION

[0040] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0041] Reference Figure 1 The preferred embodiment of the present application provides a distributed photovoltaic power prediction method, comprising the following contents:

[0042] Step S1: collecting historical power data of distributed photovoltaic power generation and preprocessing it;

[0043] Step S2: Mapping the pre-processed historical power data into a time-frequency image using wavelet packet decomposition;

[0044] Step S3: Input the time-frequency image into the trained CNN network to obtain the first prediction result;

[0045] Step S4: input the pre-processed historical power data into the trained GRU network to obtain a second prediction result;

[0046] Step S5: Perform weighted fusion calculation based on the first prediction result and the second prediction result to obtain a power prediction result of distributed photovoltaics.

[0047] It can be understood that the distributed photovoltaic power prediction process of this embodiment is as follows: first, historical power data for a period of time before the prediction target time is collected and preprocessed, and then the preprocessed historical power data is mapped into a two-dimensional time-frequency image using wavelet packet decomposition technology. Wavelet packet decomposition can decompose the photovoltaic power time series signal into multiple sub-signals in different frequency bands, which is conducive to accurately capturing the instantaneous high-frequency components and low-frequency trends in the photovoltaic power signal. The instantaneous high-frequency components reflect the power fluctuations caused by environmental changes (such as the rapid movement of clouds) during the photovoltaic power generation process. Then, the convolution operation of the CNN is used to extract spatial features from the high-dimensional time-frequency image to obtain the first prediction result. The CNN can accurately identify the complex nonlinear mapping relationship between irradiance changes and power output, effectively improving the accuracy of photovoltaic power prediction. At the same time, the preprocessed historical power data is input into the GRU network to obtain the second prediction result. The GRU network, through its unique gating mechanism, can effectively capture the dependencies in long time series while avoiding the gradient vanishing problem of traditional RNN in long sequence processing. It can accurately identify the time dependencies and change trends in the data, thereby significantly improving the accuracy and stability of photovoltaic power prediction, especially under complex photovoltaic power generation modes. Finally, a weighted fusion calculation is performed based on the first prediction result and the second prediction result, and the prediction results based on spatial features and the prediction results based on time series features are integrated, which greatly improves the accuracy of the distributed photovoltaic power prediction results.

[0048] It can be understood that the distributed photovoltaic power prediction method of this embodiment combines the time-frequency feature extraction capability of wavelet packet decomposition, the spatial feature extraction advantage of convolutional neural network and the time series modeling capability of gated recurrent unit network. The time-frequency fine decomposition of wavelet packet decomposition provides CNN with highly discriminative spatial features, while the time series modeling of GRU makes up for CNN's neglect of long-term trends. The weighted fusion of CNN and GRU achieves the complementarity between the two, which can more accurately capture the complex spatiotemporal patterns in photovoltaic power data, thereby greatly improving the accuracy and robustness of photovoltaic power prediction, especially when dealing with high volatility and complex environmental factors. It performs better, providing more reliable photovoltaic power prediction support for the power grid dispatching system, thereby improving the power grid load allocation efficiency, reducing energy waste, and ensuring the stability and economy of the photovoltaic power generation system.

[0049] Among them, in the step S1, after collecting historical power data for a period of time before the prediction target time, the data is the basis of the algorithm model, and the data quality is crucial to the accuracy of the prediction results. In the process of collecting and transmitting photovoltaic power generation data, errors may occur, resulting in incomplete, inconsistent or abnormal data in the original data set. The accuracy of photovoltaic power prediction depends largely on the quality of historical data. Low-quality data may lead to insufficient training results and reduced prediction accuracy. Therefore, the present invention needs to preprocess the historical power data after collecting it, wherein the preprocessing method includes outlier filling, data standardization or data normalization.

[0050] Optionally, the photovoltaic power data at each time point has its own role. Therefore, it is not suitable to directly delete the outliers in the photovoltaic power data. The present invention takes into account that the photovoltaic power data has strong continuity, that is, the data changes at several adjacent moments will not be large. Therefore, the present invention adopts the k-nearest neighbor method to fill and replace the outliers in the photovoltaic power data. The expression is:

[0051]

[0052] Among them, z i represents the i-th outlier, Z i represents the filling value of the i-th outlier, z i-k represents the kth data before the i-th outlier, z i+k Represents the kth data after the i-th outlier.

[0053] In addition, the calculation formulas for standardization and normalization belong to the existing technology and will not be described in detail here.

[0054] In addition, in step S2, wavelet packet decomposition (WPD) technology can decompose the time-frequency signal of photovoltaic power into sub-bands of different frequencies, each sub-band corresponding to the characteristics of the signal on a specific time scale, thereby mapping the historical power data into a two-dimensional time-frequency image. In the time-frequency image of photovoltaic power, high-frequency sub-bands usually correspond to rapidly changing signal components. These components reflect the power fluctuations caused by environmental changes (such as the rapid movement of clouds) during the photovoltaic power generation process. The movement of clouds changes the irradiance, which in turn affects the output power of the photovoltaic module. This change often manifests as high-frequency instantaneous fluctuations. Therefore, through wavelet packet decomposition, these short-term power fluctuations caused by clouds or other rapidly changing factors can be clearly identified.

[0055] Specifically, wavelet packet decomposition decomposes the collected original signal into approximate signal and detail signal through high-pass filter and low-pass filter, which can be obtained through scaling function and wavelet function. Scaling function and wavelet function satisfy the dual-scaling equation under multi-resolution analysis. Among them, the wavelet packet function is defined as: is the orthogonal scaling function, ψ(t) is the wavelet function, and the relationship between the two is:

[0056]

[0057] Among them, h K Represents the low-pass filter coefficient, g k =(-1) k h 1-k Represents the high-pass filter coefficient. For a discrete signal x(n), the wavelet packet decomposition is calculated recursively, and the subband signal of the jth node of the i-th layer of the signal is obtained by filtering and downsampling:

[0058]

[0059] Among them, W i,j (n) represents the signal of the jth node in the i-th layer, and 2n-k represents downsampling of the filtering result.

[0060] In addition, the number of decomposition layers also has a certain impact on the reconstruction of the signal. Insufficient decomposition layers may lose the high-frequency part of the signal. The present invention preferably adopts a three-layer wavelet packet decomposition tree, specifically as follows: Figure 2 As shown, where S 0,0 represents the original signal, S i,j Represents the decomposition signal of the jth node in the i-th layer.

[0061] Optionally, when wavelet packet decomposition is used to process a signal, the selection of the wavelet basis function is crucial. Different wavelet basis functions have different effects on signal reconstruction. Common wavelet basis functions include Haar wavelet, DB wavelet, Sym series wavelet, etc. The present invention takes into account the non-stationary nature of photovoltaic power signals, with a high proportion of high-frequency components (such as irradiance mutations), and the db9 wavelet can effectively capture these local mutations and avoid spectrum leakage. Compared with common wavelet basis functions, the db9 wavelet reduces the expansion of irrelevant frequencies through tight support and can more accurately process high-frequency components through high-order vanishing moment characteristics, thereby improving the accuracy of time-frequency analysis. Therefore, the wavelet basis function used in the wavelet packet decomposition of the present invention is the db9 wavelet.

[0062] In addition, in step S3, the convolutional neural network is a deep neural network composed of convolutional layers. The characteristics of the convolutional neural network structure are local connections and weight sharing between adjacent layers. This reduces the complexity of the model structure and the number of parameters that need to be trained, and can process data with higher dimensions and larger amounts of information. The CNN network can capture the spatial correlation of these local mutations through its convolution kernel. When processing an image, the convolution kernel extracts features from different local areas and captures spatial features at different levels through multi-layer convolution operations. In the photovoltaic power time-frequency image, these local features may correspond to the shadowing effect between photovoltaic arrays, or power fluctuations caused by rapid irradiance changes. By learning these local features, the CNN can identify the complex nonlinear mapping relationship between irradiance changes and power output. Therefore, after the time-frequency image extracted by WPD is input into the CNN, the CNN will output a photovoltaic power prediction result based on spatial features.

[0063] Specifically, during training, CNN automatically adjusts the weights of the convolution kernels to maximize the response to these sudden changes, thereby capturing the spatiotemporal correlations between different regions. Due to the spatial layout of photovoltaic arrays, local irradiance changes may have different effects on adjacent arrays. CNN can accurately capture these effects by learning the response patterns of these adjacent arrays, thereby improving the accuracy of power prediction. Therefore, the present invention uses wavelet packet decomposition to extract time-frequency images and CNN to learn spatial features, which helps to more accurately model the nonlinear relationship between photovoltaic power and irradiance.

[0064] Among them, the CNN network includes: input layer, convolution layer, nonlinear activation layer, pooling layer, fully connected layer and output layer. Its basic structure is as follows Figure 3 As shown in Figure 2. After the time-frequency image is passed to the convolutional neural network, the input layer needs to preprocess the time-frequency image. Specifically, in order to improve the computational efficiency, the time-frequency image is compressed to 128×128 pixels. In addition, in order to prevent gradient explosion and gradient vanishing phenomena, the time-frequency image is preprocessed using the normalization method. Normalization is to divide the input data by the standard deviation of each input pixel calculated on the training set to normalize the standard deviation to a unit value. Assuming that N training images are given and each pixel value is represented by x, the normalization formula is expressed as follows:

[0065]

[0066] in,

[0067] The convolution layer is the most important component of the convolutional neural network. It includes a set of filters, also known as convolution kernels. The convolution kernels perform convolution calculations with the given input image to generate the output feature image. During the training of the convolutional neural network, the weight of each convolution kernel can be learned. The learning process includes the randomization method of the convolution kernel weights at the beginning of training and the adjustment of the convolution kernel weights in multiple iterations after the given input and output pairs. The mathematical formula of the convolution layer can be described as: in, represents the weight of the i-th convolution kernel in the l-th convolution layer, represents the bias vector of the i-th convolution kernel in the l-th convolution layer, x l (j) represents the jth region data in the lth convolutional layer, It represents the output of the i-th convolution kernel in the l-th layer and the input of the j-th region in the i-th channel in the l+1-th layer. After the convolution operation, the output of the convolution layer is sent to the nonlinear activation layer to learn the nonlinear characteristics of the data.

[0068] The activation function of the nonlinear activation layer uses the ReLU activation function. Compared with other activation functions such as the Sigmoid function and the Tanh activation function, the ReLU activation function has a significantly lower computational complexity. For deep networks, the gradient is less likely to vanish during backpropagation. ReLU enables the sparse model to better mine relevant features and fit the training data. The RELU function can be described as: in, express The activation value of .

[0069] The pooling layer usually takes the convolution layer as input. Each convolution kernel in the convolution layer has a feature map. Increasing the number of convolution kernels will increase the dimension of the convolution, resulting in an increase in the convolution kernel parameters. The pooling layer reduces the number of parameters and the amount of computation by gradually reducing the size of the representation space, thereby achieving feature invariance and feature dimensionality reduction to control overfitting. A commonly used pooling method is the maximum pooling method, which divides the input image into several rectangular regions and outputs the maximum value for each sub-region. It is defined as: in, Indicates the rectangular area related to the k-th feature map The maximum pooling output value of Represents a rectangular area The element at (p, q) in .

[0070] The fully connected layer acts as a classifier in the entire convolutional neural network. Operations such as the convolutional layer, pooling layer, and activation function layer map the original data to the hidden feature space. The fully connected layer maps the learned "distributed feature representation" to the sample label space. The output value of the last fully connected layer is passed to an output, and the loss function is used to estimate the quality of the network's predictions on the training data. The loss function can quantitatively distinguish the difference between the estimated output of the model and the actual annotation. The most commonly used loss function is the cross-entropy loss function, which is defined as: Here, y represents the desired output, p represents the probability of each output category, and there are a total of N neurons in the output layer. Therefore, the softmax function can be used to calculate the probability of each class: in, Represents the unnormalized output of the previous layer in the network. Using cross-entropy loss to optimize network parameters is equivalent to minimizing the KL-divergence between the predicted output (generated distribution p) and the desired output (true distribution y). Therefore, the KL-divergence between p and y can be expressed as the difference between the cross entropy L and the entropy H, which can be expressed as: KL(p||y)) = L(p, y) - H(p). Therefore, minimizing cross entropy is equivalent to minimizing the KL-divergence between the two distributions.

[0071] In addition, before training the model, the weight parameters of the neural network are initialized using Kaiming (He), the MSE loss function is used, and an L2 regularization term is added to prevent overfitting during training. The model performance is evaluated using the mean absolute error (MAE), symmetric mean absolute percentage error (SMAPE), root mean square error (RMSE), and coefficient of determination (R2). The calculation formulas for these four indicators are as follows:

[0072]

[0073] in, Represents the model inversion value, y i represents the true value of the measurement, represents y i The arithmetic mean of MAE can evaluate the absolute error between the estimated value and the observed value, SMAPE can evaluate the percentage of the absolute error between the estimated value and the observed value as a percentage of the exact value, and RMSE is the expected value of the square of the difference between the estimated value and the observed value. All three intuitively reflect the gap between the inversion result and the actual value. The smaller the gap, the better the model performance. When all three are 0, it is a perfect model. 2 is the coefficient of determination, which indicates the degree to which the independent variable explains the dependent variable. 2 The closer it is to 1, the closer the estimated value of the model is to the actual observed value.

[0074] As an example, the present invention uses Python language to build a CNN model under the Tensorflow framework. During the training process, 20% of the training set is used as the validation set, the batch size is set to 20, and the number of training steps is set to 5000. The model sets three layers of convolutional pooling layers and one fully connected layer. The size of all convolution kernels is set to 3×3, the number of convolution kernels in each layer is 32, 32 and 64 respectively, the convolution kernel step size is 1, the activation function is selected to use ReLU, the pooling method adopts maximum pooling, the fully connected layer is set to 128 neurons, the learning rate of the Adam optimizer is set to 0.0001, the Tensorflow API is used to define the convolution kernel weight size for the convolution layer, and the loss function is set to the cross entropy loss function. The specific network structure parameters are shown in Table 1.

[0075] Table 1. Network structure parameters of CNN model

[0076] Serial number Network layer Convolution kernel size step length Number of convolution kernels Output size 1 Input layer / / / 128×128 2 Convolutional layer 1 3×3 1×1×1×1 32 128×128×128 3 Pooling layer 1 4×1 1×2×2×1 / 64×64×32 4 Convolutional layer 2 3×3 1×1×1×1 32 64×64×32 5 Pooling layer 2 4×1 1×2×2×1 / 32×32×32 6 Convolutional layer 3 3×3 1×1×1×1 64 32×32×64 7 Pooling layer 3 4×1 1×2×2×1 / 16×16×64 8 Fully connected layer 128 / 1 128×1 9 Softmax 6 / 1 10

[0077] In addition, in step S4, the preprocessed historical power data is input into the trained GRU network, which outputs a photovoltaic power prediction result based on time series features. The GRU network is an improved recurrent neural network that aims to better capture long-term dependencies in time series data. Compared to traditional RNNs, the GRU introduces update gates and reset gates to control the flow of information. This enables the GRU to maintain good performance when processing time series data, especially when capturing long-term dependencies in time series.

[0078] Among them, the structure of the GRU network is as follows Figure 4 As shown, x t Represents the input data at the current time t, h (t-1) Represents the hidden state output at the historical moment t-1, σ and tanh represent the Sigmoid activation function and the hyperbolic tangent activation function respectively. In order to streamline the internal structure and improve the operation efficiency, the GRU network structure integrates the input gate, forget gate, and output gate structure in LSTM into an update gate and a reset gate. Using an update gate can realize the forgetting and selective memory of the neural network, which greatly reduces the number of parameters. The update gate determines how much historical information and current information are used to update the current hidden state. The update gate at the tth moment can be expressed as: z t =σ(W z ·[h t-1 , x t ]), where z t represents the gate update signal, z t The size of determines the degree of memory of the candidate hidden state, h (t-1) Represents the historical implicit state, x t represents the input data at time t, Wz Represents the weight matrix. The reset gate determines how much historical information is retained. The reset gate at time t can be expressed as: r t =σ(W r ·[h t-1 ,x t ]), where r t Represents the reset signal. The larger the reset signal value is, the more historical information needs to be remembered. r Represents the weight matrix. In the update gate z t and reset gate r t Under the action of , the candidate hidden state at the current moment, the implicit output state h t Can be updated to: Among them, the candidate hidden state can be expressed as: The candidate hidden state is responsible for fusing the information features of the input data and historical data. This operation is combined with the reset signal r obtained by the reset gate. t Related, and h t Represents the final unit state at the current moment, which includes two processes: forgetting and remembering. (1-z t ) and the implicit state h at the previous moment t-1 The product of represents the forgetting process, z t The closer it is to 1, the more information will be forgotten. t The product of the candidate hidden state represents the memory process, z t The size determines the degree of memory of the candidate hidden state, that is, how many previous hidden states are retained, that is, how much new memory is added, how much old memory is forgotten. When the preprocessed historical power data is input into the trained GRU network, the GRU will process the data by time step. Specifically, the input of each time step is the output of the previous moment and the current power value. The GRU uses its gating mechanism to determine which information should be retained and which should be discarded. The output of the GRU is an abstraction of the implicit temporal features in the original power sequence data. These features can capture periodic or trend patterns in the data, and through the information of the local time period, the GRU can effectively capture the rapid changes in power.

[0079] In addition, in step S5, the photovoltaic power prediction result based on spatial features obtained in step S3 and the photovoltaic power prediction result based on time series features obtained in step S4 are weighted and fused, thereby realizing the complementarity of CNN and GRU, which can more accurately capture the complex spatiotemporal patterns in photovoltaic power data, thereby greatly improving the accuracy and robustness of photovoltaic power prediction, especially when dealing with high volatility and complex environmental factors.

[0080] Alternatively, existing fusion methods usually use fixed weights or simple searches. However, these two methods cannot adapt to the spatiotemporal heterogeneity in photovoltaic power data. For example, the spatiotemporal characteristics of photovoltaic power show significant differences under different weather conditions and spatial distributions. For example, spatial features dominate on sunny days, while temporal features are more critical on cloudy days. In extreme weather conditions, sudden changes may cause model prediction lags or error amplification. Therefore, the fixed weight method cannot dynamically adjust the fusion weights, and the simple search method can only optimize discrete weight combinations and cannot adapt to changes in input data in real time. Therefore, if Figure 5 As shown, the distributed photovoltaic power prediction method of the present invention also includes the following contents:

[0081] Step S6: Collect solar irradiance data and temperature data, calculate the fusion ratio parameters of the first prediction result and the second prediction result based on the solar irradiance data and temperature data, optimize and solve the fusion ratio parameters using a genetic algorithm, and perform weighted fusion calculation of the two prediction results based on the optimal solution of the fusion ratio parameters.

[0082] It can be understood that the problem of finding the optimal fusion ratio parameter is essentially an objective optimization problem. The search function of the genetic algorithm can be used to find the ratio parameter with the best fusion effect of the two. For example, the initial population is formed by encoding the fusion ratio parameter, and the population is evolved through roulette wheel selection, single-point crossover and basic mutation operations. Finally, when the convergence condition is reached (the average fitness change of the population is less than the threshold), the fusion ratio parameter that maximizes the fusion effect is found.

[0083] Specifically, in order to adapt to the spatiotemporal heterogeneity of photovoltaic power data, the present invention first collects real-time solar irradiance data and temperature data, and calculates the fusion ratio parameter of the first prediction result and the second prediction result based on the solar irradiance data and temperature data. The fusion ratio parameter is specifically calculated based on the following formula:

[0084]

[0085] Among them, K represents the fusion ratio of the first prediction result, 1-K represents the fusion ratio of the second prediction result, α and β represent the adjustment coefficients, σ 2 represents the irradiance variance, I i represents the irradiance value at the i-th time point, represents the mean irradiance, a T represents the temperature change rate within the time interval, δ1 represents the irradiance variance threshold, and δ2 represents the temperature change rate threshold. In addition, after collecting solar irradiance data and temperature data, they can also be normalized to facilitate subsequent calculations.

[0086] Optionally, two thresholds δ1 and δ2 are set based on historical data statistics. The specific setting process is: irradiance variance and temperature change rate are combined into a two-dimensional feature vector x = [σ 2 , a T ], a clustering algorithm (such as the K-Means clustering algorithm) is used to divide the historical data into two categories: sunny and cloudy, and the average value of the cluster centers of the two categories is used as the threshold. It can be understood that the present invention clusters the historical data to divide the historical data into two categories: sunny and cloudy, and then uses the average value of the cluster centers of the two categories as the threshold value for the irradiance variance and the temperature change rate. Compared with setting the threshold value based on human experience, the accuracy of the threshold setting is improved, which is conducive to further improving the accuracy of power prediction.

[0087] Optionally, the latest solar irradiance data and temperature data are updated every preset time window (for example, every hour), and the fusion ratio parameters are re-optimized using the latest data, which is conducive to adapting to short-term changes in weather patterns and further improving the accuracy of power forecasts.

[0088] Then, a certain number of individuals are randomly generated, assuming the population size is M, to form an initial population, where each individual represents a possible fusion ratio parameter K. For example, when M = 20, 20 real numbers between [0, 1] are used as randomly generated individuals in the initial population.

[0089] For each sample s in the dataset i , calculate the fusion result, the calculation formula is: v i =K×v i,C +(1-K)×v i,G , where v i,C Represents CNN for sample s i The output, v i,G Represents GRU for sample s i Output.

[0090] Further calculate the fitness of each individual and use the calculated v i Substitute the accuracy statistical function to obtain the fitness value of each individual, where the fitness value calculation formula is: M t Indicates the number of correctly predicted samples, M a Indicates the total number of samples.

[0091] Then calculate the selection probability of each individual in the group according to the individual's fitness. The calculation formula is: Based on the selection probability, the roulette wheel selection method is used to select individuals to enter the next generation population.

[0092] For a selected population, two individuals p1 and p2 are randomly selected, a crossover point c (0 < c < 1) is randomly determined, and two offspring individuals c1 and c2 are generated. The gene values of c1 are taken from p1 in the interval [0, c] and from p2 in the interval (c, 1]; c2 is the opposite.

[0093] Then, with a certain mutation probability p m perform a mutation operation on each individual in the population. If an individual is selected for mutation, a small random perturbation ΔK is randomly added to its gene value. When the average fitness of the population changes less than the threshold θ within T consecutive generations, the algorithm is considered to have converged, and the iteration is stopped and the output is generated.

[0094] It can be understood that the present invention calculates the fusion ratio parameter of the CNN output result and the GRU output result by collecting real-time solar irradiance data and temperature data, and uses this fusion ratio parameter as the encoding of the genetic algorithm, so as to use the improved genetic algorithm to find the optimal fusion method in the dynamic adjustment process, and can flexibly adjust the weights of the temporal features and spatial features according to different scenarios, thereby improving the prediction accuracy and robustness under various weather conditions and spatial heterogeneity, and greatly enhancing the adaptability and generalization ability of the model.

[0095] In addition, to improve the performance of the genetic algorithm, the parameters of the genetic algorithm can also be optimized. For example, for the population size M, if it is found that the search range is not comprehensive enough or the convergence speed is slow, the population can be gradually increased, and if there is insufficient computing resources or redundancy of individuals in the population, the population should be appropriately reduced; for the mutation probability p m , if the algorithm falls into a local optimum, it should be appropriately increased, and when similar random search characteristics appear, it should be reduced; for the convergence threshold θ, if the convergence is too fast, it is reduced, and if the convergence is too slow, it is increased.

[0096] In addition, as Figure 6 shown, another embodiment of the present invention further provides a power prediction system for distributed photovoltaic, preferably adopting the power prediction method for distributed photovoltaic as described above. The system includes:

[0097] A data preprocessing module for collecting historical power data of distributed photovoltaic power generation and preprocessing it;

[0098] A wavelet packet decomposition module for mapping the preprocessed historical power data into a time-frequency image by using wavelet packet decomposition;

[0099] A first prediction module for inputting the time-frequency image into a trained CNN network to obtain a first prediction result;

[0100] The second prediction module is used to input the preprocessed historical power data into the trained GRU network to obtain a second prediction result;

[0101] The weighted fusion module is used to perform weighted fusion calculation based on the first prediction result and the second prediction result to obtain a power prediction result of distributed photovoltaic.

[0102] It can be understood that the distributed photovoltaic power prediction system of this embodiment combines the time-frequency feature extraction capability of wavelet packet decomposition, the spatial feature extraction advantage of convolutional neural network and the time series modeling capability of gated recurrent unit network. The time-frequency fine decomposition of wavelet packet decomposition provides CNN with highly discriminative spatial features, while the time series modeling of GRU makes up for CNN's neglect of long-term trends. The weighted fusion of CNN and GRU achieves the complementarity between the two, which can more accurately capture the complex spatiotemporal patterns in photovoltaic power data, thereby greatly improving the accuracy and robustness of photovoltaic power prediction, especially when dealing with high volatility and complex environmental factors. It performs better and provides more reliable photovoltaic power prediction support for the power grid dispatching system, thereby improving the efficiency of power grid load allocation, reducing energy waste, and ensuring the stability and economy of the photovoltaic power generation system.

[0103] In addition, the weighted fusion module is also used to collect solar irradiance data and temperature data, calculate the fusion ratio parameters of the first prediction result and the second prediction result based on the solar irradiance data and temperature data, and use a genetic algorithm to optimize and solve the fusion ratio parameters, and perform weighted fusion calculation of the two prediction results based on the optimal solution of the fusion ratio parameters.

[0104] In addition, another embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the steps of the above method by calling the computer program stored in the memory.

[0105] In addition, another embodiment of the present invention further provides a computer-readable storage medium for storing a computer program for power prediction of distributed photovoltaics, wherein the computer program executes the steps of the above-described method when running on a computer.

[0106] Common computer-readable storage media include: floppy disks, flexible disks, hard disks, magnetic tape, any other magnetic media, CD-ROMs, any other optical media, punch cards, paper tape, any other physical medium with a pattern of holes, random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), flash-erasable programmable read-only memory (FLASH-EPROM), any other memory chip or cartridge, or any other medium that can be read by a computer. Instructions can further be transmitted or received via a transmission medium. The term transmission medium may include any tangible or intangible medium that can be used to store, encode, or carry instructions for execution by a machine, and includes digital or analog communication signals or other intangible media that facilitate communication of such instructions. Transmission media include coaxial cables, copper wire, and fiber optics, including the wires of a bus used to transmit a computer data signal.

[0107] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiment of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal translation scripting language JavaScript, etc.

[0108] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0109] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0111] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.

[0112] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.

[0113] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A distributed photovoltaic power prediction method, characterized in that: Includes the following: Collect historical power data of distributed photovoltaic power generation and preprocess it; The pre-processed historical power data is mapped into time-frequency images using wavelet packet decomposition; Input the time-frequency image into the trained CNN network to obtain the first prediction result; The pre-processed historical power data is input into the trained GRU network to obtain the second prediction result; A weighted fusion calculation is performed based on the first prediction result and the second prediction result to obtain a power prediction result of distributed photovoltaics.

2. The distributed photovoltaic power prediction method according to claim 1, characterized in that: Also included: Solar irradiance data and temperature data are collected, and the fusion ratio parameters of the first prediction result and the second prediction result are calculated based on the solar irradiance data and temperature data. The fusion ratio parameters are optimized and solved using a genetic algorithm, and a weighted fusion calculation of the two prediction results is performed based on the optimal solution of the fusion ratio parameters.

3. The distributed photovoltaic power prediction method according to claim 2, characterized in that: The fusion ratio parameter is calculated based on the following formula: Among them, K represents the fusion ratio of the first prediction result, α and β represent the adjustment coefficients, σ 2 represents the irradiance variance, a T It represents the temperature change rate within the time interval, δ1 represents the irradiance variance threshold, and δ2 represents the temperature change rate threshold.

4. The distributed photovoltaic power prediction method according to claim 3, characterized in that: The two thresholds are set based on historical data statistics. The specific setting process is: the irradiance variance and temperature change rate are combined into a two-dimensional feature vector, the historical data are divided into two categories: sunny and cloudy days using a clustering algorithm, and the average value of the cluster centers of the two categories is used as the threshold.

5. The distributed photovoltaic power prediction method according to claim 3, characterized in that: The latest solar irradiance and temperature data are updated every preset time window, and the fusion ratio parameters are re-optimized using the latest data.

6. The distributed photovoltaic power prediction method according to claim 1, wherein: In the process of preprocessing historical power data, the following formula is used to fill and replace abnormal values: Among them, z i represents the i-th outlier, Z i represents the filling value of the i-th outlier, z i-k represents the kth data before the i-th outlier, z i+k Represents the kth data after the i-th outlier.

7. The distributed photovoltaic power prediction method according to claim 1, wherein: The wavelet basis function used in wavelet packet decomposition is db9 wavelet.

8. A distributed photovoltaic power prediction system, characterized in that: include: Data preprocessing module, used to collect historical power data of distributed photovoltaic power generation and preprocess it; A wavelet packet decomposition module is used to map the pre-processed historical power data into a time-frequency image using wavelet packet decomposition; A first prediction module is used to input the time-frequency image into the trained CNN network to obtain a first prediction result; The second prediction module is used to input the preprocessed historical power data into the trained GRU network to obtain a second prediction result; The weighted fusion module is used to perform weighted fusion calculation based on the first prediction result and the second prediction result to obtain a power prediction result of distributed photovoltaic.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the steps of the method according to any one of claims 1 to 7 by calling the computer program stored in the memory.

10. A computer-readable storage medium for storing a computer program for power prediction of distributed photovoltaics, characterized in that: When the computer program is run on a computer, the steps of the method according to any one of claims 1 to 7 are executed.