Meteorological-wind power combined prediction method based on Swinin-Transform framework
Through the joint prediction method of meteorological-wind power based on the Swin-Transformer framework, the meteorological grid data and wind power timing data are integrated, and the problem of poor data fusion in the existing technology is solved, achieving the accuracy of short-term prediction of wind power.
Patent Information
- Application Number
- CN202411535676.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-31
AI Technical Summary
When existing short-term wind power forecasting methods integrate meteorological grid data and wind power timing data, it is difficult to effectively utilize high-dimensional data, resulting in low prediction accuracy.
Using the joint prediction method of meteorological-wind power based on the Swin-Transformer framework, the meteorological grid data and wind power timing data are integrated through time position coding and spatial position coding to form new characteristic data, and the improved Swin-Transformer model is carried out. Multi-scale modeling and feature fusion.
It effectively improves the accuracy of short-term forecasts of wind power, can better capture the spatial and temporal relationship between meteorological and wind power power, and solves the problems of high redundancy and modal inconsistency in meteorological grid data.
Smart Images

Figure CN119476586A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of short-term wind power forecasting, and in particular to a meteorological-wind power joint forecasting method based on a Swin-Transformer framework. Background Art
[0002] Short-term wind power forecasting refers to predicting the power output value at 96 points from 00:00 to 23:45 the next day at a fixed time point on the day (usually 8-12 am). The power output of a wind farm is strongly affected by meteorological conditions. Changes in meteorological factors such as wind speed, temperature, and humidity directly determine the volatility and uncertainty of wind power. Therefore, the prediction of wind farm power requires meteorological forecast data as input. Meteorological forecast data is usually in grid form. For ease of use, existing short-term power forecasting methods usually interpolate grid-formed meteorological forecast data to wind farm stations. However, this approach ignores a lot of useful information, thereby affecting the accuracy of power forecasting.
[0003] In recent years, with the rapid development of deep learning technology, new energy prediction technology based on deep learning has made significant progress. For example, models such as convolutional neural networks (CNN) and long short-term memory networks (LSTM) have been widely used in time series prediction tasks. However, these models have certain limitations in capturing complex spatiotemporal dependencies.
[0004] As an emerging deep learning model, Swin-Transformer was originally used in the field of computer vision. Its local self-attention structure based on the sliding window mechanism can more effectively process high-resolution data and capture local and global information. Compared with traditional convolutional neural networks, Swin-Transformer has better performance in processing complex data structures, especially for multi-dimensional data with strong spatiotemporal dependence such as meteorology and wind power. Summary of the invention
[0005] The purpose of the present invention is to provide a meteorological-wind power joint prediction method based on the Swin-Transformer framework. According to the characteristics of meteorological grid data and wind power time series data, the Swin-Transformer model in the field of machine vision is improved, and meteorological and wind power data of different modes are effectively integrated, thereby effectively improving the accuracy of short-term wind power prediction.
[0006] To achieve the above object, the present invention provides a meteorological-wind power joint prediction method based on the Swin-Transformer framework, comprising the following steps:
[0007] Obtain historical wind power time series data and future meteorological grid forecast data;
[0008] The acquired historical wind power time series power data and future meteorological grid forecast data are encoded in time position, encoded in space position, and convolved, and the initial features of the meteorological forecast array and historical power are output respectively. The two sets of initial features are merged and filled in the last dimension to form a new feature data;
[0009] The new feature data is input into the meteorological-new energy prediction model, and the fused features are output. The fused features are convolved again and an MLP layer is used to obtain the final prediction result.
[0010] Preferably, the specific formula for spatial position encoding is as follows:
[0011]
[0012] In the formula, p x,2j Represents the elements of even columns, p y,2j Represents the elements of the even-numbered rows. The array is two-dimensional, (n,2), where n represents the number of wind farms, 2 represents the longitude and latitude coordinates, so x represents longitude, y represents latitude, d represents the dimension of the feature, 2j represents even-numbered columns, and 2j+1 represents odd-numbered columns.
[0013] Preferably, the time position is encoded as follows:
[0014]
[0015] In the formula, i represents time, p i,2j Represents even-numbered elements, p i,2j+1 Represents an odd number of elements.
[0016] Preferably, the weather-new energy prediction model is based on the improved Swin-Transformer by stacking multiple layers of models to achieve multi-scale modeling of features, each layer including local window self-attention, shift window operation and fully connected layer.
[0017] Preferably, the shift window operation connects the information in different windows
[0018]
[0019] Where S is the number of pixels shifted, X ω represents the original features, Represents the shifted features.
[0020] The meteorological-wind power joint forecasting system based on the Swin-Transformer framework includes
[0021] The data acquisition module is used to obtain historical wind power time series power data and future meteorological grid forecast data;
[0022] The data processing module is used to perform time position encoding, spatial position encoding, and convolution on the acquired historical wind power time series power data and future meteorological grid forecast data, and output the initial features of the meteorological forecast array and historical power respectively, and merge and fill these two sets of initial features in the last dimension to form a new feature data;
[0023] The prediction module is used to input new feature data into the meteorological-new energy prediction model, output fused features, and convolute the fused features again with an MLP layer to obtain the final prediction result.
[0024] An electronic device comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of a meteorological-wind power joint prediction method based on a Swin-Transformer framework are implemented.
[0025] A storage medium stores computer executable instructions, which, when loaded and executed by a processor, implement the steps of a meteorological-wind power joint prediction method based on a Swin-Transformer framework.
[0026] Therefore, the present invention adopts the above-mentioned meteorological-wind power joint prediction method based on the Swin-Transformer framework, and the technical effects are as follows:
[0027] (1) It solves the problem that meteorological grid data and wind power time series data are inconsistent in modality and difficult to be effectively integrated and understood by machine learning models;
[0028] (2) It solves the problem that meteorological grid data has high redundancy and traditional machine learning models are difficult to effectively utilize and improve prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a flow chart of the meteorological-wind power joint prediction method based on the Swin-Transformer framework of the present invention;
[0030] Figure 2 To improve the model framework of Swin-Transformer, Figure 2 (a) is a weather-new energy prediction model based on the transformer framework; Figure 2 (b) is the transformer module based on the attention mechanism. DETAILED DESCRIPTION
[0031] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0032] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.
[0033] Embodiment 1
[0034] like Figure 1 As shown, the present invention proposes a short-term forecasting method for meteorological-wind power based on the Swin-Transformer framework, comprising the following steps:
[0035] Step 1: Obtain historical wind power time series data and future meteorological grid forecast data
[0036] The dimension of wind power time series data is 1×96, where 96 represents the 15-minute time interval in the past day, totaling 96 points; the dimension of future meteorological grid forecast data is 48×64×25, where 48 represents the hourly grid in the next 48 hours, 64 represents the 8×8 grid around the wind farm, and 25 represents meteorological elements, which are from ECMWF (European Centre for Medium-Range Weather The high-resolution forecast model of Shanghai Forecasts (meteorological elements include 200m wind speed, u component of 200m wind, v component of 200m wind, u component of 100m wind, v component of 100m wind, u component of 10m wind, v component of 10m wind, 2m temperature and terrain), Huawei's Pangu meteorological model (meteorological elements include 10m wind u component, 10m wind v component, 2m temperature, 1000hPa wind u component, 1000hPa wind v component, 1000hPa temperature, 1000hPa absolute humidity, 1000hPa potential), and Shanghai Artificial Intelligence Laboratory's Fengwu meteorological model (meteorological elements are the same as the Pangu model).
[0037] Step 2: Perform time position encoding, spatial position encoding, and convolution on the acquired historical wind power time series data and future meteorological grid forecast data, and output the initial features of the meteorological forecast array and historical power respectively. These two sets of initial features are merged and filled in the last dimension to form a new feature data.
[0038] Meteorological and power data need to be encoded with spatiotemporal positional encoding. For the spatial position encoding of meteorological data, first calculate the relative position of the wind farm station coordinates and the 8×8 meteorological grid coordinates, that is, the longitude and latitude of the wind farm station - the longitude and latitude of the meteorological grid, to form an array of (64,2) dimensions. Then, encode the coordinates through trigonometric functions to form a spatial position encoding of (1,64,25) dimensions, and then directly add it to the meteorological forecast data of (48,64,25) dimensions (the number of elements in the dimensions is different, and the broadcast mechanism is used to expand). The specific formula for spatial position encoding is as follows:
[0039]
[0040] In the formula, p x,2j Represents the elements of even columns, p y,2j The array is two-dimensional, (n, 2), where n represents the number of wind farms, 2 represents the longitude and latitude coordinates, so x represents longitude, y represents latitude, d represents the dimension of the feature, 2j represents even columns, and 2j+1 represents odd columns. Both meteorological data and power data need to be encoded with time and position. The time and position encoding of meteorological data is as follows:
[0041]
[0042] In the formula, i represents time, the value is [25,72], the step size is 1, and d is 25, forming an array of (48,1,25) dimensions, which is directly added to the weather forecast data. i,2j Represents even-numbered elements, p i,2j+1 The temporal position encoding of the power data is also obtained based on formulas (3) and (4), where i is [0, 24], the step size is 0.25, and d is 1, forming an array of (96, 1) dimensions that is directly added to the historical power data.
[0043] The weather forecast data passes through the convolution layer (Conv2d layer, Kernal = 2, Stride = 4) and outputs an array of (24, 16, C) dimensions; the historical power data passes through the convolution layer (Conv1d layer, Kernal = 4, Stride = 4) and outputs an array of (24, C) dimensions. The two arrays are merged in the last dimension to form an array of (24, 17, C) dimensions, and padded in the second dimension to finally form an array of (24, 18, C) dimensions.
[0044] Step 3: Input the new feature data into the meteorological-new energy prediction model, output the fused features, and convolute the fused features again with an MLP layer to obtain the final prediction result.
[0045] The above array is input into the improved Swin-transformer model. The model has 4 layers and the depths are 2, 6, 6, and 2 respectively. The specific model framework is as follows: Figure 2 As shown. The Transformer module consists of a multi-head self-attention mechanism (MSA) module and a nonlinear MLP module. Layer regularization (LN) is applied before each MSA module and each MLP, and residual connections are applied after each module. Among them, the local window self-attention mechanism is the core of Swin-Transformer. First, the input data X is divided into local windows of fixed size, each of which contains a part of the feature map. Assume that the size of the feature map is H×W×C, where H and W represent the height and width of the feature map, respectively, and C represents the number of channels. Within each M×M window, the model calculates self-attention to learn the relationship between the features within the window. Window partitioning is to divide the feature map X into multiple local windows X of size M×M. ω In this way, the features in each window can be processed separately. The feature matrix in the window calculates the query, key, and value vectors using the following formula:
[0046] Q=X ω W Q (5);
[0047] K=X ω W K (6);
[0048] V=X ω W V (7);
[0049] Where W Q ,W K ,W V is the learned weight matrix, Q, K, and V represent query, key, and value vectors, respectively. The attention mechanism uses query, key, and value vectors to calculate self-attention, and the attention output within the window is obtained by the following formula:
[0050]
[0051] Where, d k is the dimension of the key vector, the softmax function is used to calculate the weight, and the attention result is obtained by weighted average. The shift window operation is another important feature of Swin-Transformer. In order to achieve information interaction between windows, the feature window of each layer will be shifted before the self-attention calculation. This shift operation can be used to connect information in different windows, thereby enhancing the global context modeling ability of the model:
[0052]
[0053] Where S is the number of pixels shifted, X ω represents the original features, Represents the shifted features. By shifting the windows between different layers, the model can effectively combine the information between windows and further improve the accuracy of the prediction. In terms of feature fusion, Swin-Transformer achieves multi-scale modeling of features by stacking multiple layers of models. Each layer includes local window self-attention, shift window operation, and fully connected layer. The final features are processed by MLP to generate the final prediction output:
[0054] X out =MLP(LayerNorm(X in +Attention(X in ))) (10);
[0055] Finally, after passing through the Swin-transformer model, an array of (24, 18, 2C) dimensions is output, and then a convolutional layer (Conv2d layer, Kernal = 1, Stride = 1) and an MLP layer are passed to finally obtain a power prediction result of length 192.
[0056] The meteorological-wind power joint forecasting system based on the Swin-Transformer framework includes
[0057] The data acquisition module is used to obtain historical wind power time series power data and future meteorological grid forecast data;
[0058] The data processing module is used to perform spatiotemporal position coding convolution on the acquired historical wind power time series data and future meteorological grid forecast data, and output the initial features of the meteorological forecast array and historical power respectively, and merge and fill these two sets of initial features in the last dimension to form a new feature data;
[0059] The prediction module is used to input new feature data into the meteorological-new energy prediction model, output fused features, and convolute the fused features again with an MLP layer to obtain the final prediction result.
[0060] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0061] The present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0062] The present application also provides an electronic device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the electronic device may also include various network interfaces, power supplies and other components.
[0063] Therefore, the present invention adopts the above-mentioned meteorological-wind power joint prediction method based on the Swin-Transformer framework, which can fully mine the meteorological grid data and integrate it with the wind power time series data in a high-dimensional space, so as to better capture the spatiotemporal relationship between meteorology and wind power and achieve high-precision prediction of wind power.
[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A meteorological-wind power joint forecasting method based on the Swin-Transformer framework, characterized in that: The following steps are involved: Obtain historical wind power time series data and future meteorological grid forecast data; The acquired historical wind power time series power data and future meteorological grid forecast data are encoded in time position, encoded in space position, and convolved, and the initial features of the meteorological forecast array and historical power are output respectively. The two sets of initial features are merged and filled in the last dimension to form a new feature data; The new feature data is input into the meteorological-new energy prediction model, and the fused features are output. The fused features are convolved again and an MLP layer is used to obtain the final prediction result.
2. The meteorological-wind power joint prediction method based on the Swin-Transformer framework according to claim 1 is characterized in that: The specific formula for spatial position encoding is as follows: In the formula, p x,2j Represents the elements of even columns, p y,2j Represents the elements of the even-numbered rows. The array is two-dimensional, (n,2), where n represents the number of wind farms, 2 represents the longitude and latitude coordinates, so x represents longitude, y represents latitude, d represents the dimension of the feature, 2j represents even-numbered columns, and 2j+1 represents odd-numbered columns.
3. The meteorological-wind power joint prediction method based on the Swin-Transformer framework according to claim 1 is characterized in that: The time position is encoded as follows: In the formula, i represents time, p i,2j Represents even-numbered elements, p i,2j+1 Represents an odd number of elements.
4. The meteorological-wind power joint prediction method based on the Swin-Transformer framework according to claim 1 is characterized in that: The meteorological-new energy prediction model is based on the improved Swin-Transformer and realizes multi-scale modeling of features by stacking multiple layers of models. Each layer includes local window self-attention, shift window operation and fully connected layer.
5. The meteorological-wind power joint prediction method based on the Swin-Transformer framework according to claim 4 is characterized in that: Shift window operation connects information in different windows Where S is the number of pixels shifted, X ω represents the original features, Represents the shifted features.
6. The meteorological-wind power joint prediction system based on the Swin-Transformer framework is characterized by: include The data acquisition module is used to obtain historical wind power time series power data and future meteorological grid forecast data; The data processing module is used to perform time position encoding, spatial position encoding, and convolution on the acquired historical wind power time series power data and future meteorological grid forecast data, and output the initial features of the meteorological forecast array and historical power respectively, and merge and fill these two sets of initial features in the last dimension to form a new feature data; The prediction module is used to input new feature data into the meteorological-new energy prediction model, output fused features, and convolute the fused features again with an MLP layer to obtain the final prediction result.
7. An electronic device, characterized in that: It comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of the meteorological-wind power joint prediction method based on the Swin-Transformer framework as claimed in any one of claims 1 to 5 are implemented.
8. A storage medium, characterized in that: The storage medium stores computer executable instructions, which, when loaded and executed by the processor, implement the steps of the meteorological-wind power joint prediction method based on the Swin-Transformer framework as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Short-term wind power prediction method fusing multi-source information
CN111160621A
Wind power plant cluster short-term power prediction method based on space-time diagram convolutional neural network
CN112529282A
Wind power prediction method, system and equipment based on convolution transformer architecture
CN114021803A
Picture classification method based on improved SwinTransform
CN117132825A
Multi-wind power plant power prediction method based on attention space-time synchronization graph convolutional network
CN117498296A
Cited By
Wind power prediction method and device based on pre-trained big language model
CN120509768A
Wind field power prediction method
CN120745893A
Meteorological-new energy end-to-end power prediction method based on meteorological initial field driving
CN122136831A
Meteorological Initial Field-Driven End-to-End Power Prediction Method for Meteorological-Renewable Energy Sources
CN122136831B