Distributed power supply power prediction method, system and equipment based on LSTM (Long Short Term Memory)

Through the distributed power supply power prediction method based on LSTM, combined with meteorological data and physical constraints, the DBSCAN clustering algorithm and adaptive parameter adjustment are used to solve the problem of unstable distributed power prediction in the existing technology, and more efficient power prediction is achieved.

CN120033663AActive Publication Date: 2025-05-23STATE GRID HUBEI ELECTRIC POWER INFORMATION & TELECOMMUNICATION COMPANY +1

Patent Information

Application Number
CN202411889313.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-23
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

The prior art lacks a unified data set for output sequences for distributed power supplies and a network prediction model suitable for different power business characteristics, and traditional statistical learning methods are difficult to analyze the spatial and temporal correlation of data, resulting in unstable prediction results.

Method used

The distributed power supply power prediction method based on LSTM is adopted to obtain historical and forecast meteorological data, calculate theoretical power data, and use the DBSCAN clustering algorithm to cluster and dimension expansion. Combining the physical constraints of distributed power and theoretical power, the loss function of the LSTM prediction network is optimized, the parameters of the DBSCAN clustering algorithm are adaptively adjusted, and the above steps are repeated until the prediction is completed.

Benefits of technology

The prediction stability and efficiency of distributed power supply power are improved, the data limitation of predicting only normal values ​​is avoided, and the modeling ability of the model to model complex time dependencies is enhanced, making the algorithm more efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120033663A_ABST
    Figure CN120033663A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed power supply power prediction method, system and equipment based on LSTM, and the method comprises the steps: firstly obtaining meteorological data of a distributed power supply target region, calculating theoretical power data, then carrying out the clustering analysis based on a DBSCAN algorithm, expanding the data dimension, obtaining a normal value and abnormal value data set, carrying out the optimization of a loss function of an LSTM prediction network, and carrying out the prediction of the power supply power of the distributed power supply. And predicting to obtain future normal value and abnormal value prediction results, finally setting parameter adjustment conditions, and repeating the steps until the prediction is completed. According to the method, for the problems that historical electric power data are various in type and have many abnormal values, the distance definition of a DBSCAN clustering algorithm is improved, the distance between a data point and theoretical output power is combined, the stability of normal value extraction is improved, an LSTM prediction network is introduced, the data limitation that only the normal value is predicted is avoided, and the prediction efficiency is improved. And meanwhile, a loss function is improved by combining physical constraints and theoretical power, and adaptive adjustment parameters are optimized, so that the algorithm is more efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a power prediction method, a system and a device for predicting power supply of a distributed power supply based on LSTM. Background Art

[0002] Distributed energy has the characteristics of randomness, intermittency, and uneven distribution, which to a certain extent limits the stable absorption capacity of the power grid and causes a series of steady-state and transient power quality problems. Therefore, realizing the intelligent prediction of the power supply of distributed power sources is a necessary measure to accelerate the intelligent transformation and sustainable development of the power grid.

[0003] However, in the current technical means, not only is there a lack of a unified data set for the output sequence of distributed power sources, but there are also few network prediction models that are reasonably designed and constructed for distributed power sources based on different power business characteristics. On the one hand, in the data processing part, power data has the characteristics of large data volume, various types, and many outliers. It cannot be used directly and needs to be cleaned in advance. The cleaning efficiency directly affects the subsequent work. How to design an efficient data cleaning method still has certain challenges; on the other hand, since the output data and environmental information are both time series data and present certain relevant information with the spatial distribution, traditional statistical learning correlation analysis methods, such as Pearson correlation coefficient, are difficult to analyze the temporal and spatial correlation of data, resulting in unstable data classification results. Therefore, there is an urgent need for an efficient and stable means to effectively predict the large amount of power data. Summary of the invention

[0004] The purpose of the present invention is to overcome the above-mentioned defects and problems existing in the prior art and to provide an efficient and stable LSTM-based distributed power supply power prediction method, system and device.

[0005] To achieve the above objectives, the technical solution of the present invention is: a distributed power supply power prediction method based on LSTM, comprising:

[0006] S1. Obtain historical meteorological data and future forecast meteorological data of the target area of ​​distributed power generation, and calculate theoretical power data of the target area of ​​distributed power generation;

[0007] S2. Perform cluster analysis on theoretical power data based on DBSCAN clustering algorithm, and add theoretical power to expand data dimension to obtain normal value data set and abnormal value data set of distributed power supply power;

[0008] S3. Optimize the loss function of the LSTM prediction network in combination with the physical constraints and theoretical power of the distributed power source, and predict the normal value prediction results and the abnormal value prediction results of the future power generation of the distributed power source through the LSTM prediction network based on the normal value data set and the abnormal value data set; the LSTM prediction network includes a first prediction network and a second prediction network connected in parallel;

[0009] S4. Based on the normal value prediction results and the abnormal value prediction results, set the parameter adjustment conditions, adaptively adjust the parameter settings of the DBSCAN clustering algorithm, and repeat steps S1-S4 until the prediction is completed.

[0010] The step S1 specifically includes:

[0011] S11, obtaining historical meteorological data and future forecast meteorological data of the target area of ​​distributed power generation; the meteorological data includes water runoff, upstream and downstream water level, wind speed, atmospheric pressure, air temperature, air humidity, and light radiation intensity;

[0012] S12, obtaining the power generation type of the distributed power source, selecting the historical meteorological data and future forecast meteorological data corresponding to the power generation type, and calculating the corresponding theoretical power generation power;

[0013] The power generation type includes any one of hydropower generation, wind power generation, and photovoltaic power generation; the theoretical power generation corresponding to the power generation type includes any one or any combination of the following:

[0014] For hydroelectric power generation, the factors that affect the power generation of the turbine generator include the water flow rate l through the motor, the working head height h, and the motor working efficiency λ; then the theoretical power generation power P of hydroelectric power generation w The expression is as follows:

[0015] P w = lhλ;

[0016] h=h a -h b -h δ ;

[0017] Where: h a is the upstream water level, h b is the downstream water level, h δ is the head loss of the power station;

[0018] For wind power generation, the factors that affect the power generation of the wind turbine mainly include the wind turbine power coefficient C, air density ρ, wind rotor swept area A, and wind speed v; then the theoretical power generation of wind power generation P f The expression is as follows:

[0019]

[0020] Where: p is the atmospheric pressure, t is the air temperature, p w is the air humidity;

[0021] For photovoltaic power generation, the factors that affect the power generation of photovoltaic power generation mainly include the photoelectric conversion efficiency η, the photovoltaic array area S, the radiation intensity I, and the air temperature t 0 ; Then the theoretical power generation power of photovoltaic power generation P s The expression is as follows:

[0022] P s =ηSI[100.005(t 0 +25)].

[0023] The step S2 specifically includes:

[0024] S21, taking the theoretical power data as the data set D = (p 1 , p 2 ,…,p n ) to perform cluster analysis and to measure the power x of the theoretical power generation i Based on the theoretical power To expand the data dimension, when performing cluster analysis based on the DBSCAN clustering algorithm, any two sample points p i and p j The distance expression between them is as follows:

[0025]

[0026] ω 1 +ω 2 =1;ω 1 ,ω 2 >0;ω 1 >ω 2 ;

[0027] Where: 1 ,ω 2 are distance weight parameters, x j For p j The measured power at the point, For p j Theoretical power of the point;

[0028] S22, if p i The ε domain contains at least MinPts t samples, then p i As the core object, the cluster sub-datasets corresponding to all the core objects in the data set are combined to obtain the final normal value data set A, and the other data are the outlier data set B.

[0029] The step S3 specifically includes:

[0030] S31. Based on the first prediction network and the normal value data set A, predict the normal power occurrence time and corresponding value of the distributed power source in the future period to obtain the normal value prediction result a; combine the normal value prediction result a with the theoretical power data corresponding to the normal value data set A to obtain the normal value data set A′;

[0031] S32, based on the second prediction network and the abnormal value data set B, predict the abnormal power occurrence time and corresponding value in the future period of the distributed power source, and obtain the abnormal value prediction result b;

[0032] S33, comparing the normal value prediction result a with the abnormal value prediction result b;

[0033] If at the same time t, a t =b t ; then the prediction result b for the outlier t Add noise σ to correct it and obtain the corrected outlier prediction result b′ t ; Correct the outlier prediction result b′ t The theoretical power data corresponding to the outlier data set B is combined to obtain an outlier data set B′.

[0034] The step S4 specifically includes:

[0035] S41, combining the normal value data set A′ and the abnormal value data set B′ to form a data set D′={A′, B′};

[0036] S42, performing cluster analysis on the data set D′ based on the DBSCAN clustering algorithm to obtain a new normal value data set A″ and an abnormal value data set B″;

[0037] S43, set the first condition and the second condition for clustering algorithm adaptive parameter adjustment, and determine whether they are satisfied; if any one of the first condition or the second condition is satisfied, update the sample number threshold MinPts of the clustering algorithm at the next moment according to the satisfied condition t ;

[0038] The first condition is: if the number of data in the intersection of B″ and A′ exceeds the threshold N 0 , that is, |A′∩B″|>N 0 ;

[0039] The second condition is: if the number of data in the intersection of A″ and B′ exceeds the threshold N 0 , that is, |A″∩B′|>N 0 ;

[0040] If the first condition is met, the sample number threshold MinPts of the clustering algorithm at the next moment is increased t , which is expressed as follows:

[0041]

[0042] If the second condition is met, the sample number threshold MinPts of the clustering algorithm at the next moment is reduced t , which is expressed as follows:

[0043]

[0044] in: To round down;

[0045] S44, based on the updated sample number threshold MinPts t , return to step S1.

[0046] In step S3, optimizing the loss function means:

[0047] In the loss function of the first prediction network, the physical constraint penalty term is added for correction, and its loss function is as follows:

[0048]

[0049] Where: N 1 is the output dimension of the first prediction network, x i is the actual power, is the predicted power, λ 1 is the weight coefficient of the physical constraint, is the physical constraint penalty term, P min is the minimum power, P max is the maximum power.

[0050] In step S3, optimizing the loss function means:

[0051] In the loss function of the second prediction network, the theoretical power is added for correction, and its loss function is as follows:

[0052]

[0053] Where: N 2 is the output dimension of the second prediction network, λ 2 is the weight coefficient of the difference from the theoretical power, is the theoretical power, is the predicted power of the second prediction network, N 3 is the number of outlier datasets, x B,iis the actual power in the outlier dataset, is the predicted power at the time corresponding to the actual power.

[0054] The first prediction network includes a number of input channels, an initial LSTM layer, a feature fusion layer, a final LSTM layer and an output layer;

[0055] The second prediction network includes a number of input channels, an initial LSTM layer, a feature fusion layer and an output layer;

[0056] The input channels of the first and second prediction networks include power data input, meteorological data input, and equipment status data input;

[0057] The initial LSTM layers of the first and second prediction networks both include a power data LSTM layer, a meteorological data LSTM layer, and an equipment status data LSTM layer.

[0058] A distributed power supply power prediction system based on LSTM, which is applied to the above method, and includes:

[0059] Theoretical power data calculation module, used to obtain historical meteorological data and future forecast meteorological data of the distributed power target area, and calculate theoretical power data of the distributed power target area;

[0060] The clustering analysis module is used to perform clustering analysis on theoretical power data based on the DBSCAN clustering algorithm, and to increase the theoretical power expansion data dimension to obtain the normal value data set and abnormal value data set of the distributed power supply power;

