Photovoltaic power prediction method for micro-grid group and related device

By using GRU model and meta-learning algorithm in the microgrid group combined with the self-attention mechanism, the information acquisition and efficiency of photovoltaic power prediction in the existing technology is solved, which significantly improves the prediction accuracy and ensures that the microgrid is The group is running stably.

CN119090054APending Publication Date: 2024-12-06GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411094257.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing photovoltaic power prediction methods are difficult to obtain global information, and they are less efficient when processing long sequences, and there are problems of gradient disappearance or explosion, which affects the stable operation of the microgrid group.

Method used

The photovoltaic power generation data set based on microgrid group is used to obtain the support set and query set, the model parameters are updated through the gated cycle unit (GRU) model and meta-learning algorithm, and the photovoltaic power prediction model is improved in combination with the self-attention mechanism, and the loss function is optimized to Improve prediction accuracy.

Benefits of technology

Effectively reduce prediction errors, improve the prediction accuracy of photovoltaic power of microgrid groups, and achieve stable economic operation of microgrid groups.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090054A_ABST
    Figure CN119090054A_ABST
Patent Text Reader

Abstract

The invention provides a photovoltaic power prediction method for a micro-grid group and a related device. The method comprises the following steps: acquiring a support set and a query set based on a photovoltaic power generation data set of the micro-grid group; inputting the support set into a photovoltaic power prediction model, and obtaining a photovoltaic system state output value at the current moment; and carrying out model parameter updating on the state output value of the photovoltaic system through a meta-learning algorithm based on the query set, and carrying out loss function test based on the updated model parameters. The method can effectively reduce the prediction error, improves the prediction precision of the photovoltaic power of the micro-grid group, and achieves the stable and economical operation of the micro-grid group.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of photovoltaic power prediction, and in particular to a photovoltaic power prediction method and related devices for a microgrid group. Background Art

[0002] In recent years, new power generation methods represented by photovoltaic power generation have developed rapidly, and their proportion in the power system has gradually increased. Photovoltaic power generation can not only solve the problem of depletion of non-renewable energy, but also reduce carbon emissions. Therefore, it has been widely used in microgrid groups and has been integrated into the power grid on a large scale. However, affected by meteorological factors, photovoltaic power generation has the characteristics of randomness and volatility, which makes the output power extremely unstable, which may cause a huge impact on the power grid and affect the smooth operation of the entire power system. In order to ensure that the relevant departments of each microgrid in the microgrid group can formulate a reasonable power generation plan in advance and achieve the safety, economy and stability of power supply, it is essential to study the problem of photovoltaic power generation power prediction.

[0003] Existing photovoltaic power prediction has problems such as difficulty in obtaining global information, low efficiency when processing long sequences, and gradient vanishing or exploding. Summary of the invention

[0004] In view of this, the present disclosure aims to provide a photovoltaic power prediction method and related devices for a microgrid group to solve the technical problems in the prior art such as difficulty in obtaining global information, low efficiency when processing long sequences, and gradient disappearance or explosion.

[0005] One aspect of the present disclosure provides a photovoltaic power prediction method for a microgrid group, comprising:

[0006] Obtain support set and query set based on photovoltaic power generation dataset of microgrid cluster;

[0007] Inputting the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at the current moment;

[0008] Based on the query set, the model parameters of the photovoltaic system state output value are updated by a meta-learning algorithm, and a loss function test is performed based on the updated model parameters.

[0009] In some embodiments, the photovoltaic power generation data set based on the microgrid group obtains a support set and a query set, including:

[0010] Obtain historical data of photovoltaic power generation of microgrid groups;

[0011] Performing a normalization operation on the historical data to obtain an original data set;

[0012] A support set and a query set are obtained based on the original data set.

[0013] In some embodiments, inputting the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at the current moment includes:

[0014] Inputting the input variable and the photovoltaic system state value at the previous moment into the activation function to determine the reset gate value of the photovoltaic power prediction model;

[0015] Determining an intermediate state value of the photovoltaic system based on the input variable, the state value of the photovoltaic system at the last moment, and the reset threshold value;

[0016] Determining an update threshold value based on the input variable and the photovoltaic system state value at the previous moment;

[0017] The photovoltaic system state output value at the current moment is determined based on the photovoltaic system intermediate state value, the update threshold value and the photovoltaic system state value at the previous moment.

