A wind speed prediction method, device and medium
By constructing a wind speed prediction algorithm based on long and short memory network, Markov chain and fully connected layer, the problem of insufficient wind speed prediction accuracy and reliability in the existing technology is solved, and higher wind speed prediction accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202510227779.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-02-28
AI Technical Summary
The existing wind speed prediction methods have prediction accuracy and reliability problems when dealing with the correlation between large data volume and timing, which is difficult to meet the needs of large-scale wind power grid connection.
The wind speed prediction algorithm is adopted based on the coding layer based on the long and short memory network, the diffusion layer based on the Markov chain, and the decoding layer based on the fully connected layer, and the training set and the test set are trained to realize the encoding, diffusion and decoding of the wind speed sequence, thereby performing wind speed prediction.
Compared with other deep learning methods, this method exhibits higher accuracy and better prediction reliability in the field of wind speed prediction, and can more effectively process historical wind speed data and timing correlation.
Smart Images

Figure CN119719697B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a wind speed prediction method, device and medium. Background Art
[0002] In order to achieve large-scale wind power grid connection, accurate and reliable wind speed prediction technology is indispensable, which is conducive to coordinating automatic power generation control and guiding power system dispatch, and ultimately ensuring the safe and stable operation of the power system.
[0003] There are usually three main wind energy forecasting methods, namely physical methods, statistical methods and intelligent methods. The physical method not only considers historical wind speed information, but also includes geographical and meteorological factors; however, these methods consume a lot of computing time. The statistical method uses a simple statistical model to study the relationship between historical wind speed data and wind speed data at the time to be predicted, and the prediction accuracy is difficult to guarantee. Intelligent methods are most widely used in renewable energy forecasting. Their models such as neural networks, support vector machines, extreme learning machines and Gaussian process regression can help improve prediction accuracy; however, these methods also have disadvantages, such as difficulty in dealing with large amounts of training samples, not considering the time series correlation in the data, etc., which leads to reduced prediction accuracy and prediction reliability of the model.
[0004] In recent years, with the rapid development of deep learning technology, deep neural networks can learn the laws in massive historical data more accurately and comprehensively, and thus have achieved excellent results in many application fields, such as text and image processing. However, the research and application of deep learning technology in the field of prediction is relatively small and still needs further development.
[0005] In summary, there is an urgent need for a wind speed prediction method, device and medium to solve the problems in the prior art. Summary of the invention
[0006] The present invention aims to provide a wind speed prediction method, device and medium, and the specific technical scheme is as follows:
[0007] A wind speed prediction method comprises the following steps:
[0008] S1: Obtain the historical wind speed sequence of the site, process the historical wind speed sequence of the site, and obtain the training set and the test set;
[0009] S2: Determine the future time step that needs to be predicted according to the prediction requirements;
[0010] S3: constructing a wind speed prediction algorithm, wherein the wind speed prediction algorithm includes an encoding layer based on a long short-term memory network, a diffusion layer based on a Markov chain, and a decoding layer based on a fully connected layer;
[0011] S4: Use the training set, test set and loss function to train the wind speed prediction algorithm to obtain a wind speed prediction model;
[0012] S5: Using the historical wind speed sequence of the site as input, the wind speed prediction model is used to realize wind speed prediction.
[0013] Optionally, in S1, the historical wind speed sequence of the site is processed, including data screening and data preprocessing.
[0014] Optionally, in S3, a wind speed prediction algorithm is used to predict the wind speed, and the process is as follows:
[0015] The input sequence is input into the encoding layer and processed by the long short-term memory network to obtain the feature sequence;
[0016] The feature sequence is input into the diffusion layer, and the reconstructed feature sequence is obtained after forward diffusion and reverse diffusion;
[0017] The reconstructed feature sequence is input into the decoding layer to obtain the prediction result.
[0018] Optionally, in S3, the feature sequence is input into the diffusion layer, and a reconstructed feature sequence is obtained after forward diffusion and reverse diffusion, and the process is as follows:
[0019] Forward diffusion: The process of gradually adding noise to a sequence to become a Gaussian noise sequence. During the forward diffusion process, the current sequence only depends on the previous sequence.
[0020] Reverse diffusion: The Gaussian noise sequence obtained by forward diffusion is denoised through a denoising network to obtain a reconstructed feature sequence.
[0021] Optionally, in S3, the denoising network includes S linear layers, activation layers, and embedding layers, and the expression of the denoising network is as follows:
[0022] ;
[0023] in, represents the activation layer, represents a linear layer, represents the embedding layer, represents the current diffusion step, represents the first layer sequence input, Indicates the S-th layer sequence input or the S-1-th layer sequence output, represents the denoising network.
[0024] Optionally, in S4, the loss function is expressed as follows:
[0025] ;
[0026] represents the training loss, represents the true value, represents the final wind speed forecast value, represents the denoising learning rate, represents Gaussian noise, , , is the diffusion factor, is the total diffusion step length.
[0027] In addition, the present invention also provides a computer device, including a memory and a processor;
[0028] The memory is used to store a computer program executable on the processor;
[0029] The processor is used to implement the steps of the wind speed prediction method as described above when executing the computer program.
[0030] In addition, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the wind speed prediction method as described above are implemented.
[0031] The application of the technical solution of the present invention has the following beneficial effects:
[0032] The present invention provides a wind speed prediction method, device and medium. The method of the present invention encodes the historical input wind speed sequence through a long short-term memory network to obtain the feature mapping of the original sequence in the latent space. By defining a Markov chain with a diffusion step, noise is gradually added to the sequence code in the forward process until the original code becomes a pure noise sequence. Then the network learns the reverse diffusion process so that it can construct the feature mapping relationship of the original sequence in the latent space from the noise. And the predicted value at the next moment is obtained from the reconstructed feature relationship. In the field of wind speed prediction, the method of the present invention has a higher accuracy rate than other deep learning methods.
[0033] In addition to the above-described purposes, features and advantages, the present invention has other purposes, features and advantages. The present invention will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1It is a flow chart of the steps of the wind speed prediction method in a preferred embodiment of the present invention.
[0036] Figure 2 It is a model schematic diagram of the wind speed prediction method in the preferred embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0038] See also Figure 1 and Figure 2 , Figure 1 It is a flow chart of the steps of the wind speed prediction method in a preferred embodiment of the present invention. Figure 2 It is a model schematic diagram of the wind speed prediction method in the preferred embodiment of the present invention.
[0039] like Figure 1 and Figure 2 As shown, this embodiment provides a wind speed prediction method, comprising the following steps:
[0040] S1: Obtain the historical wind speed sequence of the site, process the historical wind speed sequence of the site, and obtain the training set and the test set;
[0041] S2: Determine the future time step that needs to be predicted according to the prediction requirements;
[0042] S3: constructing a wind speed prediction algorithm, wherein the wind speed prediction algorithm includes an encoding layer based on a long short-term memory network, a diffusion layer based on a Markov chain, and a decoding layer based on a fully connected layer;
[0043] S4: Use the training set and loss function to train the wind speed prediction algorithm, use the test set to evaluate the accuracy, and output the wind speed prediction model;
[0044] S5: Using the historical wind speed sequence of the site as input, the wind speed prediction model is used to realize wind speed prediction.
[0045] Optionally, in S1, the historical wind speed sequence of the site is processed, including data screening and data preprocessing.
[0046] Optionally, in S3, a wind speed prediction algorithm is used to predict the wind speed, and the process is as follows:
[0047] The input sequence is input into the encoding layer and processed by the long short-term memory network to obtain the feature sequence;
[0048] The feature sequence is input into the diffusion layer, and the reconstructed feature sequence is obtained after forward diffusion and reverse diffusion;
[0049] The reconstructed feature sequence is input into the decoding layer to obtain the prediction result.
[0050] Optionally, in S3, the feature sequence is input into the diffusion layer, and a reconstructed feature sequence is obtained after forward diffusion and reverse diffusion, and the process is as follows:
[0051] Forward diffusion: The process in which a sequence is gradually noisy and becomes a Gaussian noise sequence. During the forward diffusion process, the sequence at the current moment only depends on the sequence at the previous moment.
[0052] The process of forward diffusion is as follows:
[0053] Forward diffusion is the process of gradually adding noise to the original sequence to become a white noise sequence, and in the forward process, the current sequence Depends only on the last moment sequence The forward diffusion process can be regarded as a Markov process, satisfying the following equation:
[0054] ;
[0055] ;
[0056] in, represents a normal distribution, represents a standard normal distribution with a mean of 0 and a variance of 1. Indicates known hour The conditional probability of Indicates the multiplication symbol, is the diffusion factor set, , is the total diffusion step length set to satisfy .
[0057] According to the reparameterization sampling ,make , , we can get:
[0058] ;
[0059] ;
[0060] in, represents Gaussian noise.
[0061] Reverse diffusion: The Gaussian noise sequence obtained by forward diffusion is denoised through a denoising network to obtain a reconstructed feature sequence.
[0062] The reverse diffusion process is as follows:
[0063] Inverse diffusion is a denoising process, so we use a neural network to fit an inverse distribution , as shown below:
[0064] ;
[0065] ;
[0066] in, represents the noise to be predicted, Represents the sample distribution when the diffusion step is T.
[0067] From the forward process, we can know that the variance of each step is , so we can get:
[0068] ;
[0069] ;
[0070] because Known, so only the denoising network needs to be fitted That's it.
[0071] Furthermore, the denoising network includes S linear layers, activation layers and embedding layers, and the expression of the denoising network is as follows:
[0072] ;
[0073] in, represents the activation layer, represents a linear layer, represents the embedding layer, represents the current diffusion step, represents the first layer sequence input, Indicates the S-th layer sequence input or the S-1-th layer sequence output, represents the denoising network.
[0074] Optionally, in S4, the loss function is expressed as follows:
[0075] ;
[0076] represents the training loss, represents the true value, represents the final wind speed forecast value, represents the denoising learning rate, represents Gaussian noise, , , is the diffusion factor, is the total diffusion step length.
[0077] Since the model of the method in this embodiment has two training objectives, namely, minimizing the noise prediction error of the denoising module and minimizing the prediction error, the conventional loss function cannot take both objectives into account. To denoise the learning rate, the initial value is determined by hyperparameter optimization, and the value gradually decays to 0 as the number of training rounds increases.
[0078] In order to evaluate the effectiveness of the method in this embodiment in the wind speed prediction task, this embodiment conducted an experimental comparison:
[0079] The data in this embodiment are extracted from the long-term monitoring data of two subordinate areas of a local observatory, and the two subordinate areas correspond to the first data set and the second data set respectively. The data include the local average wind speed every 10 minutes from 8:00 on November 25, 2005 to 16:40 on December 15, 2005 and from 10:00 on January 19, 2006 to 18:40 on February 5, 2006. Each group of data contains 2500 data points. The first 4 / 5 of each data set is used as a training set, and the latter 1 / 5 is used as a test set. The experimental comparison results are shown in Tables 1 and 2.
[0080] Table 1 Prediction error on the first dataset
[0081]
[0082] Table 2 Prediction error of the second data set
[0083]
[0084] The methods in Tables 1 and 2 are described as follows:
[0085] Autoformer: A Transformer variant with a built-in time series decomposition module (alternating optimization of trend terms and period terms) and autocorrelation mechanism.
[0086] Informer: A lightweight Transformer architecture based on ProbSparse self-attention sparsification and feature distillation strategy.
[0087] TCN: A temporal modeling convolutional network consisting of a stack of causal convolutions, dilated convolutions, and residual blocks.
[0088] LSTM: A recurrent neural network that transmits timing information to cell states through a gating mechanism (forget gate, input gate, output gate).
[0089] GRU: A lightweight recurrent neural network variant that replaces LSTM multi-gating with update gates and reset gates.
[0090] MLP: A static data feed-forward neural network consisting of fully connected layers and non-linear activation functions.
[0091] It can be seen from Table 1 and Table 2 that compared with other deep learning methods, the method in this embodiment has a smaller error value and a higher accuracy.
[0092] In addition, this embodiment also discloses a computer device, including a memory and a processor;
[0093] The memory is used to store a computer program executable on the processor;
[0094] The processor is used to implement the steps of the above-mentioned wind speed prediction method when executing the computer program.
[0095] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the computer device.
[0096] The computer device may be a computing device such as a mobile phone, a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may include, but is not limited to, a processor and a memory. For example, the computer device may also include an input / output device, a network access device, a bus, etc.
[0097] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.
[0098] The memory can be used to store the computer program and / or module, and the processor implements the computer program by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0099] Wherein, if the module / unit integrated in the computer device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0100] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned wind speed prediction method are implemented.
[0101] The embodiment of the present invention provides a wind speed prediction method, device and medium. The method of the present invention encodes the historical input wind speed sequence through a long short-term memory network to obtain the feature mapping of the original sequence in the latent space. By defining a Markov chain with a diffusion step, noise is gradually added to the sequence code in the forward process until the original code becomes a pure noise sequence. Then the network learns the reverse diffusion process so that it can construct the feature mapping relationship of the original sequence in the latent space from the noise. And the predicted value at the next moment is obtained from the reconstructed feature relationship. In the field of wind speed prediction, the method of the present invention has a higher accuracy rate than other deep learning methods.
[0102] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0103] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A wind speed prediction method, characterized in that: The following steps are involved: S1: Obtain the historical wind speed sequence of the site, process the historical wind speed sequence of the site, and obtain the training set and the test set; S2: Determine the future time step that needs to be predicted according to the prediction requirements; S3: Construct a wind speed prediction algorithm, which includes an encoding layer based on a long short-term memory network, a diffusion layer based on a Markov chain, and a decoding layer based on a fully connected layer; the wind speed prediction algorithm is used to predict the wind speed, and the process is as follows: The input sequence is input into the encoding layer and processed by the long short-term memory network to obtain the feature sequence; The feature sequence is input into the diffusion layer, and the reconstructed feature sequence is obtained after forward diffusion and reverse diffusion; Input the reconstructed feature sequence into the decoding layer to obtain the prediction result; S4: Use the training set, test set and loss function to train the wind speed prediction algorithm to obtain a wind speed prediction model; S5: Using the historical wind speed sequence of the site as input, the wind speed prediction model is used to achieve wind speed prediction; In S3, the feature sequence is input into the diffusion layer, and the reconstructed feature sequence is obtained after forward diffusion and reverse diffusion. The process is as follows: Forward diffusion: The process of gradually adding noise to a sequence to become a Gaussian noise sequence. During the forward diffusion process, the current sequence only depends on the previous sequence. Reverse diffusion: The Gaussian noise sequence obtained by forward diffusion is denoised through a denoising network to obtain a reconstructed feature sequence.
2. The wind speed prediction method according to claim 1, characterized in that: In S1, the historical wind speed series of the site are processed, including data screening and data preprocessing.
3. The wind speed prediction method according to claim 2, characterized in that: In S3, the denoising network includes S linear layers, activation layers and embedding layers. The expression of the denoising network is as follows: … Among them, relu represents the activation layer, linear represents the linear layer, embedding represents the embedding layer, t represents the current diffusion step, x t represents the first layer sequence input, represents the S-th layer sequence input or the S-1-th layer sequence output, ε θ represents the denoising network.
4. The wind speed prediction method according to claim 3, characterized in that: In S4, the loss function is expressed as follows: Loss represents the training loss, x true represents the true value, x pred represents the final wind speed prediction value, λ represents the denoising learning rate, ε represents Gaussian noise, α t =1-β t , β t is the diffusion factor, and T is the total diffusion step length.
5. A computer device, characterized in that: including memory and processor; The memory is used to store a computer program executable on the processor; The processor is used to implement the steps of the wind speed prediction method according to any one of claims 1 to 4 when executing the computer program.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the wind speed prediction method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Space-time event prediction method and device based on deep learning
CN118378734A
Industrial key quality index prediction method based on long-term and short-term dependence of time sequence
CN118521213A