Photovoltaic power prediction model training method, photovoltaic power prediction method and system

By decomposing, correcting errors, extracting and clustering photovoltaic power data, and performing sequence prediction with sub-models of different complexity categories, and iteratively optimizing model parameters, the problem of poor accuracy of photovoltaic power prediction in the existing technology is solved, and more efficient photovoltaic power prediction is achieved.

CN119830047APending Publication Date: 2025-04-15SHENZHEN POLYTECHNIC

Patent Information

Application Number
CN202411772577.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the prior art, the accuracy of photovoltaic power prediction is poor, making it difficult to effectively process non-stationary photovoltaic data, resulting in many difficulties in power systems in demand response, economic scheduling and power grid management.

Method used

By decomposing and error correction of the sample photovoltaic power data sequence of the sample photovoltaic system, multiple sample subsequences of different modes are obtained; feature extraction and clustering are performed on each sample subsequence to obtain grouping categories; sequence prediction is performed on the sample subsequences under each grouping category based on the submodel in the initial prediction model, and the prediction data of multiple subsequences are combined to obtain photovoltaic power prediction data; finally, the model parameters are iteratively optimized to obtain the photovoltaic power prediction model.

Benefits of technology

It effectively improves the accuracy and reliability of photovoltaic power prediction, significantly improves the processing capability of non-stationary photovoltaic data, and enhances the accuracy, reliability and stability of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830047A_ABST
    Figure CN119830047A_ABST
Patent Text Reader

Abstract

The invention provides a photovoltaic power prediction model training method and a photovoltaic power prediction method and system, and the method comprises the steps: carrying out the decomposition and error correction of a sample photovoltaic power data sequence, and obtaining a plurality of sample subsequences of different modes; performing feature extraction on each sample sub-sequence, and clustering each sample sub-sequence according to the feature matrix of each sample sub-sequence; based on a sub-model corresponding to each group category in the initial prediction model, performing sequence prediction on the sample subsequences under each group category to obtain sequence prediction data of the sample subsequences under each group category in the next time period; and combining the sequence prediction data of the next period of time of the plurality of sample subsequences to obtain photovoltaic power prediction data and a photovoltaic power label, carrying out iterative optimization on the initial prediction model to obtain a photovoltaic power prediction model, and carrying out photovoltaic power prediction based on the photovoltaic power prediction model. According to the invention, the accuracy and reliability of photovoltaic power prediction are effectively 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, and in particular to a photovoltaic power prediction model training method, a photovoltaic power prediction method and a system. Background Art

[0002] Photovoltaic power generation is a clean, efficient and renewable energy source that has been rapidly developed and widely used in recent years. However, since photovoltaic power generation is affected by many factors such as solar radiation, weather conditions, and geographical location, the power output has significant volatility and uncertainty. In particular, the non-stationarity of the data has brought great challenges to the stable operation of the power system. These volatility and uncertainty make the power system face many difficulties in demand response, economic dispatch and grid management. Therefore, improving the accuracy of photovoltaic power prediction has become the key to ensuring the stability of the power grid and improving the efficiency of photovoltaic power utilization.

[0003] At present, photovoltaic power prediction methods mainly include physical methods and statistical methods. Among them, the physical method is based on solar radiation and physical models, and has good interpretability, but has high requirements for input data; the statistical method is based on historical data and uses mathematical models to capture the laws in the data. It has strong flexibility, but has limited processing capabilities for non-stationary data such as photovoltaic data. Therefore, it is difficult to effectively achieve accurate prediction of photovoltaic power. Summary of the invention

[0004] The present invention provides a photovoltaic power prediction model training method, a photovoltaic power prediction method and a system, which are used to solve the defect of poor precision of photovoltaic power prediction in the prior art and improve the accuracy and reliability of photovoltaic power prediction.

[0005] The present invention provides a photovoltaic power prediction model training method, comprising: Decomposing and error-correcting a sample photovoltaic power data sequence of a sample photovoltaic system to obtain a plurality of sample subsequences of different modes; Extracting features from each of the sample subsequences, and clustering each of the sample subsequences according to a feature matrix of each of the sample subsequences to obtain a grouping category for each of the sample subsequences; Based on the sub-models corresponding to the respective grouping categories in the initial prediction model, sequence prediction is performed on the sample sub-sequences under the respective grouping categories to obtain sequence prediction data for the next time period of the sample sub-sequences under the respective grouping categories; The sequence prediction data of the next time period of multiple sample subsequences are combined to obtain the photovoltaic power prediction data of the next time period of the sample photovoltaic power data sequence, and the model parameters of the initial prediction model are iteratively optimized according to the photovoltaic power prediction data and the photovoltaic power label of the next time period of the sample photovoltaic power data sequence to obtain the photovoltaic power prediction model.

[0006] According to a photovoltaic power prediction model training method provided by the present invention, the sample photovoltaic power data sequence of the sample photovoltaic system is decomposed and error corrected to obtain a plurality of sample subsequences of different modes, including: According to the Gaussian smoothing algorithm, a variational optimization problem corresponding to the sample photovoltaic power data sequence is established; Based on the Lagrangian penalty factor and the Lagrangian multiplication operator, the variational optimization problem is optimized and solved to obtain a plurality of initial subsequences of different modes; calculating an error between a combined sequence of the initial subsequences of a plurality of different modes and the sample photovoltaic power data sequence; The initial subsequence of each mode is corrected according to the error to obtain the sample subsequence of each mode.

[0007] According to a photovoltaic power prediction model training method provided by the present invention, the feature extraction of each sample subsequence includes: Based on fast Fourier transform, frequency components of each of the sample subsequences are calculated, and peak values ​​of the frequency components are extracted to obtain frequency characteristics of each of the sample subsequences; Calculating the sum of squares of signal strengths of each of the sample subsequences to obtain energy characteristics of each of the sample subsequences; Calculating the sample entropy of each of the sample subsequences to obtain the information entropy feature of each of the sample subsequences; Calculating the maximum peak value in the autocorrelation function of each of the sample subsequences to obtain the autocorrelation feature of each of the sample subsequences; A feature matrix of each of the sample subsequences is constructed according to the frequency feature, the energy feature, the information entropy feature and the autocorrelation feature.

[0008] According to a photovoltaic power prediction model training method provided by the present invention, the grouping category includes a first grouping category or a second grouping category, the data complexity corresponding to the first grouping category is higher than the data complexity corresponding to the second grouping category; the sub-model corresponding to the first grouping category is a convolution-unstructured converter model, and the sub-model corresponding to the second grouping category is a convolution-frequency enhanced decomposition converter model; The method of performing sequence prediction on the sample subsequences under each of the grouping categories based on the submodels corresponding to each of the grouping categories in the initial prediction model to obtain sequence prediction data for the next time period of the sample subsequences under each of the grouping categories includes: Based on the convolution-unstructured transformer model, performing sequence prediction on the sample subsequences under the first grouping category to obtain sequence prediction data for the next time period of the sample subsequences under the first grouping category; Based on the convolution-frequency enhancement decomposition transformer model, sequence prediction is performed on the sample subsequence under the second grouping category to obtain sequence prediction data of the next time period of the sample subsequence under the second grouping category.

[0009] According to a photovoltaic power prediction model training method provided by the present invention, based on the convolution-unstructured converter model, sequence prediction is performed on the sample subsequence under the first grouping category to obtain sequence prediction data for the next time period of the sample subsequence under the first grouping category, including: For any sample subsequence under the first grouping category, based on the convolution module in the convolution-unstructured transformer model, perform a convolution operation on the sample subsequence to obtain the spatiotemporal features of the sample subsequence; Based on the standardization module in the convolution-unstructured transformer model, the spatiotemporal features are standardized to obtain standardized features; Based on the embedding module in the convolution-unstructured transformer model, the position data, time data and weather data corresponding to the sample subsequence are applied to perform embedding coding to obtain embedding features; Based on the encoding module in the convolution-unstructured transformer model, applying the standardized features and the embedded features to perform encoding of the destabilized self-attention mechanism to obtain encoding features; Based on the decoding module in the convolution-unstructured transformer model, the encoding feature and the sample subsequence are applied to perform decoding to obtain a decoding feature; Based on the de-normalization module in the convolution-unstructured transformer model, the decoded features are de-normalized to obtain sequence prediction data for the next time period of the sample subsequence; Each sample subsequence under the first grouping category is traversed to obtain sequence prediction data of the next time period of each sample subsequence under the first grouping category.