[0018] In some embodiments, the photovoltaic power prediction method for a microgrid group further includes:

[0019] The photovoltaic power prediction model is improved based on the self-attention mechanism.

[0020] In some embodiments, the photovoltaic power prediction model is improved based on the self-attention mechanism, including:

[0021] forming time series data based on the photovoltaic system state output value;

[0022] Map time series data into multiple matrices;

[0023] determining attention weights based on the matrix;

[0024] An attention score output value is determined based on the attention weight.

[0025] In some embodiments, mapping the time series data into a plurality of matrices includes:

[0026] Introduce the multi-head attention mechanism into i sets of learnable weight matrices W i Q , W i K , W i V , to map the time series data into Query, Key, and Value matrices respectively.

[0027] In some embodiments, updating the model parameters of the photovoltaic system state output value by a meta-learning algorithm based on the query set, and performing a loss function test based on the updated model parameters, includes:

[0028] Setting a meta-learning task reference set, each task including a support set and a query set, and setting initial parameters of the photovoltaic power prediction model by performing neural network encoding on the task set;

[0029] Based on the model-independent meta-learning algorithm, the initial parameters are updated by using a stochastic gradient descent algorithm through the support set to obtain updated parameters;

[0030] Sampling test data using the query set, and obtaining a test loss function based on the update parameters using the test data;

[0031] Updating the update parameter using the gradient of the test loss function to obtain a test parameter;

[0032] Based on the test parameters and the support set, the model parameters with the minimum test loss are obtained through a test loss function.

[0033] Another aspect of the present disclosure provides a photovoltaic power prediction device for a microgrid group, comprising:

[0034] A first acquisition module is used to acquire a support set and a query set based on a photovoltaic power generation data set of a microgrid group;

[0035] A second acquisition module is used to input the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at a current moment;

[0036] An updating module is used to update the model parameters of the photovoltaic system state output value through a meta-learning algorithm based on the query set, and perform a loss function test based on the updated model parameters.

[0037] The present disclosure also provides a storage medium storing a computer program, wherein the computer program implements the steps of the above method when executed by a processor.

[0038] The present disclosure also provides an electronic device, which includes at least a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above method when executing the computer program in the memory.

[0039] The present disclosure can effectively reduce prediction errors, improve the prediction accuracy of photovoltaic power of a microgrid group, and achieve stable and economical operation of the microgrid group.

[0040] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In the drawings, which are not necessarily drawn to scale, the same reference numerals may appear in different views.

[0042] Describe similar parts. The same figure numbers with letter suffixes or different letter suffixes may represent different instances of similar parts. The drawings generally illustrate various embodiments by way of example and not limitation, and together with the description and claims, are used to illustrate the disclosed embodiments. When appropriate, the same figure numbers are used throughout the drawings to refer to the same or similar parts. Such embodiments are illustrative and are not intended to be exhaustive or exclusive embodiments of the present apparatus or method. The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of this application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:

[0043] Figure 1 This is a schematic diagram of the steps of a photovoltaic power prediction method for a microgrid group in an embodiment of the present disclosure;

[0044] Figure 2 This is a second schematic diagram of the steps of a photovoltaic power prediction method for a microgrid group in an embodiment of the present disclosure;

[0045] Figure 3 It is a third step schematic diagram of a photovoltaic power prediction method for a microgrid group in an embodiment of the present disclosure;

[0046] Figure 4 This is a fourth step schematic diagram of a photovoltaic power prediction method for a microgrid group in an embodiment of the present disclosure;

[0047] Figure 5 is a flow chart of a photovoltaic power prediction method for a microgrid group in one embodiment of the present disclosure;

[0048] Figure 6 is a schematic diagram comparing prediction results for a stable climate in an embodiment of the present disclosure;

[0049] Figure 7 It is a schematic diagram comparing prediction results for abrupt climate in one embodiment of the present disclosure. DETAILED DESCRIPTION

[0050] The specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings, but are not intended to limit the present disclosure.

[0051] It should be understood that various modifications may be made to the embodiments disclosed herein. Therefore, the above description should not be considered as limiting, but merely as an example of an embodiment. Other modifications within the scope and spirit of the present disclosure will occur to those skilled in the art.

[0052] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the general description of the present disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the present disclosure.