[0061] A prediction network module is used to optimize the loss function of the LSTM prediction network in combination with the physical constraints and theoretical power of the distributed power source, and based on the normal value data set and the abnormal value data set, respectively predict the normal value prediction result and the abnormal value prediction result of the future power generation of the distributed power source through the LSTM prediction network; the LSTM prediction network includes a first prediction network and a second prediction network connected in parallel;

[0062] The adaptive clustering adjustment module is used to set parameter adjustment conditions based on the normal value prediction results and the abnormal value prediction results, adaptively adjust the parameter settings of the DBSCAN clustering algorithm, and repeat the steps of the above module until the prediction is completed.

[0063] A distributed power supply power prediction device based on LSTM, the device comprising a processor and a memory;

[0064] The memory is used to store computer program code and transmit the computer program code to the processor;

[0065] The processor is used to execute the above-mentioned LSTM-based distributed power supply power prediction method according to the instructions in the computer program code.

[0066] Compared with the prior art, the present invention has the following beneficial effects:

[0067] In a distributed power supply power prediction method, system and device based on LSTM of the present invention, the method first obtains meteorological data of the distributed power target area, calculates theoretical power data, then performs cluster analysis based on the DBSCAN clustering algorithm, and expands the data dimension to obtain a normal value data set and an abnormal value data set, then optimizes the loss function of the LSTM prediction network in combination with physical constraints and theoretical power, and predicts and obtains normal value prediction results and abnormal value prediction results of future power generation, finally sets parameter adjustment conditions, repeats the above steps, and obtains the power supply power prediction value; in the application of this design, in view of the problem of numerous historical power data types and many abnormal values, by improving the distance definition of the DBSCAN clustering algorithm, combining the distance between the data point and the theoretical output power, the stability of normal value extraction is improved, and the LSTM prediction network is introduced to avoid the data limitation of only predicting normal values, and at the same time, the loss function is improved in combination with physical constraints and theoretical power, the adaptive adjustment parameters are optimized, and the modeling ability of the model for complex time-dependent relationships is enhanced, making the algorithm more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 It is a flow chart of the method of the present invention.

[0069] Figure 2 This is a flow chart of theoretical power data calculation in Example 1 of the present invention.

[0070] Figure 3 It is a clustering analysis flow chart of the DBSCAN clustering algorithm in Example 1 of the present invention.

[0071] Figure 4 This is a prediction flow chart of the LSTM prediction network in Example 1 of the present invention.

[0072] Figure 5 This is a flow chart of adaptive parameter adjustment in Embodiment 1 of the present invention.

[0073] Figure 6 It is a system structure diagram of the present invention.

[0074] Figure 7 Device structure diagram of the present invention.

[0075] In the figure: theoretical power data calculation module 1, cluster analysis module 2, prediction network module 3, adaptive adjustment cluster module 4, processor 5, memory 6, computer program code 61. DETAILED DESCRIPTION

[0076] The present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0077] Embodiment 1:

[0078] See also Figure 1 , a distributed power supply power prediction method based on LSTM, comprising:

[0079] S1. Obtain historical meteorological data and future forecast meteorological data of the target area of ​​distributed power generation, and calculate theoretical power data of the target area of ​​distributed power generation;

[0080] Furthermore, the step S1 specifically includes:

[0081] S11, obtaining historical meteorological data and future forecast meteorological data of the target area of ​​distributed power generation; the meteorological data includes water runoff, upstream and downstream water level, wind speed, atmospheric pressure, air temperature, air humidity, and light radiation intensity;

[0082] S12, obtain the power generation type of the distributed power source, select the historical meteorological data and future forecast meteorological data corresponding to the power generation type, and calculate the corresponding theoretical power generation power; the calculation process is shown in Figure 2 ;

[0083] The power generation type includes any one of hydropower generation, wind power generation, and photovoltaic power generation; the theoretical power generation corresponding to the power generation type includes any one or any combination of the following:

[0084] For hydroelectric power generation, the factors that affect the power generation of the turbine generator include the water flow rate l through the motor, the working head height h, and the motor working efficiency λ; then the theoretical power generation power P of hydroelectric power generation w The expression is as follows:

[0085] P w = lhλ;

[0086] h=h a -h b -h δ ;

[0087] Where: h a is the upstream water level, h b is the downstream water level, h δ is the head loss of the power station;

[0088] S12. For wind power generation, the factors that affect the power generation of the wind turbine mainly include the wind turbine power coefficient C, air density ρ, wind rotor swept area A, and wind speed v; then the theoretical power generation of wind power generation P fThe expression is as follows:

[0089]

[0090] Where: p is the atmospheric pressure, t is the air temperature, p w is the air humidity;

[0091] In this embodiment, for wind power generation, when the wind speed does not reach the cut-in wind speed, that is, v<V in , the fan output power is P f =0; when the wind speed is between the cut-in wind speed and the rated wind speed, that is, V in ≤v≤V rate , then calculate according to the above formula; when the wind speed is between the rated wind speed and the cut-out wind speed, that is, V rate <v<V out , the fan output power is maintained at the rated power P f =P rate ; When the wind speed is greater than the cut-out wind speed, that is, v>V out In order to protect the fan, the fan needs to be shut down. At this time, P f =0.

[0092] S13. For photovoltaic power generation, the factors that affect the power generation of photovoltaic power generation mainly include the photoelectric conversion efficiency η, the photovoltaic array area S, the radiation intensity I, and the air temperature t 0 ; Then the theoretical power generation power of photovoltaic power generation P s The expression is as follows:

[0093] P s =ηSI[100.005(t 0 +25)];

[0094] Among them: 1 00.005 and 25 are constants.

[0095] S2. Perform cluster analysis on theoretical power data based on DBSCAN clustering algorithm, and add theoretical power to expand data dimension to obtain normal value data set and abnormal value data set of distributed power supply power;