[0010] According to a photovoltaic power prediction model training method provided by the present invention, based on the convolution-frequency enhancement decomposition converter model, sequence prediction is performed on the sample subsequence under the second grouping category to obtain sequence prediction data for the next time period of the sample subsequence under the second grouping category, including: For any sample subsequence under the second grouping category, based on the convolution module in the convolution-frequency enhancement decomposition transformer model, perform a convolution operation on the sample subsequence to obtain the spatiotemporal features of the sample subsequence; Based on the encoding module in the convolution-frequency enhancement decomposition transformer model, a frequency enhancement method is applied to perform frequency domain conversion on the spatiotemporal features to obtain frequency domain conversion features, and hybrid expert learning is applied to decompose the frequency domain conversion feature data to obtain a periodic component and a trend component; Based on the decoding module in the convolution-frequency enhancement decomposition transformer model, the periodic component and the trend component are applied to perform decoding to obtain sequence prediction data for the next period of the sample subsequence; Each sample subsequence under the second grouping category is traversed to obtain sequence prediction data of the next time period of each sample subsequence under the second grouping category.

[0011] According to a photovoltaic power prediction model training method provided by the present invention, the photovoltaic power prediction data and the photovoltaic power label of the next period of the sample photovoltaic power data sequence are used to iteratively optimize the model parameters of the initial prediction model to obtain the photovoltaic power prediction model, including: Obtaining a target loss function according to an error between the photovoltaic power prediction data and the photovoltaic power label of the next period of the sample photovoltaic power data sequence; According to the target loss function, the model parameters of the initial prediction model are Bayesian optimized until the performance index value of the trained initial prediction model reaches a preset value; The photovoltaic power prediction model is constructed according to the trained initial prediction model whose performance indicator value reaches the preset value.

[0012] The present invention also provides a photovoltaic power prediction method, comprising: Decomposing and error-correcting the historical photovoltaic power data sequence of the photovoltaic system to be tested in the historical period, and obtaining multiple target subsequences of different modes; Extracting features from each of the target subsequences, and clustering each of the target subsequences according to a feature matrix of each of the target subsequences to obtain a grouping category for each of the target subsequences; Based on the prediction sub-models corresponding to each of the grouping categories in the photovoltaic power prediction model, sequence prediction is performed on the target sub-sequences under each of the grouping categories to obtain sequence prediction data of the current time period of the target sub-sequences under each of the grouping categories, and the sequence prediction data of the current time period of multiple target sub-sequences are combined to obtain photovoltaic power prediction data of the current time period of the photovoltaic system to be tested; Wherein, the photovoltaic power prediction model is trained based on any of the photovoltaic power prediction model training methods described above.

[0013] The present invention also provides a photovoltaic power prediction system, comprising: A decomposition unit is used to decompose and correct errors of a historical photovoltaic power data sequence of a historical period of the photovoltaic system to be tested, and obtain target subsequences of multiple different modes; A clustering unit, used to extract features from each of the target subsequences, and cluster each of the target subsequences according to a feature matrix of each of the target subsequences to obtain a grouping category for each of the target subsequences; A prediction unit, configured to perform sequence prediction on target subsequences under each of the grouping categories based on the prediction submodels corresponding to each of the grouping categories in the photovoltaic power prediction model, obtain sequence prediction data of the current time period of the target subsequences under each of the grouping categories, and combine the sequence prediction data of the current time period of multiple target subsequences to obtain photovoltaic power prediction data of the current time period of the photovoltaic system to be tested; Wherein, the photovoltaic power prediction model is trained based on any of the photovoltaic power prediction model training methods described above.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the photovoltaic power prediction model training method described in any one of the above-mentioned methods, or the photovoltaic power prediction method described in any one of the above-mentioned methods are implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the photovoltaic power prediction model training method described in any one of the above or the photovoltaic power prediction method described in any one of the above is implemented.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the photovoltaic power prediction model training methods described above, or any of the photovoltaic power prediction methods described above.

[0017] The photovoltaic power prediction model training method, photovoltaic power prediction method and system provided by the present invention decompose and correct the sample photovoltaic power data sequence of the sample photovoltaic system to obtain multiple sample subsequences of different modes; extract features from each sample subsequence, cluster each sample subsequence according to the feature matrix of each sample subsequence, and obtain the grouping category of each sample subsequence; based on the submodels corresponding to each grouping category in the initial prediction model, respectively perform sequence prediction on the sample subsequences under each grouping category to obtain the sequence prediction data of the next time period of the sample subsequences under each grouping category; combine the sequence prediction data of the next time period of multiple sample subsequences to obtain the photovoltaic power prediction data of the next time period of the sample photovoltaic power data sequence; according to the photovoltaic power prediction data and the photovoltaic power label of the next time period of the sample photovoltaic power data sequence, iteratively optimize the model parameters of the initial prediction model to obtain the photovoltaic power prediction model, thereby combining the advantages of data decomposition and error correction, and the data processing advantages of the submodels corresponding to the sequences of different complexity categories, and combining photovoltaic power prediction, effectively improving the processing capability of non-stationary photovoltaic data, so that the accuracy, reliability and stability of photovoltaic power prediction are significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 This is one of the flow charts of the photovoltaic power prediction model training method provided by the present invention.

[0020] Figure 2 This is the second flow chart of the photovoltaic power prediction model training method provided by the present invention.

[0021] Figure 3 It is a structural schematic diagram of the convolution-unstructured transformer model provided by the present invention.

[0022] Figure 4 It is a structural schematic diagram of the convolution-frequency enhancement decomposition transformer model provided by the present invention.

[0023] Figure 5 It is a distribution diagram of the comparison results of the prediction performances corresponding to different algorithms under sunny conditions provided by the present invention.

[0024] Figure 6It is a distribution diagram of comparison results of prediction performances corresponding to different algorithms under cloudy conditions provided by the present invention.

[0025] Figure 7 It is a distribution diagram of the comparison results of the prediction performances corresponding to different algorithms under extreme weather conditions provided by the present invention.

[0026] Figure 8 It is a flow chart of the photovoltaic power prediction method provided by the present invention.

[0027] Fig. 9 It is a structural schematic diagram of the photovoltaic power prediction system provided by the present invention.

[0028] Fig.10 It is a structural schematic diagram of the electronic device provided by the present invention.

[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] Photovoltaic power generation is a clean, efficient and renewable energy source that has been rapidly developed and widely used in recent years. However, since photovoltaic power generation is affected by many factors such as solar radiation, weather conditions, and geographical location, the power output has significant volatility and uncertainty. In particular, the non-stationarity of the data has brought great challenges to the stable operation of the power system. These volatility and uncertainty make the power system face many difficulties in demand response, economic dispatch and grid management. Therefore, improving the accuracy of photovoltaic power prediction has become the key to ensuring the stability of the power grid and improving the efficiency of photovoltaic power utilization.

[0031] At present, photovoltaic power prediction methods mainly include physical methods, statistical methods and integrated methods, each with different characteristics and application scenarios. The physical method is based on solar radiation and physical models, and has good interpretability, but has high requirements for input data; the statistical method is based on historical data and uses mathematical models to capture the laws in the data. It has strong flexibility, but its processing ability for non-stationary data is limited, and it is difficult to effectively achieve accurate prediction of photovoltaic power; the combined method uses different models in different prediction stages to complement each other's advantages, but its processing ability for such non-stationary data is limited, so it is also difficult to effectively achieve accurate prediction of photovoltaic power.

[0032] At present, the research focus of photovoltaic power prediction is on how to better deal with the non-stationarity of data and fully consider the various complex factors affecting photovoltaic power generation to improve the accuracy and reliability of prediction.

[0033] In this regard, the present application provides a photovoltaic power prediction model training method, a photovoltaic power prediction method and a system, which combine the prediction models corresponding to sequences of different complexity categories to perform photovoltaic power prediction, thereby improving the accuracy and reliability of photovoltaic power prediction, and effectively solving the problems of large input data requirements, strong non-stationarity, and inaccurate prediction results in the prior art.

[0034] It should be noted that the photovoltaic power prediction provided by the present application can be used for photovoltaic power prediction scenarios of various time scales, including but not limited to ultra-short-term prediction scenarios, short-term prediction scenarios, medium-term prediction scenarios and long-term prediction scenarios, which are not specifically limited in this embodiment. Among them, the short-term (several hours to a day) prediction scenario is particularly important and directly affects the real-time dispatch of the power grid, market transaction decisions, and operation and maintenance management of photovoltaic power stations. The difficulty of short-term prediction lies in dealing with highly random and changeable non-stationary data. The complexity and randomness of these data make the prediction task challenging. Therefore, in order to simplify the description, this application takes the short-term prediction scenario as an example to describe the photovoltaic power prediction model training method and photovoltaic power prediction method provided in this application.

