Photovoltaic power prediction method and system based on double-current network and multiple attention

Through the photovoltaic power prediction method based on space-time dual-current network and multiple attention, the problem of insufficient accuracy of photovoltaic power prediction is solved, and the prediction accuracy and adaptability are improved through feature extraction and fusion, and are suitable for photovoltaic power prediction systems.

CN120448852APending Publication Date: 2025-08-08SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510433164.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing photovoltaic power prediction technology is insufficient in the face of the intermittent and random characteristics of solar power generation, and the single feature extraction method and inefficient feature fusion mechanism limit the performance of the model under complex space-time dependencies.

Method used

The photovoltaic power prediction method based on space-time dual-current network and multiple attention is adopted. By obtaining historical photovoltaic power generation and meteorological information, variable factor impact analysis and similar daily clustering are carried out, and feature extraction and fusion are used for double-current network and multiple attention mechanism to form a feature vector containing rich space-time information.

Benefits of technology

It improves the accuracy and robustness of photovoltaic power prediction, can show excellent prediction accuracy and adaptability under different meteorological conditions, and captures slight fluctuations and rapid changes in photovoltaic power.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448852A_ABST
    Figure CN120448852A_ABST
Patent Text Reader

Abstract

The invention provides a photovoltaic power prediction method and system based on a double-current network and multiple attention, and the method comprises the steps: obtaining historical photovoltaic generating capacity and meteorological information, and obtaining initial sample data; performing variable factor influence analysis on the initial sample data to obtain a simplified initial sample data set; performing similar daily clustering processing on the simplified initial sample data set to obtain each scene data set after clustering; providing a photovoltaic power prediction initial model based on a double-current network and multiple attention, and training the photovoltaic power prediction initial model by using each clustered scene data set to obtain a photovoltaic power prediction model; and taking the historical generating capacity and meteorological data of the target photovoltaic power station in the set time period as input data of the photovoltaic power prediction model, and outputting a photovoltaic power prediction result. According to the invention, through the clustering integration method, the clustering robustness and accuracy are improved; and through multi-dimensional feature extraction and feature fusion, the prediction accuracy is 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 prediction, and in particular to a photovoltaic power prediction method and system based on a spatiotemporal dual-stream network and multiple attentions, as well as a corresponding computer terminal and computer-readable storage medium. Background Art

[0002] With the global emphasis on renewable energy and the continuous advancement of technology, photovoltaic power generation has rapidly become a focal point for solar energy applications. Accurate photovoltaic power forecasting is crucial for enhancing system reliability and flexibility in power system planning and decision-making. However, the intermittent and fluctuating nature of solar power leads to poor stability in photovoltaic power generation, complicating grid management and making accurate photovoltaic power forecasting a bottleneck for its large-scale application.

[0003] PV power forecasting technologies are primarily categorized into physical methods and data-driven approaches. Physical methods utilize theoretical simulation models and can achieve accurate predictions under ideal conditions, but their performance is limited under variable conditions. Data-driven methods, based on historical data, such as autoregressive models, fuzzy theory, and Markov chain models, demonstrate greater adaptability but remain limited when dealing with complex and nonlinear data.

[0004] Deep learning has made significant progress in the field of photovoltaic power generation forecasting. It can automatically learn relevant features in the data, reduce dependence on knowledge, and improve the accuracy and efficiency of forecasts. This technology has strong generalization capabilities in processing time series and spatial information, but the problem of sensitivity to noise and abnormal data remains to be solved.

[0005] To mitigate the sensitivity of single models to abnormal data, hybrid models combine the strengths of different neural networks to achieve more accurate predictions for multidimensional data. While hybrid models demonstrate superior performance in time series analysis, improving sensitivity to noise and abnormal data, as well as generalization, they fail to model long-term dependencies and the focal points of different features. Furthermore, feature extraction relies too heavily on a single attention mechanism, failing to fully consider the sequential relationships between features. Consequently, subtle features in the data may be overlooked, impacting the model's accuracy and generalization.

[0006] As an important time series data modeling method, the Transformer model has been widely used in time series forecasting in recent years, but it still faces the dependency relationship between different time steps.

[0007] To address these issues, many studies have proposed improved time series prediction network structures. While these models have achieved considerable success in their respective application areas, they still suffer from some common shortcomings: First, most models rely on a single feature extraction method, failing to effectively leverage multiple models to extract diverse information from the data in parallel. Second, the lack of efficient feature fusion mechanisms results in low efficiency in integrating multiple feature information, limiting the model's performance under complex spatiotemporal dependencies.

[0008] In summary, the existing photovoltaic power prediction technology still has not solved the problem of insufficient accuracy in photovoltaic power prediction when facing the intermittent and random characteristics of solar power generation. Summary of the Invention

[0009] In response to the above-mentioned deficiencies in the prior art, the present invention provides a photovoltaic power prediction method and system based on a spatiotemporal dual-stream network and multiple attentions, and also provides a corresponding computer terminal and computer-readable storage medium.

[0010] According to one aspect of the present invention, a photovoltaic power prediction method based on a dual-stream network and multiple attention is provided, comprising:

[0011] Obtain historical photovoltaic power generation and meteorological information to obtain initial sample data;

