Short-time wind speed time series prediction method based on time attention mechanism
Patent Information
- Application Number
- CN202211522271.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-11-30
AI Technical Summary
当前,利用深度神经网络构建的时序数据预测模型普遍存在预测时序相较实际时序波动偏小,以及随着预测时效的延长预测准确率逐步下降等问题,进而影响了风速预测的性能,特别是预测的准确率
Smart Images

Figure CN115775012B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Earth science and technology, and more specifically, relates to a short-term wind speed time series prediction method based on a time attention mechanism. Background Technology
[0002] Due to the highly fluctuating, localized, and intermittent nature of wind speed, short-term wind speed forecasting is one of the most challenging techniques in weather forecasting. Improving the accuracy of wind speed forecasts can reduce the damage caused by strong winds and also help improve the efficiency of wind power generation. For a long time, short-term wind speed forecasting methods have been broadly classified into two categories: physical models and statistical models. In recent years, deep learning technology has further expanded wind speed forecasting methods and achieved some success. Currently, time-series data forecasting models built using deep neural networks generally suffer from problems such as the predicted time series fluctuating less than the actual time series, and the prediction accuracy gradually decreasing with the extension of the forecast lead time, thus affecting the performance of wind speed forecasting, especially the accuracy. Summary of the Invention
[0003] To address at least one of the aforementioned technical problems, according to one aspect of the present invention, a short-time wind speed time-series prediction method based on a time attention mechanism is provided, comprising the following specific steps:
[0004] Step 1: Identify the target and driving stations, and acquire wind speed data for both. The station data uses real-time meteorological data saved by encrypted automatic weather stations. The target station is the station currently requiring forecasting, and the driving station is a geographically adjacent station. The driving station is selected by calculating the distance between each station and the target station, choosing the station with the shortest relative distance and reliable data quality. The analysis of station data quality can be performed in Step 2.
[0005] Step 2: Perform quality control on the station's data. In addition to the commonly used meteorological checks such as message format checks, timestamp checks, and abnormal character checks, data where the wind speed difference between two consecutive records is greater than V1, and data where the wind speed in two consecutive records is consistently greater than V3 without any change in value, must be removed. Furthermore, records exceeding physical extreme values should also be removed. In the above, V1∈[30,∞), V2∈[100,∞), and V3∈[1.5,∞). The units for V1 and V3 are m / s.
[0006] Step 3: Obtain the second-by-second wind speed data for the target and drive stations corresponding to the 365 consecutive days in Step 2, and define them as Spd_target and Spd_drive, respectively.
[0007] Step 4: Calculate the median wind speed per minute, Spd_drive_mean. ,in Let $\frac{ ... ,in Let r represent the maximum value of the median within the h-th 5-minute interval, r = 104320, h ∈ [1, r].
[0008] Step 5: Calculate the median wind speed per minute in Spd_target, Spd_target_mean. ,in Let $\frac{ ... ,in Let r = 104320 represent the maximum value of the median within the h-th 5-minute period, h ∈ [1, r].
[0009] Step 6: Obtain Spd_dv_mean_max and Spd_ta_mean_max of the same length from Steps 4 and 5. Divide each of Spd_dv_mean_max and Spd_ta_mean_max into several subsequences. Each subsequence consists of T consecutive wind speed values at time intervals corresponding to Spd_dv_mean_max and Spd_ta_mean_max, where T=12. Define these subsequences as Se_dv_spd and Se_ta_spd, respectively. , ,in This represents the subsequence of the q-th drive station. This represents the subsequence of the q-th target station. This represents the T-th wind speed value in the q-th driving station subsequence. Let T represent the T-th wind speed value in the subsequence of the q-th target station, where m = 104308 and q ∈ [1, m].
[0010] Step 7: Perform data equalization on the Se_dv_spd and Se_ta_spd data obtained in Step 6. The calculation formula is as follows:
[0011] (1)
[0012] In Equation 1, for The average wind speed in the medium-wind region. for Standard deviation of wind speed for The average wind speed in the medium-wind region. for The standard deviation of wind speed. This can be obtained using Formula 1. and , , ,make , , where t∈[1,m].
[0013] Step 8: The same length can be obtained through step 7. and Define the dataset Data=( , ), where Data[i] = ( [i], [i])=( Given a dataset, split Data into ds_train_data and ds_valid_date. Let... , In the above case, i∈[1, m), s=m*rated, rate∈[0, 1], and s is rounded down. A 10-fold cross-validation with no duplication is used, taking the first 90% of the time series as the training and validation sets, and the last 10% as the test set. It is ensured that the wind measurement times at the same locations in the two time series are consistent. The resulting 5-minute wind speed time series is obtained.
[0014] Step 9: Establish a normalized network layer BN module to process a subsequence of the target site. As input, The sequence is normalized to obtain This compresses the numerical distribution of the sequence into a defined interval. The specific calculation process of the BN module is as follows:
[0015] (2)
[0016] in It is a constant. and These are the parameters that the BN module needs to learn.
[0017] Step 10: Establish the AttentionLayerA neural network module to calculate the attention level of wind speed data, based on the steps in Step 9. Taking input as an example, through Calculate information with attention This represents a weighted subsequence after the subsequence is weighted by the AttentionLayer A module. The calculation process inside AttentionLayer A is as follows:
[0018] (3)
[0019] in Let the hidden layer vector of the previous layer be the vector of the network. hour, Initialize as a zero vector. The LSTM module will be described in detail in step 11. , and These are the weight and bias matrices of the AttentionLayer A module, and the values of these matrices are obtained through training the AttentionLayerA neural network module. The activation function of the AttentionLayerA neural network module is used to perform a non-linear transformation on the result, resulting in the hidden layer vector, denoted as . .
[0020] Step 11: Create an LSTM module for building The long-term dependencies between various values are calculated using LSTM in the following way:
[0021] (4)
[0022] in , , , , , , , These are all weights and offsets of the LSTM module, which will be obtained through training the LSTM module. The sigmoid is the activation function, and the output is between 0 and 1.
[0023] Step 12: Establish the AttentionLayerB neural network module to calculate the attention of hidden layer data, and use the data obtained in Step 10. If the data is used as input to AttentionLayerB, then The internal calculation process is as follows:
[0024] (5)
[0025] in , and These are the weight and bias matrices of AttentionLayerB, obtained through training AttentionLayerB. This represents the P-th hidden state vector of the LSTM, weighted by the AttentionLayerB module, in the driving sequence. The final output is denoted as... .
[0026] Step 13: Design a neural network prediction module, which contains T LSTM modules and one fully connected module, and integrates the features from Step 7. As input to the BN module in step 9, The target site subsequence is normalized so that the numerical distribution of the sequence is compressed into a specific interval, resulting in... . (The remaining text appears to be incomplete and lacks context. It's unclear what the intended meaning is.) and The concatenated data is input into T LSTMs, and then passed through a fully connected module to obtain the wind speed prediction value for the next time step T+1. The main calculation process is as follows:
[0027] (6)
[0028] In the formula, , and , These represent the weight matrix and bias matrix of the prediction module, respectively. The hidden layer vector of the previous LSTM module, when hour, Initialize as a zero vector. This is the predicted wind speed value for the next moment.
[0029] Step 14: Create a Gaussian loss module to reflect the degree of difference between the forecast and the actual results, denoted as . The specific calculation formula is as follows:
[0030] (7)
[0031] in To control the local scope of the Gaussian kernel function, the variance of the target sequence is used as its value. Let be the actual wind speed of the target sequence with the forecast lead time of idx. This is the wind speed time-series prediction model forecast result for the idx-th forecast lead time, where z represents the longest forecast lead time. , . Target sequence As an input to step 13, the predicted value for the next time step is calculated. The calculation is performed using Equation 7, and the result is recorded as follows: Then the forecast spliced into the original target sequence, we obtain Then As an input to step 13, the predicted value for the next time step is calculated. The calculation is performed using Equation 2, and the result is denoted as... Repeat the above process until the result is calculated. Therefore, a loss sequence can be obtained, denoted as... To enhance the sensitivity of the wind speed time-series prediction model to errors in predictions at more distant time points, the loss sequence was... A weighted sum is performed, and the result is used as the loss value (Loss) of the wind speed time-series prediction model. The loss function of this wind speed time-series prediction model can be expressed as:
[0032]
[0033] It is a dynamic weighting coefficient, where It gradually increases with the increase of the forecast lead time. The dynamic weighting coefficient makes the wind speed time series forecast model pay more attention to the accuracy of long-term forecasts during training, thereby improving the overall forecast performance.
[0034] Step 15: Input the training set ds_train_data from Step 8 into the wind speed time-series prediction model constructed from Steps 9 to 13 for neural network training. The neural network loss function is calculated in Step 14 during training. For the performance validation of the wind speed time-series prediction model, the validation set ds_valid_date from Step 8 is used as the input to the model for calculation.
[0035] Step 16: The final selected wind speed time-series prediction model is determined based on the above training and validation, using relevant deep learning experience and knowledge, such as training error and validation error metrics. For the selected wind speed time-series prediction model, when the model is input with wind speed time-series data for the current period, it can predict wind speed time-series data for the future period, thus achieving the goal of short-term wind speed time-series prediction. After the wind speed time-series prediction model is established, ds_train_data is used as the training set, with 1024 samples selected for each training iteration. The wind speed time-series prediction model optimizer uses Adam with a learning rate of 0.001, and three NVIDIA TESLAV1003 graphics cards are used for 300 training rounds.
[0036] The following is a method for objectively evaluating the performance of this model, which is suspected of having an underlying mechanism:
[0037] To objectively evaluate the performance of this model, we used the following four error calculation methods, as shown in the formulas below:
[0038]
[0039]
[0040]
[0041] (8)
[0042] In the formula, Indicates the truth value. This represents the model's prediction results at the same time point.
[0043] The following solutions address potential model generalization issues:
[0044] To improve the model's generalization performance, k-fold cross-validation with no replacement sampling is further employed, ensuring that each "data pair" has only one chance to be included in the training set during training. A 10-fold split is used, meaning that nine parts are used as the training set each time, and the remaining part is used as the validation set.
[0045] According to another aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the short-time wind speed time series prediction method based on the time attention mechanism of the present invention.
[0046] According to another aspect of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the short-time wind speed time series prediction method based on the time attention mechanism of the present invention. Attached Figure Description
[0047] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings of the embodiments will be briefly described below. Obviously, the drawings described below only relate to some embodiments of the present invention and are not intended to limit the present invention.
[0048] Figure 1 This is the control flowchart for Example 1;
[0049] Figure 2 This is a preprocessed data graph of point A in Example 1;
[0050] Figure 3 This is a preprocessed data graph of point B in Example 1;
[0051] Figure 4 This is a data flow diagram for Example 1. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention.
[0053] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.
[0054] like Figure 1-4 As shown,
[0055] Example 1:
[0056] This embodiment presents a short-time wind speed time series prediction method based on a time attention mechanism, the process of which is as follows: Figure 1 As shown in Figure 4, the data flow for steps 9 to 14 includes the following specific steps:
[0057] Step 1: Identify the target and driving stations, and acquire wind speed data for both. The station data uses real-time meteorological data saved by encrypted automatic weather stations. The target station is the station currently requiring forecasting, and the driving station is a geographically adjacent station. The driving station is selected by calculating the distance between each station and the target station, choosing the station with the shortest relative distance and reliable data quality. The analysis of station data quality can be performed in Step 2.
[0058] Step 2: Perform quality control on the station's data. In addition to the commonly used meteorological checks such as message format checks, timestamp checks, and abnormal character checks, data where the wind speed difference between two consecutive records is greater than V1, and data where the wind speed in two consecutive records is consistently greater than V3 without any change in value, must be removed. Furthermore, records exceeding physical extreme values should also be removed. In the above, V1∈[30,∞), V2∈[100,∞), and V3∈[1.5,∞). The units for V1 and V3 are m / s.
[0059] Step 3: Obtain the second-by-second wind speed data of the target site and drive site corresponding to the 365 consecutive days in Step 2, and define them as Spd_target and Spd_drive, respectively.
[0060] Step 4: Calculate the median wind speed per minute, Spd_drive_mean. ,in Let $\frac{ ... ,in Let r represent the maximum value of the median within the h-th 5-minute interval, r = 104320, h ∈ [1, r].
[0061] Step 5: Calculate the median wind speed per minute in Spd_target, Spd_target_mean. ,in Let $\frac{ ... ,in Let r = 104320 represent the maximum value of the median within the h-th 5-minute period, h ∈ [1, r].
[0062] Step 6: Obtain Spd_dv_mean_max and Spd_ta_mean_max of the same length from Steps 4 and 5. Divide each of Spd_dv_mean_max and Spd_ta_mean_max into several subsequences. Each subsequence consists of T consecutive wind speed values at time intervals corresponding to Spd_dv_mean_max and Spd_ta_mean_max, where T=12. Define these subsequences as Se_dv_spd and Se_ta_spd, respectively. , ,in Indicates the first Subsequences of each driving site Indicates the first Subsequences of target sites, Indicates the first The T-th wind speed value in the subsequence of driving stations Indicates the first The T-th wind speed value in the subsequence of target stations, where m=104308, q∈[1,m].
[0063] Step 7: Perform data equalization on the Se_dv_spd and Se_ta_spd data obtained in Step 6. The calculation formula is as follows:
[0064] Equation (1)
[0065] In Equation 1, for The average wind speed was 3.772 m / s. for The standard deviation of the medium wind speed is 2.784 m / s. for The average wind speed was 3.845 m / s. for The standard deviation of the wind speed is 2.845 m / s. This can be obtained using Formula 1. and , , ,make , , where t∈[1,m].
[0066] Step 8: The same length can be obtained through step 7. and Define the dataset Data=( , ), where Data[i] = ( [i], [i])=( Given a dataset, split Data into ds_train_data and ds_valid_date. Let... , For i∈[1, m), s = m * 0.9, and s is rounded down. A 10-fold cross-validation with no replacement is used, taking the first 90% of the time series as the training and validation sets, and the last 10% as the test set. This ensures that the wind measurement times at the same locations in the two time series are consistent. The resulting 5-minute wind speed time series is as follows: Figure 2 and Figure 3 As shown.
[0067] Step 9: Establish a normalized network layer BN module to process a subsequence of the target site. As input, The sequence is normalized to obtain This compresses the numerical distribution of the sequence into a defined interval. The specific calculation process of the BN module is as follows:
[0068]
[0069] in It is a constant. and These are the parameters that the BN module needs to learn.
[0070] Step 10: Establish the AttentionLayerA neural network module to calculate the attention level of wind speed data, based on the steps in Step 9. Taking input as an example, through Calculate information with attention This represents a weighted subsequence after the subsequence is weighted by the AttentionLayer A module. The calculation process inside AttentionLayer A is as follows:
[0071]
[0072] in Let the hidden layer vector of the previous layer be the vector of the network. hour, Initialize as a zero vector. The LSTM module will be described in detail in step 11. , and These are the weight and bias matrices of the AttentionLayer A module, and the values of these matrices are obtained through training the AttentionLayerA neural network module. The activation function of the AttentionLayerA neural network module is used to perform a non-linear transformation on the result, resulting in the hidden layer vector, denoted as . .
[0073] Step 11: Create an LSTM module for building The long-term dependencies between various values are calculated using LSTM in the following way:
[0074]
[0075] in , , , , , , , These are all weights and offsets of the LSTM module, which will be obtained through training the LSTM module. The sigmoid is the activation function, and the output is between 0 and 1.
[0076] Step 12: Establish the AttentionLayerB neural network module to calculate the attention of hidden layer data, and use the data obtained in Step 10. If the data is used as input to AttentionLayerB, then The internal calculation process is as follows:
[0077]
[0078] in , and These are the weight and bias matrices of AttentionLayerB, obtained through training AttentionLayerB. This represents the P-th hidden state vector of the LSTM, weighted by the AttentionLayerB module, in the driving sequence. The final output is denoted as... .
[0079] Step 13: Design a neural network prediction module, which contains T LSTM modules and one fully connected module, and integrates the features from Step 7. As input to the BN module in step 9, The target site subsequence is normalized so that the numerical distribution of the sequence is compressed into a specific interval, resulting in... . (The remaining text appears to be incomplete and lacks context. It's unclear what the intended meaning is.) and The concatenated data is input into T LSTMs, and then passed through a fully connected module to obtain the wind speed prediction value for the next time step T+1. The main calculation process is as follows:
[0080]
[0081] In the formula, , and , These represent the weight matrix and bias matrix of the prediction module, respectively. The hidden layer vector of the previous LSTM module, when hour, Initialize as a zero vector. This is the predicted wind speed value for the next moment.
[0082] Step 14: Create a Gaussian loss module to reflect the degree of difference between the forecast and the actual results, denoted as . The specific calculation formula is as follows:
[0083] (7)
[0084] in To control the local scope of the Gaussian kernel function, the variance of the target sequence is used as its value, which is 4.245. Let be the actual wind speed of the target sequence with the forecast lead time of idx. This is the wind speed time-series prediction model forecast result for the idx-th forecast lead time, where z represents the longest forecast lead time. The value is 12. . Target sequence As an input to step 13, the predicted value for the next time step is calculated. The calculation is performed using Equation 7, and the result is recorded as follows: Then the forecast spliced into the original target sequence, we obtain Then As an input to step 13, the predicted value for the next time step is calculated. The calculation is performed using Equation 2, and the result is denoted as... Repeat the above process until the result is calculated. Therefore, a loss sequence can be obtained, denoted as... To enhance the sensitivity of the wind speed time-series prediction model to errors in predictions at more distant time points, the loss sequence was... A weighted sum is performed, and the result is used as the loss value (Loss) of the wind speed time-series prediction model. The loss function of this wind speed time-series prediction model can be expressed as:
[0085]
[0086] It is a dynamic weighting coefficient, where N takes a value of 0.1 and gradually increases with the increase of the prediction lead time. The dynamic weighting coefficient makes the wind speed time series prediction model pay more attention to the accuracy of long-term predictions during training, thereby improving the overall prediction effect.
[0087] Step 15: Input the training set ds_train_data from Step 8 into the wind speed time-series prediction model constructed from Steps 9 to 13 for neural network training. The neural network loss function is calculated in Step 14 during training. For the performance validation of the wind speed time-series prediction model, the validation set ds_valid_date from Step 8 is used as the input to the model for calculation.
[0088] Step 16: The final selected wind speed time-series prediction model is determined based on the above training and validation, using relevant deep learning experience and knowledge, such as training error and validation error metrics. For the selected wind speed time-series prediction model, when the model is input with wind speed time-series data for the current period, it can predict wind speed time-series data for the future period, thus achieving the goal of short-term wind speed time-series prediction. After the wind speed time-series prediction model is established, ds_train_data is used as the training set, with 1024 samples selected for each training iteration. The wind speed time-series prediction model optimizer uses Adam with a learning rate of 0.001, and three NVIDIA TESLAV1003 graphics cards are used for 300 training rounds.
[0089] The following is a method for objectively evaluating the performance of this model, which is suspected of having an underlying mechanism:
[0090] To objectively evaluate the performance of this model, we used the following four error calculation methods, as shown in the formulas below:
[0091]
[0092]
[0093]
[0094]
[0095] In the formula, Indicates the truth value. This represents the model's prediction results at the same time point.
[0096] The following solutions address potential model generalization issues:
[0097] To improve the model's generalization performance, k-fold cross-validation with no replacement sampling is further employed, ensuring that each "data pair" has only one chance to be included in the training set during training. A 10-fold split is used, meaning that nine parts are used as the training set each time, and the remaining part is used as the validation set.
[0098] Example 2:
[0099] The computer-readable storage medium of this embodiment stores a computer program that, when executed by a processor, implements the steps in the short-time wind speed time-series prediction method based on the time attention mechanism of Embodiment 1.
[0100] The computer-readable storage medium in this embodiment can be an internal storage unit of the terminal, such as the terminal's hard disk or memory; the computer-readable storage medium in this embodiment can also be an external storage device of the terminal, such as a plug-in hard disk, smart memory card, secure digital card, flash memory card, etc. equipped on the terminal; furthermore, the computer-readable storage medium can include both the terminal's internal storage unit and external storage devices.
[0101] The computer-readable storage medium of this embodiment is used to store computer programs and other programs and data required by the terminal. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0102] Example 3:
[0103] The computer device of this embodiment includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the short-time wind speed time series prediction method based on the time attention mechanism of Embodiment 1.
[0104] In this embodiment, the processor can be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The memory can include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory can also include non-volatile random access memory. For example, the memory can also store device type information.
[0105] Those skilled in the art will understand that the content disclosed in the embodiments can be provided as a method, system, or computer program product. Therefore, this solution can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this solution can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage) containing computer-usable program code.
[0106] This solution is described with reference to flowchart illustrations and / or block diagrams of methods and computer program products according to embodiments of this solution. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0108] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0109] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0110] The examples described herein are merely preferred embodiments of the invention and are not intended to limit the concept and scope of the invention. Any modifications and improvements made by those skilled in the art to the technical solutions of the invention without departing from the design concept of the invention should fall within the protection scope of the invention.
Claims
1. A short-time wind speed time series prediction method based on a time attention mechanism, characterized in that, The steps include the following: S1. Determine the target site and the driving site, and obtain the wind speed data of the target site and the driving site; S2. Perform quality control on the site's data; S3. Obtain the wind speed data of the target site and the driving site for 365 consecutive days in S2, and define them as Spd_target and Spd_drive respectively. S4. Calculate the median wind speed per minute, Spd_drive_mean. ,in Let Spd_dv_mean_max represent the median wind speed in the driving sequence at minute b, where b ∈ [1, j]; calculate the maximum value of each median over 5 minutes. ,in This represents the maximum value of the median within the h-th 5-minute interval, where h ∈ [1, r]. S5. Calculate the median wind speed per minute in Spd_target, Spd_target_mean. ,in Let Spd_ta_mean_max represent the median wind speed of the target sequence at minute b, where b ∈ [1, j]; calculate the maximum value of the medians within 5 minutes. ,in This represents the maximum value of the median within the h-th 5-minute interval, where h ∈ [1, r]. S6. Obtain Spd_dv_mean_max and Spd_ta_mean_max of the same length from S4 and S5. Divide Spd_dv_mean_max and Spd_ta_mean_max into several subsequences. Each subsequence consists of T consecutive wind speed values in time corresponding to Spd_dv_mean_max and Spd_ta_mean_max, and are defined as Se_dv_spd and Se_ta_spd, respectively. , ,in Indicates the first Subsequences of each driving site Indicates the first Subsequences of target sites, This represents the T-th wind speed value in the q-th driving station subsequence. Let T represent the T-th wind speed value in the q-th target station subsequence, where q∈[1,m]; S7. Perform data equalization processing on the Se_dv_spd and Se_ta_spd data obtained in S6, denoted as... and ; S8. Define the dataset Divide the data into training and validation sets, denoted as ds_train_data and ds_valid_data; S9. Establish a normalized network layer BN module; S10. Establish a neural network module AttentionLayerA to calculate the attention level of wind speed data; S11. Create the LSTM module; S12. Establish the neural network module AttentionLayerB for calculating the attention of hidden layer data; S13. Design a neural network prediction module; S14. Create a Gaussian loss module The specific calculation formula is as follows: ; (1) in The local scope of the Gaussian kernel function is controlled by using the variance of the target sequence as its value; Let be the actual wind speed of the target sequence with the forecast lead time of idx. This is the wind speed time-series prediction model forecast result for the idx-th forecast lead time, where z represents the longest forecast lead time. , ; target sequence As an input to step S13, the predicted value for the next time step is calculated. The calculation is performed using formula (1), and the result is recorded as follows: Then the forecast spliced into the original target sequence, we obtain Then As an input to step S13, the predicted value for the next time step is calculated. The calculation is performed using formula (1), and the result is recorded as follows: Repeat the above process until the result is calculated. Therefore, a loss sequence can be obtained, denoted as... To enhance the sensitivity of the wind speed time series prediction model to errors in predictions at more distant time points, the loss sequence was... A weighted sum is performed, and the result is used as the loss value of the wind speed time series prediction model; the loss function of this wind speed time series prediction model is expressed as: ; (2) It is a dynamic weighting coefficient, where It gradually increases with the increase of the prediction lead time; the dynamic weight coefficient makes the wind speed time series prediction model pay more attention to the accuracy of long-term predictions during training, thereby improving the overall prediction effect. S15, Model Training; S16. Model Validation and Optimization.
2. The method according to claim 1, characterized in that, The calculation formula for step S7 is as follows: ; (3) In equation (3), for The average wind speed in the medium-wind region. for Standard deviation of wind speed for The average wind speed in the medium-wind region. for Standard deviation of wind speed.
3. The method according to claim 1, characterized in that, Step S8 uses 10-fold crossvalidation with no repetition sampling, taking the first 90% of the time series as the training set and validation set, and the last 10% as the test set; ensuring that the wind measurement time at the same location is consistent in the two time series; thus obtaining the 5-minute wind speed time series.
4. The method according to claim 1, characterized in that, Step S9 specifically involves selecting a sub-sequence from the target site. As input, the sequence is normalized to obtain This compresses the numerical distribution of the sequence into a defined interval; the specific calculation process of the BN module is as follows: ; (4) in It is a constant. and These are the parameters that the BN module needs to learn.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, it implements the steps in the short-time wind speed time series prediction method based on the time attention mechanism as described in any one of claims 1 to 4.
6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor executes the program, it implements the steps in the short-time wind speed time series prediction method based on the time attention mechanism as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Ocean station wind speed forecasting method based on information awareness attention dynamic collaborative network
CN114942480A