An offshore wind power prediction method based on dual-channel neural network with attention mechanism

Through the attention mechanism, the dual-channel neural network of ConvLSTM and ConvGRU is integrated, and the problem of insufficient utilization of space-time information in offshore wind speed prediction is solved, and more accurate wind power prediction is achieved, adapting to different wind speed conditions and improving the management of wind farms. efficiency.

CN118611059BActive Publication Date: 2024-11-01HAINAN RES INST OF ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411078044.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-01
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

Traditional offshore wind speed prediction methods are difficult to accurately capture the trend of wind speed change, especially under different wind speed conditions. There are limitations in using ConvLSTM or ConvGRU network alone, making it difficult to make full use of space-time information.

Method used

The ConvLSTM-ConvGRU dual-channel neural network based on attention mechanism is adopted. The time series and spatial distribution characteristics are processed by constructing two submodules of ConvLSTM and ConvGRU, and the feature fusion is performed through the attention mechanism, and the feature importance is dynamically adjusted to improve prediction accuracy.

Benefits of technology

It significantly improves the accuracy and reliability of power generation prediction of offshore wind power equipment, adapts to prediction under different wind speed conditions, and enhances the operation management and optimization capabilities of wind farms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118611059B_ABST
    Figure CN118611059B_ABST
Patent Text Reader

Abstract

The present invention discloses an offshore wind power prediction method of an attention mechanism dual-channel neural network. The present invention improves the accuracy and reliability of prediction by using a ConvLSTM‑ConvGRU dual-channel neural network. The specific technical scheme includes key steps such as data collection and preprocessing, dual-channel neural network model design, attention mechanism feature fusion, prediction model design, performance evaluation and optimization; firstly, historical data of environmental parameters such as wind speed, wind direction, and temperature are collected, and after feature screening, they are cleaned, filled, and normalized to improve the convergence speed and prediction performance of the model; the dual-channel neural network model processes feature data under time series of different lengths in parallel, and uses the attention mechanism to dynamically adjust the weights of different features to achieve feature fusion. The present invention is mainly used for the operation and management of wind farms, has strong adaptability and real-time performance, and meets the real-time monitoring and scheduling requirements of offshore wind farms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of electrical engineering technology, and in particular relates to a method for predicting the power generation of offshore wind power equipment based on an attention ConvLSTM-ConvGRU dual-channel neural network. Background Art

[0002] As an efficient and clean energy solution, offshore wind power plays an increasingly important role in the transformation of the global energy structure. The power generation of offshore wind turbines is directly affected by wind speed, so accurate prediction of wind speed is crucial for the economic operation of wind farms and the stable operation of power grids. However, the change of offshore wind speed is highly complex and uncertain, especially under different wind speed conditions, traditional prediction methods often have difficulty in accurately capturing its changing trend.

[0003] With the development of deep learning technology, researchers have begun to explore the application of these advanced machine learning technologies to wind speed forecasting and wind power forecasting. Convolutional long short-term memory network (ConvLSTM) and convolutional gated recurrent unit (ConvGRU) are two neural network structures that perform well in sequence data processing. ConvLSTM can effectively capture long-term dependencies in time series data through the combination of convolution units and LSTM units, and is suitable for processing time correlation in wind speed data. ConvGRU, on the other hand, is better at capturing dynamic changes in spatially distributed data through the combination of convolution units and GRU units, and is suitable for processing spatial correlation in wind speed data.

[0004] Although these two network structures have shown strong performance when used alone, they still have their own limitations when dealing with offshore wind speed prediction problems. Under different wind speed conditions, one channel may provide more accurate information than the other. In order to overcome these limitations and take full advantage of the advantages of both networks, a prediction method that can combine the two and perform effective feature fusion is needed. Summary of the invention

[0005] In order to solve the problems existing in the background technology, the present invention aims to provide a dual-channel neural network combining ConvLSTM and ConvGRU, which performs feature fusion through the attention mechanism to improve the accuracy and reliability of power generation prediction of offshore wind power equipment under different wind speed conditions.

