Multi-step weather forecasting method and device based on dynamic graph data structure
By constructing a meteorological forecast model of dynamic graph data structure, and using graph neural networks and recurrent neural networks to extract spatiotemporal features, the problems of low computational efficiency and poor generalization performance of traditional meteorological forecast models in non-European spatial data processing are solved, and the efficiency and accuracy of multi-step meteorological forecasting are achieved.
Patent Information
- Application Number
- CN202510401389.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-04-01
AI Technical Summary
Traditional meteorological forecasting models have problems of low computational efficiency and poor generalization performance when processing non-European spatial data, and the accuracy and timeliness of multi-step prediction results are insufficient.
By constructing a dynamic graph data structure based on meteorological site location and wind direction and wind speed, the graph neural network and recurrent neural network extract the spatiotemporal features, combined with the multi-step classification network to output meteorological prediction results with different time steps, reduce invalid connections, and improve model training efficiency and prediction accuracy.
The efficiency and accuracy of multi-step meteorological forecasting have been achieved, and the timeliness and accuracy of meteorological forecasting has been improved, especially in the small-scale sea fog forecasting capacity.
Smart Images

Figure CN120428356A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of weather forecasting based on deep learning technology, and in particular to a multi-step weather forecasting method and device based on a dynamic graph data structure. Background Art
[0002] Traditional deep learning methods excel at representing features in Euclidean spatial data (e.g., image object detection tasks). However, their application to non-Euclidean spatial data (e.g., graph-structured data) faces bottlenecks. Taking weather forecast networks as an example, the irregular spatial distribution of weather stations essentially constitutes typical graph-structured data, and traditional spatial transformation operations such as convolution cannot be directly transferred to such non-Euclidean spatial data. Although graph neural networks provide a solution to this problem and have been successfully applied to atmospheric-related fields, two key challenges remain in their actual implementation.
[0003] First, current neural network models for meteorological graphs often use observation stations as graph nodes, but lack a systematic mechanism for constructing edge weights. While the fully connected approach commonly used in practice enables information exchange between nodes, it leads to an exponential growth in the number of edges, severely impacting computational efficiency for large-scale graphs. Furthermore, because the correlation between elements at nearby meteorological stations is significantly higher than that at distant stations, a fully connected approach can result in a large number of invalid connections, which can affect the model's generalization performance and interfere with its predictive effectiveness.
[0004] Secondly, in actual meteorological operations, what is needed is a multi-step time series forecast result. Common weather forecast models are single-step recurrent network models, which, through iteration, ultimately form a predicted time series output result. This type of neural network model not only introduces iterative cumulative errors, but also, in order to solve practical problems with multiple factors and multiple channels, the model structure is often designed to be very complex, which increases the difficulty of training. At the same time, some common weather forecast models require the input of other factors of future time steps, so they are often only used for simulation experiments. It is worth noting that in order to meet the demand for multi-step lengths, multi-step fitting output structures are already available in fitting models, and the training strategy of "curriculum learning" (CL) is adopted to ensure the stability of training. However, in classification models, there are few specialized multi-step output structures. The existing practice is generally to build multiple prediction models with different prediction time steps based on the single-step model to form a model cluster. Summary of the Invention
[0005] The present invention provides a multi-step weather forecast method and device based on a dynamic graph data structure, which can improve the accuracy and timeliness of weather forecasts while realizing multi-step weather forecasts.
[0006] In a first aspect, an embodiment of the present invention provides a multi-step weather forecasting method based on a dynamic graph data structure, comprising:
[0007] According to the location of the meteorological station and the wind direction and speed, a dynamic atlas is constructed using a preset edge weight formula; wherein the edge weight formula is established based on the advection term in the atmospheric motion formula;
[0008] The dynamic atlas is input into a preset weather forecast model so that the weather forecast model extracts the spatiotemporal features of the dynamic atlas based on a graph neural network and a recurrent neural network, and outputs weather forecast results of different time steps based on the spatiotemporal features and a multi-step classification network; wherein the multi-step classification network includes N fully connected layers and M activation layers, where N and M are positive integers greater than or equal to 2.
[0009] The embodiment of the present invention uses the location of meteorological stations and wind direction and speed as basic data to construct a dynamic graph data structure with moderate scale, few invalid connections, and changes over time, thereby reducing the computational load for subsequent model training and improving the accuracy of model predictions. By inputting the dynamic graph set into a preset meteorological forecast model, the meteorological forecast model extracts the spatiotemporal features of the dynamic graph set based on the graph neural network and the recurrent neural network, and outputs meteorological forecast results of different time steps based on the spatiotemporal features and the multi-step classification network, thereby achieving the actual needs of multi-step meteorological forecasts with less computational consumption. Compared with the prior art, the present application can improve the accuracy and timeliness of meteorological forecasts while achieving multi-step meteorological forecasts.
[0010] Furthermore, the dynamic atlas is constructed based on the location of the meteorological station and the wind direction and speed through a preset edge weight formula, specifically:
[0011] According to the location of the meteorological station, the nodes of the unilateral directed graph are obtained;
[0012] According to the wind direction and speed and the preset edge weight formula, the edge weight of the unilateral directed graph is obtained; wherein the wind direction and speed of one time step corresponds to one unilateral directed graph;
[0013] Obtaining a unilateral directed graph according to the node and edge weights;
[0014] Construct a dynamic atlas based on the single-edge directed graph of all time steps.
[0015] The embodiment of the present invention uses the location of meteorological stations and wind direction and speed as basic data to construct a dynamic graph data structure with moderate scale, few invalid connections, and changing over time, thereby reducing the computational load for subsequent model training and improving the accuracy of model prediction.
[0016] Furthermore, the edge weight of the unilateral directed graph is obtained according to the wind direction and speed and the preset edge weight formula, specifically:
[0017] According to the wind direction and wind speed of the first meteorological station, a projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station is obtained;
[0018] Obtaining a ratio between wind speed and distance based on a projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station and the distance between the first meteorological station and the second meteorological station;
[0019] According to the ratio between the wind speed and the distance, the edge weight of the unilateral directed graph is obtained.
[0020] The embodiment of the present invention obtains the edge weight of a unilateral directed graph by referring to the advection term in the atmospheric motion formula, maps the physical formula to the graph neural network model structure, and improves the interpretability of the model.
[0021] Furthermore, the projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station is obtained according to the wind direction and wind speed of the first meteorological station, specifically:
[0022] v i ′ =v i cosθ i ;
[0023] Among them, v i is the wind speed at the first meteorological station; v i ′ v i The projection on the edge connecting the first meteorological station and the second meteorological station; θ i It is the angle between the connecting edge between the first meteorological station and the second meteorological station and the wind direction of the first meteorological station.
[0024] The embodiment of the present invention calculates the projection of the wind speed on the connecting edge, thereby providing a data basis for subsequently obtaining the ratio between the wind speed and the distance.
[0025] Furthermore, the ratio of wind speed to distance is obtained based on the projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station and the distance between the first meteorological station and the second meteorological station, specifically:
[0026]
[0027] Among them, w ij is the ratio between wind speed and distance; R ij is the distance between the first meteorological station and the second meteorological station; R min 、R max are the minimum and maximum influence distances respectively; vmax is the maximum threshold affected by wind speed.
[0028] The embodiment of the present invention calculates the ratio between wind speed and distance, thereby providing a data basis for subsequently obtaining the edge weight of a unilateral directed graph.
[0029] Furthermore, the edge weight of the unilateral directed graph is obtained according to the ratio between the wind speed and the distance, specifically:
[0030]
[0031] Among them, a ij is the weight value of the edge connecting the first meteorological station and the second meteorological station, a ij ∈[0,1], the direction is from the second meteorological station to the first meteorological station, and it is an incoming edge of the first meteorological station.
[0032] The embodiment of the present invention systematically constructs a dynamic graph data structure with a moderate scale, few invalid connections, and changes over time by establishing an edge weight formula.
[0033] Furthermore, the dynamic atlas is input into a preset weather forecast model, so that the weather forecast model extracts the spatiotemporal features of the dynamic atlas based on the graph neural network and the recurrent neural network, and outputs weather forecast results of different time steps based on the spatiotemporal features and the multi-step classification network, specifically:
[0034] Extracting spatial features of the dynamic atlas through a graph neural network to obtain a first output feature; wherein, each unilateral directed graph in the dynamic atlas corresponds to a graph neural network, each graph neural network corresponds to a first output feature, and all graph neural networks share the same set of graph neural network parameters;
[0035] Extracting the time feature of the first output feature through a recurrent neural network to obtain a second output feature; wherein one first output feature corresponds to one recurrent neural network, one recurrent neural network corresponds to one second output feature, and all recurrent neural networks share the same set of recurrent neural network parameters;
[0036] All second output features are merged and input into a multi-step classification network to synchronously output meteorological forecast results of different time steps; wherein the number of nodes in the last fully connected layer of the multi-step classification network is set to the product of the number of required prediction time steps and the number of required prediction result categories.
[0037] The embodiment of the present invention extracts the spatiotemporal features of a dynamic atlas through a graph neural network and a recurrent neural network, and outputs meteorological forecast results of different time steps through the spatiotemporal features and a multi-step classification network. While ensuring the prediction accuracy of the model, it efficiently realizes the synchronous output of meteorological forecast results of different time steps.
[0038] Furthermore, the preset weather forecast model includes the setting of the parameter initialization scheme, specifically:
[0039] Randomly initialize the parameters of the m nodes in the last fully connected layer of the multi-step classification network; where m is the number of classifications required for the prediction results;
[0040] The remaining nodes of the last fully connected layer of the multi-step classification network copy the initialization parameters of the m nodes.
[0041] The embodiment of the present invention ensures that the initial parameters of the nodes corresponding to each forecast time step are the same by setting a parameter initialization scheme.
[0042] Furthermore, the preset weather forecast model also includes the setting of the loss function value, specifically:
[0043] Set n loss functions; where n is the number of required prediction time steps, and one prediction time step corresponds to one loss function;
[0044] The total loss function value is obtained according to the sum or mean of the values of the n loss functions.
[0045] The embodiment of the present invention improves the model's ability to process unbalanced sample sets by setting the loss function value.
[0046] In a second aspect, an embodiment of the present invention provides a multi-step weather forecasting device based on a dynamic graph data structure, comprising: a dynamic graph set construction module and a weather forecast model module:
[0047] The dynamic atlas construction module is used to construct the dynamic atlas according to the location of the meteorological station and the wind direction and speed using a preset edge weight formula; wherein the edge weight formula is established based on the advection term in the atmospheric motion formula;
[0048] The weather forecast model module is used to input the dynamic atlas into a preset weather forecast model, so that the weather forecast model extracts the spatiotemporal features of the dynamic atlas based on the graph neural network and the recurrent neural network, and outputs weather forecast results of different time steps based on the spatiotemporal features and the multi-step classification network; wherein the multi-step classification network includes N fully connected layers and M activation layers, where N and M are positive integers greater than or equal to 2.
[0049] The embodiment of the present invention uses a dynamic graph set construction module to construct a dynamic graph data structure with moderate scale, few invalid connections, and changing over time, thereby reducing the computational load for subsequent model training and improving the accuracy of model prediction; and processes the dynamic graph data structure through a weather forecast model module, thereby realizing the actual needs of multi-step weather forecasting with less computational consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic flow chart of a multi-step weather forecasting method based on a dynamic graph data structure provided by an embodiment of the present invention;
[0051] Figure 2 A schematic diagram of a sea fog forecast model framework based on a dynamic graph data structure provided by an embodiment of the present invention;
[0052] Figure 3 A comparison chart of the TS scores of the EC fine-grid visibility numerical forecast product provided by an embodiment of the present invention and the sea fog forecast model based on the dynamic graph data structure for the sea fog forecast of the Ningbo Zhoushan Port area at each time step;
[0053] Figure 4 A real-time visibility map of the Ningbo-Zhoushan Port area provided by an embodiment of the present invention;
[0054] Figure 5 A comparison chart of the sea fog forecast for the Ningbo Zhoushan Port area using the EC fine-grid visibility numerical forecast product provided by an embodiment of the present invention and the sea fog forecast model based on a dynamic graph data structure;
[0055] Figure 6 A schematic structural diagram of a multi-step weather forecasting device based on a dynamic graph data structure provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0057] Please refer to Figure 1 , a multi-step weather forecast method based on a dynamic graph data structure provided by an embodiment of the present invention, including steps S101 to S102, which are described in detail as follows:
[0058] Step S101: construct a dynamic atlas based on the location of the meteorological station and the wind direction and speed using a preset edge weight formula. The edge weight formula is established based on the advection term in the atmospheric motion formula, which is specifically:
[0059]
[0060] in, is the rate of change of air mass element variables over time; is the change of the air mass element variable at a fixed position over time; V is the three-dimensional vector velocity; is the divergence operator; u, v, and w are the velocity components in the three-dimensional directions respectively; are the distance partial derivatives in three-dimensional directions respectively.
[0061] In this step, step S101 is specifically as follows:
[0062] According to the location of the meteorological station, the nodes of the unilateral directed graph are obtained;
[0063] According to the wind direction and speed and the preset edge weight formula, the edge weight of the unilateral directed graph is obtained; wherein the wind direction and speed of one time step corresponds to one unilateral directed graph;
[0064] Obtaining a unilateral directed graph according to the node and edge weights;
[0065] Construct a dynamic atlas based on the single-edge directed graph of all time steps.
[0066] The embodiment of the present invention uses the location of meteorological stations and wind direction and speed as basic data to construct a dynamic graph data structure with moderate scale, few invalid connections, and changing over time, thereby reducing the computational load for subsequent model training and improving the accuracy of model prediction.
[0067] Furthermore, the edge weight of the unilateral directed graph is obtained according to the wind direction and speed and the preset edge weight formula, specifically:
[0068] According to the wind direction and wind speed of the first meteorological station, a projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station is obtained;
[0069] Obtaining a ratio between wind speed and distance based on a projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station and the distance between the first meteorological station and the second meteorological station;
[0070] According to the ratio between the wind speed and the distance, the edge weight of the unilateral directed graph is obtained.
[0071] The embodiment of the present invention obtains the edge weight of a unilateral directed graph by referring to the advection term in the atmospheric motion formula, maps the physical formula to the graph neural network model structure, and improves the interpretability of the model.
[0072] Furthermore, the projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station is obtained according to the wind direction and wind speed of the first meteorological station, specifically:
[0073] v i ′ =v i cosθ i ;
[0074] Among them, v i is the wind speed at the first meteorological station; v i ′ v i The projection on the edge connecting the first meteorological station and the second meteorological station; θ i It is the angle between the connecting edge between the first meteorological station and the second meteorological station and the wind direction of the first meteorological station.
[0075] The embodiment of the present invention calculates the projection of the wind speed on the connecting edge, thereby providing a data basis for subsequently obtaining the ratio between the wind speed and the distance.
[0076] Furthermore, the ratio of wind speed to distance is obtained based on the projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station and the distance between the first meteorological station and the second meteorological station, specifically:
[0077]
[0078] Among them, w ij is the ratio between wind speed and distance; R ij is the distance between the first meteorological station and the second meteorological station; R min 、R max are the minimum and maximum influence distances respectively; v max is the maximum threshold affected by wind speed.
[0079] The embodiment of the present invention calculates the ratio between wind speed and distance, thereby providing a data basis for subsequently obtaining the edge weight of a unilateral directed graph.
[0080] Furthermore, the edge weight of the unilateral directed graph is obtained according to the ratio between the wind speed and the distance, specifically:
[0081]
[0082] Among them, a ij is the weight value of the edge connecting the first meteorological station and the second meteorological station, a ij ∈[0,1], the direction is from the second meteorological station to the first meteorological station, and it is an incoming edge of the first meteorological station; optionally, each meteorological station adds a self-loop and normalizes the edge weight.
[0083] The embodiment of the present invention systematically constructs a dynamic graph data structure with a moderate scale, few invalid connections, and changes over time by establishing an edge weight formula.
[0084] Step S102: input the dynamic atlas into a preset weather forecast model, so that the weather forecast model extracts the spatiotemporal features of the dynamic atlas based on a graph neural network and a recurrent neural network, and outputs weather forecast results of different time steps based on the spatiotemporal features and a multi-step classification network; wherein the multi-step classification network includes N fully connected layers and M activation layers, and N and M are positive integers greater than or equal to 2.
[0085] In this step, step S102 is specifically as follows:
[0086] The spatial features of the dynamic atlas are extracted through a graph neural network to obtain a first output feature; wherein, a unilateral directed graph of the dynamic atlas corresponds to a graph neural network, and a graph neural network corresponds to a first output feature, and all graph neural networks share the same set of graph neural network parameters; optionally, the graph neural network can adopt a structure such as graph convolution (GCN) or graph attention (GAT) as needed, and the number of layers generally does not exceed 3 layers; the activation function of the graph neural network adopts the ELU (Exponent ia l Line near Unit) activation function;
[0087] The time feature of the first output feature is extracted through a recurrent neural network to obtain a second output feature; wherein one first output feature corresponds to one recurrent neural network, one recurrent neural network corresponds to one second output feature, and all recurrent neural networks share the same set of recurrent neural network parameters; optionally, the recurrent neural network can adopt a structure such as a long short-term memory (LSTM) or an independent recurrent network (IndRNN) as needed, the number of layers generally does not exceed 3, and the network can be unidirectional or bidirectional; the activation function of the recurrent neural network adopts a ReLU activation function;
[0088] All second output features are merged and input into a multi-step classification network to synchronously output meteorological forecast results of different time steps; wherein the number of nodes in the last fully connected layer of the multi-step classification network is set to the product of the number of required prediction time steps and the number of required prediction result categories; optionally, the activation function of the multi-step classification network adopts a ReLU activation function.
[0089] The embodiment of the present invention extracts the spatiotemporal features of a dynamic atlas through a graph neural network and a recurrent neural network, and outputs meteorological forecast results of different time steps through the spatiotemporal features and a multi-step classification network. While ensuring the prediction accuracy of the model, it efficiently realizes the synchronous output of meteorological forecast results of different time steps.
[0090] Optionally, before step S102, the method further includes:
[0091] Construct a dynamic graph data structure based on the location of meteorological stations and wind direction and speed in the study area;
[0092] According to meteorological elements, obtaining node attributes of the dynamic graph data structure;
[0093] Obtaining an output label of the dynamic graph data structure according to the required prediction result classification;
[0094] Constructing a dynamic graph dataset based on the node attributes and output labels of the dynamic graph data structure; performing data cleaning, time series continuity check, and normalization processing on the dynamic graph dataset to obtain a training set, a verification set, and a test set;
[0095] Based on the dynamic graph dataset, an initial weather forecast model is iteratively trained to obtain the weather forecast model; the test set is used to test the actual generalization ability of the weather forecast model, with the TS score of the key focus category as the main basis, taking into account the accuracy, recall rate and overall accuracy of the key focus category.
[0096] Furthermore, the preset weather forecast model includes the setting of the parameter initialization scheme, specifically:
[0097] Randomly initialize the parameters of the m nodes in the last fully connected layer of the multi-step classification network; where m is the number of classifications required for the prediction results;
[0098] The remaining nodes of the last fully connected layer of the multi-step classification network copy the initialization parameters of the m nodes.
[0099] The embodiment of the present invention ensures that the initial parameters of the nodes corresponding to each forecast time step are the same by setting a parameter initialization scheme.
[0100] Furthermore, the preset weather forecast model also includes the setting of the loss function value, specifically:
[0101] Set n loss functions; where n is the number of required prediction time steps, and one prediction time step corresponds to one loss function; optionally, the loss function can adopt a cross entropy loss function or a focal loss function as needed;
[0102] The total loss function value is obtained according to the sum or mean of the values of the n loss functions.
[0103] The embodiment of the present invention improves the model's ability to process unbalanced sample sets by setting the loss function value.
[0104] In order to better reflect the beneficial effects of the present invention, the embodiment of the present invention provides a specific embodiment, taking the sea fog situation in Ningbo Zhoushan Port as the analysis object, and demonstrating the specific implementation process of the multi-step weather forecast method based on the dynamic graph data structure.
[0105] This specific embodiment collects and organizes the observation data of meteorological stations within the Ningbo-Zhoushan Port area (rectangular area of 29.4-30.6°N, 121.5-122.8°E) from January to July and November to December from 2019 to 2023, excluding meteorological stations with more missing data or short station establishment time. A total of 72 meteorological stations, 31,407 time step data, and a total of 2,261,304 station data are collected, of which 0.021 stations have sea fog.
[0106] This specific embodiment obtains the nodes of a unilateral directed graph based on the locations of meteorological stations within the Ningbo Zhoushan Port area; obtains the edge weights of the unilateral directed graph based on the wind direction and speed and a preset edge weight formula; wherein, the wind direction and speed of one time step corresponds to one unilateral directed graph; obtains the unilateral directed graph based on the nodes and edge weights; and constructs a dynamic atlas based on the unilateral directed graphs of all time steps.
[0107] In this specific embodiment, the preset edge weight formula is specifically:
[0108] v i ′ =v i cosθ i ;
[0109] Among them, v i is the wind speed at the first meteorological station; v i ′ v i The projection on the edge connecting the first meteorological station and the second meteorological station; θ i is the angle between the connecting edge of the first meteorological station and the second meteorological station and the wind direction of the first meteorological station;
[0110]
[0111] Among them, w ij is the ratio between wind speed and distance; R ij is the distance between the first meteorological station and the second meteorological station; R min 、R max are the minimum and maximum influence distances respectively; v max is the maximum threshold of wind speed influence; in this specific embodiment, when the visibility of the meteorological station is <1km, the wind speed corresponding to most observation time steps is <10m / s, so vmax Set to 10m / s; according to the v max , the maximum distance of wind movement in one hour is 36km. Due to the obvious discreteness of visibility, a smaller minimum influence distance needs to be set. Therefore, R max Set to 40km, R min Set to 0.1km;
[0112]
[0113] Among them, a ij is the weight value of the edge connecting the first meteorological station and the second meteorological station, a ij ∈[0,1], the direction is from the second meteorological station to the first meteorological station, and it is an incoming edge of the first meteorological station; each meteorological station adds a self-loop, and the edge weight is normalized.
[0114] In this specific embodiment, the visibility, relative humidity, temperature, land-sea temperature difference, wind speed U (latitudinal), wind speed V (meridional) and observation time step of each meteorological station are used as the input attribute features of the unilateral directed graph nodes; after data cleaning, each annual sample contains 72 meteorological stations, each meteorological station contains input data of 6 time steps, and output labels of whether there is sea fog in the next 24 time steps to establish a dynamic graph dataset; the samples from 2019 to 2022 are used to construct the training set and validation set, 90% of the samples are randomly selected as the training set, the rest as the validation set, and the samples from 2023 are used as the test set.
[0115] In this specific embodiment, the visibility data is normalized using a logarithmic function log10, specifically:
[0116]
[0117] Among them, vis max is the maximum visibility, set to 20000m. If vi s>20000m, then vi s=20000m;
[0118] Min-max normalization (linear function normalization) is used to normalize other data, specifically:
[0119]
[0120] Please refer to Figure 2The sea fog forecast model based on the dynamic graph data structure provided in this specific embodiment includes a graph neural network, a recurrent neural network, and a multi-step classification network; the graph neural network adopts a graph attention (GAT) structure with three layers; the activation function of the graph neural network adopts an ELU (Exponent ia lLi near Unit) activation function; the recurrent neural network adopts a bidirectional long short-term memory (LSTM) structure with two layers; the multi-step classification network consists of two fully connected layers and two activation layers, and the number of nodes in the last fully connected layer is set to 48 (24 hours × 2 classes), where every two nodes represent the prediction result of one prediction time step.
[0121] This specific embodiment sets a parameter initialization scheme for the multi-step classification network, specifically: randomly initialize the parameters of the two nodes of the last fully connected layer of the multi-step classification network; copy the initialization parameters of the two nodes of the remaining nodes of the last fully connected layer of the multi-step classification network; and randomly initialize the remaining parameters by default.
[0122] This specific embodiment adopts the Focal Loss loss function designed specifically for unbalanced data sets. One loss function is configured for each prediction time step, and the total loss of the model training is the sum of the 24 loss function values.
[0123] This specific embodiment conducts regular and fixed-point evaluations on the forecast results of the meteorological stations used for modeling; using visibility <1 km as the standard for sea fog, the TS score of sea fog is used as the main basis based on the forecast of the hourly time step of each meteorological station and the number of times sea fog actually occurs, taking into account the accuracy, recall rate and overall accuracy of sea fog.
[0124] This specific example extracts the EC fine grid visibility numerical forecast products at 08:00 and 20:00 from January to July and November to December 2023. Visibility forecast results of each meteorological station are obtained through bilinear interpolation and compared with the forecast results of the sea fog forecast model based on the dynamic graph data structure. For specific TS score comparison, please refer to Figure 3 At the same starting time step, the sea fog forecast model based on the dynamic graph data structure has significantly higher average TS score (0.173), accuracy (0.236), and recall (0.384) for sea fog forecasts at various meteorological stations within the Ningbo-Zhoushan Port area than the EC fine-grid visibility numerical forecast product (0.042, 0.100, and 0.069), indicating that the sea fog forecast model based on the dynamic graph data structure has effectively enhanced the forecast capability of sea fog, especially for small-scale sea fog.
[0125] Please refer to Figure 4, which is the actual visibility situation of Ningbo Zhoushan Port Area provided by this specific embodiment. From 07:00 on November 11, 2023 to 11:00 on November 12, 2023, only two stations in the entire Ningbo Zhoushan Port Area experienced sea fog. They were Chunxiao Station, which experienced continuous sea fog from 07:00 on the 11th to 10:00 on the 12th, and Dongpanshan Station, which experienced sea fog in two time steps from 02:00 to 03:00 on the 12th. Please refer to Figure 5 , which shows the sea fog forecast of the EC fine grid visibility numerical forecast product and the sea fog forecast model based on the dynamic graph data structure provided in this specific embodiment. The EC fine grid visibility numerical forecast product predicts that the visibility in the Ningbo-Zhoushan Port area will be relatively good from 07:00 on November 11, 2023 to 11:00 on November 12, 2023, and no sea fog is forecast. The sea fog forecast model based on the dynamic graph data structure predicts that sea fog will continue to appear at Chunxiao Station from 09:00 on the 11th to 08:00 on the 12th, which is consistent with the actual situation. Sea fog will appear at Dongpanshan Station from 17:00 on the 11th to 07:00 on the 12th, and the duration is longer than the actual situation.
[0126] Please refer to Figure 6 , a multi-step weather forecasting device based on a dynamic graph data structure provided by an embodiment of the present invention, including a dynamic graph set construction module 601 and a weather forecast model module 602, which are described in detail as follows:
[0127] The dynamic atlas construction module 601 is used to construct a dynamic atlas according to the location of the meteorological station and the wind direction and speed using a preset edge weight formula; wherein the edge weight formula is established based on the advection term in the atmospheric motion formula;
[0128] The weather forecast model module 602 is used to input the dynamic atlas into a preset weather forecast model, so that the weather forecast model extracts the spatiotemporal features of the dynamic atlas based on the graph neural network and the recurrent neural network, and outputs weather forecast results of different time steps based on the spatiotemporal features and the multi-step classification network; wherein the multi-step classification network includes N fully connected layers and M activation layers, and N and M are positive integers greater than or equal to 2.
[0129] In the embodiment of the present invention, the dynamic atlas construction module 601 includes a node construction submodule, an edge weight construction submodule, a directed graph construction submodule, and a dynamic atlas construction submodule, specifically:
[0130] The node construction submodule is used to obtain nodes of a unilateral directed graph according to the location of the meteorological station;
[0131] The edge weight construction submodule is used to obtain the edge weight of the unilateral directed graph according to the wind direction and speed and the preset edge weight formula; wherein the wind direction and speed of one hour corresponds to one unilateral directed graph;
[0132] The directed graph construction submodule is used to obtain a unilateral directed graph based on the node and edge weights;
[0133] The dynamic atlas construction submodule is used to construct a dynamic atlas based on the unilateral directed graphs of all times.
[0134] The embodiment of the present invention uses the location of meteorological stations and wind direction and speed as basic data to construct a dynamic graph data structure with moderate scale, few invalid connections, and changing over time, thereby reducing the computational load for subsequent model training and improving the accuracy of model prediction.
[0135] In an embodiment of the present invention, the edge weight construction submodule includes a projection construction unit, a ratio construction unit and an edge weight construction unit, specifically:
[0136] The projection construction unit is configured to obtain, based on the wind direction and wind speed of the first meteorological station, a projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station;
[0137] The ratio construction unit is configured to obtain a ratio between wind speed and distance based on a projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station and the distance between the first meteorological station and the second meteorological station;
[0138] The edge weight construction unit is used to obtain the edge weight of the unilateral directed graph according to the ratio between the wind speed and the distance.
[0139] The embodiment of the present invention obtains the edge weight of a unilateral directed graph by referring to the advection term in the atmospheric motion formula, maps the physical formula to the graph neural network model structure, and improves the interpretability of the model.
[0140] In the embodiment of the present invention, the projection construction unit is specifically:
[0141] v i ′ =v i cosθ i ;
[0142] Among them, v i is the wind speed at the first meteorological station; v i ′ v i The projection on the edge connecting the first meteorological station and the second meteorological station; θ i It is the angle between the connecting edge between the first meteorological station and the second meteorological station and the wind direction of the first meteorological station.
[0143] The embodiment of the present invention calculates the projection of the wind speed on the connecting edge, thereby providing a data basis for subsequently obtaining the ratio between the wind speed and the distance.
[0144] In the embodiment of the present invention, the ratio construction unit is specifically:
[0145]
[0146] Among them, w ij is the ratio between wind speed and distance; R ij is the distance between the first meteorological station and the second meteorological station; R min 、R max are the minimum and maximum influence distances respectively; v max is the maximum threshold affected by wind speed.
[0147] The embodiment of the present invention calculates the ratio between wind speed and distance, thereby providing a data basis for subsequently obtaining the edge weight of a unilateral directed graph.
[0148] In the embodiment of the present invention, the edge weight construction unit is specifically:
[0149]
[0150] Among them, a ij is the weight value of the edge connecting the first meteorological station and the second meteorological station, a ij ∈[0,1], the direction is from the second meteorological station to the first meteorological station, and it is an incoming edge of the first meteorological station.
[0151] The embodiment of the present invention systematically constructs a dynamic graph data structure with a moderate scale, few invalid connections, and changes over time by establishing an edge weight formula.
[0152] In this embodiment of the present invention, the weather forecast model module 602 includes a graph neural network submodule, a recurrent neural network submodule, and a multi-step classification network submodule, specifically:
[0153] The graph neural network submodule is used to extract the spatial features of the dynamic atlas through the graph neural network to obtain the first output feature; wherein, each unilateral directed graph of the dynamic atlas corresponds to a graph neural network, each graph neural network corresponds to a first output feature, and all graph neural networks share the same set of graph neural network parameters;
[0154] The recurrent neural network submodule is configured to extract the time feature of the first output feature through a recurrent neural network to obtain a second output feature; wherein one first output feature corresponds to one recurrent neural network, one recurrent neural network corresponds to one second output feature, and all recurrent neural networks share the same set of recurrent neural network parameters;
[0155] The multi-step classification network submodule is used to merge all the second output features, input them into the multi-step classification network, and synchronously output the meteorological forecast results of different time steps; wherein the number of nodes in the last fully connected layer of the multi-step classification network is set to the product of the required number of prediction time steps and the required number of prediction result categories.
[0156] The embodiment of the present invention extracts the spatiotemporal features of the dynamic atlas through the graph neural network sub-module and the recurrent neural network sub-module, and outputs the meteorological forecast results of different time steps through the spatiotemporal features and the multi-step classification network sub-module. While ensuring the prediction accuracy of the model, the synchronous output of meteorological forecast results of different time steps is efficiently achieved.
[0157] In the embodiment of the present invention, the weather forecast model module 602 includes a parameter initialization setting submodule, specifically:
[0158] The parameter initialization setting submodule is used to randomly initialize the parameters of the m nodes in the last fully connected layer of the multi-step classification network; where m is the number of classifications of the required prediction results; the remaining nodes in the last fully connected layer of the multi-step classification network copy the initialization parameters of the m nodes.
[0159] The embodiment of the present invention ensures that the initial parameters of the nodes corresponding to each forecast time are the same by setting a parameter initialization scheme.
[0160] In the embodiment of the present invention, the weather forecast model module 602 includes a loss function value setting submodule, specifically:
[0161] The loss function value setting submodule is used to set n loss functions; wherein n is the number of required prediction time steps, and one prediction time step corresponds to one loss function; the total loss function value is obtained according to the sum or mean of the values of the n loss functions.
[0162] The embodiment of the present invention improves the model's ability to process unbalanced sample sets by setting the loss function value.
[0163] The above-mentioned device can implement a multi-step weather forecast method based on a dynamic graph data structure in the above-mentioned method embodiment. The optional options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The remaining contents of the embodiments of this application can refer to the contents of the above-mentioned method embodiment and will not be repeated in this embodiment.
[0164] The embodiment of the present invention uses the dynamic graph set construction module 601 to construct a dynamic graph data structure with moderate scale, few invalid connections, and changing over time, thereby reducing the computational load for subsequent model training and improving the accuracy of model prediction; and uses the weather forecast model module 602 to process the dynamic graph data structure, thereby realizing the actual needs of multi-step weather forecasting with less computational consumption.
[0165] Based on the above method embodiments, another embodiment of the present invention provides a computer-readable storage medium, including a stored computer program, wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a multi-step weather forecasting method based on a dynamic graph data structure as described in any one of the above method embodiments of the present invention.
[0166] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A multi-step weather forecasting method based on a dynamic graph data structure, characterized in that: include: According to the location of the meteorological station and the wind direction and speed, a dynamic atlas is constructed using a preset edge weight formula; wherein the edge weight formula is established based on the advection term in the atmospheric motion formula; The dynamic atlas is input into a preset weather forecast model so that the weather forecast model extracts the spatiotemporal features of the dynamic atlas based on a graph neural network and a recurrent neural network, and outputs weather forecast results of different time steps based on the spatiotemporal features and a multi-step classification network; wherein the multi-step classification network includes N fully connected layers and M activation layers, where N and M are positive integers greater than or equal to 2.
2. A multi-step weather forecasting method based on a dynamic graph data structure according to claim 1, characterized in that: According to the location of the meteorological station and the wind direction and speed, a dynamic atlas is constructed using a preset edge weight formula, specifically: According to the location of the meteorological station, the nodes of the unilateral directed graph are obtained; According to the wind direction and speed and the preset edge weight formula, the edge weight of the unilateral directed graph is obtained; wherein the wind direction and speed of one time step corresponds to one unilateral directed graph; Obtaining a unilateral directed graph according to the node and edge weights; Construct a dynamic atlas based on the single-edge directed graph of all time steps.
3. A multi-step weather forecasting method based on a dynamic graph data structure according to claim 2, characterized in that: The edge weight of the unilateral directed graph is obtained according to the wind direction and speed and the preset edge weight formula, specifically: According to the wind direction and wind speed of the first meteorological station, a projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station is obtained; Obtaining a ratio between wind speed and distance based on a projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station and the distance between the first meteorological station and the second meteorological station; According to the ratio between the wind speed and the distance, the edge weight of the unilateral directed graph is obtained.
4. A multi-step weather forecasting method based on a dynamic graph data structure as claimed in claim 3, characterized in that: The projection of the wind speed of the first meteorological station on the edge connecting the first meteorological station and the second meteorological station is obtained according to the wind direction and wind speed of the first meteorological station, specifically: v i ′ =v i cosθ i ; Among them, v i is the wind speed at the first meteorological station; v i ′ v i The projection on the edge connecting the first meteorological station and the second meteorological station; θ i It is the angle between the connecting edge between the first meteorological station and the second meteorological station and the wind direction of the first meteorological station.
5. The multi-step weather forecasting method based on dynamic graph data structure according to claim 3, characterized in that: The ratio between the wind speed and the distance is obtained based on the projection of the wind speed of the first meteorological station on the connecting edge of the first meteorological station and the second meteorological station and the distance between the first meteorological station and the second meteorological station, specifically: Among them, w ij is the ratio between wind speed and distance; R ij is the distance between the first meteorological station and the second meteorological station; R min 、R max are the minimum and maximum influence distances respectively; v max is the maximum threshold affected by wind speed.
6. A multi-step weather forecasting method based on a dynamic graph data structure as claimed in claim 3, characterized in that: The edge weight of the unilateral directed graph is obtained according to the ratio between the wind speed and the distance, specifically: Among them, a ij is the weight value of the edge connecting the first meteorological station and the second meteorological station, a ij ∈[0,1], the direction is from the second meteorological station to the first meteorological station, and it is an incoming edge of the first meteorological station.
7. The multi-step weather forecasting method based on a dynamic graph data structure according to claim 1, wherein: The dynamic atlas is input into a preset weather forecast model, so that the weather forecast model extracts the spatiotemporal features of the dynamic atlas according to the graph neural network and the recurrent neural network, and outputs weather forecast results of different time steps according to the spatiotemporal features and the multi-step classification network, specifically: Extracting spatial features of the dynamic atlas through a graph neural network to obtain a first output feature; wherein, each unilateral directed graph in the dynamic atlas corresponds to a graph neural network, each graph neural network corresponds to a first output feature, and all graph neural networks share the same set of graph neural network parameters; Extracting the time feature of the first output feature through a recurrent neural network to obtain a second output feature; wherein one first output feature corresponds to one recurrent neural network, one recurrent neural network corresponds to one second output feature, and all recurrent neural networks share the same set of recurrent neural network parameters; All second output features are merged and input into a multi-step classification network to synchronously output meteorological forecast results of different time steps; wherein the number of nodes in the last fully connected layer of the multi-step classification network is set to the product of the number of required prediction time steps and the number of required prediction result categories.
8. The multi-step weather forecasting method based on dynamic graph data structure according to claim 1, characterized in that: The preset weather forecast model includes the setting of the parameter initialization scheme, specifically: Randomly initialize the parameters of the m nodes in the last fully connected layer of the multi-step classification network; where m is the number of classifications required for the prediction results; The remaining nodes of the last fully connected layer of the multi-step classification network copy the initialization parameters of the m nodes.
9. The multi-step weather forecasting method based on dynamic graph data structure according to claim 1, characterized in that: The preset weather forecast model also includes the setting of the loss function value, specifically: Set n loss functions; where n is the number of required prediction time steps, and one prediction time step corresponds to one loss function; The total loss function value is obtained according to the sum or mean of the values of the n loss functions.
10. A multi-step weather forecast device based on a dynamic graph data structure, characterized in that: include: Dynamic atlas building module and weather forecast model module: The dynamic atlas construction module is used to construct the dynamic atlas according to the location of the meteorological station and the wind direction and speed using a preset edge weight formula; wherein the edge weight formula is established based on the advection term in the atmospheric motion formula; The weather forecast model module is used to input the dynamic atlas into a preset weather forecast model, so that the weather forecast model extracts the spatiotemporal features of the dynamic atlas based on the graph neural network and the recurrent neural network, and outputs weather forecast results of different time steps based on the spatiotemporal features and the multi-step classification network; wherein the multi-step classification network includes N fully connected layers and M activation layers, where N and M are positive integers greater than or equal to 2.
Citation Information
Patent Citations
Weather parameter prediction model training method and weather parameter prediction method and device
CN112561199A
Real-time weather prediction algorithm based on LSTM-DNN network model
CN113095443A
Conv3d-LSTMs-based regional multi-station single-step runoff prediction method
CN116307146A
Multi-step meteorological prediction method based on multivariate time series diagram neural network
CN116559975A
A short-term precipitation ensemble forecast and downscaling method based on multiple meteorological elements
CN117233870B