Short-term photovoltaic power prediction method, computer readable storage medium and electronic equipment

Through ACO-optimized FCM clustering and improved singular spectrum analysis combined with the CNN-BiGRU model and cross-attention mechanism, the problem of low accuracy of short-term photovoltaic power prediction is solved and more accurate prediction results are achieved.

CN118739256APending Publication Date: 2024-10-01BEIJING INST OF TECH ZHUHAI CAMPUS +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410717756.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The accuracy of existing short-term photovoltaic power prediction methods is not high and is greatly affected by factors such as meteorological conditions, geographical location, and photovoltaic components, resulting in unstable prediction results.

Method used

The ACO-optimized FCM clustering algorithm is used to screen meteorological features, combined with the improved singular spectrum analysis method to extract the trend and periodic features of photovoltaic power data, a CNN-BiGRU model is built and a cross-attention mechanism is introduced to form a CNN-BiGRU-CrossAttention model. Make predictions about future weather data.

Benefits of technology

It improves the accuracy of short-term photovoltaic power prediction, enhances the diversity of data through cluster analysis and feature decomposition, reduces the impact of weather changes on prediction, and significantly improves the accuracy of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118739256A_ABST
    Figure CN118739256A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of photovoltaic power generation prediction, in particular to a short-term photovoltaic power prediction method, a computer readable storage medium and electronic equipment, and the method comprises the steps: obtaining historical data of a photovoltaic power generation system; meteorological features having strong correlation with the photovoltaic power are screened out to serve as meteorological feature data sets, and the meteorological feature data sets are clustered by using an ACO optimized FCM clustering algorithm; decomposing the photovoltaic power data by adopting an improved singular spectrum analysis method, and extracting a characteristic decomposition vector; taking the plurality of meteorological clusters and the characteristic decomposition vectors as input of a CNN-BiGRU model to obtain data sample sets of different categories; according to different types of data sample sets, training a corresponding CNN-BiGRU-CrossAttention model, and obtaining a short-term photovoltaic power prediction model; and inputting future short-term meteorological data into the short-term photovoltaic power prediction model. The invention provides a short-term photovoltaic power prediction method, a computer readable storage medium and electronic equipment. The accuracy of photovoltaic power prediction can be remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In recent years, with the increasing prominence of global environmental pollution and the rapid growth of energy demand, renewable energy has attracted much attention. Photovoltaic power generation, as a pollution-free, renewable, and distributed energy source, has been widely used in many fields. However, compared with traditional energy sources, photovoltaic power generation is more significantly affected by factors such as meteorological conditions, geographical location, and photovoltaic components. Its power generation will also fluctuate significantly in a short period of time, which brings many inconveniences to the control and management of photovoltaic power station operation systems. Therefore, accurate short-term photovoltaic power forecasting is crucial.

[0003] Many research methods for photovoltaic power prediction have achieved some results, but they also have different limitations. Some methods first convert the sequence to a stationary state and then use the ARIMA statistical model for prediction, but this method may still have heteroscedasticity after the difference operation. An improved ant colony optimization SVM method after preprocessing the data has been proposed, but the smoothing technology is not suitable for the preprocessing of large data sets; some studies have conducted experimental studies and comparisons on CNN, LSTM and CNN-LSTM hybrid models, and found that the length of the input time series has an impact on the prediction accuracy. There will be a threshold. When the threshold is exceeded, the prediction accuracy will decrease instead of increase. Due to the influence of various factors, the prediction accuracy of the above prediction models is not high.

[0004] It can be seen that the existing technology still needs to be improved and enhanced. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a short-term photovoltaic power prediction method, a computer-readable storage medium and an electronic device to solve the current technical problem of low accuracy in short-term photovoltaic power prediction.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A short-term photovoltaic power prediction method comprises the following steps:

[0008] Step S1, obtaining historical data of the photovoltaic power generation system, wherein the historical data includes a variety of meteorological data and corresponding photovoltaic power data;

[0009] Step S2, selecting meteorological features that have a strong correlation with photovoltaic power from a variety of meteorological data as a meteorological feature data set, and clustering the meteorological feature data set using the ACO-optimized FCM clustering algorithm to obtain multiple meteorological clusters;