[0096] In this embodiment, the DBSCAN clustering algorithm is used to cluster normal values, and the remaining data are classified as abnormal values. The sample point set is denoted as D = (p 1 , p 2 ,…,p n ), and by (ε, MinPts t ) describes the sample distribution density of the neighborhood; ε is the neighborhood distance threshold of a sample, and the ε domain is for p i ∈D, to p i MinPts is the set of points whose distance does not exceed ε;t is the number threshold of samples within the distance threshold set at the current time t, and the threshold will be adaptively adjusted with T as a period in step S4.

[0097] In this solution, in order to better adapt to different power generation modes and address the problem of various historical power data types, compared with the traditional algorithm in which the distance between two points is determined only by the measured power, the present invention increases the data dimension. i , at which the measured power x i On the basis of When the distributed power source is any one of hydroelectric power generation, wind power generation, and photovoltaic power generation, The value of is calculated based on its corresponding historical theoretical power generation.

[0098] Furthermore, the step S2 specifically includes:

[0099] S21, taking the theoretical power data as the data set D = (p 1 , p 2 ,…,p n ) to perform cluster analysis and measure the power x in the historical theoretical power generation i Based on the theoretical power To expand the data dimension, when performing cluster analysis based on the DBSCAN clustering algorithm, any two sample points p i and p j The distance expression between them is as follows:

[0100]

[0101] ω 1 +ω 2 =1;ω 1 ,ω 2 >0;ω 1 >ω 2 ;

[0102] Where: 1 ,ω 2 are distance weight parameters, x j For p j The measured power at the point, For p j Theoretical power of the point;

[0103] S22, if p i The ε domain contains at least MinPts t samples, then p iThe core object and all its density-reachable points form a set. The density connection relationship of all points in the set is used to obtain a cluster sub-dataset. The cluster sub-datasets corresponding to all core objects in the data set are combined to obtain the final normal value data set A, and the other data are the outlier data set B.

[0104] See also Figure 3 In this embodiment, the steps of performing cluster analysis using the DBSCAN clustering algorithm are as follows:

[0105] S221: Process starts;

[0106] S222: Input the data set D (or data set D′) and set the DBSCAN clustering parameter MinPts (assuming that the current time is t, the value of MinPts is MinPts t ), the neighborhood size parameter ε, the distance weight parameter ω 1 ,ω 2 , and create an empty set A (or empty set A″) and an empty set B (or empty set B″);

[0107] S223: Select any unvisited point p from the data set D (or data set D′);

[0108] S224: Check whether the number of points in the ε neighborhood of point p is greater than or equal to MinPts (or MinPts t ); if yes, go to step S226, otherwise go to step S225;

[0109] S225: Mark point p as an outlier and add it to set B (or B″);

[0110] S226: Mark point p as a core point, establish a new cluster C, and add all points in the neighborhood of point p to the new cluster C;

[0111] S227: Check all unmarked points in cluster C, denoted as point q;

[0112] S228: Check whether the number of points in the ε neighborhood of point q is less than MinPts; if so, mark the point as a boundary point and return to step S227, otherwise proceed to step S229;

[0113] S229: adding all points in the point neighborhood to cluster C, and adding all points in C to set A (or A″);

[0114] S2210: Check whether there are any unmarked points in the data set D (or data set D′); if so, return to step S223, otherwise the process ends and the cluster analysis results are output.

[0115] S3. Optimize the loss function of the LSTM prediction network in combination with the physical constraints and theoretical power of the distributed power source, and predict the normal value prediction results and the abnormal value prediction results of the future power generation of the distributed power source through the LSTM prediction network based on the normal value data set and the abnormal value data set; the LSTM prediction network includes a first prediction network and a second prediction network connected in parallel;

[0116] Further, in this solution, the first prediction network includes a number of input channels, an initial LSTM layer, a feature fusion layer, a final LSTM layer and an output layer;

[0117] The second prediction network includes a number of input channels, an initial LSTM layer, a feature fusion layer and an output layer;

[0118] The input channels of the first and second prediction networks include power data input, meteorological data input, and equipment status data input;

[0119] The initial LSTM layers of the first and second prediction networks both include a power data LSTM layer, a meteorological data LSTM layer, and an equipment status data LSTM layer.

[0120] See also Figure 4 ,In this embodiment, the first prediction network is used to realize the ,prediction of the normal value of electricity, which includes three input channels, an initial LSTM layer, a feature fusion layer, a final LSTM layer and an output layer.

[0121] The three input channels are power data input, which includes the current time before T a The historical normal power data and the corresponding theoretical power data within the time period come from set A; the meteorological data input includes the historical meteorological data at the corresponding time of set A and the future T from the current time. b Weather forecast data within the time period; equipment status data input including the operating status of the power supply equipment at the corresponding moment of set A.

[0122] Each input passes through its own initial LSTM layer, namely the power data LSTM layer, the meteorological data LSTM layer, and the equipment status data LSTM layer. Then the feature fusion layer merges the outputs of each LSTM layer into a whole through data connection. The merged data is input to the final LSTM layer to further extract high-level time series features. The output layer uses a fully connected layer and uses the sigmoid function as the activation function. Finally, the output layer outputs a set of predicted power values, and outputs the predicted results of the occurrence time and corresponding value of the normal power of the distributed power source in the future. The normal value prediction result is combined with its corresponding theoretical power data to obtain the set A′.

[0123] The second prediction network is used to realize the prediction of power anomaly values, which includes three input channels, an initial LSTM layer, a feature fusion layer and an output layer.

[0124] The three input channels are power data input, which includes the current time before T a The historical power anomaly data and the corresponding theoretical power data within the time period come from set B; the meteorological data input includes the historical meteorological data at the corresponding time of set B and the future T from the current time. b Weather forecast data within the time period; equipment status data input includes the operating status of the power supply equipment at the corresponding moment of set B.