[0035] Figure 1 is one of the flow charts of the photovoltaic power prediction model training method provided by the present invention; Figure 1 As shown, the method includes step 110 , step 120 , step 130 and step 140 .

[0036] Step 110 , decomposing and error correcting the sample photovoltaic power data sequence of the sample photovoltaic system to obtain a plurality of sample subsequences of different modes.

[0037] The sample photovoltaic power data series here refers to a data series formed by the original photovoltaic power of the sample photovoltaic system at multiple different historical moments.

[0038] Figure 2 This is the second flow chart of the photovoltaic power prediction model training method provided by the present invention.

[0039] like Figure 2As shown in the figure, since photovoltaic power is affected by a variety of environmental factors, such as solar radiation, temperature, cloud changes, etc., its data often presents complexity and volatility. In order to more accurately predict photovoltaic power generation, during the model training process, the sample photovoltaic power data sequence can be first decomposed to decompose the sample photovoltaic power data sequence into multiple initial subsequences with different characteristics and frequencies, so as to effectively isolate the complex patterns and noise in the sample photovoltaic power data sequence and improve the predictability of the sample photovoltaic power data sequence; at the same time, the initial subsequences of multiple different modes obtained by decomposition can also be error corrected, so that the error between the combined sequence of the corrected sample subsequences of multiple different modes and the sample photovoltaic power data sequence is limited to a certain range, thereby improving the accuracy of data decomposition, and laying a more reliable data foundation for subsequent model training and prediction.

[0040] The decomposition here may be achieved through various decomposition algorithms, such as empirical mode decomposition, variational mode decomposition (VMD), etc., which is not specifically limited in this embodiment.

[0041] Step 120 , extracting features from each of the sample subsequences, and clustering each of the sample subsequences according to a feature matrix of each of the sample subsequences to obtain a grouping category for each of the sample subsequences.

[0042] Optionally, step 120 specifically includes step 121 and step 122 .

[0043] Step 121 , after decomposing to obtain a plurality of sample subsequences, feature extraction may be performed on each sample subsequence to obtain a feature matrix of each sample subsequence.

[0044] The feature matrix here can be obtained by statistical calculation or extracted by a pre-trained feature extraction module, which is not specifically limited in this embodiment. The feature matrix here includes multiple feature information, including but not limited to one or more of time-frequency domain features, energy domain features, and information theory features, which is not specifically limited in this embodiment.

[0045] Step 122, after obtaining the feature matrix of each sample subsequence, each sample subsequence can be further clustered using the feature matrix of each sample subsequence as a clustering parameter to divide each sample subsequence into a corresponding cluster cluster, thereby obtaining a grouping category for each sample subsequence, and adding a label to each sample subsequence according to the grouping result, so as to assign a suitable model to it in the subsequent training step.

[0046] The clustering here can be achieved by clustering the feature matrix of each sample subsequence through a clustering algorithm such as the K-means algorithm; the grouping categories corresponding to different clustering clusters represent different data complexities, and the number of clustering clusters here can be set according to the number of divisions of the data complexity, such as setting it to 2. Accordingly, after the clustering is completed, the sample subsequences can be divided into two grouping categories according to the complexity: one group is a high-complexity sequence with a higher frequency, a larger information entropy, and a lower autocorrelation; the other group is a low-complexity sequence with a lower frequency, a smaller information entropy, and a stronger periodicity.

[0047] Step 130, based on the sub-models corresponding to the respective grouping categories in the initial prediction model, sequence prediction is performed on the sample sub-sequences under the respective grouping categories to obtain sequence prediction data for the next time period of the sample sub-sequences under the respective grouping categories.

[0048] The initial prediction model here includes sub-models with the same number as the grouping categories, and each grouping category corresponds to each sub-model one by one.

[0049] Optionally, after obtaining the grouping category of each sample subsequence, a corresponding time tag may be added to each sample subsequence, and the photovoltaic power tag of the next period of the sample photovoltaic power data sequence may be marked according to the time tag. The tag marking may be obtained by marking in a sliding window manner.

[0050] Based on the sample subsequences under each grouping category and the photovoltaic power labels of the next period of the sample photovoltaic power data sequence, a sample data set under each grouping category is constructed; and the proportion of the test set is set to divide the overall data structure of the sample data set into a training set and a test set for the convenience of model evaluation.

[0051] Then, the sample subsequences in the sample data set under each grouping category are input into the sub-model corresponding to each grouping category, so that the sub-model corresponding to each grouping category performs sequence prediction on the sample subsequences under the corresponding grouping category, thereby obtaining the sequence prediction data of the next time period of the sample subsequences under each grouping category.

[0052] Step 140, combining the sequence prediction data of the next time period of the multiple sample subsequences to obtain the photovoltaic power prediction data of the next time period of the sample photovoltaic power data sequence, and iteratively optimizing the model parameters of the initial prediction model according to the photovoltaic power prediction data and the photovoltaic power label of the next time period of the sample photovoltaic power data sequence to obtain the photovoltaic power prediction model.

[0053] Optionally, after obtaining the sequence prediction data of the next time period of each sample subsequence, the sequence prediction data of the next time period of each sample subsequence may be combined to obtain the photovoltaic power prediction data of the next time period of the sample photovoltaic power data sequence.

[0054] Next, the model parameters of the initial prediction model are iteratively optimized to minimize the error between the photovoltaic power prediction data of the next time period of the sample photovoltaic power data sequence and the photovoltaic power label of the next time period of the sample photovoltaic power data sequence. In this way, a photovoltaic power prediction model is obtained, which can accurately and reliably predict the photovoltaic power data at future moments based on the historical photovoltaic power data sequence.

[0055] The parameter optimization here can be obtained based on optimization algorithms, such as the Bayesian optimization algorithm, to automatically adjust the hyperparameters of the initial prediction model, improve the efficiency of hyperparameter adjustment, and enhance the generalization ability and prediction accuracy of the model, thereby ensuring that the trained photovoltaic power prediction model can achieve the optimal prediction effect in different data scenarios.

[0056] The method provided in this embodiment decomposes and corrects the sample photovoltaic power data sequence of the sample photovoltaic system to obtain multiple sample subsequences of different modes; extracts features from each sample subsequence, clusters each sample subsequence according to the feature matrix of each sample subsequence, and obtains the grouping category of each sample subsequence; based on the submodels corresponding to each grouping category in the initial prediction model, performs sequence prediction on the sample subsequences under each grouping category to obtain the sequence prediction data of the next time period of the sample subsequence under each grouping category; combines the sequence prediction data of the next time period of multiple sample subsequences to obtain the photovoltaic power prediction data of the next time period of the sample photovoltaic power data sequence; iteratively optimizes the model parameters of the initial prediction model according to the photovoltaic power prediction data and the photovoltaic power label of the next time period of the sample photovoltaic power data sequence to obtain the photovoltaic power prediction model. Therefore, by combining the advantages of data decomposition and error correction, and the data processing advantages of the submodels corresponding to the sequences of different complexity categories, the photovoltaic power prediction is combined, which effectively improves the processing capability of non-stationary photovoltaic data, so that the accuracy, reliability and stability of photovoltaic power prediction are significantly improved.

[0057] In some embodiments, step 110 specifically includes: According to the Gaussian smoothing algorithm, a variational optimization problem corresponding to the sample photovoltaic power data sequence is established; Based on the Lagrangian penalty factor and the Lagrangian multiplication operator, the variational optimization problem is optimized and solved to obtain a plurality of initial subsequences of different modes; calculating an error between a combined sequence of the initial subsequences of a plurality of different modes and the sample photovoltaic power data sequence; The initial subsequence of each mode is corrected according to the error to obtain the sample subsequence of each mode.

[0058] Optionally, the modal decomposition of step 110 specifically includes step 111 , step 112 and step 113 .

