Sea wave prediction method based on weather forecast field data fusion and space-time attention mechanism

By developing a wave prediction method based on meteorological forecast field data fusion and spatiotemporal attention mechanism, the problems of existing technologies failing to effectively integrate meteorological elements and lacking multi-scale interaction are solved, thereby improving the timeliness and accuracy of wave prediction, especially in complex sea areas and extreme weather conditions.

CN121614778APending Publication Date: 2026-03-06SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511744996.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing wave prediction methods fail to effectively integrate meteorological information that drives wave generation, lack multi-scale spatiotemporal feature interaction mechanisms, and ignore the physical driving mechanism of wind-wave coupling, resulting in limited accuracy in complex sea areas and extreme weather conditions.

Method used

A wave prediction method based on meteorological forecast field data fusion and spatiotemporal attention mechanism is adopted. By combining historical wave data and meteorological forecast data, cross-attention calculation and temporal attention recursion are performed through a multi-scale overlapping patch cutting strategy and cross-scale attention mechanism to generate wave height predictions for future moments.

Benefits of technology

It achieves forward-looking integration of meteorological elements, enhances multi-scale spatiotemporal interaction capabilities, deeply models the wind-wave coupling process, improves the timeliness and accuracy of wave prediction, and avoids modeling errors caused by the discretization of physical parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121614778A_ABST
    Figure CN121614778A_ABST
Patent Text Reader

Abstract

The invention discloses a sea wave prediction method based on weather forecast field data fusion and a space-time attention mechanism, and mainly relates to the technical field of sea wave prediction. The method is used for solving the problems that meteorological element information generated by driving sea waves cannot be effectively fused, a multi-scale spatial-temporal feature interaction mechanism is lacked, and a physical driving mechanism of wind wave coupling is ignored in an existing scheme. Comprising the following steps: performing space attention calculation on a historical sea wave data patch sequence to obtain a hidden state sequence; inputting the hidden state sequence into the LSTM network to obtain a hidden state at the current moment; taking a historical weather forecast data patch sequence as Query, taking the hidden state at the current moment as Key and Value, and performing cross attention calculation; recursively generating a hidden state of a preset future moment in combination with cross attention output and a time attention mechanism; and performing linear layer and reconstruction operation on the hidden state at the preset future moment to obtain final sea wave height prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wave prediction technology, and in particular to a wave prediction method based on meteorological forecast field data fusion and spatiotemporal attention mechanism. Background Technology

[0002] Traditional wave prediction primarily relies on numerical wave models, such as WAVEWATCH-III and SWAN, to achieve forecasts by solving wave action equations. However, these models suffer from limitations such as high computational complexity, empirical dependence on parameterization schemes, sensitivity to initial conditions, and difficulty in integrating multi-source data, resulting in limited accuracy in complex sea areas and extreme weather conditions. In recent years, deep learning technology has made breakthroughs in the field of spatiotemporal sequence prediction. The Visual Transformer (ViT) successfully introduced a self-attention mechanism into spatial modeling through a patch segmentation strategy, while the Swin Transformer further proposed hierarchical multi-scale attention computation, significantly improving spatial feature extraction capabilities. Graph Neural Networks (GNNs), by modeling spatial adjacency relationships, have demonstrated excellent performance in predicting gridded Earth systems.

[0003] However, existing deep learning methods for wave prediction still have key problems: First, most methods only use historical wave data and fail to effectively integrate meteorological information that drives wave generation, especially the forward-looking guidance role of historical weather forecast data; second, they lack multi-scale spatiotemporal feature interaction mechanisms, making it difficult to simultaneously capture local detailed changes and global propagation patterns of the wave field; and third, they ignore the physical driving mechanism of wind-wave coupling, making it impossible to deeply model the dynamic process of wind field on wave generation, development, and dissipation. Summary of the Invention

