Distributed photovoltaic power generation power generation method, equipment and medium

By constructing a photovoltaic output deviation prediction model, using the gray correlation method, gated cycle unit and multi-head self-attention mechanism algorithm model, the existing photovoltaic power prediction method is solved, and the problem of difficulty in capturing long-term dependence effects and taking into account the accuracy of space-time prediction is achieved, and a higher prediction accuracy is achieved.

CN119627876AInactive Publication Date: 2025-03-14STATE GRID SHANDONG ELECTRIC POWER COMPANY WEIFANG POWER SUPPLY +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411691284.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing photovoltaic power prediction methods are difficult to accurately capture the long-term dependence effects between input data, and a single prediction model cannot take into account the spatial and temporal prediction accuracy requirements under different meteorological conditions.

Method used

By obtaining multiple distributed photovoltaic power generation related historical data of the regional power grid, building feature vectors, and using the gray correlation method to calculate the distance of the feature matrix, dynamically sorting to obtain the photovoltaic output reference value. Then, a photovoltaic output deviation prediction model is constructed, and a gated cycle unit and a multi-head self-attention mechanism algorithm model is used to model the deviation of related factors and the photovoltaic output deviation.

Benefits of technology

It improves the accuracy of photovoltaic power generation prediction, can better combine historical experience values ​​and deep learning technology, and take into account the accuracy of space-time prediction under different meteorological conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119627876A_ABST
    Figure CN119627876A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed photovoltaic power generation power generation method and device and a medium, and the method comprises the steps: S1, obtaining a plurality of pieces of distributed photovoltaic power generation related historical data of a regional power grid within a certain time, forming a sample set, and constructing a feature vector; s2, calculating the distance of each feature matrix, judging the similarity degree among different photovoltaic output change related factors on different dates according to the distance between the feature matrixes, obtaining a sample value of similar change based on a judgment result of dynamic sorting of the similarity degree, and obtaining a sunlight output reference value; s3, constructing a photovoltaic output deviation prediction model and performing training based on the sample set; s4, obtaining the photovoltaic output deviation based on the photovoltaic output deviation prediction model; and S5, based on the sunlight photovoltaic output reference value and the sunlight photovoltaic output deviation, adding and calculating to obtain a photovoltaic power prediction value of the prediction day.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of photovoltaic power prediction, and in particular to a distributed photovoltaic power generation method, equipment and medium. Background Art

[0002] Photovoltaic power generation in regional power sources is unplanned, with high randomness and volatility. When a high proportion of distributed photovoltaic power is connected to the grid, accurate prediction of power generation output is a key link in the dispatching and operation of the power system. At present, photovoltaic prediction is mainly based on photovoltaic historical data, weather forecast data and other data, and uses machine learning methods for modeling and prediction.

[0003] The mainstream method is to use historical photovoltaic data combined with meteorological data for prediction. For example, RNN neural networks use a sequential input structure. Although this structure can better capture the temporal characteristics of the input data, it is not good at exploring the long-term dependence effects between the input data. The coupling between the various loads of the integrated energy system is strong, and the long-term dependence effect between the input data is more significant. If RNN neural networks are used directly, it will be difficult to obtain good prediction accuracy. Only using historical photovoltaic data or weather forecast data only considers the information of the time dimension and ignores the characteristics of the spatial dimension, making it difficult to further improve the prediction accuracy. At the same time, a single prediction model cannot take into account the requirements of spatiotemporal prediction accuracy under different meteorological conditions. Some studies have considered the movement of clouds or the influence of high-altitude wind speed and direction, but because their methods are not applicable to the spatiotemporal scale of the data, the effect is minimal. Summary of the invention

[0004] The present invention provides a distributed photovoltaic power generation method, device and medium to solve the above problems.

[0005] On the one hand, the present invention provides a distributed photovoltaic power generation method, which includes the following steps: Step S1: Acquire multiple distributed photovoltaic power generation related historical data of a regional power grid within a certain period of time, form a sample set and construct a feature vector; Step S2: Calculate the distance of each feature matrix, judge the similarity between different photovoltaic output change related factors on different dates according to the distance between the feature matrices, obtain sample values ​​of similar changes based on the judgment results of dynamic sorting of similarity, and obtain a daily photovoltaic output reference value; Step S3: Construct a photovoltaic output deviation prediction model and train it based on the sample set; Step S4: Obtain the daily photovoltaic output deviation based on the photovoltaic output deviation prediction model; Step S5: Based on the daily photovoltaic output reference value and the daily photovoltaic output deviation, add and calculate to obtain the photovoltaic power prediction value of the predicted day.