[0059] Step 111, by establishing a variational problem and solving it, the original photovoltaic power data is decomposed; specifically, according to the Gaussian smoothing algorithm, a variational optimization problem corresponding to the sample photovoltaic power data sequence is established to decompose the original time series (that is, the sample photovoltaic power data sequence) into different components under a limited bandwidth, and the signal bandwidth of each subsequence at each level is adjusted by using the Gaussian smoothing method of the adjustment signal to solve the constrained variational problem. Among them, the calculation formula of the objective function of the variational optimization problem can be expressed as follows: ; In the formula, is the original multi-component signal to be decomposed, that is, the sample photovoltaic power data sequence; For time; Indicates is the complex exponential function of angular frequency, which is used to convert the signal into the frequency domain; is an imaginary unit; After decomposition modal components, and , is the total number of modal components; For the The center frequency corresponding to the modal component; Dirac function.

[0060] And by introducing the Lagrange penalty factor and the Lagrange multiplication operator, the variational optimization problem is transformed from a constrained problem to an unconstrained problem, and the optimization solution is performed. The specific solution formula is as follows: ; in, is the Lagrangian function, which includes the optimization problem objective function and constraint state. By introducing the Lagrangian multiplier, the problem is transformed into an unconstrained optimization problem. is the Lagrange multiplier operator; is the smoothness term, is the Lagrangian penalty factor, which is used to balance the weight between the smoothness option and the error term; is the reconstruction error term, which is used to measure the decomposed mode The sum of the original signal The goal is to minimize the reconstruction error by optimizing the mode, thereby ensuring that the decomposed mode can better reconstruct the original signal; is the Lagrange multiplier term, which is a penalty factor used to express the constraint conditions; is the sample photovoltaic power data series.

[0061] Finally, the modal function and the corresponding center frequency are obtained through iterative updating, and then the initial subsequences of multiple different modes are obtained.

[0062] Step 112, calculate the correction error at each moment , use the correction error to correct the data at each moment in the initial subsequence. The correction error is obtained by calculating the error between the data at each moment in the combined sequence of the initial subsequence and the data at each moment in the sample photovoltaic power data sequence. The correction error can be specifically expressed as: ; In the formula, After decomposition The first The value of the moment, is the number of samples in the photovoltaic power data sequence. The value of a moment. is the combination sequence of the initial subsequence and the sample PV power data sequence in the first The correction error of the value at that moment.

[0063] Step 113, using the correction error to adjust each initial subsequence, the error correction formula of the value of each initial subsequence at each moment can be specifically expressed as: ; Where: For the The first The value of a moment.

[0064] The corrected error between the size of the corrected initial subsequence and the sample photovoltaic power data sequence is compared with the error threshold. If it is not less than the error threshold, steps 112 and 113 are iteratively performed until the corrected error between the size of the corrected initial subsequence and the sample photovoltaic power data sequence is less than the error threshold. The error correction process is stopped, and the corrected initial subsequence whose corrected error is less than the error threshold is used as the sample subsequence.

[0065] The method provided in this embodiment can effectively isolate the complex patterns and noise in the data and improve the predictability of the data by decomposing the original photovoltaic power data into multiple subsequences with different characteristics and frequencies by using variational coding. At the same time, the accuracy of data decomposition is further improved through the error correction step, laying a more reliable data foundation for the prediction of subsequent models, thereby helping to improve the accuracy and reliability of photovoltaic power prediction.

[0066] In some embodiments, the feature extraction step of step 121 specifically includes: Based on fast Fourier transform, frequency components of each of the sample subsequences are calculated, and peak values ​​of the frequency components are extracted to obtain frequency characteristics of each of the sample subsequences; Calculating the sum of squares of signal strengths of each of the sample subsequences to obtain energy characteristics of each of the sample subsequences; Calculating the sample entropy of each of the sample subsequences to obtain the information entropy feature of each of the sample subsequences; Calculating the maximum peak value in the autocorrelation function of each of the sample subsequences to obtain the autocorrelation feature of each of the sample subsequences; A feature matrix of each of the sample subsequences is constructed according to the frequency feature, the energy feature, the information entropy feature and the autocorrelation feature.

[0067] Optionally, for frequency characteristics, each sample subsequence can be analyzed in the frequency domain using Fast Fourier Transform (FFT) to calculate the main frequency components of each sample subsequence and perform peak frequency analysis in the FFT spectrum. Extract as the frequency feature of each sample subsequence; the frequency feature is used to reflect the rapid fluctuation information in the subsequence to help distinguish signals of different complexity. The calculation formula of the frequency feature is as follows: ; In the formula, For the frequency In the sample subsequence The frequency components for which Fourier transformation is performed.

[0068] For energy characteristics , which can be calculated for each sample subsequence The signal strength is measured by the square sum to measure its overall energy characteristics, which measures the amplitude of the signal and reflects its fluctuation intensity. Here, the specific calculation formula of the energy characteristics is as follows: ; For the information entropy feature, the sample entropy of each sample subsequence can be calculated as the information entropy feature; wherein the sample entropy can quantify the complexity of the signal, and a high entropy value indicates that the signal has high complexity and strong irregularity. Here, the specific calculation process of the information entropy feature is as follows: Construct template vector: Extract template from sequence, assuming is the template length. The specific value can be set according to actual needs. For example, For time series , extract each length A subsequence of as template: ; In the formula, is the first templates, is the total length of the subsequence.

[0069] Calculate the distance between templates: Use the maximum norm to calculate the distance between templates: ; In the formula, For template and The distance between.

[0070] Calculating Similarity Ratio: Setting a Tolerance Threshold , if the distance between two templates is less than or equal to , then the two templates are considered similar, and this ratio is used to measure the complexity of the signal.

[0071] Calculate sample entropy: Calculate sample entropy based on the ratio of similar templates: ; In the formula, is the sample entropy, which measures the complexity of the signal. The length is The distance between templates is less than or equal to The ratio of template pairs, The length is The distance between templates is less than or equal to The ratio of template pairs.

[0072] For the autocorrelation feature, the autocorrelation function of each sample subsequence can be calculated, and the maximum peak of the autocorrelation function can be extracted as the autocorrelation feature. Among them, the autocorrelation characteristic can reflect the periodicity of the signal. Here, the specific calculation formula of the autocorrelation function is as follows: ; In the formula, is the autocorrelation function, For time delay, For the subsequence of time domain signals.

[0073] Select the maximum peak of the autocorrelation function As autocorrelation feature: ; Combine the extracted features of each dimension to construct the feature matrix of each sample subsequence , the specific representation is as follows: .

[0074] The method provided in this embodiment comprehensively extracts the frequency characteristics, energy characteristics, information entropy characteristics and autocorrelation characteristics of the sample subsequence, and constructs a feature matrix based on the extracted characteristics, thereby laying a more comprehensive and reliable data foundation for subsequent sequence classification, thereby helping to improve the accuracy of sequence classification.

[0075] In some embodiments, the grouping category includes a first grouping category or a second grouping category, the data complexity corresponding to the first grouping category is higher than the data complexity corresponding to the second grouping category; the sub-model corresponding to the first grouping category is a convolution-unstructured transformer model, and the sub-model corresponding to the second grouping category is a convolution-frequency enhanced decomposition transformer model; Step 130 specifically includes step 131 and step 132 .

[0076] Step 131, based on the convolution-unstructured transformer model, performing sequence prediction on the sample subsequence under the first grouping category to obtain sequence prediction data of the next time period of the sample subsequence under the first grouping category; Step 132: Based on the convolution-frequency enhancement decomposition transformer model, sequence prediction is performed on the sample subsequence under the second grouping category to obtain sequence prediction data for the next time period of the sample subsequence under the second grouping category.

[0077] Among them, the grouping category can be divided into the first grouping category or the second grouping category, and the data complexity corresponding to the first grouping category is higher than the data complexity corresponding to the second grouping category, that is, the sample subsequence under the first grouping category is a high-complexity subsequence with high frequency, large information entropy, and low autocorrelation, and the sample subsequence under the second grouping category is a low-complexity subsequence with low frequency, small information entropy, and strong periodicity; the initial prediction model adopts a dual-model architecture of the convolution-unstructured transformer model (referred to as the CNN-ns_Transformer model) and the convolution-frequency enhanced decomposition transformer model (referred to as the CNN-FEDformer model), and is adapted according to the complexity category grouping of the subsequence. The CNN-ns_Transformer model can handle high-complexity subsequences with strong non-stationarity and accurately capture rapidly changing features; while the CNN-FEDformer model network is good at low-complexity subsequences with strong periodicity and can effectively learn periodic trends in long sequences. Therefore, for the sample subsequences under the first grouping category, it can be used to train the CNN-ns_Transformer model that can process complex data, so that the trained prediction model can predict subsequences of complex data; therefore, for the sample subsequences under the second grouping category, it can be used to train the CNN-FEDformer model that can process low complexity, so that the trained prediction model can predict subsequences of low complexity.