[0004] This application provides a wave prediction method based on meteorological forecast field data fusion and spatiotemporal attention mechanism to solve the problems of existing schemes that fail to effectively fuse meteorological element information driving wave generation, lack multi-scale spatiotemporal feature interaction mechanism, and ignore the physical driving mechanism of wind-wave coupling.

[0005] This application provides a wave prediction method based on meteorological forecast field data fusion and spatiotemporal attention mechanism, the method including: Historical wave data and historical weather forecast data for a preset historical time period are acquired, and the historical wave data and historical weather forecast data are preprocessed; the historical wave data and historical weather forecast data both include time step, number of variable channels, and spatial grid size; A multi-scale overlapping patch segmentation strategy is adopted to segment the preprocessed historical ocean wave data and historical weather forecast data at each time point into several overlapping patch sequences with a specified step size, and add encoding information to the patch sequences. The encoding information includes: two-dimensional spatial location encoding, temporal location encoding, and scale encoding. A cross-scale attention mechanism is used to integrate the patch sequences of historical ocean wave data with a specified step length overlap into a historical ocean wave data patch sequence; and to integrate the patch sequences of historical weather forecast data with a specified step length overlap into a historical weather forecast data patch sequence. Spatial attention is calculated on the historical wave data patch sequence to obtain the hidden state sequence; the hidden state sequence is then input into the LSTM network to obtain the hidden state at the current time. Using historical weather forecast data patch sequences as the Query and the current hidden state as the Key and Value, cross-attention calculation is performed to obtain the cross-attention output; By combining cross-attention output and temporal attention mechanisms, the hidden states at preset future moments are generated recursively; the hidden states at preset future moments are then processed through linear layers and reconstruction operations to obtain the final prediction of wave height.

[0006] In one implementation of this application, obtaining historical wave data and historical weather forecast data for a preset historical time period specifically includes: Obtain historical wave data for the input preset historical time period. and historical weather forecast data ; in, and These represent the time steps of historical ocean wave data and historical weather forecast data, respectively. and For the corresponding number of variable channels, Using 3 variables, the significant wave height, average wave period, and wave direction are respectively. Five variables were used, namely the predicted radial wind, zonal wind, sea level pressure, wind stress, and pressure gradient force, with H×W representing the spatial grid size.

[0007] In one implementation of this application, historical wave data and historical weather forecast data are preprocessed, specifically including: Through the formula: , , The preprocessed historical ocean wave data / historical weather forecast data are calculated and obtained. Where T represents the time step of historical ocean wave data / historical weather forecast data. This represents the historical wave data / historical weather forecast data value at channel c, time step t, and spatial location (i,j); the value of c ranges from [1,C], and C represents the number of variable channels, while H×W is the spatial grid size. This refers to the standardized historical wave data / historical weather forecast data values ​​at channel c, time step t, and spatial location (i,j).

[0008] In one implementation of this application, a multi-scale overlapping patch segmentation strategy is adopted to segment the preprocessed historical wave data and historical weather forecast data into several overlapping patch sequences with a specified step size, specifically including: Cutting formula using overlapping patches: Calculate the patch data obtained by cutting at time step t, scale k, and position (i,j). Furthermore, the patch sequence within the time step range; in: , , i and j are index variables of the patch on the spatial grid, used to determine the position of the patch in space. This represents the data value at time step t after standardization. This indicates the number of patches at each scale; H and W are the height and width dimensions of the spatial grid. The patch size at scale k. Specify the current step size; Depending on the specified step size, the preprocessed historical wave data and historical weather forecast data are divided into several overlapping patch sequences with specified step sizes.

[0009] In one implementation of this application, spatial attention is calculated on a historical wave data patch sequence to obtain a hidden state sequence, specifically including: The hidden state representation of the historical wave data patch sequence at each time step is obtained by stacking multiple layers; The hidden state representation is subjected to residual connections and layer normalization, and then used as input data for the feedforward neural network. After normalization, the hidden state sequence is obtained.