[0006] In one implementation of the present invention, in step S2, the characteristic distance is implemented using the grey correlation coefficient method, and the characteristic vector of the predicted day is X=[x1,x2,x3,x4,x5,x6,x7,x8,...,x m ], m is the number of eigenvector components, then the factor eigenvector of day n is:

[0007] X(n)=[x1(n),x2(n),x3(n),x4(n),x5(n),x6(n),x7(n),x8(n),...,x m (n)],

[0008] For the nth day, the i-th eigenvector component is normalized as follows:

[0009] x i ′(n)=[x i (n)-x imin (n)] / [x imax (n)-x imin (n)

[0010] where x i (n)x i (n) represents the i-th eigenvector component, x imax (n), x imin (n) are the maximum and minimum values ​​of the i-th eigenvector respectively;

[0011] Using the grey correlation coefficient method, the correlation coefficient between the predicted day and the ith eigenvector of the nth day is:

[0012]

[0013] Calculate the grey correlation R between the forecast day and the nth day n The calculation formula is:

[0014]

[0015] In one implementation of the present invention, in step S3, the actual output value at time t on day n is defined as T nt The photovoltaic output value of the similar period is determined to be T′ nt , then the photovoltaic output deviation is ΔT nt =T nt -T′ nt ; The characteristic matrix X(i) of the i-th related factor at time y on day n nt and the characteristic matrix X(i)′ of the related factors in similar time periods nt The deviation between nt =X(i) nt -X(i)′ nt; Through the gated recurrent unit and multi-head self-attention mechanism algorithm model, the relevant factor deviation ΔX nt and photovoltaic output deviation ΔT nt Modeling, related factor deviation ΔX nt As the input of the model, the PV output deviation ΔT nt As the output of the model, a photovoltaic output deviation prediction model is obtained through a training sample set; the gated recurrent unit and multi-head self-attention mechanism algorithm model consists of an input layer, a TGTransformer encoding layer, and an output layer.

[0016] In one implementation of the present invention, the gated recurrent unit and multi-head self-attention mechanism algorithm model uses GRU and fully connected layers to replace the word embedding and position encoding links in the traditional Transformer model to obtain higher-dimensional features about photovoltaic power generation power deviation and influencing factors. The calculation formula is as follows:

[0017] X=W i GRU(x)+b i

[0018] Where x is the input vector consisting of the photovoltaic power generation deviation and the meteorological data deviation; W i , b i are the parameter matrix and bias vector of the fully connected layer respectively; x is the high-dimensional photovoltaic power generation deviation and meteorological data deviation vector output by the input layer, which is used as the input of the encoder.

[0019] In one implementation of the present invention, the multi-head self-attention mechanism performs attention calculation on the photovoltaic power generation deviation and the meteorological data deviation data, and then screens out the key information used for photovoltaic power generation deviation prediction. The calculation formula is as follows:

[0020] X·[W q ,W k ,W v ]=[Q,K,V]

[0021]

[0022] Where X is the high-dimensional photovoltaic power generation power deviation and meteorological data deviation data vector, W q , W k , W v is a parameter matrix used to calculate Q, K, and V vectors; Q, K, and V correspond to the query vector, key vector, and value vector, respectively. Q·K TThe intrinsic correlation and mutual correlation between the power deviation and the meteorological deviation data are reflected by calculating the dot product of the query value and the key value, and after exponential normalization, multiplying it with the value vector V to obtain the attention expression A(Q, K, V) of X; Softmax is an exponential normalization function used to calculate the self-attention weight value; d k is the dimension of K, Q·K T By dividing Implement scaling calculation to prevent Q·K T The gradient of Softmax disappears due to the large value.

[0023] In one implementation of the present invention, the multi-head self-attention mechanism creates h groups of X independent mappings to establish a multi-faceted self-attention expression, and the calculation formula is:

[0024] A i =A(Q i ,K i ,V i )

[0025] A MH (X) = W mh ·[A1,…,A h ]

[0026] Where i is the number of its self-attention head, A i is the self-attention expression of the i-th node; Q i , K i 、V i are the three sets of mappings of the i-th self-attention head of X; W mh is the multi-head parameter matrix; h is the number of self-attention heads; A MH (X) is the multi-head self-attention expression of X;

[0027] A linear mapping between multiple self-attention heads is added before and after the Softmax exponential normalization operation, which is used to complete the multi-head communication of self-attention key-value pairs and self-attention weight values. The calculation formula and process are as follows:

[0028]

[0029] J i =Softmax(j i (Q i ,K i ))

[0030] [L1,…,L h ]=W l [j1,…,j h ]

[0031]

[0032] A TMH (X) = W tmh ·[A T1 ,…,A Th ]

[0033] Where i is the number of the self-attention head; Construct a key-value pair, j is the key-value pair after multi-head communication, completing the preliminary communication of the correlation between photovoltaic power generation deviation and meteorological deviation data, and its communication parameter matrix is ​​W j ; J is the self-attention weight value, which is obtained by exponential normalization of j; J represents the self-attention view of each self-attention head on how to use the input data to calculate the prediction result. After mutual communication between the heads, the self-attention weight L after multi-head communication can be obtained, and its weight communication parameter matrix is ​​W l ; In order to enhance the effect of self-attention expression, it is also necessary to perform a dot product operation on L and V, and then obtain a self-attention expression A with a communication mechanism T ; A TMH Calculation results for multi-head self-attention with communication mechanism.

[0034] In one implementation of the present invention, a gating unit is introduced into the two residual links of the Transformer to control the residual connection. The gated residual of the multi-head self-attention layer of the model is implemented as follows:

[0035] z=σ(W Z X+U Z A MH )

[0036] r=σ(W r X+U r A MH )

[0037]

[0038]

[0039] Where σ is the Sigmoid activation function; ⊙ is the Hadamard product, which is defined as the multiplication of the corresponding position elements between the two matrices; W and U are the calculation parameter matrices, and σ is updated with each training to find the optimal value;

[0040] z and r are update gate and reset gate respectively. A MH New memory representation, using the reset gate to store A MH information, and the X information required for the residual connection, A′ MH is the final output gated residual result;

[0041] The output layer consists of a fully connected layer and a Sigmoid compression function, and the calculation formula is as follows:

[0042] Y=Sigmoid(W o X D +b o )

[0043] Where, Y is the output result of the output layer; X D is the output result of the encoding layer; w o , b o is the fully connected layer parameter matrix and bias vector.

[0044] In one implementation of the present invention, step S4 is specifically as follows: according to the feature matrix X(i) of the relevant factors of the previous period before the prediction day nt and the characteristic matrix X(i)′ of the related factors of the determined similar time period nt As the input of the daily photovoltaic output deviation prediction model, the daily photovoltaic output deviation ΔT output by the daily photovoltaic output deviation prediction model is obtained. nt .

[0045] The present invention also provides a distributed photovoltaic power generation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can complete the aforementioned distributed photovoltaic power generation method.

[0046] The present invention also provides a non-volatile computer storage medium for generating distributed photovoltaic power, which stores computer executable instructions. The computer executable instructions are executed by a processor to implement the aforementioned distributed photovoltaic power generation method.

[0047] The present invention provides a distributed photovoltaic power generation method, device and medium, which have the following

[0048] Beneficial effects:

[0049] (1) Based on similar typical days, a prediction model for the deviation of photovoltaic output and meteorological factors between the predicted day and similar days is constructed, which combines historical experience values ​​and deep learning technology to improve the accuracy of photovoltaic prediction;

[0050] (2) The model uses gated recurrent units to replace the original word embedding and position encoding links, performs feature fusion on the input data, and obtains high-dimensional feature data with relative position information. By introducing a communication mechanism in the multi-head self-attention link, the expression effect of the multi-head self-attention is improved;

[0051] (3) Taking into account the spatiotemporal characteristics, by clustering the photovoltaic output, the problem that a single prediction model in the region cannot take into account the spatiotemporal prediction accuracy requirements under different meteorological conditions is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The drawings described herein are used to provide a further understanding of the present invention and constitute a part 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 drawings:

[0053] Figure 1 A flow chart of a distributed photovoltaic power generation method provided by an embodiment of the present invention;

[0054] Figure 2 A model structure diagram provided for an embodiment of the present invention;

[0055] Figure 3 A photovoltaic power generation prediction curve diagram provided by an embodiment of the present invention;

[0056] Figure 4 A schematic diagram of a distributed photovoltaic power generation device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0058] The embodiment of the present invention provides a distributed photovoltaic power generation method, device and medium. Compared with the traditional method, it adds spatiotemporal correlation factors to determine the basic value of photovoltaic output under similar operating conditions. Based on the gated recurrent unit and the multi-head self-attention mechanism, a correlation model between the deviation of factors affecting photovoltaic output and the actual deviation percentage of photovoltaic output is established to correct the photovoltaic output benchmark value. In the constructed correlation analysis model, the gated recurrent unit is used to replace the word embedding and position encoding links of the traditional Transformer model in the input layer, and the input vector is feature processed to better target the photovoltaic power prediction problem. The encoding layer of the multi-head self-attention mechanism is used to calculate the self-attention expression of the input feature vector, and the output layer is responsible for outputting the prediction results of the model. The technical solution proposed in the embodiment of the present invention is described in detail below through the accompanying drawings.