[0125] Each input passes through its own initial LSTM layer, namely the power data LSTM layer, the meteorological data LSTM layer, and the equipment status data LSTM layer. Then the feature fusion layer merges the outputs of each LSTM layer into a whole through data connection. The merged data is input to the output layer. The output layer adopts a fully connected layer and uses the sigmoid function as the activation function to output the prediction results of the occurrence time and corresponding value of abnormal power of distributed power sources in the future.

[0126] For the LSTM layers in the first and second prediction networks, each LSTM layer includes an input gate, a forget gate, an output gate, and a cell state, and the processing steps are as follows:

[0127] The memory information at time t is stored in the cell state C t In the example, the input gate processes the input of the current sequence position, which includes the sigmoid function layer and the tanh function layer. The sigmoid function determines which new information is added to the cell state, and its expression is as follows:

[0128] i t =σ(W i [h t-1 , x t ]+b i );

[0129] Where: σ(*) is the sigmoid function, x t is the input of the current sequence position, h t-1 is the hidden state, W i , b i is the network parameter;

[0130] The candidate vector generated by the tanh function layer converts the information into a form that can be added to the cell state, and its expression is as follows:

[0131]

[0132] Where: tanh(*) is the tanh function, Wc , b j is the network parameter;

[0133] The forget gate uses the sigmoid function to determine which states of the previous layer of cells need to be forgotten and which need to be retained. Its expression is as follows:

[0134] f t =σ(W f [h t-1 , x t ]+b f );

[0135] Where: W f , b f is the network parameter;

[0136] The cell state is then updated to

[0137] Furthermore, for the loss function of the first prediction network, since the output power of the distributed power source has physical constraints, such as wind power generation power is limited by wind speed, solar power output cannot be negative, etc., the present invention adds a physical constraint penalty term to the loss function for correction, and its loss function is as follows:

[0138]

[0139] Where: N 1 is the output dimension of the first prediction network, x i is the actual power, is the predicted power, λ 1 is the weight coefficient of the physical constraint, is the physical constraint penalty term, P min is the minimum power, P max is the maximum power.

[0140] The above limits the power prediction to be neither less than the minimum power P min , nor does it exceed the maximum power P max ; For hydropower and photovoltaic power generation, P min and P max The value of can be calculated by the corresponding formula in step S1 according to the actual power generation mode, equipment parameters, upper and lower limits of meteorological fluctuations, etc. For wind power generation, P min That is 0, P max That is P rate .

[0141] For the loss function of the second prediction network, in order to reflect the prediction of outliers, the theoretical power is introduced. The difference between outliers and theoretical power reflected by the loss function is as follows:

[0142]

[0143] Where: N 2 is the output dimension of the second prediction network, λ 2 is the weight coefficient for the difference from the theoretical power, is the theoretical power, is the predicted power of the second prediction network, N 3 is the number of outlier datasets, x B,i is the actual power in the outlier dataset, is the predicted power at the time corresponding to the actual power.

[0144] Furthermore, step S3 specifically includes:

[0145] S31. Based on the first prediction network and the normal value dataset A, predict the occurrence time and corresponding values of the normal power of the distributed power source in the future period to obtain the normal value prediction result a; combine the normal value prediction result a with the theoretical power data corresponding to the normal value dataset A to obtain the normal value data set A′;

[0146] S32. Based on the second prediction network and the outlier dataset B, predict the occurrence time and corresponding values of the abnormal power of the distributed power source in the future period to obtain the outlier prediction result b;

[0147] S33. Compare the normal value prediction result a with the outlier prediction result b;

[0148] If at the same moment t, a t = b t ; then add noise σ to correct the outlier prediction result b t to obtain the corrected outlier prediction result b′ t ; combine the corrected outlier prediction result b′ t with the theoretical power data corresponding to the outlier dataset B to obtain the outlier data set B′.

[0149] If at the same moment t, a t ≠ b t , then combine the outlier prediction result b t with the theoretical power data corresponding to the outlier dataset B to obtain the outlier data set B′.

[0150] S4. Based on the normal value prediction result and the outlier prediction result, set the parameter adjustment conditions, adaptively adjust the parameter settings of the DBSCAN clustering algorithm, and repeat steps S1 - S4 until the prediction is completed.

[0151] In this embodiment, steps S1-S4 are recorded as one round of prediction, and the DBSCAN clustering algorithm parameters adjusted in each round of prediction are used for prediction in the next round, and then steps S1-S4 are repeated until the stop condition is reached and the prediction is completed.

[0152] See also Figure 5 Further, the step S4 specifically includes:

[0153] S41, combining the normal value data set A′ and the abnormal value data set B′ to form a data set D′={A′, B′};

[0154] S42, performing cluster analysis on the data set D′ based on the DBSCAN clustering algorithm to obtain a new normal value data set A″ and an abnormal value data set B″;

[0155] S43, set the first condition and the second condition for clustering algorithm adaptive parameter adjustment, and determine whether they are satisfied; if any one of the first condition or the second condition is satisfied, update the sample number threshold MinPts of the clustering algorithm at the next moment according to the satisfied condition t ;

[0156] The first condition is: if the number of data in the intersection of B″ and A′ exceeds the threshold N 0 , that is, |A′∩B″|>N 0 , |*| is the number of elements in the set; the first condition represents that the clustering algorithm attributes more of the normal values ​​predicted by the network to the outliers.

[0157] The second condition is: if the number of data in the intersection of A″ and B′ exceeds the threshold N 0 , that is, |A″∩B′|>N 0 ; The second condition represents that the clustering algorithm attributes more of the outliers predicted by the network to normal values.

[0158] If the first condition is met, the sample number threshold MinPts of the clustering algorithm at the next moment is increased t , which is expressed as follows:

[0159]

[0160] If the second condition is met, the sample number threshold MinPts of the clustering algorithm at the next moment is reduced t , which is expressed as follows:

[0161]

[0162] in: To round down;