[0006] The present invention proposes a ConvLSTM-ConvGRU dual-channel neural network based on an attention mechanism, which is used to predict the power generation of offshore wind power equipment. The method processes time series and spatial distribution features by constructing two submodules, ConvLSTM and ConvGRU, respectively, and then fuses the outputs of the two submodules through an attention mechanism to improve the model's prediction accuracy for wind power changes under different wind speed conditions. This method can not only make full use of the spatiotemporal information in wind speed data, but also dynamically adjust the importance of different features through an attention mechanism, thereby more accurately predicting the power generation of offshore wind power equipment under different wind speed conditions, providing strong support for the operation management and optimization of wind farms.

[0007] The technical solution adopted by the present invention is as follows:

[0008] 1. An offshore wind power prediction method based on dual-channel neural network with attention mechanism

[0009] The following steps are involved:

[0010] S1: Collect historical wind field data;

[0011] S2: data preprocessing;

[0012] S3: Construct a dual-channel neural network model integrating attention mechanism features;

[0013] S3.1: Design the ConvLSTM channel and the ConvGRU channel, and perform preliminary fusion of the output features of the two channels through the fully connected layer;

[0014] S3.2: Attention mechanism feature fusion: Apply the multi-head self-attention mechanism module to the initially fused features, and obtain the final wind power prediction result through the fully connected layer of the self-attention mechanism module;

[0015] S4: Model training and optimization;

[0016] S5: Input the wind speed monitored in real time into the model trained in step S4 for prediction processing, output the corresponding wind power, and realize real-time prediction of wind power.

[0017] The process of collecting historical wind field data in step S1 is specifically as follows:

[0018] Arrange sensor points at different heights of the unit, and collect historical data of wind speed at different heights and wind farm power generation through historical records of offshore wind farms;

[0019] Historical wind field datasets usually contain rich meteorological information, such as wind speed, wind direction, temperature, and air pressure. However, too many input features may complicate the model training process and make it difficult to achieve effective fitting. In order to optimize model performance, we may need to filter or reduce the dimensionality of these features to ensure that the model can capture key information while maintaining high training efficiency.

[0020] The Pearson correlation coefficient (PCC) or the maximum mutual information coefficient (MIC) method is used to calculate the correlation coefficient between the wind farm's power generation and wind speeds at different heights, and then feature screening is performed, and the two sets of historical data on wind speed and power generation with the highest correlation are used as input features of the model.

[0021] The method for data preprocessing in step S2 includes:

[0022] Data cleaning: Eliminate data points that are out of the normal range or abnormal data caused by sensor failure;

[0023] Missing value processing: linear interpolation is used to fill in missing data;

[0024] Normalization: In order to improve the convergence speed and prediction performance of the model, all input data are normalized to a range between [0,1]. The Min-Max normalization method is used, and the formula is:

[0025] X'=(x i -min(x)) / (max(x)-min(x))

[0026] Among them, x is a certain type of feature, including wind speed or power; x i is the i-th data of a certain type of feature, and X' is the normalized data.

[0027] The dual-channel neural network model of step S3 includes two submodules, namely, the ConvLSTM channel and the ConvGRU channel, which process the same input content in parallel, aiming to improve the accuracy of the prediction of the power generation of offshore wind power equipment. Both channels are designed to capture the impact of wind speed on power generation, but they may show different prediction accuracy in different wind speed ranges. By combining the prediction results of the two channels, the network can more comprehensively understand and predict the power generation performance of wind power equipment.

[0028] The dual-channel neural network model includes an input layer, a convolution processing unit, an LSTM module, a GRU module, a self-attention mechanism module and an output layer. The input layer, the convolution processing unit, and the LSTM module constitute the ConvLSTM channel, and the input layer, the convolution processing unit, and the GRU module constitute the ConvGRU channel. After the outputs of the ConvLSTM channel and the ConvGRU channel are feature fused, the multi-head self-attention module is used to predict the power generation of offshore wind power equipment.

[0029] The input data of the input layer are two sets of historical data of wind speed and power generation with the highest correlation;

[0030] The convolution processing unit is composed of a plurality of sequentially connected convolution layers, pooling layers and fully connected layers; the convolution layer uses a set of learnable convolution kernels to extract local features and perform convolution operations on the input data; the data processed by the convolution layer is downsampled through the pooling layer to reduce the spatial scale of the feature map; finally, the pooled feature data is spliced ​​through the fully connected layer as the input data of the subsequent neural network; the fully connected layer includes two steps, Dropout and gradient clipping, and gradient clipping is used to prevent gradient explosion; after the convolution operation of the convolution layer, the ReLU The activation function introduces nonlinearity;