[0059] Figure 1A flow chart of a distributed photovoltaic power generation method provided by an embodiment of the present invention. Figure 1 As shown, the method mainly includes the following steps:

[0060] Step S1: Acquire historical data related to multiple distributed photovoltaic power generation in a regional power grid within a certain period of time, form a sample set and construct a feature vector.

[0061] Among them, the relevant historical data include: historical power generation data, ambient temperature, wind speed, humidity, and weather type, forming a data set. The aggregation curves of multiple distributed photovoltaic power generation outputs are obtained through k-means clustering. Based on the sample set and the processed photovoltaic output data, a feature vector is constructed, x(t) = [x1(t), x2(t), x3(t), x4(t), x5(t)], where x1(t), x2(t), x3(t), x4(t), x5(t) are respectively represented as: photovoltaic power generation data, ambient temperature, wind speed, humidity, and weather type.

[0062] Step S2: Calculate the distance between each feature matrix, and judge the similarity between the factors related to the photovoltaic output changes on different dates according to the distance between the feature matrices. Based on the judgment results of the dynamic sorting of the similarity, obtain the sample values ​​of similar changes and obtain the daily photovoltaic output benchmark value T′ 基准值,t .

[0063] Step S3: construct a photovoltaic output deviation prediction model and train it based on the sample set.