[0012] Performing variable factor impact analysis on the initial sample data to obtain a simplified initial sample data set;

[0013] Performing similar day clustering processing on the simplified initial sample data set to obtain a clustered data set for each scene;

[0014] Providing an initial photovoltaic power prediction model based on a dual-stream network and multiple attentions, and training the initial photovoltaic power prediction model using each scene data set after clustering to obtain a photovoltaic power prediction model;

[0015] The historical power generation and meteorological data of the target photovoltaic power station within a set time period are used as input data of the photovoltaic power prediction model, and the photovoltaic power prediction result is output.

[0016] According to another aspect of the present invention, a photovoltaic power prediction system based on a dual-stream network and multiple attention is provided, comprising:

[0017] Data acquisition module, which is used to obtain historical photovoltaic power generation and meteorological information to obtain initial sample data;

[0018] A factor analysis module, which is used to perform variable factor influence analysis on the initial sample data to obtain a simplified initial sample data set;

[0019] A data clustering module, which is used to perform similar day clustering processing on the simplified initial sample data to obtain a clustered data set for each scene;

[0020] A prediction model training module, which is used to provide an initial photovoltaic power prediction model based on a dual-stream network and multiple attention, and train the initial photovoltaic power prediction model using each scene data set after clustering to obtain a photovoltaic power prediction model;

[0021] The photovoltaic power prediction module is used to use the historical power generation and meteorological data of the target photovoltaic power station within a set time period as input data of the photovoltaic power prediction model and output the photovoltaic power prediction result.

[0022] According to a third aspect of the present invention, a computer terminal is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the terminal can be used to execute the method described above in the present invention, or to execute the system described above in the present invention.

[0023] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it can be used to execute the method described above in the present invention, or to run the system described above in the present invention.

[0024] Due to the adoption of the above technical solution, the present invention has at least one of the following beneficial effects compared with the prior art:

[0025] The photovoltaic power prediction method and system based on dual-stream network and multiple attention provided by the present invention solves the limitations of the single clustering algorithm in the background technology in processing high-dimensional data through the clustering integration method, and achieves the beneficial effect of improving the robustness and accuracy of clustering.

[0026] The photovoltaic power prediction method and system based on dual-stream network and multiple attention provided by the present invention solve the problems of single feature extraction method and low feature fusion in the background technology through multi-dimensional feature extraction and feature fusion, and achieve the beneficial effect of improving prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:

[0028] Figure 1 This is a workflow diagram of a photovoltaic power prediction method based on a dual-stream network and multiple attentions in a preferred embodiment of the present invention.

[0029] Figure 2 Schematic diagram of the components of a photovoltaic power prediction system based on a dual-stream network and multiple attentions in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following is a detailed description of an embodiment of the present invention. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process. It should be noted that those skilled in the art may make various modifications and improvements without departing from the scope of the present invention, and these modifications and improvements fall within the scope of protection of the present invention.

[0031] To address the inaccuracy of photovoltaic power forecasting due to the intermittent and random nature of solar power generation, one embodiment of the present invention provides a short-term photovoltaic power forecasting method based on a dual-stream network and a multi-attention mechanism. This method leverages a spatiotemporal dual-stream network to fully exploit the spatial distribution characteristics and time series dynamics of solar power generation. It also employs an iterative cross-attention mechanism to effectively fuse independently extracted features, forming a feature vector rich in spatiotemporal information. This effectively improves the accuracy of short-term photovoltaic power forecasts, significantly outperforming existing mainstream time series forecasting techniques.

[0032] Specifically, if Figure 1 As shown, the photovoltaic power prediction method based on the dual-stream network and multiple attention provided by this embodiment may include the following operations:

[0033] S1, obtain historical photovoltaic power generation and meteorological information to obtain initial sample data;

[0034] S2, perform variable factor impact analysis on the initial sample data to obtain a simplified initial sample data set;

[0035] S3, perform similar day clustering on the simplified initial sample data to obtain the clustered dataset for each scene;

[0036] S4, provides an initial photovoltaic power prediction model based on a dual-stream network and multiple attention, and uses the clustered data sets of each scene to train the initial photovoltaic power prediction model to obtain a photovoltaic power prediction model;

[0037] S5, using the historical power generation and meteorological data of the target photovoltaic power station within a set time period as input data of the photovoltaic power prediction model, and outputting the photovoltaic power prediction result.

[0038] In some preferred embodiments, the above S1, obtaining historical photovoltaic power generation and meteorological information to obtain initial sample data, may further include:

[0039] S11, obtaining historical photovoltaic power generation and meteorological information;

[0040] S12, performing preprocessing operations such as missing value processing and outlier processing on the historical photovoltaic power generation and meteorological information, optimizing the data quality of the historical photovoltaic power generation and meteorological information and eliminating outliers, and obtaining initial sample data.

[0041] In some preferred embodiments, the above S2, performing variable factor impact analysis on the initial sample data to obtain a simplified initial sample data set, may further include:

[0042] The initial sample data were comprehensively analyzed using three correlation coefficients: Kendall, Spearman, and Pearson, to obtain the results of the impact of multiple variables on photovoltaic power generation.