[0031] The LSTM module includes T LSTM units, the input of the first LSTM unit is the output of the convolution processing unit, and the input of the remaining LSTM units is the output of the convolution processing unit and the output of the previous LSTM unit; the outputs of the T LSTM units are spliced ​​as the final output of the ConvLSTM channel;

[0032] The GRU module includes T GRU units, the input of the GRU unit is the output of the convolution processing unit, the input of the first GRU unit is the output of the convolution processing unit, and the input of the remaining GRU units is the output of the convolution processing unit and the output of the previous GRU unit; the outputs of the T GRU units are concatenated as the final output of the ConvGRU channel;

[0033] The self-attention mechanism module includes:

[0034] The output of the ConvLSTM channel and the output of the ConvGRU channel are concatenated as the input X of the multi-head self-attention module origin ;

[0035] Split the input sequence into h heads, each head has a dimension of d k = d model / h , and add the corresponding positional encoding to the input:

[0036] P( l,2k )=sin( l / 10000 (2k / d model ) )

[0037] P( l,2k+ 1)=cos( l / 10000 (2 / d model ) )

[0038] Among them, P() is the position code, l is the temporal position corresponding to the position code, k 0 to 0.5 d model Integer value between -1;

[0039] For sequence length L and model dimension d model , create an L× d model The position encoding matrix PE is:

[0040] Add the positional encoding matrix PE to the input sequence: X = X origin +PE, so that the input data X at each time step origin Contains position information, X is the input sequence after adding position encoding;

[0041] Apply three different linear transformations to the input sequence X to obtain the query Q (Query), key K (Key), and value V (Value):

[0042] Q=XW Q

[0043] K=XW K

[0044] V=XW V

[0045] Among them, W Q , W K , W V are weight matrices respectively;

[0046] Use the Softmax function to normalize the attention score and get the attention weight:

[0047] Softmax ( x i )= e xi / Σ i e xi

[0048] in, x i It is the characteristic i individual data;

[0049] Use the attention weight obtained by Softmax to weight the Value:

[0050] A( Q,K,V )= Softmax ( QK T / d k 1 / 2 ) V

[0051] in, QK T / d k 1 / 2 is the attention score;

[0052] The features are fused through the fully connected layer, specifically:

[0053] FC=W FC ·A( Q,K,V )+ b FC

[0054] in, W FC is the weight matrix of the fully connected layer, b FC is the bias term;

[0055] Finally, it is output through a linear layer, and the output of the linear layer is directly used as the prediction result of the power generation:

[0056] P = W out · FC + b out

[0057] in, W out is the weight matrix of the output layer, b out is the bias term.

[0058] During the training and optimization process of step S4:

[0059] Using mean square error as loss function, loss function L The expression is:

[0060] L=1 / n; Σ i=1 ( P i -P actual,i ) 2

[0061] in, n is the sample size, P i The model predicts i The power generation of each sample, P actual,i The actual i The power generation of each sample, i=1~n ;

[0062] The training optimization is realized through the optimizer to reduce the RMSE; the Adam optimizer is selected as the optimization method for the model parameters. The update rule of the Adam optimizer is:

[0063] v t = β 1 v t-1 + (1- β 1) ▽ θ L

[0064] s t =β 2 s t-1 + (1- β 2)·(▽ θ L ) 2

[0065] i t+1 =θ t –( or / ( s t / (1- β 2 t ) ) 1 / 2 )- v t

[0066] in, i are model parameters, L is the loss function, v t ands t are estimates of the first and second moments of the gradient, respectively, β 1 and β 2 is the decay rate, or is the learning rate.

[0067] In step S5, the root mean square error is used as an evaluation indicator.

[0068] 2. A terminal

[0069] The terminal includes a memory, a processor, and an offshore wind power prediction program stored in the memory and executable on the processor. When the processor executes the offshore wind power prediction program, the offshore wind power prediction method of the attention mechanism dual-channel neural network is implemented.

