Photovoltaic power generation power prediction method and system based on historical data

By introducing an encoder-decoder model with attention mechanism into the photovoltaic power prediction model, the problem of low prediction accuracy in sunny days is solved, and the amplitude of predicted power is automatically adjusted, which improves prediction capabilities and reduces operation and maintenance. cost.

CN119093342AActive Publication Date: 2024-12-06STATE GRID HUNAN ELECTRIC POWER COMPANY LIMITED +2
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing photovoltaic power prediction model predicts that the power generation power is lower than the actual power generation power in sunny scenarios, resulting in low prediction accuracy and manual adjustment of coefficients is required to increase the operation and maintenance time cost.

Method used

Using an encoder-decoder model with attention mechanism, by obtaining historical actual power generation power, meteorological forecasts and historical meteorological data, calculate the correlation coefficient and context variables, automatically adjust the amplitude of the predicted power generation power, improve the prediction accuracy, and avoid manual settings. coefficient.

Benefits of technology

The accuracy of photovoltaic power generation prediction in sunny scenes is improved, the adaptability of the model is realized, the operation and maintenance costs are reduced, and the prediction capability is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119093342A_ABST
    Figure CN119093342A_ABST
Patent Text Reader

Abstract

The invention discloses a photovoltaic power generation power prediction method and system based on historical data, and the method comprises the steps: obtaining one or more of historical actual power generation power, weather forecast and historical weather data, and inputting the one or more of historical actual power generation power, weather forecast and historical weather data into an encoder of a model, thereby obtaining a preliminary prediction result; acquiring a template day, and representing actual power generation power data and forecast irradiation intensity data of the template day in a matrix form to obtain a knowledge representation vector; inputting the preliminary prediction result, the knowledge representation vector and the implicit state of the decoder into an Attention module of the model, and outputting a context variable; and inputting one or more of the historical actual power generation power, 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 method has the advantages of high prediction precision, good adaptability and the like.
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 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 connected to the distribution network, which brings huge challenges to the planning, operation, control and other aspects of the power system. Since the amount of solar radiation is closely related to meteorological conditions, the output power of photovoltaic power generation systems is inherently random and volatile. In the case that the mismatch between power storage facilities and new energy grid-connected power is difficult to change in the short term, the access of large-scale photovoltaic power generation systems to the power grid will have a great impact on the safe and stable operation of the power system. This is also a key technical problem that needs to be solved for the large-scale access of photovoltaic power generation to the power 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 the power system, and helps the power system dispatching department to coordinate the power generation planning of conventional energy and photovoltaic power generation, and reasonably arrange the operation mode of the power grid.

[0003] At present, most of the models used to predict photovoltaic power generation are machine learning models and deep learning models. The existing photovoltaic power generation prediction model constructs a mapping relationship between forecast weather, historical weather data, and historical power generation data to power generation of power stations, and uses this mapping relationship to predict the power generation of photovoltaic stations in future time periods. Due to the accuracy of weather forecast data, there will be a deviation between the predicted power generation and the actual power generation. A common type of deviation is that in sunny scenes, the predicted power generation is lower than the actual power generation (related to meteorological data, training data, model limitations, etc.). To address the problem that the predicted power generation in sunny scenes is lower than the actual power generation, the predicted power generation of the model can be stretched by adjusting the coefficients. Post-processing the model prediction results by using coefficients can effectively solve the problem of low predicted power generation in sunny scenes, but the determination and adjustment of coefficients need to be manually updated regularly. If the number of sites is too large, manually updating the coefficients will increase the time cost of operation and maintenance. Summary of the invention

[0004] In view of 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 encoder of the model to obtain a preliminary prediction result;

[0008] A template day is obtained, and the actual power generation data and the 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 the day reaches a threshold is called the template day;

[0009] Input the preliminary prediction result, the knowledge representation vector and the 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 power generation, 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 irradiance 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, and 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, wherein the computer program executes the steps of the method described above when executed by a processor.

[0028] The present invention further discloses a computer-readable storage medium on which a computer program is stored. 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 method described above 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 predicted power generation based on 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 prediction model framework diagram of the present invention.

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

[0034] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.

[0035] like Figure 1-Figure 2 As shown, the photovoltaic power generation prediction method based on historical data provided by the embodiment of the present invention is implemented by 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 forecast and historical meteorological data (any two data combinations, or all three data), input them into the encoder of the model, and obtain preliminary prediction results;

