A wind farm power control method, device, terminal equipment and storage medium
By combining historical wind energy data and meteorological data, and using the wind power prediction model to extract time series and meteorological correlation characteristics, accurate target power is generated, which solves the problem of traditional wind farm power prediction failing to consider meteorological conditions, and achieves the stability of wind farm output power and the safe and stable operation of the power grid.
Patent Information
- Application Number
- CN202411732539.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Traditional wind farm power forecasts fail to effectively consider the impact of external meteorological conditions, resulting in unstable output power and an inability to ensure the safe and stable operation of the power grid.
By combining historical wind energy data and current meteorological data, the wind power prediction model is used to extract the time series characteristics and meteorological correlation characteristics of power, generate accurate target power, and control the output of wind turbines to match current meteorological conditions.
The stability of wind farm output power is achieved, the safe and stable operation level of the power grid is improved, and power fluctuations are reduced.
Smart Images

Figure CN119695857B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wind farm control, and in particular to a wind farm power control method, apparatus, terminal equipment and storage medium. Background Art
[0002] Fluctuations in wind farm power can affect the overall operation of the power grid and may even cause grid failures or power outages. Furthermore, wind farm output power generally fluctuates dramatically due to rapid changes in meteorological conditions (such as sudden changes in wind speed and direction). If the wind farm output power cannot be adjusted in time to match the current meteorological conditions, it will lead to instability in the wind farm output power, impacting the power grid. Accurate power forecasting and precise wind farm power control can make the wind farm output power more stable, thereby ensuring the safe and stable operation of the power grid.
[0003] However, in the process of traditional wind energy data processing and power forecasting, the current or future wind power output is predicted directly based on historical data, without considering the potential impact of external meteorological conditions on wind farm power. As a result, it is impossible to accurately predict the power output required by the current wind farm, and it is impossible to achieve precise wind farm power control, resulting in instability of wind farm output power, that is, it is impossible to ensure the safe and stable operation of the power grid. Summary of the Invention
[0004] The embodiments of the present invention provide a power control method, apparatus, terminal device and storage medium for a wind farm, which can input meteorological data together with historical wind energy data into a wind power prediction model, so that the model can not only extract time series features for representing the trend of power changes over time, but also capture the correlation features between power and meteorology, thereby comprehensively considering the time series changes of power and the potential impact of meteorological conditions on power. It can effectively solve the problem in the prior art that the potential impact of external meteorological conditions on wind farm power is not considered, resulting in the inability to accurately predict the power required to be output by the current wind farm, and thus the inability to achieve precise wind farm power control.
[0005] An embodiment of the present invention provides a power control method for a wind farm, comprising:
[0006] Obtain historical wind energy data of the wind farm and meteorological data corresponding to the current moment; wherein the historical wind energy data includes several different historical moments; each historical moment corresponds to several different historical powers;
[0007] Inputting the historical wind energy data and the meteorological data into a wind power prediction model, so that the wind power prediction model extracts time series characteristics of power and correlation characteristics between power and meteorological conditions based on the historical wind energy data and meteorological data, and generates a plurality of different target powers corresponding to the current moment based on the time series characteristics and correlation characteristics; wherein the time series characteristics are used to characterize the trend of power changes over time;
[0008] Control the output power of each wind turbine in the wind farm according to different target powers;
[0009] The generation of the wind power prediction model includes:
[0010] The wind energy data samples and the meteorological sample data corresponding to the wind energy data samples are used as training samples; wherein each moment in the wind energy data samples corresponds to a number of different power samples;
[0011] Taking each training sample and the actual power corresponding to each training sample as input and the predicted power of each training sample as output, the wind power prediction model to be trained is iteratively trained until the model converges, thereby generating a trained wind power prediction model.
[0012] Preferably, each of the historical powers corresponds to a power value or a preset value; wherein the historical power corresponding to a preset value is marked as a target historical power with a missing power value;
[0013] Inputting the historical wind energy data and the meteorological data into a wind power prediction model includes:
[0014] When it is determined that the historical wind energy data does not have a target historical power with a missing power value, directly inputting the historical wind energy data and the meteorological data into a wind power prediction model;
[0015] When determining that the target historical power has several power values missing from the historical wind energy data, generating a raw tensor having multiple dimensions based on the historical wind energy data; wherein the historical moments correspond to multiple different dimensions in the raw tensor; and the historical power corresponds to one dimension in the raw tensor;
[0016] Decomposing the original tensor using a tensor decomposition algorithm to generate an initial core tensor and several initial factor matrices; wherein the initial core tensor and the several initial factor matrices do not have preset values; the number of dimensions of the core tensor is the same as the number of dimensions of the original tensor; different factor matrices correspond to ranks corresponding to different dimensions in the original tensor;
[0017] Generate an initial reconstruction tensor based on the initial kernel tensor and several initial factor matrices;
[0018] Repeat the reconstruction tensor update operation until it is determined that the current reconstruction error is not greater than the preset error threshold, and then output the current reconstruction tensor as the final reconstruction tensor;
[0019] Generate completed historical wind energy data based on the final reconstructed tensor;
[0020] Inputting the meteorological data and the completed historical wind energy data into a wind power prediction model;
[0021] The reconstructed tensor update operation includes:
[0022] Get the current reconstruction tensor; where the initial current reconstruction tensor is the initial reconstruction tensor;
[0023] Determining a current reconstruction error based on a deviation value between the current reconstructed tensor and the original tensor;
[0024] When it is determined that the current reconstruction error is greater than a preset error threshold, a current gradient vector corresponding to the current reconstructed tensor is calculated based on the current reconstruction error; wherein the current gradient vector is used to indicate the direction in which the current reconstruction error decreases fastest;
[0025] According to the preset learning rate, the current gradient vector and the current reconstruction tensor, the value of the core tensor and the value of each factor matrix in the current reconstruction tensor are updated to generate an updated reconstruction tensor;
[0026] The updated reconstructed tensor is used as the current reconstructed tensor for the next reconstructed tensor update operation.
[0027] Preferably, determining the current reconstruction error according to the deviation value between the current reconstructed tensor and the original tensor includes:
[0028] The current reconstruction error is calculated according to the following formula:
[0029] h=∑ d,m,v∈Ω (O(d,m,v)-P) 2 ;
[0030]
[0031] Where h is the current reconstruction error, O(d,m,v) represents the target tensor formed after removing the preset values in the original tensor and retaining the power values in the original tensor, Ω is the set corresponding to the power values of different dimensions in the original tensor, P is the current reconstructed tensor; C is the core tensor, and V, M, and D are the factor matrices corresponding to different dimensions, respectively.
[0032] Preferably, the wind power prediction model includes: an encoder; the meteorological data includes: wind direction, wind speed, temperature and humidity;
[0033] The wind power prediction model extracts the time series characteristics of power and the correlation characteristics between power and weather based on historical wind energy data and meteorological data, including:
[0034] Converting the historical wind energy data into a corresponding first query matrix, a first key matrix, and a first value matrix by the encoder;
[0035] Converting meteorological data into a corresponding second query matrix, a second key matrix, and a second value matrix;
[0036] Performing a dot product operation on the first query matrix and the first key matrix to obtain a first attention matrix; performing a weighted summation on the first value matrix based on the first attention matrix to generate a time series feature of power;
[0037] Performing a dot product operation on the first query matrix and the second key matrix to obtain a second attention matrix; or performing a dot product operation on the second query matrix and the first key matrix to obtain a second attention matrix;
[0038] Based on the second attention matrix, a weighted summation is performed on the second value matrix to generate a correlation feature between power and weather; wherein the second attention matrix includes: correlation scores between each historical power and wind direction, wind speed, temperature and humidity respectively.
[0039] Preferably, the encoder comprises: a sparse self-attention layer; a first query matrix comprising a plurality of query vectors for representing historical moments; a first key matrix comprising a plurality of key vectors for representing historical power; a first attention matrix comprising a plurality of click pairs; each click pair corresponding to an attention weight;
[0040] The step of performing a dot product operation on the first query matrix and the first key matrix to obtain a first attention matrix includes:
[0041] Determining the divergence corresponding to each query vector based on the transformed probability distribution corresponding to each query vector through the sparse self-attention layer; wherein the divergence is used to represent the sparsity of the query vector;
[0042] Performing a dot product operation on the first query matrix and the first key matrix to generate an initial attention weight for each dot product pair; wherein the dot product pair is used to represent the power correlation between different historical moments;
[0043] Based on each divergence, the initial attention weight of each dot product pair is adjusted, and then a first attention matrix is generated according to each dot product pair and each adjusted attention weight.
[0044] Preferably, the wind power prediction model includes: a decoder;
[0045] The generating of a plurality of different target powers corresponding to the current moment according to the timing characteristics and the correlation characteristics includes:
[0046] By means of the decoder, capturing the local correlation between the timing features and the correlation features, and capturing the global correlation between the timing features and the correlation features;
[0047] According to the local correlation and the global correlation, a plurality of different target powers corresponding to the current moment are generated.
[0048] Preferably, the decoder comprises: a multi-head self-attention layer and a full attention layer;
[0049] The capturing, by the decoder, the local correlation between the timing features and the correlation features, and the capturing the global correlation between the timing features and the correlation features, includes:
[0050] The time series features and the correlation features are divided into a plurality of feature heads through the multi-head self-attention layer; the self-attention distribution of each feature head is calculated, the self-attention distributions of each feature head are weighted summed, and local correlation is output; wherein the local correlation is used to characterize the local feature vector between the time series features and the correlation features;
[0051] Through the full attention layer, corresponding attention distributions are generated according to the temporal features and the correlation features respectively; global correlation is generated according to the dependency between each attention distribution; wherein the global correlation is used to characterize the global feature vector between the temporal features and the correlation features.
[0052] Based on the above method embodiments, the present invention provides corresponding device embodiments.
[0053] An embodiment of the present invention provides a power control device for a wind farm, comprising: a data acquisition module, a power prediction module, and a unit control module;
[0054] The data acquisition module is used to acquire historical wind energy data of the wind farm and meteorological data corresponding to the current moment; wherein the historical wind energy data includes several different historical moments; each historical moment corresponds to several different historical powers;
[0055] The power prediction module is configured to input the historical wind energy data and the meteorological data into a wind power prediction model, so that the wind power prediction model extracts time series characteristics of power and correlation characteristics between power and meteorological conditions based on the historical wind energy data and meteorological data, and generates a plurality of different target powers corresponding to the current moment based on the time series characteristics and correlation characteristics; wherein the time series characteristics are used to characterize the trend of power changes over time;
[0056] The unit control module is used to control the output power of each wind turbine in the wind farm according to different target powers;
[0057] The generation of the wind power prediction model includes:
[0058] The wind energy data samples and the meteorological sample data corresponding to the wind energy data samples are used as training samples; wherein each moment in the wind energy data samples corresponds to a number of different power samples;
[0059] Taking each training sample and the actual power corresponding to each training sample as input and the predicted power of each training sample as output, the wind power prediction model to be trained is iteratively trained until the model converges, thereby generating a trained wind power prediction model.
[0060] Based on the above method embodiments, the present invention provides corresponding terminal device embodiments.
[0061] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the power control method of a wind farm described in the above embodiment of the invention is implemented.
[0062] Based on the above method embodiment, the present invention provides a corresponding storage medium embodiment.
[0063] Another embodiment of the present invention provides a storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the power control method for a wind farm described in the above embodiment of the invention.
[0064] The following beneficial effects are achieved by implementing the present invention:
[0065] The embodiments of the present invention provide a power control method, apparatus, terminal device, and storage medium for a wind farm. After acquiring the historical wind energy data of the wind farm and the meteorological data corresponding to the current moment, the present invention can input the meteorological data and the historical wind energy data into a wind power prediction model, so that the model can not only extract the temporal characteristics used to represent the trend of power changes over time, but also capture the correlation characteristics between power and meteorology, thereby comprehensively considering the temporal changes of power and the potential impact of meteorological conditions on power, and thus more accurately predict the output power of the wind farm. Compared with the prior art, the present invention can use the wind power prediction model to combine historical wind energy data with current meteorological data to capture the correlation characteristics between power and meteorology, thereby achieving accurate prediction of wind power output power. Finally, the output power of each wind turbine in the wind farm is controlled according to the accurately predicted target power, which can reduce the fluctuation of the wind farm output power and improve the safe and stable operation level of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 The figure is a flow chart of a power control method for a wind farm provided by an embodiment of the present invention.
[0067] Figure 2 The figure is a schematic structural diagram of a power control device for a wind farm provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0068] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0069] like Figure 1 FIG. 1 is a flow chart of a power control method for a wind farm provided by an embodiment of the present invention. The power control method for a wind farm includes:
[0070] Step S1: Obtain historical wind energy data of the wind farm and meteorological data corresponding to the current moment; wherein the historical wind energy data includes several different historical moments; each historical moment corresponds to several different historical powers;
[0071] Step S2: Inputting the historical wind energy data and the meteorological data into a wind power prediction model, so that the wind power prediction model extracts the time series characteristics of power and the correlation characteristics between power and meteorology based on the historical wind energy data and meteorological data, and generates a plurality of different target powers corresponding to the current moment based on the time series characteristics and the correlation characteristics; wherein the time series characteristics are used to characterize the trend of power changes over time;
[0072] Step S3: controlling the output power of each wind turbine in the wind farm according to different target powers;
[0073] The generation of the wind power prediction model includes:
[0074] The wind energy data samples and the meteorological sample data corresponding to the wind energy data samples are used as training samples; wherein each moment in the wind energy data samples corresponds to a number of different power samples;
[0075] Taking each training sample and the actual power corresponding to each training sample as input and the predicted power of each training sample as output, the wind power prediction model to be trained is iteratively trained until the model converges, thereby generating a trained wind power prediction model.
[0076] For step S1, in a preferred embodiment, the historical wind energy data of the present invention includes the power output conditions at different time points in the past (i.e., historical moments). By analyzing and learning the historical wind energy data, the model can capture the trend of power changes over time (i.e., time series characteristics).
[0077] Meteorological data includes meteorological information such as temperature, humidity, wind speed, and wind direction at the current moment. By combining and processing historical wind energy data and the meteorological data corresponding to the current moment, the model can predict the output power of the wind farm under the current meteorological conditions to match the current meteorological conditions and maintain the stable operation of the wind farm.
[0078] For step S2, in a preferred embodiment, the present invention can address the problem of missing wind power data caused by sensor failure and communication interruption. Before inputting the data into the model, the missing parts of the input wind energy data can be supplemented, that is, the low-rank characteristics of the tensor can be used to recover the data to ensure the integrity of the data and improve the accuracy of the prediction.
[0079] Illustratively, each historical power corresponds to a power value or a preset value; wherein, the historical power corresponding to a preset value is marked as the target historical power with a missing power value; it can be understood that if the preset value is 0, then when the historical power at a certain historical moment has a missing power value, it will be assigned a value of 0. The present invention can fill in the missing part (the part with a value of 0) in the current data set through tensor decomposition and iterative optimization.
[0080] In actual application, the inputting of the historical wind energy data and the meteorological data into the wind power prediction model includes:
[0081] Determine whether there is any missing power value;
[0082] When it is determined that the historical wind energy data does not have a target historical power with a missing power value, the historical wind energy data and the meteorological data may be directly input into a wind power prediction model;
[0083] When it is determined that the historical wind energy data has a target historical power with several power values missing, the missing power values of the historical wind energy data may be supplemented.
[0084] First, based on historical wind energy data, a raw tensor with multiple dimensions is generated; wherein the historical moments correspond to multiple different dimensions in the raw tensor; and the historical power corresponds to one dimension in the raw tensor;
[0085] The original tensor is decomposed by a tensor decomposition algorithm to generate an initial core tensor and several initial factor matrices; wherein, the initial core tensor and the several initial factor matrices do not have preset values; the number of dimensions of the core tensor is the same as the number of dimensions of the original tensor; different factor matrices are ranks corresponding to different dimensions in the original tensor; schematically, the original tensor can be decomposed by the Tucker decomposition algorithm, which can decompose a high-dimensional tensor into a combination of low-dimensional core tensors and factor matrices, and these decomposed components jointly determine the structure and information of the original tensor.
[0086] Generate an initial reconstruction tensor based on the initial kernel tensor and several initial factor matrices;
[0087] Repeat the reconstruction tensor update operation until it is determined that the current reconstruction error is not greater than the preset error threshold, and then output the current reconstruction tensor as the final reconstruction tensor;
[0088] Generate completed historical wind energy data based on the final reconstructed tensor;
[0089] Inputting the meteorological data and the completed historical wind energy data into a wind power prediction model;
[0090] The reconstructed tensor update operation includes:
[0091] Get the current reconstruction tensor; where the initial current reconstruction tensor is the initial reconstruction tensor;
[0092] Determining a current reconstruction error based on a deviation value between the current reconstructed tensor and the original tensor;
[0093] When it is determined that the current reconstruction error is greater than a preset error threshold, a current gradient vector corresponding to the current reconstructed tensor is calculated based on the current reconstruction error; wherein the current gradient vector is used to indicate the direction in which the current reconstruction error decreases fastest;
[0094] According to the preset learning rate, the current gradient vector and the current reconstruction tensor, the value of the core tensor and the value of each factor matrix in the current reconstruction tensor are updated to generate an updated reconstruction tensor;
[0095] The updated reconstructed tensor is used as the current reconstructed tensor for the next reconstructed tensor update operation.
[0096] It is understandable that the present invention can gradually approximate the true distribution of the original tensor by continuously iteratively updating the reconstructed tensor, thereby improving the accuracy of data completion. Moreover, each iteration calculates a gradient vector based on the current reconstruction error, and updates the values of the core tensor and factor matrix accordingly, making the reconstructed tensor increasingly close to the original tensor. The iterative process can ensure that the completed historical wind energy data remains consistent with the original data in structure and information. Since the reconstructed tensor is generated based on the low-rank structure and nonlinear relationship of the original tensor, the completed data can retain the important features and information in the original data.
[0097] Schematically, based on the initial kernel tensor and factor matrix, an initial reconstruction tensor can be generated, and this reconstruction tensor is a preliminary estimate of the original tensor.
[0098] And through repeated iterations, the values of the kernel tensor and factor matrix are continuously adjusted according to the reconstruction error, thereby generating a reconstructed tensor that is increasingly close to the original tensor.
[0099] During the iterative process, the present invention uses the gradient descent method to optimize the reconstruction tensor. Schematically, the calculated gradient vector points out the direction in which the current reconstruction error decreases fastest. Then, during the iterative process, the values of the kernel tensor and the factor matrix can be adjusted along this direction to gradually reduce the reconstruction error, thereby continuously approaching the true distribution of the original data and improving the accuracy of the completed data.
[0100] Therefore, in the process of data completion, the present invention first makes full use of the multi-dimensional information in the historical wind energy data based on the tensor decomposition algorithm, so that the true distribution of the original data can be more accurately approximated in the future, and the power value of the missing value can be estimated, thereby reducing the impact on the performance of the wind power prediction model and improving the accuracy and stability of the model.
[0101] In a preferred embodiment, the current reconstruction error can be calculated according to the following formula:
[0102] h=∑ d,m,v∈Ω (O(d,m,v)-P) 2 ;
[0103]
[0104] Where h is the current reconstruction error, O(d,m,v) represents the target tensor formed after removing the preset values in the original tensor and retaining the power values in the original tensor, Ω is the set corresponding to the power values of different dimensions in the original tensor, P is the current reconstructed tensor; C is the core tensor, and V, M, and D are the factor matrices corresponding to different dimensions, respectively.
[0105] Schematically, wind energy data can be represented as a matrix or tensor, where each dimension represents time and different sensor data (such as measured historical power). Since the time dimension is too large compared to the data dimension, the time dimension can be further divided into two dimensions, such as every day and every ten minutes. Optionally, the embodiment of the present invention can obtain a third-order wind energy data tensor (original tensor), which can be represented as X∈R Value*Minute*Day Then the LRTFR of wind energy data tensor can be expressed as:
[0106]
[0107] Among them, C is the core tensor, V, M, and D are the factor matrices corresponding to different dimensions respectively; v i ,m j ,d k are column vectors in V, M, and D respectively;
[0108] Represents the vector outer product operation, r i , r j , r k Represent the ranks in three different dimensions, which are positive integers. Each element in X can be expressed as:
[0109]
[0110] Among them, p=1,2...Value, q=1,2...Minute, s=1,2...Day.
[0111] The completion problem of the wind energy data tensor mentioned above can be an optimization task, that is, to minimize the reconstruction error of the observation data while following the low-rank structure, then:
[0112]
[0113] Among them, O(d,m,v) is the observable variable value (that is, the power value corresponding to the historical power), and Ω is the set of observed data points.
[0114] In a preferred embodiment, multilayer perceptrons (MLP) can be used to parameterize C, V, M, and D respectively to adapt to the complex nonlinear relationships in wind energy data, so that the model with optimized parameters can effectively learn the basic patterns in the data.
[0115] Because C, V, M, and D are parameterized separately, the admn optimizer can also be used to directly optimize the parameters, effectively handling the stochastic gradient descent problem. The loss function is differentiable with respect to the core tensor and MLP parameters, which promotes end-to-end training and ultimately obtains a reconstructed tensor that is close to the original wind energy data tensor.
[0116] The embodiment of the present invention can use tensor decomposition algorithm (such as LRTFR) and multi-layer perceptron (MLP) to complete the wind energy data tensor, which can make full use of the low-rank structure and nonlinear relationship in the data, and can more accurately estimate the missing power value, thereby improving the accuracy of data completion.
[0117] Furthermore, for the input historical wind energy data and the meteorological data, the wind power prediction model of the present invention can obtain time series characteristics and correlation characteristics based on the historical wind energy data and meteorological data, and output several different target powers corresponding to the current moment according to the obtained time series characteristics and correlation characteristics, so as to realize subsequent accurate power control.
[0118] In a preferred embodiment, the wind power prediction model includes an encoder and a decoder; and the input meteorological data includes wind direction, wind speed, temperature and humidity.
[0119] In the processing of the wind power prediction model, the wind power prediction model extracts the time series characteristics of power and the correlation characteristics between power and weather based on historical wind energy data and meteorological data, including:
[0120] Converting the historical wind energy data into a corresponding first query matrix, a first key matrix, and a first value matrix by the encoder;
[0121] Converting meteorological data into a corresponding second query matrix, a second key matrix, and a second value matrix;
[0122] Performing a dot product operation on the first query matrix and the first key matrix to obtain a first attention matrix; performing a weighted summation on the first value matrix based on the first attention matrix to generate a time series feature of power;
[0123] Performing a dot product operation on the first query matrix and the second key matrix to obtain a second attention matrix; or performing a dot product operation on the second query matrix and the first key matrix to obtain a second attention matrix;
[0124] Based on the second attention matrix, a weighted summation is performed on the second value matrix to generate a correlation feature between power and weather; wherein the second attention matrix includes: correlation scores between each historical power and wind direction, wind speed, temperature and humidity respectively.
[0125] Furthermore, generating a plurality of different target powers corresponding to the current moment according to the timing characteristics and the correlation characteristics includes:
[0126] By means of the decoder, capturing the local correlation between the timing features and the correlation features, and capturing the global correlation between the timing features and the correlation features;
[0127] According to the local correlation and the global correlation, a plurality of different target powers corresponding to the current moment are generated.
[0128] Illustratively, the encoder of the present invention is responsible for extracting key features from historical wind energy data and meteorological data. These features include the temporal characteristics of power (i.e., the pattern of power changes over time) and the correlation characteristics between power and meteorological factors (i.e., the relationship between power and meteorological factors such as wind direction, wind speed, temperature, and humidity). The encoder can also convert the input data into corresponding query matrices, key matrices, and value matrices, allowing the model to calculate the correlation scores between the input data, thereby capturing the inherent connections between the data.
[0129] The decoder is responsible for capturing local and global correlations between time series features and correlation features. Local correlation refers to power variations between adjacent time steps or under similar meteorological conditions, while global correlation encompasses the impact of a wider range of time and meteorological conditions on power. Based on these captured local and global correlations, the decoder generates several different target powers corresponding to the current moment. These target powers reflect the model's prediction of wind power under current meteorological conditions, providing a more accurate reference power for subsequent power control.
[0130] In a preferred embodiment, the encoder comprises: a sparse self-attention layer;
[0131] The first query matrix includes: a plurality of query vectors for representing historical moments; the first key matrix includes: a plurality of key vectors for representing historical power; the first attention matrix includes: a plurality of click pairs; each click pair corresponds to an attention weight;
[0132] The encoder performs a dot product operation on the first query matrix and the first key matrix to obtain the first attention matrix, specifically including:
[0133] Determining the divergence corresponding to each query vector based on the transformed probability distribution corresponding to each query vector through the sparse self-attention layer; wherein the divergence is used to represent the sparsity of the query vector;
[0134] Performing a dot product operation on the first query matrix and the first key matrix to generate an initial attention weight for each dot product pair; wherein the dot product pair is used to represent the power correlation between different historical moments;
[0135] Based on each divergence, the initial attention weight of each dot product pair is adjusted, and then a first attention matrix is generated according to each dot product pair and each adjusted attention weight.
[0136] It can be understood that the sparse self-attention layer can optimize the traditional self-attention mechanism by introducing sparsity. When processing long sequence data, the sparse self-attention layer can derive the divergence of each query vector based on the probability distribution of each query vector. Unlike the traditional self-attention mechanism, the probabilistic sparse self-attention layer selectively focuses on certain key-value pairs in a probabilistic manner. In the embodiment of the present invention, the sparsity of the query vector can be measured by the calculated divergence, so all key-value pairs do not need to be considered equally. In the embodiment of the present invention, it can be ensured that the key-value pairs most relevant to the query vector are used for subsequent calculations.
[0137] By introducing divergence to adjust the attention weights, the model can selectively focus on those key vectors that are most relevant to the current query vector, thereby reducing unnecessary calculations and lowering the computational complexity of the model.
[0138] The divergence reflects the sparsity of the query vector, that is, how many key vectors it has significant correlation with. By adjusting the attention weights, the model can more accurately capture the key information that has an important impact on the prediction results.
[0139] In a preferred embodiment, the decoder comprises: a multi-head self-attention layer and a full attention layer;
[0140] When capturing local correlation and global correlation through the decoder, the specific process is:
[0141] Through the multi-head self-attention layer, the temporal features and the correlation features are divided into a plurality of feature heads;
[0142] Calculate the self-attention distribution of each feature head, perform weighted summation on the self-attention distributions of each feature head, and output local correlation; wherein the local correlation is used to characterize the local feature vectors between the temporal features and the correlation features;
[0143] Generate corresponding attention distributions based on temporal features and correlation features through the full attention layer; generate global correlation based on the dependency between the attention distributions;
[0144] The global correlation is used to characterize the global feature vector between the time series features and the correlation features.
[0145] It can be understood that the multi-head self-attention layer can capture richer local correlation features by splitting the feature heads and independently calculating the self-attention distribution, thereby improving the expressiveness of the model. Since each feature head can independently calculate the self-attention distribution, the model is more robust to slight changes in the input data. Furthermore, the calculation of the multi-head self-attention layer in the embodiment of the present invention can be performed in parallel, thereby improving the computational efficiency of the model.
[0146] The full attention layer can capture the global correlation between temporal features and correlation features, which can help the model better understand the overall structure of the input data. Because the global correlation features contain the overall information of the input data, the model can more accurately capture the changing trends of the input data when making predictions.
[0147] In summary, through the processing of multi-head self-attention layer and full attention layer, the decoder can capture the local correlation and global correlation characteristics of the input data, thereby improving the expressiveness and prediction accuracy of the model.
[0148] For step S3, in a preferred embodiment, when the present invention controls the output power of each wind turbine in the wind farm based on accurately predicted different target powers, since the prediction of the target power is based on the current meteorological conditions and the historical power sequence, it means that the generation of the target power of the present invention is based on the correlation characteristics between power and meteorology, so that when the output power of each wind turbine in the wind farm is controlled according to the accurately predicted target power, it can match the current meteorological conditions, reduce the fluctuation of the wind farm output power, and further improve the safe and stable operation level of the power grid.
[0149] like Figure 2 As shown, based on the above-mentioned various wind farm power control method embodiments, the present invention provides corresponding device embodiments;
[0150] An embodiment of the present invention provides a power control device for a wind farm, comprising: a data acquisition module, a power prediction module, and a unit control module;
[0151] The data acquisition module is used to acquire historical wind energy data of the wind farm and meteorological data corresponding to the current moment; wherein the historical wind energy data includes several different historical moments; each historical moment corresponds to several different historical powers;
[0152] The power prediction module is configured to input the historical wind energy data and the meteorological data into a wind power prediction model, so that the wind power prediction model extracts time series characteristics of power and correlation characteristics between power and meteorological conditions based on the historical wind energy data and meteorological data, and generates a plurality of different target powers corresponding to the current moment based on the time series characteristics and correlation characteristics; wherein the time series characteristics are used to characterize the trend of power changes over time;
[0153] The unit control module is used to control the output power of each wind turbine in the wind farm according to different target powers;
[0154] The generation of the wind power prediction model includes:
[0155] The wind energy data samples and the meteorological sample data corresponding to the wind energy data samples are used as training samples; wherein each moment in the wind energy data samples corresponds to a number of different power samples;
[0156] Taking each training sample and the actual power corresponding to each training sample as input and the predicted power of each training sample as output, the wind power prediction model to be trained is iteratively trained until the model converges, thereby generating a trained wind power prediction model.
[0157] It should be noted that the device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, and may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art can understand and implement the present invention without paying any creative effort.
[0158] Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0159] Based on the above-mentioned various embodiments of the power control method for a wind farm, the present invention provides corresponding embodiments of terminal equipment.
[0160] An embodiment of the present invention provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a power control method for a wind farm described in any method embodiment of the present invention.
[0161] The terminal device may be a computing terminal device such as a desktop computer, a notebook computer, a palmtop computer, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0162] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.
[0163] The memory can be used to store the computer program, and the processor implements various functions of the terminal device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created based on the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device or other volatile solid-state storage device.
[0164] Based on the above-mentioned various embodiments of the power control method for a wind farm, the present invention provides corresponding embodiments of a storage medium.
[0165] An embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a wind farm power control method described in any method embodiment of the present invention.
[0166] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. The computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0167] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A power control method for a wind farm, characterized in that: include: Obtain historical wind energy data of the wind farm and meteorological data corresponding to the current moment; wherein the historical wind energy data includes a plurality of different historical moments; each historical moment corresponds to a plurality of different historical powers; each of the historical powers corresponds to a power value or a preset value; the historical power corresponding to a preset value is marked as a target historical power with a missing power value; Inputting the historical wind energy data and the meteorological data into a wind power prediction model, so that the wind power prediction model extracts time series characteristics of power and correlation characteristics between power and meteorological conditions based on the historical wind energy data and meteorological data, and generates a plurality of different target powers corresponding to the current moment based on the time series characteristics and correlation characteristics; wherein the time series characteristics are used to characterize the trend of power changes over time; Control the output power of each wind turbine in the wind farm according to different target powers; Inputting the historical wind energy data and the meteorological data into a wind power prediction model includes: When it is determined that the historical wind energy data does not have a target historical power with a missing power value, directly inputting the historical wind energy data and the meteorological data into a wind power prediction model; When determining that the target historical power has several power values missing from the historical wind energy data, generating a raw tensor having multiple dimensions based on the historical wind energy data; wherein the historical moments correspond to multiple different dimensions in the raw tensor; and the historical power corresponds to one dimension in the raw tensor; Decomposing the original tensor using a tensor decomposition algorithm to generate an initial core tensor and several initial factor matrices; wherein the initial core tensor and the several initial factor matrices do not have preset values; the number of dimensions of the core tensor is the same as the number of dimensions of the original tensor; different factor matrices correspond to ranks corresponding to different dimensions in the original tensor; Generate an initial reconstruction tensor based on the initial kernel tensor and several initial factor matrices; Repeat the reconstruction tensor update operation until it is determined that the current reconstruction error is not greater than the preset error threshold, and then output the current reconstruction tensor as the final reconstruction tensor; Generate completed historical wind energy data based on the final reconstructed tensor; Inputting the meteorological data and the completed historical wind energy data into a wind power prediction model; The reconstructed tensor update operation includes: Get the current reconstruction tensor; where the initial current reconstruction tensor is the initial reconstruction tensor; Determining a current reconstruction error based on a deviation value between the current reconstructed tensor and the original tensor; When it is determined that the current reconstruction error is greater than a preset error threshold, a current gradient vector corresponding to the current reconstructed tensor is calculated based on the current reconstruction error; wherein the current gradient vector is used to indicate the direction in which the current reconstruction error decreases fastest; According to the preset learning rate, the current gradient vector and the current reconstruction tensor, the value of the core tensor and the value of each factor matrix in the current reconstruction tensor are updated to generate an updated reconstruction tensor; The updated reconstructed tensor is used as the current reconstructed tensor for the next reconstructed tensor update operation.
2. A wind farm power control method according to claim 1, characterized in that: The determining of a current reconstruction error according to a deviation between the current reconstructed tensor and the original tensor includes: The current reconstruction error is calculated according to the following formula: ; ; in, is the current reconstruction error, Represents the target tensor formed after removing the preset value from the original tensor and retaining the power value in the original tensor. is the set corresponding to the power values of different dimensions in the original tensor, Reconstruct the current tensor; is the core tensor, 、 、 are the factor matrices corresponding to different dimensions.
3. A wind farm power control method according to claim 2, characterized in that: The wind power prediction model includes: an encoder; the meteorological data includes: wind direction, wind speed, temperature and humidity; The wind power prediction model extracts the time series characteristics of power and the correlation characteristics between power and weather based on historical wind energy data and meteorological data, including: Converting the historical wind energy data into a corresponding first query matrix, a first key matrix, and a first value matrix by the encoder; Converting meteorological data into a corresponding second query matrix, a second key matrix, and a second value matrix; Performing a dot product operation on the first query matrix and the first key matrix to obtain a first attention matrix; performing a weighted summation on the first value matrix based on the first attention matrix to generate a time series feature of power; Performing a dot product operation on the first query matrix and the second key matrix to obtain a second attention matrix; or performing a dot product operation on the second query matrix and the first key matrix to obtain a second attention matrix; Based on the second attention matrix, a weighted summation is performed on the second value matrix to generate a correlation feature between power and weather; wherein the second attention matrix includes: correlation scores between each historical power and wind direction, wind speed, temperature and humidity respectively.
4. A wind farm power control method according to claim 3, characterized in that: The encoder comprises: a sparse self-attention layer; a first query matrix comprising a plurality of query vectors for representing historical moments; a first bond matrix comprising a plurality of bond vectors for representing historical power; a first attention matrix comprising a plurality of click pairs; each click pair corresponding to an attention weight; The step of performing a dot product operation on the first query matrix and the first key matrix to obtain a first attention matrix includes: Determining the divergence corresponding to each query vector based on the transformed probability distribution corresponding to each query vector through the sparse self-attention layer; wherein the divergence is used to represent the sparsity of the query vector; Performing a dot product operation on the first query matrix and the first key matrix to generate an initial attention weight for each dot product pair; wherein the dot product pair is used to represent the power correlation between different historical moments; Based on each divergence, the initial attention weight of each dot product pair is adjusted, and then a first attention matrix is generated according to each dot product pair and each adjusted attention weight.
5. A wind farm power control method according to claim 4, characterized in that: The wind power prediction model includes: a decoder; The generating of a plurality of different target powers corresponding to the current moment according to the timing characteristics and the correlation characteristics includes: By means of the decoder, capturing the local correlation between the timing features and the correlation features, and capturing the global correlation between the timing features and the correlation features; According to the local correlation and the global correlation, a plurality of different target powers corresponding to the current moment are generated.
6. A wind farm power control method according to claim 5, characterized in that: The decoder includes: a multi-head self-attention layer and a full attention layer; The capturing, by the decoder, the local correlation between the timing features and the correlation features, and the capturing the global correlation between the timing features and the correlation features, includes: The time series features and the correlation features are divided into a plurality of feature heads through the multi-head self-attention layer; the self-attention distribution of each feature head is calculated, the self-attention distributions of each feature head are weighted summed, and local correlation is output; wherein the local correlation is used to characterize the local feature vector between the time series features and the correlation features; Through the full attention layer, corresponding attention distributions are generated according to the temporal features and the correlation features respectively; global correlation is generated according to the dependency between each attention distribution; wherein the global correlation is used to characterize the global feature vector between the temporal features and the correlation features.
7. A power control device for a wind farm, characterized in that: include: Data acquisition module, power prediction module and unit control module; The data acquisition module is configured to acquire historical wind energy data of the wind farm and meteorological data corresponding to the current moment; wherein the historical wind energy data includes a plurality of different historical moments; each historical moment corresponds to a plurality of different historical powers; each of the historical powers corresponds to a power value or a preset value; the historical power corresponding to a preset value is marked as a target historical power with a missing power value; The power prediction module is configured to input the historical wind energy data and the meteorological data into a wind power prediction model, so that the wind power prediction model extracts time series characteristics of power and correlation characteristics between power and meteorological conditions based on the historical wind energy data and meteorological data, and generates a plurality of different target powers corresponding to the current moment based on the time series characteristics and correlation characteristics; wherein the time series characteristics are used to characterize the trend of power changes over time; Inputting the historical wind energy data and the meteorological data into a wind power prediction model includes: When it is determined that the historical wind energy data does not have a target historical power with a missing power value, directly inputting the historical wind energy data and the meteorological data into a wind power prediction model; When determining that the target historical power has several power values missing from the historical wind energy data, generating a raw tensor having multiple dimensions based on the historical wind energy data; wherein the historical moments correspond to multiple different dimensions in the raw tensor; and the historical power corresponds to one dimension in the raw tensor; Decomposing the original tensor using a tensor decomposition algorithm to generate an initial core tensor and several initial factor matrices; wherein the initial core tensor and the several initial factor matrices do not have preset values; the number of dimensions of the core tensor is the same as the number of dimensions of the original tensor; different factor matrices correspond to ranks corresponding to different dimensions in the original tensor; Generate an initial reconstruction tensor based on the initial kernel tensor and several initial factor matrices; Repeat the reconstruction tensor update operation until it is determined that the current reconstruction error is not greater than the preset error threshold, and then output the current reconstruction tensor as the final reconstruction tensor; Generate completed historical wind energy data based on the final reconstructed tensor; Inputting the meteorological data and the completed historical wind energy data into a wind power prediction model; The reconstructed tensor update operation includes: Get the current reconstruction tensor; where the initial current reconstruction tensor is the initial reconstruction tensor; Determining a current reconstruction error based on a deviation value between the current reconstructed tensor and the original tensor; When it is determined that the current reconstruction error is greater than a preset error threshold, a current gradient vector corresponding to the current reconstructed tensor is calculated based on the current reconstruction error; wherein the current gradient vector is used to indicate the direction in which the current reconstruction error decreases fastest; According to the preset learning rate, the current gradient vector and the current reconstruction tensor, the value of the core tensor and the value of each factor matrix in the current reconstruction tensor are updated to generate an updated reconstruction tensor; The updated reconstructed tensor is used as the current reconstructed tensor for the next reconstructed tensor update operation; The unit control module is used to control the output power of each wind turbine in the wind farm according to different target powers.
8. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for controlling power of a wind farm according to any one of claims 1 to 6 is implemented.
9. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute the power control method for a wind farm according to any one of claims 1 to 6.