[0070] 3. A computer-readable storage medium

[0071] The computer-readable storage medium stores an offshore wind power prediction program. When the offshore wind power prediction program is executed by the processor, the offshore wind power prediction method of the attention mechanism dual-channel neural network is implemented.

[0072] The beneficial effects of the present invention are:

[0073] 1) Improving prediction accuracy: By combining the ConvLSTM and ConvGRU dual-channel neural networks, the present invention can more comprehensively capture the time series characteristics and spatial distribution characteristics of the power generated by offshore wind power equipment, significantly improving the prediction accuracy.

[0074] 2) Strong adaptability: The introduction of the attention mechanism enables the model to adaptively focus on the features that are more important to the current prediction task, thereby maintaining high prediction accuracy under different wind speed conditions. The fusion of the dual-channel neural network structure and the attention mechanism improves the generalization ability of the model, enabling it to adapt to different wind farm environments and working conditions.

[0075] 3) Real-time performance: The system design takes into account the needs of real-time data processing, and can respond quickly and provide prediction results to meet the needs of real-time monitoring and scheduling of offshore wind farms.

[0076] In summary, the present invention relates to the technical field of power generation prediction of offshore wind power equipment, and in particular to a dual-channel neural network prediction method and system based on deep learning, which has the advantages of significantly improving the prediction accuracy and management efficiency of power generation of offshore wind power equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1This is a structural diagram of the dual-channel neural network model based on the self-attention mechanism of the present invention.

[0078] Figure 2 Schematic diagram of the self-attention mechanism structure.

[0079] Figure 3 This is the structural diagram of the convolution processing unit.

[0080] Figure 4 This is the LSTM unit structure diagram.

[0081] Figure 5 This is the GRU unit structure diagram. DETAILED DESCRIPTION

[0082] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0083] like Figure 1 As shown, the present invention comprises the following steps:

[0084] 1) Data collection and preprocessing;

[0085] By installing multiple high-precision sensors at offshore wind farms, key environmental parameters such as wind speed, wind direction, and temperature are collected in real time. The collected data is sent to the central processing unit and initially cleaned, including removing outliers, filling missing data, and converting data types. The data is normalized to eliminate the impact of different dimensions so that the data can be compared and calculated at the same scale.

[0086] Step 1) of the present invention innovatively deploys a high-precision sensor array at an offshore wind farm to achieve real-time monitoring of key environmental parameters. These parameters include but are not limited to wind speed, wind direction, and temperature, which are key factors affecting wind power output. The collected data is cleaned using advanced data preprocessing technology to ensure the accuracy and reliability of the data. This step includes the elimination of outliers, intelligent filling of missing data, and standardized conversion of data types, laying a solid foundation for subsequent data analysis and model training.

[0087] Wind power data sets not only contain wind power, but also usually provide multi-dimensional meteorological information, including wind speed, wind direction, temperature, and air pressure. Too many input features will make the model training process difficult to fit. In order to improve the training efficiency and prediction accuracy of the model, the Pearson correlation coefficient and the maximum mutual information coefficient are used for feature screening. The data samples are selected from all sample data of wind speed, wind direction, temperature, air pressure, wind speed at different heights, and power generation after data cleaning. After that, through a comprehensive analysis of the size of the two correlation coefficients, two parameters with the highest correlation with power generation are obtained as the input of the subsequent model.

[0088] The Pearson correlation coefficient (PCC) or the maximum mutual information coefficient (MIC) method is used to calculate the correlation coefficient between the wind farm's power generation and wind speed at different heights, and then feature screening is performed, and the two sets of historical data of wind speed and power generation with the highest correlation are used as the input features of the model. The specific calculation formula is as follows:

[0089] F PCC ( a,b )=Σ i=1 ( a i -a’ )( b i -b’ ) / ( (Σ i=1 ( a i -a’ ) 2 ) 1 / 2 ·(Σ i=1 ( b i -b’ ) 2 ) 1 / 2 )

[0090] I ( a,b ) =∫p( a,b )log2( p ( a,b ) / ( p ( a ) p ( b ))) · dadb

[0091] F MIC ( a,b )=max n1n2<B ·( I ( a,b ) / log2min( n1,n2 ))

