Construction method, system and equipment of photovoltaic power generation prediction model and medium

By constructing a photovoltaic power generation prediction model based on convolutional long and short-term memory network and timing mode attention mechanism, the problem of unstable power output in distributed photovoltaic power generation systems is solved, the prediction accuracy is improved, and the stability and reliability of the energy system are optimized.

CN119624163APending Publication Date: 2025-03-14CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +3
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411519918.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Due to geographical factors, irradiance and meteorological factors, there is great uncertainty in distributed photovoltaic power generation systems, resulting in unstable power output. The accuracy of the existing technology in the prediction of distributed photovoltaic power generation is not high.

Method used

The photovoltaic power generation prediction model based on the convolutional long short-term memory network and timing mode attention mechanism is adopted. By collecting historical power generation data of the distributed photovoltaic system, iterates into training sets and test sets, and the model is trained until the preset training iterations are reached, and the model is trained and constructed.

Benefits of technology

It improves the accuracy of distributed photovoltaic power generation prediction, reduces the pressure and voltage fluctuations of photovoltaic system output fluctuations on the power grid, significantly improves the stability of the power grid, optimizes the cooperation between energy storage systems and distributed photovoltaic systems, achieves a more balanced power supply and demand management, and enhances the stability and reliability of the entire energy system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119624163A_ABST
    Figure CN119624163A_ABST
Patent Text Reader

Abstract

The invention provides a photovoltaic power generation prediction model construction method, system, device and medium, and the method comprises the steps: collecting a plurality of historical power generation data sequences of a distributed photovoltaic system, and dividing the historical power generation data sequences into a training set and a test set; taking each historical power generation data sequence in the training set as an input, taking a future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as an output, iteratively training the photovoltaic power generation prediction model until the number of training iterations reaches a preset number of training iterations, and completing the training of the photovoltaic power generation prediction model; based on the test set, correcting the trained photovoltaic power generation prediction model to complete construction of the photovoltaic power generation prediction model; according to the method, complex dynamic relations and key features can be extracted, the prediction accuracy of photovoltaic power generation is improved, pressure and voltage fluctuation caused by output fluctuation of a photovoltaic system to a power grid are effectively reduced, and therefore the stability of the power grid is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The patent application of this invention belongs to the field of solar power generation technology, and specifically relates to a method, system, equipment and medium for constructing a photovoltaic power generation prediction model. Background Art

[0002] With the implementation of new energy access policies and the increasing maturity of new energy power generation technology, access to more new energy will inevitably affect the operation of the distribution network. Due to the influence of geographical factors, irradiance and various meteorological factors, distributed photovoltaic power generation has great uncertainty. However, one of the main challenges of photovoltaic systems is that their output depends on variable weather conditions, such as sunlight intensity, which leads to unstable power production. To overcome this problem, the integration of energy storage systems becomes crucial. Energy storage systems can store excess electricity and release it when needed, thereby balancing supply and demand and increasing the overall efficiency and reliability of the energy system. Therefore, energy storage systems and distributed photovoltaic systems need to cooperate with each other to maximize the benefits of distributed photovoltaic systems and energy storage systems. However, distributed photovoltaic power generation has great uncertainty, so the difficulty of distributed photovoltaic power generation prediction is also relatively large, and the existing technology is not very accurate in predicting distributed photovoltaic power generation. Summary of the invention

[0003] In order to overcome the above-mentioned deficiencies of the prior art, the present invention patent application proposes a method for constructing a photovoltaic power generation prediction model, including:

[0004] Collecting multiple historical power generation data sequences of a distributed photovoltaic system, and dividing the historical power generation data sequences into a training set and a test set;

[0005] Build a photovoltaic power generation prediction model based on convolutional long short-term memory network and temporal pattern attention mechanism;

[0006] Taking each historical power generation data sequence in the training set as input and taking the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, iteratively training the photovoltaic power generation prediction model until the number of training iterations reaches a preset number of training iterations, thereby completing the training of the photovoltaic power generation prediction model;

[0007] Based on the test set, the trained photovoltaic power generation prediction model is modified to complete the construction of the photovoltaic power generation prediction model;

[0008] Wherein, during each iterative training of the photovoltaic power generation prediction model, the hidden state matrix and the current hidden state of the convolutional long short-term memory network are updated.

[0009] Preferably, the collecting of multiple historical power generation data sequences of the distributed photovoltaic system and dividing the historical power generation data sequences into a training set and a test set includes:

[0010] Collect multiple historical power generation data sequences of distributed photovoltaic systems, use the 3σ rule to process abnormal data, and obtain the historical power generation data sequence after abnormal data processing;

[0011] Performing data normalization and data denormalization operations on the historical power generation data sequence after abnormal data processing to obtain the final historical power generation data sequence;

[0012] The final historical power generation data sequence is divided into a training set and a test set.

[0013] Preferably, the convolutional long short-term memory network includes: an input gate, a forget gate and an output gate; the photovoltaic power generation prediction model is iteratively trained by taking each historical power generation data sequence in the training set as input and taking the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output until the number of training iterations reaches a preset number of training iterations, thereby completing the training of the photovoltaic power generation prediction model, including:

[0014] Taking each historical power generation data sequence in the training set as input and taking the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, sequentially training the input gate, the forget gate and the output gate to obtain the hidden state matrix and the current hidden state corresponding to the training set;

[0015] Using a pre-built temporal pattern attention mechanism, convolution calculation is performed on the hidden state matrix, and according to the temporal pattern matrix obtained by the convolution calculation combined with the current hidden state, a scoring function is used to obtain a future historical power generation prediction result;

[0016] According to the future historical power generation prediction result and the error of the future historical power generation data sequence, the model parameters in the photovoltaic power generation prediction model are adjusted, and iterative training is performed again, and when the photovoltaic power generation prediction model is iteratively trained each time, the hidden state matrix and the current hidden state are updated until the number of training iterations reaches a preset number of training iterations, and the training of the photovoltaic power generation prediction model is completed;

[0017] The future historical power generation data sequence is a historical power generation data sequence at a future moment relative to the historical power generation data sequence.

[0018] Preferably, the pre-built temporal pattern attention mechanism is used to perform convolution calculation on the hidden state matrix, and the temporal pattern matrix obtained by the convolution calculation is combined with the current hidden state, and a scoring function is used to obtain the future historical power generation prediction result, including:

[0019] Through a pre-constructed temporal pattern attention mechanism, the convolution kernel of the output gate is used to perform convolution calculation on the row vector of the hidden state matrix to extract the temporal pattern matrix within the convolution kernel range;

[0020] Using a scoring function, calculating the correlation between the temporal pattern matrix and the current hidden state, and using an activation function sigmoid to normalize the correlation to obtain an attention weight of the row vector;

[0021] Perform weighted summation on the temporal pattern matrix of each row vector and the corresponding attention weight to obtain the context vector;