[0010] Step S3, using an improved singular spectrum analysis method to decompose the photovoltaic power data, and extracting trend and periodic characteristic decomposition quantities that have a strong correlation with the photovoltaic power data as new characteristic decomposition vectors;

[0011] Step S4, building a CNN-BiGRU model including a CNN layer and a BiGRU layer, taking multiple meteorological clusters and feature decomposition vectors as inputs of the CNN-BiGRU model, and classifying them according to different weather types to obtain data sample sets of different categories;

[0012] Step S5, introducing the feature-based cross-attention mechanism into the CNN-BiGRU model, building a CNN-BiGRU-CrossAttention model, and then training the corresponding CNN-BiGRU-CrossAttention model according to data sample sets of different categories to obtain a short-term photovoltaic power prediction model;

[0013] Step S6: input the future short-term meteorological data into the short-term photovoltaic power prediction model to obtain the short-term photovoltaic power prediction result.

[0014] The short-term photovoltaic power prediction method as described above, after step S1, also includes the steps of: dimensionless processing of multiple meteorological data; in step S2, the meteorological characteristics having a strong correlation with photovoltaic power are obtained by calculating the Spearman correlation coefficient between the meteorological data and the photovoltaic power data.

[0015] In the short-term photovoltaic power prediction method as described above, in step S2, the meteorological characteristic data set is clustered using the ACO optimized FCM clustering algorithm, including the following steps:

[0016] Step S21, initializing the ACO algorithm and the FCM clustering algorithm;

[0017] Step S22, calculating the Euclidean distance between the meteorological feature having a strong correlation with the photovoltaic power and the cluster center;

[0018] Step S23, perform an iterative operation, the ants select the next cluster number according to the current pheromone concentration, use the FCM algorithm to process the cluster number to obtain the clustering result, and use the Xie_Beni index to evaluate the clustering result. The calculation formula of the Xie_Beni index is:

[0019]

[0020] In the formula, i and k represent the indexes of different clusters, U i Represents the distance from each data point to the center of its cluster, D ik Represents the distance between different clusters;

[0021] Step S24, update the pheromone on the path, the calculation formula is:

[0022]

[0023] In the formula, ρ is the volatilization rate of pheromone, which controls the attenuation degree of pheromone; is the pheromone left by the mth ant;

[0024] Step S25, repeating step S23 and step S24, and continuously iterating until the convergence condition is met, thereby obtaining a clustering result obtained using the optimal number of clusters.

[0025] In the short-term photovoltaic power prediction method described above, in step S3, the photovoltaic power data is decomposed using an improved singular spectrum analysis method, specifically:

[0026] Assume that the photovoltaic power data is F N =(f1,f2,…,f N ), find the optimal window length L through the ACO algorithm, let K = N-L+1, and construct an L×K trajectory matrix. The trajectory matrix is ​​as follows:

[0027]

[0028] Perform singular value decomposition on X. The specific formula is as follows:

[0029] X=USV T

[0030] Where U is the left singular vector matrix; V T is a right singular vector matrix; S is a diagonal matrix; and finally L eigendecomposition vectors are decomposed.

[0031] In the short-term photovoltaic power prediction method described above, the finding of the optimal window length L by the ACO algorithm specifically includes:

[0032] Step S31, initializing the ACO algorithm and window length;

[0033] Step S32, initializing pheromone for each possible window length;

[0034] Step S33, selecting the next window length according to the pheromone and the heuristic information, and executing the SSA algorithm according to the selected window length to obtain the decomposition result, and then using the Spearman correlation coefficient as the objective function to evaluate the decomposed subsequence;

[0035] Step S34, iteratively updating pheromone and window length;

[0036] Step S35: Repeat step S33 and step S34 until the iteration ends and the optimal window length L is obtained for decomposition.

[0037] In the short-term photovoltaic power prediction method as described above, in step S4, the CNN layer includes a convolutional layer, an activation layer, a pooling layer and a fully connected layer connected in sequence, the BiGRU layer includes two gated recurrent units in the forward and reverse directions of the timing, the convolutional layer includes a two-dimensional convolutional layer, and the pooling layer includes a two-dimensional pooling layer.