[0078] Optionally, for the sample subsequences under the first grouping category, sequence prediction can be performed on the sample subsequences under the first grouping category based on the CNN-ns_Transformer model, thereby obtaining sequence prediction data for the next time period of the sample subsequences under the first grouping category.

[0079] For the sample subsequences under the second grouping category, sequence prediction can be performed on the sample subsequences under the second grouping category based on the CNN-FEDformer model, thereby obtaining sequence prediction data for the next time period of the sample subsequences under the second grouping category.

[0080] Subsequently, the CNN-ns_Transformer model and the CNN-FEDformer model can be iteratively trained based on the sequence prediction data of the next time period of the sample subsequence under the first grouping category and the sequence prediction data of the next time period of the sample subsequence under the second grouping category, so that the trained CNN-ns_Transformer model can accurately predict the subsequences under the first grouping category, and the trained CNN-FEDformer model can accurately predict the subsequences under the second grouping category, so that the accuracy and stability of the prediction can be significantly improved through the combination of the two models.

[0081] In some implementations, step 131 specifically includes: For any sample subsequence under the first grouping category, based on the convolution module in the convolution-unstructured transformer model, a convolution operation is performed on the sample subsequence to obtain the spatiotemporal features of the sample subsequence; Based on the standardization module in the convolution-unstructured transformer model, the spatiotemporal features are standardized to obtain standardized features; Based on the embedding module in the convolution-unstructured transformer model, the position data, time data and weather data corresponding to the sample subsequence are applied to perform embedding coding to obtain embedding features; Based on the encoding module in the convolution-unstructured transformer model, applying the standardized features and the embedded features to perform encoding of the destabilized self-attention mechanism to obtain encoding features; Based on the decoding module in the convolution-unstructured transformer model, the encoding feature and the sample subsequence are applied to perform decoding to obtain a decoding feature; Based on the de-normalization module in the convolution-unstructured transformer model, the decoded features are de-normalized to obtain sequence prediction data for the next time period of the sample subsequence; Each sample subsequence under the first grouping category is traversed to obtain sequence prediction data of the next time period of each sample subsequence under the first grouping category.

[0082] Figure 3 Schematic diagram of the structure of the convolution-unstructured transformer model provided by the present invention. Figure 3 As shown in the figure, the CNN-ns_Transformer model includes a convolution module, a normalization module, an embedding module, an encoding module (or encoder), a decoding module (or decoder), and a denormalization module which are connected sequentially.

[0083] like Figure 3 As shown, for each sample subsequence under the first grouping category, step 131 may specifically perform the following steps to realize the sequence prediction data of the next time period of each sample subsequence under the first grouping category: Step 1311, initialize the CNN-ns_Transformer model, that is, select appropriate initialization model parameters for the CNN-ns_Transformer model, such as input, label, prediction sequence length, convolution layer parameters in CNN feature extraction, pooling layer parameters, fully connected layer parameter learning rate and input sequence length, hidden layer dimension, number of attention heads in the ns_Transformer prediction model, etc. The specific parameter settings need to be adjusted according to the data characteristics.

[0084] Step 1312: pass the sample subsequence into a convolutional neural network (CNN) module to extract the corresponding spatiotemporal features through convolution operations. The CNN module can effectively handle non-stationarity and local volatility and capture short-term dependency features in the input data.

[0085] Step 1313, the spatiotemporal features extracted and output by the CNN module are standardized using a standardization module to reduce the non-stationarity of the data, thereby improving the robustness of the model.

[0086] Step 1314, embedding features are added through the embedding module, specifically encoding the position data corresponding to the sample subsequence to obtain an absolute time code, encoding the time data and weather data corresponding to the sample subsequence to obtain a relative time code, so as to enhance the model's capture of periodic changes and the impact of the external environment on photovoltaic power; and constructing the final embedded features based on the absolute time code and the relative time code. The time data here includes but is not limited to time data such as timestamp, week, month, etc., and the encoding features of the embedded data can assist in enhancing the model's capture of periodic changes; weather data includes but is not limited to temperature, humidity, sunshine intensity, wind speed, wind pressure, air pressure, etc., and the encoding features of the embedded data can assist the model in capturing the impact of the external environment on photovoltaic power.

[0087] In step 1315, the standardized data and the embedded features are input into the encoding module, so that the encoding module uses a destabilizing self-attention mechanism to encode the data to further reduce the volatility of the data, thereby obtaining the encoded features.

[0088] Step 1316, the encoded features output by the encoding module are input into the decoding module together with the original input sample subsequence, so that the decoding module uses the multi-head attention mechanism for processing to enhance the prediction ability and efficiency, and the output decoded features are brought into the denormalization module to obtain the sequence prediction data for the next time period of the sample subsequence. Among them, the multi-head attention mechanism enables the decoding module to pay attention to the characteristics of different time periods of the data, thereby improving the prediction ability and efficiency of the model. The multi-head attention mechanism further enhances the model's ability to capture complex data patterns in the decoding module, helping to improve the accuracy of prediction.

[0089] The following describes the specific calculation process of the modules other than the CNN module, namely the unstructured transformer (ns_Transformer) model.

[0090] Assumptions is the input matrix, for The matrix obtained after normalization is , are the mean and standard deviation of x, respectively. is a module including an embedding module, an encoding module, and a decoding module. , , are three matrices of the same size obtained by stabilizing the input feature variables, For passing The matrix obtained after the module is for The denormalized matrix is: , is the destabilizing factor.

[0091] In order to reduce the non-stationarity of each input sequence, the ns_Transformer model can standardize the time dimension by transforming the window. For each input x, it is transformed and inversely transformed by translation and scaling operations. The expression for the standardization calculation performed by the standardization module is: ; ; ; In the formula, for The total number of samples; for The variance of for Fixed column values; for Fixed column value.

[0092] In passing After the module , the denormalization module is expressed as , Information to map the module's output back to , in order to restore the information lost during standardization, the expression of the de-standardization module is: ; ; Considering that the self-attention mechanism itself does not contain information about the order of elements, the introduction of position encoding can capture the order characteristics of the sequence. In this paper, absolute position encoding is implemented by different frequencies of sine and cosine functions, and its formula is as follows: ; ; In the formula, is the position of the element in the sequence, is the dimension index, is the model dimension size.

[0093] The method provided in this embodiment, by constructing a convolutional-unstructured converter model, combines the effective feature extraction of a convolutional neural network with the complex pattern capture capability of an unstructured converter model, thereby achieving accurate capture of spatiotemporal characteristics and periodic changes in photovoltaic power prediction, while reducing the non-stationarity and volatility of the data, and significantly improving the accuracy and efficiency of photovoltaic power prediction.

[0094] In some embodiments, step 132 specifically includes: For any sample subsequence under the second grouping category, based on the convolution module in the convolution-frequency enhancement decomposition transformer model, perform a convolution operation on the sample subsequence to obtain the spatiotemporal features of the sample subsequence; Based on the encoding module in the convolution-frequency enhancement decomposition transformer model, a frequency enhancement method is applied to perform frequency domain conversion on the spatiotemporal features to obtain frequency domain conversion features, and hybrid expert learning is applied to decompose the frequency domain conversion feature data to obtain a periodic component and a trend component; Based on the decoding module in the convolution-frequency enhancement decomposition transformer model, the periodic component and the trend component are applied to perform decoding to obtain sequence prediction data for the next period of the sample subsequence; Each sample subsequence under the second grouping category is traversed to obtain sequence prediction data of the next time period of each sample subsequence under the second grouping category.

[0095] Figure 4 Schematic diagram of the structure of the convolution-frequency enhancement decomposition transformer model provided by the present invention. Figure 4 As shown in the figure, the CNN-FEDformer model includes a convolutional module, an encoding module (or encoder), and a decoding module (or decoder) connected in sequence.

[0096] like Figure 4 As shown, for each sample subsequence under the second grouping category, step 132 may specifically perform the following steps to realize the sequence prediction data of the next time period of each sample subsequence under the second grouping category: Step 1321, initialize the CNN-FEDformer model, that is, select appropriate initialization model parameters for the CNN-FEDformer model, such as input, label, sequence length, hidden layer dimension, etc., convolution layer parameters, pooling layer parameters, fully connected layer parameter learning rate in CNN feature extraction, and input sequence length, hidden layer dimension, etc. in the FEDformer prediction model. The specific parameter settings need to be adjusted according to the characteristics of the data.