[0022] Calculating an output value of the temporal pattern attention mechanism based on the context vector, the current hidden state, the training weight of the convolutional long short-term memory network output state, and the training weight of the context vector;

[0023] Based on the output value of the temporal pattern attention mechanism and the final weight of the photovoltaic power generation prediction model, a future historical power generation prediction result is obtained;

[0024] Wherein, the time pattern matrix includes multiple eigenvalues.

[0025] Preferably, the calculation formula of the characteristic value is as follows:

[0026]

[0027] in, is the eigenvalue extracted by the jth convolution kernel from the i-th row vector, H i,(t-w-1+l) is the eigenvalue extracted by the i-th row vector through the convolution kernel with a length of tw-1+l, C j,T-w+l is the j-th convolution kernel with a length of T-w+l, w is the length of the historical power generation data sequence, C is the convolution kernel, T is the maximum weight extracted by the convolution kernel, and l is the padding length in the convolution operation.

[0028] Preferably, the scoring function is expressed as follows:

[0029]

[0030] in, is the evaluation function, is the transpose of the i-th row vector of the temporal pattern matrix, is the i-th row vector of the temporal pattern matrix, h t is the current hidden state, W a is the training weight matrix of the scoring function.

[0031] Preferably, the photovoltaic power generation prediction model that has been trained is corrected based on the test set to complete the construction of the photovoltaic power generation prediction model, including:

[0032] Constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model according to a preset prediction demand time step and the photovoltaic power generation prediction model;

[0033] Calculating the value of the evaluation index of the single-step photovoltaic power generation prediction model or the multi-step photovoltaic power generation prediction model according to the test set;

[0034] According to the value of the evaluation index each time, the trained photovoltaic power generation prediction model is corrected, and when the value of the evaluation index reaches the value of the preset evaluation index, the construction of the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model is completed;

[0035] The value of the evaluation index includes at least one or more of the following: mean absolute error, mean square error, root mean square error, standardized mean absolute error and standardized root mean square error.

[0036] Preferably, the photovoltaic power generation prediction model that has been trained is corrected according to the value of the evaluation index each time. When the value of the evaluation index reaches the value of the preset evaluation index, after the construction of the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model is completed, it also includes:

[0037] Using the real-time power generation data series of the distributed photovoltaic system, the corresponding future power generation prediction results are obtained by constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model;

[0038] According to the future power generation prediction result, the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model are optimized to obtain the optimized single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model.

[0039] Based on the same inventive concept, the present patent application also provides a photovoltaic power generation prediction model construction system, including: a training data division module, a photovoltaic power generation prediction model construction module, a photovoltaic power generation prediction model training module and a photovoltaic power generation prediction model correction module;

[0040] The training data division module is used to collect multiple historical power generation data sequences of the distributed photovoltaic system and divide the historical power generation data sequences into a training set and a test set;

[0041] The photovoltaic power generation prediction model building module is used to build a photovoltaic power generation prediction model based on a convolutional long short-term memory network and a temporal pattern attention mechanism;

[0042] The photovoltaic power generation prediction model training module is used to take each historical power generation data sequence in the training set as input, take the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, iteratively train the photovoltaic power generation prediction model until the number of training iterations reaches a preset number of training iterations, and complete the training of the photovoltaic power generation prediction model;

[0043] The photovoltaic power generation prediction model correction module is used to correct the trained photovoltaic power generation prediction model based on the test set to complete the construction of the photovoltaic power generation prediction model;

[0044] Wherein, during each iterative training of the photovoltaic power generation prediction model, the hidden state matrix and the current hidden state of the convolutional long short-term memory network are updated.

[0045] Preferably, the training data partitioning module is used to:

[0046] Collect multiple historical power generation data sequences of distributed photovoltaic systems, use the 3σ rule to process abnormal data, and obtain the historical power generation data sequence after abnormal data processing;

[0047] Performing data normalization and data denormalization operations on the historical power generation data sequence after abnormal data processing to obtain the final historical power generation data sequence;

[0048] The final historical power generation data sequence is divided into a training set and a test set.

[0049] Preferably, the convolutional long short-term memory network includes: an input gate, a forget gate and an output gate; the photovoltaic power generation prediction model training module includes:

[0050] A training convolutional long short-term memory network submodule is used to take each historical power generation data sequence in the training set as input, take the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, train the input gate, forget gate and output gate in sequence, and obtain the hidden state matrix and current hidden state corresponding to the training set;

[0051] A training temporal pattern attention mechanism submodule is used to use a pre-built temporal pattern attention mechanism to perform convolution calculation on the hidden state matrix, and obtain a future historical power generation prediction result by combining the temporal pattern matrix obtained by the convolution calculation with the current hidden state using a scoring function;

[0052] An iterative training submodule, used to adjust the model parameters in the photovoltaic power generation prediction model according to the future historical power generation prediction result and the error of the future historical power generation data sequence, and perform iterative training again, and update the hidden state matrix and the current hidden state during each iterative training of the photovoltaic power generation prediction model, until the number of training iterations reaches a preset number of training iterations, and the training of the photovoltaic power generation prediction model is completed;

[0053] The future historical power generation data sequence is a historical power generation data sequence at a future moment relative to the historical power generation data sequence.

[0054] Preferably, the training temporal pattern attention mechanism submodule is used to:

[0055] Through a pre-constructed temporal pattern attention mechanism, the convolution kernel of the output gate is used to perform convolution calculation on the row vector of the hidden state matrix to extract the temporal pattern matrix within the convolution kernel range;

[0056] Using a scoring function, calculating the correlation between the temporal pattern matrix and the current hidden state, and using an activation function sigmoid to normalize the correlation to obtain an attention weight of the row vector;

[0057] Perform weighted summation on the temporal pattern matrix of each row vector and the corresponding attention weight to obtain the context vector;

[0058] Calculating an output value of the temporal pattern attention mechanism based on the context vector, the current hidden state, the training weight of the convolutional long short-term memory network output state, and the training weight of the context vector;

[0059] Based on the output value of the temporal pattern attention mechanism and the final weight of the photovoltaic power generation prediction model, a future historical power generation prediction result is obtained;

[0060] Wherein, the time pattern matrix includes multiple eigenvalues.

[0061] Preferably, the calculation formula of the characteristic value is as follows:

[0062]

[0063] in, is the eigenvalue extracted by the jth convolution kernel from the i-th row vector, H i,(t-w-1+l) is the eigenvalue extracted by the i-th row vector through the convolution kernel with a length of tw-1+l, C j,T-w+l is the j-th convolution kernel with a length of T-w+l, w is the length of the historical power generation data sequence, C is the convolution kernel, T is the maximum weight extracted by the convolution kernel, and l is the padding length in the convolution operation.

[0064] Preferably, the scoring function is expressed as follows:

[0065]

[0066] in, is the evaluation function, is the transpose of the i-th row vector of the temporal pattern matrix, is the i-th row vector of the time pattern matrix, h t is the current hidden state, W a is the training weight matrix of the scoring function.