[0038] In the above-mentioned short-term photovoltaic power prediction method, in step S4, weather type classification is performed on the historical data samples to obtain data sample sets of different categories, specifically including:

[0039] Step S41, inputting the multiple meteorological clusters and feature decomposition vectors into a CNN layer including two convolutional layers, the two convolutional layers are responsible for extracting features from the input data to obtain feature vectors;

[0040] Step S42: using a maximum pooling layer to perform a pooling operation on the feature vector extracted from the convolution layer, the outputs of the two convolution layers are spliced ​​together after batch normalization in the maximum pooling layer to form a comprehensive feature representation;

[0041] Step S43, inputting the comprehensive feature representation into the BiGRU layer, the BiGRU layer performs sequence modeling on the comprehensive feature representation from the positive and negative directions of the time series respectively, so as to capture the front-back dependency relationship in the time series data;

[0042] In step S44, the output of the BiGRU layer is batch normalized again and then sent to the fully connected layer for transformation. At the same time, a dropout mechanism is introduced to reduce the risk of overfitting, and finally data sample sets of different categories are output.

[0043] In the short-term photovoltaic power prediction method as described above, in step S4, the feature-based cross-attention mechanism includes three modules: an embedding layer, a feature cross-layer and an output layer; the embedding layer encodes the strongly correlated meteorological features and photovoltaic power data into a new sequence vector, and maps it to a high-dimensional dense vector space; the feature cross-layer performs feature cross-operations on the meteorological features and their photovoltaic power, and between two meteorological features, and then uses the self-attention mechanism to calculate the correlation score to obtain a cross-feature representation that integrates the input feature information; the output layer performs batch normalization on the cross-feature representation, and then outputs the prediction result after passing through the fully connected layer.

[0044] A computer-readable storage medium stores a program thereon, and when the program is executed by a processor, the steps in the short-term photovoltaic power prediction method as described above are implemented.

[0045] The electronic device comprises a memory, a processor and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in the short-term photovoltaic power prediction method as described above are implemented.

[0046] Beneficial effects:

[0047] The present invention discloses a short-term photovoltaic power prediction method. The method comprises the following steps: obtaining a plurality of meteorological data and historical data of corresponding photovoltaic power data at a photovoltaic power generation system, screening out meteorological features having a strong correlation with photovoltaic power, clustering using an ACO-optimized FCM clustering algorithm, and obtaining a plurality of meteorological clusters; in addition, an improved singular spectrum analysis method is used to decompose the historical photovoltaic power sequence, and decomposition quantities having a strong correlation with photovoltaic power data are extracted as new feature decomposition vectors; using the plurality of meteorological clusters and feature decomposition vectors as inputs of a CNN-BiGRU model, classifying the weather types of historical data samples, and obtaining data sample sets of different categories; then training the corresponding CNN-BiGRU-CrossAttention model according to the data sample sets of different categories, and obtaining a short-term photovoltaic power prediction model; inputting relevant features into the short-term photovoltaic power prediction model, and obtaining a short-term photovoltaic power prediction result; wherein, the method is optimized using the ACO algorithm. The FCM clustering algorithm is used to perform cluster analysis on historical meteorological data, which helps to discover the potential patterns and characteristics of the data and identify the categories of the data, laying the foundation for the subsequent classification tasks. The improved singular spectrum analysis method is used to decompose the photovoltaic power sequence to extract new dimensional features, which helps to expand the data set and increase the diversity of samples. The CNN-BiGRU classification model is used to classify the weather type of the forecast day data, and the weather is divided into three categories: sunny, cloudy and rainy, and data sample sets are generated respectively to reduce the impact of weather changes on photovoltaic power forecasting and improve the subsequent prediction accuracy. The CNN-BiGRU-CrossAttention prediction model is formed by introducing a feature-based cross-attention mechanism into the CNN-BiGRU model. This model selectively focuses on the correlation between input features and the correlation between meteorological features and photovoltaic output, thereby effectively improving the accuracy of photovoltaic output forecasting. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 The present invention provides a flowchart of the short-term photovoltaic power prediction method. DETAILED DESCRIPTION