[0064] Step S4: obtaining the daily photovoltaic output deviation based on the photovoltaic output deviation prediction model.

[0065] Step S5: Based on the daily photovoltaic output reference value and the daily photovoltaic output deviation, the photovoltaic power forecast value of the forecast day is obtained by adding and calculating.

[0066] In the embodiment of the present invention, in step S2, the characteristic distance is realized by using the grey correlation coefficient method, and the characteristic vector of the predicted day is X=[x1,x2,x3,x4,x5,x6,x7,x8,...,x m ], m is the number of eigenvector components, which is 5 in this embodiment. Then the factor eigenvector of the nth day is:

[0067] X(n)=[x1(n),x2(n),x3(n),x4(n),x5(n),x6(n),x7(n),x8(n),...,x m (n)],

[0068] For the nth day, the i-th eigenvector component is normalized as follows:

[0069] x i(n) = [x i (n)-x imin (n)] / [x imax (n)-x imin (n)

[0070] where x i (n) represents the i-th eigenvector component, x imax (n), x imin (n) are the maximum and minimum values ​​of the i-th eigenvector respectively;

[0071] Using the grey correlation coefficient method, the correlation coefficient between the predicted day and the ith eigenvector of the nth day is:

[0072]

[0073] Calculate the grey correlation R between the forecast day and the nth day n The calculation formula is:

[0074]

[0075] In the embodiment of the present invention, in step S3, the actual output value at time t on day n is defined as T nt The photovoltaic output value of the similar period is determined to be T′ nt , then the photovoltaic output deviation is ΔT nt =T nt -T′ nt ; The characteristic matrix X(i) of the i-th related factor at time t on the n-th day nt and the characteristic matrix X(i)′ of the related factors in similar time periods nt The deviation between nt =X(i) nt -X(i)′ nt ; Through the gated recurrent unit and multi-head self-attention mechanism algorithm model, the relevant factor deviation ΔX nt and photovoltaic output deviation ΔT nt Modeling, related factor deviation ΔX nt As the input of the model, the PV output deviation ΔT nt As the output of the model, the photovoltaic output deviation prediction model is obtained through the training sample set; the gated recurrent unit and multi-head self-attention mechanism algorithm model consists of an input layer, a TGTransformer encoding layer, and an output layer. The model structure diagram is shown in Figure 2 shown.

[0076] In the embodiment of the present invention, the gated recurrent unit and multi-head self-attention mechanism algorithm model uses GRU and fully connected layers to replace the word embedding and position encoding links in the traditional Transformer model, obtains higher-dimensional features about photovoltaic power generation power deviation and influencing factors, and uses high-dimensional feature data with more detailed position information as the input of the encoding layer to make up for the inherent structural defects of the traditional Transformer and improve the final prediction effect of the model. The calculation formula is as follows:

[0077] X=W i GRU(x)+b i

[0078] Where x is the input vector consisting of the photovoltaic power generation deviation and the meteorological data deviation; W i , b i are the parameter matrix and bias vector of the fully connected layer respectively; x is the high-dimensional photovoltaic power generation deviation and meteorological data deviation vector output by the input layer, which is used as the input of the encoder.

[0079] Transformer's multi-head self-attention mechanism can efficiently capture the dependencies between input feature vectors by highlighting key features. In order to further leverage this advantage, the project introduces mutual mapping between multiple self-attention heads, enabling mutual communication between self-attention heads and strengthening the output effect of the self-attention mechanism.

[0080] In one implementation of the present invention, the multi-head self-attention mechanism performs attention calculation on the photovoltaic power generation deviation and the meteorological data deviation data, and then screens out the key information used for photovoltaic power generation deviation prediction. The calculation formula is as follows:

[0081] X·[W q ,W k ,W v ]=[Q,K,V]

[0082]

[0083] Where X is the high-dimensional photovoltaic power generation power deviation and meteorological data deviation data vector, W q , W k , W v is a parameter matrix used to calculate Q, K, and V vectors; Q, K, and V correspond to the query vector, key vector, and value vector, respectively. Q·K T The intrinsic correlation and mutual correlation between the power deviation and the meteorological deviation data are reflected by calculating the dot product of the query value and the key value, and after exponential normalization, multiplying it with the value vector V to obtain the attention expression A(Q, K, V) of X; Softmax is an exponential normalization function used to calculate the self-attention weight value; dk is the dimension of K, Q·K T By dividing Implement scaling calculation to prevent Q·K T The gradient of Softmax disappears due to the large value.

[0084] In the embodiment of the present invention, the multi-head self-attention mechanism creates h groups of X independent mappings to establish multi-faceted self-attention expressions, and the calculation formula is:

[0085] A i =A(Q i ,K i ,V i )

[0086] a MH (x) = W mh ·[A1,…,A h ]

[0087] Where i is the number of its self-attention head, A i is the self-attention expression of the i-th node; Q i , K i 、V i are the three sets of mappings of the i-th self-attention head of X; W mh is the multi-head parameter matrix; h is the number of self-attention heads; A MH (X) is the multi-head self-attention expression of X;

[0088] Each head in the multi-head self-attention structure is independent of each other, and there is no information exchange, which is not conducive to further analyzing the potential relationship between photovoltaic power generation deviation and meteorological data deviation. Linear mapping between multiple self-attention heads is added before and after the Softmax exponential normalization operation, which is used to complete the multi-head mutual communication of self-attention key-value pairs and self-attention weight values. The calculation formula and process are as follows:

[0089]

[0090] J i =Softmax(j i (Q i ,K i ))

[0091] [L1,…,L h ]=W l [j1,…,j h ]

[0092] A Ti =L i ·V i

[0093] A TMH (X) = W tmh ·[A T1 ,…,A Th ]

[0094] Where i is the number of the self-attention head; Construct a key-value pair, j is the key-value pair after multi-head communication, completing the preliminary communication of the correlation between photovoltaic power generation deviation and meteorological deviation data, and its communication parameter matrix is ​​W j ; J is the self-attention weight value, which is obtained by exponential normalization of j; J represents the self-attention view of each self-attention head on how to use the input data to calculate the prediction result. After mutual communication between the heads, the self-attention weight L after multi-head communication can be obtained, and its weight communication parameter matrix is ​​W l ; In order to enhance the effect of self-attention expression, it is also necessary to perform a dot product operation on L and V, and then obtain a self-attention expression A with a communication mechanism T ; A TMH Calculation results for multi-head self-attention with communication mechanism.

[0095] In the embodiment of the present invention, a gating unit is introduced into the two residual links of the Transformer to control the residual connection. The gated residual of the multi-head self-attention layer of the model is implemented as follows:

[0096] z=σ(W Z X+U Z A MH )

[0097] r=σ(W r X+U r A MH )

[0098]

[0099]

[0100] Where σ is the Sigmoid activation function; ⊙ is the Hadamard product, which is defined as the multiplication of the corresponding position elements between the two matrices; W and U are the calculation parameter matrices, and σ is updated with each training to find the optimal value;

[0101] z and r are the update gate and reset gate respectively. The update gate determines how much self-attention data before the residual connection needs to be input after the residual connection, and the reset gate determines how much attention data before the residual connection needs to be forgotten. A MH New memory representation, using the reset gate to store A MH information, and the X information required for the residual connection, A′MH is the final output gated residual result; the subsequent feedforward connection gated residual calculation structure is the same as this structure.

[0102] The output layer consists of a fully connected layer and a Sigmoid compression function, and the calculation formula is as follows:

[0103] Y=Sigmoid(W o X D +b o )

[0104] Where, Y is the output result of the output layer; X D is the output result of the encoding layer; W o , b o is the fully connected layer parameter matrix and bias vector.

[0105] In the embodiment of the present invention, the step S4 is specifically as follows: according to the feature matrix X(i) of the relevant factors of the previous period before the prediction day nt and the characteristic matrix X(i)′ of the related factors of the determined similar time period nt As the input of the daily photovoltaic output deviation prediction model, the daily photovoltaic output deviation ΔT output by the daily photovoltaic output deviation prediction model is obtained. nt .

[0106] The photovoltaic power on the forecast day is predicted according to the following formula:

[0107] T 预测日,t =ΔT t +T′ 基准值,t

[0108] Where, T 预测日,t is the predicted photovoltaic power value on the forecast day, ΔT t is the daily photovoltaic output deviation, T′ 基准值,t It is the daily photovoltaic output benchmark value.

[0109] The application of the present invention in actual scenarios is as follows: In October 2024, a field application test was carried out in a distributed park. The multi-electric parameter data of the photovoltaic power generation grid point is collected through a three-phase harmonic measuring instrument, the voltage is connected in parallel to the original voltage transformer terminals, and the current is connected in series to the original instrument. The three-phase harmonic measuring instrument and 4G communication device are installed in the cabinet, and the photovoltaic power generation power prediction curve output by the computer is as follows Figure 3 As shown, the prediction accuracy is 95.3%.

[0110] The above is a distributed photovoltaic power generation method provided by an embodiment of the present invention. Based on the same inventive concept, an embodiment of the present invention also provides a distributed photovoltaic power generation device. Figure 4A schematic diagram of a distributed photovoltaic power generation device provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the device mainly includes: at least one processor 401; and a memory 402 that is communicatively connected to the at least one processor; wherein the memory 402 stores instructions that can be executed by the at least one processor 401, and the instructions are executed by the at least one processor 401 so that the at least one processor 401 can complete the aforementioned distributed photovoltaic power generation method.

[0111] In addition, an embodiment of the present invention further provides a non-volatile computer storage medium for generating distributed photovoltaic power, which stores computer executable instructions. The computer executable instructions are executed by a processor to implement the aforementioned distributed photovoltaic power generation method.

[0112] 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.

[0113] 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 including 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.

[0114] 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 The steps for the functions specified in one or more boxes.

[0115] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0116] The various embodiments of the present invention are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0117] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0118] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A distributed photovoltaic power generation method, characterized in that: The method comprises the following steps: Step S1: Acquire relevant historical data of multiple distributed photovoltaic power generation in a regional power grid within a certain period of time, form a sample set and construct a feature vector; Step S2: Calculate the distance between each feature matrix, determine the similarity between the factors related to the photovoltaic output changes on different dates according to the distance between the feature matrices, obtain the sample values ​​of similar changes based on the dynamic sorting of the similarity, and obtain the daily photovoltaic output benchmark value; Step S3: construct a photovoltaic output deviation prediction model and train it based on the sample set; Step S4: obtaining a daily photovoltaic output deviation based on the photovoltaic output deviation prediction model; Step S5: Based on the daily photovoltaic output reference value and the daily photovoltaic output deviation, the photovoltaic power forecast value of the forecast day is obtained by adding and calculating.