[0053] These and other characteristics of the present disclosure will become apparent from the following description of a preferred form of embodiment given as a non-limiting example, with reference to the attached drawings.

[0054] It should also be understood that, although the present disclosure has been described with reference to some specific examples, those skilled in the art will be able to realize many other equivalent forms of the present disclosure that have the features described in the claims and are therefore within the scope of protection defined thereby.

[0055] The above and other aspects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.

[0056] Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it should be understood that the disclosed embodiments are merely examples of the present disclosure, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant details. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in a variety of ways with substantially any suitable detailed structure.

[0057] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0058] This specification may use the phrases "in one embodiment," "in another embodiment," "in a further embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present disclosure.

[0059] The first embodiment of the present disclosure provides a photovoltaic power prediction method for a microgrid group, wherein the photovoltaic power prediction method is implemented based on a MAML-GRU model, wherein GRU represents a gated recurrent unit, and MAML represents a model-independent meta-learning algorithm, such as Figure 1 As shown, the power prediction method comprises the following steps:

[0060] S101, obtaining a support set and a query set based on a photovoltaic power generation dataset of a microgrid group.

[0061] In this step, if Figure 2 As shown, the support set and query set are obtained based on the photovoltaic power generation dataset of the microgrid group.

[0062] S201, obtaining historical photovoltaic power generation data of the microgrid group.

[0063] In this step, the photovoltaic power generation history data of the microgrid group is obtained. Specifically, the photovoltaic power generation operation related data is obtained through the photovoltaic power generation operation platform of the microgrid group, such as the historical power generation power of each microgrid, the energy interaction data between microgrids, and meteorological index data, where the meteorological index data includes, for example, solar radiation value, ambient temperature value, humidity value, wind speed value, and cloud cover value.

[0064] S202: performing a normalization operation on the historical data to obtain an original data set.

[0065] After obtaining the photovoltaic power generation history data of the microgrid group through the above step S201, in this step, the historical data is normalized to obtain the original data set. Specifically, the acquired historical data is sorted by normalization to obtain the original data set. Among them, since the dimensions of meteorological factors are not exactly the same, the historical data needs to be linearly normalized as follows:

[0066]

[0067] In the above formula, X is the result of linear normalization; X is the input value of the independent variable; X is the original number norm max

[0068] The maximum value of the factors affecting X in the data set; min It is the minimum value of the factors affecting X in the original data set.

[0069] S203: Acquire a support set and a query set based on the original data set.

[0070] After the historical data is normalized to obtain the original data set in step S202, in this step, a support set and a query set are obtained based on the original data set. Specifically, in this step, the original data set is used to form task samples of the training set, thereby generating a support set and a query set.

[0071] Specifically, due to the large difference in photovoltaic power output under different climate conditions, the original data after normalization preprocessing is divided into two different time series data sets under stable climate conditions and sudden climate conditions, and data are selected from the corresponding time series data sets as support sets and query sets respectively. Here, the support set and query set are used to form task samples suitable for meta-learning parameter optimization of the gated recurrent unit (GRU) model.

[0072] S102, inputting the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at a current moment.

[0073] After obtaining the support set and the query set based on the photovoltaic power generation data set of the microgrid group in the above step S101, in this step, the support set is input into the photovoltaic power prediction model to obtain the photovoltaic system state output value at the current moment.

[0074] Specifically, in this step, the photovoltaic power prediction model of the microgrid group is first constructed using the gated recurrent unit (GRU), and the time series related to the photovoltaic power generation power is captured from the data of the support set as the photovoltaic system state output value at the current moment. In this way, according to the MAML-GRU prediction model, the photovoltaic power prediction value of the microgrid group under different climate conditions is output. The photovoltaic power prediction model here includes an input layer, a GRU layer, and an output layer.

[0075] Furthermore, the core module of the photovoltaic power prediction model based on the gated cyclic unit here is to update the gate z t and reset gate r t . The input variable x t The output result of the previous hidden layer, that is, the photovoltaic system state value h at the previous moment t-1 The concatenated matrix is ​​transformed into the range of (0,1) by the activation function σ, and then input into the update gate z. t It is used to control the degree to which the amount of information at the previous moment is retained to the current state; then the reset gate r t Similarly, the input variable x t The output result of the previous hidden layer, that is, the photovoltaic system state value h at the previous moment t-1 spliced ​​together, the reset gate is used to control the degree of integration of the current state and the information of the previous moment, and the output result is h t 1-zt times the output of the previous hidden layer h t-1 and z t times the sum of the pending output values.

