Training method of weather prediction model, weather prediction method and device, electronic equipment and program product
By using multi-temporal and spatial scale feature extraction and dependency modeling modules, combined with the loss function design guided by the MJO index, the shortcomings of existing meteorological forecasting models in terms of temporal and spatial dependencies and physical constraints are solved, achieving higher meteorological forecasting accuracy and MJO prediction precision.
Patent Information
- Application Number
- CN202511622360.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-03
AI Technical Summary
Existing meteorological forecasting models lack spatiotemporal dependency modeling and physical constraints at different spatiotemporal scales, resulting in low meteorological forecasting accuracy, especially in sub-seasonal forecasts where it is difficult to capture complex atmospheric physical processes.
A multi-temporal and spatial scale feature extraction module, a multi-temporal and spatial scale dependency modeling module, and a fusion and prediction module are adopted. The cross-variable and spatiotemporal dependencies of meteorological features are modeled through a self-attention mechanism and a spatiotemporal graph neural network. The MJO exponent guides the design of the loss function and trains the meteorological prediction model.
It improves the accuracy and robustness of weather forecasts, especially by capturing atmospheric physical processes more comprehensively in sub-season forecasts, thus enhancing the accuracy of MJO forecasts.
Smart Images

Figure CN121456480A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of meteorological forecasting, and in particular relates to a training method for a meteorological forecasting model, a meteorological forecasting method, an apparatus, electronic equipment, and a program product. Background Technology
[0002] Weather forecasting refers to the technology of predicting the weather conditions of the Earth's atmosphere or a specific location below the atmosphere using modern scientific methods. It is of great significance to all aspects of human production, life, transportation, and safety. For example, weather forecasting can be used to plan farmland irrigation and pest control in advance, ensuring agricultural production; it can be used to optimize the dispatch of electricity and renewable energy, reducing energy consumption; and it can improve the ability to issue medium-term warnings for severe weather events such as rainstorms and cold waves. Therefore, improving the accuracy of weather forecasting is an urgent technical problem to be solved. Summary of the Invention
[0003] This application provides a method for training a weather forecasting model, a weather forecasting method, an apparatus, an electronic device, and a program product, which can improve the accuracy of weather forecasting.
[0004] In a first aspect, embodiments of this application provide a training method for a meteorological forecasting model, the meteorological forecasting model comprising: a multi-temporal and spatial scale feature extraction module, a multi-temporal and spatial scale dependency modeling module, and a fusion and prediction module, the training method comprising: Obtain a meteorological-related sample training set; In the multi-temporal-scale feature extraction module, meteorological features at multiple temporal and spatial scales are extracted from historical observations in the sample training set. In the multi-temporal-scale dependency modeling module, the multi-temporal-scale meteorological features are subjected to variable interactions based on a self-attention mechanism to model the cross-variable dependencies of the multi-temporal-scale meteorological features at the corresponding temporal-scale, thereby obtaining the corresponding aggregated meteorological features. The spatiotemporal dependencies of the aggregated meteorological features at the corresponding temporal-scale are then modeled to obtain the updated multi-temporal-scale meteorological features. The updated multi-temporal and spatial scale meteorological features are fused in the fusion and prediction module, and the model prediction results corresponding to the historical observation values are output. Based on the prediction results of the model, the meteorological prediction model is trained to obtain a trained meteorological prediction model, which is used to make meteorological predictions for the target area.
[0005] In this embodiment, by acquiring a meteorological-related sample training set, multi-temporal and spatial scale meteorological features can be extracted from each historical observation value in the multi-temporal and spatial scale feature extraction module of the meteorological prediction model. In the multi-temporal and spatial scale dependency modeling module, the multi-temporal and spatial scale meteorological features are subjected to variable interactions based on a self-attention mechanism to model the intervariate dependency of the multi-temporal and spatial scale meteorological features at the corresponding temporal and spatial scales, thereby obtaining the corresponding aggregated meteorological features. The spatiotemporal dependency of the aggregated meteorological features at the corresponding temporal and spatial scales is then modeled to obtain the updated multi-temporal and spatial scale meteorological features. In the fusion and prediction module, the updated multi-temporal and spatial scale meteorological features are fused, and the model prediction results corresponding to the historical observation values are output. Based on the model prediction results, the meteorological prediction model can be trained, thereby obtaining the trained meteorological prediction model. This scheme uses a multi-temporal-scale dependency modeling module to model the intervariate and spatiotemporal dependencies of meteorological features at each temporal-scale, thereby capturing the dynamic correlation and spatiotemporal co-evolution laws among various meteorological variables. Based on this, the meteorological prediction model is trained on the updated multi-temporal-scale meteorological features, which enables the trained meteorological prediction model to more comprehensively capture complex atmospheric physical processes, thereby improving the accuracy of meteorological prediction.
[0006] In some embodiments of the first aspect, the number of spatial scales is , For integers greater than 1, the multi-temporal-scale feature extraction module includes: a two-dimensional convolutional network, a temporal pyramid layer, and a block embedding layer; representing the historical observations as meteorological features at spatial and temporal scales of 1. In the case where the multi-temporal scale meteorological features are extracted from the historical observations in the multi-temporal scale feature extraction module, the extraction includes: Extracting the historical observations from the two-dimensional convolutional network Meteorological characteristics at various spatial scales, the Each spatial scale is greater than the spatial scale 1; Meteorological features at multiple time scales at each spatial scale are extracted from the time pyramid layer to obtain meteorological features at each spatiotemporal scale. In the segmented embedding layer, the meteorological features of each spatiotemporal scale are segmented and embedded in two dimensions to obtain the meteorological features of each spatiotemporal scale after segmented embedding. The meteorological features of each spatiotemporal scale after segmented embedding are the multi-spatiotemporal scale meteorological features.
[0007] In some embodiments of the first aspect, the extraction of the historical observations from the two-dimensional convolutional network... Meteorological characteristics at various spatial scales include: The spatial scale is obtained in the two-dimensional convolutional network based on two-dimensional convolutional layers, two-dimensional average pooling layers, and meteorological features. Meteorological characteristics:
[0008] in, Indicates spatial scale Meteorological characteristics at time scale 1 This represents the two-dimensional convolutional layer. This represents the two-dimensional average pooling layer. Indicates spatial scale Meteorological characteristics at time scale 1 Spatial scale Spatial scale The next spatial scale, spatial scale for In addition to spatial scale, Spatial scale beyond, spatial scale The meteorological characteristics are as described Meteorological characteristics at any spatial scale among meteorological characteristics at various spatial scales.
[0009] In some embodiments of the first aspect, the fusion and prediction module includes: a temporal fusion layer, a spatial fusion layer, and a prediction layer; the step of fusing the updated multi-temporal and spatial scale meteorological features in the fusion and prediction module and outputting model prediction results corresponding to the historical observations includes: In the time fusion layer, meteorological features belonging to different time scales at the same spatial scale among the multi-temporal scale meteorological features are fused to obtain meteorological features fused at the corresponding spatial scale. In the spatial fusion layer, meteorological features fused from all spatial scales are fused to obtain meteorological features fused from all spatiotemporal scales. In the prediction layer, the meteorological features fused from all spatiotemporal scales are processed through a linear layer and a random deactivation layer to obtain the model prediction results.
[0010] In some embodiments of the first aspect, the number of spatial scales is The number of time scales is , and All are integers greater than 1, representing the historical observations as meteorological characteristics at a spatial scale of 1 and a temporal scale of 1. In the case where the meteorological features belonging to the same spatial scale but different time scales in the multi-temporal scale meteorological features are fused in the time fusion layer to obtain the corresponding spatial scale fused meteorological features, the process includes: for Any spatial scale in a spatial scale In the time fusion layer, a one-dimensional transposed convolutional layer is used to convert the time scale. Meteorological characteristics aligned to time scale The meteorological characteristics were used to obtain the spatial scale after transpose and convolution. and time scale meteorological characteristics, greater than zero and less than or equal to integers, greater than zero and less than integers, time scale Time scale The next timescale, in for In the case of the time scale The meteorological characteristics are spatial scale and time scale Meteorological characteristics; in Less than In the case of the time scale The meteorological characteristics are spatial scale and time scale Meteorological characteristics after +1 linear combination; Spatial scale and time scale The meteorological characteristics and the spatial scale after transpose convolution and time scale By linearly combining the meteorological characteristics, we can obtain the spatial scale. and time scale Meteorological characteristics after linear combination, and spatial scale Meteorological characteristics obtained by linear combination with time scale 1 are determined as spatial scale. The meteorological characteristics after fusion.
[0011] In some embodiments of the first aspect, the fusion of meteorological features fused at all spatial scales in the spatial fusion layer to obtain meteorological features fused at all spatiotemporal scales includes: In the spatial fusion layer, the spatial scale is represented by a two-dimensional transposed convolutional layer. Meteorological characteristics aligned to spatial scale The fused meteorological features yield the spatial scale after transpose and convolution. meteorological characteristics, greater than zero and less than Integers, spatial scale Spatial scale The next spatial scale; in for In the case of the spatial scale The meteorological characteristics are spatial scale The combined meteorological characteristics; Less than In the case of the spatial scale The meteorological characteristics are spatial scale Meteorological characteristics after linear combination; The spatial scale The fused meteorological features and the spatial scale after transposed convolution By linearly combining the meteorological characteristics, we can obtain the spatial scale. The meteorological characteristics after linear combination are determined, and the meteorological characteristics after linear combination of spatial scale 1 are determined as the meteorological characteristics after fusion of all spatiotemporal scales.
[0012] In some embodiments of the first aspect, prior to training the weather prediction model based on the model prediction results, the method further includes: Obtain the actual meteorological results, actual MJO index, and predicted MJO index corresponding to the historical observation values; The step of training the meteorological prediction model based on the prediction results of the model includes: Based on the actual meteorological results and the model prediction results, the first prediction loss of the meteorological prediction model is calculated; Based on the actual MJO index and the predicted MJO index, the second prediction loss of the weather prediction model is calculated; The weather forecasting model is trained based on the first prediction loss and the second prediction loss.
[0013] Secondly, embodiments of this application provide a weather forecasting method, including: Obtain historical meteorological data for the target area; The historical meteorological data is input into the trained meteorological prediction model to obtain the meteorological prediction results for the target area in a preset future time period. The trained meteorological prediction model is trained based on the method described in any one of the first aspects above.
[0014] In this embodiment of the application, historical meteorological data of the target area can be obtained and input into a trained meteorological prediction model. The trained meteorological prediction model can capture complex atmospheric physical processes more comprehensively, thereby improving the accuracy of meteorological prediction.
[0015] Thirdly, embodiments of this application provide a training device for a meteorological forecasting model, the meteorological forecasting model comprising: a multi-temporal and spatial scale feature extraction module, a multi-temporal and spatial scale dependency modeling module, and a fusion and prediction module, the training device comprising: The training set acquisition module is used to acquire a meteorological-related sample training set; The feature extraction module is used to extract multi-temporal and spatial scale meteorological features from historical observations in the sample training set in the multi-temporal and spatial scale feature extraction module; The dependency modeling module is used to perform inter-variable interactions of the multi-temporal and spatial scale meteorological features based on a self-attention mechanism in the multi-temporal and spatial scale dependency modeling module, so as to model the intervariable dependencies of the multi-temporal and spatial scale meteorological features at the corresponding temporal and spatial scales, obtain the corresponding aggregated meteorological features, and model the spatiotemporal dependencies of the aggregated meteorological features at the corresponding temporal and spatial scales, so as to obtain the updated multi-temporal and spatial scale meteorological features. The feature fusion module is used to fuse the updated multi-temporal and spatial scale meteorological features in the fusion and prediction module, and output the model prediction results corresponding to the historical observation values. The model training module is used to train the meteorological prediction model based on the prediction results of the model, and obtain a trained meteorological prediction model, which is used to make meteorological predictions for the target area.
[0016] Fourthly, embodiments of this application provide a weather forecasting device, comprising: The data acquisition module is used to acquire historical meteorological data for the target area; The data input module is used to input the historical meteorological data into the trained meteorological prediction model to obtain the meteorological prediction results of the target area in a preset future time period. The trained meteorological prediction model is trained based on the method described in any one of the first aspects above.
[0017] Fifthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device enables the electronic device to implement the training method for the meteorological forecasting model as described in any one of the first aspects above, or to implement the meteorological forecasting method as described in the second aspect above.
[0018] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a computer, implements the training method for the meteorological forecasting model as described in any one of the first aspects above, or implements the meteorological forecasting method as described in the second aspect above.
[0019] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program that, when run, causes the training method of a weather forecasting model as described in any one of the first aspects above to be executed, or causes the weather forecasting method as described in the second aspect above to be executed.
[0020] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic flowchart of the training method for the meteorological forecasting model provided in the embodiments of this application; Figure 2 This is a flowchart illustrating the overall process of training a meteorological forecasting model provided in this application embodiment. Figure 3 This is a schematic diagram of the overall framework of the meteorological forecasting model provided in the embodiments of this application; Figure 4 This is a schematic flowchart of the weather forecasting method provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the training device for the meteorological forecasting model provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the weather forecasting device provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0023] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0024] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0025] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0026] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0027] It should be understood that this application does not limit the forecast time scale of the meteorological forecast model. For example, the meteorological forecast model provided in the embodiments of this application can perform short-term forecasts (e.g., forecasts for the next 0-12 hours), short-term forecasts (e.g., forecasts for the next 1-3 days), medium-term forecasts (e.g., forecasts for the next 3-10 days), sub-seasonal forecasts (e.g., forecasts for the next 15-60 days), seasonal forecasts (e.g., forecasts for the next 3 months or more), etc.
[0028] For ease of understanding, this embodiment uses sub-seasonal forecasting as an example, but this does not constitute a limitation on the forecast time scale of the meteorological forecasting model.
[0029] Sub-seasonal forecasting, also known as sub-seasonal to seasonal forecasting (S2S forecasting), refers to climate prediction of atmospheric or surface variables over the next 15 to 60 days. This forecast timescale falls between weather forecasting (usually within 7 days) and seasonal forecasting (usually 3 months or more). Sub-seasonal forecasting has high application value, for example (1) enabling advance planning of farmland irrigation and pest control to ensure agricultural production; (2) optimizing power and renewable energy dispatch to reduce energy consumption; and (3) enhancing the mid-term early warning capability for severe weather events such as rainstorms and cold waves. However, sub-seasonal forecasting is difficult and has low accuracy, representing a technical challenge in current meteorological forecasting.
[0030] The challenge of subseasonal forecasting lies in modeling the complex spatiotemporal dependencies between atmospheric, terrestrial, and oceanic variables across multiple spatiotemporal scales. These meteorological variables, such as atmospheric circulation, sea surface temperature, soil moisture, snow cover, and sea ice, span from days to months in time and cover local, regional, and even global scales in space. Their interactions are highly nonlinear and exhibit significant long time lags and cross-sphere and cross-regional coupling characteristics. For example, distant tropical sea surface temperature anomalies can influence mid-latitude weather weeks later through atmospheric teleconnection paths, while changes in Arctic sea ice can alter planetary wave propagation and perturb mid-latitude circulation structures. These cross-regional feedback mechanisms disrupt local causal relationships, posing significant challenges to modeling and inference.
[0031] Furthermore, the Madden-Julian Oscillation (MJO), as one of the most critical subseasonal atmospheric variability phenomena, significantly influences weather evolution in the troposphere through eastward-propagating convection and wind field disturbances. Its activity and propagation state play a decisive role in subseasonal forecasts of precipitation, temperature, and other parameters, and therefore often serves as an important physical constraint in forecasting systems.
[0032] Currently, sub-seasonal forecasting mainly employs numerical weather prediction (NWP) and deep learning models. NWP models are built based on physical equations and have advantages such as strong interpretability and quantifiable uncertainty, but they are sensitive to initial conditions, have high computational costs, and lack the ability to respond to key variables such as the MJO.
[0033] In recent years, data-driven deep learning models have gradually emerged in weather forecasting. Typical models include Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), Transformer structures, and Graph Neural Networks (GNNs). These models automatically extract pattern features from large-scale historical observation data, effectively uncovering nonlinear patterns and offering advantages such as fast inference and low computational cost. However, deep learning models lack modeling of dependencies between variables at different spatiotemporal scales. Furthermore, existing deep learning models lack physical constraints at sub-seasonal scales.
[0034] To address the shortcomings of existing methods in considering spatiotemporal dependencies at different spatiotemporal scales and the lack of physical constraints, the embodiments of this application can model the dependencies between variables and spatiotemporal dependencies at multiple spatiotemporal scales, thereby improving the accuracy of weather forecasts. Furthermore, by using important atmospheric phenomena at the sub-seasonal scale (i.e., MJOs) to guide the design of loss functions, the potential correlations between variables in the ocean, land, and atmosphere at the sub-seasonal scale can be explored, thereby improving the accuracy of MJO forecasts.
[0035] The training method for the weather forecast model provided in this application embodiment can be applied to electronic devices such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application embodiment does not impose any restrictions on the specific type of electronic device.
[0036] Please see Figure 1 , Figure 1 A schematic flowchart illustrating the training method of the meteorological forecasting model provided in this application embodiment is shown. The meteorological forecasting model includes: a multi-temporal and spatial scale feature extraction module, a multi-temporal and spatial scale dependency modeling module, and a fusion and prediction module. As an example and not a limitation, the method includes the following steps: Step 101: Obtain a training set of meteorological-related samples.
[0037] Each sample in the training set may include historical observations of multiple meteorological variables at multiple time steps from multiple geographic grid points.
[0038] A geographic grid can be a basic data structure used to discretize spatial locations on the Earth's surface. That is, the continuous Earth's surface is divided into a regularly arranged two-dimensional grid, with each grid point (i.e., a geographic grid point) corresponding to a specific geographic coordinate (e.g., latitude and longitude), and storing historical observations of multiple meteorological variables at multiple time steps for that location.
[0039] As an example, and not a limitation, each sample data includes: Geographic grid points individual meteorological variables Historical observations at each time step That is, each sample data is . , , and All are integers greater than 1, and their specific values can be set according to actual needs or experience. This application does not impose any restrictions on them.
[0040] The meteorological variables mentioned above include, but are not limited to, variables from the ocean, land, and atmosphere. Variables from the ocean layer include, but are not limited to, sea surface temperature, ocean currents, salinity, and sea surface latent heat flux. Variables from the land layer include, but are not limited to, surface temperature, soil moisture, and snow depth. Variables from the atmosphere include, but are not limited to, temperature, humidity, air pressure, wind speed, and precipitation rate.
[0041] In one example, taking temperature as the meteorological variable, multiple time steps are each hour within a certain three days. Then, the historical observations of temperature at multiple time steps can refer to a temperature value for each hour within a certain three days, for a total of 72 historical observations.
[0042] In some embodiments, the given ERA5 meteorological data can be preprocessed first, and then a meteorological-related sample training set can be constructed based on chronological order. ERA5 is the global climate reanalysis dataset provided by the European Centre for Medium-Range Weather Forecasts.
[0043] The data preprocessing mentioned above includes, but is not limited to, outlier and missing value removal, standardization, and batch processing of the training set.
[0044] Step 102: Extract multi-temporal and spatial scale meteorological features from historical observations in the sample training set in the multi-temporal and spatial scale feature extraction module.
[0045] Among them, multi-temporal and spatial scale meteorological features reveal the inherent patterns of changes in historical observations across different time and spatial scales. By extracting multi-temporal and spatial scale meteorological features, meteorological forecasting models can learn the key mechanism of interactions between features at different scales, thereby improving the accuracy of meteorological forecasts.
[0046] Step 103: In the multi-temporal-scale dependency modeling module, the multi-temporal-scale meteorological features are subjected to variable interactions based on a self-attention mechanism to model the intervariate dependencies of the multi-temporal-scale meteorological features at the corresponding temporal-scale, thereby obtaining the corresponding aggregated meteorological features. The spatiotemporal dependencies of the aggregated meteorological features at the corresponding temporal-scale are then modeled to obtain the updated multi-temporal-scale meteorological features.
[0047] In some embodiments, the multi-spatiotemporal scale dependency modeling module described above may include a variable aggregation layer and a spatiotemporal encoder. The variable aggregation layer performs inter-variable interactions of meteorological features at multiple spatiotemporal scales based on a self-attention mechanism. The spatiotemporal encoder models and aggregates the spatiotemporal dependencies of meteorological features at corresponding spatiotemporal scales based on a spatiotemporal graph neural network.
[0048] In this embodiment, by introducing a multi-temporal-scale dependency modeling module, variables of the ocean, land, atmosphere and other spheres are interacted using a self-attention mechanism at each temporal-scale, and spatiotemporal features are interacted using a spatiotemporal graph neural network. This enables the modeling of cross-variable dependencies and spatiotemporal dependencies at multiple temporal-scales, thereby capturing the dynamic correlation and spatiotemporal co-evolution laws among various meteorological variables and improving the accuracy of meteorological forecasts.
[0049] Step 104: In the fusion and prediction module, the updated multi-temporal and spatial scale meteorological features are fused, and the model prediction results corresponding to the historical observation values are output.
[0050] In this embodiment, the fusion and prediction module can fuse the updated multi-temporal and spatial scale meteorological features on both the temporal and spatial scales to obtain meteorological features fused at all temporal and spatial scales. Based on the meteorological features fused at all temporal and spatial scales, the model prediction results can be obtained.
[0051] In this embodiment, by introducing a fusion and prediction module, atmospheric features at different time and spatial scales are integrated, which can solve the complex interaction problems that cannot be captured by a single scale, thereby improving the accuracy, robustness and practicality of weather forecasts.
[0052] Step 105: Based on the model prediction results, train the meteorological prediction model to obtain the trained meteorological prediction model. The trained meteorological prediction model is used to make meteorological predictions for the target area.
[0053] The above-mentioned model prediction results may refer to the meteorological results predicted by the meteorological prediction model.
[0054] In some embodiments, real meteorological results corresponding to historical observations can be obtained, and a meteorological prediction model can be trained based on the model prediction results and the real meteorological results.
[0055] The target area mentioned above can refer to any region that requires weather forecasting. For example, the target area could be the entire Southeast Asia region or a specific city.
[0056] like Figure 2 The diagram shown is an overall flowchart of the training method for the meteorological forecasting model provided in this application embodiment. Figure 2The original meteorological data in the model is given ERA5 meteorological data. Data preprocessing can be performed sequentially, including outlier handling, standardization, and batch processing of the training set. A batch of training samples is randomly selected from the training set. These training samples are then sequentially input into the multi-temporal scale feature extraction module, multi-temporal scale dependency modeling module, and fusion and output module of the meteorological prediction model, outputting the prediction results (i.e., the model prediction results). The training loss is calculated based on the model prediction results, and the model parameters (i.e., the parameters in the meteorological prediction model) are updated using the backpropagation algorithm based on the training loss. The model then determines whether training is complete (e.g., whether the early stopping condition or the specified number of iterations has been met). If the early stopping condition or the specified number of iterations has been met, training is complete, and the trained meteorological prediction model is output. If the early stopping condition has not been met and the specified number of iterations has not been met, training is incomplete, and the process returns to the step of randomly selecting a batch of training samples from the training set and subsequent steps until training is complete.
[0057] In this embodiment, the multi-temporal-scale dependency modeling module can model the cross-variable dependency and spatiotemporal dependency of meteorological features at each spatiotemporal scale, thereby capturing the dynamic correlation and spatiotemporal co-evolution law between various meteorological variables. Based on this, the meteorological prediction model can be trained based on the updated multi-temporal-scale meteorological features, which enables the trained meteorological prediction model to capture complex atmospheric physical processes more comprehensively, thereby improving the accuracy of meteorological prediction.
[0058] In some embodiments of this application, the hyperparameters required for the weather forecasting model and the time-series pooling ratio can be preset before training the weather forecasting model. Number of time scales Space pooling ratio Number of spatial scales Patch length Training loss balance coefficient Optionally, the above hyperparameters can be set according to actual needs or empirical values; this application does not impose any restrictions on this.
[0059] In some embodiments of this application, the number of spatial scales is , For integers greater than 1, the multi-temporal-scale feature extraction module includes: a two-dimensional convolutional network, a temporal pyramid layer, and a block embedding layer; representing historical observations as meteorological features at spatial and temporal scales of 1. In this case, the multi-temporal and spatial scale meteorological features are extracted from historical observations in the multi-temporal and spatial scale feature extraction module, including: Extracting historical observations from a 2D convolutional network Meteorological characteristics at various spatial scales Each spatial scale is greater than spatial scale 1; Meteorological features at multiple time scales are extracted at each spatial scale in the time pyramid layer to obtain meteorological features at each spatiotemporal scale. In the block embedding layer, the meteorological features of each spatiotemporal scale are divided into two-dimensional blocks for embedding, resulting in meteorological features of each spatiotemporal scale after block embedding. The meteorological features of each spatiotemporal scale after block embedding are multi-spatiotemporal scale meteorological features.
[0060] Among them, the above The spatial scales include: spatial scale 2, ..., spatial scale 3. Compared to meteorological characteristics at a spatial scale of 1, this Meteorological features at different spatial scales correspond to a larger receptive field, enabling the capture of more macroscopic systemic meteorological structures. Due to their wider coverage, these meteorological features are more abstract and integrate contextual information, thus providing key environmental and physical constraints for meteorological forecasting models to understand large-scale physical processes, and enhancing the models' ability to understand complex meteorological environments.
[0061] Optionally, a time pyramid layer can be composed of a convolutional kernel with a size of [missing information]. A one-dimensional convolutional layer and a pooling kernel of size It consists of a one-dimensional average pooling layer.
[0062] In this embodiment, by introducing a multi-temporal-scale feature extraction module, hierarchical spatial features can be extracted first using a two-dimensional convolutional network, and then hierarchical temporal features can be extracted using a time pyramid layer, thereby enabling the extraction of the spatiotemporal features of each meteorological variable at multiple spatiotemporal scales.
[0063] In some embodiments of this application, historical observations are extracted from a two-dimensional convolutional network. Meteorological characteristics at various spatial scales include: Spatial scale is obtained in a two-dimensional convolutional network based on two-dimensional convolutional layers, two-dimensional average pooling layers, and meteorological features. Meteorological characteristics:
[0064] in, Indicates spatial scale Meteorological characteristics at time scale 1 Represents a two-dimensional convolutional layer. This represents a two-dimensional average pooling layer. Indicates spatial scale Meteorological characteristics at time scale 1 Spatial scale Spatial scale The next spatial scale, spatial scale for In addition to spatial scale, Spatial scale beyond, spatial scale The meteorological characteristics are Meteorological characteristics at any spatial scale among meteorological characteristics at various spatial scales.
[0065] Optionally, the kernel size of the above-mentioned two-dimensional convolutional layer can be... The pooling kernel size of the above two-dimensional average pooling layer can be... .
[0066] In some embodiments of this application, the fusion and prediction module includes: a temporal fusion layer, a spatial fusion layer, and a prediction layer; the fusion and prediction module fuses updated multi-temporal and spatial scale meteorological features and outputs model prediction results corresponding to historical observations, including: In the time fusion layer, meteorological features belonging to the same spatial scale but different time scales in multi-temporal and spatial scale meteorological features are fused to obtain meteorological features fused at the corresponding spatial scale. In the spatial fusion layer, meteorological features fused from all spatial scales are fused to obtain meteorological features fused from all spatiotemporal scales. In the prediction layer, the meteorological features fused across all spatiotemporal scales are processed through a linear layer and a random deactivation layer to obtain the model prediction results.
[0067] In this embodiment, the temporal fusion layer fuses meteorological features from different time scales at the same spatial scale, capturing cross-temporal dependencies and strengthening key information in the time dimension. This enhances the meteorological prediction model's understanding of the evolution patterns of meteorological sequences and improves prediction accuracy. The spatial fusion layer further fuses the temporally fused meteorological features at different spatial scales, integrating multi-spatial-scale interaction mechanisms. This allows the meteorological prediction model to better capture meteorological features from different regions, thereby improving its prediction accuracy and regional applicability. In the prediction layer, a linear layer maps the high-dimensional fused meteorological features to specific prediction targets (e.g., precipitation probability, temperature values). A random deactivation layer is introduced during the training phase of the meteorological prediction model for regularization, effectively suppressing overfitting and significantly improving the generalization ability of the meteorological prediction model.
[0068] In some embodiments of this application, the number of spatial scales is The number of time scales is , and All are integers greater than 1, representing historical observations as meteorological characteristics at a spatial scale of 1 and a temporal scale of 1. In this case, meteorological features belonging to the same spatial scale but different time scales are fused in the time fusion layer to obtain the corresponding spatial scale fused meteorological features, including: for Any spatial scale in a spatial scale In the temporal fusion layer, a one-dimensional transposed convolutional layer is used to combine the time scales. Meteorological characteristics aligned to time scale The meteorological characteristics were used to obtain the spatial scale after transpose and convolution. and time scale meteorological characteristics, greater than zero and less than or equal to integers, greater than zero and less than integers, time scale Time scale The next timescale, in for In the case of time scale The meteorological characteristics are spatial scale and time scale Meteorological characteristics; in Less than In the case of time scale The meteorological characteristics are spatial scale and time scale Meteorological characteristics after linear combination; Spatial scale and time scale Meteorological characteristics and spatial scale after transpose convolution and time scale By linearly combining the meteorological characteristics, we can obtain the spatial scale. and time scale Meteorological characteristics after linear combination, and spatial scale Meteorological characteristics obtained by linear combination with time scale 1 are determined as spatial scale. The meteorological characteristics after fusion.
[0069] The one-dimensional transposed convolutional layer in the temporal fusion layer is used to align meteorological features at a larger time scale to meteorological features at a smaller time scale. Optionally, the kernel size of the aforementioned one-dimensional transposed convolutional layer can be [missing information]. The stride can be 1.
[0070] In this embodiment, by aligning meteorological features at a larger time scale to meteorological features at a smaller time scale, meteorological features at different time scales can be fused at the same time scale. This allows the meteorological forecasting model to effectively improve the accuracy of short-term and refined forecasts while making full use of the contextual information provided by the meteorological features at a larger time scale.
[0071] In some embodiments of this application, meteorological features fused at all spatial scales are fused in the spatial fusion layer to obtain meteorological features fused at all spatiotemporal scales, including: In the spatial fusion layer, a two-dimensional transposed convolutional layer is used to scale the spatial dimensions. Meteorological characteristics aligned to spatial scale The fused meteorological features yield the spatial scale after transpose and convolution. meteorological characteristics, greater than zero and less than Integers, spatial scale Spatial scale The next spatial scale; in for In the case of spatial scale The meteorological characteristics are spatial scale The combined meteorological characteristics; Less than In the case of spatial scale The meteorological characteristics are spatial scale Meteorological characteristics after linear combination; Spatial scale The fused meteorological features and the spatial scale after transposed convolution By linearly combining the meteorological characteristics, we can obtain the spatial scale. The meteorological characteristics after linear combination are determined, and the meteorological characteristics after linear combination of spatial scale 1 are determined as the meteorological characteristics after fusion of all spatiotemporal scales.
[0072] The spatial fusion layer includes a two-dimensional transposed convolutional layer used to align meteorological features at a larger spatial scale to those at a smaller spatial scale. Optionally, the kernel size of the aforementioned two-dimensional transposed convolutional layer can be [missing information]. The stride can be .
[0073] In this embodiment, by aligning meteorological features at a larger spatial scale to meteorological features at a smaller spatial scale, meteorological features at different spatial scales can be fused at the same spatial scale. This allows the meteorological forecasting model to effectively improve the accuracy of local and refined forecasts while making full use of the contextual information provided by the meteorological features at a large spatial scale.
[0074] In some embodiments of this application, before training the meteorological forecasting model based on the model prediction results, the method further includes: Obtain the actual meteorological results, actual MJO index, and predicted MJO index corresponding to historical observations; Based on the model prediction results, a meteorological prediction model is trained, including: Based on actual meteorological results and model prediction results, calculate the first prediction loss of the meteorological prediction model; Based on the actual MJO index and the predicted MJO index, the second prediction loss of the meteorological prediction model is calculated. The weather forecasting model is trained based on the first and second prediction losses.
[0075] In some embodiments, predicted outward longwave radiation variables, zonal wind variables, and zonal wind variables corresponding to historical observations can be obtained, and the predicted MJO index can be calculated based on these predicted variables. Alternatively, actual outward longwave radiation variables, zonal wind variables, and zonal wind variables corresponding to historical observations can be obtained, and the actual MJO index can be calculated based on these actual variables.
[0076] It should be understood that this application does not limit the loss function used in calculating the first prediction loss and the second prediction loss. The loss function used to calculate the first prediction loss and the loss function used to calculate the second prediction loss can be the same (e.g., both use mean absolute error) or different (e.g., the loss function used to calculate the first prediction loss is mean absolute error, and the loss function used to calculate the second prediction loss is mean squared error). This application does not limit this.
[0077] In some embodiments, the first prediction loss and the second prediction loss can be weighted and summed based on a set training loss balance coefficient to obtain the training loss, thereby training the weather prediction model based on the training loss.
[0078] In this embodiment, by introducing the MJO prediction loss (i.e., the second prediction loss), the meteorological prediction model can be constrained to learn the features of MJO-related variables, thereby uncovering the potential correlations between variables in the ocean, land, atmosphere and other spheres at the sub-seasonal scale, and thus improving the accuracy of MJO prediction.
[0079] like Figure 3 The diagram shown is a schematic representation of the overall framework of the meteorological forecasting model provided in this application embodiment. Steps 1 to 10 are combined below. Figure 3 The training process of the meteorological forecasting model is described in detail.
[0080] Step 1: Perform outlier and missing value removal and standardization on the given ERA5 meteorological data, determine the time span of the training set, and then use a sliding window to divide the processed meteorological data to obtain the training set.
[0081] Outliers and missing values in the given ERA5 meteorological data are eliminated, and then the ERA5 meteorological data is standardized. The standardization process is implemented using the following formula:
[0082] in, For the global Geographic grid points Meteorological data for 1 meteorological variable, with a training set time span of 1. . , They are respectively Geographic grid points The mean and standard deviation of the training set for each meteorological variable over its time span. The data is the standardized meteorological data. A training set is obtained by dividing the standardized meteorological data using a sliding window, with the time window being [time window value missing]. Each sample data in the training set is .
[0083] Step 2: Divide the training set into the set batch size. The operation will be carried out in batches, with a total of [number] batches. .
[0084] The batch processing of the training set can be determined based on the total number of samples in the training set and the batch size, and the calculation formula is as follows:
[0085] in, This represents the total number of samples in the training set.
[0086] Step 3: Manually set the hyperparameters required for the model, including the time-series pooling ratio. Number of time scales Space pooling ratio Number of spatial scales Block length Training loss balance coefficient .
[0087] Step 4: Randomly select a batch of training samples from the training set, where the data for each training sample (i.e., each sample data) contains... Geographic grid points individual meteorological variables Historical observations at each time step .
[0088] Step 5, Defined as spatial scale and time scale meteorological characteristics , Therefore, historical observations It can be expressed as spatial scale and time scale meteorological characteristics .Will The data is input into the multi-temporal and spatial scale feature extraction module to obtain multi-temporal and spatial scale meteorological features. .
[0089] First, in the multi-temporal-scale feature extraction module, a two-dimensional convolutional layer is used to extract meteorological features at a larger spatial scale. A two-dimensional convolutional layer consists of a convolutional kernel of size [missing information]. A two-dimensional convolutional layer and a The two-dimensional average pooling layer is constructed, and its implementation formula is as follows:
[0090] Secondly, a time pyramid layer is used to extract meteorological features at multiple time scales for each spatial scale. Each time pyramid layer consists of a convolutional kernel with a size of [missing information]. A one-dimensional convolutional layer and a pooling kernel of size The one-dimensional average pooling layer is constructed, and its implementation formula is as follows:
[0091] in, Indicates spatial scale and time scale meteorological characteristics, .
[0092] Finally, the meteorological features at each spatiotemporal scale are used in a segmented embedding layer. The formula for two-dimensional block embedding is as follows:
[0093] in, Indicates spatial scale and time scale Meteorological features after segmentation and embedding For feature dimensions.
[0094] Step 6: Combine meteorological characteristics at multiple temporal and spatial scales. The input is fed into the multi-temporal-scale dependency modeling module to obtain updated multi-temporal-scale meteorological features. .
[0095] First, in the multi-temporal-scale dependency modeling module, a variable aggregation layer is used to perform variable interactions based on a self-attention mechanism on the segmented and embedded meteorological features. For spatial scale... and time scale Characteristics of global variables initialized with given random parameters and meteorological features after segmentation and embedding The variable aggregation layer will feature global variables. As a self-attention mechanism, the query will embed the meteorological features in blocks. As the keys and values of the self-attention mechanism, its implementation formula is as follows:
[0096] in, Spatial scale and time scale Aggregated meteorological characteristics after variable aggregation.
[0097] Secondly, aggregate meteorological characteristics The input is fed into the spatiotemporal encoder. For spatial scale... and time scale Node embedding initialized with given random parameters In the spatiotemporal encoder, a graph unique to each spatiotemporal scale is constructed. Nodes in the graph represent geographic grid points corresponding to that spatiotemporal scale, and edges are adaptively learnable edges. The relationship between nodes and edges in the graph can be represented using a learnable adjacency matrix, the formula of which is as follows:
[0098] in, Spatial scale and time scale The adjacency matrix, Represents a non-linear activation function. This represents the normalization function.
[0099] Given The spatiotemporal encoder is mainly based on Graph Convolutional Recurrent Units (GCRUs) in spatiotemporal graph neural networks. It can not only model spatial dependencies based on graphs, but also model temporal dependencies in a recurrent manner. Its implementation formula is as follows:
[0100] in, Spatial scale and time scale Meteorological characteristics (i.e., updated spatial scale) obtained through the spatiotemporal encoder and time scale (Meteorological characteristics).
[0101] Step 7: Convert the output of the multi-spatiotemporal scale dependency modeling module. The data is input into the fusion and prediction module to obtain weather forecasts for the next period of time. .
[0102] First, the temporal fusion layer in the fusion and prediction module aggregates meteorological features across all time scales for each spatial scale. For spatial scales... A one-dimensional transposed convolutional layer is used to align meteorological features at a larger time scale to meteorological features at a smaller time scale. The formula for this is as follows:
[0103] in, Spatial scale after transpose convolution and time scale meteorological characteristics, .
[0104] It should be understood that, in When the value is less than K, the formula (9) will be used. Updated to .
[0105] Then, using normalized parameters and , , The formula for its implementation is as follows:
[0106] in, Spatial scale and time scale Meteorological characteristics after linear combination, taking spatial scale Meteorological characteristics at the smallest time scale As a spatial scale The meteorological characteristics after fusion.
[0107] Secondly, the spatial fusion layer aggregates meteorological features from all spatial scales, and uses a two-dimensional transposed convolutional layer to align meteorological features from larger spatial scales to meteorological features from smaller spatial scales. The formula for this is as follows:
[0108] in, Spatial scale after transpose convolution meteorological characteristics, .
[0109] It should be understood that, in Less than In the case of formula (11), Updated to .
[0110] Then, using normalized parameters ,in , , The formula for its implementation is as follows:
[0111] in, Spatial scale Meteorological characteristics after linear combination. The meteorological characteristics at the smallest spatial scale are taken as the fused meteorological characteristics at all spatiotemporal scales, i.e. .
[0112] Finally, the prediction layer outputs the model prediction results through a linear layer and a random deactivation layer, and its implementation formula is as follows:
[0113] in, , This indicates the prediction time step.
[0114] Step 8: Calculate the prediction loss for all training samples in a batch of training samples. (i.e., the first prediction loss), calculate the MJO prediction loss (i.e., the second prediction loss), which is the prediction loss of the Madden-Julian oscillation on the next seasonal timescale. Based on the prediction loss... And MJO predicted loss Training loss can be obtained. .
[0115] In this embodiment, the mean absolute error can be used as the prediction loss. That is, the real weather conditions of all training samples in a batch of training samples. and model prediction results The error between them is calculated using the following formula:
[0116] in, For the first training sample training samples, for The first of the meteorological variables One meteorological variable, To predict the time step The first in Each time step for Row index in a geographic grid for Column indexes in a geographic grid.
[0117] Furthermore, the MJO prediction loss is used as a constraint term on the sub-seasonal timescale. First, the predicted outward longwave radiation variable is... 200hPa zonal wind variable 850hPa zonal wind variable and the actual outward longwave radiation variables 200hPa zonal wind variable 850hPa zonal wind variable The formula for calculating the MJO exponent is as follows:
[0118] in, This represents the MJO exponent calculation function. This is the true MJO index. To predict the MJO index.
[0119] Finally, the mean absolute error is calculated based on the predicted MJO exponent and the actual MJO exponent to obtain the MJO prediction loss for a batch of training samples. The calculation formula is as follows:
[0120] in, and They represent in The actual MJO index and the predicted MJO index at any given time. Predict the loss for MJO.
[0121] Based on predicted loss And MJO predicted loss Training loss can be obtained. The calculation formula is as follows:
[0122] in, The range of values is .
[0123] Step 9, based on training loss The parameters in the weather forecast model are updated using the backpropagation algorithm.
[0124] Based on the training loss obtained in step 8 The parameters of the entire weather forecast model The update is implemented using the following formula:
[0125] in, The learning rate is set by the individual.
[0126] Step 10: Repeat steps 4-9 until all batches of the training set are involved in model training.
[0127] Step 11: Repeat steps 4-10 until the early stopping condition is met or the specified number of iterations is reached to obtain the trained weather prediction model.
[0128] Step 12: Input a batch of historical meteorological data into the trained meteorological forecast model to obtain the meteorological forecast results for the future period.
[0129] Based on the foregoing embodiments, this application provides a weather forecasting method. The weather forecasting method provided in this application can be applied to electronic devices such as mobile phones, tablets, wearable devices, in-vehicle devices, AR / VR devices, laptops, UMPCs, netbooks, and PDAs. This application does not impose any restrictions on the specific type of electronic device.
[0130] Please see Figure 4 , Figure 4 A schematic flowchart of a weather forecasting method provided in an embodiment of this application is shown. By way of example and not limitation, the method includes the following steps: Step 401: Obtain historical meteorological data for the target area.
[0131] The target area mentioned above can refer to any region where weather forecasting is required. Historical meteorological data can include historical observations of multiple meteorological variables at multiple time steps within the target area.
[0132] In some embodiments, historical meteorological data of the target area within a historical time period can be obtained, and multiple time steps can be selected from the historical time period. Optionally, the historical time period can be set according to actual needs, and this application does not limit this.
[0133] Step 402: Input historical meteorological data into the trained meteorological prediction model to obtain the meteorological prediction results for the target area in the preset future time period.
[0134] The trained meteorological forecasting model is obtained by training based on the methods described in the aforementioned embodiments.
[0135] In this embodiment of the application, historical meteorological data of the target area can be obtained and input into a trained meteorological prediction model. The trained meteorological prediction model can capture complex atmospheric physical processes more comprehensively, thereby improving the accuracy of meteorological prediction.
[0136] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0137] Corresponding to the training method of the meteorological prediction model described in the above embodiments, Figure 5 A schematic diagram of the training device for the meteorological prediction model provided in this application embodiment is shown. The meteorological prediction model includes: a multi-temporal and spatial scale feature extraction module, a multi-temporal and spatial scale dependency modeling module, and a fusion and prediction module. For ease of explanation, only the parts relevant to the embodiments of this application are shown.
[0138] Reference Figure 5 The training device includes: Training set acquisition module 501 is used to acquire a meteorological-related sample training set; Feature extraction module 502 is used to extract multi-temporal scale meteorological features from historical observations in the sample training set in the multi-temporal scale feature extraction module; The dependency modeling module 503 is used to perform inter-variable interaction of the multi-temporal and spatial scale meteorological features based on the self-attention mechanism in the multi-temporal and spatial scale dependency modeling module, so as to model the intervariable dependency of the multi-temporal and spatial scale meteorological features at the corresponding temporal and spatial scales, obtain the corresponding aggregated meteorological features, and model the spatiotemporal dependency of the aggregated meteorological features at the corresponding temporal and spatial scales, so as to obtain the updated multi-temporal and spatial scale meteorological features. The feature fusion module 504 is used to fuse the updated multi-temporal and spatial scale meteorological features in the fusion and prediction module, and output the model prediction results corresponding to the historical observation values. The model training module 505 is used to train the meteorological prediction model based on the prediction results of the model, and obtain a trained meteorological prediction model, which is used to make meteorological predictions for the target area.
[0139] In some embodiments, the number of spatial scales is , For integers greater than 1, the multi-temporal-scale feature extraction module includes: a two-dimensional convolutional network, a temporal pyramid layer, and a block embedding layer; representing the historical observations as meteorological features at spatial and temporal scales of 1. In the case of this, the feature extraction module 502 includes: The first extraction unit is used to extract the historical observations from the two-dimensional convolutional network. Meteorological characteristics at various spatial scales, the Each spatial scale is greater than the spatial scale 1; The second extraction unit is used to extract meteorological features of multiple time scales at each spatial scale in the time pyramid layer, so as to obtain meteorological features at each spatiotemporal scale. The segmented embedding unit is used to perform two-dimensional segmented embedding of the meteorological features of each spatiotemporal scale in the segmented embedding layer to obtain the meteorological features of each spatiotemporal scale after segmented embedding. The meteorological features of each spatiotemporal scale after segmented embedding are the multi-spatiotemporal scale meteorological features.
[0140] In some embodiments, the first extraction unit is specifically used for: The spatial scale is obtained in the two-dimensional convolutional network based on two-dimensional convolutional layers, two-dimensional average pooling layers, and meteorological features. Meteorological characteristics:
[0141] in, Indicates spatial scale Meteorological characteristics at time scale 1 This represents the two-dimensional convolutional layer. This represents the two-dimensional average pooling layer. Indicates spatial scale Meteorological characteristics at time scale 1 Spatial scale Spatial scale The next spatial scale, spatial scale for In addition to spatial scale, Spatial scale beyond, spatial scale The meteorological characteristics are as described Meteorological characteristics at any spatial scale among meteorological characteristics at various spatial scales.
[0142] In some embodiments, the fusion and prediction module includes: a temporal fusion layer, a spatial fusion layer, and a prediction layer; the feature fusion module 504 includes: The first fusion unit is used to fuse meteorological features belonging to different time scales at the same spatial scale in the multi-temporal scale meteorological features in the time fusion layer to obtain meteorological features fused at the corresponding spatial scale. The second fusion unit is used to fuse meteorological features after fusion of all spatial scales in the spatial fusion layer to obtain meteorological features after fusion of all spatiotemporal scales. The feature processing unit is used to process the meteorological features fused from all spatiotemporal scales in the prediction layer through a linear layer and a random deactivation layer to obtain the model prediction results.
[0143] In some embodiments, the number of spatial scales is The number of time scales is , and All are integers greater than 1, representing the historical observations as meteorological characteristics at a spatial scale of 1 and a temporal scale of 1. In this case, the first fusion unit is specifically used for: for Any spatial scale in a spatial scale In the time fusion layer, a one-dimensional transposed convolutional layer is used to convert the time scale. Meteorological characteristics aligned to time scale The meteorological characteristics were used to obtain the spatial scale after transpose and convolution. and time scale meteorological characteristics, greater than zero and less than or equal to integers, greater than zero and less than integers, time scale Time scale The next timescale, in for In the case of the time scale The meteorological characteristics are spatial scale and time scale Meteorological characteristics; in Less than In the case of the time scale The meteorological characteristics are spatial scale and time scale Meteorological characteristics after linear combination; Spatial scale and time scale The meteorological characteristics and the spatial scale after transpose convolution and time scale By linearly combining the meteorological characteristics, we can obtain the spatial scale. and time scale Meteorological characteristics after linear combination, and spatial scale Meteorological characteristics obtained by linear combination with time scale 1 are determined as spatial scale. The meteorological characteristics after fusion.
[0144] In some embodiments, the second fusion unit is specifically used for: In the spatial fusion layer, the spatial scale is represented by a two-dimensional transposed convolutional layer. Meteorological characteristics aligned to spatial scale The fused meteorological features yield the spatial scale after transpose and convolution. meteorological characteristics, greater than zero and less than Integers, spatial scale Spatial scale The next spatial scale; in for In the case of the spatial scale The meteorological characteristics are spatial scale The combined meteorological characteristics; Less than In the case of the spatial scale The meteorological characteristics are spatial scale Meteorological characteristics after linear combination; The spatial scale The fused meteorological features and the spatial scale after transposed convolution By linearly combining the meteorological characteristics, we can obtain the spatial scale. The meteorological characteristics after linear combination are determined, and the meteorological characteristics after linear combination of spatial scale 1 are determined as the meteorological characteristics after fusion of all spatiotemporal scales.
[0145] In some embodiments, the training device further includes: The result acquisition module is used to acquire the actual meteorological results, actual MJO index and predicted MJO index corresponding to the historical observation values; The model training module 505 is specifically used for: Based on the actual meteorological results and the model prediction results, the first prediction loss of the meteorological prediction model is calculated; Based on the actual MJO index and the predicted MJO index, the second prediction loss of the weather prediction model is calculated; The weather forecasting model is trained based on the first prediction loss and the second prediction loss.
[0146] Corresponding to the weather forecasting method described in the above embodiments, Figure 6 A schematic diagram of the weather forecasting device provided in an embodiment of this application is shown. For ease of explanation, only the parts relevant to the embodiment of this application are shown.
[0147] Reference Figure 6 The weather forecasting device includes: Data acquisition module 601 is used to acquire historical meteorological data of the target area; The data input module 602 is used to input the historical meteorological data into the trained meteorological prediction model to obtain the meteorological prediction results of the target area in a preset future time period. The trained meteorological prediction model is trained based on the method described in any one of the first aspects above.
[0148] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0149] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 7 of this embodiment includes: at least one processor 70 ( Figure 7 (Only one is shown in the diagram) a processor, a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70, wherein the processor 70 executes the computer program 72 to implement the steps in any of the above method embodiments.
[0150] The electronic device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will understand that... Figure 7 This is merely an example of electronic device 7 and does not constitute a limitation on electronic device 7. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0151] The processor 70 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0152] In some embodiments, the memory 71 may be an internal storage unit of the electronic device 7, such as a hard disk or memory of the electronic device 7. In other embodiments, the memory 71 may be an external storage device of the electronic device 7, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 7. Furthermore, the memory 71 may include both internal and external storage units of the electronic device 7. The memory 71 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 71 can also be used to temporarily store data that has been output or will be output.
[0153] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0154] This application also provides an electronic device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the steps in any of the above method embodiments.
[0155] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0156] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0157] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0158] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0159] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0160] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0161] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0162] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A training method for a meteorological forecasting model, characterized in that, The meteorological prediction model includes: a multi-temporal and spatial scale feature extraction module, a multi-temporal and spatial scale dependency modeling module, and a fusion and prediction module. The training method includes: Obtain a meteorological-related sample training set; In the multi-temporal-scale feature extraction module, meteorological features at multiple temporal and spatial scales are extracted from historical observations in the sample training set. In the multi-temporal-scale dependency modeling module, the multi-temporal-scale meteorological features are subjected to variable interactions based on a self-attention mechanism to model the cross-variable dependencies of the multi-temporal-scale meteorological features at the corresponding temporal-scale, thereby obtaining the corresponding aggregated meteorological features. The spatiotemporal dependencies of the aggregated meteorological features at the corresponding temporal-scale are then modeled to obtain the updated multi-temporal-scale meteorological features. The updated multi-temporal and spatial scale meteorological features are fused in the fusion and prediction module, and the model prediction results corresponding to the historical observation values are output. Based on the prediction results of the model, the meteorological prediction model is trained to obtain a trained meteorological prediction model, which is used to make meteorological predictions for the target area.
2. The training method according to claim 1, characterized in that, The number of spatial scales is , For integers greater than 1, the multi-temporal-scale feature extraction module includes: a two-dimensional convolutional network, a temporal pyramid layer, and a block embedding layer; representing the historical observations as meteorological features at spatial and temporal scales of 1. In the case where the multi-temporal scale meteorological features are extracted from the historical observations in the multi-temporal scale feature extraction module, the extraction includes: Extracting the historical observations from the two-dimensional convolutional network Meteorological characteristics at various spatial scales, the Each spatial scale is greater than the spatial scale 1; Meteorological features at multiple time scales at each spatial scale are extracted from the time pyramid layer to obtain meteorological features at each spatiotemporal scale. In the segmented embedding layer, the meteorological features of each spatiotemporal scale are segmented and embedded in two dimensions to obtain the meteorological features of each spatiotemporal scale after segmented embedding. The meteorological features of each spatiotemporal scale after segmented embedding are the multi-spatiotemporal scale meteorological features.
3. The training method according to claim 2, characterized in that, The historical observations are extracted from the two-dimensional convolutional network. Meteorological characteristics at various spatial scales include: The spatial scale is obtained in the two-dimensional convolutional network based on two-dimensional convolutional layers, two-dimensional average pooling layers, and meteorological features. Meteorological characteristics: in, Indicates spatial scale Meteorological characteristics at time scale 1 This represents the two-dimensional convolutional layer. This represents the two-dimensional average pooling layer. Indicates spatial scale Meteorological characteristics at time scale 1 Spatial scale Spatial scale The next spatial scale, spatial scale for In addition to spatial scale, Spatial scale beyond, spatial scale The meteorological characteristics are as described Meteorological characteristics at any spatial scale among meteorological characteristics at various spatial scales.
4. The training method according to claim 1, characterized in that, The fusion and prediction module includes a temporal fusion layer, a spatial fusion layer, and a prediction layer. The module fuses the updated multi-temporal and spatial meteorological features and outputs model prediction results corresponding to the historical observations, including: In the time fusion layer, meteorological features belonging to different time scales at the same spatial scale among the multi-temporal scale meteorological features are fused to obtain meteorological features fused at the corresponding spatial scale. In the spatial fusion layer, meteorological features fused from all spatial scales are fused to obtain meteorological features fused from all spatiotemporal scales. In the prediction layer, the meteorological features fused from all spatiotemporal scales are processed through a linear layer and a random deactivation layer to obtain the model prediction results.
5. The training method according to claim 4, characterized in that, The number of spatial scales is The number of time scales is , and All are integers greater than 1, representing the historical observations as meteorological characteristics at a spatial scale of 1 and a temporal scale of 1. In the case where the meteorological features belonging to the same spatial scale but different time scales in the multi-temporal scale meteorological features are fused in the time fusion layer to obtain the corresponding spatial scale fused meteorological features, the process includes: for Any spatial scale in a spatial scale In the time fusion layer, a one-dimensional transposed convolutional layer is used to convert the time scale. Meteorological characteristics aligned to time scale The meteorological characteristics were used to obtain the spatial scale after transpose and convolution. and time scale meteorological characteristics, greater than zero and less than or equal to integers, greater than zero and less than integers, time scale Time scale The next timescale, in for In the case of the time scale The meteorological characteristics are spatial scale and time scale Meteorological characteristics; in Less than In this case, the time scale The meteorological characteristics are spatial scale and time scale Meteorological characteristics after linear combination; Spatial scale and time scale The meteorological characteristics and the spatial scale after transpose convolution and time scale By linearly combining the meteorological characteristics, we can obtain the spatial scale. and time scale Meteorological characteristics after linear combination, and spatial scale Meteorological characteristics obtained by linear combination with time scale 1 are determined as spatial scale. The meteorological characteristics after fusion.
6. The training method according to claim 5, characterized in that, The process involves fusing meteorological features fused across all spatial scales in the spatial fusion layer to obtain meteorological features fused across all spatiotemporal scales, including: In the spatial fusion layer, the spatial scale is represented by a two-dimensional transposed convolutional layer. Meteorological characteristics aligned to spatial scale The fused meteorological features yield the spatial scale after transpose and convolution. meteorological characteristics, greater than zero and less than Integers, spatial scale Spatial scale The next spatial scale; in for In the case of the spatial scale The meteorological characteristics are spatial scale The combined meteorological characteristics; Less than In the case of the spatial scale The meteorological characteristics are spatial scale Meteorological characteristics after linear combination; The spatial scale The fused meteorological features and the spatial scale after transposed convolution By linearly combining the meteorological characteristics, we can obtain the spatial scale. The meteorological characteristics after linear combination are determined, and the meteorological characteristics after linear combination of spatial scale 1 are determined as the meteorological characteristics after fusion of all spatiotemporal scales.
7. The training method according to any one of claims 1 to 6, characterized in that, Before training the weather prediction model based on the model prediction results, the method further includes: Obtain the actual meteorological results, actual MJO index, and predicted MJO index corresponding to the historical observation values; The step of training the meteorological prediction model based on the prediction results of the model includes: Based on the actual meteorological results and the model prediction results, the first prediction loss of the meteorological prediction model is calculated; Based on the actual MJO index and the predicted MJO index, the second prediction loss of the weather prediction model is calculated; The weather forecasting model is trained based on the first prediction loss and the second prediction loss.
8. A weather forecasting method, characterized in that, include: Obtain historical meteorological data for the target area; The historical meteorological data is input into the trained meteorological prediction model to obtain the meteorological prediction results of the target area in a preset future time period. The trained meteorological prediction model is trained based on the method described in any one of claims 1 to 7.
9. A training device for a meteorological forecasting model, characterized in that, The meteorological prediction model includes: a multi-temporal and spatial scale feature extraction module, a multi-temporal and spatial scale dependency modeling module, and a fusion and prediction module. The training device includes: The training set acquisition module is used to acquire a meteorological-related sample training set; The feature extraction module is used to extract multi-temporal and spatial scale meteorological features from historical observations in the sample training set in the multi-temporal and spatial scale feature extraction module; The dependency modeling module is used to perform inter-variable interactions of the multi-temporal and spatial scale meteorological features based on a self-attention mechanism in the multi-temporal and spatial scale dependency modeling module, so as to model the intervariable dependencies of the multi-temporal and spatial scale meteorological features at the corresponding temporal and spatial scales, obtain the corresponding aggregated meteorological features, and model the spatiotemporal dependencies of the aggregated meteorological features at the corresponding temporal and spatial scales, so as to obtain the updated multi-temporal and spatial scale meteorological features. The feature fusion module is used to fuse the updated multi-temporal and spatial scale meteorological features in the fusion and prediction module, and output the model prediction results corresponding to the historical observation values. The model training module is used to train the meteorological prediction model based on the prediction results of the model, and obtain a trained meteorological prediction model, which is used to make meteorological predictions for the target area.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it causes the electronic device to implement the training method of the meteorological forecasting model as described in any one of claims 1 to 7, or to implement the meteorological forecasting method as described in claim 8.
11. A computer program product, characterized in that, It includes a computer program, which, when run, causes the training method of the weather forecasting model as described in any one of claims 1 to 7 to be executed, or causes the weather forecasting method as described in claim 8 to be executed.