2. A distributed photovoltaic power generation method according to claim 1, characterized in that: In step S2, the characteristic distance is realized by the grey correlation coefficient method, and the characteristic vector of the predicted day is X=[x1, x2, x3, x4, x5, x6, x7, x8, ..., x m ], m is the number of eigenvector components, then the factor eigenvector of day n is: X(n)=[x1(n),x2(n),x3(n),x4(n),x5(n),x6(n),x7(n),x8(n),...,x m (n)], For the nth day, the i-th eigenvector component is normalized as follows: x i (n)=[x i (n)-x imin (n)] / [x imax (n)-x imin (n)] where x i (n)x i (n) represents the i-th eigenvector component, x imax (n), x imin (n) are the maximum and minimum values ​​of the i-th eigenvector respectively; Using the grey correlation coefficient method, the correlation coefficient between the predicted day and the ith eigenvector of the nth day is: Calculate the grey correlation R between the forecast day and the nth day n The calculation formula is:

3. A distributed photovoltaic power generation method according to claim 1, characterized in that: In step S3, the actual output value at time t on day n is defined as T nt The photovoltaic output value of the similar period is determined to be T′ nt , then the photovoltaic output deviation is ΔT nt =T nt -T′ nt ; The characteristic matrix X(i) of the i-th related factor at time t on the n-th day nt and the characteristic matrix X(i)′ of the related factors in similar time periods nt The deviation between nt =X(i) nt -X(i)′ nt ; Through the gated recurrent unit and multi-head self-attention mechanism algorithm model, the relevant factor deviation ΔX nt and photovoltaic output deviation ΔT nt Modeling, related factor deviation ΔX nt As the input of the model, the PV output deviation ΔT nt As the output of the model, a photovoltaic output deviation prediction model is obtained through a training sample set; the gated recurrent unit and multi-head self-attention mechanism algorithm model consists of an input layer, a TGTransformer encoding layer, and an output layer.