[0092] Where: a and b Represents two types of sample variables, namely power generation and wind speed; n is the total number of samples, i =1~ n ; a’ and b’ is the mean of the two types of samples; FPCC is the PCC coefficient between samples, p ( a,b ) is the joint probability between sample variables; I ( a,b ) is the mutual information; F MIC is the MIC between samples; n 1 and n 2 is the number of grid distributions; B The size of is taken as 0.6 power of the amount of data.

[0093] 2) Construction and training of dual-channel neural networks;

[0094] The dual-channel neural network model consists of two submodules, namely the ConvLSTM channel and the ConvGRU channel.

[0095] The ConvLSTM channel uses Figure 3 The convolutional layer shown in Figure 2 extracts local features of the time series data and passes them through Figure 4 The LSTM layer shown captures temporal dependencies. The ConvGRU channel uses convolutional layers to extract features of spatially distributed data and passes through Figure 5 The GRU layer shown processes sequence data. The output features of the two channels are initially fused through a fully connected layer. The dataset is divided into a training set, a validation set, and a test set. The training set is used to train the two-channel neural network, and the hyperparameters are adjusted through the validation set.

[0096] Step 2) of the present invention adopts a cutting-edge dual-channel neural network architecture, combining a convolutional long short-term memory network (ConvLSTM) and a convolutional gated recurrent unit (ConvGRU) to achieve in-depth analysis of time series data. This structure not only captures the local characteristics and temporal dependencies of the data, but also performs effective feature extraction and sequence processing on spatially distributed data.

[0097] 3) Attention mechanism feature fusion;

[0098] The feature fusion of the attention mechanism is specifically as follows: a multi-head self-attention module is applied to the initially fused features, the importance of different features is learned, and the weights of the features are dynamically adjusted. An attention network is designed, which calculates the weight of each feature through convolution operations and softmax functions. The weighted features are finally fused to form a comprehensive feature representation.

[0099] like Figure 2 As shown in Figure 2, the basic structure of the multi-head self-attention module is as follows:

[0100] 3.1) Splice the two channel outputs as module input;

[0101] The output of the ConvLSTM channel and the output of the ConvGRU channel are concatenated as the input X of the multi-head self-attention module origin ;

[0102] 3.2) Split the input and add position encoding;

[0103] Split the input sequence into h heads, each head has a dimension of d k = d model / h , and add the corresponding positional encoding to the input:

[0104] P( l,2k )=sin( l / 10000 (2k / d model ) )

[0105] P( l,2k+ 1)=cos( l / 10000 (2 / d model ) )

[0106] Among them, P() is the position code, l is the temporal position corresponding to the position code, k 0 to 0.5 d model Integer value between -1;

[0107] For sequence length L and model dimension d model , create an L× d model The position encoding matrix PE is:

[0108] Add the positional encoding matrix PE to the input sequence: X = X origin +PE, so that the input data X at each time step origin Contains position information, X is the input sequence after adding position encoding;

[0109] 3.3) Each head obtains its Q, K, and V matrices according to different linear transformations;

[0110] Apply three different linear transformations to the input sequence X to obtain the query Q (Query), key K (Key), and value V (Value):

[0111] Q=XW Q

[0112] K=XW K

[0113] V=XW V

[0114] Among them, W Q , W K , W V are weight matrices respectively;

[0115] 3.4) For each query Q, calculate its attention score with all keys K QK T / d k 1 / 2 ;

[0116] 3.5) The obtained attention scores are normalized by the Softmax function to obtain weights, and the weighted sum is obtained to obtain A( Q,K,V );

[0117] Use the Softmax function to normalize the attention score and get the attention weight:

[0118] Softmax ( x i )= e xi / Σ i e xi

[0119] in, x i It is the characteristic i individual data;

[0120] Use the attention weight obtained by Softmax to weight the Value:

[0121] A( Q,K,V )= Softmax ( QK T / d k 1 / 2 ) V

[0122] in, QK T / d k 1 / 2 is the attention score;

[0123] 3.6) The output vectors of all heads are concatenated through a fully connected layer to obtain the output result of the attention module, and finally a linear layer is used to generate the final power prediction output.