[0043] According to the results of the impact of multivariate factors on photovoltaic power generation, the initial sample data is divided into key factors and secondary factors;

[0044] The minor factors in the initial sample data are eliminated to obtain a simplified initial sample data set.

[0045] Furthermore, in order to deeply understand the impact of multivariate factors on photovoltaic power generation, the preferred embodiment uses three correlation coefficients, Kendall, Spearman and Pearson, to conduct a comprehensive analysis. The correlation coefficient results are shown in Table 1.

[0046] Table 1 Correlation coefficient between power generation and meteorological characteristics

[0047]

[0048] The analysis results show that PV power is most significantly correlated with global radiation and global radiation on the slope, followed by diffuse radiation, diffuse radiation on the slope, and temperature. Wind speed, wind direction, rainfall, and humidity show relatively weak correlations. The study area is an arid tropical desert with scarce rainfall. The model prioritizes key factors such as diffuse radiation, global radiation, diffuse radiation on the slope, global radiation on the slope, and temperature, while eliminating secondary factors such as wind direction and rainfall. By simplifying the data set used as model input, prediction efficiency and accuracy can be further improved.

[0049] In some preferred embodiments, the above S3, performing similar day clustering processing on the simplified initial sample data set to obtain each scene data set after clustering, may further include:

[0050] S31, selecting a base clusterer, and performing clustering processing on the simplified initial sample data set based on the base clusterer to obtain a single clustering result;

[0051] S32, using the Hungarian algorithm to unify the classification labels of different single clustering results to obtain the aligned single clustering results;

[0052] S33, based on the aligned single clustering result, construct a co-cooperation matrix, which is used to represent the frequency of samples being assigned to the same cluster in all clustering results;

[0053] S34, using the co-correlation matrix as a similarity matrix between samples, clustering the co-correlation matrix to achieve the final clustering division of the simplified initial sample data set, and obtaining each scene data set after clustering.

[0054] In some preferred embodiments, the above S31, selecting a base clusterer, and performing clustering processing on the simplified initial sample data based on the base clusterer to obtain a single clustering result, may further include:

[0055] Base clusterers, including: K-Medoids algorithm, spectral clustering algorithm, AGNES (agglomerative nesting) algorithm and BIRCH (balanced iterative reducing and clustering using hierarchies) algorithm; among them:

[0056] S311, K-Medoids algorithm minimizes the sum of the distances from the points in the cluster to the cluster center by selecting the cluster center, as shown in formula (1):

[0057]

[0058] Where m i is the updated cluster center of the i-th cluster, C i is the i-th cluster, x is the candidate cluster center, x j Cluster C i The sample, d(x j ,x) is the distance function, calculate x j The distance from x, k is the number of clusters, d(x j ,m i ) is the distance function, calculate x j and m i distance;

[0059] S312, the spectral clustering algorithm constructs a similarity matrix and a Laplace matrix, and uses eigenvalue decomposition to extract the main eigenvectors, mapping the data point cluster information in a low-dimensional space, as shown in formula (2):

[0060] L=DW (2)

[0061] Where W is an n×n symmetric matrix, which represents the similarity between nodes, D is the degree matrix, which represents the connection strength between nodes, and L is the Laplace matrix;

[0062] S313, AGNES algorithm uses a bottom-up hierarchical clustering method to form a hierarchical structure by gradually merging the most similar clusters;

[0063] The core clustering merging formula of the AGNES algorithm is divided into the shortest distance H min , the longest distance H max and the average distance H avg , as shown in formula (3) to formula (5):

[0064]

[0065]

[0066]

[0067] Where C i ,C j is a cluster, e and f are any two points in the cluster, and dist(e,f) is a distance function used to measure the distance between e and f;

[0068] S314, the BIRCH algorithm implements data clustering by constructing and refining a clustering feature tree; wherein:

[0069] S3141, constructing cluster feature tree;

[0070] S3142, adding all samples in the simplified initial sample data to the cluster feature tree respectively, and calculating the radius of the leaf node after adding the new sample;

[0071] S3143: Based on the obtained radius of the leaf node, the sample is merged into the corresponding cluster and all cluster feature triplets on the cluster feature tree path are updated;

[0072] S3144: treating the cluster represented by each leaf node in the cluster feature tree as a data point, and performing secondary clustering to optimize the cluster feature tree;

[0073] S3145, define the simplified initial sample data as D = (x1, x2, ..., x n ), a feature subset related to photovoltaic output is screened out through feature engineering, and the selected base clusterer is used to cluster the data. Each base clusterer is set to generate m clusters, and finally different single clustering results are obtained.

[0074] In some preferred embodiments, the above S3141, constructing a cluster feature tree, may further include:

[0075] Determine the three parameters B, L, and T of the clustering feature tree; among them, B is the maximum CF number of internal nodes; L is the maximum CF number of leaf nodes; T is the maximum sample radius threshold of each CF of leaf nodes; CF = (N, L S 、S S ) represents the cluster feature triplet; N represents the number of samples in each CF; L S Represents the sum vector of the eigenvalues of the sample points in this CF; S s Indicates the sum of squares of the eigenvalues of the samples in this CF; L S and S s The calculation formulas are shown in formulas (6) and (7):