[0010] In one implementation of this application, historical weather forecast data patch sequences are used as the Query, and the hidden state at the current moment is used as the Key and Value, specifically including: Obtain weight data , , ,Will Multiply by the historical weather forecast data patch sequence to obtain the Query; Multiply by the current hidden state to obtain the Key; Multiply by the hidden state at the current moment to obtain Value.

[0011] In one implementation of this application, cross-attention calculation is performed to obtain cross-attention output, specifically including: Through the formula: The cross-attention output is calculated. in, This represents the dimension of K.

[0012] In one implementation of this application, a hidden state for a preset future time is recursively generated by combining cross-attention output and temporal attention mechanisms, specifically including: Through the formula: Recursively generate hidden states for preset future times. ; in, This is the hidden state before recursion. This indicates the output of cross-attention. This represents the multi-head temporal attention function.

[0013] In one implementation of this application, the final wave height prediction is obtained by using a linear layer and a reconstruction operation to obtain the hidden state at a preset future time. Specifically, this includes: Through the formula: The final wave height prediction was obtained. ; in, This indicates a hidden state that is preset for a future time. Represents a linear function. This represents the refactoring operation function.

[0014] In one implementation of this application, encoding information is added to the patch sequence, specifically including: Add encoding information to the patch sequence; Among them, encoding information ; Encoding two-dimensional spatial location, Encoding for time and location. It is scale-coded.

[0015] As can be seen from the above technical solutions, this application has the following advantages: I. Proactive integration of meteorological elements to improve forecast timeliness: By incorporating historical weather forecast data as a query in cross-attention calculations, the technical solution directly achieves forward-looking modeling of wave generation drivers. The spatiotemporal alignment of historical wave data with future meteorological elements such as wind fields and air pressure enables the model to anticipate the impact of sudden meteorological changes on wave evolution, overcoming the limitations of traditional methods that rely solely on historical data due to their lag. The introduction of time-location encoding into the coding information further enhances the modeling capability for temporal causal relationships.

[0016] II. Multi-scale spatiotemporal interaction mechanisms enhance feature representation capabilities: By employing a multi-scale overlapping patch segmentation strategy and scale encoding, the technical solution explicitly constructs a hierarchical feature representation of the wave field. A spatial attention mechanism captures local wave details through gridding, while the combination of an LSTM network and a temporal attention mechanism enables dynamic tracking of the global propagation pattern. Two-dimensional spatial location encoding in the encoded information ensures the precise spatial positioning of features at different scales, forming a local-global collaborative feature interaction network.

[0017] III. In-depth modeling of the physical driving mechanism of wind-wave coupling process: By using future meteorological data as the query side of the attention mechanism and historical wave hidden states as the key / value side, the technical solution directly establishes a dynamic correlation channel between wind field and waves. The cross-attention calculation process implicitly simulates the energy transfer mechanism of wind energy input to wave generation, while the linear layer reconstruction operation conforms to the physical laws of wave energy dissipation. This end-to-end architecture design avoids the modeling errors caused by the discretization of physical parameters in traditional methods. Attached Figure Description To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of a wave prediction method based on meteorological forecast field data fusion and spatiotemporal attention mechanism provided in an embodiment of this application. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Those skilled in the art should understand that the embodiments described below are merely preferred embodiments of this disclosure and do not imply that this disclosure can only be implemented through these preferred embodiments. These preferred embodiments are merely used to explain the technical principles of this disclosure and are not intended to limit the scope of protection of this disclosure. All other embodiments obtained by those skilled in the art based on the preferred embodiments provided in this disclosure without inventive effort should still fall within the scope of protection of this disclosure.

[0021] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0022] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0023] The embodiment provides a wave prediction method based on meteorological forecast field data fusion and spatiotemporal attention mechanism, such as Figure 1 As shown in the embodiments of this application, the method mainly includes the following steps: Step 110: Obtain historical wave data and historical weather forecast data for a preset historical time period, and preprocess the historical wave data and historical weather forecast data.