4. A distributed photovoltaic power generation method according to claim 3, characterized in that: The gated recurrent unit and multi-head self-attention mechanism algorithm model uses GRU and fully connected layers to replace the word embedding and position encoding links in the traditional Transformer model to obtain higher-dimensional features about photovoltaic power generation power deviation and influencing factors. The calculation formula is as follows: X=W i GRU(x)+b i Where x is the input vector consisting of the photovoltaic power generation deviation and the meteorological data deviation; W i 、b i are the parameter matrix and bias vector of the fully connected layer respectively; X is the high-dimensional photovoltaic power generation deviation and meteorological data deviation vector output by the input layer, which is used as the input of the encoder.

5. A distributed photovoltaic power generation method according to claim 3, characterized in that: The multi-head self-attention mechanism performs attention calculation on the photovoltaic power generation deviation and meteorological data deviation data, and then screens out the key information for photovoltaic power generation deviation prediction. The calculation formula is as follows: X·[W q ,W k ,W v ]=[Q,K,V] Where X is the high-dimensional photovoltaic power generation power deviation and meteorological data deviation data vector, W q , W k , W v is a parameter matrix used to calculate Q, K, and V vectors; Q, K, and V correspond to the query vector, key vector, and value vector, respectively. Q·K T The intrinsic correlation and mutual correlation between the power deviation and the meteorological deviation data are reflected by calculating the dot product of the query value and the key value, and after exponential normalization, multiplying it with the value vector V to obtain the attention expression A(Q, K, V) of X; Softmax is an exponential normalization function used to calculate the self-attention weight value; d k is the dimension of K, Q·K T By dividing Implement scaling calculation to prevent Q·K T The gradient of Softmax disappears due to the large value.