[0049] The present invention provides a short-term photovoltaic power prediction method, a computer-readable storage medium and an electronic device. In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples.

[0050] In the description of the present invention, it should be understood that the orientation or position relationship indicated by the terms "top", "bottom", etc. is based on the orientation or position relationship shown in the accompanying drawings, which is only for the convenience of describing the present invention and simplifying the description, and cannot be understood as a limitation on the present invention; in addition, the terms "installation", "connection", etc. should be understood in a broad sense, and for ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0051] See also Figure 1 The present invention provides a short-term photovoltaic power prediction method, comprising the following steps:

[0052] Step S1, obtaining historical data of the photovoltaic power generation system, wherein the historical data includes a variety of meteorological data and corresponding photovoltaic power data;

[0053] Step S2, selecting meteorological features that have a strong correlation with photovoltaic power from a variety of meteorological data as a meteorological feature data set, and clustering the meteorological feature data set using the ACO-optimized FCM clustering algorithm to obtain multiple meteorological clusters;

[0054] Step S3, using an improved singular spectrum analysis method to decompose the photovoltaic power data, and extracting trend and periodic characteristic decomposition quantities that have a strong correlation with the photovoltaic power data as new characteristic decomposition vectors;

[0055] Step S4, building a CNN-BiGRU model including a CNN layer and a BiGRU layer, taking multiple meteorological clusters and feature decomposition vectors as inputs of the CNN-BiGRU model, and classifying them according to different weather types to obtain data sample sets of different categories;

[0056] Step S5, introducing the feature-based cross-attention mechanism into the CNN-BiGRU model, building a CNN-BiGRU-CrossAttention model, and then training the corresponding CNN-BiGRU-CrossAttention model according to data sample sets of different categories to obtain a short-term photovoltaic power prediction model;

[0057] Step S6: input the future short-term meteorological data into the short-term photovoltaic power prediction model to obtain the short-term photovoltaic power prediction result.

[0058] Among them, the meteorological characteristics that have a strong correlation with photovoltaic power refer to the corresponding meteorological characteristics that directly affect photovoltaic power generation, that is, the meteorological characteristics corresponding to sudden changes in photovoltaic power generation.

[0059] The present invention discloses a short-term photovoltaic power prediction method. The method comprises the following steps: obtaining historical data of various meteorological data and corresponding photovoltaic power data at a photovoltaic power generation system, selecting meteorological features with strong correlation with photovoltaic power from various meteorological data as meteorological feature data sets, clustering the meteorological feature data sets using an ACO-optimized FCM clustering algorithm, and obtaining a plurality of meteorological clusters; in addition, an improved singular spectrum analysis method is used to decompose the photovoltaic power data, and trend and periodic feature decomposition quantities with strong correlation with the photovoltaic power data are extracted as new feature decomposition vectors; taking the plurality of meteorological clusters and feature decomposition vectors as inputs of a CNN-BiGRU model, and obtaining data sample sets of different categories according to different weather types; introducing a feature-based cross-attention mechanism into the CNN-BiGRU model, building a CNN-BiGRU-CrossAttention model, and then training the corresponding CNN-BiGRU-CrossAttention model according to data sample sets of different categories to obtain a short-term photovoltaic power prediction model; and The meteorological data of the previous period is input into the short-term photovoltaic power prediction model to obtain the short-term photovoltaic power prediction results; the FCM clustering algorithm optimized by the ACO algorithm is used to perform cluster analysis on the historical meteorological data, which is helpful to discover the potential laws and characteristics of the data, and identify the categories of the data to lay the foundation for the subsequent classification tasks; the photovoltaic power data is decomposed using the improved singular spectrum analysis method to extract new dimensional features, which helps to expand the data set and increase the diversity of samples; the CNN-BiGRU classification model is used to classify the weather type of the forecast day data, and the weather is divided into three categories: sunny, cloudy and rainy, and data sample sets are generated respectively to reduce the impact of weather changes on photovoltaic power prediction and improve the subsequent prediction accuracy; and by introducing the feature-based cross-attention mechanism into the CNN-BiGRU model, a CNN-BiGRU-CrossAttention prediction model is formed, which selectively focuses on the correlation between input features and the correlation between meteorological features and photovoltaic output, thereby effectively improving the accuracy of photovoltaic output prediction.