[0024] Both historical wave data and historical weather forecast data include time step, number of variable channels, and spatial grid size. The historical wave data and historical weather forecast data are date-to-date, with the historical weather forecast data representing the weather forecast for that specific day prior to the historical event. "Prior to the historical event" can be the day before the event.

[0025] It should be noted that systematically processing historical ocean wave and future meteorological data can effectively improve the quality of underlying data for marine environmental prediction. The preprocessing stage automatically removes outliers and fills in missing data, providing structured input for subsequent modeling. In practical applications, this can reduce model training errors caused by disorganized raw data formats and avoid prediction interruptions due to missing data.

[0026] In some embodiments, acquiring historical wave data and historical weather forecast data for a preset historical time period specifically includes: Obtain historical wave data for the input preset historical time period. and historical weather forecast data ; in, and These represent the time steps of historical ocean wave data and historical weather forecast data, respectively. and For the corresponding number of variable channels, Using 3 variables, the significant wave height, average wave period, and wave direction are respectively. Five variables were used, namely the predicted radial wind, zonal wind, sea level pressure, wind stress, and pressure gradient force, with H×W representing the spatial grid size.

[0027] The preprocessing of historical wave data and historical weather forecast data can specifically include: Through the formula: , , The preprocessed historical ocean wave data / historical weather forecast data are calculated and obtained. Where T represents the time step of historical ocean wave data / historical weather forecast data. This represents the historical wave data / historical weather forecast data value at channel c, time step t, and spatial location (i,j); the value of c ranges from [1,C], and C represents the number of variable channels, while H×W is the spatial grid size. This refers to the standardized historical wave data / historical weather forecast data values ​​at channel c, time step t, and spatial location (i,j).

[0028] Step 120: Using a multi-scale overlapping patch cutting strategy, the preprocessed historical wave data and historical weather forecast data at each time point are respectively divided into several overlapping patch sequences with a specified step size.

[0029] It should be noted that, based on the patch segmentation concept of ViT (Vision Transformer), this step adopts a multi-scale overlapping patch segmentation strategy, dividing the two-dimensional field at each time step into multiple overlapping patch sequences with a specified step size. The reduction in step size and the resulting region overlap are intended to increase signal interaction between the patches. As an example, multi-scale overlapping patch cutting can involve specified step sizes such as 8 for fine-scale, 16 for medium-scale, and 32 for coarse-scale: Fine-scale path size is Step length That is, the overlapping area is 50%; The size of the mesoscale path is Step length That is, the overlapping area is 50%; coarse-scale path size is Step length That is, the overlapping area is 50%.

[0030] The above-mentioned multi-scale overlapping patch segmentation strategy is adopted to segment the preprocessed historical ocean wave data and historical weather forecast data into several overlapping patch sequences with a specified step size. Specifically, it can be as follows: Cutting formula using overlapping patches: Calculate the patch data obtained by cutting at time step t, scale k, and position (i,j). Furthermore, the patch sequence within the time step range; in: , , i and j are index variables of the patch on the spatial grid, used to determine the position of the patch in space. This represents the data value at time step t after standardization. This indicates the number of patches at each scale; H and W are the height and width dimensions of the spatial grid. The patch size at scale k. Specify the current step size; Depending on the specified step size, the preprocessed historical wave data and historical weather forecast data are divided into several overlapping patch sequences with specified step sizes.

[0031] Add encoding information to the patch sequence. This encoding information includes: two-dimensional spatial location encoding, temporal location encoding, and scale encoding.

[0032] Among them, encoding information ; Encoding two-dimensional spatial location, Encoding for time and location. It is scale-coded.

[0033] Step 130: Using a cross-scale attention mechanism, integrate the patch sequences with a specified step length overlap corresponding to historical ocean wave data into a historical ocean wave data patch sequence; integrate the patch sequences with a specified step length overlap corresponding to historical weather forecast data into a historical weather forecast data patch sequence.

