A short-term wind power prediction method, device and storage medium
By combining a hybrid model with time series decomposition and self-attention LSTM network, the problems of complex modeling and low accuracy in wind power forecasting are solved, and efficient and accurate short-term wind power forecasting is achieved.
Patent Information
- Application Number
- CN202411794812.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-12-09
AI Technical Summary
In the existing technology, wind power prediction methods have the problems of complex modeling, high cost, insufficient data leading to large local deviations, and artificial intelligence models having difficulty processing dynamically changing long sequence data, resulting in low accuracy.
A hybrid model is adopted to obtain the initial sample data for preprocessing and feature separation, and the time series decomposition method is used to decompose the data into trend terms and periodic terms. The hybrid model of long short-term memory network and self-attention mechanism is combined for training to construct a short-term wind power prediction model.
It improves the accuracy of wind power forecasting, reduces costs, can effectively process dynamically changing long sequence data, and simplifies model development and maintenance.
Smart Images

Figure CN119921297B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power engineering, and in particular to a short-term wind power prediction method, device and storage medium. Background Art
[0002] As a sustainable, clean energy source, wind power is increasingly connected to the grid. However, wind power output is highly random and volatile. The disorderly connection of large-scale wind turbines to the grid could exacerbate the imbalance between power generation and consumption. Therefore, wind power forecasting is necessary. Short-term power forecasts can be used to adjust the generator mix to balance power generation and consumption. Traditional wind power forecasting uses physical models, but these methods are complex and costly. Statistical models suffer from insufficient data and excessive local deviations due to the non-stationary and nonlinear characteristics of wind power data. Artificial intelligence models struggle to process long, dynamically changing sequences of data and suffer from low accuracy.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0004] The embodiments of the present invention provide a short-term wind power prediction method, device, and storage medium, which effectively improve accuracy and reduce costs.
[0005] In one aspect, an embodiment of the present invention provides a short-term wind power forecasting method, comprising the following steps:
[0006] Acquiring initial sample data, the initial sample data including numerical weather forecast data and historical wind power data, the numerical weather forecast data including wind speed, wind direction, temperature or air pressure, and the historical wind power data including wind farm power generation;
[0007] Preprocessing the initial sample data to obtain target sample data;
[0008] Performing feature separation processing on the target sample data to obtain a target trend item and a target period item;
[0009] Inputting the target trend item and the target period item into a preset hybrid model so as to train the preset hybrid model and obtain an initial short-term wind power prediction model;
[0010] Evaluating the initial short-term wind power forecast model to obtain a target short-term wind power forecast model;
[0011] Wind power forecasting is performed according to the target short-term wind power forecasting model.
[0012] In some embodiments, preprocessing the initial sample data to obtain target sample data includes:
[0013] Performing sequence splicing processing on the initial sample data to obtain sequence splicing data;
[0014] The sequence splicing data is normalized to obtain the target sample data.
[0015] In some embodiments, performing feature separation processing on the target sample data to obtain a target trend item and a target period item includes:
[0016] Decomposing the target sample data using a time series decomposition method according to an additive model to obtain the target trend term, the initial cycle term, and the residual term;
[0017] The initial periodic term and the residual term are combined to obtain the target periodic term.
[0018] In some embodiments, the decomposition of the target sample data using a time series decomposition method to obtain the target trend term, the initial cycle term, and the residual term includes:
[0019] Converting the target sample data to obtain an original time series;
[0020] Initialize the initial trend item;
[0021] Subtracting the original time series from the initial trend term to obtain a difference;
[0022] generating a subsequence according to the plurality of difference components;
[0023] Fitting the subsequence using a loss regression method according to a smoothing parameter;
[0024] sorting the fitted subsequences in time to obtain regression results;
[0025] Performing a sliding average on the regression results;
[0026] Using the loss regression method to fit the regression results after sliding average to obtain a trend component;
[0027] generating the initial period term according to the regression result and the trend component;
[0028] Subtracting the original time series from the initial periodic term to obtain a non-periodic component;
[0029] Fitting the non-periodic component using the loss regression method to obtain the target trend item;
[0030] If the initial period term and the target trend term meet a preset convergence condition, the residual term is obtained.
[0031] In some embodiments, the process of constructing the preset hybrid model includes:
[0032] Constructing a trend feature sequence prediction network, wherein the trend feature sequence prediction network includes a fully connected layer and a multi-head attention layer, and the trend feature sequence prediction network is used to extract features of the target trend item to obtain a trend feature sequence;
[0033] Constructing a periodic feature sequence prediction network, the periodic feature sequence prediction network including a long short-term memory network, the multi-head attention layer and a preset activation function, the periodic feature sequence prediction network is used to extract features of the target periodic item to obtain a periodic feature sequence;
[0034] After the trend feature sequence prediction network and the period feature sequence prediction network, a sequence splicing layer is constructed, wherein the sequence splicing layer is used to splice the trend feature sequence and the period feature sequence to obtain a spliced feature sequence;
[0035] After the sequence splicing layer, a prediction sequence merging network is constructed. The prediction sequence merging network includes a fully connected layer. The prediction sequence merging network is used to output a wind power prediction result according to the splicing feature sequence.
[0036] In some embodiments, the process of constructing the long short-term memory network includes:
[0037] Construct the input layer;
[0038] After the input layer, a hidden layer is constructed, wherein the number of neuron units in the hidden layer is 16, and the neuron unit includes a forget gate, an input gate, and an output gate;
[0039] After the hidden layer, a stacked layer is constructed;
[0040] After the stacking layer, a self-attention layer is constructed;
[0041] After the self-attention layer, the output layer is constructed.
[0042] In some embodiments, evaluating the initial short-term wind power prediction model to obtain a target short-term wind power prediction model includes:
[0043] Calculate the forecast accuracy based on available power, forecast power, wind farm installed capacity for the month, and day-ahead statistical coefficients;
[0044] If the prediction accuracy is greater than a preset threshold, the initial short-term wind power prediction model is used as the target short-term wind power prediction model; otherwise, the initial short-term wind power prediction model is retrained.
[0045] In another aspect, an embodiment of the present invention provides a short-term wind power prediction device, comprising:
[0046] A first module is configured to obtain initial sample data, wherein the initial sample data includes numerical weather forecast data and historical wind power data, wherein the numerical weather forecast data includes wind speed, wind direction, temperature or air pressure, and the historical wind power data includes wind farm power generation;
[0047] The second module is used to preprocess the initial sample data to obtain target sample data;
[0048] The third module is used to perform feature separation processing on the target sample data to obtain a target trend item and a target period item;
[0049] A fourth module is configured to input the target trend item and the target period item into a preset hybrid model so as to train the preset hybrid model and obtain an initial short-term wind power prediction model;
[0050] A fifth module is configured to evaluate the initial short-term wind power forecast model to obtain a target short-term wind power forecast model;
[0051] The sixth module is used to perform wind power forecasting according to the target short-term wind power forecasting model.
[0052] In another aspect, an embodiment of the present invention provides a computer device, comprising:
[0053] at least one processor;
[0054] at least one memory for storing at least one program;
[0055] When the at least one program is executed by the at least one processor, the at least one processor implements the method.
[0056] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0057] The beneficial effects of the present invention are as follows:
[0058] The embodiment of the present invention first obtains initial sample data, preprocesses the initial sample data to obtain target sample data, then performs feature separation processing on the target sample data to obtain target trend items and target cycle items, inputs the target trend items and target cycle items into a preset hybrid model to train the preset hybrid model to obtain an initial short-term wind power prediction model, then evaluates the initial short-term wind power prediction model to obtain a target short-term wind power prediction model, and finally performs wind power prediction based on the target short-term wind power prediction model, so that the prediction model can be trained through the separated feature sequence to achieve short-term wind power prediction, thereby improving accuracy and reducing costs.
[0059] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the structures particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0061] Figure 1 This is a flow chart of a short-term wind power prediction method according to an embodiment of the present invention;
[0062] Figure 2 A schematic diagram of the inner loop process of an STL time series decomposition algorithm according to an embodiment of the present invention;
[0063] Figure 3 A schematic diagram of a preset hybrid model structure according to an embodiment of the present invention;
[0064] Figure 4 A schematic diagram of an LSTM network architecture with a self-attention mechanism according to an embodiment of the present invention;
[0065] Figure 5 A schematic diagram of a short-term wind power prediction process based on time series decomposition and time attention LSTM network according to an embodiment of the present invention;
[0066] Figure 6 This is a schematic structural diagram of a short-term wind power prediction device according to an embodiment of the present invention;
[0067] Figure 7 The figure is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0069] It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0070] The terms "at least one", "plurality", "each", "any", etc. used in this application include "at least one", "two" or more, "plurality" or "each", "any" or "any one", "each" or "any one" as used herein.
[0071] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0072] Before explaining the embodiments of the present application in detail, some of the nouns and terms involved in the embodiments of the present application are first explained. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0073] Long Short-Term Memory (LSTM) is a type of recurrent neural network designed to address the long-term dependency issues inherent in typical RNNs (recurrent neural networks). All RNNs have a chain-like structure of repeating neural network modules. In standard RNNs, this repeating module has a very simple structure.
[0074] Wind power, as a sustainable, clean energy source, is increasingly connected to the grid and becoming a key green energy source. However, due to the uncertainties of various internal and external environmental conditions, such as weather, terrain, and wind turbines themselves, wind power output is highly random and volatile. The unordered connection of large-scale wind turbines to the grid could exacerbate the imbalance between power generation and demand. Therefore, the utilization of wind energy resources requires highly accurate predictions of wind power generation. The primary goal of wind power prediction is to improve model prediction accuracy and continuously optimize model performance. Based on the time scale of the prediction, wind power prediction currently includes ultra-short-term, short-term, and medium- to long-term predictions. Short-term power predictions can serve as a reference for adjusting wind turbine unit combinations, optimizing the power generation plans of each generator within a specific timeframe, and improving power consumption capacity, thus holding significant research value. Currently, the main models used for short-term prediction include physical models, statistical models, artificial intelligence models, and combined models combining these models. Common physical models primarily predict wind power based on complex functional relationships and physical meanings, but this approach is complex and costly, making it rarely used in practice. Statistical models are relatively simple to implement, but due to the non-stationary and nonlinear characteristics of wind power data, statistical methods often suffer from excessive local deviations due to insufficient data. Artificial intelligence models can better fit the nonlinear relationship between power generation and other environmental factors, but a single model alone is difficult to process dynamically changing long series of data. Therefore, a combination of long-short-term memory neural networks (LSTMs) and other models can be used in wind power forecasting models.
[0075] In light of this, this embodiment uses local numerical weather forecast (NWP) data and historical wind power data as input, and outputs a power time series predicted by a neural network. The model is evaluated by comparing its accuracy with the actual series. Compared to single neural network, physical modeling, statistical modeling, and other methods, this embodiment has the advantages of fast model updates, low manual intervention, and more accurate predictions. This embodiment can solve the problem of low wind power prediction accuracy in existing technologies, which is caused by complex single model modeling and low raw data quality.
[0076] A short-term wind power prediction method provided in an embodiment of the present application relates to the field of electric power engineering technology. A short-term wind power prediction method provided in an embodiment of the present application can be applied to a terminal, can be applied to a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited thereto; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements a short-term wind power prediction method, etc., but is not limited to the above forms.
[0077] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0078] The following is a detailed explanation of the embodiments of the present application with reference to the accompanying drawings:
[0079] Figure 1 This is an optional flow chart of a short-term wind power prediction method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0080] Step S101: Acquire initial sample data, the initial sample data including numerical weather forecast data and historical wind power data, the numerical weather forecast data including wind speed, wind direction, temperature or air pressure, and the historical wind power data including wind farm power generation;
[0081] Step S102: pre-process the initial sample data to obtain target sample data;
[0082] Step S103: performing feature separation processing on the target sample data to obtain a target trend item and a target period item;
[0083] Step S104: inputting the target trend item and the target period item into a preset hybrid model so as to train the preset hybrid model and obtain an initial short-term wind power prediction model;
[0084] Step S105: Evaluate the initial short-term wind power prediction model to obtain a target short-term wind power prediction model;
[0085] Step S106: Perform wind power forecasting according to the target short-term wind power forecasting model.
[0086] Steps S101 to S106 shown in the embodiment of the present application implement short-term wind power forecasting, improve accuracy, and reduce costs.
[0087] In some embodiments, in step S101, initial sample data can be obtained from a power grid database. Initial sample data can also be obtained through other methods, without limitation. The initial sample data can include numerical weather forecast (NWP) data and historical wind power data. The NWP data can include wind speed, wind direction, temperature, or air pressure, and the historical wind power data can include wind farm power generation. It is understood that the initial sample data are arranged in chronological order and correspond to each other, meeting the basic requirements of a time series. In this embodiment, the time series can be an NWP data series or a wind farm power generation series. Furthermore, the initial sample data can be divided into a monthly dataset, with the monthly historical data for each wind turbine serving as a complete m-row, n-column feature matrix. Here, m is the length of the monthly historical data for a single wind turbine, and n is the number of features. The dataset is divided into a training set, a test set, and a validation set using a time scale of 7:2:1. Subsequently, a pre-set hybrid model can be trained based on these datasets, and through continuous iterative optimization, it can achieve high-quality short-term wind power forecasting.
[0088] In some embodiments, in step S102, preprocessing the initial sample data to obtain target sample data may include but is not limited to the following steps:
[0089] Perform sequence splicing processing on the initial sample data to obtain sequence splicing data;
[0090] The sequence splicing data is normalized to obtain the target sample data.
[0091] In some embodiments, the initial sample data is a long sequence of n m rows and single columns before preprocessing, where n is the number of features, i.e., NWP features such as wind speed, wind direction, temperature or air pressure, and m is the number of time points in the sequence. The initial sample data can be first subjected to sequence splicing processing to obtain sequence splicing data. Exemplarily, the long sequence (i.e., the initial sample data) can be spliced by column and an index can be created to meet the input requirements of the composite prediction network. After splicing by column, the initial sample data becomes a feature matrix of m rows and n columns with an index value of n, which determines the dimension of the LSTM and linear layer input matrices. The sequence splicing data is then normalized to obtain the target sample data. Exemplarily, maximum-minimum normalization can be used, that is, the data is scaled according to the maximum and minimum values. The normalization calculation formula is: Where X′ is the normalized value, X is the current value, and X max is the maximum value in the sequence, X min is the minimum value in the sequence. Furthermore, historical wind power data can be normalized according to the installed capacity of the current wind turbines.
[0092] In some embodiments, in step S103, feature separation processing is performed on the target sample data to obtain target trend items and target period items, which may include but is not limited to the following steps:
[0093] Step S201: Decompose the target sample data using the time series decomposition method according to the additive model to obtain the target trend term, the initial cycle term, and the residual term;
[0094] Step S202: Merge the initial periodic term and the residual term to obtain a target periodic term.
[0095] In some embodiments, the target sample data can be first decomposed using the time series decomposition method according to the additive model to obtain the target trend term, the initial period term and the residual term, and then the initial period term and the residual term are combined to obtain the target period term. It can be understood that the time series decomposition algorithm (Seasonal-Trend decomposition procedure based on Loess, STL) follows the additive model, which belongs to the time series decomposition model. The mathematical expression of the additive model is: v =T v +S v +R v , where Y v is the original time series at the vth moment, T v is the trend term at the vth moment, S v is the periodic term at the vth moment, R vis the residual term at the vth moment. Moreover, the target trend term, initial period term, and residual term obtained after decomposition have the same sequence length.
[0096] In some embodiments, in step S201, the target sample data is decomposed using a time series decomposition method to obtain a target trend term, an initial cycle term, and a residual term, which may include but is not limited to the following steps:
[0097] Transform the target sample data to obtain the original time series;
[0098] Initialize the initial trend item;
[0099] Subtract the original time series from the initial trend term to obtain the difference;
[0100] Generate a subsequence based on multiple difference components;
[0101] According to the smoothing parameter, the subsequence is fitted using the loss regression method;
[0102] Sort the multiple subsequences after fitting by time to obtain the regression results;
[0103] Perform sliding average on the regression results;
[0104] The regression results after sliding average are fitted using loss regression method to obtain the trend component;
[0105] Generate initial periodic terms based on regression results and trend components;
[0106] Subtract the original time series from the initial periodic term to obtain the non-periodic component;
[0107] The loss regression method is used to fit the non-periodic component to obtain the target trend term;
[0108] If the initial period term and the target trend term meet the preset convergence conditions, the residual term is obtained.
[0109] In some embodiments, the STL algorithm can be used for decomposition. The inner loop of the STL algorithm is responsible for trend fitting and periodic term calculation, and the outer loop is used to adjust the weights to handle outliers in the data. By adjusting parameters such as the seasonal period, the length of the seasonal smoother, and the length of the trend smoother, the time series features can be separated as much as possible. The inner loop process of the STL time series decomposition algorithm is as follows: Figure 2 As shown, its purpose is to separate the trend term and the cycle term. The target sample data can be converted to obtain the original time series, and the initial trend term can be initialized. The original time series and the initial trend term are subtracted to obtain the difference. For example, when the number of cycles is greater than 1, the original time series Y v , minus the trend term T of the previous round of resultsv If this is the first cycle, the initial trend term T can be subtracted v , whose value is 0. Then, based on multiple difference components, a subsequence is generated. For example, the sample points at different times in the same period can be gathered together to form a subsequence. p , 1+2n p} etc. form a subsequence, {2, 2+n p , 2+2n p} etc. form another subsequence. The algorithm cycle can be set to n p , then there are n p Then, according to the smoothing parameter, the subsequences are fitted using the loss regression method, and the multiple subsequences after fitting are sorted by time to obtain the regression results. For example, each subsequence can be fitted using LOESS regression (loss regression), and each subsequence is extended forward and backward by a value. Then these n p The fitted time series are arranged in chronological order and recorded as Represents the regression result of the k+1th cycle, its total length is N+2n p Among them, the smoothing parameter n of LOESS is s Used for weighted moving average.
[0110] Then, the regression results are subjected to sliding average, and the regression results after sliding average are fitted using the loss regression method to obtain the trend component. Do 3 sliding averages of different lengths. Then use LOESS regression to fit the sequence Its length is N. Among them, the smoothing parameter n of LOESS l For separating the trend component, we get Equivalent to Then, based on the regression results and trend components, the initial period term is generated. For example, it can be obtained from Separate the initial periodic term Subtract the original time series from the initial period term, that is, The non-periodic component is obtained. Then the loss regression method is used to fit the non-periodic component to obtain the target trend term, where the smoothing parameter n of the loss regression is t Used to fit the trend component. If the initial period term and the target trend term meet the preset convergence condition, the residual term is obtained. The expression of the preset convergence condition is: Where, is the trend term or period term of the k-th iteration, is the trend term or period term of the k+1th iteration. In addition, in programming implementation, according to debugging, the optimal parameter seasonal period n of the STL algorithm is set. p (period) is 6, the low-pass filter length is n l is 7, the length of the seasonal smoother n s is 7, the length of the trend smoother n t is 7.
[0111] In some embodiments, in step S104, the target trend item and the target cycle item can be input into a preset hybrid model to train the preset hybrid model and obtain an initial short-term wind power forecast model. For example, during model training, the configured training set and test set can be used, and the training parameters are first set. The training cycle (epoch) is set to 1000, the gradient optimization algorithm is the Adam algorithm, the learning rate (1r) is determined to be 0.01, and the loss function is selected as MSELoss. During the model loading process, the hybrid model can be loaded. If there is no pre-trained model, the pre-trained model loading is skipped. If the model update is selected, the previously trained model is loaded; otherwise, a new initial model (i.e., the preset hybrid model) is loaded. During the training process, the model continuously learns the relationship between NWP data, historical wind power data, and wind turbine output power during the forward propagation process. During the backward propagation process, the model iterates the weights to find the optimal parameters. When the model loss reaches a certain threshold of 1e-4 or the training epoch reaches 1000, the current round of training is terminated and testing begins. Subsequent test results reflect the effectiveness of the current round of training. If the requirements are met, the current model parameters are saved for subsequent use.
[0112] In some embodiments, in step S104, the process of constructing the preset hybrid model includes:
[0113] Construct a trend feature sequence prediction network, which includes a fully connected layer and a multi-head attention layer. The trend feature sequence prediction network is used to extract features of the target trend item and obtain a trend feature sequence.
[0114] Construct a periodic feature sequence prediction network, which includes a long short-term memory network, a multi-head attention layer, and a preset activation function. The periodic feature sequence prediction network is used to extract features of the target periodic item and obtain a periodic feature sequence.
[0115] After the trend feature sequence prediction network and the period feature sequence prediction network, a sequence splicing layer is constructed. The sequence splicing layer is used to splice the trend feature sequence and the period feature sequence to obtain a spliced feature sequence.
[0116] After the sequence splicing layer, a prediction sequence merging network is constructed. The prediction sequence merging network includes a fully connected layer. The prediction sequence merging network is used to output wind power prediction results based on the spliced feature sequence.
[0117] In some embodiments, the preset hybrid model structure is as follows Figure 3 As shown in the figure, after feature separation to obtain the target trend item and target period item, a trend feature sequence prediction network can be constructed. This network includes a fully connected layer (Linear) and a multi-head attention layer (Attention). This network can be used to extract features from the target trend item, generating a trend feature sequence, effectively exploring similarities between power generation and the environment in long-term trends. A period feature sequence prediction network is then constructed. This network includes a long short-term memory (LSTM) network, a multi-head attention layer (Attention), and a preset activation function (sigmoid). This network can be used to extract features from the target period item, generating a period feature sequence. Furthermore, self-attention weight allocation optimization can be incorporated into the LSTM network to mine attention features at the temporal level, effectively processing short-term dynamic changes. The fully connected layer then outputs the period feature sequence prediction results. Following the trend feature sequence prediction network and the period feature sequence prediction network, a sequence concatenation layer can be constructed. This concatenation layer concatenates the trend feature sequence and the period feature sequence to generate a concatenated feature sequence. After the sequence concatenation layer, a prediction sequence merging network can be constructed, wherein the prediction sequence merging network includes a fully connected layer (Linear), and the wind power prediction result can be output through the prediction sequence merging network based on the concatenated feature sequence. It can be understood that the length of the concatenated feature sequence is the sum of the time lengths of the trend feature sequence and the period feature sequence, and the output length is the time length of the predicted power sequence. Furthermore, the trend feature sequence has a high correlation with the historical wind power output power, and feature extraction is completed through the fully connected layer, Sigmoid activation function, and multi-head attention layer. Among them, the fully connected layer needs to meet the input and output requirements, that is, the input feature input_size is the total number of features n; the output feature output_size is the number of hidden layers entering the attention layer, hidden_size is 16. After completing the prediction of the period feature sequence and the trend feature sequence, the sequence concatenation layer merges the predicted periodic power features and trend power features into a sequence with a length of 2*hidden_size, that is, 32. Finally, the fully connected layer of the network is merged through the prediction sequence, whose input feature input_size is 2*hidden_size; the output feature output_size is the actual predicted power sequence, which is 1.
[0118] In some embodiments, the process of constructing a long short-term memory network includes:
[0119] Construct the input layer;
[0120] After the input layer, a hidden layer is constructed. The number of neuron units in the hidden layer is 16, and the neuron units include a forget gate, an input gate, and an output gate.
[0121] After the hidden layer, build the stacked layer;
[0122] After stacking the layers, build the self-attention layer;
[0123] After the self-attention layer, the output layer is constructed.
[0124] In some embodiments, the LSTM network adds self-attention weight distribution optimization, mines attention features at the time level, effectively processes short-term dynamic change features, and outputs periodic feature sequence prediction results through the fully connected layer. Figure 4 As shown, we can first construct the input layer, setting the number of features to n, that is, the number of columns in the input sequence x to n. After the input layer, we construct the hidden layer. The hidden layer contains 16 neuron units A, each of which includes a forget gate, an input gate, and an output gate. Furthermore, each LSTM neuron unit A consists of a forget gate (forget), an input gate (input), and an output gate (output), which contain the cell state (cell) and the hidden state (hidden). The forget gate determines how much output information from the previous moment should be discarded. The input gate determines which input information at the current moment is useful and how much to retain. The output gate combines information from the current moment with information from past moments to determine what information to output. The cell state stores useful information at each moment. The hidden state is the input to the next moment. These variables interact through the sigmoid function (σ), the tanh function, and other calculations, resulting in the LSTM unit outputting the hidden state h.
[0125] After the hidden layer, a stacking layer is constructed with a number of layers (num_layers) of 4. This means that the input sequence x is passed through the LSTM and calculated once to obtain the hidden state h. After this stacking layer, a self-attention layer (Attention) is constructed, and the output layer is constructed. For example, the hidden state h is passed through the LSTM and calculated three times in a loop, ultimately producing the output periodic feature sequence y. The output layer size (output_size) is 1, meaning that the number of features in the output periodic feature sequence y is 1, corresponding to the LSTM predicted power sequence. It can be understood that the Attention layer is placed within the last output feature layer of the LSTM. The final time-series output vector is used to form a self-attention function consisting of the feature vectors query, key, and value. Softmax weight normalization is then performed, and the weighted sum of the weights and the corresponding value vector is then performed to obtain the new time-series output vector. Because the mechanism operates on a temporal scale, it is called a temporal attention layer. To maintain scale consistency, the hidden layer size (hidden_dim) of the attention layer feature vector is equal to the number of hidden layers in the LSTM network (hidden_size), which is 16. Alternatively, the multi-head attention can be set to 2. The output periodic feature sequence y is input to the attention layer to calculate the result. Finally, the periodic feature sequence is trained once through the Sigmoid activation function.
[0126] In some embodiments, in step S105, evaluating the initial short-term wind power prediction model to obtain a target short-term wind power prediction model may include but is not limited to the following steps:
[0127] Calculate the forecast accuracy based on available power, forecast power, wind farm installed capacity for the month, and day-ahead statistical coefficients;
[0128] If the prediction accuracy is greater than a preset threshold, the initial short-term wind power prediction model is used as the target short-term wind power prediction model; otherwise, the initial short-term wind power prediction model is retrained.
[0129] In some embodiments, the short-term day-ahead power forecast results of the wind farm can be statistically analyzed on a daily basis and evaluated on a monthly basis. The forecast accuracy can be calculated based on the available power, the forecast power, the installed capacity of the wind farm for the month, and the day-ahead statistical coefficient. The calculation formula for the forecast accuracy is: Where ACC is the prediction accuracy, P Mi is the available power at time i, P Pi is the predicted power at time i, Cap is the installed capacity of the wind farm in that month, and n is the statistical coefficient of the day, which can be obtained based on the reporting interval of the wind turbine operation data. It can be understood that at the power restriction time P Mi is the available power at time i, when there is no power restriction, P Miis the actual power at time i. During power-limited periods, the available power is affected by output limitations and differs from the actual power output by the wind turbine. During periods of unlimited power, the actual power is the available power. If the prediction accuracy is greater than a preset threshold, the initial short-term wind power prediction model is used as the target short-term wind power prediction model; otherwise, the initial short-term wind power prediction model is retrained. For example, the prediction accuracy of the model output can be used to determine the results of this round of training. If the results do not meet the requirements, that is, the prediction accuracy is less than the preset threshold, the parameters can be adjusted and retrained until the model meets the requirements. The initial short-term wind power prediction model is then used as the target short-term wind power prediction model.
[0130] In some embodiments, in step S106, a wind power forecast may be performed based on the target short-term wind power forecast model. For example, the numerical weather forecast data to be identified and the historical wind power data to be identified may be input into the target short-term wind power forecast model to obtain a wind power forecast result for subsequent adjustment of the wind turbine group combination.
[0131] In some embodiments, the short-term wind power prediction process based on time series decomposition and time attention LSTM network is as follows: Figure 5 As shown in the figure, we can first construct the NWP dataset and the wind power historical dataset, and perform preprocessing, including feature matrix organization and normalization. Then, we can build a temporal attention LSTM hybrid model, train the model, and finally evaluate it to obtain the evaluation score. The model can then be used to predict the wind power prediction result.
[0132] In some embodiments, this embodiment adopts an LSTM network as the core, combines the self-attention mechanism, and is based on time series decomposition data preprocessing to construct an artificial intelligence combination model suitable for short-term wind power forecasting. The time series decomposition of this embodiment decomposes the input sequence into trend terms, periodic terms, and residual terms, which can reduce the difficulty of mining different features while keeping the total number of features unchanged. This embodiment combines the self-attention LSTM network to predict the periodic terms, which can preserve the coupling relationship between information and effectively process dynamically changing meteorological data and historical wind power data. At the same time, using the fully connected layer to predict the trend terms can extract the similarities between power generation and environment in long-term changes. Under the premise that the quality of the original wind power data is not high, this embodiment can still improve the model algorithm's ability to mine the features of historical time series data.
[0133] In some embodiments, this embodiment constructs a feature matrix by inputting NWP data and historical wind power data of wind turbines according to the time scale, and separates the features of different rules through a feature separation module based on time series decomposition. In the hybrid model, the LSTM with self-attention mechanism has high adaptability to the input periodic feature sequence, and the long-term trend of historical wind power data has high adaptability to the input trend feature sequence. The combination of the two can make up for the disadvantage of a single model that is difficult to dynamically change long sequence data. The hybrid model of this embodiment is based on the LSTM with self-attention mechanism. The model integrates the LSTM multi-head attention layer, the Sigmoid activation function and the single-layer fully connected layer. There is no need to train multiple models separately, which simplifies the difficulty of model development, deployment, maintenance and management, and saves the computing resources required for prediction. The prediction accuracy evaluation of the model in this embodiment uses the short-term power forecast results of the wind farm to be counted on a daily basis and assessed on a monthly basis. It meets the requirements of the power grid and has reference significance.
[0134] The beneficial effects of implementing the embodiments of the present invention include: the embodiments of the present invention first obtain initial sample data, preprocess the initial sample data to obtain target sample data, and then perform feature separation processing on the target sample data to obtain target trend items and target cycle items, and input the target trend items and target cycle items into a preset hybrid model to train the preset hybrid model to obtain an initial short-term wind power prediction model, and then evaluate the initial short-term wind power prediction model to obtain a target short-term wind power prediction model, and finally perform wind power prediction based on the target short-term wind power prediction model, so that the prediction model can be trained through the separated feature sequence to achieve short-term wind power prediction, thereby improving accuracy and reducing costs.
[0135] like Figure 6 As shown, an embodiment of the present invention further provides a short-term wind power prediction device, comprising:
[0136] The first module 801 is used to obtain initial sample data, which includes numerical weather forecast data and historical wind power data. The numerical weather forecast data includes wind speed, wind direction, temperature or air pressure, and the historical wind power data includes wind farm power generation;
[0137] The second module 802 is used to preprocess the initial sample data to obtain target sample data;
[0138] The third module 803 is used to perform feature separation processing on the target sample data to obtain a target trend item and a target period item;
[0139] The fourth module 804 is configured to input the target trend item and the target period item into a preset hybrid model so as to train the preset hybrid model and obtain an initial short-term wind power prediction model;
[0140] The fifth module 805 is used to evaluate the initial short-term wind power prediction model to obtain a target short-term wind power prediction model;
[0141] The sixth module 806 is configured to perform wind power forecasting according to the target short-term wind power forecasting model.
[0142] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0143] like Figure 7 As shown, an embodiment of the present invention further provides a computer device, including:
[0144] at least one processor 901;
[0145] At least one memory 902, configured to store at least one program;
[0146] When at least one program is executed by at least one processor, the at least one processor implements Figure 1 The method shown.
[0147] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0148] The embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program, which is executed by a processor to implement Figure 1 The method shown.
[0149] The contents of the above method embodiments are all applicable to the present storage medium embodiment. The functions specifically implemented by the present storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0150] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A short-term wind power prediction method, characterized in that: The following steps are involved: Acquiring initial sample data, the initial sample data including numerical weather forecast data and historical wind power data, the numerical weather forecast data including wind speed, wind direction, temperature or air pressure, and the historical wind power data including wind farm power generation; Preprocessing the initial sample data to obtain target sample data; Performing feature separation processing on the target sample data to obtain a target trend item and a target period item; Inputting the target trend item and the target period item into a preset hybrid model so as to train the preset hybrid model and obtain an initial short-term wind power prediction model; Evaluating the initial short-term wind power forecast model to obtain a target short-term wind power forecast model; Performing wind power forecasting according to the target short-term wind power forecasting model; The construction process of the preset hybrid model includes: Constructing a trend feature sequence prediction network, wherein the trend feature sequence prediction network includes a fully connected layer and a multi-head attention layer, and the trend feature sequence prediction network is used to extract features of the target trend item to obtain a trend feature sequence; Constructing a periodic feature sequence prediction network, the periodic feature sequence prediction network including a long short-term memory network, the multi-head attention layer and a preset activation function, the periodic feature sequence prediction network is used to extract features of the target periodic item to obtain a periodic feature sequence; After the trend feature sequence prediction network and the period feature sequence prediction network, a sequence splicing layer is constructed, wherein the sequence splicing layer is used to splice the trend feature sequence and the period feature sequence to obtain a spliced feature sequence; After the sequence splicing layer, a prediction sequence merging network is constructed, wherein the prediction sequence merging network includes a fully connected layer and is used to output a wind power prediction result based on the spliced feature sequence; The feature separation processing is performed on the target sample data to obtain a target trend item and a target period item, including: Decomposing the target sample data using a time series decomposition method according to an additive model to obtain the target trend term, the initial cycle term, and the residual term; The initial periodic term and the residual term are combined to obtain the target periodic term.
2. The method according to claim 1, characterized in that The preprocessing of the initial sample data to obtain target sample data includes: Performing sequence splicing processing on the initial sample data to obtain sequence splicing data; The sequence splicing data is normalized to obtain the target sample data.
3. The method according to claim 1, characterized in that The target sample data is decomposed by using a time series decomposition method to obtain the target trend term, the initial cycle term and the residual term, including: Converting the target sample data to obtain an original time series; Initialize the initial trend item; Subtracting the original time series from the initial trend term to obtain a difference; generating a subsequence according to the plurality of difference components; Fitting the subsequence using a loss regression method according to a smoothing parameter; sorting the fitted subsequences in time to obtain regression results; Performing a sliding average on the regression results; Using the loss regression method to fit the regression results after sliding average to obtain a trend component; generating the initial period term according to the regression result and the trend component; Subtracting the original time series from the initial periodic term to obtain a non-periodic component; Fitting the non-periodic component using the loss regression method to obtain the target trend item; If the initial period term and the target trend term meet a preset convergence condition, the residual term is obtained.
4. The method according to claim 1, wherein The construction process of the long short-term memory network includes: Construct the input layer; After the input layer, a hidden layer is constructed, wherein the number of neuron units in the hidden layer is 16, and the neuron unit includes a forget gate, an input gate, and an output gate; After the hidden layer, a stacked layer is constructed; After the stacking layer, a self-attention layer is constructed; After the self-attention layer, the output layer is constructed.
5. The method according to claim 1, wherein The evaluating the initial short-term wind power prediction model to obtain a target short-term wind power prediction model includes: Calculate the forecast accuracy based on available power, forecast power, wind farm installed capacity for the month, and day-ahead statistical coefficients; If the prediction accuracy is greater than a preset threshold, the initial short-term wind power prediction model is used as the target short-term wind power prediction model; otherwise, the initial short-term wind power prediction model is retrained.
6. A short-term wind power prediction device, characterized in that: include: A first module is configured to obtain initial sample data, wherein the initial sample data includes numerical weather forecast data and historical wind power data, wherein the numerical weather forecast data includes wind speed, wind direction, temperature or air pressure, and the historical wind power data includes wind farm power generation; The second module is used to preprocess the initial sample data to obtain target sample data; The third module is used to perform feature separation processing on the target sample data to obtain a target trend item and a target period item; A fourth module is configured to input the target trend item and the target period item into a preset hybrid model so as to train the preset hybrid model and obtain an initial short-term wind power prediction model; A fifth module is configured to evaluate the initial short-term wind power forecast model to obtain a target short-term wind power forecast model; A sixth module is used to perform wind power forecasting according to the target short-term wind power forecasting model; The construction process of the preset hybrid model includes: Constructing a trend feature sequence prediction network, wherein the trend feature sequence prediction network includes a fully connected layer and a multi-head attention layer, and the trend feature sequence prediction network is used to extract features of the target trend item to obtain a trend feature sequence; Constructing a periodic feature sequence prediction network, the periodic feature sequence prediction network including a long short-term memory network, the multi-head attention layer and a preset activation function, the periodic feature sequence prediction network is used to extract features of the target periodic item to obtain a periodic feature sequence; After the trend feature sequence prediction network and the period feature sequence prediction network, a sequence splicing layer is constructed, wherein the sequence splicing layer is used to splice the trend feature sequence and the period feature sequence to obtain a spliced feature sequence; After the sequence splicing layer, a prediction sequence merging network is constructed, wherein the prediction sequence merging network includes a fully connected layer and is used to output a wind power prediction result based on the spliced feature sequence; The third module is specifically used to: Decomposing the target sample data using a time series decomposition method according to an additive model to obtain the target trend term, the initial cycle term, and the residual term; The initial periodic term and the residual term are combined to obtain the target periodic term.
7. A computer device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.