A wave energy prediction method and device based on STL decomposition and a multi-layer seq2seq model
Patent Information
- Application Number
- CN202311126949.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-09-01
AI Technical Summary
[0004]相关技术中,比如提出了一种经验小波变换和卷积神经网络的波浪功率综合预测方法,该方法存在模态过多的问题,并且由于过拟合导致分解出来的分量物理周期含义模糊,导致预测结果的不稳定
[0055]The technical solution provided in this disclosure has the following advantages compared with the prior art: The wave energy prediction scheme based on STL decomposition and multi-layer seq2seq model provided in this disclosure acquires historical power data of wave energy power generation devices; preprocesses the historical power data to obtain the original sequence; decomposes the original sequence to obtain the target trend sequence and the target periodic sequence; and processes the original sequence, the target trend sequence, and the target periodic sequence respectively through a trained multi-layer seq2seq model to obtain the prediction result. By using the above technical solution, decomposing the wave energy power generation sequence using STL, and then using a multi-layer seq2seq model to extract features and predict the original sequence, trend sequence, and periodic sequence, this solves the problems of ambiguous physical meaning of decomposed components and the degradation of prediction results by multiple components in existing modal decomposition methods. It can fully extract the periodic information and temporal features in the original sequence, thereby improving the accuracy of model prediction.
Smart Images