[0034] Because of the patch sequences collected in step 120 at several scales, in order to effectively integrate these spatiotemporal features at different scales, this step adopts a cross-scale attention mechanism to capture the information interaction and complementarity between different scales, and integrates several patch sequences with a specified step size overlap into historical ocean wave data patch sequences and historical weather forecast data patch sequences.

[0035] It should be noted that integrating multi-scale patch sequences through a cross-scale attention mechanism can effectively capture the feature correlations at different spatiotemporal scales in ocean wave data. Specifically, this mechanism enhances the ability to simultaneously model small-scale fluctuations and large-scale trends by dynamically weighting patch information at different scales, thus providing a more comprehensive feature representation for subsequent prediction tasks. In practical applications, this integration method can reduce prediction bias caused by single-scale features, and is particularly suitable for natural phenomena like ocean waves that have significant multi-scale characteristics.

[0036] Step 140: Perform spatial attention calculation on the historical wave data patch sequence to obtain the hidden state sequence; input the hidden state sequence into the LSTM network to obtain the hidden state at the current time.

[0037] In some embodiments, spatial attention is performed on historical wave data patch sequences to obtain hidden state sequences, specifically including: The hidden state representation of the historical wave data patch sequence at each time step is obtained by stacking multiple layers; The hidden state representation is subjected to residual connections and layer normalization, and then used as input data for the feedforward neural network. After normalization, the hidden state sequence is obtained.

[0038] It's important to note that combining spatial attention mechanisms with LSTM networks effectively extracts spatial feature dependencies from ocean wave data. Specifically, spatial attention computation dynamically focuses on the correlations between different regional patches, generating more representative hidden state sequences, while the LSTM network further captures the temporal evolution of these states. In practical applications, this combined structure can simultaneously model the spatial heterogeneity and dynamic changes of the ocean wave field, providing a more comprehensive feature representation for subsequent prediction tasks. For scenarios such as marine engineering and disaster early warning, this step can provide the model with more robust spatiotemporal feature inputs. The design of residual connections and layer normalization helps alleviate the gradient vanishing problem in deep network training, improving model stability.

[0039] Step 150: Use the historical weather forecast data patch sequence as the Query, and the hidden state at the current moment as the Key and Value, to perform cross-attention calculation and obtain the cross-attention output.

[0040] Specifically, historical weather forecast data patch sequences are used as queries, and the current hidden state is used as the key and value. This includes: Obtain weight data , , ,Will Multiply by the historical weather forecast data patch sequence to obtain the Query; Multiply by the current hidden state to obtain the Key; Multiply by the hidden state at the current moment to obtain Value.

[0041] The process of performing cross-attention calculations to obtain cross-attention outputs specifically includes: Through the formula: The cross-attention output is calculated. in, This represents the dimension of K.

[0042] It's worth noting that the value of achieving efficient fusion of future data and historical features through the cross-attention mechanism lies in three aspects: First, the design of using future data patches as queries and the current hidden state as key / value pairs dynamically captures the spatiotemporal correlation between historical features and future prediction targets. Second, by linearly transforming the query, key, and value using a learnable weight matrix, the importance of different feature dimensions can be adaptively adjusted. Finally, the attention calculation method based on scaled dot products effectively models long-range dependencies. In practical applications, this mechanism can provide more accurate spatiotemporal feature interaction representations for wave prediction tasks.

[0043] Step 160: Combining cross-attention output and temporal attention mechanisms, recursively generate the hidden state at the preset future time; use the hidden state at the preset future time through a linear layer and reconstruction operation to obtain the final wave height prediction.

[0044] It should be noted that the synergistic effect of cross-attention and temporal attention mechanisms enables the recursive generation of hidden state representations for future moments. Specifically, the cross-attention output provides the temporal attention mechanism with input that integrates historical and future features, while temporal attention further captures the temporal evolution patterns of these states. Linear layers and reconstruction operations transform the hidden states into interpretable wave height predictions, forming an end-to-end prediction process. In practical applications, this combined structure can effectively model the complex spatiotemporal dynamics of wave phenomena, providing direct predictive outputs for scenarios such as marine engineering and disaster early warning.