6. A distributed photovoltaic power generation method according to claim 3, characterized in that: The multi-head self-attention mechanism creates h groups of independent mappings of X to establish a multi-faceted self-attention expression. The calculation formula is: A i =A(Q i ,K i ,V i ) A MH (X)=W mh ·[A1,…,A h ] Where i is the number of its self-attention head, A i is the self-attention expression of the i-th node; Q i , K i 、V i are the three sets of mappings of the i-th self-attention head of X; W mh is the multi-head parameter matrix; h is the number of self-attention heads; A MH (X) is the multi-head self-attention expression of X; A linear mapping between multiple self-attention heads is added before and after the Softmax exponential normalization operation, which is used to complete the multi-head communication of self-attention key-value pairs and self-attention weight values. The calculation formula and process are as follows: J i =Softmax(j i (Q i ,K i )) [L1,...,L h ]=W l [j1,...,j h ] A TMH (X)=W tmh ·[A T1 ,...,A Th ] Where i is the number of the self-attention head; Construct a key-value pair, j is the key-value pair after multi-head communication, completing the preliminary communication of the correlation between photovoltaic power generation deviation and meteorological deviation data, and its communication parameter matrix is ​​W j ; J is the self-attention weight value, which is obtained by exponential normalization of j; J represents the self-attention view of each self-attention head on how to use the input data to calculate the prediction result. After mutual communication between the heads, the self-attention weight L after multi-head communication can be obtained, and its weight communication parameter matrix is ​​W l ; In order to enhance the effect of self-attention expression, it is also necessary to perform a dot product operation on L and V, and then obtain a self-attention expression A with a communication mechanism T ; A TMH Calculation results for multi-head self-attention with communication mechanism.