[0060] After step S1, the method further includes the steps of: applying dimensionless processing to various meteorological data, wherein the meteorological data includes radiation, ambient temperature, humidity, wind speed, etc.; dimensionless processing refers to eliminating the dimension (unit) difference of the data so that the numerical ranges of different features are similar, in order to ensure that the influence weight of each feature on the model is relatively balanced. Generally speaking, dimensionless processing can include minimum-maximum scaling processing, standardization processing, and decimal calibration processing.

[0061] The meteorological characteristics that have a strong correlation with the photovoltaic power in step S2 are obtained by calculating the Spearman correlation coefficient between the meteorological data and the photovoltaic power data, and the formula is expressed as follows:

[0062]

[0063] In the formula, represents the corresponding rank difference; n is the sample size.

[0064] In this embodiment, meteorological features with a ρ value greater than 0.7 are selected as inputs for subsequent algorithms and models.

[0065] The FCM algorithm is one of the most widely used clustering methods. It is a soft clustering algorithm based on objective function optimization. The core idea is to allow each data sample to belong to multiple categories. Each sample will have a membership degree corresponding to each category. By iteratively updating the class center and membership degree, the data sample is finally divided into the category with the maximum membership degree. However, in practical applications, FCM's dependence on the number of clusters is usually a challenge.

[0066] Furthermore, in step S2, the meteorological characteristic data set is clustered using the ACO optimized FCM clustering algorithm, including the following steps:

[0067] Step S21, initializing the ACO algorithm and the FCM clustering algorithm;

[0068] Step S22, calculating the Euclidean distance between the meteorological feature having a strong correlation with the photovoltaic power and the cluster center;

[0069] Step S23, perform an iterative operation, the ants select the next cluster number according to the current pheromone concentration, use the FCM algorithm to process the cluster number to obtain the clustering result, and use the Xie_Beni index to evaluate the clustering result. The calculation formula of the Xie_Beni index is:

[0070]

[0071] In the formula, i and k represent the indexes of different clusters, U i Represents the distance from each data point to the center of its cluster, D ik Represents the distance between different clusters;

[0072] Step S24, update the pheromone on the path, the calculation formula is:

[0073]

[0074] In the formula, ρ is the volatilization rate of pheromone, which controls the attenuation degree of pheromone; is the pheromone left by the mth ant;

[0075] Step S25, repeating step S23 and step S24, and continuously iterating until the convergence condition is met, thereby obtaining a clustering result obtained using the optimal number of clusters.

[0076] Furthermore, in step S3, the photovoltaic power data is decomposed using an improved singular spectrum analysis method, specifically:

[0077] Assume that the photovoltaic power data is F N =(f1,f2,…,f N ), find the optimal window length L through the ACO algorithm, let K = N-L+1, and construct an L×K trajectory matrix. The trajectory matrix is ​​as follows:

[0078]

[0079] Perform singular value decomposition on X. The specific formula is as follows:

[0080] X=USV T

[0081] Where U is the left singular vector matrix; V T is a right singular vector matrix; S is a diagonal matrix; and finally L eigendecomposition vectors are decomposed.

[0082] The ACO algorithm is an intelligent algorithm with excellent global optimization capabilities. It can search for solutions in a global range to avoid the algorithm falling into a local optimal solution. The heuristic optimization characteristics of the ACO algorithm can overcome the limitations of some existing algorithms.

[0083] Preferably, the finding the optimal window length L by using the ACO algorithm specifically includes:

[0084] Step S31, initializing the ACO algorithm and window length;

[0085] Step S32, initializing pheromone for each possible window length;

[0086] Step S33, selecting the next window length according to the pheromone and the heuristic information, and executing the SSA algorithm according to the selected window length to obtain the decomposition result, and then using the Spearman correlation coefficient as the objective function to evaluate the decomposed subsequence;

[0087] Step S34, iteratively updating pheromone and window length;

[0088] Step S35: Repeat step S33 and step S34 until the iteration ends and the optimal window length L is obtained for decomposition.