[0124] The features are fused through the fully connected layer, specifically:

[0125] FC=W FC ·A( Q,K,V )+ b FC

[0126] in, W FC is the weight matrix of the fully connected layer, b FC is the bias term;

[0127] Finally, it is output through a linear layer, and the output of the linear layer is directly used as the prediction result of the power generation:

[0128] P = W out · FC + b out

[0129] in, W out is the weight matrix of the output layer, b out is the bias term.

[0130] Step 3 of the present invention introduces a self-attention mechanism module design based on the preliminary fusion of features. The network applies the self-attention mechanism to adaptively learn the importance of different features and dynamically adjust the feature weights. Through the clever combination of convolution operation and softmax function, the weight of the feature is calculated, the final fusion of the feature is achieved, and a comprehensive and highly expressive comprehensive feature representation is generated.

[0131] 4) Model training and optimization.

[0132] Step 4 of the present invention constructs a fully connected layer based on feature fusion, which is used to map the fused features to the prediction of the power generation of offshore wind power equipment. Select appropriate loss functions and optimization algorithms to train and optimize the model to ensure the accuracy and efficiency of the prediction.

[0133] Using mean square error as loss function, loss function L The expression is:

[0134] L=1 / n; Σ ni=1 ( P i -P actual,i ) 2

[0135] in, n is the sample size, P i The model predicts i The power generation of each sample, P actual,i The actual i The power generation of each sample;

[0136] Select Adam optimizer as the optimization method for model parameters. The update rule of Adam optimizer is:

[0137] v t = β 1 v t-1 + (1- β 1) ▽ θ L

[0138] s t =β 2 s t-1 + (1- β 2)·(▽ θ L ) 2

[0139] i t+1 =θ t –( or / ( s t / (1- β 2 t ) ) 1 / 2 )- v t

[0140] in, i are model parameters, L is the loss function, v t and s t are estimates of the first and second moments of the gradient, respectively, β 1 and β 2 is the decay rate, or is the learning rate.

[0141] Finally, the model is comprehensively evaluated through the test set, and a series of performance indicators are used to measure the accuracy and reliability of the prediction, thereby ensuring the efficiency and stability of the model in practical applications.

Claims

1. A method for offshore wind power prediction based on an attention mechanism dual-channel neural network, characterized in that: The following steps are involved: S1: Collect historical wind field data; S2: data preprocessing; S3: Construct a dual-channel neural network model integrating attention mechanism features; S3.1: Design the ConvLSTM channel and the ConvGRU channel, and perform preliminary fusion of the output features of the two channels through the fully connected layer; S3.2: Attention mechanism feature fusion: Apply the multi-head self-attention mechanism module to the initially fused features, and obtain the wind power prediction result through the fully connected layer of the self-attention mechanism module; S4: Model training and optimization; S5: input the wind speed monitored in real time into the model trained in step S4 for prediction processing, output the corresponding wind power, and realize real-time prediction of wind power; In step S3: The dual-channel neural network model includes an input layer, a convolution processing unit, an LSTM module, a GRU module, a self-attention mechanism module and an output layer. The input layer, the convolution processing unit and the LSTM module constitute a ConvLSTM channel, and the input layer, the convolution processing unit and the LSTM module constitute a ConvGRU channel. After the outputs of the ConvLSTM channel and the ConvGRU channel are feature-fused, the power generation of offshore wind power equipment is predicted through the multi-head self-attention module; The input data of the input layer are two sets of historical data of wind speed and power generation with the highest correlation; The convolution processing unit is composed of a plurality of sequentially connected convolution layers, pooling layers and fully connected layers; the convolution layer uses the convolution kernel to extract local features and performs convolution operations on the input data; the data processed by the convolution layer is downsampled through the pooling layer to reduce the spatial scale of the feature map; finally, the pooled feature data is spliced ​​through the fully connected layer as the input data of the subsequent neural network; the fully connected layer includes two steps of Dropout and gradient clipping; after the convolution operation of the convolution layer, the ReLU The activation function introduces nonlinearity; The LSTM module includes T LSTM units, the input of the first LSTM unit is the output of the convolution processing unit, and the input of the remaining LSTM units is the output of the convolution processing unit and the output of the previous LSTM unit; The outputs of T LSTM units are concatenated as the final output of the ConvLSTM channel; The GRU module includes T GRU units, the input of the GRU unit is the output of the convolution processing unit, the input of the first GRU unit is the output of the convolution processing unit, and the input of the remaining GRU units is the output of the convolution processing unit and the output of the previous GRU unit; the outputs of the T GRU units are concatenated as the final output of the ConvGRU channel.