[0076]

[0077] Where: x n represents the nth sample vector; x nm represents the mth eigenvalue of the nth sample point; M represents the number of features of the data in the sample point.

[0078] In some preferred embodiments, the above S3142, adding all samples in the simplified initial sample data to the cluster feature tree and calculating the radius of the leaf node after adding the new sample, may further include:

[0079] All samples are read into the cluster feature tree in sequence, and the leaf node A closest to the new sample is found. The radius R of the leaf node A after the new sample is added is calculated. The calculation method is shown in formula (8):

[0080]

[0081] Where x n is the nth sample vector, and x0 is the initial sample vector.

[0082] In some preferred embodiments, the above S3143, based on the obtained radius of the leaf node, merging the sample into the corresponding cluster and updating all cluster feature triples on the cluster feature tree path, may further include:

[0083] S31431: If the radius of the leaf node R≤T, merge the sample into the cluster and update all cluster feature triples CF on the cluster feature tree CF-tree path, and perform the following steps:

[0084] Check from bottom to top whether the parent node needs to be split. If it needs to be split, use the leaf node splitting method until the root node;

[0085] S31432: If the radius of the leaf node R>T, perform the following steps:

[0086] Determine whether the number of CFs in leaf node A reaches the maximum L; if it is less than L, create a new CF node to store the new sample and update all CF tuples on the CF-tree path; otherwise, select the two CFs with the farthest hypersphere radius from all CF tuples in leaf node A as new leaf nodes A′ and A″ to replace the original leaf node A, and put the CF tuples in the original leaf node and the new sample tuples into the new leaf nodes A′ and A″ in order of distance.

[0087] In some preferred embodiments, the above S32, using the Hungarian algorithm to unify the classification labels of different single clustering results, may further include:

[0088] Taking the classification label of a single clustering result as the benchmark, the Hungarian algorithm is used to align the classification labels of other single clustering results.

[0089] In some preferred embodiments, the above S23, constructing a co-cooperation matrix based on the aligned single clustering result, may further include:

[0090] For a given k clustering results C1, C2, ..., C k , each element CA(i, j) of the co-correlation matrix CA is as follows:

[0091]

[0092] Where, φ k represents the label mapping function of the k-th clustering result; Ι(·) represents the indicator function, which takes the value 1 when the condition is met and 0 otherwise; CA(i,j) represents the sample x i With sample x j The frequency of being assigned to the same cluster in all clustering results, ranging from [0, 1].

[0093] In some preferred embodiments, the above S34 may further include:

[0094] The BIRCH algorithm is used to cluster the co-correlation matrix to obtain the final clustering result. The specific algorithm can be referred to the relevant steps in S314 and will not be repeated here.

[0095] In some preferred embodiments, the above S4 provides a photovoltaic power prediction model based on a dual-stream network and multiple attentions, and trains the photovoltaic power prediction model using each scene data set after clustering, and may further include:

[0096] S41, providing an initial photovoltaic power prediction model based on a dual-stream network and multiple attentions, the initial photovoltaic power prediction model based on the dual-stream network and multiple attentions comprising: multiple dual-stream network models arranged in sequence, an uncertainty head model arranged in parallel at the back end of the last dual-stream network model, and a dynamically combinable multi-head self-attention model; wherein:

[0097] The two-stream network model is used to obtain the fusion features of spatial features and temporal features in the input data;

[0098] The uncertainty head model takes the fused features as input and obtains the first PV power prediction data with uncertainty and volatility description of PV power generation;

[0099] The dynamic composable multi-head self-attention model takes the fused features as input and obtains the second photovoltaic power prediction data with attention score tensor and attention weight tensor;

[0100] The first photovoltaic power prediction data and the second photovoltaic power prediction data are combined to obtain a final photovoltaic power prediction result;

[0101] S42, after clustering, each scene data set is divided into a training set, a validation set, and a test set, and the initial photovoltaic power prediction model based on the dual-stream network is trained to obtain a final photovoltaic power prediction model for obtaining a photovoltaic power prediction result that takes into account meteorological information and photovoltaic power generation.

[0102] In some preferred embodiments, the above S41 may further include:

[0103] S411, a dual-stream network model, including: a parallel spatial stream model and a temporal stream model and a feature mixing model set at the back end of the spatial stream model and the temporal stream model.

[0104] S412, uncertainty head model, performs uncertainty analysis on the mean and variance of photovoltaic power generation, obtains the uncertainty and volatility description of photovoltaic power generation, and obtains the first photovoltaic power prediction data;

[0105] S413, a dynamic combinable multi-head self-attention model, the dynamic combinable multi-head self-attention model is used to provide an attention score tensor and an attention weight tensor to obtain the second photovoltaic power prediction data.

[0106] In some preferred embodiments, the spatial stream model in S411 may further include: a ModernTCN network and an ITransformer network; wherein:

[0107] ModernTCN network separates the mixed processing of time information and feature information by introducing decoupling design; by dividing the input data, it generates independent embedding representations as follows:

[0108] X emb =Embedding(X in )

[0109] Where: X in The input time series includes historical photovoltaic power data and related meteorological data. is a time series with M variables of length L, X emb is the embedded time series, D is the dimension of block embedding, N is the number of blocks, N=L / / S, S is the stride;

