A distributed photovoltaic power generation power prediction method, system, device and medium
By introducing the Attention mechanism into the LSTM network and optimizing parameters with the meta-learning framework, the problem of low efficiency of existing photovoltaic power generation prediction methods is solved, and more accurate and fast photovoltaic power prediction is achieved.
Patent Information
- Application Number
- CN202310913388.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-24
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2043-07-24
AI Technical Summary
The existing photovoltaic power prediction methods have poor prediction efficiency and cannot quickly predict photovoltaic power.
The LSTM network is adopted and the Attention mechanism is introduced, and the prediction model parameters are optimized in combination with the meta-learning framework to build a distributed photovoltaic power prediction model.
It improves the accuracy and speed of photovoltaic power generation prediction, can better process multi-dimensional time series feature data of distributed photovoltaics, quickly obtain optimal initial parameters, and reduce the number of model iterations.
Smart Images

Figure CN116937565B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power generation prediction, and in particular relates to a distributed photovoltaic power generation prediction method, system, equipment and medium. Background Art
[0002] As society pays more and more attention to issues such as energy security, ecological environment, and climate change, the proportion of renewable energy power generation represented by wind power and photovoltaics connected to the grid will continue to rise. However, renewable energy power such as wind power and photovoltaics has strong randomness and intermittency, and its large-scale grid connection will bring challenges to the planning, operation and control of the power system. Accurate photovoltaic output prediction is the key to realizing the local consumption of distributed photovoltaic power generation and improving the distribution network's ability to accept photovoltaic power. It can also provide support for the optimized planning and design of photovoltaic power sources and the optimized scheduling and management of distribution networks. However, photovoltaic output is affected by many uncertain factors such as climate environment and installation conditions. In addition, large-scale distributed photovoltaics form an organic whole due to the disorderly access to the distribution network at multiple points, and their outputs are also coupled with each other, which makes it difficult to accurately predict photovoltaic output.
[0003] At present, photovoltaic prediction methods are generally divided into two categories: direct prediction and indirect prediction. The direct prediction method of photovoltaic output is essentially a statistical prediction method. It is a method of predicting photovoltaic output under different weather conditions in the future based on the laws of historical data. Its prediction accuracy can generally meet the requirements. The indirect prediction method refers to a method that does not require any historical photovoltaic data and directly predicts based on weather forecast data. Its main advantage is that it reduces a large amount of historical data statistics.
[0004] However, the existing direct prediction method and indirect prediction method of photovoltaic power generation have poor prediction efficiency and cannot quickly predict photovoltaic power generation. Summary of the invention
[0005] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a distributed photovoltaic power prediction method, system, device and medium to solve the problem that the existing photovoltaic power prediction method has poor prediction efficiency and cannot quickly predict photovoltaic power.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a distributed photovoltaic power generation power prediction method, comprising:
[0008] Obtaining distributed photovoltaic operation-related data, and processing the obtained distributed photovoltaic operation-related data using standardization to obtain an original data set;
[0009] Obtain a pre-built distributed photovoltaic power generation prediction model; wherein the distributed photovoltaic power generation prediction model adopts an LSTM network and introduces an Attention mechanism into the LSTM network;
[0010] Based on the meta-learning framework, the distributed photovoltaic power generation prediction model parameters are optimized through the original data set to obtain the optimized distributed photovoltaic power generation prediction model;
[0011] The actual operation data is input into the optimized distributed photovoltaic power generation prediction model, and the distributed photovoltaic power generation prediction value is output.
[0012] Furthermore, the acquisition of distributed photovoltaic operation related data includes:
[0013] Obtain photovoltaic operation-related data through power companies or photovoltaic power generation operators, including historical photovoltaic power generation, and collect meteorological indicators, including solar radiation, ambient temperature, humidity, wind speed, air pressure and cloud cover.
[0014] Furthermore, the obtained distributed photovoltaic operation-related data is processed by standardization to obtain an original data set, which specifically includes:
[0015] The collected data is processed by standardization to obtain data samples with a mean of 0 and a variance of 1. The processed data characteristics conform to the normal distribution and constitute the original data set; the standardization equation is as follows:
[0016]
[0017] In the formula, represents the nth feature of the i-th sample, represents the expectation of the nth feature, represents the variance of the nth feature; Represents the normalized value of the nth feature of the ith sample.
[0018] Furthermore, the method for constructing a distributed photovoltaic power generation power prediction model specifically includes:
[0019] Let a certain time be time t, then the information transmitted at time t-1 and the input information at time t Multiply by weight W plus bias b, and activate through sigmoid function Get the control coefficient of the gate unit , to control whether to update the candidate information in the memory unit Or forget the information stored in the memory unit at time t-1 , thereby updating the information in the memory unit ; Updated memory unit The information in Activation function and multiply by the control coefficient of the output gate unit After getting The data is passed to the next LSTM cell, so that key information can be memorized and updated in the process of processing time series problems. Each cell of LSTM is represented by the following formula:
[0020]
[0021] In the formula, is the alternative information in the memory unit at time t; is the activation function; is the sigmoid activation function; To update the door unit; For the forget door unit; is the output gate unit; is the information in the memory unit at time t; is the information in the memory unit at time t-1; is the information input at time t; is the information input at time t-1; is the input information at time t; is the weight of the memory unit; is the bias of the memory unit; is the weight of the update gate unit; To update the bias of the gate unit; is the weight of the forget gate unit; is the bias of the forget gate unit; is the weight of the output gate unit; is the bias of the output gate unit;
[0022] Multiple LSTM cells pass through the memory unit , information transmission unit between LSTM cells And the input information at each time To get the forecast data ;
[0023] In the processing of time series data, the Attention mechanism is used to calculate the hidden layer vector of the LSTM output. Perform a weighted summation, where Indicates i The state value of the hidden layer of the input sequence at each moment, and the dot product method is used to calculate the last hidden layer output The hidden layer output at each other time point Similarity score , the similarity calculation formula is as follows:
[0024]
[0025] The different attention weights at each time point are calculated through the soft-max function , on this basis, the attention weight is calculated The product of the hidden layer state is the output vector of the Attention layer. :
[0026]
[0027]
[0028] Where: is the output vector of the Attention layer; Different attention weights for each time point; For each time point, the hidden layer output The similarity score of .
[0029] Furthermore, the root mean square error RMSE is used as the evaluation index for the photovoltaic power generation prediction task, and the calculation formula is:
[0030]
[0031] Where: n To predict the sequence length, For the i The actual power value, For the i The predicted power value.
[0032] Furthermore, based on the meta-learning framework, the distributed photovoltaic power generation prediction model parameters are optimized through the original data set to obtain the optimized distributed photovoltaic power generation prediction model, which specifically includes:
[0033] Repeatedly randomly extract m data samples from the original data set, each m data samples is a task, forming a task pool consisting of T identically distributed tasks , each task contains training data and test data; meta-learning adopts a hierarchical framework, which is divided into inner and outer layers to update parameters. The training process is as follows:
[0034] Randomly initialize all parameters of the distributed photovoltaic power generation prediction model ;
[0035] Set the outer training end condition and the number of iterations to 10000;
[0036] During the outer training process, each iteration starts from the task distribution Randomly select a batch of tasks;
[0037] For each task , execute the inner training process, extract the test set D′, and obtain the updated model parameters ;
[0038] Every task The inner training process is executed until the tasks of this batch are completed;
[0039] The update step size is , each batch of tasks uses the updated model parameters , perform forward calculation on D' to obtain a loss value, and the sum of the loss values is , then Derivation is performed to obtain the gradient on the test set D′, and the parameters are updated using gradient descent to obtain :
[0040]
[0041] in, are the initial parameters of the distributed photovoltaic power generation prediction model;
[0042] The optimized As the initial parameters of the distributed photovoltaic power generation power prediction model.
[0043] Furthermore, the inner layer training process includes:
[0044] In a task Randomly select a training sample set D containing K data points;
[0045] Use mean square error loss function , calculate the loss function on D And the loss function parameters Gradient ;
[0046] Use the calculated gradient , using a gradient descent to update the model parameters on this task :
[0047]
[0048] From this task A test set D′ is sampled from the dataset for parameter updating.
[0049] In a second aspect, the present invention provides a distributed photovoltaic power generation power prediction system, comprising:
[0050] The original data set construction module is used to obtain the distributed photovoltaic operation related data, and process the obtained distributed photovoltaic operation related data by standardization to obtain the original data set;
[0051] A prediction model acquisition module is used to obtain a pre-built distributed photovoltaic power generation prediction model; wherein the distributed photovoltaic power generation prediction model adopts an LSTM network and introduces an Attention mechanism into the LSTM network;
[0052] The prediction model optimization module is used to optimize the parameters of the distributed photovoltaic power generation prediction model through the original data set based on the meta-learning framework to obtain the optimized distributed photovoltaic power generation prediction model;
[0053] The prediction value output module is used to input the actual operation data into the optimized distributed photovoltaic power generation power prediction model and output the distributed photovoltaic power generation power prediction value.
[0054] In a third aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a distributed photovoltaic power generation power prediction method described in any one of the above is implemented.
[0055] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the distributed photovoltaic power generation power prediction method described in any one of the above is implemented.
[0056] The present invention has at least the following beneficial effects:
[0057] 1. The present invention collects distributed photovoltaic operation-related data and performs standardized processing on the data; introduces the Attention mechanism into the LSTM network, assigns different weights to the hidden layer according to the degree of influence of the input features on the prediction results, and can connect the information extracted by an LSTM unit of the decoder with other LSTM units in the encoder, so that the implicit information between different time periods can be accurately represented by weights, and the multi-dimensional time series feature data of distributed photovoltaics can be better predicted; a distributed photovoltaic power generation prediction model is established; a meta-learning framework is used to optimize the initial parameters of the prediction model to obtain an optimized distributed photovoltaic power generation prediction model, the original data set is input into the optimized distributed photovoltaic power generation prediction model, and the distributed photovoltaic power generation prediction value is output; the meta-learning framework is used to perform hierarchical optimization on the model parameters, and the optimal initial parameters can be quickly obtained, which can effectively reduce the number of model iterations and improve the model operation performance and model operation speed.
[0058] 2. The present invention combines historical photovoltaic power generation data with numerical weather forecast data to improve the accuracy of photovoltaic power generation prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:
[0060] Figure 1 It is a schematic diagram of a distributed photovoltaic power generation power prediction method;
[0061] Figure 2 It is a long short-term memory neural network model;
[0062] Figure 3 It is the LSTM network information transmission model;
[0063] Figure 4 It is an encoding-decoding model with the Attention mechanism added;
[0064] Figure 5 An LSTM network prediction model that introduces the Attention mechanism;
[0065] Figure 6 This is a schematic diagram of a distributed photovoltaic power generation power prediction system module. DETAILED DESCRIPTION
[0066] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.
[0067] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present invention belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit the exemplary embodiments according to the present invention.
[0068] Example 1
[0069] like Figure 1 As shown, a distributed photovoltaic power generation power prediction method includes:
[0070] S1: Obtain photovoltaic operation related data, use standardization to process the obtained distributed photovoltaic operation related data to obtain the original data set;
[0071] Obtain photovoltaic operation-related data through power companies or photovoltaic power generation operators, including historical photovoltaic power generation, and collect meteorological indicators, including solar radiation, ambient temperature, humidity, wind speed, air pressure and cloud cover.
[0072] The collected data is processed by standardization to obtain data samples with a mean of 0 and a variance of 1. The processed data characteristics conform to the normal distribution and constitute the original data set. The standardization equation is as follows:
[0073]
[0074] In the formula, represents the nth feature of the i-th sample, represents the expectation of the nth feature, represents the variance of the nth feature; Represents the normalized value of the nth feature of the ith sample.
[0075] S2: Obtain a pre-built distributed photovoltaic power generation prediction model; wherein the distributed photovoltaic power generation prediction model adopts an LSTM network and introduces an Attention mechanism into the LSTM network; based on a meta-learning framework, optimize the parameters of the distributed photovoltaic power generation prediction model to obtain an optimized distributed photovoltaic power generation prediction model;
[0076] S21: Long Short Term Memory (LSTM) is an improvement on the traditional Recurrent Neural Network (RNN). It uses a gating mechanism to update the cell state and hidden state, solving the long-term dependency problem in RNN. The structure of the LSTM model is as follows: Figure 2 shown.
[0077] The most representative features of the LSTM network are its three gates. Each LSTM cell includes an update gate unit. , forget door unit , output gate unit , memory unit And the information transmission unit between LSTM cells The gating mechanism can effectively alleviate the overfitting and underfitting phenomena during the training process.
[0078] Suppose a certain time is time t, then the information transmission unit at time t-1 and the input information at time t Multiply by weight W plus bias b, and activate through sigmoid function Get the control coefficient of the gate unit , to control whether to update the candidate information in the memory unit Or forget the information stored in the memory unit at time t-1 , thereby updating the information in the memory unit ; Updated memory unit The information in Activation function and multiply by the control coefficient of the output gate unit After getting The data is passed to the next LSTM cell, so that key information can be memorized and updated in the process of processing time series problems. Each LSTM cell can be expressed by the following formula:
[0079]
[0080] In the formula, is the alternative information in the memory unit at time t; is the activation function; is the sigmoid activation function; To update the door unit; For the forget door unit; is the output gate unit; is the information in the memory unit at time t; is the information in the memory unit at time t-1; is the information transmission unit at time t; is the information transmission unit at time t-1; is the input information at time t; is the weight of the memory unit; is the bias of the memory unit; is the weight of the update gate unit; To update the bias of the gate unit; is the weight of the forget gate unit; is the bias of the forget gate unit; is the weight of the output gate unit; is the bias of the output gate unit;
[0081] And multiple LSTM cells are connected through memory units , information transmission unit between LSTM cells And the input information at each time To get the forecast data ,like Figure 3 shown.
[0082] S22: Introduce the Attention mechanism into the LSTM network, including:
[0083] Attention is a mechanism used to improve the effect of the encoder-decoder model. It enables the model to assign corresponding weights to the hidden layers h at different moments of the input sequence, merge the latent vectors into new latent vectors according to their importance, and input them into the decoder. Figure 4 shown.
[0084] In the processing of time series data, the Attention mechanism is used to calculate the hidden layer vector of the LSTM output. Perform a weighted summation, where Indicates i The state value of the hidden layer of the input sequence at each moment, and the dot product method is used to calculate the last hidden layer output The hidden layer output at each other time point Similarity score , the similarity calculation formula is as follows:
[0085]
[0086] The different attention weights at each time point are calculated through the soft-max function , on this basis, the attention weight is calculated The product of the hidden layer state is the output vector of the Attention layer. .
[0087]
[0088]
[0089] Where: is the output vector of the Attention layer; Different attention weights for each time point; For each time point, the hidden layer output The similarity score of .
[0090] The LSTM power prediction model combined with the Attention mechanism can determine the importance of information at each input moment, and the training efficiency of the model is improved. The Attention mechanism assigns different weights to the input features of the LSTM, highlights the key influencing factors, helps the LSTM make accurate judgments, and does not increase the computational and storage overhead of the model.
[0091] The LSTM network prediction model based on the Attention mechanism is as follows Figure 5 As shown, Figure 5 Mean vector X represents the input sequence, h Represents the hidden layer vector in the LSTM network, a It is the weight of each hidden layer vector calculated under the Attention mechanism.
[0092] The root mean square error RMSE is used as the evaluation index for the photovoltaic power prediction task, and the calculation formula is:
[0093]
[0094] Where: n To predict the sequence length, For the i The actual power value, For the i The larger the RMSE value is, the greater the error is.
[0095] S23: Optimizing prediction model parameters based on a meta-learning framework
[0096] Meta-learning enables the model to acquire the ability to learn and adjust parameters, and to quickly learn new tasks. The model-agnostic meta-learning framework MAML (Model-Agnostic Meta-Learning - MAML) is used to train the prediction model. Repeatedly randomly extract m data samples from the original data set, each m data sample is a task, forming a task pool p(T) consisting of T identically distributed tasks, each task contains training data and test data. Meta-learning adopts a hierarchical framework, which is divided into inner and outer layers to update parameters. The training process is as follows:
[0097] 1) First, randomly initialize all parameters of the distributed photovoltaic power generation prediction model ;
[0098] 2) Set the end condition of outer layer training and the number of iterations to 10000;
[0099] 3) During the outer training process, each iteration randomly selects a batch of tasks from the task distribution p(T);
[0100] 4) For each task , execute the inner training process, extract the test set D′, and obtain the updated model parameters ;
[0101] a) In a specific task Randomly select a training sample set D containing K data points;
[0102] b) Use mean square error loss function , calculate the loss function on D And the loss function parameters Gradient ;
[0103] c) Use the calculated gradient , using a gradient descent to update the model parameters on this task :
[0104]
[0105] d) From this task A test set D′ is sampled from the dataset for parameter updating.
[0106] 5) Each task The inner training process is executed until the tasks of this batch are completed;
[0107] 6) Calculate each task The gradient on the respective test set D′ is updated with a step size of , each batch of tasks uses its own updated model parameters , perform forward calculation on D' to obtain a loss value, and the sum of the loss values is , then Derivation is performed to obtain the gradient on the test set D′, and the parameters are updated using gradient descent to obtain :
[0108]
[0109] The parameters These are the initial parameters of the distributed photovoltaic power generation prediction model.
[0110] (6) The parameters finally optimized by the meta-learning framework above As the initial parameters of the distributed photovoltaic power generation prediction model, it can effectively reduce the number of model iteration steps and improve the running speed.
[0111] S3: Input the actual operation data into the optimized distributed photovoltaic power generation power prediction model, and output the distributed photovoltaic power generation power prediction value.
[0112] Example 2
[0113] like Figure 6 As shown, a distributed photovoltaic power generation power prediction system includes:
[0114] The original data set construction module is used to obtain the distributed photovoltaic operation related data, and process the obtained distributed photovoltaic operation related data by standardization to obtain the original data set;
[0115] A prediction model acquisition module is used to obtain a pre-built distributed photovoltaic power generation prediction model; wherein the distributed photovoltaic power generation prediction model adopts an LSTM network and introduces an Attention mechanism into the LSTM network;
[0116] The prediction model optimization module is used to optimize the parameters of the distributed photovoltaic power generation prediction model through the original data set based on the meta-learning framework to obtain the optimized distributed photovoltaic power generation prediction model;
[0117] The prediction value output module is used to input the actual operation data into the optimized distributed photovoltaic power generation power prediction model and output the distributed photovoltaic power generation power prediction value.
[0118] Example 3
[0119] The present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a distributed photovoltaic power generation power prediction method described in Example 1 is implemented.
[0120] Example 4
[0121] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the distributed photovoltaic power generation power prediction method described in Example 1 is implemented.
[0122] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may 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 code.
[0123] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of 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 produce 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.
[0124] 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.
[0125] 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.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A distributed photovoltaic power generation power prediction method, characterized in that: include: Obtaining distributed photovoltaic operation-related data, and processing the obtained distributed photovoltaic operation-related data using standardization to obtain an original data set; Obtain a pre-built distributed photovoltaic power generation prediction model; wherein the distributed photovoltaic power generation prediction model adopts an LSTM network and introduces an Attention mechanism into the LSTM network; Based on the meta-learning framework, the distributed photovoltaic power generation prediction model parameters are optimized through the original data set to obtain the optimized distributed photovoltaic power generation prediction model; The actual operation data is input into the optimized distributed photovoltaic power generation prediction model, and the distributed photovoltaic power generation prediction value is output.
2. A distributed photovoltaic power generation power prediction method according to claim 1, characterized in that: The acquisition of distributed photovoltaic operation related data includes: Obtain photovoltaic operation-related data, including historical photovoltaic power generation, through power companies or photovoltaic power generation operators, and collect meteorological indicators, including solar radiation, ambient temperature, humidity, wind speed, air pressure and cloud cover.
3. A distributed photovoltaic power generation power prediction method according to claim 1, characterized in that: The standardization is used to process the obtained distributed photovoltaic operation related data to obtain the original data set, which specifically includes: The collected data is processed by standardization to obtain data samples with a mean of 0 and a variance of 1. The processed data characteristics conform to the normal distribution and constitute the original data set; the standardization equation is as follows: In the formula, represents the nth feature of the i-th sample, E(x (n) ) represents the expectation of the nth feature, Std(x (n) ) represents the variance of the nth feature; Represents the normalized value of the nth feature of the ith sample.
4. A distributed photovoltaic power generation power prediction method according to claim 1, characterized in that: The method for constructing a distributed photovoltaic power generation power prediction model specifically includes: Suppose a certain time is time t, then the information a transmitted at time t-1 is <t-1>< / t-1> and the input information x at time t <t>< / t> Multiply the weight W and add the bias b, and use the sigmoid activation function σ(x) to get the control coefficient Γ of the gate unit to control whether to update the candidate information in the memory unit Or forget the information C stored in the memory unit at time t-1 <t-1>< / t-1> , thereby updating the information C in the memory unit <t>< / t> ; Updated memory unit C <t>< / t> The information in is activated by the tanh(x) function and multiplied by the control coefficient Γ of the output gate unit to obtain a <t>< / t> The data is passed to the next LSTM cell, so that key information can be memorized and updated in the process of processing time series problems. Each LSTM cell is represented by the following formula: In the formula, is the candidate information in the memory unit at time t; tan h(x) is the activation function; σ(x) is the sigmoid activation function; Γ u is the update gate unit; Γ f is the forget gate unit; Γ o is the output gate unit; C <t>< / t> is the information in the memory unit at time t; C <t-1>< / t-1> is the information in the memory unit at time t-1; a <t>< / t> is the information received at time t; a <t-1>< / t-1> is the information input at time t-1; x <t>< / t> is the input information at time t; W c is the weight of the memory unit; b c is the bias of the memory unit; W u is the weight of the update gate unit; b u is the bias of the update gate unit; W f is the weight of the forget gate unit; b f is the bias of the forget gate unit; W o is the weight of the output gate unit; b o is the bias of the output gate unit; Multiple LSTM cells obtain predicted data y through the memory unit C, the information transmission unit a between LSTM cells, and the input information x at each moment; In the processing of time series data, the Attention mechanism is used to calculate the hidden layer vector h of the LSTM output. t Perform weighted summation, where h i Represents the state value of the hidden layer of the input sequence at the i-th moment, and uses the dot product method to calculate the last hidden layer output h k The hidden layer output h at each other time point i The similarity score e i , the similarity calculation formula is as follows: e i =Dot(h k ,h i ) The different attention weights a at each time point are calculated through the soft-max function i , on this basis, calculate the attention weight a i The product of the hidden layer state is the output vector C of the Attention layer: Where: C is the output vector of the Attention layer; a i is the different attention weights for each time point; e i For each time point, the hidden layer outputs h i The similarity score of .
5. A distributed photovoltaic power generation power prediction method according to claim 1, characterized in that: The root mean square error RMSE is used as the evaluation index for the photovoltaic power prediction task, and the calculation formula is: Where: n is the length of the prediction sequence, y i is the ith actual power value, is the i-th predicted power value.
6. A distributed photovoltaic power generation power prediction method according to claim 1, characterized in that: Based on the meta-learning framework, the distributed photovoltaic power generation prediction model parameters are optimized through the original data set to obtain the optimized distributed photovoltaic power generation prediction model, which specifically includes: Repeatedly randomly extract m data samples from the original data set, each m data samples is a task, forming a task pool p(T) consisting of T identically distributed tasks. Each task contains training data and test data. Meta-learning adopts a hierarchical framework, which is divided into inner and outer layers to update parameters. The training process is as follows: Randomly initialize all parameters θ of the distributed photovoltaic power generation prediction model; Set the outer training end condition and the number of iterations to 10000; During the outer training process, each iteration randomly selects a batch of tasks from the task distribution p(T); For each task T i , execute the inner training process, extract the test set D′, and obtain the updated model parameters θ ′ i ; Each task T i The inner training process is executed until the tasks of this batch are completed; The update step size is β, and each batch of tasks uses the updated model parameters θ ′ i , forward calculation is performed on D' to obtain a loss value, and the sum of the loss values is L(θ′ i ), and then θ′ i Derivation is performed to obtain the gradient on the test set D′, and the parameters are updated using gradient descent to obtain θ″ i : Among them, θ″ i are the initial parameters of the distributed photovoltaic power generation prediction model; The optimized θ″ i As the initial parameters of the distributed photovoltaic power generation power prediction model.
7. A distributed photovoltaic power generation power prediction method according to claim 6, characterized in that: The inner layer training process includes: In a task T i Randomly select a training sample set D containing K data points; Use mean square error loss function Calculate the loss function on D and the gradient of the loss function with respect to the parameter θ Use the calculated gradient Use a gradient descent to update the model parameters θ on this task: From this task T i A test set D′ is sampled from the dataset for parameter updating.
8. A distributed photovoltaic power generation power prediction system, characterized in that: include: The original data set construction module is used to obtain the distributed photovoltaic operation related data, and process the obtained distributed photovoltaic operation related data by standardization to obtain the original data set; A prediction model acquisition module is used to obtain a pre-built distributed photovoltaic power generation prediction model; wherein the distributed photovoltaic power generation prediction model adopts an LSTM network and introduces an Attention mechanism into the LSTM network; The prediction model optimization module is used to optimize the parameters of the distributed photovoltaic power generation prediction model through the original data set based on the meta-learning framework to obtain the optimized distributed photovoltaic power generation prediction model; The prediction value output module is used to input the actual operation data into the optimized distributed photovoltaic power generation power prediction model and output the distributed photovoltaic power generation power prediction value.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, a distributed photovoltaic power generation power prediction method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, a distributed photovoltaic power generation power prediction method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Photovoltaic power prediction method for multi-energy power distribution network
CN115238970A