[0163] S44, based on the updated sample number threshold MinPtst , return to step S1.

[0164] Embodiment 2:

[0165] See also Figure 6 , a distributed power supply power prediction system based on LSTM, the system is applied to the method described in Example 1, the system comprising:

[0166] Theoretical power data calculation module 1 is used to obtain historical meteorological data and future forecast meteorological data of the distributed power target area and calculate theoretical power data of the distributed power target area;

[0167] Furthermore, the theoretical power data calculation module 1 is used to calculate the theoretical power data according to the following steps:

[0168] S11, obtaining historical meteorological data and future forecast meteorological data of the target area of ​​distributed power generation; the meteorological data includes water runoff, upstream and downstream water level, wind speed, atmospheric pressure, air temperature, air humidity, and light radiation intensity;

[0169] S12, obtaining the power generation type of the distributed power source, selecting the historical meteorological data and future forecast meteorological data corresponding to the power generation type, and calculating the corresponding theoretical power generation power;

[0170] The power generation type includes any one of hydropower generation, wind power generation, and photovoltaic power generation; the theoretical power generation corresponding to the power generation type includes any one or any combination of the following:

[0171] For hydroelectric power generation, the factors that affect the power generation of the turbine generator include the water flow rate l through the motor, the working head height h, and the motor working efficiency λ; then the theoretical power generation power P of hydroelectric power generation w The expression is as follows:

[0172] P w = lhλ;

[0173] h=h a -h b -h δ ;

[0174] Where: h a is the upstream water level, h b is the downstream water level, h δ is the head loss of the power station;

[0175] For wind power generation, the factors that affect the power generation of the wind turbine mainly include the wind turbine power coefficient C, air density ρ, wind rotor swept area A, and wind speed v; then the theoretical power generation of wind power generation P f The expression is as follows:

[0176]

[0177] Where: p is the atmospheric pressure, t is the air temperature, p w is the air humidity;

[0178] For photovoltaic power generation, the factors that affect the power generation of photovoltaic power generation mainly include the photoelectric conversion efficiency η, the photovoltaic array area S, the radiation intensity I, and the air temperature t 0 ; Then the theoretical power generation power of photovoltaic power generation P s The expression is as follows:

[0179] P s =ηSI[100.005(t 0 +25)];

[0180] Among them: 100.005 and 25 are constants.

[0181] Cluster analysis module 2 is used to perform cluster analysis on theoretical power data based on DBSCAN clustering algorithm, and increase the theoretical power expansion data dimension to obtain normal value data set and abnormal value data set of distributed power supply power;

[0182] Furthermore, the cluster analysis module 2 is used to perform cluster analysis according to the following steps:

[0183] S21, taking the theoretical power data as the data set D = (p 1 , p 2 ,…,p n ) to perform cluster analysis and measure the power x in the historical theoretical power generation i Based on the theoretical power To expand the data dimension, when performing cluster analysis based on the DBSCAN clustering algorithm, any two sample points p i and p j The distance expression between them is as follows:

[0184]

[0185] ω 1 +ω 2 =1;ω 1 ,ω 2 >0;ω 1 >ω 2 ;

[0186] Where: 1 ,ω 2 are distance weight parameters, x j For p j The measured power at the point, For pj Theoretical power of the point;

[0187] S22, if p i The ε domain contains at least MinPts t samples, then p i As the core object, the cluster sub-datasets corresponding to all the core objects in the data set are combined to obtain the final normal value data set A, and the other data are the outlier data set B.

[0188] Prediction network module 3 is used to optimize the loss function of the LSTM prediction network in combination with the physical constraints and theoretical power of the distributed power source, and based on the normal value data set and the abnormal value data set, respectively predict the normal value prediction result and the abnormal value prediction result of the future power generation of the distributed power source through the LSTM prediction network; the LSTM prediction network includes a first prediction network and a second prediction network connected in parallel;

[0189] Furthermore, the prediction network module 3 is used to make predictions according to the following steps:

[0190] S31. Based on the first prediction network and the normal value data set A, predict the normal power occurrence time and corresponding value of the distributed power source in the future period to obtain the normal value prediction result a; combine the normal value prediction result a with the theoretical power data corresponding to the normal value data set A to obtain the normal value data set A′;

[0191] S32, based on the second prediction network and the abnormal value data set B, predict the abnormal power occurrence time and corresponding value in the future period of the distributed power source, and obtain the abnormal value prediction result b;

[0192] S33, comparing the normal value prediction result a with the abnormal value prediction result b;

[0193] If at the same time t, a t =b t ; then the prediction result b for the outlier t Add noise σ to correct it and obtain the corrected outlier prediction result b′ t ; Correct the outlier prediction result b′ t The theoretical power data corresponding to the outlier data set B is combined to obtain the outlier data set B′;

[0194] The loss function optimized by the prediction network module 3 is as follows:

[0195] In the loss function of the first prediction network, the physical constraint penalty term is added for correction, and its loss function is as follows:

[0196]

[0197]

[0198] Where: N 1 is the output dimension of the first prediction network, x i is the actual power, is the predicted power, λ 1 is the weight coefficient of the physical constraint, is the physical constraint penalty term, P min is the minimum power, P max is the maximum power.

[0199] In the loss function of the second prediction network, the theoretical power is added for correction, and its loss function is as follows:

[0200]

[0201] Where: N 2 is the output dimension of the second prediction network, λ 2 is the weight coefficient of the difference from the theoretical power, is the theoretical power, is the predicted power of the second prediction network, N 3 is the number of outlier data sets, x B,i is the actual power in the outlier dataset, is the predicted power at the time corresponding to the actual power.

[0202] The adaptive clustering adjustment module 4 is used to set parameter adjustment conditions based on the normal value prediction results and the abnormal value prediction results, adaptively adjust the parameter settings of the DBSCAN clustering algorithm, and repeat the steps of the above module until the prediction is completed.