[0110] in:

[0111] The ModernTCN network is composed of multiple ModernTCN modules stacked together, each of which includes: depthwise separable convolution, ConvFFN and residual module. Depthwise separable convolution is used to extract features from input data, thereby maintaining the independence of feature information and time information variables, enabling the model to learn the dependencies of each univariate time series separately; ConvFFN modifies the dimension of the features extracted by depthwise separable convolution through decoupling, thereby obtaining the required dimension, and finally obtains the ModernTCN module through residual connection, which is expressed as:

[0112]

[0113] Where: Block(·) represents the ModernTCN module;

[0114] The ITransformer network treats the variables of a single time series as independent tags, uses the tags to capture the correlation between multiple variables through the attention mechanism, represents each variable tag in sequence through the feedforward network, and outputs the spatial flow results through the linear layer, that is, obtaining spatial features.

[0115] Furthermore, the ITransformer network applies the attention mechanism and feedforward network to the reversed dimension, that is, the time points of the individual sequences are embedded in the variable tags, and the attention mechanism uses these tags to capture the correlation between multiple variables. At the same time, the feedforward network is applied to each variable tag to learn nonlinear representations. The ITransformer does not make any modifications to the components of the Transformer. Instead, the ITransformer adopts these components and improves the architecture in the reversed dimension. The ITransformer only adopts the encoder structure of the Transformer, focusing on representation learning and adaptive relationships of multivariate sequences. Each time series driven by the underlying complex process is first tokenized to describe the characteristics of the variable, then interacts through the self-attention mechanism, and is processed separately by the feedforward network for sequence representation. However, the task of generating the sequence is handed over to the linear layer.

[0116] In some preferred embodiments, the above S411, the time flow model, may further include: a GRU network and a TimesNet network; wherein:

[0117] The GRU network regulates the flow and update of information in the network through the reset gate, update gate, and activation function. It processes input data through specific weight fusion and activation function to generate output values. The formula is as follows:

[0118]

[0119] Where, is the weight matrix, h t-1 is the hidden state of the previous moment, α represents the Sigmoid activation function, u t represents the output of the update gate, i t The input at the current moment.

[0120] The reset gate (RG) in GRU t It determines which previous information will be passed to the update gate (UG), which operates according to the mathematical expression shown below:

[0121]

[0122] Where, is the weight matrix;

[0123] In addition, a specific memory content is used to store information and the weight is processed through the tanh activation function. The mathematical equation of the memory content is as follows:

[0124] m' r =tanh[(w1×i t )+w2×(rt hh t-1 )]

[0125] Where m′ r represents the memory content, tanh[·] represents the tanh function, w * represents the weight matrix.

[0126] Finally, element-by-element summation and multiplication operations are used to calculate the memory content of the current timestamp. The formula is as follows:

[0127] h t =(u t ·h t-1 +(1-u t )·m' r )

[0128] Where h t Indicates the current output, u t Represents the output of the update gate.

[0129] The TimesNet network is used to transform one-dimensional time series into two-dimensional feature representations, capturing the complex changes within and between cycles in the data;

[0130] First, we use the Fast Fourier Transform to identify the main frequency components in the data and determine the most significant periodicity, obtaining:

[0131]

[0132] Where: represents a one-dimensional input time series, represents the calculated amplitude at each frequency, f k represents the kth frequency value, represents the kth period length, and Period(·) represents the periodic information of the time series extracted based on Fourier transform;

[0133] On this basis, the one-dimensional input time series is reorganized into a two-dimensional tensor by padding and reshaping, where each tensor corresponds to a different period transformation, resulting in:

[0134]

[0135] Where: represents the two-dimensional tensor after the i-th transformation, Reshape(·) represents the data reshaping process, Padding(·) represents the zero extension of the time series, d model Represents the feature dimension in the model;

[0136] Each two-dimensional tensor is passed through the Inception neural network to capture the corresponding multi-scale time changes, and the obtained two-dimensional feature representation is:

[0137]

[0138] Where: Represents the learned feature two-dimensional tensor;

[0139] The two-dimensional feature representations of different periods are integrated through an adaptive aggregation mechanism and weighted according to their respective amplitudes to reflect the relative importance of information from different periods, resulting in:

[0140]

[0141] Where: represents the amplitude after softmax normalization, represents the amplitude obtained by Fourier transform, represents the one-dimensional tensor after the l-th layer aggregation, Represents the one-dimensional tensor after the i-th transformation

[0142] In some preferred embodiments, the feature fusion model in S411 above adopts a bimodal feature fusion model to fuse spatial features and temporal features in a structured manner; wherein:

[0143] The dual-modal feature fusion model includes: a spatial feature reduction model, an iterative cross-modal feature enhancement model, and a NIN fusion model; among which:

[0144] The spatial feature reduction model uses average pooling and maximum pooling of adaptive aggregation to perform feature compression processing on the features obtained from the spatial stream and temporal stream, which can be expressed as:

[0145] F O =λ·F a +(1-λ)·F m

[0146] Where: λ represents the weight between 0 and 1, F O Represents the feature map after adaptive aggregation, F a represents the feature map after average pooling, F m Represents the feature map after maximum pooling;

[0147] The iterative cross-modal feature enhancement model is based on the cross-modal feature enhancement algorithm and introduces an iterative learning strategy to increase network depth without increasing parameters. The cross-modal feature enhancement algorithm flattens the input feature map obtained by the spatial feature reduction model and incorporates position embedding to encode inter-modal information. It constructs a correlation matrix and normalizes the features using the softmax function. The results are remapped to the original dimension through a nonlinear transformation to obtain the result of feature fusion, which is expressed as:

[0148] T′T =α·Z T W O +β·T T

[0149]

[0150] Where: T T ′ represents the output tensor obtained by nonlinearization and residual connection, T T represents the input tensor, represents the enhanced features, Z T Represents the feature matrix after the softmax function, W O represents the output weight matrix, FFN represents the feedforward network, and α, β, γ, and δ represent learnable parameters initialized to 1.

[0151] In some preferred embodiments, the above S412, establishing the uncertain head model, may further include:

[0152] The normal inverse gamma distribution is used to model the uncertainty of the mean and variance of photovoltaic power generation; where:

[0153] Assume that the mean μ of photovoltaic power generation data obeys the parameters γ and σ 2 ν (-1) The Gaussian distribution of the photovoltaic power generation data is followed by the standard deviation σ of the inverse gamma distribution with parameters α and β, where α, β, γ and ν are hyperparameters. The probability function of the normal inverse gamma distribution describes μ and σ. 2 The interdependence of PV power generation data is expressed by σ 2 The uncertainty of PV power prediction is measured by the expectation of μ, and the uncertainty of PV power prediction is measured by the variance of μ, which is expressed as:

[0154]

[0155] Where, P(μ,σ 2 |α,β,γ,v) denotes the joint probability density function, Γ(·) denotes the gamma function;

[0156] The loss function L for establishing the uncertainty head model is a weighted combination of the negative log-likelihood function and the regularization term, expressed as:

[0157] L=L NLL +λL R

[0158] Where: L NLL Represents the negative log-likelihood function, focusing on the fitting of data, L R represents the uncertainty of the corresponding error distribution, and λ represents the learning parameter that can be changed during training.

[0159] In some preferred embodiments, the above S413, establishing a dynamic combinable multi-head self-attention model, may further include:

[0160] A Compose function driven by a trainable parameter θ is introduced into the multi-head attention mechanism to construct a dynamic composable multi-head self-attention;

[0161] The Compose function is used before and after the softmax function to implement the attention score tensor A S and the attention weight tensor A W A dual operation on , transforming the input vector Q i and K j The attention vector A ij A is the new vector i ' j , expressed as:

[0162] A ij ′=Compose(A ij ,Q i ,K j ;θ)

[0163] The Compose function integrated into the multi-head attention mechanism provides dual operations on the attention score tensors before and after softmax and on the attention weight tensors;

[0164] Among them, the input vector Q i and K j is the fusion feature output by the two-stream network model, Q i is the query vector, K j is the key vector;

[0165] The working mechanism of the constructed dynamic composable multi-head self-attention model is expressed as:

[0166]

[0167]

[0168] A S =Compose(A S ,Q,K;θ pre )

[0169] A W =Softmax(A S ,dim=-1)

[0170] A W =Compose(A W ,Q,K;θ post )

[0171]

[0172] O=Concat(O1,O2,...,O H )W O

[0173] Where: represents the attention head weight matrix, Q represents the query matrix, K represents the key matrix, and D h represents the scaling factor, T represents the transpose, and A S represents the attention weight matrix, Stack(·) represents the stacking process, H represents the number of attention heads, Compose(·) represents the Compose function process, θ pre Indicates that the parameter θ introduced by the Compose function is applied before the softmax function. Softmax(·) represents the activation function. A W Represents the attention weight matrix after softmax function processing, dim=-1 represents the last dimension, θ post It means that the parameter θ introduced by the Compose function is applied after the softmax function. i Represents the final output of the i-th head, represents the weight matrix of the i-th attention head, V represents the value matrix, O represents the final output tensor, Concat(·) represents the concatenation operation, and W O Represents the output projection matrix, W i Q 、W i K and W i V Represents the projection matrix of the i-th head.

[0174] Furthermore, in the above S412 and S413, the uncertainty head model and the dynamic combinable multi-head self-attention model both obtain prediction data, but the data accuracy is different. For example, when the fluctuation is very small, the accuracy of the uncertainty head may be better, and the dynamic combinable multi-head self-attention model is slightly less accurate. When the fluctuation is large, the dynamic combinable multi-head self-attention model is better, and the accuracy of the uncertainty head is slightly less accurate.

[0175] In some preferred embodiments, the above S42 may further include:

[0176] S421, using a sliding window to select time series input and prediction labels for the clustered data set;

[0177] S422, using the prediction label, based on the time series input, predicting the data of the next set time, capturing the spatiotemporal dependency in the clustered data set, and expanding each scene data set after clustering.

[0178] In some preferred embodiments, the above S5, based on the photovoltaic power prediction model, takes the historical photovoltaic power data and related meteorological information of the target photovoltaic power station within the set time period as the input data of the photovoltaic power prediction model, obtains the corresponding fusion features of spatial features and time features through multiple dual-stream network models, obtains the first type of photovoltaic power prediction data through the uncertainty head model using the fusion features, and obtains the second type of photovoltaic power prediction data through the dynamic combinable multi-head self-attention model using the fusion features; the above two types of photovoltaic power prediction data are combined to output the final photovoltaic power prediction result of photovoltaic power generation taking into account meteorological information.

[0179] Based on the same inventive concept, an embodiment of the present invention further provides a photovoltaic power prediction system based on a dual-stream network and multiple attentions.

[0180] Specifically, if Figure 2 As shown, the photovoltaic power prediction system based on the dual-stream network and multiple attention provided by this embodiment may include the following operations:

[0181] Data acquisition module, which is used to obtain historical photovoltaic power generation and meteorological information to obtain initial sample data;

[0182] Factor analysis module, which is used to analyze the influence of variable factors on the initial sample data to obtain a simplified initial sample data set;

[0183] Data clustering module, which is used to perform similar day clustering processing on the simplified initial sample data to obtain the clustered data set for each scene;

[0184] The prediction model training module is used to provide an initial photovoltaic power prediction model based on a dual-stream network and multiple attention. The initial photovoltaic power prediction model is trained using each scene data set after clustering to obtain a photovoltaic power prediction model.

[0185] The photovoltaic power prediction module is used to use the historical power generation and meteorological data of the target photovoltaic power station within a set time period as input data of the photovoltaic power prediction model and output the photovoltaic power prediction result.

[0186] It should be noted that the steps in the method provided by the present invention can be implemented using corresponding modules, devices, units, etc. in the system. Those skilled in the art can refer to the technical solution of the method to implement the composition of the system, that is, the embodiments in the method can be understood as preferred examples of constructing the system, which will not be elaborated here.

[0187] An embodiment of the present invention further provides a computer terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the processor can be used to execute any one of the methods described in the foregoing embodiments of the present invention, or to execute any one of the systems described in the foregoing embodiments of the present invention.

[0188] Optionally, the memory is used to store programs; the memory may include volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviated: RAM), such as static random-access memory (English: static random-access memory, abbreviated: SRAM), double data rate synchronous dynamic random access memory (English: Double Data Rate Synchronous Dynamic Random Access Memory, abbreviated: DDR SDRAM), etc.; the memory may also include non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory). The memory is used to store computer programs (such as applications, functional modules, etc. that implement the above-mentioned methods), computer instructions, etc., and the above-mentioned computer programs, computer instructions, etc. can be partitioned and stored in one or more memories. In addition, the above-mentioned computer programs, computer instructions, data, etc. can be called by the processor.