7. A distributed photovoltaic power generation method according to claim 3, characterized in that: In the two residual links of Transformer, a gated unit is introduced to control the residual connection. The gated residual of the multi-head self-attention layer of the model is implemented as follows: z=σ(W z X+U Z A MH ) r6σ(W r X+U r AM MH ) Where σ is the Sigmoid activation function; ⊙ is the Hadamard product, which is defined as the multiplication of the corresponding position elements between the two matrices; W and U are the calculation parameter matrices, and σ is updated with each training to find the optimal value; z and r are update gate and reset gate respectively. A MH New memory representation, using the reset gate to store A MH information, and the X information required for the residual connection, A′ MH is the final output gated residual result; The output layer consists of a fully connected layer and a Sigmoid compression function, and the calculation formula is as follows: Y=Sigmoid(W o X D +b o ) Where, Y is the output result of the output layer; X D is the output result of the encoding layer; W o 、b o is the fully connected layer parameter matrix and bias vector.

8. A distributed photovoltaic power generation method according to claim 1, characterized in that: The step S4 is specifically as follows: according to the feature matrix X(i) of the relevant factors of the previous period before the forecast date nt and the characteristic matrix X(i)′ of the related factors of the determined similar time period nt As the input of the daily photovoltaic output deviation prediction model, the daily photovoltaic output deviation ΔT output by the daily photovoltaic output deviation prediction model is obtained. nt .

9. A distributed photovoltaic power generation device, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can complete the distributed photovoltaic power generation method described in any one of claims 1-8.

10. A non-volatile computer storage medium for distributed photovoltaic power generation, storing computer executable instructions, characterized in that: The computer executable instructions are executed by a processor to implement a distributed photovoltaic power generation method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Photovoltaic power prediction method combining attention mechanism and error correction

    CN113205226A

  • Distributed photovoltaic power distribution network output prediction method and device, electronic equipment and medium

    CN116842855A

  • GRA-BI-LSTM photovoltaic power prediction method and model based on similar days

    CN119009973A