A photovoltaic power generation power prediction method and system based on historical data

Through an encoder-decoder model with an attention mechanism, photovoltaic power generation prediction is automatically adjusted, solving the problem of low prediction in sunny scenarios, improving prediction accuracy and reducing operation and maintenance costs.

CN119093342BActive Publication Date: 2025-10-21STATE GRID HUNAN ELECTRIC POWER COMPANY LIMITED +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411177002.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2025-10-21
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

The existing photovoltaic power prediction model underestimates the power generation in sunny scenarios, resulting in low prediction accuracy. The manual coefficient adjustment method also increases the operation and maintenance time cost.

Method used

An encoder-decoder model with an attention mechanism is adopted. By obtaining historical actual power generation, weather forecasts and historical meteorological data, the attention mechanism and recurrent neural network are used to automatically adjust the amplitude of predicted power generation and improve prediction accuracy.

Benefits of technology

High-precision photovoltaic power generation prediction is achieved under sunny scenarios. The model is adaptive and does not require manual setting of coefficients, reducing operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119093342B_ABST
    Figure CN119093342B_ABST
Patent Text Reader

Abstract

The application discloses a photovoltaic power generation power prediction method and system based on historical data, and the prediction method comprises the following steps: acquiring one or more of historical actual power generation, weather forecast and historical weather data, inputting the data into an encoder of a model to obtain a preliminary prediction result; acquiring a template day, and representing actual power generation data and predicted irradiance data of the template day in the form of a matrix to obtain a knowledge representation vector; inputting the preliminary prediction result, the knowledge representation vector and a hidden state of a decoder into an Attention module of the model to output a context variable context; and inputting one or more of the historical actual power generation, the weather forecast and the historical weather data and the context variable context into a decoder of the model to obtain a photovoltaic power generation power prediction value. The application has the advantages of high prediction accuracy and good self-adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to the technical field of photovoltaic power generation prediction, and in particular to a photovoltaic power generation power prediction method and system based on historical data. Background Art

[0002] With the increasing application of photovoltaic power generation systems, more and more photovoltaic power sources are being connected to the distribution network, posing enormous challenges to the planning, operation, and control of power systems. Since solar radiation is closely related to meteorological conditions, the output power of photovoltaic power generation systems is inherently random and volatile. Given that the mismatch between power storage facilities and renewable energy grid-connected power is difficult to change in the short term, the connection of large-scale photovoltaic power generation systems to the grid will have a significant impact on the safe and stable operation of the power system. This is also a key technical issue that needs to be addressed for the large-scale connection of photovoltaic power generation to the grid. Countries around the world have successively carried out technical research on photovoltaic power generation power prediction, which is of great significance to the stable operation of power systems. It helps power system dispatching departments coordinate the power generation planning of conventional energy and photovoltaic power generation, and rationally arrange the operation mode of the power grid.

[0003] Currently, most models used to predict photovoltaic power generation are machine learning and deep learning models. Existing photovoltaic power generation prediction models map forecasted weather, historical weather data, and historical power generation data to power generation data for power plants. This mapping is then used to predict future power generation at photovoltaic sites. Due to inaccuracies in weather forecast data, there can be discrepancies between predicted and actual power generation. A common discrepancy is that predicted power generation is lower than actual power generation on sunny days (related to factors such as weather data, training data, and model limitations). To address this issue, the model's predicted power generation can be adjusted by adjusting coefficients. Post-processing the model's predictions using coefficients can effectively address the issue of low predicted power generation on sunny days. However, the determination and adjustment of coefficients require regular manual updates. If the number of sites is large, manually updating coefficients increases operational time and costs. Summary of the Invention

[0004] In order to solve the technical problems existing in the prior art, the present invention provides a photovoltaic power generation prediction method and system based on historical data with high prediction accuracy.