[0097] Step 1322: extract the temporal and spatial features of the input sample subsequence through a convolutional neural network (CNN). The input data after feature extraction is sent to the encoding module to provide basic features for the operation of the frequency enhancement module and the hybrid expert module.

[0098] Step 1323, replace the multi-head self-attention mechanism in the traditional Transformer with a frequency enhancement module in the encoding module. The frequency enhancement module is mainly used to perform frequency domain conversion and frequency analysis on time series data, so as to capture the periodicity and trend characteristics in the signal. This module can process long sequence data more efficiently and reduce redundant calculations. At the same time, a hybrid expert module is introduced in the encoding module to decompose the time series data after frequency domain analysis into components with obvious periodic characteristics (periodic and seasonal data), such as seasonal fluctuations and trend characteristics, such as the long-term growth or decline trend of photovoltaic power. In the encoding module, the input data is first converted into the frequency domain by the frequency enhancement module, and the periodicity and trend components (seasonal and trend parts) are processed respectively by two hybrid expert modules. Different frequency features are effectively separated to improve the ability to capture periodicity and trend.

[0099] Step 1324, the periodicity and trend (seasonality) data decomposed by the encoding module are input into the frequency enhancement module of the decoding module for frequency domain conversion and feature analysis to enhance the adaptability of the decoding module to complex patterns in time series. In the decoding module, the periodicity and trend data are further decomposed into more detailed frequency components through the hybrid expert module, distinguishing more subtle change patterns and ensuring the accurate prediction of the model at different frequencies and trends. The decomposed data is input into the frequency enhancement attention mechanism, which focuses on the important periodicity and trend components in the data through frequency domain conversion and feature analysis, thereby improving the learning ability of the model in the frequency domain. Finally, the processed data is reconstructed by the hybrid expert module and the feedforward network and the sequence prediction data for the next period of the sample subsequence is output.

[0100] The method provided in this embodiment utilizes a convolution-frequency enhancement decomposition transformer model to extract spatiotemporal features by performing a convolution operation on a sample subsequence under the second grouping category, and then applies a frequency enhancement method and hybrid expert learning to perform frequency domain conversion and decomposition on the features to obtain periodic components and trend components, and finally decodes to obtain sequence prediction data for the next time period. This process significantly improves the ability to capture periodic and trend features in photovoltaic power time series data, thereby achieving more accurate photovoltaic power prediction.

[0101] In some embodiments, step 140 specifically includes: Obtaining a target loss function according to an error between the photovoltaic power prediction data and the photovoltaic power label of the next period of the sample photovoltaic power data sequence; According to the target loss function, the model parameters of the initial prediction model are Bayesian optimized until the performance index value of the trained initial prediction model reaches a preset value; The photovoltaic power prediction model is constructed according to the trained initial prediction model whose performance indicator value reaches the preset value.

[0102] like Figure 2 As shown in the figure, after obtaining the sequence prediction data of the next period of each sample subsequence, the sequence prediction data of the next period of multiple sample subsequences can be combined to form the photovoltaic power prediction data of the next period of the sample photovoltaic power data sequence, and the model parameters of the initial prediction model are Bayesian optimized according to the photovoltaic power prediction data of the next period of the sample photovoltaic power data sequence, so as to obtain a photovoltaic power prediction model that can accurately predict the short-term photovoltaic power prediction results. Specifically, in the parameter optimization process, the Gaussian process is used as a proxy model to approximately describe the objective function in the hyperparameter space. The Gaussian process learns the objective function by updating the posterior distribution, generates the prediction mean and uncertainty estimation, and thus strikes a balance between exploration and utilization. According to the prediction results of the proxy model, the value of the acquisition function is calculated. The acquisition function is used to select a new hyperparameter configuration to maximize the expected improvement, that is, to achieve a lower RMSE value in the model. In each iteration, the hyperparameter configuration is updated according to the recommendation of the acquisition function, and the RMSE value corresponding to the new configuration is evaluated. If the new configuration performs better than the current optimal configuration, it is updated to the current optimal hyperparameter configuration. The hyperparameter update is performed cyclically until the preset target RMSE threshold is reached. When the termination condition is reached, the optimal hyperparameter configuration is output.

[0103] The specific training steps include: Step 141, create photovoltaic power prediction data after synthesizing the sequence prediction data of the next period of multiple sample subsequences. The goal is to optimize the hyperparameter configuration of the model based on the data to improve the prediction performance. Specify the optimization direction as minimizing the root mean square error (RMSE). RMSE is used to measure the deviation between the predicted value and the actual value and is suitable as an indicator for evaluating the prediction accuracy. Define the objective function (also called the target loss function), and use the objective function as the core of Bayesian optimization. The objective function takes the current hyperparameter configuration as input and outputs the corresponding RMSE value as the optimization basis. In each training, calculate the error between the model prediction value and the actual value, and use MSE for back propagation to update the model weights to improve the model's ability to fit the photovoltaic power data.

[0104] Step 142, after the objective function initializes the model structure according to the current hyperparameter configuration (learning rate, number of convolutional layer channels, etc.), the Adam optimizer is used for optimization, and the mean square error (MSE) loss function is selected for training to calculate the error between the predicted value and the actual value. The Adam optimizer can accelerate convergence and improve optimization efficiency by adjusting parameters through adaptive learning rate.

[0105] Step 143, evaluate the trained model on the test set, calculate RMSE as the performance indicator, and return the target value (also called the performance indicator value).

[0106] Step 144, determine whether to perform Bayesian optimization based on the target value. If the target value does not meet the standard, execute hyperparameter update repeatedly. If the target value meets the standard, output the optimal hyperparameter.

[0107] Step 145 , constructing a photovoltaic power prediction model using the optimal hyperparameters, so as to obtain a final short-term photovoltaic power prediction result using the photovoltaic power prediction model.

[0108] The method provided in this embodiment uses Bayesian optimization to automatically adjust the hyperparameters of the prediction model, thereby improving the efficiency of hyperparameter adjustment and enhancing the generalization ability and prediction accuracy of the model, thereby ensuring that the model can achieve the optimal prediction effect in different data scenarios.

[0109] The following is a specific simulation of this experiment to verify the effectiveness of the method provided by this application.

[0110] During the experiment, the real photovoltaic power generation data of a certain area from July 2022 to June 2023 was selected as the data source for the implementation case. The original data was recorded every 15 minutes, totaling 35040 records. The overall process of the proposed prediction method is as follows Figure 1 and Figure 2 As shown. First, VMD variational mode decomposition is used to decompose the original photovoltaic power data into 5 groups of subsequences, namely IMF1, IMF2, IMF3, IMF4, and IMF5, and the subsequences are corrected using the corrected error value. Next, the features of the subsequences are extracted and clustered to label IMF1, IMF2, and IMF4 with high complexity labels, and IMF3 and IMF5 with low complexity labels. The high complexity subsequence is input into ns_Transformer through CNN. The low complexity subsequence is input into FEDformer through CNN. The hyperparameters of the prediction model are then Bayesian optimized to improve the prediction accuracy and maximize the performance of the mining model.

[0111] In order to further illustrate the effectiveness and feasibility of the method provided in this application, the method provided in this application (also called proposed) is compared with the real data of photovoltaic power (also called real), as well as the back propagation neural network (BP) model, the long short-term memory (LSTM) model and the Transformer model. In the comparative experiment, the BP neural network is a multi-layer feedforward neural network, which is mainly trained based on the error back propagation algorithm. The network adjusts the weights by back propagating the error layer by layer to minimize the loss function. LSTM is a special recurrent neural network that realizes the long short-term memory function by introducing memory units, input gates, forget gates and output gates. It can retain important historical information during the training process and filter irrelevant information. It is suitable for processing dependencies in long time series. LSTM performs well in time series data modeling, especially good at processing long-term dependencies of long sequences, and can remember the associations between distant time points. It is suitable for time series prediction tasks such as photovoltaic power. Transformer is a sequence-to-sequence model based on the self-attention mechanism, which processes sequence data through a combination of multi-head self-attention and feedforward networks. The Transformer model performs well in modeling long sequence data and is particularly suitable for capturing global features in time series. Since there is no need for step-by-step recursion, it can be highly parallelized, which improves computational efficiency and is suitable for large-scale data sets. In addition, the multi-head attention mechanism enables the model to focus on different features in the sequence.