[0076] Specifically, the support set is input into the photovoltaic power prediction model to obtain the photovoltaic system state output value at the current moment, such as Figure 3 As shown, the following steps are included:

[0077] S301, inputting input variables and the photovoltaic system state value at the previous moment into an activation function to determine a reset gate value of the photovoltaic power prediction model.

[0078] In this step, the input variables and the photovoltaic system state value at the previous moment are input into the activation function to determine the reset threshold value of the photovoltaic power prediction model. Specifically, the degree of forgetting of the previous stage information, that is, the reset threshold value, is determined according to the input variables and the photovoltaic system state value at the previous moment, where:

[0079] r t =σ(W r x t +U r h t-1 +b r )

[0080] Where: r t is the reset gate value, the value is 0-1; t is the time step; σ is the Sigmoid activation function; W r , U r is the network training parameter matrix; x t is the input variable at the current moment; h t-1 is the photovoltaic system status value at the previous moment; b r is the bias parameter.

[0081] S302: Determine an intermediate state value of the photovoltaic system based on the input variable, the state value of the photovoltaic system at a previous moment, and the reset threshold value.

[0082] After inputting the input variables and the photovoltaic system state value at the previous moment into the activation function to determine the reset threshold value of the photovoltaic power prediction model through the above step S301, in this step, the intermediate state value of the photovoltaic system is determined based on the input variables, the photovoltaic system state value at the previous moment and the reset threshold value.

[0083] Specifically, the propagation ratio of the previous stage information is determined by multiplying the reset gate value by the photovoltaic system state value at the previous moment, and the intermediate state value of the photovoltaic system is further determined in combination with the input variable as the pending output value, which is expressed in the following way:

[0084] h't =tanh(r t ⊙U h h t-1 +W h x t +b h )

[0085] Where: h' t is the intermediate state value; ⊙ is the dot multiplication operation; U h , W h is the network training parameter matrix; b h is the bias parameter, where σ and tanh are mathematically described as follows:

[0086]

[0087] S303: Determine an update threshold value based on the input variable and the photovoltaic system state value at the last moment.

[0088] After the intermediate state value of the photovoltaic system is determined based on the input variables, the state value of the photovoltaic system at the last moment, and the reset threshold value in the above step S302, in this step, the update threshold value is determined based on the input variables and the state value of the photovoltaic system at the last moment. Specifically, the amount of information retained in the previous stage is determined according to the input variables and the state value of the photovoltaic system at the last moment, that is, the update threshold value, and the specific expression is as follows:

[0089] z t =σ(W u x t +U u h t-1 +b u )

[0090] Where: z t is the update gate value, the value is 0-1; W u , U u is the network training parameter matrix; b u is the bias parameter.

[0091] S304: Determine a photovoltaic system state output value at a current moment based on the photovoltaic system intermediate state value, the update threshold value, and the photovoltaic system state value at a previous moment.

[0092] After the update threshold value is determined based on the input variable and the photovoltaic system state value at the previous moment in step S303, in this step, the photovoltaic system state output value at the current moment is determined based on the intermediate state value, the update threshold value and the photovoltaic system state value at the previous moment. In this step, the photovoltaic system state output value at the current moment is determined by the following formula:

[0093] ht =z t ⊙h' t +(1-z t )⊙h t-1 ;

[0094] Where: h t is the photovoltaic system status value output at time t.

[0095] In addition, in this embodiment, the photovoltaic power prediction method for a microgrid group further includes:

[0096] The photovoltaic power prediction model is improved based on the self-attention mechanism. Specifically, improving the photovoltaic power prediction model through the self-attention mechanism can enable the photovoltaic power prediction model to better capture key information and improve the error propagation problem of the photovoltaic power prediction model.

[0097] Specifically, Figure 4 As shown, the photovoltaic power prediction model is improved based on the self-attention mechanism, including:

[0098] S401, forming time series data based on the photovoltaic system state output value. Specifically, the output value of the photovoltaic power prediction model, that is, the photovoltaic system state output value h at the current moment t A sliding window is added to the position of the photovoltaic system state output value h of the first m time steps. t Aggregate to form a new sequence Where n represents the hidden state h t Dimensions;