[0037] 2) Obtain a template day, and represent the actual power generation data and the forecast irradiation intensity data of the template day 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 the 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 decoder of the model to obtain the predicted value of photovoltaic power generation.

[0040] Specifically, 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 forecast (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 and 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 was first used for machine translation problems for sequence-to-sequence learning. The recurrent neural network encoder in the framework converts the input sequence into a context variable of fixed dimension, and then the recurrent neural network decoder generates the output (target) sequence token by token based on the generated tokens and context variables. In the original encoder-decoder framework, the context variables are fixed. After the introduction of the attention mechanism, the context variables can be adjusted according to the current prediction.

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

[0045] The internal framework and parameters of the recurrent neural network in the decoder part are also determined by the actual problem, and context is the context variable. The recurrent neural network layer can be a gated recurrent unit (GRU) or a long short-term memory network (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 sunny scenes 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 that 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 represents the standard deviation of actual power generation and weather forecast irradiance, μ X and μ Yrepresents the mean of actual power generation and weather forecast irradiance, 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 the 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 characterization 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, the model predicts the power generation for the whole day on May 30, 2024, and 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 an attention mechanism. Figure 1 As shown, the knowledge representation item is a matrix containing the 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, and 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 the conventional encoder-decoder model with 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 consistent. 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 application, 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 implicit state of the decoder is the query and the template day is the key, the purpose of weighted averaging the implicit state of the decoder 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 moment in the template day will be given a larger weight.

[0065] The prediction method of the present invention can automatically adjust the amplitude of predicted power generation based on 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 features 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 of the encoder part, the recurrent neural network module framework of 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 (epoch);

[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 in 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, which executes the steps of the above method when executed by a processor. The present invention further discloses a computer-readable storage medium, which stores a computer program, which executes the steps of the above method when executed by a processor. The present invention also discloses a computer system, including a memory and a processor connected to each other, the memory storing a computer program, which executes the steps of the above method when executed by the processor. The product, medium and system of the present invention correspond to the above method and also have the advantages described in the above 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 the computer program can implement the steps of the above-mentioned method embodiment when executed by the processor. 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, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. 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 may also include non-volatile memory, such as a hard disk, an internal 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 devices.

[0075] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope 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 steps: Obtain one or more of historical actual power generation, weather forecast and historical weather data, and input them into the encoder of the model to obtain a preliminary prediction result; A template day is obtained, and the actual power generation data and the 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 the day reaches a threshold is called the template day; Input the preliminary prediction result, the knowledge representation vector and the implicit state of the decoder into the Attention module of the model, and output the context variable context; One or more of the historical actual power generation, weather forecast and historical meteorological data, and the context variables are input into the decoder of the model to obtain the predicted value of photovoltaic power generation.

2. The photovoltaic power generation prediction method based on historical data according to claim 1 is 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 is characterized in that: The correlation coefficient ρ between the actual power generation curve and the forecast irradiation intensity curve corresponding to the day X,Y The calculation formula is: 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.

4. The photovoltaic power generation 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: 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.

5. The photovoltaic power generation prediction method based on historical data according to claim 4 is characterized in that: Attention weight function α(q,k i )for: Among them, a is the scoring function and exp is the exponential function.

6. The photovoltaic power generation prediction method based on historical data according to claim 5 is characterized in that: Using additive attention as the scoring function, given a query q and a key k, the scoring function of additive attention is: Among them, w v ,W q ,W k is the model parameter, tanh is the hyperbolic tangent function, Indicates that w v Transpose.

7. The photovoltaic power generation prediction method based on historical data according to claim 6 is characterized in that: In a single time step, the recurrent network layer in the decoder of the model has the hidden state s at time step t t for: s t =f(s t-1 ,[x t ,context t ]) Among them, t represents the time step, f() is the recurrent neural network layer, and 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.

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, 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.

Citation Information

Patent Citations

  • Photovoltaic power prediction method based on a convolutional neural network and meta-learning

    CN110070226A

  • Optical power prediction method and device

    CN110365059A

  • Photovoltaic power station power prediction method and device

    CN116629416A

  • Photovoltaic power generation power prediction method and system based on meteorological self-correction

    CN117077514A

  • Photovoltaic power generation power prediction method and system based on neural network

    CN117154690A