[0112] Figure 5 It is a distribution diagram of the comparison results of the prediction performances corresponding to different algorithms under sunny conditions provided by the present invention. Figure 6 It is a distribution diagram of comparison results of prediction performances corresponding to different algorithms under cloudy conditions provided by the present invention. Figure 7 FIG. 1 is a schematic diagram showing the distribution of the comparison results of the prediction performance of different algorithms under extreme weather conditions provided by the present invention. In the figure, the horizontal axis is time (time), and the vertical axis is power (Active Power). Figure 5 As shown in the figure, the real power data is relatively smooth under sunny conditions. All four models can grasp the power change trend, but the method proposed in this application minimizes the deviation while ensuring the same trend. Figure 6As shown in the figure, under cloudy conditions, the original photovoltaic data has a significant downward trend in the afternoon due to weather reasons, and then rebounds. The BP neural network did not learn in the dark, the power was 0, the Transformer did not catch the upward trend, and although the LSTM was close to the true value trend, the deviation was too large. The method proposed in this application uses ns_Transformer to reduce the impact of volatility, minimizes the deviation from the true value, and uses FEDformer to catch the trend, and the overall prediction is accurate. Figure 7 As shown, in extreme weather, violent fluctuations make the BP neural network almost unable to fit, LSTM's prediction of the wave peak is obviously too large, and Transformer has no obvious change trend for rapid fluctuations. The method proposed in this application has a prediction value closest to 0 at night, and can follow the changes well during violent fluctuations during the day.

[0113] Table 1 Comparison of prediction error indicators of different methods

[0114] In order to further evaluate the accuracy of the method proposed in this application, the mean absolute error (MAE), mean square error (MSE) and determination coefficient (R²) of the photovoltaic power prediction model proposed in this application are compared with other prediction models. The results are shown in Table 1.

[0115] As can be seen from Table 1, the three indicators of MAE, MSE and R² of the photovoltaic power prediction model proposed in this application are the smallest among all models, indicating that it has the smallest prediction error and a changing trend that is more consistent with the true value. In terms of the MAE indicator, the photovoltaic power prediction model proposed in this application is 43.3%, 39.8% and 52.1% lower than other optimal models in different weather conditions. In terms of the MSE indicator, the photovoltaic power prediction model proposed in this application is 51.8%, 51.7% and 58.4% lower than other optimal models in different weather conditions. In terms of the R² indicator, the photovoltaic power prediction model proposed in this application is 2.5%, 2.8% and 6.3% higher than other optimal models in different weather conditions. It is proved that the photovoltaic power prediction model proposed in this application shows a high prediction performance regardless of the data set.

[0116] In some embodiments, this embodiment also provides a photovoltaic power prediction method.

[0117] Figure 8 Schematic diagram of the photovoltaic power prediction method provided by the present invention. Figure 8 As shown, the method includes: Step 810 , decomposing and error correcting the historical photovoltaic power data sequence of the photovoltaic system to be tested in the historical period, to obtain a plurality of target subsequences of different modes.

[0118] The historical periods here are all periods before the current period.

[0119] Optionally, in the model application, the historical photovoltaic power data sequence can be first decomposed to decompose the historical photovoltaic power data sequence into multiple initial subsequences with different characteristics and frequencies; at the same time, the initial subsequences of multiple different modes obtained by decomposition can also be error corrected so that the error between the combined sequence of the corrected target subsequences of multiple different modes and the historical photovoltaic power data sequence is limited to a certain range, thereby improving the accuracy of data decomposition to lay a more reliable data foundation for subsequent predictions. The specific implementation method of this step can be referred to step 110, which will not be repeated here.

[0120] Step 820 , extracting features from each of the target subsequences, clustering each of the target subsequences according to a feature matrix of each of the target subsequences, and obtaining a grouping category for each of the target subsequences.

[0121] Optionally, after decomposing to obtain multiple target subsequences, feature extraction may be performed on each target subsequence to obtain a feature matrix of each target subsequence. After obtaining the feature matrix of each target subsequence, each target subsequence may be further clustered using the feature matrix of each target subsequence as a clustering parameter to divide each target subsequence into corresponding cluster clusters, thereby obtaining a grouping category of each target subsequence. The specific implementation of this step can be referred to step 120, which will not be described in detail here.

[0122] Step 830, based on the prediction sub-models corresponding to each of the grouping categories in the photovoltaic power prediction model, sequence prediction is performed on the target sub-sequences under each of the grouping categories to obtain the sequence prediction data of the current time period of the target sub-sequences under each of the grouping categories, and the sequence prediction data of the current time period of multiple target sub-sequences are combined to obtain the photovoltaic power prediction data of the current time period of the photovoltaic system to be tested; wherein the photovoltaic power prediction model is trained based on the photovoltaic power prediction model training method described in the above embodiments.

[0123] Optionally, after obtaining the grouping categories of each target subsequence, the target subsequences under each grouping category are input into the prediction submodels corresponding to each grouping category in the photovoltaic power prediction model, so that the prediction submodels corresponding to each grouping category perform sequence prediction on the target subsequences under the corresponding grouping category, thereby obtaining the sequence prediction data of the target subsequences under each grouping category in the current period. The specific implementation method of this step can be referred to step 130, which will not be repeated here.

[0124] After the sequence prediction data of the current period of each target subsequence is obtained, the sequence prediction data of the current period of each target subsequence may be combined to obtain the photovoltaic power prediction data of the current period of the photovoltaic system to be tested.

[0125] The method provided in this embodiment combines the advantages of data decomposition and error correction, as well as the data processing advantages of the sub-models corresponding to sequences of different complexity categories, to perform photovoltaic power prediction in combination, thereby effectively improving the processing capabilities of non-stationary photovoltaic data, and significantly improving the accuracy, reliability and stability of photovoltaic power prediction.

[0126] The photovoltaic power prediction system provided by the present invention is described below. The photovoltaic power prediction system described below and the photovoltaic power prediction method described above can be referred to each other.

[0127] Fig. 9 Schematic diagram of the photovoltaic power prediction system provided by the present invention; Fig. 9 As shown, the system includes: The decomposition unit 910 is used to decompose and correct errors of the historical photovoltaic power data sequence of the photovoltaic system to be tested in the historical period, and obtain a plurality of target subsequences of different modes; The clustering unit 920 is used to extract features from each of the target subsequences, and cluster each of the target subsequences according to a feature matrix of each of the target subsequences to obtain a grouping category of each of the target subsequences; The prediction unit 930 is used to perform sequence prediction on the target subsequences under each of the grouping categories based on the prediction submodels corresponding to each of the grouping categories in the photovoltaic power prediction model, obtain the sequence prediction data of the current time period of the target subsequences under each of the grouping categories, and combine the sequence prediction data of the current time period of multiple target subsequences to obtain the photovoltaic power prediction data of the current time period of the photovoltaic system to be tested; Wherein, the photovoltaic power prediction model is trained based on any of the photovoltaic power prediction model training methods described above.

[0128] The system provided in this embodiment combines the advantages of data decomposition and error correction, as well as the data processing advantages of the sub-models corresponding to sequences of different complexity categories, to perform photovoltaic power forecasting, thereby effectively improving the processing capabilities of non-stationary photovoltaic data, and significantly improving the accuracy, reliability and stability of photovoltaic power forecasting.

[0129] The system provided by the present invention is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for the specific processes and detailed contents, which will not be repeated here.

[0130] Fig.10An example of a physical structure diagram of an electronic device is shown in FIG. Fig.10 As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020 and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 may call the logic instructions in the memory 1030 to execute the photovoltaic power prediction model training method or the photovoltaic power prediction method provided in the above embodiments.

[0131] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0132] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the photovoltaic power prediction model training method or photovoltaic power prediction method provided by the above methods.

[0133] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the photovoltaic power prediction model training method or photovoltaic power prediction method provided by the above methods.

[0134] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A photovoltaic power prediction model training method, characterized in that: include: Decomposing and error-correcting a sample photovoltaic power data sequence of a sample photovoltaic system to obtain a plurality of sample subsequences of different modes; Extracting features from each of the sample subsequences, and clustering each of the sample subsequences according to a feature matrix of each of the sample subsequences to obtain a grouping category for each of the sample subsequences; Based on the sub-models corresponding to the respective grouping categories in the initial prediction model, sequence prediction is performed on the sample sub-sequences under the respective grouping categories to obtain sequence prediction data for the next time period of the sample sub-sequences under the respective grouping categories; The sequence prediction data of the next time period of multiple sample subsequences are combined to obtain the photovoltaic power prediction data of the next time period of the sample photovoltaic power data sequence, and the model parameters of the initial prediction model are iteratively optimized according to the photovoltaic power prediction data and the photovoltaic power label of the next time period of the sample photovoltaic power data sequence to obtain the photovoltaic power prediction model.