[0189] The processor is configured to execute the computer program stored in the memory to implement the various steps of the method or various modules of the system involved in the above embodiments. For details, please refer to the relevant descriptions in the above method and system embodiments.

[0190] The processor and memory can be independent structures or integrated structures. When the processor and memory are independent structures, the memory and processor can be coupled via a bus.

[0191] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it can be used to execute any method of the above embodiments of the present invention, or to run any system of the above embodiments of the present invention.

[0192] Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of computer programs from one location to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. Alternatively, the ASIC can be located in a user device. Of course, the processor and storage medium can also exist as discrete components in a communication device.

[0193] The photovoltaic power prediction method and system based on a dual-stream network and multiple attention provided by the above-mentioned embodiments of the present invention exhibit excellent performance under various meteorological conditions: on clear days, they can accurately capture and predict small fluctuations in photovoltaic power, demonstrating remarkable prediction accuracy and adaptability; under cloudy conditions, they exhibit good generalization capabilities, accurately tracking rapid changes in photovoltaic power; and under low irradiance conditions on rainy days, they maintain stable prediction performance, fully demonstrating the robustness of the model. These characteristics demonstrate that the photovoltaic power prediction method and system provided by the above-mentioned embodiments of the present invention are adaptable to photovoltaic power prediction under various complex meteorological conditions.

[0194] Matters not mentioned in the above embodiments of the present invention are well known in the art.

[0195] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various variations or modifications within the scope of the claims, which do not affect the essence of the present invention.

Claims

1. A photovoltaic power prediction method based on dual-stream network and multiple attention, characterized in that: include: Obtain historical photovoltaic power generation and meteorological information to obtain initial sample data; Performing variable factor impact analysis on the initial sample data to obtain a simplified initial sample data set; Performing similar day clustering processing on the simplified initial sample data set to obtain a clustered data set for each scene; Providing an initial photovoltaic power prediction model based on a dual-stream network and multiple attentions, and training the initial photovoltaic power prediction model using each scene data set after clustering to obtain a photovoltaic power prediction model; The historical power generation and meteorological data of the target photovoltaic power station within a set time period are used as input data of the photovoltaic power prediction model, and the photovoltaic power prediction result is output.

2. The photovoltaic power prediction method based on dual-stream network and multiple attention according to claim 1 is characterized in that: The acquisition of historical photovoltaic power generation and meteorological information to obtain initial sample data includes: Obtain historical photovoltaic power generation and meteorological information; The historical photovoltaic power generation and meteorological information are preprocessed to optimize the data quality of the historical photovoltaic power generation and meteorological information and eliminate outliers to obtain initial sample data.