[0203] Furthermore, the adaptive clustering adjustment module 4 is used to set parameter adjustment conditions according to the following steps:

[0204] S41, combining the normal value data set A′ and the abnormal value data set B′ to form a data set D′={A′, B′};

[0205] S42, performing cluster analysis on the data set D′ based on the DBSCAN clustering algorithm to obtain a new normal value data set A″ and an abnormal value data set B″;

[0206] S43, set the first condition and the second condition for clustering algorithm adaptive parameter adjustment, and determine whether they are satisfied; if any one of the first condition or the second condition is satisfied, update the sample number threshold MinPts of the clustering algorithm at the next moment according to the satisfied condition t ;

[0207] The first condition is: if the number of data in the intersection of B″ and A′ exceeds the threshold N 0 , that is, |A′∩B″|>N 0 ;

[0208] The second condition is: if the number of data in the intersection of A″ and B′ exceeds the threshold N 0 , that is, |A″∩B′|>N 0 ;

[0209] If the first condition is met, the sample number threshold MinPts of the clustering algorithm at the next moment is increased t , which is expressed as follows:

[0210]

[0211] If the second condition is met, the sample number threshold MinPts of the clustering algorithm at the next moment is reduced t , which is expressed as follows:

[0212]

[0213] in: To round down;

[0214] S44, based on the updated sample number threshold MinPts t , return to step S1.

[0215] Embodiment 3:

[0216] See also Figure 7 , a distributed power supply power prediction device based on LSTM, the device comprising a processor 5 and a memory 6;

[0217] The memory 6 is used to store the computer program code 61 and transmit the computer program code 61 to the processor 5;

[0218] The processor 5 is used to execute the distributed power supply power prediction method based on LSTM described in Example 1 according to the instructions in the computer program code 61.

[0219] This embodiment also includes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed on a computer, the distributed power supply power prediction method based on LSTM described in Example 1 is implemented.

[0220] Generally speaking, the computer instructions for implementing the method of the present invention may be carried in any combination of one or more computer-readable storage media. Non-transitory computer-readable storage media may include any computer-readable media, except for the signal itself that is temporarily propagating.

[0221] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EKROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0222] Computer program code for performing the operation of the present invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, SMalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages, in particular, Python suitable for neural network computing and platform frameworks based on TensorFlow, PyTorch, etc. can be used. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer or to an external computer (for example, using an Internet service provider to connect via the Internet) through any type of network, including a local area network (LAN) or a wide area network (WAN).

[0223] The above-mentioned device and non-temporary computer-readable storage medium can refer to the specific description of a distributed power supply power prediction method based on LSTM and its beneficial effects, which will not be repeated here.

[0224] Although the embodiments of the present invention have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A distributed power supply power prediction method based on LSTM, characterized in that: include: S1. Obtain historical meteorological data and future forecast meteorological data of the target area of ​​distributed power generation, and calculate theoretical power data of the target area of ​​distributed power generation; S2. Perform cluster analysis on theoretical power data based on DBSCAN clustering algorithm, and add theoretical power to expand data dimension to obtain normal value data set and abnormal value data set of distributed power supply power; S3. Optimize the loss function of the LSTM prediction network in combination with the physical constraints and theoretical power of the distributed power source, and predict the normal value prediction results and the abnormal value prediction results of the future power generation of the distributed power source through the LSTM prediction network based on the normal value data set and the abnormal value data set; the LSTM prediction network includes a first prediction network and a second prediction network connected in parallel; S4. Based on the normal value prediction results and the abnormal value prediction results, set the parameter adjustment conditions, adaptively adjust the parameter settings of the DBSCAN clustering algorithm, and repeat steps S1-S4 until the prediction is completed.

2. The distributed power supply power prediction method based on LSTM according to claim 1 is characterized in that: The step S1 specifically includes: S11, obtaining historical meteorological data and future forecast meteorological data of the target area of ​​distributed power generation; the meteorological data includes water runoff, upstream and downstream water level, wind speed, atmospheric pressure, air temperature, air humidity, and light radiation intensity; S12, obtaining the power generation type of the distributed power source, selecting the historical meteorological data and future forecast meteorological data corresponding to the power generation type, and calculating the corresponding theoretical power generation power; The power generation type includes any one of hydropower generation, wind power generation, and photovoltaic power generation; the theoretical power generation corresponding to the power generation type includes any one or any combination of the following: For hydroelectric power generation, the factors that affect the power generation of the turbine generator include the water flow rate l through the motor, the working head height h, and the motor working efficiency λ; then the theoretical power generation power P of hydroelectric power generation w The expression is as follows: P w =lhλ; h=h a -h b -h δ ; Where: h a is the upstream water level, h b is the downstream water level, h δ is the head loss of the power station; For wind power generation, the factors that affect the power generation of the wind turbine mainly include the wind turbine power coefficient C, air density ρ, wind rotor swept area A, and wind speed v; then the theoretical power generation of wind power generation P f The expression is as follows: Where: p is the atmospheric pressure, t is the air temperature, p w is the air humidity; For photovoltaic power generation, the factors that affect the power generation of photovoltaic power generation mainly include the photoelectric conversion efficiency η, the photovoltaic array area S, the radiation intensity I, and the air temperature t0; then the theoretical power generation power of photovoltaic power generation P s The expression is as follows: P s =ηSI[100.005(t0+25)]。 3. The distributed power supply power prediction method based on LSTM according to claim 1 is characterized in that: The step S2 specifically includes: S21, taking the theoretical power data as the data set D = (p1, p2, ..., p n ) to perform cluster analysis and to measure the power x of the theoretical power generation i Based on the theoretical power To expand the data dimension, when performing cluster analysis based on the DBSCAN clustering algorithm, any two sample points p i and p j The distance expression between them is as follows: ω1+ω2=1; ω1, ω2>0; ω1>ω2; Among them: ω1, ω2 are distance weight parameters, x j For p j The measured power at the point, For p j Theoretical power of the point; S22, if p i The ε domain contains at least MinPts t samples, then p i As the core object, the cluster sub-datasets corresponding to all the core objects in the data set are combined to obtain the final normal value data set A, and the other data are the outlier data set B.