2. The photovoltaic power prediction model training method according to claim 1, characterized in that: The sample photovoltaic power data sequence of the sample photovoltaic system is decomposed and error corrected to obtain a plurality of sample subsequences of different modes, including: According to the Gaussian smoothing algorithm, a variational optimization problem corresponding to the sample photovoltaic power data sequence is established; Based on the Lagrangian penalty factor and the Lagrangian multiplication operator, the variational optimization problem is optimized and solved to obtain a plurality of initial subsequences of different modes; calculating an error between a combined sequence of the initial subsequences of a plurality of different modes and the sample photovoltaic power data sequence; The initial subsequence of each mode is corrected according to the error to obtain the sample subsequence of each mode.

3. The photovoltaic power prediction model training method according to claim 1, characterized in that: The extracting features from each of the sample subsequences comprises: Based on fast Fourier transform, frequency components of each of the sample subsequences are calculated, and peak values ​​of the frequency components are extracted to obtain frequency characteristics of each of the sample subsequences; Calculating the sum of squares of signal strengths of each of the sample subsequences to obtain energy characteristics of each of the sample subsequences; Calculating the sample entropy of each of the sample subsequences to obtain the information entropy feature of each of the sample subsequences; Calculating the maximum peak value in the autocorrelation function of each of the sample subsequences to obtain the autocorrelation feature of each of the sample subsequences; A feature matrix of each of the sample subsequences is constructed according to the frequency feature, the energy feature, the information entropy feature and the autocorrelation feature.

4. The photovoltaic power prediction model training method according to any one of claims 1 to 3, characterized in that: The grouping category includes a first grouping category or a second grouping category, the data complexity corresponding to the first grouping category is higher than the data complexity corresponding to the second grouping category; the sub-model corresponding to the first grouping category is a convolution-unstructured transformer model, and the sub-model corresponding to the second grouping category is a convolution-frequency enhancement decomposition transformer model; The method of performing sequence prediction on the sample subsequences under each of the grouping categories based on the submodels corresponding to each of the grouping categories in the initial prediction model to obtain sequence prediction data for the next time period of the sample subsequences under each of the grouping categories includes: Based on the convolution-unstructured transformer model, performing sequence prediction on the sample subsequences under the first grouping category to obtain sequence prediction data for the next time period of the sample subsequences under the first grouping category; Based on the convolution-frequency enhancement decomposition transformer model, sequence prediction is performed on the sample subsequence under the second grouping category to obtain sequence prediction data of the next time period of the sample subsequence under the second grouping category.

5. The photovoltaic power prediction model training method according to claim 4, characterized in that: The step of performing sequence prediction on the sample subsequences under the first grouping category based on the convolution-unstructured transformer model to obtain sequence prediction data for the next time period of the sample subsequences under the first grouping category includes: For any sample subsequence under the first grouping category, based on the convolution module in the convolution-unstructured transformer model, a convolution operation is performed on the sample subsequence to obtain the spatiotemporal features of the sample subsequence; Based on the standardization module in the convolution-unstructured transformer model, the spatiotemporal features are standardized to obtain standardized features; Based on the embedding module in the convolution-unstructured transformer model, the position data, time data and weather data corresponding to the sample subsequence are applied to perform embedding coding to obtain embedding features; Based on the encoding module in the convolution-unstructured transformer model, applying the standardized features and the embedded features to perform encoding of the destabilized self-attention mechanism to obtain encoding features; Based on the decoding module in the convolution-unstructured transformer model, the encoding feature and the sample subsequence are applied to perform decoding to obtain a decoding feature; Based on the de-normalization module in the convolution-unstructured transformer model, the decoded features are de-normalized to obtain sequence prediction data for the next time period of the sample subsequence; Each sample subsequence under the first grouping category is traversed to obtain sequence prediction data of the next time period of each sample subsequence under the first grouping category.

6. The photovoltaic power prediction model training method according to claim 4, characterized in that: The performing sequence prediction on the sample subsequence under the second grouping category based on the convolution-frequency enhancement decomposition transformer model to obtain sequence prediction data of the next time period of the sample subsequence under the second grouping category includes: For any sample subsequence under the second grouping category, based on the convolution module in the convolution-frequency enhancement decomposition transformer model, perform a convolution operation on the sample subsequence to obtain the spatiotemporal features of the sample subsequence; Based on the encoding module in the convolution-frequency enhancement decomposition transformer model, a frequency enhancement method is applied to perform frequency domain conversion on the spatiotemporal features to obtain frequency domain conversion features, and hybrid expert learning is applied to decompose the frequency domain conversion feature data to obtain a periodic component and a trend component; Based on the decoding module in the convolution-frequency enhancement decomposition transformer model, the periodic component and the trend component are applied to perform decoding to obtain sequence prediction data for the next period of the sample subsequence; Each sample subsequence under the second grouping category is traversed to obtain sequence prediction data of the next time period of each sample subsequence under the second grouping category.

7. The photovoltaic power prediction model training method according to any one of claims 1 to 3, characterized in that: The method of iteratively optimizing the model parameters of the initial prediction model according to the photovoltaic power prediction data and the photovoltaic power label of the next time period of the sample photovoltaic power data sequence to obtain the photovoltaic power prediction model includes: Obtaining a target loss function according to an error between the photovoltaic power prediction data and the photovoltaic power label of the next period of the sample photovoltaic power data sequence; According to the target loss function, the model parameters of the initial prediction model are Bayesian optimized until the performance index value of the trained initial prediction model reaches a preset value; The photovoltaic power prediction model is constructed according to the trained initial prediction model whose performance indicator value reaches the preset value.

8. A photovoltaic power prediction method, characterized in that: include: Decomposing and error-correcting the historical photovoltaic power data sequence of the photovoltaic system to be tested in the historical period, and obtaining multiple target subsequences of different modes; Extracting features from each of the target subsequences, and clustering each of the target subsequences according to a feature matrix of each of the target subsequences to obtain a grouping category for each of the target subsequences; Based on the prediction sub-models corresponding to each of the grouping categories in the photovoltaic power prediction model, sequence prediction is performed on the target sub-sequences under each of the grouping categories to obtain sequence prediction data of the current time period of the target sub-sequences under each of the grouping categories, and the sequence prediction data of the current time period of multiple target sub-sequences are combined to obtain photovoltaic power prediction data of the current time period of the photovoltaic system to be tested; The photovoltaic power prediction model is obtained by training based on the photovoltaic power prediction model training method according to any one of claims 1 to 7.

9. A photovoltaic power prediction system, characterized in that: include: A decomposition unit is used to decompose and correct errors of a historical photovoltaic power data sequence of a historical period of the photovoltaic system to be tested, and obtain target subsequences of multiple different modes; A clustering unit, used to extract features from each of the target subsequences, and cluster each of the target subsequences according to a feature matrix of each of the target subsequences to obtain a grouping category for each of the target subsequences; A prediction unit, configured to perform sequence prediction on target subsequences under each of the grouping categories based on the prediction submodels corresponding to each of the grouping categories in the photovoltaic power prediction model, obtain sequence prediction data of the current time period of the target subsequences under each of the grouping categories, and combine the sequence prediction data of the current time period of multiple target subsequences to obtain photovoltaic power prediction data of the current time period of the photovoltaic system to be tested; The photovoltaic power prediction model is obtained by training based on the photovoltaic power prediction model training method according to any one of claims 1 to 7.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the photovoltaic power prediction model training method according to any one of claims 1 to 7 or the photovoltaic power prediction method according to claim 8 is implemented.

Citation Information

Patent Citations

  • Photovoltaic power prediction method based on deep convolution nerve network

    CN108549929A

  • Method and device for predicting future generating capacity of power station based on time sequence concept drift

    CN116131255A

  • Wind power prediction method based on non-stationary Transform model

    CN117154680A

  • FEDformer-based industrial boiler water quality prediction method

    CN118427549A

  • Photovoltaic power prediction method and device, and medium

    CN118820752A

Cited By

  • CNN-LSTM-based photovoltaic power prediction method and related equipment

    CN121480788A

  • Power consumption prediction method

    CN121707071A