Wind power prediction method and system based on spatiotemporal enhanced pre-trained large language model
By decomposing wind power time series based on spatiotemporally enhanced pre-trained large language model and combining spatial and temporal cues, the problem of wind speed uncertainty in wind power forecasting is solved, improving the accuracy of wind power forecasting and the degree of automation of the system, and reducing operating costs. .
Patent Information
- Application Number
- CN202410733333.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-07
AI Technical Summary
Uncertainty in wind speed in wind power forecasting causes wind turbine output power to fluctuate, affecting the stability and reliability of the power system. Existing technologies are difficult to effectively solve this problem.
Using a pre-trained large language model (STELLM) based on spatiotemporal enhancement, by decomposing the wind power time series into seasonal and trend parts, combined with spatial and temporal cues, and using Laplacian position encoding and k-shape algorithm, the wind power is learned. The spatial and temporal dependencies between prediction models are enhanced to enhance the spatiotemporal modeling capabilities of the prediction model.
It improves the accuracy and reliability of wind power prediction, reduces the need for manual intervention and management, reduces system operation and maintenance costs, and improves the automation and operability of the system.
Smart Images

Figure CN118313463B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of spatiotemporal wind power prediction, and in particular relates to a wind power prediction method and system based on a spatiotemporal enhanced pre-trained large language model. Background Art
[0002] As a non-polluting renewable energy source, wind energy has become a research focus. Wind power generation faces the strong randomness of wind speed, which brings some challenges to practical applications. The uncertainty of wind speed causes the output power of wind turbines to fluctuate, which may affect the stability and reliability of the power system. In order to overcome these problems, spatiotemporal wind power forecasting becomes a vital tool.
[0003] The main goal of spatiotemporal wind power forecasting is to use historical observation data to predict future changes in wind speed and wind energy. By analyzing past wind speed patterns, meteorological data, and other relevant information, the forecasting model can generate a series of forecast results to help wind power system operators make more informed decisions. These decisions can include adjusting power generation plans, backup power arrangements, and the management of power networks to better cope with future fluctuations in wind power.
[0004] Accurate wind power forecasting is crucial to the stability and safety of wind power systems. If system operators can understand future power changes in advance, they can take appropriate measures to balance power production and demand, thereby reducing the impact of power fluctuations on the power network. This helps maintain the stability of the power system and prevent power fluctuations caused by wind speed fluctuations.
[0005] Therefore, spatiotemporal wind power forecasting not only helps optimize the operation of wind power generation, but also improves the reliability and stability of the power system. By continuously improving forecasting technology and models, the volatility of wind energy can be minimized, so that it can be better integrated into the power network and promote the sustainable development of renewable energy. Summary of the invention
[0006] To solve the above technical problems, the present invention provides a wind power prediction method and system based on spatiotemporal enhanced pre-trained large language model (STELLM). The method first decomposes the wind power time series into seasonal and trend parts, aiming to extract the complex coupled patterns in the wind power sequence. Then, the wind power sequence is converted into input tags of large language models (LLMs) using patch and channel independence strategies. The patch rearranges the sequence into subsequence-level tags to capture the local semantic information of the Transformer model. In order to enhance the spatiotemporal modeling capability of LLMs, spatial and temporal cues are introduced to integrate spatiotemporal context information with the input representation. Specifically, Laplace position encoding is used to generate spatial cues to effectively represent the structural and positional features of wind turbines. For temporal cues, the k-shape algorithm is used on the historical wind power sequence data to learn a set of representative local temporal patterns. The backbone network only models the temporal dependencies in the wind power sequence, while ignoring the spatial correlations between wind turbines. Considering this, a local spatial module is supplemented to capture spatial features from the representations of these wind turbines and enhance spatiotemporal modeling, thereby further improving the prediction performance. Subsequently, the output of the local spatial module is finally transformed to obtain the prediction result.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] The wind power prediction method based on the spatiotemporal enhanced pre-trained large language model includes the following steps:
[0009] Step 1: Collect wind power data of each wind turbine in the region, wherein the wind power data includes measured meteorological data and historical power generation data;
[0010] Step 2: Decompose the wind power data into trend items and period items;
[0011] Step 3: constructing spatial prompts and time prompts based on the wind power data after decomposition of trend items and period items;
[0012] Step 4: Combine spatial cues and temporal cues with the pre-trained large language model to predict future wind power representations;
[0013] Step 5: Input the predicted future wind power representation into the local space module to learn the spatial dependency between wind turbines and output the predicted power generation data.
[0014] On the other hand, the present invention also provides a wind power prediction system based on a spatiotemporal enhanced pre-trained large language model, which can execute the above method and includes the following modules:
[0015] A data collection module is used to collect wind power data of each wind turbine in the region, wherein the wind power data includes measured meteorological data and historical power generation data;
[0016] The spatiotemporal wind power prediction module is used to input the collected historical power generation data of each wind turbine into the wind power prediction model to generate future prediction data of each wind turbine. The wind power prediction model includes a sequence decomposition module, a spatiotemporal prompt module, a pre-trained large language model and a local space module;
[0017] The model optimization module is used to train and optimize the spatiotemporal wind power prediction module. After obtaining the future prediction data, it collects the corresponding measured future power data and feeds back the error between the future prediction data and the measured future power data to the model optimization module, so that it can continuously correct the model parameters of the spatiotemporal wind power prediction module and finally reach the set error threshold.
[0018] The beneficial effects of the present invention are as follows: by utilizing the spatiotemporal enhanced pre-trained large language model, a large amount of language information and background knowledge is learned, the system can better capture the spatiotemporal characteristics in wind power forecasting, have a higher level of intelligence, and improve the generalization ability of the system in different scenarios, thereby improving the accuracy and reliability of the prediction, so that the system can better understand and analyze various complex situations in wind power forecasting; in addition, with the help of the intelligent capabilities of the pre-trained large language model, the system can reduce the need for manual intervention and management, reduce the cost and difficulty of system operation and maintenance, and improve the system's degree of automation and operability. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flow chart of the wind power prediction method based on the spatiotemporal enhanced pre-trained large language model of the present invention;
[0020] Figure 2 It is a structural schematic diagram of the wind power prediction system based on the spatiotemporal enhanced pre-trained large language model of the present invention. DETAILED DESCRIPTION
[0021] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0022] The present invention proposes a wind power prediction method and system based on a spatiotemporal enhanced pre-trained large language model. The method is divided into three stages. The first stage is to collect historical meteorological data and power output data of each wind power site in the area; the second stage is to perform dynamic spatiotemporal modeling on each power generation site, and predict the power output data of each site in the future through the STELLM model we proposed; the third stage is to continuously collect new site historical data and continuously iterate and optimize the model, aiming to continuously improve the accuracy of wind power prediction. The main technical points involved are as follows:
[0023] Series decomposition: In order to capture the complex temporal patterns in wind power time series, the wind power series is decomposed into trend and seasonal parts, which represent the long-term trend and potential periodicity respectively. Multiple average filters of different sizes are used to extract trend patterns of different scales, and then data-dependent weights are learned and combined to produce the final trend part.
[0024] Spatiotemporal cues: To enhance the spatial modeling capability of LLMs, the graph Laplacian eigenvectors, which preserve the topological structure information of wind turbines, are used to construct spatial cues. This enables LLMs to learn geographic features and capture the location distribution knowledge of wind turbines. For temporal cues, a k-shape algorithm is applied to the historical wind power series data to learn a set of representative local temporal patterns. Then, similar patterns are selected as temporal cues to provide short-term temporal information for the input tokens.
[0025] Pre-trained Large Language Model (STELLM): In STELLM, GPT-2 is adopted as the backbone model for pre-training LLMs. In order to efficiently capture the decoupled temporal patterns in wind power sequences, two GPT modules are used to model different semantic information in trend and seasonal components respectively. For each GPT module, only the self-attention block and position encoding are retained. In order to retain the basic knowledge in the pre-trained LLMs, the multi-head attention and feed-forward layers in the self-attention block are frozen, which contain most of the parameters.
[0026] Local spatial module: The backbone model encodes the temporal dependency of wind power sequences, but ignores the spatial correlation between wind turbines. The wind conditions of neighboring wind turbines, such as wind speed and direction, can further help the power forecast of the target wind turbine. In order to make full use of this information and model the spatial dependency between wind turbines, a local spatial module is designed, which considers the historical local time series information from neighboring wind turbines to predict the wind power of the target wind turbine.
[0027] Embodiment 1
[0028] like Figure 1As shown, it is a flow chart of the wind power prediction method based on the spatiotemporal enhanced pre-trained large language model of the present invention. Sequence decomposition is used to decompose the wind power sequence input data into seasonal term and trend term components, and different input representation characteristics are captured from the decoupled patterns. In order to give LLMs spatiotemporal modeling capabilities, spatial cues and temporal cues are introduced to integrate short-term temporal patterns and the geographical distribution information of wind turbines to enrich the input wind power sequence. In addition, two GPT modules (pre-trained large language model (GPT-1) and pre-trained large language model (GPT-2)) are used to simulate different semantic information in trend and seasonal components respectively, and the autoregressive fine-tuning strategy is used to align LLMs with wind power sequence data to learn patch-level representations. These representations are then input into a local space module, and the spatial dependencies between wind turbines are captured through the predicted linear layer.
[0029] The present invention provides a wind power prediction method based on a spatiotemporal enhanced pre-trained large language model, comprising the following steps:
[0030] Step 1: Collect wind power data of each wind power station in the region, wherein the wind power data includes measured meteorological data and historical power generation data;
[0031] Step 2: Decompose the wind power data into periodic items and trend items;
[0032] Step 3: Construct time prompts and space prompts based on the decomposed period items and trend items;
[0033] Step 4: Combine temporal and spatial enhancements with a pre-trained large language model (GPT-2) to predict future wind power representations;
[0034] Step 5: Input the future wind power representation into the local spatial module to learn the spatial dependencies between wind turbines and output the predicted power generation data.
[0035] Furthermore, the step 1 comprises:
[0036] Collect wind power data from each wind turbine in the area and define Indicates at time Down Power generation data, given the power generation data within L steps of historical observations , defining the wind power forecasting task as predicting the future The power output data of each wind turbine within the step time , R represents the field of real numbers.
[0037] Furthermore, the step 2 comprises:
[0038] The power generation within L steps of historical observations is transformed into Transformed into high-dimensional representation , expressed as , where Conv1d represents a standard one-dimensional convolution, is the dimension of the hidden state. The wind power data is decomposed into periodic terms and trend terms. The formula for the decomposition process is:
[0039] ,
[0040]
[0041] in, are learnable data-dependent weights, represents a series of average pooling filters, represents the trend term after decomposition, is the decomposed periodic term, represents the normalized exponential function, Represents the element-wise product operation, based on the trend term and period term obtained after decomposition , , we construct trend patches and season patches respectively as ,in is the number of trend patches and the number of season patches, and P represents the length of the constructed trend patches and the length of the season patches.
[0042] Furthermore, the step 3 comprises:
[0043] Using graph Laplacian eigenvectors, constructing spatial hints, and pre-defining adjacency matrices , where exp() represents the exponential function, For wind turbines and The Euclidean distance between and is a natural number, Represents the predefined weight coefficients, and the Laplace eigenvector is calculated by factoring the standardized Laplace matrix, that is:
[0044]
[0045] in, represents the normalized Laplacian matrix, represents the identity matrix, represents the angle matrix, Represents the total adjacency matrix of all wind turbines, where for different wind turbines and The adjacency matrix between is represented as a predefined adjacency matrix , and are the eigenvalue matrix and the eigenvector matrix respectively, and the superscript T represents the transpose of the matrix. , we use a linear layer to project the matrix into a high-dimensional representation to obtain the set of spatial cues we need ;in They respectively represent the spatial prompts of the 1st, 2nd, ...Nth wind turbines.
[0046] For time hints, the historical power generation data is divided into a set of patches with a length of 2P, and then a k-shape clustering algorithm is performed on this set of patches to obtain a set of representative time patterns, which encode the local semantic features of the historical power generation data. The wind power characteristic set of a wind turbine is expressed as ,in is the number of clusters, Respectively represent The 1st, 2nd, ..., Kth wind power features of a wind turbine; a high-dimensional representation of the initial input Perform patch processing to generate non-standardized patches , from the unnormalized patch Extract the Wind turbine patch and compare it with Wind power characteristics set of wind turbines They are input together into three randomly initialized linear layers to generate three feature matrices, namely query matrix, key matrix, and value matrix, as shown below:
[0047] , ,
[0048] in, is the corresponding feature matrix The learnable projection matrix, Respectively The first P length sequences and the last P length sequences in , where is the corresponding query matrix, is the corresponding key matrix, is the corresponding value matrix, Perform the criss-cross attention operation as follows:
[0049] ,
[0050] Among them, Wind turbine time reminder Adaptively integrate representative temporal patterns according to the input patches as temporal cues to encode temporal knowledge and guide the final wind power prediction, represents the attention mechanism, represents the normalized exponential function. The collection of matrices constitutes the time prompt collection of all wind turbines .
[0051] Further, the step 4 comprises:
[0052] GPT-2 is used as the backbone model of the pre-trained large language model. The first GPT module and the second GPT module are used to simulate different semantic information in the trend and periodic components respectively. Trend patches for wind turbines and time reminder , concatenate them into a high-dimensional representation as follows:
[0053]
[0054] in, is the time-enhanced input A learnable projection matrix, where represents the temporally augmented input, where Indicated in The Mth step has a one-to-one correspondence with the number of trend patches M, which incorporates representative local patterns. Next, we add spatial cues before the temporally enhanced input to obtain the spatiotemporally enhanced input , as shown below:
[0055] ,
[0056] Put the input features into the first GPT module, learn the patch-level representation, and obtain the model output of the trend term Based on a similar process, the second GPT module is used to obtain the model output of the periodic term , combining the model outputs of the periodic term and the trend term to obtain the final Wind power characterization output for each wind turbine N wind turbines obtain their own wind power characterization outputs and combine them to form a wind power characterization output set .
[0057] Further, the step 5 comprises:
[0058] Design local space modules to output sets from the model Get the local representation matrix
[0059] ,in is the size of the local kernel, and the graph convolution operation is performed to aggregate neighbor information. q represents the number of elements in the local representation matrix obtained. In addition, we also designed an adaptive adjacency matrix, which uses two randomly initialized wind matrices to learn the adaptive adjacency matrix graph structure, and trains these two randomly initialized wind matrices in an end-to-end manner. Finally, we get the adaptive adjacency matrix ,as follows:
[0060]
[0061] in, represents two randomly initialized wind matrices, and are two randomly initialized wind matrices after the hyperbolic tangent activation function, is the corresponding two randomly initialized wind matrices , The mapping matrix, is the dimension of the randomly initialized wind matrix, is the hyperbolic tangent activation function, is a linear rectifier activation function. The total adjacency matrix of all wind turbines is and the adaptive adjacency matrix , the above graph convolution operation can be re-expressed as:
[0062] ,
[0063] in, and denote the learnable projection matrices corresponding to the total adjacency matrix and the adaptive adjacency matrix of all wind turbines, respectively. It represents the Layer space representation, where
[0064] , a represents the index of local time, Indicates Here we define the number of layers of graph convolution as , after After layer convolution, these representations are obtained Combined together, the final spatial representation is generated and the predicted power generation data is output.
[0065] Embodiment 2
[0066] like Figure 2As shown, the present invention provides a wind power prediction system based on a pre-trained large language model with spatiotemporal enhancement, comprising the following modules:
[0067] A data collection module, used to collect historical power data of wind power stations in the region;
[0068] A spatiotemporal wind power prediction module, which is used to input the collected historical power data of each wind power site into the wind power prediction model constructed in the first embodiment to generate the predicted power generation data of each wind power station in the future (i.e., future prediction data). The wind power prediction model includes a sequence decomposition module, a spatiotemporal prompt module, a pre-trained large language model and a local space module;
[0069] The model optimization module is used to train and optimize the power spatiotemporal wind power prediction module. After obtaining the future prediction data, it collects the subsequent corresponding measured power generation (i.e., future power data), and feeds back the error between the future prediction data and the future power data to the model optimization module, so that it can continuously correct the model parameters of the spatiotemporal wind power prediction module, and finally reach the set error threshold to achieve accurate prediction of regional power generation.
[0070] The above embodiments are provided only for the purpose of describing the present invention, and are not intended to limit the scope of the present invention. The scope of the present invention is defined by the appended claims. Various equivalent substitutions and modifications made without departing from the spirit and principles of the present invention should all be included within the scope of the present invention.
Claims
1. A wind power prediction method based on a spatiotemporal enhanced pre-trained large language model, characterized in that: The steps include: Step 1: Collect wind power data of each wind turbine in the region, wherein the wind power data includes measured meteorological data and historical power generation data; Step 2: Decompose the wind power data into trend items and period items; Step 3: Construct spatial and temporal cues; Step 4: Combine spatial cues and temporal cues with the pre-trained large language model to predict future wind power representations; Step 5: Input the predicted future wind power representation into the local space module to learn the spatial dependency between wind turbines and output the predicted power generation data; Wherein, the step 3 of constructing the space hint includes: pre-defining the adjacency matrix , where exp() represents the exponential function, For different wind turbines Hefeng Motor The Euclidean distance between and Represents the predefined weight coefficients, and the Laplace eigenvectors are calculated by factorizing the normalized Laplace matrix: , in, represents the normalized Laplacian matrix, represents the identity matrix, represents the angle matrix, Represents the total adjacency matrix of all wind turbines, where for different wind turbines and The adjacency matrix between is represented as a predefined adjacency matrix , and They are the eigenvalue matrix and eigenvector matrix respectively, and the superscript T indicates the transpose of the matrix; A linear layer is used to transform the feature vector matrix Projecting into a high-dimensional representation, we get a set of spatial cues ,in Respectively represent the spatial prompts of the 1st, 2nd, ...Nth wind turbines; The construction of time hints includes: dividing the historical power generation data into a group of patches with a length of 2P, and performing a k-shape clustering algorithm on the group of patches to obtain a group of representative time patterns, which encode the local semantic features of the historical power generation data, namely, wind power features, and The wind power characteristic set of a wind turbine is expressed as ,in represents the number of clusters, Respectively represent The 1st, 2nd, ..., Kth wind power features of a wind turbine; a high-dimensional representation of the initial input Perform patch processing to generate non-standardized patch B , a high-dimensional representation of the initial input The expression is , where Conv1d represents a standard one-dimensional convolution, Represents the dimension of the hidden state, the power generation data set within L steps of historical observation ,from Extract the first Wind turbine patch and compare it with Wind power characteristics set of wind turbines Input together into three randomly initialized linear layers to generate three feature matrices , , , as shown below: , in, is the corresponding feature matrix The learnable projection matrix, It corresponds to The learnable projection matrix, Respectively represent Wind power characteristics set of wind turbines The first P length sequences and the last P length sequences in the three feature matrices Perform a cross-attention operation: , Among them, Wind turbine time reminder , represents the attention mechanism, Represents a normalized exponential function. N wind turbines obtain their own time prompts and then combine them to form a time prompt set .
2. The wind power prediction method based on a spatiotemporal enhanced pre-trained large language model according to claim 1, characterized in that: The step 1 comprises: Collect wind power data of each wind turbine in the area and define Indicates at time Down The wind power prediction task is defined as predicting the future The power output data of each wind turbine within the step time , R represents the field of real numbers.
3. The wind power prediction method based on a spatiotemporal enhanced pre-trained large language model according to claim 2, characterized in that: The step 2 comprises: The convolutional network is used to collect the historical observation of power generation data within L steps. Transformed into high-dimensional representation , decompose the trend term and cycle term of wind power data: , , in, represents the trend term after decomposition, represents the decomposed periodic term, represents the normalized exponential function, represents the learnable data-dependent weights, represents a series of average pooling filters, Represents the element-wise product operation, based on the decomposed trend term and the decomposed periodic terms , construct trend patches respectively and Season Patches , ,in represents the number of trend patches and the number of season patches, and P represents the length of the constructed trend patches and the length of the season patches.
4. The wind power prediction method based on a spatiotemporal enhanced pre-trained large language model according to claim 3 is characterized in that: The step 4 comprises: GPT-2 is used as the backbone model of the pre-trained large language model. The first GPT module and the second GPT module are used to simulate different semantic information in the trend term and the cycle term components respectively. Trend patches for wind turbines and time reminder , and concatenate the two into a high-dimensional representation: , in, represents the time-augmented input, Indicated in The input of the time enhancement in the Mth step has a one-to-one correspondence with the number of trend patches M. is the time-enhanced input The learnable projection matrix, after temporal augmentation of the input Before adding space hint: , represents the spatiotemporally enhanced input, spatial prompts; The spatiotemporally enhanced input Put it into the first GPT module, learn the patch-level representation, and obtain the model output of the trend item , using the second GPT module to obtain the model output of the periodic term , combining the model outputs of the periodic term and the trend term to obtain Wind power characterization output for each wind turbine , N wind turbines obtain their own wind power characterization outputs and combine them to form a wind power characterization output set .
5. The wind power prediction method based on a spatiotemporal enhanced pre-trained large language model according to claim 4 is characterized in that: The step 5 includes inputting the predicted future wind power representation into the local space module to learn the spatial dependency between wind turbines and output the predicted power generation data: Design local spatial modules to output a collection of wind power characterization outputs Obtain local wind power characterization matrix , perform graph convolution operations to aggregate neighbor information, where represents the number of elements of the local wind power characterization matrix obtained, and q represents the index of the patch; design an adaptive adjacency matrix , using two randomly initialized wind matrices to learn the adaptive adjacency matrix graph structure, and training the two randomly initialized wind matrices in an end-to-end manner, , , in, Represent two randomly initialized wind matrices, and They represent two randomly initialized wind matrices after the hyperbolic tangent activation function operation, Respectively represent the corresponding two randomly initialized wind matrices , The mapping matrix, is the dimension of the randomly initialized wind matrix, is the hyperbolic tangent activation function, is the linear rectification activation function; Combine the total adjacency matrix of all wind turbines and , the graph convolution operation is defined as: , in, and Represent the total adjacency matrix corresponding to all wind turbines and A learnable projection matrix of the adjacency matrix, Indicates the aggregated Layer space representation, initial space representation ,in represents the local wind power representation, a represents the index of the local time, Indicates Local wind power characterization of the layer; The number of layers of graph convolution is defined as , after After the layer graph convolution, the aggregated spatial representation of all layers is obtained Combined together, the final spatial representation is generated and the predicted power generation data is output.
6. A wind power prediction system based on a spatiotemporal enhanced pre-trained large language model, used to execute the method according to any one of claims 1 to 5, characterized in that: Includes the following modules: A data collection module is used to collect wind power data of each wind turbine in the region, wherein the wind power data includes measured meteorological data and historical power generation data; The spatiotemporal wind power prediction module is used to input the collected historical power generation data of each wind turbine into the wind power prediction model to generate future prediction data of each wind turbine. The wind power prediction model includes a sequence decomposition module, a spatiotemporal prompt module, a pre-trained large language model and a local space module; The model optimization module is used to train and optimize the spatiotemporal wind power prediction module. After obtaining the future prediction data, it collects the corresponding measured future power data and feeds back the error between the future prediction data and the measured future power data to the model optimization module, so that it can continuously correct the model parameters of the spatiotemporal wind power prediction module and finally reach the set error threshold.