2. The offshore wind power prediction method of the attention mechanism dual-channel neural network according to claim 1 is characterized in that: The process of collecting historical wind field data in step S1 is specifically as follows: Arrange sensor points at different heights of the unit, and collect historical data of wind speed at different heights and wind farm power generation through historical records of offshore wind farms; The Pearson correlation coefficient or the maximum mutual information coefficient method is used to calculate the correlation coefficient between the wind farm's power generation and wind speeds at different heights, and then feature screening is performed, and the two sets of historical data on wind speed and power generation with the highest correlation are used as input features of the model.

3. The offshore wind power prediction method of an attention mechanism dual-channel neural network according to claim 1 is characterized in that: The method for data preprocessing in step S2 includes: Data cleaning: Eliminate data points that are out of the normal range or abnormal data caused by sensor failure; Missing value processing: linear interpolation is used to fill in missing data; Normalization: All input data are normalized to be between [0, 1].

4. The offshore wind power prediction method of the attention mechanism dual-channel neural network according to claim 1 is characterized by: The structure of the self-attention mechanism module is specifically as follows: The output of the ConvLSTM channel and the output of the ConvGRU channel are concatenated as the input X of the multi-head self-attention module origin ; Split the input sequence into h heads, each head has a dimension of d k = d model / h , and add the corresponding positional encoding to the input: P( l,2k )=sin( l / 10000 (2k / d model ) ) P( l,2k+ 1)=cos( l / 10000 (2 / d model ) ) Among them, P() is the position code, l is the temporal position corresponding to the position code, k 0 to 0.5 d model Integer value between -1; For sequence length L and model dimension d model , create an L× d model The position encoding matrix PE is: Add the positional encoding matrix PE to the input sequence: X = X origin +PE, so that the input data X at each time step origin Contains position information, X is the input sequence after adding position encoding; Apply three different linear transformations to the input sequence X to obtain the query Q, key K, and value V: Use the Softmax function to normalize the attention score and get the attention weight: Use the attention weight obtained by Softmax to weight the value Value: A( Q,K,V )= Softmax ( QK T / d k 1 / 2 ) V in, QK T / d k 1 / 2 is the attention score; The features are fused through the fully connected layer, specifically: FC=W FC ·A( Q,K,V )+ b FC in, W FC is the weight matrix of the fully connected layer, b FC is the bias term; Finally, it is output through a linear layer, and the output of the linear layer is directly used as the prediction result of the power generation: P = W out · FC + b out in, W out is the weight matrix of the output layer, b out is the bias term.

5. The offshore wind power prediction method of the attention mechanism dual-channel neural network according to claim 1 is characterized by: During the training and optimization process of step S4: Using mean square error as loss function, loss function L The expression is: L=1 / n S i=1 ( P i -P actual,i ) 2 in, n is the sample size, P i The model predicts i The power generation of each sample, P actual,i The actual i The power generation of each sample, i =1~ n ; The training optimization is achieved through the optimizer to reduce the RMSE; the Adam optimizer is selected as the optimization method for the model parameters.

6. The offshore wind power prediction method of an attention mechanism dual-channel neural network according to claim 1 is characterized in that: In step S4: the trained model is evaluated using a test set, and the prediction accuracy is measured by a performance indicator; wherein the root mean square error is used as the evaluation indicator.

7. A terminal, characterized in that: The terminal includes a memory, a processor, and an offshore wind power prediction program stored in the memory and executable on the processor. When the processor executes the offshore wind power prediction program, the offshore wind power prediction method of the attention mechanism dual-channel neural network as described in any one of claims 1 to 6 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an offshore wind power prediction program. When the offshore wind power prediction program is executed by the processor, the offshore wind power prediction method of the attention mechanism dual-channel neural network as described in any one of claims 1 to 6 is implemented.