A wind power prediction method based on segmented filtering and vertical and horizontal clustering
Through the segmented filtering and vertical and horizontal clustering methods, combined with the improved DO algorithm and VAE feature extraction, the Transformer model is optimized to solve the problem of low wind power power prediction accuracy and achieve efficient and accurate wind power power prediction.
Patent Information
- Application Number
- CN202310627483.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2043-05-30
AI Technical Summary
When existing wind power power prediction methods deal with the high-dimensional characteristics and seasonal changes of wind power power, the prediction accuracy is low, the training period is long, and the calculation is complex, which cannot meet the actual demand for wind power power.
A method based on segmented filtering and vertical and horizontal clustering is adopted, the Transformer model is optimized through the improved DO algorithm, and VAE is used to extract and predict features of wind power data to achieve accurate prediction of wind power power.
It improves the accuracy and robustness of wind power prediction, reduces data complexity, simplifies operations, and enhances the prediction accuracy of the model.
Smart Images

Figure CN116646927B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of wind power prediction, and in particular relates to a wind power prediction method based on segmented filtering and vertical and horizontal clustering. Background Art
[0002] As my country's economy develops better and better, the demand for energy in all walks of life and people in society is also increasing. Traditional energy can no longer meet people's needs, and traditional energy also causes serious environmental pollution. Wind power, as a new type of renewable energy, is developing rapidly in my country. The development of wind power is of great significance for ensuring energy security, adjusting energy structure, reducing environmental pollution, and achieving sustainable development. However, the instability of wind power is one of the obstacles to the integration of wind power systems with the main power grid. In order to more safely and effectively utilize the continuously growing wind energy, high-precision wind power prediction methods are of great significance to the operation of the power grid. Accurate prediction of wind speed and wind power in advance can alleviate the pressure of peak load regulation and frequency regulation of the power system and effectively improve the grid's ability to accept wind power.
[0003] Wind power grid connection brings great challenges to the dispatching, safety and stability of the power system, making the accurate prediction of wind power particularly important. At present, wind power prediction methods are mainly divided into statistical methods and machine learning methods, and statistical methods can only achieve good predictions for power with obvious fluctuation patterns and relatively stable. However, wind energy and wind power have strong randomness and volatility, resulting in poor accuracy of wind power prediction by this method. Taking into account the influence of objective factors, high-dimensional features will be involved. In actual application, traditional power prediction methods have long training cycles, complex calculations, and low prediction accuracy. In addition, wind energy varies greatly in different seasons and different time periods of the day. Ordinary clustering and prediction methods cannot meet the actual situation, which also has a great impact on wind power prediction. Summary of the invention
[0004] Purpose of the invention: In order to solve the problems raised in the background technology, the present invention provides a wind power prediction method based on segmented filtering and vertical and horizontal clustering, which uses vertical and horizontal clustering to cluster wind power, thereby taking into account the changes in wind power in different seasons and within a single day, and uses VAE to extract features from the clustered data. The Transformer model is optimized through the improved DO algorithm to achieve accurate prediction of wind power.
[0005] Technical solution: The present invention proposes a wind power prediction method based on segmented filtering and vertical and horizontal clustering, comprising the following steps:
[0006] (1) Collecting the original power data of the wind farm and preprocessing the collected data;
[0007] (2) The improved Dandelion optimization algorithm is used to optimize the revolving door algorithm, and the characteristics of climbing events are identified on the preprocessed data. Then the identified data are divided into two categories according to whether they are climbing or not;
[0008] (3) The data identified as climbing are filtered by MEEMD, and the data identified as non-climbing are filtered by smoothing;
[0009] (4) The filtered data are clustered using vertical and horizontal clustering strategies. The vertical clustering is performed through three steps of intra-day pre-clustering, single-day re-clustering, and vertical time unit clustering to achieve the annual refined seasonal characteristic clustering. At the same time, all the data within the vertical cluster are clustered together to achieve fine horizontal clustering at a small time scale.
[0010] (5) Use variational autoencoder to extract features from clustered data;
[0011] (6) Construct a Transformer prediction model and use the improved Dandelion optimization algorithm to optimize the parameters of the Transformer prediction model; input the feature extracted data into the optimized Transformer prediction model to predict future wind power.
[0012] Furthermore, the implementation process of step (2) is as follows:
[0013] (2.1) First, initialize, where K 1new is the initial upper revolving door slope, K 2new The initial slope of the lower revolving door is as follows:
[0014]
[0015] Let X be the data sequence, where x0 is the end point of the previous compression process, x1 is the next data point, and x i is the i-th stronghold; T0, T1, T i are x0, x1, x i The corresponding time point, E is the compression threshold, T is the original data time series, and x is the corresponding original data series;
[0016] (2.2) Calculate T respectively i The upper revolving door slope K1 and the lower revolving door slope K2 are as shown in the formula:
[0017]
[0018] (2.3) Update K 1new and K 2new Values:
[0019] K1new =Max(K1,K 1new );K 2new =Max(K2,K 2new ) (3)
[0020] (2.4) According to K 1new and K 2new The size determines whether compression is complete; if k 1new ≥k 2new Then the compression process ends and storage t i-1 The data value p corresponding to the time i-1 , and return to (2.1) to start the next compression process; if k 1new ≤k 2new , then continue the compression and return to step (2.2), at this time i=i+1;
[0021] (2.5) The improved dandelion optimization algorithm is used to optimize the value of the tolerance coefficient △E of the revolving door algorithm. △E is the height of the door, that is, the tolerance coefficient. After compression by the revolving door algorithm, a new data sequence is obtained:
[0022] The DO algorithm is divided into the ascending stage, the descending stage and the landing stage according to the characteristics of dandelion seeds flying long distances when they mature and looking for the optimal landing position. Different strategies are used for the optimization process in the three stages. △E corresponds to the fitness value in the algorithm. After the algorithm continuously iterates and calculates the optimal fitness value, the value of the tolerance coefficient △E is output.
[0023] Furthermore, the step (2.5) comprises the following steps:
[0024] (2.5.1) Setting the parameters of the DO algorithm includes: maximum number of iterations, population size, dimension size, upper and lower bounds of the search space;
[0025] (2.5.2) The Logistic chaos initialization method is used instead of the random initialization method in the DO algorithm, so that the dandelion population can conduct a more extensive preliminary search. The formula is as follows:
[0026]
[0027] Among them, L(n+1) is the updated individual position, and λ is the control variable;
[0028] (2.5.3) In the rising stage, under the influence of wind speed, air humidity, etc., local falling is carried out according to different weather conditions. The fitness value of the seed position is calculated to find the optimal fitness value, and the value of the tolerance coefficient corresponding to the fitness value is output:
[0029] Sunny day: In clear weather, the wind speed can be considered to be log-normally distributed. The DO algorithm emphasizes search. During the search, dandelion seeds are randomly blown to various locations by the wind. The update formula is:
[0030] F t+1 =F t +α*v x *v y *lnY*(F s -F t ) (5)
[0031] Among them, F t represents the position of the dandelion seed after iteration t; F s represents the randomly selected position in the search space at the tth iteration, InY represents the log-normal distribution with μ = 0 and σ2 = 1, and α is an adaptive parameter used to adjust the search step size, which fluctuates randomly between [0, 1];
[0032] Rainy day: Dandelion seeds perform local search, and the position update formula is:
[0033] F t+1 =F t *ε (6)
[0034] Among them, ε is used to limit the local search range and oscillates in a "convex downward" manner;
[0035] The mathematical expression of dandelion seeds in the rising period is:
[0036]
[0037] (2.5.4) Descending stage: In this stage, the DO algorithm also emphasizes search and uses Brownian motion to simulate the trajectory of dandelions. In order to reflect the stability of the dandelion's descent, the average position information after the ascending stage is used. The corresponding mathematical expression is:
[0038] F t+1 =F t -α*β t *(F mean_t -α*β t *F t ) (8)
[0039] Among them, β t represents Brownian motion, is a random number from a standard normal distribution, F mean_t t is the average position of the group, expressed as:
[0040]
[0041] (2.5.5) Landing phase: In this phase, the DO algorithm focuses on development. Based on the first two phases, as the population evolves, the global optimal solution, that is, the optimal tolerance coefficient, can be found. Then, the revolving door optimization algorithm can be used to identify the climbing event, and Levy flight is used for selection. The position update formula is:
[0042] F t+1 =F elite +levy(λ)*α*(F elite -F t *δ) (10)
[0043] Among them, F elite Indicates the optimal position of the current iteration, δ is a linearly increasing parameter, equal to 2t / T, Levy flight calculation formula:
[0044]
[0045] β is a random number between [0,2], s is a fixed constant 0.01, ω and t are random numbers between [0,1];
[0046] (2.5.6) Determine whether the maximum number of iterations reaches the algorithm termination condition. If not, go to (2.5.3), finally end the operation and output the optimal result.
[0047] Furthermore, the implementation process of step (3) is as follows:
[0048] (3.1) A set of white noise signals v with the same modulus and opposite signs i (t) and -v i (t) is added to the actual wind power signal x(t), as shown in the formula:
[0049]
[0050] In the formula, v i (t) represents white noise: a i represents the amplitude of white noise, n is the logarithm of the added white noise, and the number of white noise signals in the set is 2n;
[0051] (3.2) For each pair of wind power signals x in the set + (t) and x - (t) Perform EMD decomposition to obtain a set of IMF components:
[0052]
[0053] Among them, h ij + (t), h ij -(t) represents the j-th order IMF component of the i-th signal;
[0054] (3.3) The multi-component components are averaged to obtain the IMF components of each order:
[0055]
[0056] Where p(t) represents the j-th order IMF component;
[0057] (3.4) Identify h by permutation entropy j (t) Whether it is an abnormal signal; if the signal is more random,
[0058] The larger the column entropy, the greater the threshold value is set to determine whether the signal is an abnormal signal or a noise signal;
[0059] (3.5) Subtract the abnormal signal and the noise signal from the actual wind power signal, and then add the filtered noise signal to obtain the filtered wind power signal:
[0060] p(t)=x(t)-x'(t)+x”(t) (15)
[0061] Among them, p(t) represents the wind power signal after filtering, x(t) is the original signal, x'(t) is the sum of all abnormal signals and noise signals, and x”(t) is the noise signal after wavelet filtering;
[0062] (3.6) The non-climbing data is passed through a smooth filter. The function of the smooth filter is to smooth the sequence and reduce the noise of the signal. The filtering principle is to regard the continuous sampling data as a queue with a fixed length of N. After a new measurement, the first data of the queue is removed, and the remaining N-1 data are moved forward in sequence, and the new sampling data is inserted as the tail of the new queue; then arithmetic operations are performed on this queue, and the result is used as the result of this measurement; assuming that the input is x and the output is y, the moving average filter calculation formula is:
[0063]
[0064] Furthermore, the implementation process of step (4) is as follows:
[0065] (4.1) Intra-day pre-clustering, taking the minimum time interval T within the day as samples, construct the feature vector, as shown in the following table:
[0066]
[0067] Among them, i is the minimum time interval sequence number; R maxi and R mini are the i-th minimum time interval T in a single day.i The maximum and minimum active power values within the T i The average value of internal active power; then the samples are normalized to transform the data:
[0068]
[0069] Among them, Y ij is the sampling value of the jth attribute of the ith sample, Y ij ' is the normalized value of the jth attribute of the i-th sample; m j and M j are the maximum and minimum values of the jth attribute respectively; M jnew and m jnew are the upper and lower limits of the new mapping range of j respectively;
[0070] (4.2) The pre-clustered data is re-clustered within a single day. After intra-day pre-clustering, the feature vector of the re-clustering within a single day is constructed to represent the category of each T within the day and the total number of clusters within the day. The formula is as follows:
[0071]
[0072] Where k is the day serial number; D Tnk is the time period T of the kth day n The cluster center of the category to which it belongs, n is the total number of segments divided into a single day according to the minimum time interval T; D ck is the number of clusters on the kth day; D maxk and D mink are the maximum active power value and the minimum active power value on the kth day, respectively. is the daily average active power value; D s2k is the daily active power sample variance; the annual data is divided into J categories, and the category of each day in the year can be obtained;
[0073] (4.3) The vertical time axis data of the whole year is divided into vertical time units T ZN The unit is divided into L segments, T ZN Choose to divide by quarter; construct feature vectors based on the proportion characteristics obtained by re-clustering within a single day, and finally obtain clustering results that can reflect the refined seasonal characteristics; after re-clustering within a single day, divide the annual data into J categories, and count the longitudinal time unit T ZN The categories occupied by each category in the period are used to represent the daily composition structure and fluctuation trend within the period, supplemented by statistics that characterize power fluctuations to form a feature vector.
[0074]
[0075] Among them, h is the longitudinal time unit number; Sh1 ,S h2 ,...,S hj To count the proportion of the 1st, 2nd, ..., jth categories in the hth longitudinal time unit; S maxh and S minh are the maximum active power and minimum active power in the hth longitudinal time unit, respectively. and S s2h are respectively the mean and variance of active power in the hth longitudinal time unit; according to T ZN The classification objectively divides the annual data into L categories;
[0076] (4.4) After vertical clustering, the data is clustered horizontally. All data belonging to the same vertical cluster are connected head to tail, and the horizontal columns form horizontal continuous data. HN Divide the data into H segments and perform horizontal clustering on all data. HN The change rate sequence within the minimum time interval T is used to represent the horizontal data fluctuation trend, supplemented by active power statistics to form the feature vector:
[0077]
[0078] Among them, p is the horizontal time unit sequence number; b is T ZN The minimum number of time intervals in W maxp ,W minp are the maximum active power and the minimum active power in the pth horizontal time unit respectively; and W s2p are the average active power and variance in the pth horizontal time unit respectively; η pb T ZN The volatility sequence of b minimum time intervals is calculated as follows:
[0079]
[0080] Where: i is the minimum time interval sequence number; Pw is the root bus active power sequence composed of load and wind power; {} is the root bus power sequence number; T HN is the horizontal time unit;
[0081] (4.5) Through horizontal clustering, all data of the same vertical class are clustered into q classes, each of which can be represented by its own cluster center; the similarity of the characteristic vectors of each cluster center in the sample of this period and the historical sample is judged by the distance:
[0082]
[0083] Among them, ρ(A,B) is the Euclidean distance between sequence A and sequence B.
[0084] Furthermore, the implementation process of step (5) is as follows:
[0085] (5.1) Data encoding, the encoder contains 4 convolutional layers, and the 4 convolutional layers are connected to a fully connected layer with 256 neurons. The number of neurons in the fully connected layer corresponding to the logarithm of the mean and variance is set to 10;
[0086] (5.2) Data decoding,The decoder input dimension is 10, first containing a fully connected layer of 256 neurons, followed by a fully connected layer of 9216 neurons;
[0087] (5.3) Gradient back propagation: The loss function is calculated by decoding the output data and the input original data, and the network weights are updated through back propagation. The network weights are initialized using the Glorot uniform distribution method. After repeated training, the decoder learns the mapping rules of the data.
[0088] (5.4) Generate data, that is, extract the decoder as the VAE generation model, extract a set of feature vectors from the Gaussian distribution as the model input, and then output new data that conforms to the probability distribution of the training data set.
[0089] Furthermore, the Transformer prediction model in step (6) includes an encoding module, a decoding module, a feedforward neural network and an attention mechanism; the encoding module includes two layers, a self-attention layer and a feedforward neural network, and the self-attention can obtain context information; the decoding module also includes a self-attention layer and a feedforward neural network, and there is an attention layer in between, which can help the node obtain the key content that needs to be paid attention to at present; after self-attention processes the data, it sends the data to the feedforward neural network, and the output is input into the next encoder.
[0090] Furthermore, the implementation process of step (6) is as follows:
[0091] (6.1) The DO algorithm can find the optimal hyperparameters of the Transformer model. With continuous iterations, individuals with high fitness values appear in the DO algorithm, which are the optimal values of the hyperparameters. The wind power data after clustering and VAE feature extraction is the input of the Transformer, and then the optimal hyperparameters found by the DO algorithm are used to optimize the model's prediction accuracy for wind power.
[0092] (6.2) Using the Logistic chaos initialization method instead of the random initialization method in the DO algorithm enables the dandelion population to conduct a more extensive preliminary search;
[0093] (6.3) In the ascending stage, the fitness value of the seed position is calculated to find the optimal hyperparameter. On sunny days, the algorithm simulates dandelion seeds and is more oriented to global search, and the hyperparameter result is the global optimal; on rainy days, a local search is performed, and the hyperparameter result is the local optimal, so that the input wind power is predicted;
[0094] (6.4) Landing phase: As the population evolves, the global optimal solution, i.e., the optimal hyperparameters, can be found eventually, and then the wind power can be predicted through the model;
[0095] (6.5) Determine whether the maximum number of iterations reaches the algorithm termination condition. If not, go to step (7.3), finally end the operation and output the optimal result.
[0096] Beneficial effects: Compared with the prior art, the present invention has the following beneficial effects:
[0097] 1. Aiming at the volatility and randomness of wind power, the present invention uses the SDT revolving door algorithm to identify the climbing of data, and uses MEEMD filtering for the data with large volatility identified as climbing, and uses smooth filtering for the non-climbing data, thereby reducing the impact of volatility on power prediction to a certain extent.
[0098] 2. Aiming at the large difference in wind energy in different seasons and different time periods of a day, which leads to a relatively large impact of wind power uncertainty, the present invention establishes a vertical and horizontal clustering analysis that takes into account both daytime similarities and refined seasonal characteristics, considers the actual situation of wind power, and improves the accuracy and robustness of the model.
[0099] 3. The present invention proposes a method for generating random wind power output scenarios based on conditional variational autoencoders, which unsupervisedly learns the temporal, spatial and volatility characteristics of wind power training data and efficiently generates data that meets the characteristics according to conditions. This reduces data complexity, simplifies calculations and does not reduce prediction accuracy.
[0100] 4. The present invention proposes to use the Transformer model to predict wind power, use the chaotic initialization population to enhance the optimization ability of the DO algorithm, and optimize the Transformer model through the improved DO algorithm, thereby improving the accuracy of the model prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] Figure 1 is a flow chart of the present invention;
[0102] Figure 2 It is the MEEMD filtering flow chart;
[0103] Figure 3 It is a flowchart of the vertical and horizontal clustering method;
[0104] Figure 4 This is the Transformer model structure diagram. DETAILED DESCRIPTION
[0105] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0106] The present invention proposes a wind power prediction method based on segmented filtering and vertical and horizontal clustering, such as Figure 1 As shown, the following steps are included:
[0107] Step 1: Preprocess the collected data, delete abnormal wind power data, and use interpolation method to process missing data.
[0108] Step 2: Use the improved dandelion algorithm to optimize the revolving door algorithm, identify the characteristics of the ramp event on the preprocessed data, and then divide the identified data into two categories according to whether it is ramping or not. The specific steps are as follows:
[0109] The improved revolving door algorithm (SDT) is used to identify the characteristics of the climbing event of the data. Let X be the data sequence, x0 be the end point of the previous compression process, x1 be the next data point, and x i is the i-th base station. T is the time series, T0, T1, T i are x0, x1, x i The corresponding time point. △E is the height of the door, that is, the tolerance coefficient. After compression by the revolving door algorithm, a new data sequence is obtained. The slope is represented by K. The specific steps are as follows:
[0110] (2.1) First, initialize, where K 1new is the initial upper revolving door slope, K 2new The initial slope of the lower revolving door is as follows:
[0111]
[0112] Let X be the data sequence, where x0 is the end point of the previous compression process, x1 is the next data point, and x i is the i-th stronghold; T0, T1, T i are x0, x1, x i The corresponding time point, E is the compression threshold, T is the original data time series, and x is the corresponding original data series;
[0113] (2.2) Calculate T respectively i The upper revolving door slope K1 and the lower revolving door slope K2 are as shown in the formula:
[0114]
[0115] (2.3) Update K1new and K 2new Values:
[0116] K 1new =Max(K1,K 1new );K 2new =Max(K2,K 2new ) (3)
[0117] (2.4) According to K 1new and K 2new The size determines whether compression is complete; if k 1new ≥k 2new Then the compression process ends and storage t i-1 The data value p corresponding to the time i-1 , and return to (2.1) to start the next compression process; if k 1new ≤k 2new , then continue the compression and return to step (2.2), at this time i=i+1.
[0118] (2.5) The improved dandelion optimization algorithm DO is used to optimize the value of the tolerance coefficient △E of the revolving door algorithm.
[0119] △E corresponds to the fitness value in the algorithm. After the algorithm continuously iterates and calculates the optimal fitness value, the value of the tolerance coefficient △E is output. Optimizing the revolving door algorithm by calculating the fitness value includes the following steps:
[0120] The DO algorithm is divided into the ascending stage, descending stage and landing stage according to the characteristics of dandelion seeds flying long distances when they mature and looking for the optimal landing position. Different strategies are used in the three stages for the optimization process. △E corresponds to the fitness value in the algorithm. After the algorithm continuously iterates and calculates the optimal fitness value, the value of the tolerance coefficient △E is output. Optimizing the revolving door algorithm by calculating the fitness value includes the following steps:
[0121] (2.5.1) The parameters of the DO algorithm include: maximum number of iterations, population size, dimension size, upper and lower bounds of the search space.
[0122] (2.5.2) The Logistic chaos initialization method is used instead of the random initialization method in the DO algorithm, so that the dandelion population can conduct a more extensive preliminary search. The formula is as follows:
[0123]
[0124] Among them, L(n+1) is the updated individual position and λ is the control variable.
[0125] (2.5.3) In the rising stage, under the influence of wind speed, air humidity, etc., local falling is carried out according to different weather conditions. The fitness value of the seed position is calculated to find the optimal fitness value, and the value of the tolerance coefficient corresponding to the fitness value is output:
[0126] Sunny day: In clear weather, the wind speed can be considered to be log-normally distributed. The DO algorithm emphasizes search. During the search, dandelion seeds are randomly blown to various locations by the wind. The update formula is:
[0127] F t+1 =F t +α*v x *v y *lnY*(F s -F t ) (5)
[0128] Among them, F t represents the position of the dandelion seed after iteration t, F s represents the randomly selected position in the search space at iteration t times, InY represents the log-normal distribution with μ = 0 and σ2 = 1, and α is an adaptive parameter used to adjust the search step size, which fluctuates randomly between [0, 1].
[0129] Rainy day: Dandelion seeds perform local search, and the position update formula is:
[0130] F t+1 =F t *ε (6)
[0131] Among them, ε is used to limit the local search range and oscillates in a "convex downward" manner.
[0132] Taking into account the different weather conditions during the rising phase, and in order to make the algorithm more oriented to global search, the tolerance coefficient corresponding to its fitness value is confirmed to be the global optimal, and the cutoff point is set to 1.5. The mathematical expression of dandelion seeds during the rising phase is:
[0133]
[0134] (2.5.4) Descending stage. In this stage, the DO algorithm also emphasizes search and uses Brownian motion to simulate the trajectory of dandelions. In order to reflect the stability of the dandelion's descent, the average position information after the ascending stage is used; the corresponding mathematical expression is:
[0135] F t+1 =F t -α*β t *(F mean_t -α*β t *F t ) (8)
[0136] Among them, β t represents Brownian motion, is a random number from a standard normal distribution, F mean_t t is the average position of the group, expressed as:
[0137]
[0138] (2.5.5) Landing phase. In this phase, the DO algorithm focuses on development. Based on the first two phases, as the population evolves, the global optimal solution can be found. That is, the optimal tolerance coefficient, and then the climbing event can be identified through the revolving door optimization algorithm. Levy flight is used for selection. Position update formula:
[0139] F t+1 =F elite +levy(λ)*α*(F elite -F t *δ) (10)
[0140] Among them, F elite Indicates the optimal position of the current iteration, δ is a linearly increasing parameter, equal to 2t / T, Levy flight calculation formula:
[0141]
[0142] β is a random number between [0,2] (β=1.5 in this paper), s is a fixed constant 0.01. ω and t are random numbers between [0,1].
[0143] (2.5.6) Determine whether the maximum number of iterations reaches the algorithm termination condition. If not, go to (2.5.3), finally end the operation and output the optimal result.
[0144] Step 3: If Figure 2 As shown, the data identified as climbing are filtered through MEEMD, and the data identified as non-climbing are filtered through smooth.
[0145] MEEMD decomposes the actual wind power data into a series of IMF components from high frequency to low frequency. By calculating the permutation entropy of the IMF components, the IMF components can be divided into three parts: abnormal components, noise components and regular components. Abnormal signals are directly eliminated. The noise components and regular components after wavelet filtering are reconstructed, and the reconstructed signals are the wind power data after MEEMD filtering.
[0146] Step 3.1: Substitute a set of white noise signals v with the same modulus and opposite signs i (t) and -v i (t) is added to the actual wind power signal x(t), as shown in the formula.
[0147]
[0148] In the formula, v i (t) represents white noise: a i represents the amplitude of white noise, a i The value is generally taken as 0.15 to 0.25 times the standard deviation of the original signal: n is the logarithm of the added white noise, and the number of white noise signals in the set is 2n.
[0149] Step 3.2: For each pair of wind power signals x in the set + (t) and x - (t) Perform EMD decomposition to obtain a set of IMF components, as shown in the formula
[0150]
[0151] Among them, h ij + (t), h ij - (t) represents the j-th order IMF component of the i-th signal.
[0152] Step 3.3: Average the multi-group components to obtain the IMF components of each order, as shown in the formula.
[0153]
[0154] Where p(t) represents the j-th order IMF component.
[0155] Step 3.4: Identify h by permutation entropy j (t) Whether it is an abnormal signal. The greater the randomness of the signal, the greater the permutation entropy. Set the threshold to determine whether the signal is an abnormal signal or a noise signal. Signals with entropy values between 0.5 and 0.7 are classified as noise signals, and signals with entropy values greater than 0.7 are classified as abnormal signals.
[0156] Step 3.5: Subtract the abnormal signal and the noise signal from the actual wind power signal, and then add the filtered noise signal to obtain the filtered wind power signal, as shown in the formula.
[0157] p(t)=x(t)-x'(t)+x”(t) (15)
[0158] Among them, p(t) represents the wind power signal after filtering, x(t) is the original signal, x'(t) is the sum of all abnormal signals and noise signals, and x"(t) is the noise signal after wavelet filtering.
[0159] The non-climbing data is filtered through smoothing. Assuming the input is x and the output is y, the moving average filter calculation formula is:
[0160]
[0161] Step 4: Figure 3 As shown in the figure, the filtered data is clustered using vertical and horizontal clustering strategies. The vertical clustering realizes the clustering of refined seasonal characteristics throughout the year through three-step clustering of intra-day pre-clustering, single-day re-clustering and longitudinal time units. At the same time, all data within the vertical cluster are clustered in a row to achieve fine horizontal clustering at a small time scale.
[0162] The method of using vertical and horizontal clustering is to perform small-scale horizontal clustering on the filtered data obtained in step 3 for daily clustering and large-scale vertical clustering on seasonal and annual clustering. Horizontal and vertical clustering can achieve refined seasonal characteristic clustering analysis based on time continuity, while vertical and horizontal clustering takes into account the similarities and differences between days, thereby improving the accuracy and robustness of the model. The K-means algorithm is used for clustering.
[0163] The data is first clustered vertically. The vertical clustering is divided into three steps. First, the minimum time interval T is determined, and each T in a single day is clustered according to the power fluctuation characteristics to obtain the overall characteristics of a single day; then similar days are clustered according to the characteristics of each day in the whole year; finally, the vertical time unit clustering is realized according to the proportion characteristics obtained from the daytime clustering results. The specific steps are as follows:
[0164] (4.1) First, intra-day pre-clustering is performed, taking the minimum time interval T within the day as samples and constructing the feature vector, as shown in the following table:
[0165]
[0166] Among them, i is the minimum time interval sequence number; R maxi and R mini are the i-th minimum time interval T in a single day. i The maximum and minimum active power values within the T i The average value of internal active power. Then the samples are normalized to transform the data:
[0167]
[0168] Among them, Y ij is the sampling value of the jth attribute of the ith sample, Y ij ' is the normalized value of the jth attribute of the i-th sample; m j and M j are the maximum and minimum values of the jth attribute respectively; Mjnew and m jnew They are the upper and lower limits of the new mapping range of j, which are 1 and 0 respectively.
[0169] (4.2) The pre-clustered data is re-clustered within a single day. After intra-day pre-clustering, the feature vector of the re-clustering within a single day is constructed to represent the category of each T within the day and the total number of clusters within the day. The formula is as follows:
[0170]
[0171] Where k is the day serial number; D Tnk is the time period T of the kth day n The cluster center of the category to which it belongs, n is the total number of segments divided into a single day according to the minimum time interval T; D ck is the number of clusters on the kth day; D maxk and D mink are the maximum active power value and the minimum active power value on the kth day, respectively. is the daily average active power value; D s2k is the daily active power sample variance. After construction, normalization is first performed according to Formula 4 and then clustering is performed to divide the annual data into J categories, and the categories to which each day of the year belongs can be obtained.
[0172] (4.3) The vertical time axis data of the whole year is divided into vertical time units T ZN The unit is divided into L segments, T ZN Select to divide by quarter. After re-clustering within a single day, the annual data is clustered into J categories by day, and the longitudinal time unit T is counted. ZN The categories occupied by each category in the period are used to represent the daily composition structure and fluctuation trend within the period, supplemented by statistics that characterize power fluctuations to form a feature vector.
[0173]
[0174] Among them, h is the longitudinal time unit number; S h1 ,S h2 ,...,S hj To count the proportion of the 1st, 2nd, ..., jth categories in the hth longitudinal time unit; S maxh and S minh are the maximum active power and minimum active power in the hth longitudinal time unit, respectively. and S s2h are the mean and variance of active power in the hth longitudinal time unit, respectively. After normalization and clustering according to formula 10, the data for the whole year can be objectively divided into L categories.
[0175] (4.4) After vertical clustering, the data is clustered horizontally. The main approach is to connect all the data belonging to the same vertical cluster head to tail, and form horizontal continuous data in horizontal columns. HN All data are divided into H segments and clustered horizontally. HN The change rate sequence within the minimum time interval T is used to represent the horizontal data fluctuation trend, supplemented by active power statistics to form the feature vector:
[0176]
[0177] Among them, p is the horizontal time unit sequence number; b is T ZN The minimum number of time intervals in W maxp ,W minp are the maximum active power and the minimum active power in the pth horizontal time unit respectively; and W s2p are the average active power and variance in the pth horizontal time unit respectively. pb T ZN The volatility sequence of b minimum time intervals within the interval is expressed as η pb For example, the calculation formula is
[0178]
[0179] Among them, i is the minimum time interval sequence number; Pw is the root bus active power sequence composed of load and wind power; {} is the root bus power sequence number; T HN It is the horizontal time unit.
[0180] (4.5) Through horizontal clustering, all data of the same vertical class are clustered into q classes, and each class can be represented by its own cluster center. When studying the load model of a certain period, it is only necessary to use the fluctuation data of the period to form the characteristic vector of the following formula, and use the Euclidean distance of formula 15 to judge the similarity of the characteristic vectors of the various cluster centers in the sample of the period and the historical sample, and it is considered that the sample belongs to the historical sample class with high similarity (small Euclidean distance).
[0181]
[0182] Among them, ρ(A,B) is the Euclidean distance between sequence A and sequence B.
[0183] Step 5: Weight the clustered data according to the load of different quarters, increase the weight of the quarter with large load, and then use variational autoencoder (VAE) to extract features from the clustered data.
[0184] Data encoding: The basic idea is to use the fitting ability of deep neural networks to reduce the dimension of input data into a set of feature vectors through an encoder.
[0185] Data decoding: Use a decoder to restore this set of feature vectors to input data.
[0186] Gradient back propagation. The loss function is calculated by decoding the output data and the input raw data, and the network weights are updated by back propagation. The network weights are initialized using the Glorot uniform distribution method. After repeated training, the decoder learns the mapping law of the data. The batch gradient descent (mini-batch) size of the training is 32, and Adam is used as the optimizer. Except for the output layer using Sigmoid, all other activation functions use ReLu.
[0187] Generate data, that is, extract the decoder as the VAE generation model, extract a set of feature vectors from the Gaussian distribution as the model input, and then output new data that conforms to the probability distribution of the training data set.
[0188] Step 6: Construct a Transformer prediction model and use the improved Dandelion optimization algorithm to optimize the Transformer prediction model parameters; input the feature-extracted data into the optimized Transformer prediction model to predict future wind power.
[0189] Figure 4 The Transformer model structure diagram includes an encoding module, a decoding module, a feedforward neural network, and an attention mechanism. The encoding module contains two layers, a self-attention layer and a feedforward neural network. Self-attention can obtain context information. The decoding module also contains a self-attention layer and a feedforward neural network. There is also an attention layer in between, which can help the node obtain the key content to be paid attention to at present. After self-attention processes the data, it sends the data to the feedforward neural network, and the output is input to the next encoder.
[0190] Use the improved Dandelion optimization algorithm to optimize the hyperparameters in the Transformer model. The specific steps are as follows:
[0191] The DO algorithm can find the optimal hyperparameters of the Transformer model. With continuous iterations, individuals with high fitness values appear in the DO algorithm, which are the optimal values of the hyperparameters. The wind power data after clustering and VAE feature extraction is the input of the Transformer, and then the optimal hyperparameters found by the DO algorithm are used to optimize the model's prediction accuracy for wind power.
[0192] The Logistic chaos initialization method is used instead of the random initialization method in the DO algorithm, so that the dandelion population can conduct a wider range of preliminary searches.
[0193] In the ascending stage, the fitness value of the seed position is calculated to find the optimal hyperparameter. On sunny days, the algorithm simulates dandelion seeds and searches globally, and the hyperparameter results are globally optimal. On rainy days, local searches are performed, and the hyperparameter results are locally optimal, so that predictions can be made based on the input wind power.
[0194] Landing phase. As the population evolves, the global optimal solution can be found. That is, the optimal hyperparameters, and then the wind power can be predicted through the model. The algorithm termination condition is reached, and the operation is finally terminated and the optimal result is output.
[0195] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.
Claims
1. A wind power prediction method based on segmented filtering and vertical and horizontal clustering, characterized in that: The following steps are involved: (1) Collecting the original power data of the wind farm and preprocessing the collected data; (2) The improved Dandelion optimization algorithm is used to optimize the revolving door algorithm, and the characteristics of climbing events are identified on the preprocessed data. Then the identified data are divided into two categories according to whether they are climbing or not; (3) The data identified as climbing are filtered by MEEMD, and the data identified as non-climbing are filtered by smoothing; (4) The filtered data are clustered using vertical and horizontal clustering strategies. The vertical clustering is performed through three steps of intra-day pre-clustering, single-day re-clustering, and vertical time unit clustering to achieve the annual refined seasonal characteristic clustering. At the same time, all the data within the vertical cluster are clustered together to achieve fine horizontal clustering at a small time scale. (5) Use variational autoencoder to extract features from clustered data; (6) Construct a Transformer prediction model and use the improved Dandelion optimization algorithm to optimize the parameters of the Transformer prediction model; input the feature-extracted data into the optimized Transformer prediction model to predict future wind power; The implementation process of step (2) is as follows: (2.1) First, initialize, where K 1new is the initial upper revolving door slope, K 2new The initial slope of the lower revolving door is as follows: Among them, x0 is the end point of the previous compression process, x1 is the next data point, and x i is the i-th data point; τ0, τ1 are the time points corresponding to x0, x1 respectively, and E is the compression threshold; (2.2) Calculate τ respectively i The upper revolving door slope K1 and the lower revolving door slope K2 are as shown in the formula: Among them, x i is the i-th stronghold; τ0, τ i x0, x i The corresponding time point; (2.3) Update K 1new and K 2new Values: K 1new =Max(K1,K 1new );K 2new =Max(K2,K 2new )(3) (2.4) According to K 1new and K 2new The size determines whether compression is complete; if k 1new ≥k 2new Then the compression process ends and storage t i-1 The data value p corresponding to the time i-1 , and return to (2.1) to start the next compression process; if k 1new ≤k 2new , then continue the compression and return to step (2.2), at this time i=i+1; (2.5) The improved dandelion optimization algorithm is used to optimize the value of the tolerance coefficient ΔE of the revolving door algorithm. ΔE is the height of the door, that is, the tolerance coefficient. After compression by the revolving door algorithm, a new data sequence is obtained: The DO algorithm is divided into the ascending stage, descending stage and landing stage according to the characteristics of dandelion seeds flying long distances when they mature, and searching for the optimal landing position. Different strategies are used in the three stages for the optimization process. ΔE corresponds to the fitness value in the algorithm. After the algorithm continuously iterates and calculates the optimal fitness value, the value of the tolerance coefficient ΔE is output. The step (2.5) comprises the following steps: (2.5.1) Setting the parameters of the DO algorithm includes: maximum number of iterations, population size, dimension size, upper and lower bounds of the search space; (2.5.2) The Logistic chaos initialization method is used instead of the random initialization method in the DO algorithm, so that the dandelion population can conduct a more extensive preliminary search. The formula is as follows: Among them, L(n+1) is the updated individual position, and λ is the control variable; (2.5.3) In the rising stage, under the influence of wind speed, air humidity, etc., local falling is carried out according to different weather conditions. The fitness value of the seed position is calculated to find the optimal fitness value, and the value of the tolerance coefficient corresponding to the fitness value is output: Sunny day: In clear weather, the wind speed can be considered to be log-normally distributed. The DO algorithm emphasizes search. During the search, dandelion seeds are randomly blown to various locations by the wind. The update formula is: F t+1 =F t +α*v x *in y *lnY*(F s -F t ) (5) Among them, F t represents the position of the dandelion seed after iteration t; F s represents a randomly selected position in the search space at iteration t, and InY represents the position that meets μ=0 and σ 2 =1 lognormal distribution, α is an adaptive parameter used to adjust the search step size, which fluctuates randomly between [0,1]; Rainy day: Dandelion seeds perform local search, and the position update formula is: F t+1 =F t *e (6) Among them, ε is used to limit the local search range and oscillates in a "convex downward" manner; The mathematical expression of dandelion seeds in the rising period is: (2.5.4) Descending stage: In this stage, the DO algorithm also emphasizes search and uses Brownian motion to simulate the trajectory of dandelions. In order to reflect the stability of the dandelion's descent, the average position information after the ascending stage is used. The corresponding mathematical expression is: F t+1 =F t -a*b t *(F mean_t -a*b t *F t ) (8) Among them, β t represents Brownian motion, is a random number from a standard normal distribution, F mean_t t is the average position of the group, expressed as: (2.5.5) Landing phase: In this phase, the DO algorithm focuses on development. Based on the first two phases, as the population evolves, the global optimal solution, that is, the optimal tolerance coefficient, can be found. Then, the revolving door optimization algorithm can be used to identify the climbing event, and Levy flight is used for selection. The position update formula is: F t+1 =F elite +levy(λ)*α*(F elite -F t *δ) (10) Among them, F elite It represents the optimal position of the current iteration. δ is a linearly increasing parameter, which is equal to 2It / Max_it. It is the current number of iterations, and Max_it is the maximum number of iterations. The formula for Levy flight is: β is a random number between [0,2], s is a fixed constant 0.01, ω and t are random numbers between [0,1]; (2.5.6) Determine whether the maximum number of iterations reaches the algorithm termination condition. If not, go to (2.5.3), finally end the operation and output the optimal result; The implementation process of step (3) is as follows: (3.1) A set of white noise signals v with the same modulus and opposite signs i (t) and -v i (t) is added to the actual wind power signal x(t), as shown in the formula: In the formula, v i (t) represents white noise: a i represents the amplitude of white noise, n is the logarithm of the added white noise, and the number of white noise signals in the set is 2n; (3.2) For each pair of wind power signals x in the set + (t) and x - (t) Perform EMD decomposition to obtain a set of IMF components: Among them, h ij + (t), h ij - (t) represents the j-th order IMF component of the i-th signal; (3.3) The multi-component components are averaged to obtain the IMF components of each order: In the formula, h j (t) represents the j-th order IMF component; (3.4) Identify h by permutation entropy j (t) Whether it is an abnormal signal; if the signal is more random, the permutation entropy is greater; set a threshold to determine whether the signal is an abnormal signal or a noise signal; (3.5) Subtract the abnormal signal and the noise signal from the actual wind power signal, and then add the filtered noise signal to obtain the filtered wind power signal: p(t)=x(t)-x'(t)+x”(t)(15)wherein, p(t) represents the wind power signal after filtering, x(t) is the original signal, x'(t) is the sum of all abnormal signals and noise signals, and x”(t) is the noise signal after wavelet filtering; (3.6) The non-climbing data is passed through a smooth filter. The function of the smooth filter is to smooth the sequence and reduce the noise of the signal. The filtering principle is to regard the continuous sampling data as a queue with a fixed length of N. After a new measurement, the first data of the queue is removed, and the remaining N-1 data are moved forward in sequence, and the new sampling data is inserted as the tail of the new queue; then arithmetic operations are performed on this queue, and the result is used as the result of this measurement; assuming that the input is x and the output is y, the moving average filter calculation formula is: The implementation process of step (4) is as follows: (4.1) Intra-day pre-clustering, taking the minimum time interval T within the day as samples, construct the feature vector, as shown in the following table: Among them, i is the minimum time interval sequence number; R maxi and R mini are the i-th minimum time interval T in a single day. i The maximum and minimum active power values within the T i The average value of internal active power; then the samples are normalized to transform the data: Among them, Y ij is the sampling value of the jth attribute of the ith sample, Y ij ' is the normalized value of the jth attribute of the i-th sample; m j and M j are the maximum and minimum values of the jth attribute respectively; M jnew and m jnew They are the upper and lower limits of the new mapping range of j; (4.2) The pre-clustered data is re-clustered within a single day. After intra-day pre-clustering, the feature vector of the re-clustering within a single day is constructed to represent the category of each T within the day and the total number of clusters within the day. The formula is as follows: Where k is the day serial number; D Tnk is the time period T of the kth day n The cluster center of the category to which it belongs, n is the total number of segments divided into a single day according to the minimum time interval T; D Ck is the number of clusters on the kth day; D maxk and D mink are the maximum active power value and the minimum active power value on the kth day, respectively. is the daily average active power value; D s2k is the daily active power sample variance; the annual data is divided into J categories, and the category of each day in the year can be obtained; (4.3) The vertical time axis data of the whole year is divided into vertical time units T ZN The unit is divided into L segments, T ZN Choose to divide by quarter; construct feature vectors based on the proportion characteristics obtained by re-clustering within a single day, and finally obtain clustering results that can reflect the refined seasonal characteristics; after re-clustering within a single day, divide the annual data into J categories, and count the longitudinal time unit T ZN The categories occupied by each category in the period are used to represent the daily composition structure and fluctuation trend within the period, supplemented by statistics that characterize power fluctuations to form a feature vector. Among them, h is the longitudinal time unit number; S h1 ,S h2 ,...,S hj To count the proportion of the 1st, 2nd, ..., jth categories in the hth longitudinal time unit; S maxh and S minh are the maximum active power and minimum active power in the hth longitudinal time unit, respectively. and S s2h are respectively the mean and variance of active power in the hth longitudinal time unit; according to T ZN The classification objectively divides the annual data into L categories; (4.4) After vertical clustering, the data is clustered horizontally. All data belonging to the same vertical cluster are connected head to tail, and the horizontal columns form horizontal continuous data. HN Divide the data into H segments and perform horizontal clustering on all data. HN The change rate sequence within the minimum time interval T is used to represent the horizontal data fluctuation trend, supplemented by active power statistics to form the feature vector: Among them, p is the horizontal time unit sequence number; b is T ZN The minimum number of time intervals in W maxp ,W minp are the maximum active power and the minimum active power in the pth horizontal time unit respectively; and W s2p are the average active power and variance in the pth horizontal time unit respectively; η pb T ZN The volatility sequence of b minimum time intervals is calculated as follows: Where: i is the minimum time interval sequence number; Pw is the root bus active power sequence composed of load and wind power; {} is the root bus power sequence number; T HN is the horizontal time unit; (4.5) Through horizontal clustering, all data of the same vertical class are clustered into q classes, each of which can be represented by its own cluster center; the similarity of the characteristic vectors of each cluster center in the sample of this period and the historical sample is judged by Euclidean distance: Among them, ρ(A,B) is the Euclidean distance between sequence A and sequence B; The implementation process of step (6) is as follows: (6.1) The DO algorithm can find the optimal hyperparameters of the Transformer model. With continuous iterations, individuals with high fitness values appear in the DO algorithm, which are the optimal values of the hyperparameters. The wind power data after clustering and VAE feature extraction is the input of the Transformer, and then the optimal hyperparameters found by the DO algorithm are used to optimize the model's prediction accuracy for wind power. (6.2) Using the Logistic chaos initialization method instead of the random initialization method in the DO algorithm enables the dandelion population to conduct a more extensive preliminary search; (6.3) In the ascending stage, the fitness value of the seed position is calculated to find the optimal hyperparameter. On sunny days, the algorithm simulates dandelion seeds and is more oriented to global search, and the hyperparameter result is the global optimal; on rainy days, a local search is performed, and the hyperparameter result is the local optimal, so that the input wind power is predicted; (6.4) Landing phase: As the population evolves, the global optimal solution, i.e., the optimal hyperparameters, can be found eventually, and then the wind power can be predicted through the model; (6.5) Determine whether the maximum number of iterations reaches the algorithm termination condition. If not, go to step (6.3), finally end the operation and output the optimal result.
2. A wind power prediction method based on segmented filtering and vertical and horizontal clustering according to claim 1, characterized in that: The implementation process of step (5) is as follows: (5.1) Data encoding, the encoder contains 4 convolutional layers, and the 4 convolutional layers are connected to a fully connected layer with 256 neurons. The number of neurons in the fully connected layer corresponding to the logarithm of the mean and variance is set to 10; (5.2) Data decoding,The decoder input dimension is 10, first containing a fully connected layer of 256 neurons, followed by a fully connected layer of 9216 neurons; (5.3) Gradient back propagation: The loss function is calculated by decoding the output data and the input original data, and the network weights are updated through back propagation. The network weights are initialized using the Glorot uniform distribution method. After repeated training, the decoder learns the mapping rules of the data. (5.4) Generate data, that is, extract the decoder as the VAE generation model, extract a set of feature vectors from the Gaussian distribution as the model input, and then output new data that conforms to the probability distribution of the training data set.
3. The wind power prediction method based on segmented filtering and vertical and horizontal clustering according to claim 1 is characterized in that: The Transformer prediction model in step (6) includes an encoding module, a decoding module, a feedforward neural network and an attention mechanism; the encoding module includes two layers, a self-attention layer and a feedforward neural network, and the self-attention layer can obtain context information; The decoding module includes a self-attention layer and a feedforward neural network. In the middle, there is an attention layer that helps the node obtain the key content that needs to be paid attention to. After self-attention processes the data, it sends the data to the feedforward neural network, and the output is input into the next encoder.
Citation Information
Patent Citations
Longitudinal time axis clustering method in generalized load modeling on basis of seasonality
CN104200106A
Wind power prediction method and system for optimizing deep Transformer network
CN112653142A
Short-term offshore wind power prediction method based on CEEMDAN-SSA-BiLSTM
CN114611808A
Ultra-short-term power prediction model establishment method considering time-space characteristics of multiple offshore wind power units
CN115587525A
Wind power climbing event identification method based on PASDA and FTS
CN115688472A