Figure CN117374913B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to a wave energy prediction method, apparatus, device and medium based on STL (Seasonal and Trend decomposition using Loess) decomposition and multi-level seq2seq (Sequence to Sequence) model. Background Technology
[0002] Wave energy generation is an important new energy power generation method with the advantages of cleanliness and sustainability. With the rapid development of wave energy generation technology, wave energy generation devices in various countries have been put into operation and connected to the grid. However, due to the fluctuating and intermittent nature of wave resources, wave energy generation power is highly random, posing a significant threat to the power supply stability of coastal and isolated island power grids. Therefore, accurate wave energy generation power prediction can optimize grid dispatching plans, reduce grid operating costs, and improve grid operational security. At the same time, accurate power prediction can also accelerate the development of wave energy generation, thereby speeding up the commissioning of wave energy generation devices and accelerating the development and utilization of ocean energy.
[0003] Common wave energy power generation prediction methods can be categorized into physical methods, statistical methods, and artificial intelligence methods. Physical methods, based on linear or nonlinear wave theory, simulate waves to obtain power generation figures, but these often deviate significantly from actual values. Numerical simulation methods, such as the SWAN model, can achieve high prediction accuracy, but they involve enormous computational costs and their accuracy declines significantly over longer time spans. Statistical methods build prediction models by finding relationships between historical and future power generation sequences; however, due to the inherent randomness of wave energy and the strong nonlinear characteristics of the power sequence, statistical models suffer from large prediction errors. Artificial intelligence methods possess powerful nonlinear fitting capabilities; deep learning models such as Long Short-Term Memory (LSTM) neural networks have been applied to wave energy power generation prediction. Modal decomposition of the model input can extract information from different modes, improving the information mining capabilities of deep learning models from historical sequences.
[0004] In related technologies, for example, a wave power prediction method combining empirical wavelet transform and convolutional neural networks has been proposed. However, this method suffers from an excessive number of modes, and overfitting leads to ambiguity in the physical period meaning of the decomposed components, resulting in unstable prediction results. Another example is a power prediction method based on MEEMD decomposition and ARIMA models. MEEMD decomposition is sensitive to initial conditions and generates too many intrinsic mode functions lacking practical meaning. Furthermore, the ARIMA model's fitting ability is weaker than that of deep learning models. Summary of the Invention
[0005] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a wave energy prediction method, apparatus, device, and medium based on STL decomposition and multi-layer seq2seq model.
[0006] This disclosure provides a wave energy prediction method based on STL decomposition and a multi-level seq2seq model, the method comprising:
[0007] Obtain historical power data from wave energy generation devices;
[0008] The historical power data is preprocessed to obtain the original sequence;
[0009] The original sequence is decomposed to obtain the target trend sequence and the target periodic sequence;
[0010] The original sequence, the target trend sequence, and the target periodic sequence are processed by a trained multi-layer seq2seq model to obtain prediction results.
[0011] Optionally, the step of decomposing the original sequence to obtain the target trend sequence and the target periodic sequence includes:
[0012] The original sequence is iterated multiple times to obtain the trend term;
[0013] Calculate the difference between the original sequence and the trend term to obtain the initial trend sequence;
[0014] The original sequence is locally weighted regression smoothed based on preset parameters to obtain a smoothed sequence, and the initial periodic sequence is filtered to obtain a filtered sequence.
[0015] Calculate the difference between the smoothed sequence and the filtered sequence to obtain the initial periodic sequence;
[0016] The difference between the original sequence, the initial trend sequence, and the initial periodic sequence is calculated to obtain the residual sequence;
[0017] The initial trend sequence and the initial periodic sequence corresponding to the minimum residual sequence are determined according to the target window width and are used as the target trend sequence and the target periodic sequence.
[0018] Optionally, the formula for determining the window width by calculating the correlation through the residual sequence is:
[0019]
[0020] Where w* is the window width of the target periodic component, and f(i,w) is the i-th lag autocorrelation coefficient of the periodic sequence when the window width is w.
[0021] Optionally, the multi-layer seq2seq model includes a first-layer seq2seq model, a second-layer seq2seq model, and a third-layer seq2seq model;
[0022] The first layer seq2seq model is constructed by sequentially connecting the LSTM encoding module, the temporal pattern attention module, and the LSTM decoding module.
[0023] The second-layer seq2seq model is constructed by sequentially connecting the LSTM encoding module, the temporal pattern attention module, and the LSTM decoding module.
[0024] The third-layer seq2seq model is constructed by sequentially connecting the LSTM encoding module, the LSTM decoding module, and the self-attention module.
[0025] Optionally, the step of processing the original sequence, the target trend sequence, and the target periodic sequence using a trained multi-layer seq2seq model to obtain prediction results includes:
[0026] The original sequence is input into the first-layer seq2seq model to obtain historical fluctuation features and some random features;
[0027] The target trend sequence is input into the second-layer seq2seq model to obtain trend features;
[0028] The target periodic sequence is input into the third-layer seq2seq model to obtain periodic features;
[0029] The historical fluctuation features, along with some random features, the trend features, and the periodic features, are concatenated and then input into a fully connected layer to obtain the prediction result.
[0030] This disclosure also provides a wave energy prediction device based on STL decomposition and a multi-level seq2seq model, the device comprising:
[0031] The preprocessing module is used to acquire historical power data of the wave energy power generation device, preprocess the historical power data, and obtain the original sequence.
[0032] The STL decomposition module is used to decompose the original sequence to obtain the target trend sequence and the target periodic sequence.
[0033] The prediction module is used to process the original sequence, the target trend sequence, and the target periodic sequence respectively using a trained multi-layer seq2seq model to obtain prediction results.
[0034] Optionally, the STL decomposition module is used for, specifically for:
[0035] The original sequence is iterated multiple times to obtain the trend term;
[0036] Calculate the difference between the original sequence and the trend term to obtain the initial trend sequence;
[0037] The original sequence is locally weighted regression smoothed based on preset parameters to obtain a smoothed sequence, and the initial periodic sequence is filtered to obtain a filtered sequence.
[0038] Calculate the difference between the smoothed sequence and the filtered sequence to obtain the initial periodic sequence;
[0039] The difference between the original sequence, the initial trend sequence, and the initial periodic sequence is calculated to obtain the residual sequence;
[0040] The initial trend sequence and the initial periodic sequence corresponding to the minimum residual sequence are determined according to the target window width and are used as the target trend sequence and the target periodic sequence.
[0041] Optionally, the formula for determining the window width by calculating the correlation through the residual sequence is:
[0042]
[0043] Where w* is the window width of the target periodic component, and f(i,w) is the i-th lag autocorrelation coefficient of the periodic sequence when the window width is w.
[0044] Optionally, the multi-layer seq2seq model includes a first-layer seq2seq model, a second-layer seq2seq model, and a third-layer seq2seq model;
[0045] The first layer seq2seq model is constructed by sequentially connecting the LSTM encoding module, the temporal pattern attention module, and the LSTM decoding module.
[0046] The second-layer seq2seq model is constructed by sequentially connecting the LSTM encoding module, the temporal pattern attention module, and the LSTM decoding module.
[0047] The third-layer seq2seq model is constructed by sequentially connecting the LSTM encoding module, the LSTM decoding module, and the self-attention module.
[0048] Optionally, the prediction module is specifically used for:
[0049] The original sequence is input into the first-layer seq2seq model to obtain historical fluctuation features and some random features;
[0050] The target trend sequence is input into the second-layer seq2seq model to obtain trend features;
[0051] The target periodic sequence is input into the third-layer seq2seq model to obtain periodic features;
[0052] The historical fluctuation features, along with some random features, the trend features, and the periodic features, are concatenated and then input into a fully connected layer to obtain the prediction result.
[0053] This disclosure also provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the wave energy prediction method based on STL decomposition and multi-layer seq2seq model as provided in this disclosure.
[0054] This disclosure also provides a computer-readable storage medium storing a computer program for executing the wave energy prediction method based on STL decomposition and multi-layer seq2seq model provided in this disclosure.
[0055] The technical solution provided in this disclosure has the following advantages compared with the prior art: The wave energy prediction scheme based on STL decomposition and multi-layer seq2seq model provided in this disclosure acquires historical power data of wave energy power generation devices; preprocesses the historical power data to obtain the original sequence; decomposes the original sequence to obtain the target trend sequence and the target periodic sequence; and processes the original sequence, the target trend sequence, and the target periodic sequence respectively through a trained multi-layer seq2seq model to obtain the prediction result. By using the above technical solution, decomposing the wave energy power generation sequence using STL, and then using a multi-layer seq2seq model to extract features and predict the original sequence, trend sequence, and periodic sequence, this solves the problems of ambiguous physical meaning of decomposed components and the degradation of prediction results by multiple components in existing modal decomposition methods. It can fully extract the periodic information and temporal features in the original sequence, thereby improving the accuracy of model prediction. Attached Figure Description
[0056] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0057] Figure 1 A flowchart illustrating a wave energy prediction method based on STL decomposition and multi-layer seq2seq model provided in this embodiment of the disclosure;
[0058] Figure 2 A flowchart illustrating another wave energy prediction method based on STL decomposition and multi-layer seq2seq model provided in this embodiment of the present disclosure.
[0059] Figure 3 This is a schematic diagram of the structure of a multi-layer seq2seq model provided in an embodiment of the present disclosure;
[0060] Figure 4 This is a schematic diagram of the structure of a temporal pattern attention network provided in an embodiment of the present disclosure;
[0061] Figure 5 This is a schematic diagram of a wave energy prediction device based on STL decomposition and multi-layer seq2seq model, provided as an embodiment of the present disclosure. Detailed Implementation
[0062] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0063] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0064] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0065] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0066] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0067] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0068] Figure 1 This is a flowchart illustrating a wave energy prediction method based on STL decomposition and a multi-layer seq2seq model, provided as an embodiment of this disclosure. This method can be executed by a wave energy prediction device based on STL decomposition and a multi-layer seq2seq model. This device can be implemented using software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, the method includes:
[0069] Step 101: Obtain historical power data of the wave energy power generation device.
[0070] Step 102: Preprocess the historical power data to obtain the original sequence.
[0071] In this embodiment of the disclosure, the wave energy power generation device can be one or more devices that generate electricity using wave energy. Power data of the wave energy power generation device over a certain historical period can be collected using sensors or other methods to obtain historical power data, such as one year or two years' worth, which can be selected and set according to needs. The specific data collection method is not specifically limited in this embodiment of the disclosure.
[0072] In this embodiment of the disclosure, after obtaining historical power data within a historical time period, the historical power data is preprocessed to obtain the original sequence. The original sequence refers to power data with a target time point, such as time A, with a power generation of B watts per hour, etc., which can be set according to specific needs.
[0073] Preprocessing may include, but is not limited to, filling in missing time values and null values, re-interpolating outliers, removing long-term missing data segments, and data normalization. It is understandable that complex marine conditions can lead to sensor malfunctions, communication interruptions, and abnormal data recording, resulting in historical power data containing outliers, intermittent missing values, and long-term missing data. Therefore, outliers and intermittent missing values are replaced by averaging adjacent data; for long-term missing data, simulation methods such as SWAN are used to reconstruct wave information and infer power values, or the missing power segments are directly removed.
[0074] Step 103: Decompose the original sequence to obtain the target trend sequence and the target periodic sequence.
[0075] In some embodiments, decomposing the original sequence to obtain a target trend sequence and a target periodic sequence includes: iterating the original sequence multiple times to obtain a trend term; calculating the difference between the original sequence and the trend term to obtain an initial trend sequence; performing local weighted regression smoothing on the original sequence based on preset parameters to obtain a smoothed sequence, and filtering the initial periodic sequence to obtain a filtered sequence; calculating the difference between the smoothed sequence and the filtered sequence to obtain an initial periodic sequence; calculating the difference between the original sequence, the initial trend sequence, and the initial periodic sequence to obtain a residual sequence; and determining the initial trend sequence and the initial periodic sequence corresponding to the minimum residual sequence according to the target window width as the target trend sequence and the target periodic sequence.
[0076] In some embodiments, the formula for determining the window width by calculating the correlation of the residual sequence is:
[0077]
[0078] Where w* is the window width of the target periodic component, and f(i,w) is the i-th lag autocorrelation coefficient of the periodic sequence when the window width is w.
[0079] The periodic sequence can be a seasonal cycle, a monthly cycle, etc., and can be selected as needed. The following explanation uses the seasonal cycle as an example, that is, the periodic sequence is a seasonal sequence.
[0080] Specifically, the preprocessed original wave energy power generation sequence, i.e., the original sequence, is subjected to STL decomposition to obtain the optimal trend sequence and periodic sequence. The specific process of STL decomposition is as follows:
[0081] Specifically, STL decomposition is achieved through two mechanisms: an inner loop and an outer loop. Then, the correlation of the residual sequences after decomposition is calculated, and the decomposition parameters corresponding to the minimum correlation are taken as the optimal decomposition parameters.
[0082] The inner loop process is as follows:
[0083] 1) Detrending: through Calculate the detrended sequence, where Y v It is the original sequence. It is the trend term after the kth iteration.
[0084] 2) Periodic subsequence smoothing: Select parameters q = n, d = 1 to perform local weighted regression smoothing to obtain a smoothed value sequence. This is a temporary periodic sequence, also known as the initial periodic sequence.
[0085] 3) Low-pass filtering is performed on the smoothed periodic subsequence: for example, the filter used includes a period of length n. p The moving average of 3, and parameters d=1, q=n (l) The local moving average is used to output the result.
[0086] 4) Detrending of periodic subsequences: The seasonal term in the (k+1)th cycle is
[0087] 5) Seasonal term removal: Calculate the seasonal term removal sequence.
[0088] 6) Trend smoothing: The seasonal term is removed using the parameter q = n (t) Smoothing is performed on locally weighted regression with d=1.
[0089] The outer loop process is as follows: The initial run of the inner loop obtains the trend term T. v and seasonal items S v .
[0090] 1) Calculate the residual sequence: The initial run of the inner loop obtains the trend term T. v and seasonal items S v Calculate the residual sequence R v =Y v-T v -S v .
[0091] 2) Define the weight of each observation: through ρ v Reflecting the extremes of the residual values, points with excessively large residual values will have small weights. In steps 2 and 6 of the inner loop, the adjacency weights at each time step will be multiplied by the robust weight ρ. v .
[0092] h = 6median(|R) v |) (1)
[0093] ρ v =B(|R v | / h) (2)
[0094]
[0095] Where B is the quadratic weighting function.
[0096] The optimal window width is found by calculating the correlation of the residual sequences, and the formula is as follows:
[0097]
[0098] Where w* is the window width of the optimal seasonal component, and f(i,w) is the i-th lag autocorrelation coefficient of the time series when the window width is w.
[0099] In some embodiments, the original sequence is automatically decomposed using a preset STL decomposition to obtain the target trend sequence and the target periodic sequence.
[0100] In some embodiments, a decomposition period of 12h25min is used, and the optimal decomposition window size is found by minimizing the autocorrelation value of the residual sequence. This approach can adapt to the tidal period of 12h25min and effectively removes the implicit historical information of the residuals, increasing the historical characteristics of the trend and periodic sequences. It effectively addresses the shortcomings of the modal decomposition methods EMD and EWT, such as excessive decomposition quantities and ambiguous physical meanings of the components.
[0101] Step 104: Process the original sequence, target trend sequence, and target periodic sequence respectively using the trained multi-layer seq2seq model to obtain the prediction results.
[0102] In some embodiments, the multi-layer seq2seq model includes a first-layer seq2seq model, a second-layer seq2seq model, and a third-layer seq2seq model; the first-layer seq2seq model is constructed by sequentially connecting an LSTM encoding module, a temporal pattern attention module, and an LSTM decoding module; the second-layer seq2seq model is constructed by sequentially connecting an LSTM encoding module, a temporal pattern attention module, and an LSTM decoding module; and the third-layer seq2seq model is constructed by sequentially connecting an LSTM encoding module, an LSTM decoding module, and a self-attention module.
[0103] In some embodiments, the original sequence, the target trend sequence, and the target periodic sequence are processed by a trained multi-layer seq2seq model to obtain prediction results, including: inputting the original sequence into the first-layer seq2seq model to obtain historical fluctuation features and some random features; inputting the target trend sequence into the second-layer seq2seq model to obtain trend features; inputting the target periodic sequence into the third-layer seq2seq model to obtain periodic features; and concatenating the historical fluctuation features with some random features, trend features, and periodic features and then inputting the concatenation into a fully connected layer to obtain prediction results.
[0104] For example, the historical power time series, i.e., the original series, is divided into training and test sets. Seasonal trend decomposition is then performed on both the training and test sets to determine trend and periodic components. The original series is input into a first-layer seq2seq model to extract historical fluctuation characteristics and some random features. The trend component is input into a second-layer seq2seq model to further extract trend features, and the periodic component is input into a third-layer seq2seq model to further extract periodic features. Each of the three models outputs a prediction result. The outputs of the three models are then concatenated and passed through a fully connected layer to output the final prediction result.
[0105] Specifically, the first and second layer seq2seq models have the same structure, including an LSTM encoding module, a temporal pattern attention module, and an LSTM decoding module. The third layer seq2seq model includes an LSTM encoding module, an LSTM decoding module, and a self-attention module.
[0106] Specifically, seasonal trend decomposition is performed on the divided training and test sets to determine the trend and periodic components, including:
[0107] Based on the tidal pattern of two high tides and two low tides occurring approximately every 24 hours and 50 minutes, the decomposition period is determined to be 12 hours and 25 minutes; the window width of the seasonal components is set by minimizing the autocorrelation of the residuals.
[0108] The window width for the seasonal component is determined using the following formula:
[0109]
[0110] Where w* is the window width of the optimal seasonal component, and f(i,w) is the i-th lag autocorrelation coefficient of the time series when the window width is w.
[0111] The basic unit of the multi-layer seq2seq model is the LSTM model:
[0112] The input gate, whose function is to determine how much of the input information at the current time step will be written into the cell state, is formulated as follows:
[0113] i t =σ(W xi ·xt+W hi ·h t-1 +b i (5)
[0114] The forget gate, which determines which information will be deleted from the cell state, is formulated as follows:
[0115] f t =σ(W xf ·x t +W hf ·h t-1 +b f (6)
[0116] The current cell state, which is updated by combining the input gate, the forget gate, and new candidate values, is formulated as follows:
[0117]
[0118] The output gate determines which information from the cell state will be output to the hidden state, and is formulated as follows:
[0119] o t =σ(W xo ·x t +W ho ·h t-1 +b o (8)
[0120] The new cell state, the cell renewal state, is formulated as follows:
[0121]
[0122] The hidden state, which is the hidden layer state updated at each time step, is formulated as follows:
[0123] h t =o t ⊙tanh*(c t (10)
[0124] The convolutional layer for temporal attention performs feature-dimensional convolutions on all hidden layer states of the LSTM encoder except for the last hidden layer state, as formulated as:
[0125]
[0126] Among them, H i,j C represents the convolution result of the j-th convolution kernel with the i-th hidden vector in the feature dimension. j,T-w+l h is the convolution kernel i,(t-w-1+k) The hidden vector for convolution.
[0127] The weight calculation layer for temporal attention performs a weighted operation on the convolution result and the last hidden layer vector of the LSTM encoder, as formulated as follows:
[0128] α i =sigmoid((H i ) T W a h t (12)
[0129]
[0130] α i h represents the weight of the i-th hidden vector. t ' represents the final output hidden layer vector, which is the result of concatenating and summing the last hidden layer vector and the weighted hidden layer vector.
[0131] As an example of a scenario, such as Figure 2 As shown, power data of wave energy generation devices is acquired and preprocessed to obtain historical power time series. The data preprocessing includes missing time values and null value imputation, outlier re-interpolation, removal of long-term missing data segments, and data normalization. The original sequence is decomposed according to the STL method, and trend and periodic sequences are obtained according to the principle of minimum correlation. Features are extracted and predicted from the original sequence, trend sequence, and periodic sequence using a multi-layer seq2seq model, and predicted values are output. The predicted values are concatenated and the final prediction result is obtained through a fully connected layer.
[0132] Therefore, the trend component and periodic component of the wave energy power generation sequence can be extracted, with the periodic component having a clear physical meaning. Then, a multi-level seq2seq model is used to predict the original sequence, trend sequence, and periodic sequence respectively, thereby extracting the trend and random features of the sequence and enhancing the extraction of periodic features. The proposed method solves the problems of ambiguous physical meaning of decomposed components and the degradation of prediction results by multiple components in mode decomposition methods. It can fully extract the periodic information and temporal features from the original sequence, thus improving the accuracy of model prediction.
[0133] Constructing a multi-layer seq2seq prediction model, such as Figure 3 As shown, it specifically includes:
[0134] The multi-layer seq2seq model uses LSTM as the encoding and decoding unit, and its formula is as follows:
[0135] i t =σ(W xi ·x t +W hi ·h t-1 +b i )
[0136] f t =σ(W xf ·x t +W hf ·h t-1 +b f )
[0137]
[0138] o t =σ(W xo ·x t +W ho ·h t-1 +b o )
[0139]
[0140] h t =o t ☉tanh(c t (14)
[0141] Among them, i t The output of the input gate represents how much information has been written to the cell state in the current time step. t This represents the input sequence at the current time step. t-1 This represents the hidden state at the previous time step. W xi W represents the weight matrix from the input sequence to the input gate.hi This represents the weight matrix from the hidden state to the input gate. (b) i This represents the bias vector of the input gate. σ represents the sigmoid activation function. W xf W represents the weight matrix from the input sequence to the forget gate. hf Let represent the weight matrix from the hidden state to the forget gate. Let bf represent the bias vector of the forget gate. This represents the candidate cell state at the current time step. W xc W represents the weight matrix from the input sequence to the cell state. hc This represents the weight matrix from the hidden state to the cell state. (b) c A deviation vector representing the cell state. t This is the output of the output gate, indicating how much cell state information is output in the current time step. W xo W ho represents the weight matrix from the input sequence to the output gate, and the weight matrix from the hidden state to the output gate, respectively. o This represents the bias vector of the output gate. ⊙ represents element-wise multiplication.
[0142] The original sequence, trend sequence, and periodic sequence are used as inputs to a three-layer seq3seq model. Each seq3seq model first passes through a dense (fully connected) layer to increase dimensionality and improve the ability to mine hidden features from the input information. All three sequences are encoded using an LSTM module. For the encoded original sequence and trend sequence, the hidden states of each LSTM cell are used as inputs to the temporal pattern attention, such as... Figure 4 The diagram shows the temporal pattern attention network structure. Temporal pattern attention can extract temporal information between different feature dimensions, and its formula is as follows:
[0143]
[0144] Among them, H i,j C represents the convolution result of the j-th convolution kernel with the i-th hidden vector in the feature dimension. j,T-w+l h is the convolution kernel i,(t-w-1+k) The hidden vector for convolution.
[0145] The weight calculation layer for temporal attention performs a weighted operation on the convolution result and the last hidden layer vector of the LSTM encoder, as formulated as follows:
[0146] α i =sigmoid((H i ) T W a h t (16)
[0147]
[0148] α i h represents the weight of the i-th hidden vector. t ' represents the final output hidden layer vector, which is the result of concatenating and summing the last hidden layer vector and the weighted hidden layer vector.
[0149] Therefore, the seq2seq models corresponding to the original sequence and trend sequence both use LSTM modules for decoding, with zero input as the decoding input. The periodic sequence, after being upscaled using a dense layer, is then encoded and decoded using an LSTM module, with the periodic sequence as input during decoding to enhance the extraction of periodicity. The periodic sequence is generated using a sine function with a period of 12 hours and 25 minutes, corresponding to the cyclical changes of tides. The decoded results are input into a self-attention mechanism module to further extract temporal similarity characteristics. The prediction results corresponding to the original sequence, trend sequence, and periodic sequence are concatenated and processed through a fully connected layer to obtain a prediction result of the required length.
[0150] Therefore, by using a multi-layer seq2seq model to extract features and predict the original sequence, trend sequence, and periodic sequence respectively, the predicted values are obtained and then concatenated to obtain the final predicted value. The encoder is implemented using an LSTM unit. The encoded original and trend sequences are input into a time-mode attention model, which fully extracts information from the time step and feature dimensions of the encoded vector. The periodic sequence is decoded using a periodic input method, and the decoding result is then input into the attention mechanism model to further extract periodic repetition features. This solves the problems of a large number of modes, periodic overlap of modes, and ambiguous physical meaning in mode decomposition methods, improves the prediction model's feature extraction capability for multiple sequences, thereby improving the model's prediction accuracy and enabling economic dispatch and security assurance for island and coastal power grids.
[0151] This disclosure provides a wave energy prediction scheme based on STL decomposition and a multi-level seq2seq model. The scheme acquires historical power data from wave energy generation devices; preprocesses the historical power data to obtain the original sequence; decomposes the original sequence to obtain a target trend sequence and a target periodic sequence; and processes the original sequence, target trend sequence, and target periodic sequence respectively using a trained multi-level seq2seq model to obtain prediction results. By employing this technical solution, decomposing the wave energy generation power sequence using STL, and then extracting and predicting features from the original sequence, trend sequence, and periodic sequence using a multi-level seq2seq model, this scheme solves the problems of ambiguous physical meanings of decomposed components and the degradation of prediction results by multiple components in existing modal decomposition methods. It can fully extract periodic information and temporal features from the original sequence, thereby improving the accuracy of model prediction.
[0152] Figure 5 This is a schematic diagram of a wave energy prediction device based on STL decomposition and a multi-layer seq2seq model, provided as an embodiment of this disclosure. This device can be implemented by software and / or hardware and is generally integrated into electronic devices. Figure 5 As shown, the device includes:
[0153] The preprocessing module is used to acquire historical power data of the wave energy power generation device, preprocess the historical power data, and obtain the original sequence.
[0154] The STL decomposition module is used to decompose the original sequence to obtain the target trend sequence and the target periodic sequence.
[0155] The prediction module is used to process the original sequence, the target trend sequence, and the target periodic sequence respectively using a trained multi-layer seq2seq model to obtain prediction results.
[0156] Optionally, the STL decomposition module is used for, specifically for:
[0157] The original sequence is iterated multiple times to obtain the trend term;
[0158] Calculate the difference between the original sequence and the trend term to obtain the initial trend sequence;
[0159] The original sequence is locally weighted regression smoothed based on preset parameters to obtain a smoothed sequence, and the initial periodic sequence is filtered to obtain a filtered sequence.
[0160] Calculate the difference between the smoothed sequence and the filtered sequence to obtain the initial periodic sequence;
[0161] The difference between the original sequence, the initial trend sequence, and the initial periodic sequence is calculated to obtain the residual sequence;
[0162] The initial trend sequence and the initial periodic sequence corresponding to the minimum residual sequence are determined according to the target window width and are used as the target trend sequence and the target periodic sequence.
[0163] Optionally, the formula for determining the window width by calculating the correlation through the residual sequence is:
[0164]
[0165] Where w* is the window width of the target periodic component, and f(i,w) is the i-th lag autocorrelation coefficient of the periodic sequence when the window width is w.
[0166] Optionally, the multi-layer seq2seq model includes a first-layer seq2seq model, a second-layer seq2seq model, and a third-layer seq2seq model;
[0167] The first layer seq2seq model is constructed by sequentially connecting the LSTM encoding module, the temporal pattern attention module, and the LSTM decoding module.
[0168] The second-layer seq2seq model is constructed by sequentially connecting the LSTM encoding module, the temporal pattern attention module, and the LSTM decoding module.
[0169] The third-layer seq2seq model is constructed by sequentially connecting the LSTM encoding module, the LSTM decoding module, and the self-attention module.
[0170] Optionally, the prediction module is specifically used for:
[0171] The original sequence is input into the first-layer seq2seq model to obtain historical fluctuation features and some random features;
[0172] The target trend sequence is input into the second-layer seq2seq model to obtain trend features;
[0173] The target periodic sequence is input into the third-layer seq2seq model to obtain periodic features;
[0174] The historical fluctuation features, along with some random features, the trend features, and the periodic features, are concatenated and then input into a fully connected layer to obtain the prediction result.
[0175] The wave energy prediction device based on STL decomposition and multi-layer seq2seq model provided in this disclosure can execute the wave energy prediction method based on STL decomposition and multi-layer seq2seq model provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0176] This disclosure also provides a computer program product, including a computer program / instruction that, when executed by a processor, implements the wave energy prediction method based on STL decomposition and multi-layer seq2seq model provided in any embodiment of this disclosure.
[0177] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0178] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0179] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0180] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: acquire historical power data of the wave energy generation device; preprocess the historical power data to obtain the original sequence; decompose the original sequence to obtain the target trend sequence and the target periodic sequence; and process the original sequence, the target trend sequence, and the target periodic sequence respectively through a trained multi-layer seq2seq model to obtain the prediction result.
[0181] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0182] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0183] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0184] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0185] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0186] According to one or more embodiments of this disclosure, this disclosure provides an electronic device, including:
[0187] processor;
[0188] Memory used to store the processor's executable instructions;
[0189] The processor is configured to read the executable instructions from the memory and execute the instructions to implement the wave energy prediction method based on STL decomposition and multi-level seq2seq model as provided in any of the present disclosure.
[0190] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium storing a computer program for performing a wave energy prediction method based on STL decomposition and multi-layer seq2seq model as described in any of the present disclosure.
[0191] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0192] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0193] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A wave energy prediction method based on STL decomposition and multi-level seq2seq model, characterized in that, Includes the following steps: Obtain historical power data from wave energy generation devices; The historical power data is preprocessed to obtain the original sequence; The original sequence is decomposed to obtain the target trend sequence and the target periodic sequence; The original sequence, the target trend sequence, and the target periodic sequence are processed by a trained multi-layer seq2seq model to obtain prediction results. The step of decomposing the original sequence to obtain the target trend sequence and the target periodic sequence includes: performing multiple iterations on the original sequence to obtain a trend term; calculating the difference between the original sequence and the trend term to obtain an initial trend sequence; performing local weighted regression smoothing on the original sequence based on preset parameters to obtain a smoothed sequence, and filtering the initial periodic sequence to obtain a filtered sequence; calculating the difference between the smoothed sequence and the filtered sequence to obtain an initial periodic sequence; calculating the difference between the original sequence, the initial trend sequence, and the initial periodic sequence to obtain a residual sequence; and determining the initial trend sequence and the initial periodic sequence corresponding to the minimum residual sequence according to the target window width as the target trend sequence and the target periodic sequence. The multi-layer seq2seq model includes a first-layer seq2seq model, a second-layer seq2seq model, and a third-layer seq2seq model. The first-layer seq2seq model is constructed by sequentially connecting an LSTM encoding module, a temporal pattern attention module, and an LSTM decoding module; the second-layer seq2seq model is constructed by sequentially connecting an LSTM encoding module, a temporal pattern attention module, and an LSTM decoding module; and the third-layer seq2seq model is constructed by sequentially connecting an LSTM encoding module, an LSTM decoding module, and a self-attention module. The step of processing the original sequence, the target trend sequence, and the target periodic sequence using a trained multi-layer seq2seq model to obtain a prediction result includes: inputting the original sequence into the first-layer seq2seq model to obtain historical fluctuation features and some random features; inputting the target trend sequence into the second-layer seq2seq model to obtain trend features; inputting the target periodic sequence into the third-layer seq2seq model to obtain periodic features; and concatenating the historical fluctuation features and some random features, the trend features, and the periodic features before inputting them into a fully connected layer to obtain the prediction result.
2. The method according to claim 1, characterized in that, The formula for determining the window width by calculating the correlation of the residual sequence is as follows: ; in, It is the window width of the target periodic component. It is a periodic sequence in a window with a width of The i-th lag autocorrelation coefficient at time i.
3. A wave energy prediction device based on STL decomposition and multi-level seq2seq model, characterized in that, include: The preprocessing module is used to acquire historical power data of the wave energy power generation device, preprocess the historical power data, and obtain the original sequence. The STL decomposition module is used to decompose the original sequence to obtain the target trend sequence and the target periodic sequence. The prediction module is used to process the original sequence, the target trend sequence, and the target periodic sequence respectively using a trained multi-layer seq2seq model to obtain prediction results; The STL decomposition module is used for, specifically for: The original sequence is iterated multiple times to obtain the trend term; Calculate the difference between the original sequence and the trend term to obtain the initial trend sequence; The original sequence is locally weighted regression smoothed based on preset parameters to obtain a smoothed sequence, and the initial periodic sequence is filtered to obtain a filtered sequence. Calculate the difference between the smoothed sequence and the filtered sequence to obtain the initial periodic sequence; The difference between the original sequence, the initial trend sequence, and the initial periodic sequence is calculated to obtain the residual sequence; The initial trend sequence and the initial periodic sequence corresponding to the minimum residual sequence are determined according to the target window width and are used as the target trend sequence and the target periodic sequence, respectively. Specifically, the prediction module is used for: The original sequence is input into the first-layer seq2seq model to obtain historical fluctuation features and some random features; The target trend sequence is input into the second-layer seq2seq model to obtain trend features; The target periodic sequence is input into the third-layer seq2seq model to obtain periodic features; The historical fluctuation features, along with some random features, the trend features, and the periodic features, are concatenated and then input into a fully connected layer to obtain the prediction result. Specifically, the prediction module is further configured to: input the original sequence into the first-layer seq2seq model to obtain historical fluctuation features and some random features; input the target trend sequence into the second-layer seq2seq model to obtain trend features; input the target periodic sequence into the third-layer seq2seq model to obtain periodic features; and concatenate the historical fluctuation features and some random features, the trend features, and the periodic features into a fully connected layer to obtain the prediction result.
4. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the wave energy prediction method based on STL decomposition and multi-layer seq2seq model as described in any of claims 1-2.
5. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the wave energy prediction method based on STL decomposition and multi-layer seq2seq model as described in any of claims 1-2.