[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is:

[0006] A photovoltaic power generation prediction method based on historical data is implemented using an encoder-decoder model with an attention mechanism. The prediction method includes the following steps:

[0007] Obtain one or more of historical actual power generation, weather forecast, and historical weather data, and input them into the model encoder to obtain a preliminary prediction result;

[0008] A template day is obtained, and the actual power generation data and forecast irradiation intensity data for the template day are represented in the form of a matrix to obtain a knowledge representation vector. The date on which the correlation coefficient between the actual power generation curve and the forecast irradiation intensity curve corresponding to that day reaches a threshold is called the template day.

[0009] Input the preliminary prediction result, knowledge representation vector and implicit state of the decoder into the Attention module of the model and output the context variable context;

[0010] One or more of the historical actual generated power, weather forecast and historical meteorological data, and the context variable context are input into the decoder of the model to obtain the predicted value of photovoltaic power generation.

[0011] Preferably, the weather forecast includes forecast irradiance, forecast temperature, forecast humidity, forecast wind speed and forecast air pressure; and the historical meteorological data includes measured irradiance, measured temperature, measured humidity, measured wind speed and measured air pressure.

[0012] Preferably, the correlation coefficient ρ between the actual power generation curve and the forecast irradiation intensity curve corresponding to the day is X,Y The calculation formula is:

[0013]

[0014] Among them, X and Y represent the actual power generation and weather forecast irradiation intensity respectively, σ X and σ Y They represent the standard deviation of actual power generation and weather forecast irradiance, μ X and μ Y represent the mean of actual power generation and weather forecast irradiance, For expectation.

[0015] Preferably, the calculation formula of the context variable context is:

[0016]

[0017] Among them, α is the attention weight, seq _in is the length of the input sequence data, q is the implicit state of the decoder; k is the knowledge representation vector; v is the preliminary prediction result output by the encoder.

[0018] Preferably, the attention weight function α(q,k i )for:

[0019]

[0020] Among them, a is the scoring function and exp is the exponential function.

[0021] Preferably, additive attention is used as the scoring function. Given a query q and a key k, the scoring function of additive attention is:

[0022]

[0023] Among them, t v ,W q ,W k is the model parameter, tanh is the hyperbolic tangent function, Indicates that w v Transpose.

[0024] Preferably, in a single time step, the recurrent network layer in the decoder of the model has the hidden layer state s at time step t t for:

[0025] s t =f(s t-1 ,[x t ,context t ])

[0026] Among them, t represents the time step, f() is the recurrent neural network layer, context t is the context variable calculated at the tth time step, x t is the input at time t, [x t ,context t ] means to change x t and context t In x t The feature dimensions are merged.

[0027] The present invention also discloses a computer program product, comprising a computer program, which executes the steps of the above method when executed by a processor.

[0028] The present invention further discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method described above are executed.

[0029] The present invention also discloses a computer system, comprising a memory and a processor connected to each other, wherein a computer program is stored in the memory, and when the computer program is run by the processor, the steps of the above method are executed.

[0030] Compared with the prior art, the advantages of the present invention are:

[0031] The prediction method of the present invention can automatically adjust the amplitude of the predicted power generation based on the historical power generation, effectively improving the prediction ability of the model in sunny scenes with high prediction accuracy. Compared with the traditional coefficient adjustment method, the advantage of the present invention is that the model is adaptive and does not require manual setting of coefficients. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 This is a framework diagram of the prediction model of the present invention.

[0033] Figure 2 The flowchart of the prediction method in an embodiment of the present invention is shown in FIG. DETAILED DESCRIPTION

[0034] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0035] like Figure 1-Figure 2 As shown, the photovoltaic power generation power prediction method based on historical data provided by the embodiment of the present invention is implemented using an encoder-decoder model with an attention mechanism. The prediction method includes the following steps:

[0036] 1) Obtain one or more combinations of historical actual power generation, weather forecasts, and historical meteorological data (any two data combinations, or all three data), input them into the model encoder, and obtain preliminary prediction results;

[0037] 2) Obtain a template day and represent the actual power generation data and forecast irradiation intensity data for the template day in the form of a matrix to obtain a knowledge representation vector. The date on which the correlation coefficient between the actual power generation curve and the forecast irradiation intensity curve corresponding to that day reaches a threshold is called the template day.

[0038] 3) Input the preliminary prediction results, knowledge representation vector and implicit state of the decoder into the Attention module of the model and output the context variable context;

[0039] 4) Input one or more combinations of historical actual power generation, weather forecast, and historical meteorological data (any two data combinations, or all three data), as well as the context variable context, into the model decoder to obtain the predicted value of photovoltaic power generation.

[0040] Specifically, if Figure 1 As shown in the figure, the model framework for predicting photovoltaic power generation in the present invention is an encoder-decoder model with an attention mechanism. The data input to the model is sequence data with a dimension of bs×seq _in ×d, where bs is the number of single batch data, seq _in is the length of the input sequence data, d is the number of features; parameters bs, seq_in And the value of d can be determined based on the actual problem;

[0041] The features input to the model are historical actual power generation, weather forecasts (forecast irradiation, forecast temperature, forecast humidity, forecast wind speed, forecast air pressure, etc.), and historical meteorological data (measured irradiation, measured temperature, measured humidity, measured wind speed, measured air pressure, etc.);

[0042] The model output is the power prediction value, with the dimension of bs×seq _out , seq _out The length of the output sequence data.

[0043] in Figure 1 The model framework in [1] was first used for machine translation problems and is used for sequence-to-sequence learning. The recurrent neural network encoder in this framework converts the input sequence into a fixed-dimensional context variable. The recurrent neural network decoder then generates an output (target) sequence of tokens based on the generated tokens and the context variables. In the original encoder-decoder framework, the context variables were fixed. With the introduction of the attention mechanism, the context variables can be adjusted based on the current prediction.

