Short-term wind power prediction method and device and storage medium
By preprocessing and feature separation of the initial sample data, combined with preset hybrid model training and evaluation, short-term wind power prediction is achieved, solving the problems of low accuracy and high cost in the prior art, improving the accuracy of prediction and reducing costs.
Patent Information
- Application Number
- CN202411794812.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The prior art has problems of low accuracy and high cost in short-term wind power prediction, especially when dealing with long-sequence data with dynamic changes, which makes it difficult for a single model to effectively predict.
By obtaining the initial sample data, including numerical weather forecast data and historical wind power data, preprocessing and feature separation, the target trend term and target period term are obtained, and then these characteristics are input into the preset hybrid model for training, an initial short-term wind power power prediction model is obtained, and the target short-term wind power power prediction model is obtained through evaluation, and the wind power power prediction model is finally carried out.
It improves the accuracy of short-term wind power power prediction, reduces costs, can effectively process dynamically changing long-sequence data, and improves prediction accuracy and economicality in the prior art.
Smart Images

Figure CN119921297A_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 and clean energy, the proportion of wind power generation and grid connection is increasing. However, wind power output is highly random and volatile. The disorderly access of large-scale wind turbines to the grid may lead to an increase in the imbalance between power generation and power consumption in the grid. It is necessary to predict wind power generation. The results of short-term power prediction can be used to adjust the combination of generators to balance power generation and power consumption. Traditional wind power prediction uses physical models, but the modeling is complex and costly; the use of statistical models will lead to insufficient data and excessive local deviations due to the non-stationary and nonlinear characteristics of wind power data; the use of artificial intelligence models is difficult to process dynamically changing long sequence data and has 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 the accuracy and reduce the cost.
[0005] In one aspect, an embodiment of the present invention provides a short-term wind power forecasting method, comprising the following steps:
[0006] Acquire 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;
[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 that the preset hybrid model is trained to obtain an initial short-term wind power prediction model;
[0010] Evaluating the initial short-term wind power prediction model to obtain a target short-term wind power prediction model;
[0011] Wind power forecasting is performed according to the target short-term wind power forecasting model.
[0012] In some embodiments, the preprocessing of 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, the performing feature separation processing on the target sample data to obtain a target trend item and a target period item includes:
[0016] According to the additive model, 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;
[0017] The initial periodic term and the residual term are combined to obtain the target periodic term.
[0018] In some embodiments, 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:
[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 component;
[0022] generating a subsequence according to the plurality of difference quantities;
[0023] According to the smoothing parameter, the subsequence is fitted using a loss regression method;
[0024] Time-sorting the plurality of subsequences after fitting to obtain regression results;
[0025] Performing a sliding average on the regression results;
[0026] Using the loss regression method to fit the regression result after sliding average, a trend component is obtained;
[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] Using the loss regression method to fit the non-periodic component, to obtain the target trend item;
[0030] If the initial period term and the target trend term meet the 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 comprising 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, and 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 concatenation 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 according to the concatenated 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, 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 stacked layers, 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 prediction accuracy based on available power, predicted power, wind farm installed capacity for the month and day-ahead statistical coefficient;
[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] On the other hand, an embodiment of the present invention provides a short-term wind power prediction device, comprising:
[0046] The first module is used 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 used to input the target trend item and the target period item into a preset hybrid model so that the preset hybrid model is trained to obtain an initial short-term wind power prediction model;
[0050] A fifth module is used to evaluate the initial short-term wind power prediction model to obtain a target short-term wind power prediction 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 described 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 so that the preset hybrid model is trained 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 partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by 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 drawings required for use in the description of the embodiments will be briefly introduced below. 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 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 an 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 diagram of the structure 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 in conjunction with 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 only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0069] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment 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 can be interpreted as "at the time of" or "when" or "in response to determination".
[0070] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0071] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0072] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0073] Long Short-Term Memory (LSTM): A time-recurrent neural network designed to solve the long-term dependency problem of general RNNs (recurrent neural networks). All RNNs have a chain form of repeated neural network modules. In standard RNNs, this repeated structural module has only a very simple structure.
[0074] In related technologies, wind energy, as a sustainable clean energy, has a growing proportion of grid-connected power generation and is gradually becoming one of the important green energy sources. However, due to the uncertainty of various internal and external environmental conditions such as weather, terrain, and wind turbines themselves, wind power output has strong randomness and volatility. The disorderly access of large-scale wind turbines to the grid may lead to an increase in the imbalance between power generation and power consumption in the grid. Therefore, the application of wind energy resources is inseparable from the high-precision prediction of wind power generation. The main goal of wind power prediction is to improve the accuracy of model prediction and continuously optimize model performance. According to the scale of prediction time, wind power prediction currently mainly includes ultra-short-term prediction, short-term prediction, and medium- and long-term prediction. The results of short-term power prediction can be used as a reference for adjusting the combination of wind turbine units; optimizing the power generation plan of each power generation unit within a certain period of time; and improving the absorption capacity, so it has important research value. At present, the modeling for short-term prediction mainly includes physical models, statistical models, artificial intelligence models, and combined models composed of these models. Common physical models mainly realize wind power forecasting based on complex functional relationships and physical meanings, but this method is complex to model, costly, and rarely used in practice; the implementation of statistical models is relatively simple, but due to the non-stationary and nonlinear characteristics of wind power data, statistical methods often cause the disadvantage of excessive local deviations due to insufficient data; artificial intelligence models can better fit the nonlinear relationship between power generation and other environmental factors, but it is difficult to process dynamically changing long sequence data with only a single model. Therefore, a combination of long short-term memory neural network (LSTM) and other models can be used in the wind power forecasting combined model.
[0075] In view of this, this embodiment uses local numerical weather forecast (NWP) data and historical wind power data as input, and uses the power time series predicted by the neural network as output, and evaluates the model by comparing the accuracy with the real series. Compared with single neural network, physical modeling, statistical modeling and other methods, this embodiment has the advantages of fast model update, low manual participation and more accurate prediction. This embodiment can solve the problem of low wind power prediction accuracy in the prior art due to complex single model modeling and low quality of original data.
[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 to this; the server side can be configured as an independent physical server, or can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured 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, etc. 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, etc. 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 through 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 in conjunction with the accompanying drawings:
[0079] Figure 1 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, obtaining 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: preprocess 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: input the target trend item and the target period item into a preset hybrid model so that the preset hybrid model is trained to obtain an initial short-term wind power prediction model;
[0084] Step S105, evaluating 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 realize short-term wind power prediction, improve accuracy and reduce cost.
[0087] In step S101 of some embodiments, the initial sample data can be obtained through the power grid database. The initial sample data can also be obtained by other means, not limited thereto. Among them, the initial sample data may include numerical weather forecast (NWP) data and historical wind power data, the numerical weather forecast data may include wind speed, wind direction, temperature or air pressure, and the historical wind power data may include wind farm power generation. It can be understood that the initial sample data are arranged in chronological order and correspond to each other, meeting the basic requirements of the time series. The time series in this embodiment may be a NWP data sequence or a wind farm power generation sequence. More, the initial sample data can be divided by month as a data set, with the monthly historical data of each wind turbine as a complete m-row n-column feature matrix. Among them, m is the length of the monthly historical data of a single wind turbine, and n is the number of features. The data set is divided into a training set, a test set, and a validation set according to the time scale of 7:2:1. Subsequently, a preset hybrid model can be trained based on these data sets, and through continuous iterative optimization, it can complete the short-term wind power prediction task with high quality.
[0088] In some embodiments, in step S102, the initial sample data is preprocessed to obtain target sample data, which may include but is not limited to the following steps:
[0089] Performing 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 a single column 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. Among them, the normalization calculation formula is: In the formula, 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, the 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 the 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. More importantly, the target trend term, initial cycle 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 according to multiple difference quantities;
[0101] According to the smoothing parameters, the subsequences are 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 the 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 weight to handle outliers in the data. By adjusting parameters such as the seasonal cycle, 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, the 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, a subsequence is generated based on multiple difference components. For example, 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} and so on to 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 in 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 one 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, and 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 moved averaged, and the regression results after moving 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: In the formula, is the trend term or period term of the kth iteration, is the trend term or period term of the k+1th iteration. More importantly, in programming implementation, according to debugging, the optimal parameter seasonal cycle 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 is n s is 7, the length of the trend smoother is 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 so that the preset hybrid model is trained to obtain an initial short-term wind power prediction model. Exemplarily, in model training, the configured training set and test set can be used, and the training parameters are set first. Set the training cycle (epoch) to 1000, the gradient optimization algorithm to the Adam algorithm, determine the learning rate (1r) to 0.01, and select MSELoss as the loss function. 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) will be loaded. During the training process, the model continuously learns the relationship between NWP data, historical wind power data and wind turbine power generation during the forward propagation process; during the back propagation process, the model will iterate the weights to find the optimal parameters. When the model loss (Loss) reaches a certain threshold of 1e-4 or the training round (epoch) reaches 1000, the current round of training will be stopped and the test will start. Subsequent test results reflect the effect of this 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 to 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 to 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, and 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 concatenation 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 concatenated feature sequence.
[0117] In some embodiments, the preset hybrid model structure is as follows: Figure 3 As shown in the figure, after the target trend item and the target period item are obtained by feature separation, a trend feature sequence prediction network can be constructed first, wherein the trend feature sequence prediction network includes a fully connected layer (Linear) and a multi-head attention layer (Attention), and the target trend item can be feature extracted through the trend feature sequence prediction network to obtain a trend feature sequence, which can effectively mine the similarities between power generation power and environment in long-term trends. Then a period feature sequence prediction network is constructed, wherein the period feature sequence prediction network includes a long short-term memory network (LSTM), a multi-head attention layer (Attention) and a preset activation function (sigmoid), and the target period item can be feature extracted through the period feature sequence prediction network to obtain a period feature sequence. Furthermore, the weight distribution optimization of self-attention can be added to the LSTM network, and the attention features can be mined at the time level to effectively process the short-term dynamic change features, and the period feature sequence prediction results can be output through the fully connected layer. After the trend feature sequence prediction network and the period feature sequence prediction network, a sequence concatenation layer can be constructed, wherein the sequence concatenation layer is used to concatenate the trend feature sequence and the period feature sequence to obtain 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 according to 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 periodic 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, the Sigmoid activation function, and the 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 periodic 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, and its 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. 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 allocation 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, the input layer can be constructed first, and the number of features is set to n, that is, the number of columns of the input sequence x is n. After the input layer, the hidden layer is constructed, where the number of neuron units A in the hidden layer is 16, and the neuron unit includes a forget gate, an input gate, and an output gate. Moreover, each LSTM neuron unit A is composed of a forget gate (forget), an input gate (input), and an output gate (output), which contains a cell state (cell) and a hidden state (hidden). The forget gate determines how much output information of the previous moment needs to be discarded, and the input gate is used to determine which input information of the current moment is useful and how much needs to be retained. The output gate determines which information to output after combining the current moment information and the past moment information. The cell state stores useful information at each moment. The hidden state is the information input to the next moment. These variables interact through the Sigmoid function (σ) and the tanh function and other calculations, so that the LSTM unit outputs the hidden state h.
[0125] After the hidden layer, a stacking layer is constructed, and the number of stacking layers num_layers is 4, that is, the input sequence x is put into LSTM for calculation once to obtain the hidden state h. After the stacking layer, a self-attention layer (Attention) is constructed, and an output layer is constructed. Exemplarily, the hidden state h is put into LSTM for cyclic calculation 3 times, and the output periodic feature sequence y is finally obtained. Among them, the size of the output layer output_size is 1, that is, the number of features of the output periodic feature sequence y is 1, corresponding to the LSTM prediction power sequence. It can be understood that the Attention layer is set in the last layer output feature of LSTM, and the final time series output vector is used to form self-attention for the feature vector query, key and value, and the softmax weight is normalized, and then the weight and the corresponding value vector are weighted summed to obtain a new time series output vector. Because the mechanism acts on the time scale, it is called a time attention layer. In order to keep the scale consistent, the size of the hidden layer of the attention layer feature vector hidden_dim is equal to the number of hidden layers of the LSTM network hidden_size, and is 16. In addition, the multi-head attention can be set to 2. The output periodic feature sequence y is input into 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 prediction accuracy based on available power, predicted power, wind farm installed capacity for the month and day-ahead statistical coefficient;
[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 used for daily statistics and monthly assessment. The forecast accuracy can be calculated based on the available power, forecast power, the installed capacity of the wind farm for the month and the day-ahead statistical coefficient, where the calculation formula for the forecast accuracy is: In the formula, ACC is the prediction accuracy, P Mi is the available power at time i, P Pi is the predicted power at time i the day before, Cap is the installed capacity of the wind farm that month, and n is the day-ahead statistical coefficient, which can be obtained based on the day-ahead wind turbine operation data reporting interval. It can be understood that at the power-limiting time P Mi is the available power at time i. Miis the actual power at moment i. The available power at the power-limited moment is affected by the output limitation and is different from the actual power output by the wind turbine. The actual power at the time of unlimited power is the available power. If the prediction accuracy is greater than the 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. Exemplarily, the results of this round of training can be determined by the prediction accuracy of the model output. When the effect does 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, and the initial short-term wind power prediction model is used as the target short-term wind power prediction model.
[0130] In some embodiments, in step S106, wind power prediction can be performed according to the target short-term wind power prediction model. For example, the numerical weather forecast data to be identified and the historical wind power data to be identified can be input into the target short-term wind power prediction model to obtain the wind power prediction result, so as to subsequently adjust 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, 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. We can then use the model to predict the wind power prediction result.
[0132] In some embodiments, this embodiment adopts LSTM network as the core, combined with self-attention mechanism, and 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 long sequence data that is difficult to change dynamically in a single model. 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 day-ahead prediction results of the wind farm to be counted on a daily basis and assessed on a monthly basis, which 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, then perform feature separation processing on the target sample data to obtain target trend items and target cycle items, input the target trend items and target cycle items into a preset hybrid model so that the preset hybrid model is trained to obtain an initial short-term wind power prediction model, 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, the embodiment of the present invention also provides a short-term wind power prediction device, including:
[0136] The first module 801 is used to obtain initial sample data, the initial sample data 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 pre-process 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 used to input the target trend item and the target period item into the 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 used 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, used 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, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, Figure 1 The method shown.
[0149] The contents of the above method embodiments are all applicable to the present storage medium embodiments. The functions specifically implemented by the present storage medium 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.
[0150] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but the scope of the rights of the present application is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present application should be within the scope of the rights of the present application.
Claims
1. A short-term wind power prediction method, characterized in that: The following steps are involved: Acquire 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; 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 that the preset hybrid model is trained to obtain an initial short-term wind power prediction model; Evaluating the initial short-term wind power prediction model to obtain a target short-term wind power prediction model; Wind power forecasting is performed according to the target short-term wind power forecasting model.
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 feature separation process is performed on the target sample data to obtain a target trend item and a target period item, including: According to the additive model, 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; The initial periodic term and the residual term are combined to obtain the target periodic term.
4. The method according to claim 3, characterized in that The target sample data is decomposed by using the 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 component; generating a subsequence according to the plurality of difference quantities; According to the smoothing parameter, the subsequence is fitted using a loss regression method; Time-sorting the plurality of subsequences after fitting to obtain regression results; Performing a sliding average on the regression results; Using the loss regression method to fit the regression result after sliding average, a trend component is obtained; 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; Using the loss regression method to fit the non-periodic component, to obtain the target trend item; If the initial period term and the target trend term meet the preset convergence condition, the residual term is obtained.
5. The method according to claim 1, characterized in that 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 comprising 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, and 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 concatenation 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 according to the concatenated feature sequence.
6. The method according to claim 5, characterized in that The construction process of the long short-term memory network includes: Construct the input layer; After the input layer, a hidden layer is constructed, 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 stacked layers, a self-attention layer is constructed; After the self-attention layer, the output layer is constructed.
7. The method according to claim 1, characterized in that The evaluating the initial short-term wind power prediction model to obtain a target short-term wind power prediction model includes: Calculate the prediction accuracy based on available power, predicted power, wind farm installed capacity for the month and day-ahead statistical coefficient; 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.
8. A short-term wind power prediction device, characterized in that: include: The first module is used 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 used to input the target trend item and the target period item into a preset hybrid model so that the preset hybrid model is trained to obtain an initial short-term wind power prediction model; A fifth module is used to evaluate the initial short-term wind power prediction model to obtain a target short-term wind power prediction model; The sixth module is used to perform wind power forecasting according to the target short-term wind power forecasting model.
9. 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 7.
10. 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 7 is implemented.
Citation Information
Patent Citations
AI and TSD combined new energy medium-term power combined prediction method
CN115545362A
Photovoltaic power generation power prediction method based on combined machine learning model and application thereof
CN115860177A
Short-term generating capacity prediction method based on ensemble learning
CN116307119A
STL data decomposition-based STL-SARIMA-GRU power prediction method
CN116562471A
Ultra-short-term wind power prediction method and electronic equipment
CN116865248A