[0067] Preferably, the photovoltaic power generation prediction model correction module is used to:

[0068] Constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model according to a preset prediction demand time step and the photovoltaic power generation prediction model;

[0069] Calculating the value of the evaluation index of the single-step photovoltaic power generation prediction model or the multi-step photovoltaic power generation prediction model according to the test set;

[0070] According to the value of the evaluation index each time, the trained photovoltaic power generation prediction model is corrected, and when the value of the evaluation index reaches the value of the preset evaluation index, the construction of the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model is completed;

[0071] The value of the evaluation index includes at least one or more of the following: mean absolute error, mean square error, root mean square error, standardized mean absolute error and standardized root mean square error.

[0072] Preferably, the system further comprises: a model optimization module, configured to:

[0073] Using the real-time power generation data series of the distributed photovoltaic system, the corresponding future power generation prediction results are obtained by constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model;

[0074] According to the future power generation prediction result, the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model are optimized to obtain the optimized single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model.

[0075] Based on the same inventive concept, the patent application of the present invention also provides an electronic device, comprising: at least one processor and a memory; the memory and the processor are connected via a bus;

[0076] The memory is used to store one or more programs;

[0077] When the one or more programs are executed by the at least one processor, a method for constructing a photovoltaic power generation prediction model as described above is implemented.

[0078] Based on the same inventive concept, the patent application of the present invention also provides a readable storage medium on which a computer program and an execution program are stored. When the execution program is executed, a method for constructing a photovoltaic power generation prediction model as described above is implemented.

[0079] Compared with the closest prior art, the patent application of this invention has the following beneficial effects:

[0080] The patent application of the present invention provides a method, system, device and medium for constructing a photovoltaic power generation prediction model, including: collecting multiple historical power generation data sequences of a distributed photovoltaic system, and dividing the historical power generation data sequences into a training set and a test set; constructing a photovoltaic power generation prediction model based on a convolutional long short-term memory network and a temporal pattern attention mechanism; taking each historical power generation data sequence in the training set as input, and taking the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, iteratively training the photovoltaic power generation prediction model until the number of training iterations reaches a preset number of training iterations, and completing the training of the photovoltaic power generation prediction model; based on the test set, correcting the trained photovoltaic power generation prediction model to complete the construction of the photovoltaic power generation prediction model; wherein, in each iterative training of the photovoltaic power generation prediction model, the hidden state matrix and the current hidden state of the convolutional long short-term memory network are updated; when training the photovoltaic power generation prediction model, the present invention uses the training to train the photovoltaic power generation prediction model. A convolutional long short-term memory network is trained to update the hidden state matrix and the current hidden state. The hidden state matrix and the current hidden state reflect the spatially relevant information and time-dependent information of the data in the training set. According to the hidden state matrix and the current hidden state, by training the time series pattern attention mechanism, different historical power generation data can be given different importances, so as to better understand and process the complex dynamic relationships in the hidden state matrix and the current hidden state, thereby extracting the complex dynamic relationships and key features. Then, through the photovoltaic power generation prediction model of the present invention, the power output of the power system in different time periods can be predicted, and the future power generation prediction results with high accuracy can be obtained, thereby improving the prediction accuracy of the photovoltaic power generation prediction model, effectively reducing the pressure and voltage fluctuations on the power grid caused by the output fluctuations of the photovoltaic system, and significantly improving the stability of the power grid, thereby optimizing the use of energy storage systems and distributed photovoltaic systems, and being able to achieve more balanced management between power supply and demand, and enhancing the stability and reliability of the entire energy system. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1 A schematic flow chart of a method for constructing a photovoltaic power generation model provided for the patent application of the present invention;

[0082] Figure 2 A flow chart of a timing output modeling method provided for the patent application of the present invention;

[0083] Figure 3 A schematic diagram of the principle of the temporal pattern attention mechanism provided for the patent application of this invention;

[0084] Figure 4 A schematic diagram of the convolutional long short-term memory network structure provided for the patent application of this invention;

[0085] Figure 5 A schematic diagram of a photovoltaic power generation model construction system provided for the patent application of the present invention;

[0086] Figure 6 A schematic structural diagram of an electronic device provided for the patent application of the present invention. DETAILED DESCRIPTION

[0087] The specific implementation methods of the patent application of the present invention are further described in detail below in conjunction with the accompanying drawings.

[0088] Embodiment 1:

[0089] The present invention provides a method for constructing a photovoltaic power generation prediction model. Figure 1 As shown, including:

[0090] Step 1: Collect multiple historical power generation data sequences of distributed photovoltaic systems, and divide the historical power generation data sequences into a training set and a test set;

[0091] Step 2: Build a photovoltaic power generation prediction model based on convolutional long short-term memory network and temporal pattern attention mechanism;

[0092] Step 3: using each historical power generation data sequence in the training set as input and the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, iteratively training the photovoltaic power generation prediction model until the number of training iterations reaches a preset number of training iterations, thereby completing the training of the photovoltaic power generation prediction model;

[0093] Step 4: Based on the test set, the trained photovoltaic power generation prediction model is modified to complete the construction of the photovoltaic power generation prediction model;

[0094] Wherein, during each iterative training of the photovoltaic power generation prediction model, the hidden state matrix and the current hidden state of the convolutional long short-term memory network are updated.

[0095] The above step 1 collects multiple historical power generation data sequences of the distributed photovoltaic system and divides the historical power generation data sequences into a training set and a test set, including:

[0096] Collect multiple historical power generation data sequences of distributed photovoltaic systems, use the 3σ rule to process abnormal data, and obtain the historical power generation data sequence after abnormal data processing;

[0097] For example, a historical power generation data sequence of a distributed photovoltaic system with a collection time interval of 15 minutes, and a historical power generation data sequence includes multiple historical power generation data;

[0098] In the case of large samples (the number of historical power generation data is greater than 185), the Gaussian distribution rule (3σ rule) is widely used as a judgment standard because of its simplicity. The 3σ rule is used to process abnormal data. The specific formula is as follows:

[0099]

[0100] Among them, δ is the standard deviation, x q is the qth historical power generation data, N is the number of historical power generation data, is the average value of historical power generation data, Δx q is the difference between the qth historical power generation data and the average value.

[0101] Performing data normalization and data denormalization operations on the historical power generation data sequence after abnormal data processing to obtain the final historical power generation data sequence;

[0102] For example, since the unit dimensions of each historical power generation data are different, normalization and denormalization operations are required to prevent significant impact on subsequent calculations and analysis. The normalization calculation formula is as follows:

[0103]

[0104] Among them, x' is the normalized historical power generation data, x is the historical power generation data after abnormal data processing, and x max is the maximum value of historical power generation data, x min It is the minimum value of historical power generation data;

[0105] The calculation formula for denormalization is as follows:

[0106]

[0107] Among them, X is the historical power generation data after denormalization.

[0108] Step 1 also includes analyzing the spatiotemporal distribution characteristics of the final historical power generation data series using the Pearson correlation coefficient, as follows:

[0109] The Pearson correlation coefficient is a statistical indicator that measures the degree of linear correlation between two variables. By calculating the Pearson correlation coefficient between photovoltaic power generation data at different locations and time periods, the spatial and temporal correlation characteristics of photovoltaic power generation can be revealed. This analysis helps to identify which regions have similar trends in power generation and which time periods have consistent power generation changes, thereby providing a reference for the optimization of photovoltaic power generation systems.

[0110] The Pearson correlation coefficient is used to measure the linear relationship between two variables, and its calculation formula is as follows:

[0111]

[0112] Among them, γ is the Pearson correlation coefficient between two historical power generation data, A s is the sth historical power generation data of photovoltaic power station A, u A is the average value of historical power generation data of photovoltaic power station A, B S is the sth historical power generation data of photovoltaic power station B, u B is the average value of historical power generation data of photovoltaic power station B, and L is the number of historical power generation data of photovoltaic power station A or photovoltaic power station B;

[0113] The final historical power generation data sequence is divided into a training set and a test set; the present invention uses the 3σ rule, data normalization and data denormalization operations to perform fine data processing on the collected multiple historical power generation data sequences, thereby ensuring the data quality and the accuracy of the prediction.

[0114] In the above step 2, the convolutional long short-term memory network (ConvLSTM) is integrated with the temporal pattern attention mechanism (TPA). The temporal pattern attention mechanism is used to extract the local features of each time series in the hidden layer of ConvLSTM through convolution operations, simplify the internal relationship of the time series, reduce unnecessary processes, and improve the prediction accuracy. The hidden layer (hidden state) is the target of the input gate, forget gate and output gate operations in ConvLSTM, which stores the historical information about the time series in the historical power generation data sequence. The input gate, forget gate and output gate all adjust the information transmission and update of the hidden state through the gating mechanism. The input gate controls the impact of the current input on the hidden state and determines the degree to which new information enters the hidden layer; the forget gate adjusts the information retained or forgotten in the hidden state of the previous time step; the output gate determines how the hidden layer information of the current time step is output to the next layer or the next step, thereby affecting the overall prediction and transmission process of the network.

[0115] The convolutional long short-term memory network in the above step 3 includes: an input gate, a forget gate and an output gate; the photovoltaic power generation prediction model is iteratively trained by taking each historical power generation data sequence in the training set as input and taking the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output until the number of training iterations reaches a preset number of training iterations, and the training of the photovoltaic power generation prediction model is completed, including:

[0116] Taking each historical power generation data sequence in the training set as input and taking the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, sequentially training the input gate, the forget gate and the output gate to obtain the hidden state matrix and the current hidden state corresponding to the training set;

[0117] For example, the convolutional long short-term memory network (ConvLSTM) combines the advantages of CNN (Convolutional Neural Networks) and LSTM (Long Short-Term Memory), and can learn spatiotemporal correlation at the same time. Therefore, it can extract spatially related information and time-dependent information from historical photovoltaic power generation data. In each time step, three vectors are input into the current ConvLSTM, namely, the memory unit C at time t-1 t-1 , the hidden state H at time t-1 t-1 and the historical power generation data series D at time t t ,These input vectors pass through the forget gate, the input gate and the output gate. Each vector is between 0 and 1. The forget gate selects the most relevant historical PV power information for better prediction. The input gate determines the current information of the final input. The output gate determines which information is used as the final output; Figure 2 This is a schematic diagram of the ConvLSTM structure, and its principle can be expressed as follows:

[0118]

[0119] Among them, i t is the output of the input gate at time t, f t is the output of the forget gate at time t, C t is the output of the memory unit at time t, o t is the output of the output gate at time t, D t is the historical power generation data sequence at time t, tanh and σ are nonlinear activation functions, b i is the bias of the input gate, b f is the bias of the forget gate, b c is the bias of the memory unit, b o is the bias of the output gate, H t-1is the hidden state at time t-1, C t-1 is the memory unit at time t-1, H t is the hidden state at time t, W Di is the convolution weight used to process the input data when calculating the input gate, W Df is the convolution weight used to process the input data when calculating the forget gate, W ci is the convolution weight used to process the previous cell state when calculating the input gate, W cf is the convolution weight used to process the previous cell state when calculating the forget gate, W hf is the convolution weight used to process the previous hidden state when calculating the forget gate, W Dc and W hc To calculate the convolution weights for processing the previous hidden state and input data in the cell state update, W Do is the convolution weight used to process the input data when calculating the output gate, W co is the convolution weight used to process the previous cell state when calculating the output gate, W ho The convolution weight used to process the previous hidden state when calculating the output gate;

[0120] Figure 2 The b in the above formula is the bias of the ConvLSTM structure, including one or more of the following: i , b f , b c and b o .

[0121] The continuous historical power generation data sequence in the training set is input into ConvLSTM in sequence to obtain the corresponding hidden state h t-w ~h t , where h t-w is the hidden state at time tw, w is the length of the historical power generation data sequence, and h is selected t-w ~h t-1 As the hidden state matrix, h t As the hidden state at the current moment, the hidden state matrix is ​​as follows:

[0122] H={h t-w ,h t-w-1 , ..., h t-1}

[0123] Among them, H is the hidden state matrix, h t-w is the hidden state at time tw, h t-w-1 is the hidden state at time tw-1, h t-1 is the hidden state at time t-1.

[0124] Using a pre-built temporal pattern attention mechanism, convolution calculation is performed on the hidden state matrix, and according to the temporal pattern matrix obtained by the convolution calculation combined with the current hidden state, a scoring function is used to obtain a future historical power generation prediction result;

[0125] For example, time series output modeling is a technology that can predict the power output of the power system in different time periods. It is reflected in the time series pattern attention mechanism of the photovoltaic power generation prediction model. The time series pattern attention mechanism can give different importance to different time series patterns, so as to better understand and handle the complex dynamic relationship in the spatiotemporal series. This enables the model to dynamically adjust the contribution of the time series pattern of each power station to the prediction task, improve the accuracy of the prediction, and the time series pattern attention mechanism can identify and weight the key features in the time series, so as to effectively capture the long-term dependency. The working mechanism of TPA is as follows Figure 3 As shown, where h t-w is the hidden state at time tw, h t-1 is the hidden state at time t-1, h t is the current hidden state, The time pattern matrix is ​​formed. is the eigenvalue extracted by the i-th convolution kernel of the i-th row vector, is the eigenvalue extracted by the jth convolution kernel from the i-th row vector, f is the evaluation function, a1~a i is the attention weight of the temporal pattern matrix, a1 is the attention weight of the first row in the temporal pattern matrix, and a i is the attention weight of the i-th row in the temporal pattern matrix, v t is the context vector at time t, h t is the current hidden state, y t-1 It is the output value of the photovoltaic power generation prediction model, that is, the future historical power generation prediction result.