[0044] Figure 1 The encoder part is a recurrent network layer, and the internal framework and parameters of the recurrent network layer are determined by the actual problem.

[0045] The internal framework and parameters of the recurrent neural network in the decoder are also determined by the actual problem. Context is the context variable. The recurrent neural network layer can be a gated recurrent unit (GRU) or a long short-term memory (LSTM).

[0046] Specifically, in sunny scenes, the actual power generation curve is stable and bell-shaped. The present invention puts the measured power curve and the predicted irradiation intensity of the sunny scene into the model for training. The criterion for whether to put the actual power generation curve of a certain day into the model for training is: whether the correlation coefficient between the actual power generation curve and the predicted irradiation intensity curve of the day reaches a threshold, the correlation coefficient ρ X,Y The calculation formula is shown in formula (1):

[0047]

[0048] Among them, X and Y represent the actual power generation and weather forecast irradiation intensity respectively, σ X and σ Y Indicates the standard deviation of actual power generation and weather forecast irradiance, μ X and μ Yrepresents the mean of actual power generation and weather forecast irradiation, For expectation.

[0049] In step 2), the date when the correlation between the actual power generation curve and the forecast irradiation intensity curve corresponding to that day reaches the threshold is called the template day, and the actual power generation data and forecast irradiation intensity data of the template day are represented in the form of a matrix with a dimension of L×2, where L is the data length. For example, 3 template days are selected from the historical data for predicting future power generation, with 96 moments a day (15-minute resolution), and the value of L is 3x96. Since only the actual power generation curve and the forecast irradiation intensity curve corresponding to that day are used, the matrix obtained by representation has only two columns of data. The date covered by the template day data must be before the date corresponding to the target value. For example, if the model predicts the power generation for the whole day on May 30, 2024, the template day can only cover dates on and before May 28, 2024.

[0050] In step 3), the template is represented in the form of a matrix and fused with the original model using the attention mechanism. Figure 1 As shown, the knowledge representation item is a matrix containing template day information.

[0051] Figure 1 The context variable context in is calculated by formula (2):

[0052]

[0053] Among them, α is the attention weight, seq _Yn is the length of the input sequence data, q is the implicit state of the decoder, that is, Figure 1 The hidden state in , so the dimension of q is determined by the dimension of the input data and the recurrent neural network model framework in the decoder; k is the knowledge representation, so the dimension of k is determined by the matrix representing the template day; and v is the final output of the encoder after all time steps are completed, that is Figure 1 The output in , so the dimension of v is determined by the dimension of the input data and the recurrent neural network model framework in the encoder. Figure 1 The Attention module in derives the context variable context based on the output of the encoder, the knowledge representation vector, and the implicit state of the decoder.

[0054] Attention weight function α(q,k i ) is given by formula (3):

[0055]

[0056] Among them, a is the scoring function and exp is the exponential function.

[0057] Furthermore, the present invention adopts additive attention as the scoring function. Given a query q and a key k, the scoring function of additive attention is shown in formula (4):

[0058]

[0059] Among them, w v ,W q ,W k is the model parameter, tanh is the hyperbolic tangent function, Indicates that w v Transpose.

[0060] In step 4), the context variables and input data are combined and input into the recurrent neural network layer in the decoder. That is, in a single time step, the hidden layer state s of the recurrent network layer in the decoder at time step t is t Calculated by formula (5):

[0061] s t =f(s t-1 ,[x t ,context t ]) (5)

[0062] Among them, t represents the time step, f() is the recurrent neural network layer, context t is the context variable calculated at the tth time step, x t is the input at time t, [x t ,context t ] means to change x t and context t In x t The feature dimensions are merged.

[0063] In a conventional encoder-decoder model with an attention mechanism, the key k and the value v are both the final output of the recurrent neural network layer in the encoder. Therefore, the dimensions of k and v are the same. In the present invention, the key k is the knowledge representation, and the value v is the final output of the recurrent neural network layer in the encoder. To ensure the consistency of the dimensions of the two, in actual applications, the length of the matrix of the selected template representation needs to be consistent with the length of the sequence data input to the model, both of which are seq _in , which is the length of the input sequence data.

[0064] Since the decoder's implicit state is the query and the template day is the key, the purpose of taking a weighted average of the decoder's implicit state at the current time step and the template day is to evaluate whether the predicted power generation at the current time step is similar to the historical power generation in the template day. If so, the data at that time in the template day will be given a larger weight.

[0065] The prediction method of the present invention can automatically adjust the amplitude of the predicted power generation based on the historical power generation, effectively improving the prediction ability of the model in sunny scenes; compared with the traditional coefficient adjustment method, the advantage of the present invention is that the model is adaptive and does not require manual setting of coefficients.