[0089] In the step S4, the CNN layer includes a convolutional layer, an activation layer, a pooling layer and a fully connected layer connected in sequence, the BiGRU layer includes two gated recurrent units along the forward and reverse directions of the time sequence, the convolutional layer includes a two-dimensional convolutional layer, and the pooling layer includes a two-dimensional pooling layer.

[0090] Furthermore, the activation function used in the activation layer of the CNN-BiGRU-CrossAttention model is the ReLU function.

[0091] Furthermore, the bidirectional gated recurrent unit is composed of two gated recurrent units along the forward and reverse directions of the timing. The calculation process of a single GRU is as follows:

[0092] z t =σ(W z ·[h t-1 ,x t ])

[0093] r t =σ(W r ·[h t-1 ,x t ])

[0094]

[0095]

[0096] Where W z , W r , W is the weight matrix; z t is the update gate; r t is the reset gate; h t is the activation function; is an alternative activation function; x t is the input; σ is the sigmoid activation function;

[0097] In BiGRU, the final output at each time step is obtained by concatenating the outputs of the forward GRU and the backward GRU at the same time step.

[0098] CNN can extract local features from the photovoltaic power sequence and capture short-term dependencies through a series of convolution and pooling operations; BIGRU is composed of two gated recurrent units along the forward and reverse directions of the time series, reading the input time series data at forward time steps and reverse time steps respectively, and can obtain the long-term dependencies between the past and future in the sequence, learn more comprehensive information, and help improve the prediction effect and generalization ability of classification or regression tasks.

[0099] In step S4, weather type classification is performed on the historical data samples to obtain data sample sets of different categories, specifically including:

[0100] Step S41, inputting the multiple meteorological clusters and feature decomposition vectors into a CNN layer including two convolutional layers, the two convolutional layers are responsible for extracting features from the input data to obtain feature vectors;

[0101] Step S42: using a maximum pooling layer to perform a pooling operation on the feature vector extracted from the convolution layer, the outputs of the two convolution layers are spliced ​​together after batch normalization in the maximum pooling layer to form a comprehensive feature representation;

[0102] Step S43, inputting the comprehensive feature representation into the BiGRU layer, the BiGRU layer performs sequence modeling on the comprehensive feature representation from the positive and negative directions of the time series respectively, so as to capture the front-back dependency relationship in the time series data;

[0103] In step S44, the output of the BiGRU layer is batch normalized again and then sent to the fully connected layer for transformation. At the same time, a dropout mechanism is introduced to reduce the risk of overfitting, and finally data sample sets of different categories are output.

[0104] The attention mechanism can significantly improve the performance of the model by enhancing the information processing capabilities of the neural network. Its core principle is that it can selectively pay attention to the information generated during the encoding process during the decoding process, that is, to allocate a large amount of attention to a small amount of truly important information. The different degrees of attention are given different weights in the calculation. This dynamic weight allocation strategy enables the attention mechanism to show higher efficiency and accuracy in processing long sequence data.

[0105] The feature-based cross-attention mechanism in step S4 includes three modules: an embedding layer, a feature cross-attention layer, and an output layer; the embedding layer encodes the strongly correlated meteorological features and photovoltaic power data into a new sequence vector, and maps it to a high-dimensional dense vector space; the feature cross-attention layer performs feature cross-operation on the meteorological features and their photovoltaic power, and between two meteorological features, and then uses the self-attention mechanism to calculate the correlation score to obtain a cross-feature representation that integrates the input feature information; the output layer performs batch normalization on the cross-feature representation, and then outputs the prediction result after passing through the fully connected layer.

[0106] The feature cross layer uses the factor decomposition machine method to perform cross operations on the features. The specific formula is

[0107] include:

[0108]

[0109] in,

[0110]

[0111] In the above formula,

[0112] y is the prediction result, w0 is the initial weight, x i 、x j is the characteristic component, w i is each feature x i The weight of and is a conventional linear model, v i 、v j is a k-dimensional vector, <v i ,v j >

[0113] Represents the dot product of two k-dimensional vectors, R is a set of real numbers, k is a hyperparameter, i and j are features, and n is the number of features.

[0114] The relevance score is calculated using the self-attention mechanism, and the attention weight calculation formula is:

[0115]