[0045] By combining cross-attention output and temporal attention mechanisms, the hidden states for preset future moments are generated recursively, specifically including: Through the formula: Recursively generate hidden states for preset future times. ; in, This is the hidden state before recursion. This indicates the output of cross-attention. This represents the multi-head temporal attention function.

[0046] The final wave height prediction is obtained by using a linear layer and reconstruction operations to obtain the hidden state at a preset future time. Specifically, this includes: Through the formula: The final wave height prediction was obtained. ; in, This indicates a hidden state that is preset for a future time. Represents a linear function. This represents the refactoring operation function.

[0047] Understandably, this approach, through joint modeling of cross-attention and temporal attention, recursively generates hidden state representations for future moments. Specifically, the cross-attention output provides the temporal attention mechanism with input that integrates historical and future features, while temporal attention further captures the temporal evolution patterns of these states. Linear layers and reconstruction operations transform the hidden states into interpretable wave height predictions, forming an end-to-end prediction process.

[0048] Based on the above description, this embodiment introduces historical weather forecast data as a query to participate in cross-attention calculation, directly achieving forward-looking modeling of wave generation driving factors. The spatiotemporal alignment of historical wave data with future meteorological elements such as wind fields and air pressure enables the model to capture the impact of sudden meteorological changes on wave evolution in advance, overcoming the limitations of traditional methods that rely solely on historical data due to their lag. The introduction of time location encoding in the encoded information further strengthens the modeling capability of temporal causal relationships.

[0049] By employing a multi-scale overlapping patch segmentation strategy and scale encoding, the technical solution explicitly constructs a hierarchical feature representation of the wave field. A spatial attention mechanism captures local wave details through gridding, while the combination of an LSTM network and a temporal attention mechanism enables dynamic tracking of the global propagation pattern. Two-dimensional spatial location encoding in the encoded information ensures the precise spatial positioning of features at different scales, forming a local-global collaborative feature interaction network.

[0050] By using future meteorological data as the query side of the attention mechanism and historical wave hidden states as the key / value side, the technical solution directly establishes a dynamic correlation channel between wind field and waves. The cross-attention calculation process implicitly simulates the energy transfer mechanism of wind energy input to wave generation, while the linear layer reconstruction operation conforms to the physical laws of wave energy dissipation. This end-to-end architecture design avoids the modeling errors caused by the discretization of physical parameters in traditional methods.

[0051] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism, characterized in that, The method comprises: Obtaining historical sea wave data and historical weather forecast data of a preset historical time period, and preprocessing the historical sea wave data and the historical weather forecast data; wherein the historical sea wave data and the historical weather forecast data both comprise time steps, variable channel numbers and spatial grid sizes; Using a multi-scale overlapping patch cutting strategy, the preprocessed historical sea wave data and the historical weather forecast data at each time are respectively cut into a plurality of specified step overlapping patch sequences, and coding information is added in the patch sequences; wherein the coding information comprises two-dimensional spatial position coding, time position coding and scale coding; Using a cross-scale attention mechanism, the specified step overlapping patch sequences corresponding to the historical sea wave data are integrated into a historical sea wave data patch sequence; and the specified step overlapping patch sequences corresponding to the historical weather forecast data are integrated into a historical weather forecast data patch sequence; For the historical sea wave data patch sequence, spatial attention calculation is performed to obtain a hidden state sequence; and the hidden state sequence is input into an LSTM network to obtain a hidden state at a current time; The historical weather forecast data patch sequence is taken as Query, and the hidden state at the current time is taken as Key and Value, and cross-attention calculation is performed to obtain cross-attention output; The cross-attention output and a time attention mechanism are combined to recursively generate a hidden state at a preset future time; and the hidden state at the preset future time is subjected to linear layer and reconstruction operations to obtain a final sea wave height prediction.