3. The photovoltaic power prediction method based on dual-stream network and multiple attention according to claim 1 is characterized in that: The performing of variable factor influence analysis on the initial sample data to obtain a simplified initial sample data set includes: The initial sample data were comprehensively analyzed using the Kendall, Spearman, and Pearson correlation coefficients to obtain the impact of multiple variables on photovoltaic power generation. According to the influence of the multivariate factors on photovoltaic power generation, the initial sample data is divided into key factors and secondary factors; Minor factors in the initial sample data are eliminated to obtain a simplified initial sample data set.

4. The photovoltaic power prediction method based on dual-stream network and multiple attention according to claim 1 is characterized in that: The simplified initial sample data set is subjected to similar day clustering processing to obtain each scene data set after clustering, including: Selecting a base clusterer, and performing clustering processing on the simplified initial sample data set based on the base clusterer to obtain a single clustering result; The Hungarian algorithm is used to unify the classification labels of different single clustering results to obtain the aligned single clustering results; Based on the aligned single clustering result, a co-cooperation matrix is constructed, which is used to represent the frequency of samples being assigned to the same cluster in all clustering results; The co-correlation matrix is used as a similarity matrix between samples, and the co-correlation matrix is clustered to achieve the final clustering division of the simplified initial sample data set, thereby obtaining each scene data set after clustering.

5. The photovoltaic power prediction method based on dual-stream network and multiple attention according to claim 1 is characterized in that: The method provides an initial photovoltaic power prediction model based on a dual-stream network and multiple attentions, and trains the initial photovoltaic power prediction model using each scene data set after clustering to obtain a photovoltaic power prediction model, including: A photovoltaic power prediction initial model based on a dual-stream network and multiple attentions is provided. The photovoltaic power prediction initial model based on the dual-stream network and multiple attentions includes: multiple dual-stream network models arranged in sequence, an uncertainty head model and a dynamic combinable multi-head self-attention model arranged in parallel at the back end of the last dual-stream network model; wherein: the dual-stream network model is used to obtain a fusion feature of spatial features and temporal features in input data; the uncertainty head model uses the fusion feature as input to obtain a first type of photovoltaic power prediction data having a description of the uncertainty and volatility of photovoltaic power generation; the dynamic combinable multi-head self-attention model uses the fusion feature as input to obtain a second type of photovoltaic power prediction data having an attention score tensor and an attention weight tensor; and the first photovoltaic power prediction data and the second photovoltaic power prediction data are combined to obtain a final photovoltaic power prediction result. After clustering, each scene data set is divided into a training set, a validation set, and a test set. The initial photovoltaic power prediction model based on the dual-stream network is trained to obtain a final photovoltaic power prediction model, which is used to obtain a photovoltaic power prediction result that takes into account meteorological information and photovoltaic power generation.

6. The photovoltaic power prediction method based on dual-stream network and multiple attention according to claim 5 is characterized in that: The dual-stream network model includes: a parallel spatial stream model and a temporal stream model and a feature mixing model provided at the back end of the spatial stream model and the temporal stream model; The uncertainty head model performs uncertainty analysis on the mean and variance of photovoltaic power generation, obtains uncertainty and volatility description of photovoltaic power generation, and obtains the first photovoltaic power prediction data; The dynamic combinable multi-head self-attention model is used to obtain the attention score tensor and attention weight tensor of photovoltaic power generation, and obtain the second photovoltaic power prediction data.

7. The photovoltaic power prediction method based on dual-stream network and multiple attention according to claim 5, characterized in that: Also includes: Using a sliding window to select time series input and prediction labels for each scene data set after clustering; The prediction labels are used to predict data at the next set time based on the time series input, so as to capture the spatiotemporal dependency in each scene data set after clustering, and to expand each scene data set after clustering.

8. A photovoltaic power prediction system based on dual-stream network and multiple attention, characterized in that: include: Data acquisition module, which is used to obtain historical photovoltaic power generation and meteorological information to obtain initial sample data; A factor analysis module, which is used to perform variable factor influence analysis on the initial sample data to obtain a simplified initial sample data set; A data clustering module, which is used to perform similar day clustering processing on the simplified initial sample data to obtain a clustered data set for each scene; A prediction model training module, which is used to provide an initial photovoltaic power prediction model based on a dual-stream network and multiple attention, and train the initial photovoltaic power prediction model using each scene data set after clustering to obtain a photovoltaic power prediction model; The photovoltaic power prediction module is used to use the historical power generation and meteorological data of the target photovoltaic power station within a set time period as input data of the photovoltaic power prediction model and output the photovoltaic power prediction result.

9. A computer terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When executing the computer program, the processor can be used to perform the method according to any one of claims 1 to 7, or run the system according to claim 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it can be used to perform the method according to any one of claims 1 to 7, or to run the system according to claim 8.

Citation Information

Cited By

  • Ultra-short-term photovoltaic output prediction method based on bimodal weather typing

    CN120833075A

  • Photovoltaic power prediction method, device and equipment

    CN120974456A