4. The distributed power supply power prediction method based on LSTM according to claim 3 is characterized in that: The step S3 specifically includes: S31. Based on the first prediction network and the normal value data set A, predict the normal power occurrence time and corresponding value of the distributed power source in the future period to obtain the normal value prediction result a; combine the normal value prediction result a with the theoretical power data corresponding to the normal value data set A to obtain the normal value data set A′; S32, based on the second prediction network and the abnormal value data set B, predict the abnormal power occurrence time and corresponding value in the future period of the distributed power source, and obtain the abnormal value prediction result b; S33, comparing the normal value prediction result a with the abnormal value prediction result b; If at the same time t, a t =b t ; then the prediction result b for the outlier t Add noise σ for correction and obtain the corrected outlier prediction result b′ t ; Correct the outlier prediction result b′ t The theoretical power data corresponding to the outlier data set B is combined to obtain an outlier data set B′.

5. The distributed power supply power prediction method based on LSTM according to claim 4 is characterized in that: The step S4 specifically includes: S41, combining the normal value data set A′ and the abnormal value data set B′ to form a data set D′={A′, B′}; S42, performing cluster analysis on the data set D′ based on the DBSCAN clustering algorithm to obtain a new normal value data set A″ and an abnormal value data set B″; S43, set the first condition and the second condition for clustering algorithm adaptive parameter adjustment, and determine whether they are satisfied; if any one of the first condition or the second condition is satisfied, update the sample number threshold MinPts of the clustering algorithm at the next moment according to the satisfied condition t ; The first condition is: if the number of data in the intersection of B″ and A′ exceeds the threshold N0, that is, |A′∩B″|>N0; The second condition is: if the number of data in the intersection of A″ and B′ exceeds the threshold N0, that is, |A″∩B′|>N0; If the first condition is met, the sample number threshold MinPts of the clustering algorithm at the next moment is increased t , which is expressed as follows: If the second condition is met, the sample number threshold MinPts of the clustering algorithm at the next moment is reduced t , which is expressed as follows: in: To round down; S44, based on the updated sample number threshold MinPts t , return to step S1.

6. The distributed power supply power prediction method based on LSTM according to claim 1 is characterized in that: In step S3, optimizing the loss function means: In the loss function of the first prediction network, the physical constraint penalty term is added for correction, and its loss function is as follows: Where: N1 is the output dimension of the first prediction network, x i is the actual power, is the predicted power, λ1 is the weight coefficient of the physical constraint, is the physical constraint penalty term, P min is the minimum power, P max is the maximum power.

7. The distributed power supply power prediction method based on LSTM according to claim 1 is characterized in that: In step S3, optimizing the loss function means: In the loss function of the second prediction network, the theoretical power is added for correction, and its loss function is as follows: Where: N2 is the output dimension of the second prediction network, λ2 is the weight coefficient of the difference from the theoretical power, is the theoretical power, is the prediction power of the second prediction network, N3 is the number of outlier data sets, x B,i is the actual power in the outlier dataset, is the predicted power at the time corresponding to the actual power.

8. The distributed power supply power prediction method based on LSTM according to claim 1 is characterized in that: The first prediction network includes a number of input channels, an initial LSTM layer, a feature fusion layer, a final LSTM layer and an output layer; The second prediction network includes a number of input channels, an initial LSTM layer, a feature fusion layer and an output layer; The input channels of the first and second prediction networks include power data input, meteorological data input, and equipment status data input; The initial LSTM layers of the first and second prediction networks both include a power data LSTM layer, a meteorological data LSTM layer, and an equipment status data LSTM layer.

9. A distributed power supply power prediction system based on LSTM, characterized in that: The system is applied to the method described in any one of claims 1 to 8, and the system comprises: Theoretical power data calculation module (1), used to obtain historical meteorological data and future forecast meteorological data of the distributed power target area, and calculate theoretical power data of the distributed power target area; A cluster analysis module (2) is used to perform cluster analysis on theoretical power data based on a DBSCAN clustering algorithm, and to increase the theoretical power expansion data dimension to obtain a normal value data set and an abnormal value data set of the distributed power supply power; A prediction network module (3) is used to optimize the loss function of the LSTM prediction network in combination with the physical constraints and theoretical power of the distributed power source, and based on the normal value data set and the abnormal value data set, respectively predict the normal value prediction result and the abnormal value prediction result of the future power generation of the distributed power source through the LSTM prediction network; the LSTM prediction network includes a first prediction network and a second prediction network connected in parallel; The adaptive clustering adjustment module (4) is used to set parameter adjustment conditions based on the normal value prediction results and the abnormal value prediction results, adaptively adjust the parameter settings of the DBSCAN clustering algorithm, and repeat the steps of the above module until the prediction is completed.

10. A distributed power supply power prediction device based on LSTM, characterized in that: The device comprises a processor (5) and a memory (6); The memory (6) is used to store computer program code (61) and transmit the computer program code (61) to the processor (5); The processor (5) is used to execute the LSTM-based distributed power supply power prediction method described in any one of claims 1 to 8 according to the instructions in the computer program code (61).

Citation Information

Patent Citations

  • Photovoltaic generating capacity prediction model training method and photovoltaic generating capacity prediction method

    CN119046685A

  • Distance to obstacle detection in autonomous machine applications

    US20200210726A1

  • Methods and systems for machine-learning for prediction of grid carbon emissions

    US20200372588A1

Cited By

  • Photovoltaic power generation prediction method and device based on physical constraint and LSTM network

    CN120822705A