2. The sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism according to claim 1, characterized in that, Obtaining historical sea wave data and historical weather forecast data of a preset historical time period, specifically comprising: acquiring historical sea wave data for a preset historical time period of an input and historical weather forecast data ; wherein, and are the time steps of historical wave data and historical weather forecast data, respectively, and are the corresponding variable channel numbers, 3 is adopted, and the variables are the significant wave height, the mean wave period, and the wave direction, respectively; 5 is adopted, and the variables are the predicted radial wind, the latitudinal wind, the sea level pressure, the wind stress, and the barometric gradient force, respectively. H x W is the spatial grid size.

3. The sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism according to claim 1, characterized in that, Preprocessing the historical sea wave data and the historical weather forecast data, specifically comprising: Through the formula: , , obtaining pre-processed historical sea wave data / historical weather forecast data; where T is the time step of the historical sea wave data / historical weather forecast data, represents the data value of the historical sea wave data / historical weather forecast data at channel c, time step t, spatial location (i, j); c is in the range of [1, C], and C represents the number of variable channels, and H x W is the spatial grid size; is the data value of the historical sea wave data / historical weather forecast data at channel c, time step t, spatial location (i, j) after standardization.

4. The sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism according to claim 1, characterized in that, Using a multi-scale overlapping patch cutting strategy, the preprocessed historical sea wave data and the historical weather forecast data at each time are respectively cut into a plurality of specified step overlapping patch sequences, specifically comprising: Through the overlapping patch cutting formula: calculating patch data resulting from the cutting at time step t, scale k, location (i,j) and thereby obtaining a sequence of patches over a range of time steps; Wherein: , , i and j are index variables of the patch on the spatial grid, which are used to determine the position of the patch in space, denotes the data value at the normalized position of time step t, denotes the number of patches at each scale; H, W are the height and width dimensions of the spatial grid, is the patch size at scale k, is the current specified step size; According to a specified step size The pre-processed historical sea wave data and historical weather forecast data are respectively cut into a plurality of patch sequences with a specified step size.

5. The sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism according to claim 1, characterized in that, For the historical sea wave data patch sequence, spatial attention calculation is performed to obtain a hidden state sequence, specifically comprising: The hidden state representation of the historical sea wave data patch sequence at each time is obtained through multi-layer stacking; Residual connection and layer normalization are performed on the hidden state representation, which is then taken as input data of a feedforward neural network, and after normalization processing, a hidden state sequence is obtained.

6. The sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism according to claim 1, characterized in that, The historical weather forecast data patch sequence is taken as Query, and the hidden state at the current time is taken as Key and Value, specifically comprising: Obtain weight data , , ,Will Multiply by the historical weather forecast data patch sequence to obtain the Query; Multiply by the current hidden state to obtain the Key; Multiply by the hidden state at the current moment to obtain Value.

7. The sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism according to claim 1, characterized in that, Cross-attention calculation is performed to obtain cross-attention output, specifically comprising: Through the formula: , compute the cross-attention output; wherein denotes the dimension of K.

8. The sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism according to claim 1, characterized in that, The cross-attention output and a time attention mechanism are combined to recursively generate a hidden state at a preset future time, specifically comprising: Through the formula: , recursively generating the hidden state of the preset future moment ; wherein, is the hidden state before the recursion, denotes the cross-attention output, denotes the multi-head temporal attention function.

9. The sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism according to claim 1, characterized in that, The hidden state at the preset future time is subjected to linear layer and reconstruction operations to obtain a final sea wave height prediction, specifically comprising: Through the formula: , to obtain a final sea wave height prediction ; wherein, denotes a hidden state at a preset future time, denotes a linear function, denotes a reconstruction operation function.

10. The sea wave prediction method based on meteorological forecast field data fusion and spatio-temporal attention mechanism according to claim 1, characterized in that, Coding information is added in the patch sequence, specifically comprising: Coding information is added in the patch sequence; wherein the encoding information ; for two-dimensional spatial positions, for time positions, for scales.