[0126] According to the future historical power generation prediction result and the error of the future historical power generation data sequence, the model parameters in the photovoltaic power generation prediction model are adjusted, and iterative training is performed again, and when the photovoltaic power generation prediction model is iteratively trained each time, the hidden state matrix and the current hidden state are updated until the number of training iterations reaches a preset number of training iterations, and the training of the photovoltaic power generation prediction model is completed;

[0127] The future historical power generation data sequence is a historical power generation data sequence at a future moment relative to the historical power generation data sequence.

[0128] In one implementation, the pre-built temporal pattern attention mechanism is used to perform convolution calculation on the hidden state matrix, and the temporal pattern matrix obtained by the convolution calculation is combined with the current hidden state, and a scoring function is used to obtain the future historical power generation prediction result, including:

[0129] Through a pre-constructed temporal pattern attention mechanism, the convolution kernel of the output gate is used to perform convolution calculation on the row vector of the hidden state matrix to extract the temporal pattern matrix within the convolution kernel range;

[0130] For example, the TPA mechanism uses CNN to enhance the learning ability of the model by applying filters in CNN on row vectors of hidden states, and uses convolution kernels to perform convolution calculations on row vectors of the hidden state matrix to extract a temporal pattern matrix within the range of the convolution kernel, wherein the temporal pattern matrix includes multiple eigenvalues.

[0131] Using a scoring function, calculating the correlation between the temporal pattern matrix and the current hidden state, and using an activation function sigmoid to normalize the correlation to obtain an attention weight of the row vector;

[0132] For example, using the scoring function, the current hidden state h output by ConvLSTM is t Interact with each row of the temporal pattern matrix to compute With h t The correlation between them is normalized using the sigmoid function to obtain the attention weight of the row vector, that is, the attention weight a of each row. i , the attention weight a of each row i The calculation formula is as follows:

[0133]

[0134] Among them, a i express For the current hidden state h t The influence strength of is the attention weight of the i-th row in the temporal pattern matrix, is the evaluation function, is the i-th row vector of the temporal pattern matrix, h t is the current hidden state;

[0135] Perform weighted summation on the temporal pattern matrix of each row vector and the corresponding attention weight to obtain the context vector;

[0136] For example, Conduct a i Weighted summation to get the context vector v t , v tThe calculation formula is as follows:

[0137]

[0138] Among them, v t is the context vector at time t, a i is the attention weight of the i-th row in the temporal pattern matrix, is the i-th row vector of the time pattern matrix, and m is the number of rows of the time pattern matrix;

[0139] v t Representing the temporal pattern matrix Each row of the current hidden state h t The combined effect of ,that is, the sequential mode attention mechanism.

[0140] Calculating an output value of the temporal pattern attention mechanism based on the context vector, the current hidden state, the training weight of the convolutional long short-term memory network output state, and the training weight of the context vector;

[0141] For example, after linear mapping operation, h t and v t The sum is calculated as follows:

[0142] h t ′=W h h t +W v v t

[0143] Among them, h t ′ is the output value of the temporal pattern attention mechanism, W h is the training weight of the output state of the convolutional long short-term memory network, h t is the current hidden state, W v is the training weight of the context vector, v t is the context vector at time t.

[0144] Based on the output value of the temporal pattern attention mechanism and the final weight of the photovoltaic power generation prediction model, a future historical power generation prediction result is obtained;

[0145] For example, the final photovoltaic power generation prediction model output y t-1 As shown below:

[0146] y t-1 =W h′ h t '

[0147] Among them, y t-1 is the output value of the photovoltaic power generation prediction model, that is, the future historical power generation prediction result, W h′is the final weight of the photovoltaic power generation prediction model, h t ′ is the output value of the temporal pattern attention mechanism.

[0148] Wherein, the time pattern matrix includes multiple eigenvalues.

[0149] In one implementation, the characteristic value is calculated as follows:

[0150]

[0151] in, is the eigenvalue extracted by the jth convolution kernel from the i-th row vector, H i,(t-w-1+l) is the eigenvalue extracted by the i-th row vector through the convolution kernel with a length of tw-1+l, C j,T-w+l is the j-th convolution kernel with a length of T-w+l, w is the length of the historical power generation data sequence, C is the convolution kernel, T is the maximum weight extracted by the convolution kernel, and l is the padding length in the convolution operation.

[0152] For example, usually T=w.

[0153] In one implementation, the scoring function is expressed as follows:

[0154]

[0155] in, is the evaluation function, is the transpose of the i-th row vector of the temporal pattern matrix, is the i-th row vector of the time pattern matrix, h t is the current hidden state, W a The invention provides a training weight matrix for the scoring function; the temporal pattern attention mechanism of the present invention can understand the complex dynamic relationship between the hidden state matrix and the current hidden state of the convolutional long short-term memory network, and then dynamically adjust the contribution to the prediction task to improve the accuracy of the prediction; based on the temporal pattern matrix and the current hidden state, the correlation between the two is calculated through the scoring function, and the key features are obtained through the subsequent calculation of the context vector and the training weights, so as to effectively capture the long-term dependency; the convolution calculation of the temporal pattern matrix within the convolution kernel range can be clarified through the calculation formula of the eigenvalue; the correlation between the temporal pattern matrix and the current hidden state is clarified through the expression of the scoring function.

[0156] The above step 4, based on the test set, corrects the trained photovoltaic power generation prediction model to complete the construction of the photovoltaic power generation prediction model, including:

[0157] Constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model according to a preset prediction demand time step and the photovoltaic power generation prediction model;

[0158] Calculating the value of the evaluation index of the single-step photovoltaic power generation prediction model or the multi-step photovoltaic power generation prediction model according to the test set;

[0159] For example, in order to evaluate the accuracy of the prediction results of the single-step photovoltaic power generation prediction model or the multi-step photovoltaic power generation prediction model and measure the difference between the prediction results and the actual results, the values ​​of five evaluation indicators are used to evaluate the performance of the prediction model. The values ​​of these evaluation indicators include mean absolute error (MAE), mean squared error (MSE), root mean square error (RMSE), normalized mean absolute error (NMAE) and normalized root mean square error (NRMSE), which are calculated as follows:

[0160]

[0161] Among them, MAE is the mean absolute error, y z is the zth actual historical power generation data in the test set, is the corresponding predicted historical power generation data obtained by the single-step photovoltaic power generation prediction model or the multi-step photovoltaic power generation prediction model, and u is the number of actual historical power generation data;

[0162]

[0163] Among them, MSE is the mean square error;

[0164]

[0165] Among them, RMSE is the root mean square error;

[0166]

[0167] Among them, NRMSE is the standardized root mean square error, y max is the maximum value of the actual historical power generation data in the test set, y min is the minimum value of the actual historical power generation data in the test set;

[0168]

[0169] Among them, NMAE is the normalized mean absolute error.

[0170] According to the value of the evaluation index each time, the trained photovoltaic power generation prediction model is corrected, and when the value of the evaluation index reaches the value of the preset evaluation index, the construction of the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model is completed;