[0116] Where Q, K, V are the query vector, keyword matrix and value matrix respectively, and d is the embedding dimension.

[0117] The feature-based cross-attention mechanism can not only dynamically learn the adaptive weights of input features relative to PV output, but also learn the correlation between input features.

[0118] In this embodiment, the corresponding CNN-BiGRU-CrossAttention model is trained according to different types of data sample sets to obtain a short-term photovoltaic output prediction model, including:

[0119] The CNN layer and the BiGRU layer are consistent with the CNN-BiGRU model structure described above;

[0120] Introduce the feature-based cross-attention mechanism into the output sequence of the BiGRU layer for weighted fusion;

[0121] Sum all the attention-weighted encoder outputs to form a comprehensive output vector representation;

[0122] This output vector representation is batch normalized and then sent to a fully connected layer to be converted into the final prediction value.

[0123] This model architecture, which combines convolutional neural networks, bidirectional gated recurrent units, and a feature-based cross-attention mechanism, can not only significantly improve the accuracy of photovoltaic power prediction, but also enhance the model's ability to capture time series data. In particular, the application of the feature-based cross-attention mechanism enables the model to more effectively identify the most critical features in the data.

[0124] A computer-readable storage medium stores a program thereon, and when the program is executed by a processor, the steps in the short-term photovoltaic power prediction method as described above are implemented.

[0125] The electronic device comprises a memory, a processor and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in the short-term photovoltaic power prediction method as described above are implemented.

[0126] It is understandable that the execution subject of the present invention may be a short-term photovoltaic output prediction model construction device, or a terminal or a server. The embodiment of the present invention is described by taking a server as the execution subject as an example.

[0127] It is understandable that those skilled in the art can make equivalent substitutions or changes based on the technical solution and inventive concept of the present invention, and all these changes or substitutions should fall within the protection scope of the present invention.

Claims

1. A short-term photovoltaic power prediction method, characterized in that: The following steps are involved: Step S1, obtaining historical data of the photovoltaic power generation system, wherein the historical data includes a variety of meteorological data and corresponding photovoltaic power data; Step S2, selecting meteorological features that have a strong correlation with photovoltaic power from a variety of meteorological data as a meteorological feature data set, and clustering the meteorological feature data set using the ACO-optimized FCM clustering algorithm to obtain multiple meteorological clusters; Step S3, using an improved singular spectrum analysis method to decompose the photovoltaic power data, and extracting trend and periodic characteristic decomposition quantities that have a strong correlation with the photovoltaic power data as new characteristic decomposition vectors; Step S4, building a CNN-BiGRU model including a CNN layer and a BiGRU layer, taking multiple meteorological clusters and feature decomposition vectors as inputs of the CNN-BiGRU model, and classifying them according to different weather types to obtain data sample sets of different categories; Step S5, introducing the feature-based cross-attention mechanism into the CNN-BiGRU model, building a CNN-BiGRU-CrossAttention model, and then training the corresponding CNN-BiGRU-CrossAttention model according to data sample sets of different categories to obtain a short-term photovoltaic power prediction model; Step S6: input the future short-term meteorological data into the short-term photovoltaic power prediction model to obtain the short-term photovoltaic power prediction result.

2. A short-term photovoltaic power prediction method according to claim 1, characterized in that: After step S1, the method further includes the steps of: dimensionless processing of various meteorological data; in step S2, the meteorological characteristics having a strong correlation with photovoltaic power are obtained by calculating the Spearman correlation coefficient between the meteorological data and the photovoltaic power data.

3. A short-term photovoltaic power prediction method according to claim 1, characterized in that: In step S2, the meteorological feature data set is clustered using the ACO-optimized FCM clustering algorithm, including the following steps: Step S21, initializing the ACO algorithm and the FCM clustering algorithm; Step S22, calculating the Euclidean distance between the meteorological feature having a strong correlation with the photovoltaic power and the cluster center; Step S23, perform an iterative operation, the ants select the next cluster number according to the current pheromone concentration, use the FCM algorithm to process the cluster number to obtain the clustering result, and use the Xie_Beni index to evaluate the clustering result. The calculation formula of the Xie_Beni index is: In the formula, i and k represent the indexes of different clusters, U i Represents the distance from each data point to the center of its cluster, D ik Represents the distance between different clusters; Step S24, update the pheromone on the path, the calculation formula is: In the formula, ρ is the volatilization rate of pheromone, which controls the attenuation degree of pheromone; is the pheromone left by the mth ant; Step S25: Repeat step S23 and step S24, and continue to iterate until the convergence condition is met, so as to obtain a clustering result using the optimal number of clusters.