[0099] S402, map the time series data into multiple matrices. Specifically, introduce the multi-head attention mechanism into i groups of learnable weight matrices W i Q , W i K , W i V , respectively, to be used for Mapped to Query, Key, Value matrix, we get Query, Key, Value matrix. The matrix formula is as follows:

[0100]

[0101] S403, determining the attention weight based on the matrix. Specifically, for each hidden state at time step t, the attention weight is calculated using the Query, Key, and Value matrices respectively, and the formula is as follows:

[0102]

[0103] in, This is to scale the size of the inner product to avoid the input of the softmax function being too large or too small.

[0104] S404, determining an attention score output value based on the attention weight. Specifically, based on the attention weight, the output vectors based on multiple attentions are concatenated to obtain a matrix Z, which is represented as follows:

[0105] Z=concat(Attention1,...,Attention i );

[0106] Further linear transformation of matrix Z is performed to obtain the attention score output value h att , where the attention score output value is expressed as follows:

[0107] h att =Z·W

[0108] Among them, W is the learnable weight matrix, and the attention score output value h here is att The hidden state used as the input of the photovoltaic system prediction model in the next time step is involved in the training, and finally the output is passed to the meta-training set for loss function calculation.

[0109] Table 1 compares the accuracy of different prediction models under stable climate conditions. As can be seen from Table 1, when the climate is stable, the combination of meta-learning and the addition of an improved self-attention mechanism can significantly improve the photovoltaic prediction accuracy of the traditional neural network GRU model. The MAE and RMSE values ​​of the MAML-GRU model under stable climate conditions are reduced by 58.87% and 54.81% respectively compared to the traditional GRU model.

[0110] Table 2 shows the accuracy comparison of different prediction models under the condition of sudden climate. As can be seen from Table 2, the combination of meta-learning and the addition of improved self-attention mechanism can also improve the photovoltaic prediction accuracy of the traditional neural network GRU model under the condition of sudden climate. The MAE value and RMSE value of MAML-GRU compared with the traditional GRU model under the condition of sudden climate are reduced by 40.79% and 37.74% respectively.

[0111] Table 1 Comparison of the accuracy of different prediction models under stable climate conditions

[0112]

[0113] Table 2 Comparison of the accuracy of different prediction models under abrupt climate conditions

[0114]

[0115] S103, updating the model parameters of the photovoltaic system state output value by a meta-learning algorithm based on the query set, and performing a loss function test based on the updated model parameters.

[0116] After the support set is input into the photovoltaic power prediction model through the above step S102 to obtain the photovoltaic system state output value at the current moment, in this step, the model parameters of the photovoltaic system state output value are updated based on the query set through a meta-learning algorithm, and a loss function test is performed based on the updated model parameters.

[0117] This step at least includes the following steps: setting a meta-learning task reference set, each task includes a support set and a query set, and setting the initial parameters of the photovoltaic power prediction model by performing neural network encoding on the task set; updating the initial parameters using a stochastic gradient descent algorithm through the support set based on a model-independent meta-learning algorithm to obtain updated parameters; sampling test data using the query set, and obtaining a test loss function based on the updated parameters through the test data; updating the updated parameters using the gradient of the test loss function to obtain test parameters; and obtaining model parameters with the minimum test loss based on the test parameters and the support set through a test loss function.

[0118] Since the photovoltaic power prediction model in this embodiment is a meta-learning optimization model, the model-agnostic meta-learning algorithm (MAML) used is a classic algorithm in meta-learning. Its core idea is to optimize the initialization parameters of the model so that the model can adapt to new tasks more quickly and achieve better results even with a small number of samples. Specifically, the working method of the meta-learning optimization model here is as follows: Set the meta-learning task reference set to A T , each task contains a support set D S and query set D Q , meta-learning is performed by encoding the task set through a neural network, and for this purpose, the initial parameters θ0 of the photovoltaic power prediction model are set.

[0119] Based on the model-independent meta-learning algorithm, the model parameters are updated by using the stochastic gradient descent algorithm through the data of the support set of the known microgrid group to obtain the updated parameter θ1. The calculation expression is as follows:

[0120]

[0121] Where α is the gradient descent learning rate of the photovoltaic power prediction model, L(D S ,θ0) is the loss function of the microgrid group on the support set, is the gradient descent loss.