[0171] The value of the evaluation index includes at least one or more of the following: mean absolute error, mean square error, root mean square error, standardized mean absolute error and standardized root mean square error.

[0172] In one implementation, the photovoltaic power generation prediction model that has been trained is corrected according to the value of the evaluation index each time. When the value of the evaluation index reaches the value of the preset evaluation index, after the construction of the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model is completed, it also includes:

[0173] Using the real-time power generation data series of the distributed photovoltaic system, the corresponding future power generation prediction results are obtained by constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model;

[0174] According to the future power generation prediction results, the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model are optimized to obtain the optimized single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model; by Figure 4As shown in the schematic diagram, the present invention generates a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model according to the required prediction demand step length, which can meet a variety of demand step lengths; by calculating the value of the evaluation index of the photovoltaic power generation prediction model, the trained single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model are tested, and their obvious advantages over other prediction models are demonstrated; the method proposed in the present invention is to improve the accuracy of the power output prediction of the distributed photovoltaic system, thereby optimizing the use of the energy storage system. This accurate time series output modeling is crucial to improving the efficiency of the integration of the photovoltaic system and the energy storage system. Through this innovative method, a more balanced management can be achieved between power supply and demand, and the stability and reliability of the entire energy system can be enhanced. In addition, it also helps to promote a better integration of renewable energy with the existing power grid, and supports grid operators, energy planners and users to make more informed decisions on energy management; the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model of the present invention uniquely combine the time series pattern attention mechanism (TPA) and the convolutional long short-term memory (ConvLSTM) to improve the prediction accuracy of the power output of the distributed photovoltaic system. This prediction model ensures data quality and prediction accuracy by finely processing and analyzing spatiotemporal data, especially using the 3σ rule to handle outliers. The performance of the prediction model, especially in terms of mean absolute error (MAE) and root mean square error (RMSE), shows its obvious advantages over other prediction models. In addition, the present invention can optimize the integration of photovoltaic systems and power grids, which not only reduces the volatility of the power grid, but also improves the overall stability of the energy system. The contribution of this technology in reducing environmental impact and promoting sustainable energy development is also an important aspect that it wants to protect, reflecting the high attention paid to sustainable technologies in today's energy market.

[0175] Embodiment 2:

[0176] Based on the same inventive concept, the present invention patent application also provides a photovoltaic power generation prediction model construction system such as Figure 5 As shown, it includes: a training data division module, a photovoltaic power generation prediction model building module, a photovoltaic power generation prediction model training module and a photovoltaic power generation prediction model correction module;

[0177] The training data division module is used to collect multiple historical power generation data sequences of the distributed photovoltaic system and divide the historical power generation data sequences into a training set and a test set;

[0178] The photovoltaic power generation prediction model building module is used to build a photovoltaic power generation prediction model based on a convolutional long short-term memory network and a temporal pattern attention mechanism;

[0179] The photovoltaic power generation prediction model training module is used to take each historical power generation data sequence in the training set as input, take the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, iteratively train the photovoltaic power generation prediction model until the number of training iterations reaches a preset number of training iterations, and complete the training of the photovoltaic power generation prediction model;

[0180] The photovoltaic power generation prediction model correction module is used to correct the trained photovoltaic power generation prediction model based on the test set to complete the construction of the photovoltaic power generation prediction model;

[0181] Wherein, during each iterative training of the photovoltaic power generation prediction model, the hidden state matrix and the current hidden state of the convolutional long short-term memory network are updated.

[0182] Preferably, the training data partitioning module is used to:

[0183] Collect multiple historical power generation data sequences of distributed photovoltaic systems, use the 3σ rule to process abnormal data, and obtain the historical power generation data sequence after abnormal data processing;

[0184] Performing data normalization and data denormalization operations on the historical power generation data sequence after abnormal data processing to obtain the final historical power generation data sequence;

[0185] The final historical power generation data sequence is divided into a training set and a test set.

[0186] Preferably, the convolutional long short-term memory network includes: an input gate, a forget gate and an output gate; the photovoltaic power generation prediction model training module includes:

[0187] A training convolutional long short-term memory network submodule is used to take each historical power generation data sequence in the training set as input, take the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, train the input gate, forget gate and output gate in sequence, and obtain the hidden state matrix and current hidden state corresponding to the training set;

[0188] A training temporal pattern attention mechanism submodule is used to use a pre-built temporal pattern attention mechanism to perform convolution calculation on the hidden state matrix, and obtain a future historical power generation prediction result by combining the temporal pattern matrix obtained by the convolution calculation with the current hidden state using a scoring function;

[0189] An iterative training submodule, used to adjust the model parameters in the photovoltaic power generation prediction model according to the future historical power generation prediction result and the error of the future historical power generation data sequence, and perform iterative training again, and update the hidden state matrix and the current hidden state during each iterative training of the photovoltaic power generation prediction model, until the number of training iterations reaches a preset number of training iterations, and the training of the photovoltaic power generation prediction model is completed;

[0190] The future historical power generation data sequence is a historical power generation data sequence at a future moment relative to the historical power generation data sequence.

[0191] Preferably, the training temporal pattern attention mechanism submodule is used to:

[0192] Through a pre-constructed temporal pattern attention mechanism, the convolution kernel of the output gate is used to perform convolution calculation on the row vector of the hidden state matrix to extract the temporal pattern matrix within the convolution kernel range;

[0193] Using a scoring function, calculating the correlation between the temporal pattern matrix and the current hidden state, and using an activation function sigmoid to normalize the correlation to obtain an attention weight of the row vector;

[0194] Perform weighted summation on the temporal pattern matrix of each row vector and the corresponding attention weight to obtain the context vector;

[0195] Calculating an output value of the temporal pattern attention mechanism based on the context vector, the current hidden state, the training weight of the convolutional long short-term memory network output state, and the training weight of the context vector;

[0196] Based on the output value of the temporal pattern attention mechanism and the final weight of the photovoltaic power generation prediction model, a future historical power generation prediction result is obtained;

[0197] Wherein, the time pattern matrix includes multiple eigenvalues.

[0198] Preferably, the calculation formula of the characteristic value is as follows:

[0199]

[0200] in, is the eigenvalue extracted by the jth convolution kernel from the i-th row vector, H i,(t-w-1+l) is the eigenvalue extracted by the i-th row vector through the convolution kernel with a length of tw-1+l, C j,T-w+l is the j-th convolution kernel with a length of T-w+l, w is the length of the historical power generation data sequence, C is the convolution kernel, T is the maximum weight extracted by the convolution kernel, and l is the padding length in the convolution operation.

[0201] Preferably, the scoring function is expressed as follows:

[0202]

[0203] in, is the evaluation function, is the transpose of the i-th row vector of the temporal pattern matrix, is the i-th row vector of the time pattern matrix, h t is the current hidden state, W a is the training weight matrix of the scoring function.

[0204] Preferably, the photovoltaic power generation prediction model correction module is used to:

[0205] Constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model according to a preset prediction demand time step and the photovoltaic power generation prediction model;

[0206] Calculating the value of the evaluation index of the single-step photovoltaic power generation prediction model or the multi-step photovoltaic power generation prediction model according to the test set;

[0207] According to the value of the evaluation index each time, the trained photovoltaic power generation prediction model is corrected, and when the value of the evaluation index reaches the value of the preset evaluation index, the construction of the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model is completed;

[0208] The value of the evaluation index includes at least one or more of the following: mean absolute error, mean square error, root mean square error, standardized mean absolute error and standardized root mean square error.

[0209] Preferably, the system further comprises: a model optimization module, configured to:

[0210] Using the real-time power generation data series of the distributed photovoltaic system, the corresponding future power generation prediction results are obtained by constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model;

[0211] According to the future power generation prediction result, the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model are optimized to obtain the optimized single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model.

[0212] Example 3

[0213] like Figure 6As shown, the present invention also provides an electronic device, which may be a computer device, a single-chip device, an intelligent mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, the processor, and the transceiver component are connected via a bus; the memory may be used to store an execution program, and an exemplary execution program may include instructions; the processor is used to execute the instructions stored in the memory. The memory may also be used to store data, which may be called and / or modified when the instructions are executed.

[0214] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in a storage medium to implement the corresponding method flow or corresponding functions, so as to implement the steps of a method for constructing a photovoltaic power generation prediction model in the above-mentioned embodiment.

[0215] Example 4

[0216] Based on the same inventive concept, the present invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It can be understood that the storage medium here can include both built-in storage media in electronic devices and, of course, extended storage media supported by electronic devices. The storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more execution programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor loads and executes one or more instructions stored in the storage medium, which can implement the steps of a method for constructing a photovoltaic power generation prediction model in the above embodiment.

[0217] It should be understood by those skilled in the art that the embodiments of the present invention patent application can be provided as methods, systems, or computer program products. Therefore, the present invention patent application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention patent application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

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

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

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

[0221] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the patent application of the present invention rather than to limit its protection scope. Although the patent application of the present invention is described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that after reading the patent application of the present invention, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the application, but these changes, modifications or equivalent substitutions are all within the protection scope of the claims to be approved.

Claims

1. A method for constructing a photovoltaic power generation prediction model, characterized in that: include: Collecting multiple historical power generation data sequences of a distributed photovoltaic system, and dividing the historical power generation data sequences into a training set and a test set; Build a photovoltaic power generation prediction model based on convolutional long short-term memory network and temporal pattern attention mechanism; Taking each historical power generation data sequence in the training set as input and taking the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, iteratively training the photovoltaic power generation prediction model until the number of training iterations reaches a preset number of training iterations, thereby completing the training of the photovoltaic power generation prediction model; Based on the test set, the trained photovoltaic power generation prediction model is modified to complete the construction of the photovoltaic power generation prediction model; Wherein, during each iterative training of the photovoltaic power generation prediction model, the hidden state matrix and the current hidden state of the convolutional long short-term memory network are updated.

2. The method according to claim 1, characterized in that The collecting of multiple historical power generation data sequences of the distributed photovoltaic system and dividing the historical power generation data sequences into a training set and a test set includes: Collect multiple historical power generation data sequences of distributed photovoltaic systems, use the 3σ rule to process abnormal data, and obtain the historical power generation data sequence after abnormal data processing; Performing data normalization and data denormalization operations on the historical power generation data sequence after abnormal data processing to obtain the final historical power generation data sequence; The final historical power generation data sequence is divided into a training set and a test set.

3. The method according to claim 1, characterized in that The convolutional long short-term memory network includes: an input gate, a forget gate and an output gate; the photovoltaic power generation prediction model is iteratively trained by taking each historical power generation data sequence in the training set as input and taking the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output until the number of training iterations reaches a preset number of training iterations, and the training of the photovoltaic power generation prediction model is completed, including: Taking each historical power generation data sequence in the training set as input and taking the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, sequentially training the input gate, the forget gate and the output gate to obtain the hidden state matrix and the current hidden state corresponding to the training set; Using a pre-built temporal pattern attention mechanism, convolution calculation is performed on the hidden state matrix, and according to the temporal pattern matrix obtained by the convolution calculation combined with the current hidden state, a scoring function is used to obtain a future historical power generation prediction result; According to the future historical power generation prediction result and the error of the future historical power generation data sequence, the model parameters in the photovoltaic power generation prediction model are adjusted, and iterative training is performed again, and when the photovoltaic power generation prediction model is iteratively trained each time, the hidden state matrix and the current hidden state are updated until the number of training iterations reaches a preset number of training iterations, and the training of the photovoltaic power generation prediction model is completed; The future historical power generation data sequence is a future historical power generation data sequence relative to the historical power generation data sequence.

4. The method according to claim 3, characterized in that The pre-built temporal pattern attention mechanism is used to perform convolution calculation on the hidden state matrix, and the temporal pattern matrix obtained by the convolution calculation is combined with the current hidden state, and a scoring function is used to obtain the future historical power generation prediction result, including: Through a pre-constructed temporal pattern attention mechanism, the convolution kernel of the output gate is used to perform convolution calculation on the row vector of the hidden state matrix to extract the temporal pattern matrix within the convolution kernel range; Using a scoring function, calculating the correlation between the temporal pattern matrix and the current hidden state, and using an activation function sigmoid to normalize the correlation to obtain an attention weight of the row vector; Perform weighted summation on the temporal pattern matrix of each row vector and the corresponding attention weight to obtain the context vector; Calculating an output value of the temporal pattern attention mechanism based on the context vector, the current hidden state, the training weight of the convolutional long short-term memory network output state, and the training weight of the context vector; Based on the output value of the temporal pattern attention mechanism and the final weight of the photovoltaic power generation prediction model, a future historical power generation prediction result is obtained; Wherein, the time pattern matrix includes multiple eigenvalues.

5. The method according to claim 4, characterized in that The calculation formula of the eigenvalue is as follows: in, is the eigenvalue extracted by the jth convolution kernel from the i-th row vector, H i,(t-w-1+l) is the eigenvalue extracted by the i-th row vector through the convolution kernel with a length of tw-1+l, C j,T-w+l is the j-th convolution kernel with a length of T-w+l, w is the length of the historical power generation data sequence, C is the convolution kernel, T is the maximum weight extracted by the convolution kernel, and l is the padding length in the convolution operation.

6. The method according to claim 4, characterized in that The expression of the scoring function is as follows: in, is the evaluation function, is the transpose of the i-th row vector of the temporal pattern matrix, is the i-th row vector of the time pattern matrix, h t is the current hidden state, W a is the training weight matrix of the scoring function.