4. A short-term photovoltaic power prediction method according to claim 1, characterized in that: In step S3, the photovoltaic power data is decomposed using an improved singular spectrum analysis method, specifically: Assume that the photovoltaic power data is F N =(f1,f2,…,f N ), find the optimal window length L through the ACO algorithm, let K = N-L+1, and construct an L×K trajectory matrix. The trajectory matrix is ​​as follows: Perform singular value decomposition on X. The specific formula is as follows: X=USV T Where U is the left singular vector matrix; V T is a right singular vector matrix; S is a diagonal matrix; and finally L eigendecomposition vectors are decomposed.

5. A short-term photovoltaic power prediction method according to claim 4, characterized in that: The method of finding the optimal window length L by using the ACO algorithm specifically includes: Step S31, initializing the ACO algorithm and window length; Step S32, initializing pheromone for each possible window length; Step S33, selecting the next window length according to the pheromone and the heuristic information, and executing the SSA algorithm according to the selected window length to obtain the decomposition result, and then using the Spearman correlation coefficient as the objective function to evaluate the decomposed subsequence; Step S34, iteratively updating pheromone and window length; Step S35: Repeat step S33 and step S34 until the iteration ends and the optimal window length L is obtained for decomposition.

6. A short-term photovoltaic power prediction method according to claim 1, characterized in that: In step S4, the CNN layer includes a convolutional layer, an activation layer, a pooling layer and a fully connected layer connected in sequence, the BiGRU layer includes two gated recurrent units along the forward and reverse directions of the time sequence, the convolutional layer includes a two-dimensional convolutional layer, and the pooling layer includes a two-dimensional pooling layer.

7. A short-term photovoltaic power prediction method according to claim 6, characterized in that: In step S4, weather type classification is performed on the historical data samples to obtain data sample sets of different categories, specifically including: Step S41, inputting the multiple meteorological clusters and feature decomposition vectors into a CNN layer including two convolutional layers, the two convolutional layers are responsible for extracting features from the input data to obtain feature vectors; Step S42: using a maximum pooling layer to perform a pooling operation on the feature vector extracted from the convolution layer, the outputs of the two convolution layers are spliced ​​together after batch normalization in the maximum pooling layer to form a comprehensive feature representation; Step S43, inputting the comprehensive feature representation into the BiGRU layer, the BiGRU layer performs sequence modeling on the comprehensive feature representation from the positive and negative directions of the time series respectively, so as to capture the front-back dependency relationship in the time series data; In step S44, the output of the BiGRU layer is batch normalized again and then sent to the fully connected layer for transformation. At the same time, a dropout mechanism is introduced to reduce the risk of overfitting, and finally data sample sets of different categories are output.

8. A short-term photovoltaic power prediction method according to claim 6, characterized in that: In step S4, the feature-based cross-attention mechanism includes three modules: an embedding layer, a feature cross-layer and an output layer; the embedding layer encodes the strongly correlated meteorological features and photovoltaic power data into a new sequence vector, and maps it to a high-dimensional dense vector space; the feature cross-layer performs feature cross-operations on the meteorological features and their photovoltaic power, and between two meteorological features, and then uses the self-attention mechanism to calculate the correlation score to obtain a cross-feature representation that integrates the input feature information; the output layer performs batch normalization on the cross-feature representation, and then outputs the prediction result after passing through the fully connected layer.

9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps in a short-term photovoltaic power prediction method as described in any one of claims 1 to 8 are implemented.

10. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the short-term photovoltaic power prediction method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Energy prediction method and system based on large language model

    CN120218354A

  • Settlement prediction method and system fused with multi-scale optimization, terminal and storage medium

    CN120338211A

  • Photovoltaic power prediction method, device and equipment

    CN120974456A