[0122] After updating the model parameters, it is determined whether the output prediction value meets the prediction accuracy requirement. If the accuracy requirement is not met, the test data of the query set of the microgrid group is used to sample the test data, and the test loss function L(D) of the microgrid group is calculated based on the updated parameter θ1. Q ,θ1); L(D Q ,θ1) is used to update the update parameter θ1 to obtain the test parameter, and its calculation expression is as follows:

[0123]

[0124] Where β is the learning rate of meta-learning, L(D Q ,θ1) is the loss function of the microgrid group on the query set, is the gradient descent loss.

[0125] The goal in this embodiment is to minimize the test loss of the learned model parameters on the microgrid group, that is:

[0126]

[0127] In this way, the prediction error of the prediction model can be gradually reduced. At the same time, the universal initialization parameter θ0 of the network containing the timing correlation of the source microgrid group can be obtained. The initialization parameter θ0 can be directly migrated to other microgrid group models, and the training sets of other microgrid groups can be used for training and updating.

[0128] In a specific implementation, the photovoltaic power prediction method for a microgrid group is used based on the MAML-GRU model to predict the photovoltaic power of the photovoltaic system, such as Figure 5 As shown, the steps are as follows:

[0129] S1: Collect the historical data of photovoltaic power generation of the microgrid group and use the normalization method to standardize the historical data;

[0130] S2: Divide the normalized data into task samples and further divide them into support sets D S and query set D Q data;

[0131] S3: Construct a photovoltaic power prediction model based on GRU, which includes an input layer, a GRU layer, and an output layer, and improve the photovoltaic power prediction model based on the self-attention mechanism;

[0132] S4: Use the data from the support set to train the photovoltaic power prediction model with an attention mechanism and calculate the loss function to update the model parameters;

[0133] S5: Use the query set data to update the model parameters again to obtain the minimum test loss;

[0134] S6: Determine whether the output prediction value meets the prediction accuracy requirement. If it does not meet the accuracy requirement, repeat steps S5 and S6; otherwise, output the prediction result.

[0135] Figure 6 It is a schematic diagram comparing the prediction results of each model under stable climate conditions. By comparing and analyzing the predicted values ​​and actual values ​​of the photovoltaic power of the microgrid group when the climate is stable by the prediction method provided in this embodiment and the traditional GRU prediction method, it can be seen from the figure that although the predicted value of the MAML-GRU method is higher than the actual value in the time periods of 6:00-10:00 and 14:00-18:00, and the predicted value of the MAML-GRU method is lower than the actual value in the time period of 10:00-14:00; the predicted value of the GRU method is higher than the actual value. However, the absolute value of the difference between the predicted value and the actual value of the MAML-GRU method at all times is always smaller than the absolute value of the difference between the predicted value and the actual value of the GRU method, indicating that the prediction accuracy of the prediction method proposed by the present invention is higher under stable climate conditions.

[0136] Figure 7 : This is a schematic diagram comparing the prediction results of each model under the sudden climate condition. By comparing and analyzing the predicted values ​​and actual values ​​of the photovoltaic power of the microgrid group under the sudden climate condition using the prediction method provided in this embodiment and the traditional GRU prediction method, it can be seen from the figure that the photovoltaic power output of the microgrid group under this climate condition is unstable, and the overall output is also less than the output under the stable climate condition. In this case, the prediction value of the MAML-GRU method is also more accurate than the prediction value of the GRU method in most cases.

[0137] The disclosed embodiment obtains the historical data of photovoltaic power generation of the microgrid group and forms an original data set, constructs the training set task of the meta-model through the original data set and divides the data in the task into a support set and a query set; secondly, uses a gated recurrent unit to capture the time series that is strongly correlated with photovoltaic power generation and constructs a photovoltaic power prediction model for the microgrid group; then improves the GRU model based on the self-attention mechanism, and better captures key information by dynamically adjusting the weights of different time steps; finally, the output parameters of the prediction model are updated through a meta-learning algorithm, and the data is input into the meta-model for testing, thereby gradually improving the prediction accuracy.

[0138] The present disclosure can effectively reduce prediction errors, improve the prediction accuracy of photovoltaic power of a microgrid group, and achieve stable and economical operation of the microgrid group.

[0139] Based on the same inventive concept, the second embodiment of the present disclosure provides a photovoltaic power prediction device for a microgrid group, comprising:

[0140] A first acquisition module is used to acquire a support set and a query set based on a photovoltaic power generation data set of a microgrid group;

[0141] A second acquisition module is used to input the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at a current moment;

[0142] An updating module is used to update the model parameters of the photovoltaic system state output value through a meta-learning algorithm based on the query set, and perform a loss function test based on the updated model parameters.

[0143] Furthermore, the first acquisition module includes:

[0144] A first acquisition unit is used to acquire photovoltaic power generation history data of the microgrid group;

[0145] A second acquisition unit, configured to perform a normalization operation on the historical data to acquire an original data set;

[0146] The third acquisition unit is used to acquire a support set and a query set based on the original data set.

[0147] Furthermore, the second acquisition module includes:

[0148] A first determination unit, configured to input an input variable and a photovoltaic system state value at a previous moment into an activation function to determine a reset gate value of the photovoltaic power prediction model;

[0149] a second determining unit, configured to determine an intermediate state value of the photovoltaic system based on the input variable, the state value of the photovoltaic system at a previous moment, and the reset threshold value;

[0150] a third determining unit, configured to determine an update threshold value based on the input variable and a photovoltaic system state value at a previous moment;

[0151] The fourth determining unit is used to determine the photovoltaic system state output value at a current moment based on the photovoltaic system intermediate state value, the update threshold value and the photovoltaic system state value at a previous moment.

[0152] Furthermore, the prediction device further comprises:

[0153] An improvement module is used to improve the photovoltaic power prediction model based on a self-attention mechanism.

[0154] Furthermore, the improvement module includes:

[0155] A forming unit, configured to form time series data based on the photovoltaic system state output value;

[0156] A mapping unit, used to map time series data into multiple matrices;

[0157] a fifth determining unit, configured to determine an attention weight based on the matrix;

[0158] A sixth determining unit is used to determine an attention score output value based on the attention weight.

[0159] Furthermore, the mapping unit is specifically used for:

[0160] Introduce the multi-head attention mechanism into i sets of learnable weight matrices W i Q , W i K , W i V , to map the time series data into Query, Key, and Value matrices respectively.

[0161] Furthermore, the update module includes:

[0162] A setting unit, used for setting a reference set of tasks for meta-learning, each task including a support set and a query set, and setting initial parameters of the photovoltaic power prediction model by performing neural network encoding on the task set;

[0163] A first updating unit, configured to update the initial parameters by using a stochastic gradient descent algorithm through the support set based on a model-independent meta-learning algorithm to obtain updated parameters;

[0164] A loss function acquisition unit, configured to sample test data using the query set, and acquire a test loss function based on the update parameters through the test data;

[0165] A second updating unit, configured to update the update parameter using the gradient of the test loss function to obtain a test parameter;

[0166] A testing unit is used to obtain model parameters with minimum test loss through a test loss function based on the test parameters and the support set.

[0167] The present disclosure can effectively reduce prediction errors, improve the prediction accuracy of photovoltaic power of a microgrid group, and achieve stable and economical operation of the microgrid group.

[0168] A third embodiment of the present disclosure provides a storage medium storing a computer program. When the computer program is executed by a processor, the steps of implementing the above method include:

[0169] S11, obtaining support set and query set based on photovoltaic power generation dataset of microgrid cluster;

[0170] S12, inputting the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at the current moment;

[0171] S13, updating the model parameters of the photovoltaic system state output value through a meta-learning algorithm based on the query set, and performing a loss function test based on the updated model parameters.

[0172] The storage medium of the present disclosure stores a computer program, which can implement the methods in different implementation modes of the above-mentioned first embodiment when executed by a processor.

[0173] The present disclosure can effectively reduce prediction errors, improve the prediction accuracy of photovoltaic power of a microgrid group, and achieve stable and economical operation of the microgrid group.

[0174] A fourth embodiment of the present disclosure provides an electronic device, the electronic device comprising at least a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the above method when executing the computer program on the memory, specifically comprising:

[0175] S21, obtaining support set and query set based on photovoltaic power generation dataset of microgrid cluster;

[0176] S22, inputting the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at the current moment;

[0177] S23, updating the model parameters of the photovoltaic system state output value through a meta-learning algorithm based on the query set, and performing a loss function test based on the updated model parameters.