[0066] The steps of the above prediction method in specific application are:

[0067] 1. Determine the input sequence data length, input sequence data characteristics, and output sequence data length, prepare training data based on the determined parameters, and divide the training data into training set, validation set, and test set;

[0068] 2. Determine the correlation coefficient threshold and select the template day based on the determined parameters and historical data;

[0069] 3. Determine the recurrent neural network module framework for the encoder part, the recurrent neural network module framework for the decoder part, and the attention mechanism module framework, and build the model based on the determined framework parameters;

[0070] 4. Determine the training model hyperparameters, such as learning rate, number of single batch data (bs), and training rounds (epochs);

[0071] 4.1. After each round of training, the model trained in that round is applied to the validation set to obtain the prediction results, and the mean square error (MSE) is calculated based on the prediction results and the target value.

[0072] 4.2. After all rounds are completed, the MSE obtained on the validation set is compared. The model trained in the round with the smallest MSE will be used as the optimal model for testing and subsequent power prediction.

[0073] The present invention also discloses a computer program product, including a computer program that, when executed by a processor, performs the steps of the above-described method. The present invention further discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the above-described method. The present invention also discloses a computer system, including a memory and a processor connected to each other, the memory having a computer program stored thereon, which, when executed by the processor, performs the steps of the above-described method. The products, media, and systems of the present invention correspond to the above-described method and also have the advantages described for the above-described method.

[0074] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned method embodiment. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media include: any entity or device that can carry computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. The memory is used to store computer programs and / or modules, and the processor implements various functions by running or executing computer programs and / or modules stored in the memory, and calling data stored in the memory. The memory may include high-speed random access memory and non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0075] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the principles of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A photovoltaic power generation prediction method based on historical data is implemented using an encoder-decoder model with an attention mechanism, characterized in that: The prediction method includes the following steps: Obtain one or more of historical actual power generation, weather forecast, and historical weather data, and input them into the model encoder to obtain a preliminary prediction result; A template day is obtained, and the actual power generation data and forecast irradiation intensity data of the template day are represented in the form of a matrix to obtain a knowledge representation vector. The date when the correlation coefficient between the actual power generation curve and the forecast irradiation intensity curve corresponding to that day reaches a threshold is called the template day. Input the preliminary prediction result, knowledge representation vector and implicit state of the decoder into the Attention module of the model and output the context variable context; One or more of historical actual generated power, weather forecast and historical meteorological data, and the context variables are input into a decoder of the model to obtain a predicted value of photovoltaic generated power.

2. The photovoltaic power generation prediction method based on historical data according to claim 1, characterized in that: The weather forecast includes forecast irradiance, forecast temperature, forecast humidity, forecast wind speed and forecast air pressure; the historical meteorological data includes measured irradiance, measured temperature, measured humidity, measured wind speed and measured air pressure.

3. The photovoltaic power generation prediction method based on historical data according to claim 1, characterized in that: Correlation coefficient between the actual power generation curve and the forecast irradiation intensity curve corresponding to the day The calculation formula is: in, and They represent the actual power generation and the weather forecast irradiation intensity respectively. and represent the standard deviation of actual power generation and weather forecast irradiance, and represent the mean of actual power generation and weather forecast irradiance, For expectation.

4. The photovoltaic power generation power prediction method based on historical data according to claim 1, 2 or 3, characterized in that: The calculation formula of the context variable context is: in, is the attention weight, is the length of the input sequence data, is the implicit state of the decoder; is the first knowledge representation vector elements; The first prediction result output by the encoder elements.

5. The photovoltaic power generation prediction method based on historical data according to claim 4, characterized in that: Attention weight function for: in, is the scoring function, is an exponential function; is the first knowledge representation vector elements.

6. The photovoltaic power generation prediction method based on historical data according to claim 5, characterized in that: Adopting additive attention as the scoring function, given the query and key , the scoring function of additive attention is: in, are model parameters, is the hyperbolic tangent function, Indicates that Transpose.

7. The photovoltaic power generation prediction method based on historical data according to claim 6, characterized in that: In a single time step, the recurrent network layer in the decoder of the model is at time step The hidden layer state for: in, represents the time step, is the recurrent neural network layer, For the The context variables calculated in time steps are For the Time input, Indicates that and exist The feature dimensions are merged.

8. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are performed.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program performs the steps of the method according to any one of claims 1 to 7.

10. A computer system comprising a memory and a processor connected to each other, wherein a computer program is stored in the memory, wherein: When the computer program is executed by a processor, the computer program performs the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Optical power prediction method and device

    CN110365059A

  • Photovoltaic power station power prediction method and device

    CN116629416A