7. The method according to claim 1, characterized in that The step of modifying the trained photovoltaic power generation prediction model based on the test set to complete the construction of the photovoltaic power generation prediction model includes: Constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model according to a preset prediction demand time step and the photovoltaic power generation prediction model; Calculating the value of the evaluation index of the single-step photovoltaic power generation prediction model or the multi-step photovoltaic power generation prediction model according to the test set; According to the value of the evaluation index each time, the trained photovoltaic power generation prediction model is corrected, and when the value of the evaluation index reaches the value of the preset evaluation index, the construction of the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model is completed; The value of the evaluation index includes at least one or more of the following: mean absolute error, mean square error, root mean square error, standardized mean absolute error and standardized root mean square error.

8. The method according to claim 7, characterized in that According to the value of the evaluation index each time, the trained photovoltaic power generation prediction model is corrected. When the value of the evaluation index reaches the value of the preset evaluation index, after the construction of the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model is completed, the method further includes: Using the real-time power generation data series of the distributed photovoltaic system, the corresponding future power generation prediction results are obtained by constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model; According to the future power generation prediction result, the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model are optimized to obtain the optimized single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model.

9. A system for constructing a photovoltaic power generation prediction model, characterized in that: include: Training data division module, photovoltaic power generation prediction model building module, photovoltaic power generation prediction model training module and photovoltaic power generation prediction model correction module; The training data division module is used to collect multiple historical power generation data sequences of the distributed photovoltaic system and divide the historical power generation data sequences into a training set and a test set; The photovoltaic power generation prediction model building module is used to build a photovoltaic power generation prediction model based on a convolutional long short-term memory network and a temporal pattern attention mechanism; The photovoltaic power generation prediction model training module is used to take each historical power generation data sequence in the training set as input, take the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, iteratively train the photovoltaic power generation prediction model until the number of training iterations reaches a preset number of training iterations, and complete the training of the photovoltaic power generation prediction model; The photovoltaic power generation prediction model correction module is used to correct the trained photovoltaic power generation prediction model based on the test set to complete the construction of the photovoltaic power generation prediction model; Wherein, during each iterative training of the photovoltaic power generation prediction model, the hidden state matrix and the current hidden state of the convolutional long short-term memory network are updated.

10. The system according to claim 9, characterized in that The training data partitioning module is used to: Collect multiple historical power generation data sequences of distributed photovoltaic systems, use the 3σ rule to process abnormal data, and obtain the historical power generation data sequence after abnormal data processing; Performing data normalization and data denormalization operations on the historical power generation data sequence after abnormal data processing to obtain the final historical power generation data sequence; The final historical power generation data sequence is divided into a training set and a test set.

11. The system according to claim 9, characterized in that The convolutional long short-term memory network includes: an input gate, a forget gate and an output gate; the photovoltaic power generation prediction model training module includes: A training convolutional long short-term memory network submodule is used to take each historical power generation data sequence in the training set as input, take the future historical power generation data sequence corresponding to each historical power generation data sequence in the training set as output, train the input gate, forget gate and output gate in sequence, and obtain the hidden state matrix and current hidden state corresponding to the training set; A training temporal pattern attention mechanism submodule is used to use a pre-built temporal pattern attention mechanism to perform convolution calculation on the hidden state matrix, and obtain a future historical power generation prediction result by combining the temporal pattern matrix obtained by the convolution calculation with the current hidden state using a scoring function; An iterative training submodule, used to adjust the model parameters in the photovoltaic power generation prediction model according to the future historical power generation prediction result and the error of the future historical power generation data sequence, and perform iterative training again, and update the hidden state matrix and the current hidden state during each iterative training of the photovoltaic power generation prediction model, until the number of training iterations reaches a preset number of training iterations, and the training of the photovoltaic power generation prediction model is completed; The future historical power generation data sequence is a historical power generation data sequence at a future moment relative to the historical power generation data sequence.

12. The system according to claim 11, characterized in that The training temporal pattern attention mechanism submodule is used to: Through a pre-constructed temporal pattern attention mechanism, the convolution kernel of the output gate is used to perform convolution calculation on the row vector of the hidden state matrix to extract the temporal pattern matrix within the convolution kernel range; Using a scoring function, calculating the correlation between the temporal pattern matrix and the current hidden state, and using an activation function sigmoid to normalize the correlation to obtain an attention weight of the row vector; Perform weighted summation on the temporal pattern matrix of each row vector and the corresponding attention weight to obtain the context vector; Calculating an output value of the temporal pattern attention mechanism based on the context vector, the current hidden state, the training weight of the convolutional long short-term memory network output state, and the training weight of the context vector; Based on the output value of the temporal pattern attention mechanism and the final weight of the photovoltaic power generation prediction model, a future historical power generation prediction result is obtained; Wherein, the time pattern matrix includes multiple eigenvalues.

13. The system of claim 12, wherein: The calculation formula of the eigenvalue is as follows: in, is the eigenvalue extracted by the jth convolution kernel from the i-th row vector, H i,(t-w-1+l) is the eigenvalue extracted by the i-th row vector through the convolution kernel with a length of tw-1+l, C j,T-w+l is the j-th convolution kernel with a length of T-w+l, w is the length of the historical power generation data sequence, C is the convolution kernel, T is the maximum weight extracted by the convolution kernel, and l is the padding length in the convolution operation.

14. The system of claim 12, wherein: The expression of the scoring function is as follows: in, is the evaluation function, is the transpose of the i-th row vector of the temporal pattern matrix, is the i-th row vector of the temporal pattern matrix, h t is the current hidden state, W a is the training weight matrix of the scoring function.

15. The system of claim 9, wherein: The photovoltaic power generation prediction model correction module is used to: Constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model according to a preset prediction demand time step and the photovoltaic power generation prediction model; Calculating the value of the evaluation index of the single-step photovoltaic power generation prediction model or the multi-step photovoltaic power generation prediction model according to the test set; According to the value of the evaluation index each time, the trained photovoltaic power generation prediction model is corrected, and when the value of the evaluation index reaches the value of the preset evaluation index, the construction of the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model is completed; The value of the evaluation index includes at least one or more of the following: mean absolute error, mean square error, root mean square error, standardized mean absolute error and standardized root mean square error.

16. The system of claim 14, wherein: The system further comprises: a model optimization module, configured to: Using the real-time power generation data series of the distributed photovoltaic system, the corresponding future power generation prediction results are obtained by constructing a single-step photovoltaic power generation prediction model and a multi-step photovoltaic power generation prediction model; According to the future power generation prediction result, the single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model are optimized to obtain the optimized single-step photovoltaic power generation prediction model and the multi-step photovoltaic power generation prediction model.

17. An electronic device, characterized in that: include: at least one processor and memory; The memory and the processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, a method for constructing a photovoltaic power generation prediction model as described in any one of claims 1 to 8 is implemented.

18. A readable storage medium, characterized in that: An execution program is stored thereon, and when the execution program is executed, a method for constructing a photovoltaic power generation prediction model as described in any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Photovoltaic power generation power prediction model training method, prediction method, device, equipment and medium

    CN119853033A

  • Distributed energy scheduling method and system based on virtual power plant

    CN121481367A