[0178] The memory of the electronic device of the present disclosure stores a computer program, and the processor implements the methods of other implementations in the above-mentioned first embodiment when executing the computer program in the memory.

[0179] The present disclosure can effectively reduce prediction errors, improve the prediction accuracy of photovoltaic power of a microgrid group, and achieve stable and economical operation of the microgrid group.

[0180] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0181] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0182] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0183] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0184] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0185] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0186] If the integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. 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. The computer-readable medium may include: any entity or device capable of carrying the 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. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0187] In addition, the features of the embodiments shown in the drawings of the present application or the various embodiments mentioned in this specification are not necessarily understood as independent embodiments. Instead, each feature described in one example of an embodiment can be combined with one or more other desired features from other embodiments to produce other embodiments not described in words or with reference to the drawings.

[0188] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A photovoltaic power prediction method for a microgrid group, characterized in that: include: Obtain support set and query set based on photovoltaic power generation dataset of microgrid cluster; Inputting the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at the current moment; Based on the query set, the model parameters of the photovoltaic system state output value are updated by a meta-learning algorithm, and a loss function test is performed based on the updated model parameters.

2. The photovoltaic power prediction method according to claim 1, characterized in that: The photovoltaic power generation data set based on the microgrid group obtains a support set and a query set, including: Obtain historical data of photovoltaic power generation of microgrid groups; Performing a normalization operation on the historical data to obtain an original data set; A support set and a query set are obtained based on the original data set.

3. The photovoltaic power prediction method according to claim 1, characterized in that: The step of inputting the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at a current moment includes: Inputting the input variable and the photovoltaic system state value at the previous moment into the activation function to determine the reset gate value of the photovoltaic power prediction model; Determining an intermediate state value of the photovoltaic system based on the input variable, the state value of the photovoltaic system at the last moment, and the reset threshold value; Determining an update threshold value based on the input variable and the photovoltaic system state value at the previous moment; The photovoltaic system state output value at the current moment is determined based on the photovoltaic system intermediate state value, the update threshold value and the photovoltaic system state value at the previous moment.

4. The photovoltaic power prediction method according to claim 1, characterized in that: The photovoltaic power prediction method for a microgrid group also includes: The photovoltaic power prediction model is improved based on the self-attention mechanism.

5. The photovoltaic power prediction method according to claim 4, characterized in that: The photovoltaic power prediction model is improved based on the self-attention mechanism, including: forming time series data based on the photovoltaic system state output value; Map time series data into multiple matrices; determining attention weights based on the matrix; An attention score output value is determined based on the attention weight.

6. The photovoltaic power prediction method according to claim 5, characterized in that: The time series data is mapped into multiple matrices, including: Introduce the multi-head attention mechanism into i sets of learnable weight matrices W i Q , W i K , W i V , to map the time series data into Query, Key, and Value matrices respectively.

7. The photovoltaic power prediction method according to claim 1, characterized in that: The updating of the model parameters of the photovoltaic system state output value by a meta-learning algorithm based on the query set, and the performing of a loss function test based on the updated model parameters, include: Setting a meta-learning task reference set, each task including a support set and a query set, and setting initial parameters of the photovoltaic power prediction model by performing neural network encoding on the task set; Based on the model-independent meta-learning algorithm, the initial parameters are updated by using a stochastic gradient descent algorithm through the support set to obtain updated parameters; Sampling test data using the query set, and obtaining a test loss function based on the update parameters using the test data; Updating the update parameter using the gradient of the test loss function to obtain a test parameter; Based on the test parameters and the support set, the model parameters with the minimum test loss are obtained through a test loss function.

8. A photovoltaic power prediction device for a microgrid group, characterized in that: include: A first acquisition module is used to acquire a support set and a query set based on a photovoltaic power generation data set of a microgrid group; A second acquisition module is used to input the support set into a photovoltaic power prediction model to obtain a photovoltaic system state output value at a current moment; An updating module is used to update the model parameters of the photovoltaic system state output value through a meta-learning algorithm based on the query set, and perform a loss function test based on the updated model parameters.

9. A storage medium storing 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 implemented.

10. An electronic device, comprising at least a memory and a processor, wherein a computer program is stored in the memory, wherein: The processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program on the memory.

Citation Information

Cited By

  • Household photovoltaic power prediction method and system fusing deep learning and migration mechanism

    CN121036020A