Traffic prediction method and device based on heterogeneous dual-graph spatio-temporal network

By constructing a heterogeneous dual-graph spatiotemporal network, the problem of existing models being unable to distinguish between meteorological drivers and hydrological responses in river flow prediction is solved. This enables dynamic representation and error suppression of hydraulic connections, improving prediction accuracy and stability.

CN122241318APending Publication Date: 2026-06-19HUAZHONG UNIV OF SCI & TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAZHONG UNIV OF SCI & TECH
Filing Date
2026-04-21
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing data-driven models fail to reflect the unidirectional physical logic of meteorological-driven hydrology in river flow prediction, cannot effectively distinguish the differences between the driving source and the response end, have static and rigid spatial dependencies, and cannot capture the dynamic characteristics of hydraulic connections, resulting in unstable prediction results and error accumulation, especially in long-duration predictions where accuracy decreases.

Method used

A heterogeneous dual-graph spatiotemporal network is constructed. By combining the topological structure of meteorological and hydrological subgraphs with temporal feature extraction and graph convolution operations, cross-graph information fusion and residual decoding are achieved. This explicitly distinguishes between meteorological drivers and hydrological responses, adaptively represents time-varying spatial dependencies, and suppresses error accumulation.

Benefits of technology

It significantly improves the accuracy and long-term stability of flow forecasting, enhances the physical interpretability of the model and its ability to characterize key processes such as flood peaks, and reduces the risk of error accumulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122241318A_ABST
    Figure CN122241318A_ABST
Patent Text Reader

Abstract

This invention provides a method and apparatus for flow prediction based on a heterogeneous dual-graph spatiotemporal network, belonging to the field of hydrological prediction and intelligent computing technology. The method includes: constructing a heterogeneous dual-graph topology; extracting temporal features from meteorological and hydrological data using a time-series encoder with Fourier gating to obtain meteorological and hydrological feature representations; performing graph convolution operations on the heterogeneous dual-graph topology based on a weighted fusion of dynamic and static adjacency matrices to obtain meteorological and hydrological node features; fusing cross-graph information based on the meteorological and hydrological node features using a cross-graph gating mechanism to obtain a fused hydrological feature representation; and using a residual decoding strategy to determine the predicted flow value of the target watershed at future time steps based on the fused hydrological feature representation. This invention can effectively improve the accuracy and long-duration prediction stability of flow prediction in complex watershed scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hydrological prediction and intelligent computing technology, specifically to a method and apparatus for flow prediction based on heterogeneous dual-graph spatiotemporal networks. Background Technology

[0002] River flow forecasting, as a core component of flood and drought disaster prevention systems and water resource optimization, plays an irreplaceable role in safeguarding people's lives and property and supporting sustainable economic and social development. Existing data-driven models using spatiotemporal graph neural networks to process watershed hydrological processes generally employ isomorphic graph structures, simply treating meteorological and hydrological stations as homogeneous nodes for mixed modeling. This approach fails to reflect the unidirectional physical logic of "meteorology driving hydrology" in rainfall confluence, leading to chaotic information transmission paths within the model and an inability to effectively distinguish between the driving source and the response end. This weakens the interpretability of the prediction results, making it difficult for decision-makers to understand the physical basis of the model's output. Secondly, the representation of spatial dependencies suffers from static rigidity. Traditional graph neural networks typically construct static adjacency matrices based on fixed geographical distances or historical statistical correlations. However, in actual hydrological systems, the hydraulic connections between upstream and downstream stations have strong dynamic characteristics. During extreme events such as rainstorms and floods, the intensity of the upstream water's impact on the downstream fluctuates dramatically with rapid changes in water level. Static graph structures cannot capture such time-varying spatial dependencies, resulting in distorted representations of key hydrological processes. Finally, the stability of long-duration forecasts is seriously insufficient. When the forecast time step is extended to several hours in the future, the existing models suffer from the inherent error accumulation effect of the recursive forecast mechanism, coupled with the long-term memory decay problem, which leads to a sharp decline in the forecast accuracy of key indicators such as peak flow and arrival time. Especially in complex watershed scenarios, this instability may lead to the risk of misjudgment in flood control scheduling decisions. Summary of the Invention

[0003] To address the aforementioned problems, this application provides a flow prediction method and apparatus based on heterogeneous dual-graph spatiotemporal networks. This method aims to improve the accuracy of watershed flow prediction. The technical solution is as follows: In a first aspect, the present invention provides a traffic prediction method based on heterogeneous dual-graph spatiotemporal networks, comprising: Acquire meteorological and hydrological data for the target watershed, and construct a heterogeneous dual-graph topology based on the meteorological and hydrological data; Temporal features are extracted from meteorological and hydrological data to obtain meteorological and hydrological feature representations. Based on meteorological feature representation, hydrological feature representation, and heterogeneous dual-graph topology, graph convolution operation is performed to obtain meteorological node features and hydrological node features; Cross-map information fusion is performed based on meteorological node features and hydrological node features to obtain a fused hydrological feature representation. The predicted water flow value of the target watershed at future time steps is determined based on the fused hydrological feature representation.

[0004] Combining the first aspect and the above-mentioned implementation methods, in some possible implementation methods, meteorological and hydrological data of the target watershed are obtained, including: Historical meteorological and hydrological observation data sequences of the target watershed are obtained, and time-aligned data sequences are processed to obtain time-aligned meteorological and hydrological data. The time-aligned meteorological and hydrological data are standardized to obtain preprocessed meteorological and hydrological data.

[0005] Combining the first aspect and the above implementation methods, some possible implementation methods involve constructing a heterogeneous dual-graph topology based on meteorological and hydrological data, including: Meteorological submaps are constructed based on the spatial correlation between meteorological stations corresponding to meteorological data. Hydrological sub-graphs are constructed based on the upstream and downstream topological relationships between hydrological stations corresponding to hydrological data. Establish cross-graph connection edges connecting the meteorological subgraph and the hydrological subgraph to obtain a heterogeneous bigraph topology.

[0006] Combining the first aspect and the above implementation methods, in some possible implementation methods, time-series feature extraction is performed on meteorological and hydrological data to obtain meteorological feature representations and hydrological feature representations, including: Meteorological and hydrological data are respectively input into a preset temporal convolutional layer. Local temporal features are extracted based on the temporal convolutional layer to obtain the first meteorological intermediate feature and the first hydrological intermediate feature. The first meteorological intermediate feature and the first hydrological intermediate feature are respectively input into the frequency domain gating unit, and the first meteorological intermediate feature and the first hydrological intermediate feature are transformed into the frequency domain through fast Fourier transform; In the frequency domain, a gated network is used to selectively enhance key frequency components and suppress high-frequency noise representing random fluctuations. The first meteorological intermediate feature and the first hydrological intermediate feature, after frequency domain feature processing, are converted back to the time domain by inverse Fourier transform. The first meteorological intermediate feature and the first hydrological intermediate feature, after being converted back to the time domain, are respectively residually connected with the first meteorological intermediate feature and the first hydrological intermediate feature to obtain the second meteorological intermediate feature and the second hydrological intermediate feature. The second meteorological intermediate feature and the second hydrological intermediate feature are respectively input into the time attention unit. Based on the time attention unit, the meteorological feature representation and the hydrological feature representation are obtained.

[0007] Combining the first aspect and the above implementation methods, in some possible implementation methods, graph convolution operations are performed based on meteorological feature representation, hydrological feature representation, and heterogeneous dual-graph topology to obtain meteorological node features and hydrological node features, including: Calculate the meteorological dynamic similarity matrix of the meteorological submap based on the meteorological feature representation of the current time step; Calculate the hydrological dynamic similarity matrix of hydrological submaps based on the hydrological feature representation of the current time step; The meteorological dynamic similarity matrix and the meteorological static adjacency matrix are weighted and fused to obtain the meteorological fused adjacency matrix; The hydrological dynamic similarity matrix and the hydrological static adjacency matrix are weighted and fused to obtain the hydrological fused adjacency matrix; Graph convolution operations are performed on the meteorological fusion adjacency matrix and the hydrological fusion adjacency matrix respectively to obtain meteorological node features and hydrological node features.

[0008] Combining the first aspect and the above implementation methods, in some possible implementation methods, cross-map information fusion is performed based on meteorological node features and hydrological node features to obtain a fused hydrological feature representation, including: Based on a pre-defined cross-graph adjacency matrix, meteorological node features are aggregated to the corresponding hydrological nodes to obtain aggregated meteorological features. The gating coefficient is calculated based on the updated hydrological node features and aggregated meteorological features, and the value of the gating coefficient is within a preset range. The updated hydrological node features and aggregated meteorological features are weighted and fused based on the gating coefficient to obtain the fused hydrological feature representation.

[0009] Combining the first aspect and the above implementation methods, in some possible implementation methods, the predicted water flow value of the target watershed at future time steps is determined based on the fused hydrological feature representation, including: Based on the fused hydrological feature representation, the flow increment at future times relative to the current time is predicted using a residual decoder; Obtain the measured flow rate at the current moment; The flow increment is superimposed with the measured flow value at the current moment to obtain the predicted water flow value at the future time step.

[0010] Secondly, the present invention also provides a traffic prediction device based on a heterogeneous dual-graph spatiotemporal network, comprising: The topology construction unit is used to acquire meteorological and hydrological data of the target watershed and construct a heterogeneous dual-graph topology based on the meteorological and hydrological data. The feature extraction unit is used to extract time-series features from meteorological and hydrological data to obtain meteorological feature representations and hydrological feature representations. The feature structure processing unit is used to perform graph convolution operations based on meteorological feature representation, hydrological feature representation and heterogeneous dual graph topology to obtain meteorological node features and hydrological node features; The feature fusion unit is used to fuse cross-map information based on meteorological node features and hydrological node features to obtain the fused hydrological feature representation. The flow prediction unit is used to determine the predicted water flow value of the target watershed at future time steps based on the fused hydrological feature representation.

[0011] Thirdly, the present invention also provides an electronic device, including a memory and a processor, wherein, Memory, used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks in any of the above implementations.

[0012] Fourthly, the present invention also provides a computer-readable storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the steps in the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks in any of the above implementations.

[0013] The beneficial effects of this invention are as follows: First, by constructing a heterogeneous dual-graph topology, the two physical processes of meteorological driving and hydrological response can be explicitly distinguished, significantly enhancing the physical interpretability of rainfall-runoff modeling. Second, by fusing static and dynamic adjacency matrices, the time-varying spatial dependencies between stations under non-stationary conditions such as floods can be adaptively characterized, thereby accurately capturing the dynamic interactions during the confluence process. Third, through a cross-graph gating mechanism, adaptive and selective injection of meteorological information into hydrological information is achieved, improving the ability to characterize key hydrological processes such as flood peaks. Finally, the residual decoding strategy is used to predict flow increments, effectively suppressing error accumulation in multi-step prediction. By superimposing the flow increment with the measured flow value, the predicted water flow value for the future time step is obtained, thereby effectively improving the accuracy of flow prediction and the stability of long-duration prediction in complex watershed scenarios. Attached Figure Description To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is a schematic diagram illustrating a scenario for the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 2This is a flowchart illustrating the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 3 This is a schematic diagram illustrating a scenario for the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 4 This is a schematic diagram showing the comparison of prediction metrics for the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by this invention. Figure 5 This is a schematic diagram of the fitting results of a typical site traffic process for the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 6 This is a flowchart illustrating the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 7 This is a flowchart illustrating the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 8 This is a flowchart illustrating the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 9 This is a flowchart illustrating the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 10 This is a flowchart illustrating the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 11 This is a flowchart illustrating the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided by the present invention. Figure 12 A schematic diagram of the traffic prediction device based on heterogeneous dual-graph spatiotemporal network provided by the present invention; Figure 13 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

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

[0016] In the description of the embodiments of the present invention, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0017] The terms "first," "second," etc., used in the embodiments of this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.

[0018] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0019] This invention provides a flow prediction method and apparatus based on a heterogeneous dual-graph spatiotemporal network, which will be described in detail below. The execution entity of this flow prediction method based on a heterogeneous dual-graph spatiotemporal network is either a flow prediction apparatus based on a heterogeneous dual-graph spatiotemporal network or an electronic device with a water flow prediction program. Detailed descriptions follow.

[0020] Before demonstrating specific embodiments, the following terms will be explained.

[0021] Meteorological data typically includes continuous records of changes in rainfall, temperature, humidity, wind speed, and sunshine over time.

[0022] Hydrological data typically includes continuous records of river flow and water level changes over time.

[0023] Heterogeneous dual-graph spatiotemporal network is a graph neural network structure. "Heterogeneous" means that the network contains different types of nodes and edges, such as meteorological stations and hydrological stations; "dual-graph" means that there are two or more related graph structures, such as a meteorological map and a hydrological map; "spatiotemporal" means that the network can simultaneously process the time series characteristics and spatial topological relationships of data.

[0024] The heterogeneous bi-graph topology defines the connections between different types of nodes and the associations between different graph structures. This structure can explicitly model the driving relationships between meteorological and hydrological processes.

[0025] Multi-scale time series feature extraction refers to capturing patterns and information at different time granularities or frequencies from time series data. By analyzing data at different scales, we can understand the patterns of data change, such as short-term fluctuations and long-term trends.

[0026] Meteorological feature representations and hydrological feature representations refer to the vectors or matrices used to describe meteorological and hydrological data, respectively, after feature extraction. These representations contain information from the original data and are encoded into numerical forms that the model can process.

[0027] Graph convolution is a convolution operation performed on graph-structured data. It updates the feature representation of nodes by aggregating information from their neighbors, thereby capturing spatial dependencies between nodes. In heterogeneous graphs, graph convolution can be customized for different types of nodes and edges.

[0028] Cross-map information fusion refers to the process of integrating information from different map structures. In heterogeneous dual-map structures, this typically involves effectively transferring and integrating driving information from meteorological maps into hydrological maps to simulate the physical driving effect of meteorology on hydrology.

[0029] Water flow forecast refers to the flow estimate at future time steps output by the model.

[0030] In traditional single-flow forecasting techniques, existing methods employ a homogeneous graph structure to model meteorological and hydrological stations in a hybrid manner. The physical roles of meteorological drivers and hydrological responses are not explicitly distinguished, and the unidirectional causal logic of meteorological elements' influence on hydrological responses during rainfall runoff is ignored, leading to insufficient model interpretability. Furthermore, the modeling of spatial dependencies, based on static adjacency matrices, cannot adapt to the dynamic changes in hydraulic connections between upstream and downstream stations during extreme events such as floods, resulting in a rigid representation of spatial dependencies. Moreover, in long-step runoff forecasting, error accumulation and memory decay are introduced, reducing the prediction accuracy of key hydrological events.

[0031] For example, in a real-time hydrological monitoring system of a large basin in the middle reaches of the Yangtze River, a meteorological station network covers rainfall monitoring points in the mountainous areas upstream of the basin, while hydrological stations are deployed along the main channel at key sections. When encountering continuous heavy rainfall events, rainfall intensity data recorded by meteorological stations and flow response data from hydrological stations are input into existing prediction models. Because meteorological and hydrological nodes are treated equally, the driving effect of meteorological input on hydrological output is not reflected, resulting in ambiguous causal relationships in the prediction results. Simultaneously, the static graph structure fails to dynamically adjust during rainstorms to reflect the enhanced upstream-downstream hydraulic connections, distorting the model's simulation of the flood peak propagation process. Furthermore, when predicting runoff for the next 24 hours, the predicted flow curve gradually deviates from the measured value, and peak flow period deviations appear, affecting the reliability of flood control scheduling decisions.

[0032] If the above problems are not addressed, models will struggle to accurately depict the physical mechanisms between meteorological drivers and hydrological responses, resulting in predictions lacking scientific basis and weakening the effectiveness of flood and drought disaster prevention measures. Static modeling of spatial dependencies cannot capture the dynamic characteristics of extreme hydrological events, increasing uncertainty in flood risk assessment and potentially leading to inappropriate allocation of flood control resources. Insufficient stability in long-duration forecasts will further lead to error propagation, weakening the guiding role of water resource allocation and flood control engineering operations, and potentially resulting in reduced water resource management efficiency and the failure of disaster response measures.

[0033] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the scenario in which the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided in this application is applied, such as... Figure 1 As shown, this temporal convolutional network takes meteorological and hydrological data as input. After the temporal encoder extracts temporal features, it enters the dual-graph interaction layer. In the dual-graph interaction layer, the dynamic adjacency matrix generation module first fuses static topology and dynamic similarity. Then, the meteorological and hydrological node features are updated by the meteorological map convolutional layer and the hydrological map convolutional layer, respectively. The cross-graph fusion module integrates the meteorological subgraph information into the hydrological subgraph using a gating mechanism and outputs the fused features. Subsequently, the residual decoder predicts the flow increment based on the fused features. Finally, the predicted increment is linearly combined with the current measured flow value to obtain the water flow prediction value, realizing accurate runoff prediction driven by meteorology.

[0034] Please see Figure 2 , Figure 2 This is a flowchart illustrating the traffic prediction method based on a heterogeneous dual-graph spatiotemporal network provided in an embodiment of this application. Figure 2 As shown, the method in this application embodiment may include the following steps S101-S105: S101: Acquire meteorological and hydrological data of the target watershed, and construct a heterogeneous dual-graph topology based on the meteorological and hydrological data.

[0035] Specifically, the coordinates of all meteorological stations in the target watershed are obtained, and the straight-line distance between any two meteorological stations is calculated, resulting in a distance matrix containing distance information between all meteorological stations. A Gaussian function is used to transform the distance information in the distance matrix into a similarity score representing the degree of relationship; that is, the closer the meteorological stations are, the higher the similarity, and the similarity decreases smoothly as the distance increases. After the Gaussian function transformation, a connectivity similarity matrix composed of all meteorological stations is obtained. This matrix serves as a meteorological subgraph, where each element in the matrix represents the correlation strength between corresponding two meteorological stations.

[0036] Traverse the similarity values ​​in the similarity matrix, retain only the connection edges that are greater than the preset similarity threshold, and remove the connection edges that are less than or equal to the threshold, i.e., set their weights to zero, thus obtaining a sparse static similarity matrix.

[0037] Obtain the control section represented by each hydrological station and its corresponding sub-basin area. Based on the connectivity of the river network, analyze and determine whether there is a direct hydraulic connection between any two hydrological stations, i.e., whether water can flow directly from one station to the next without passing through other stations. Based on these relationships, construct a directed adjacency matrix. In the adjacency matrix, "1" indicates that water can flow directly from one hydrological station to another. "0" indicates that there is no direct water flow channel between the two stations. For example, if hydrological station A is directly upstream of hydrological station B, a connection edge is established from hydrological station A to hydrological station B, and the weight of this edge is set to 1, representing the forward transport path of the water flow. Conversely, if hydrological station A is downstream of hydrological station B, or if there is no direct water flow channel between the two stations, no connection is established, and the corresponding value in the matrix is ​​0. The matrix constructed in this way is a directed topological connection graph, which represents the hydrological subgraph.

[0038] Check if the geographical location of a meteorological station in the meteorological submap falls within the control sub-basin boundary of a hydrological station in the hydrological submap. If so, establish a connection edge from the meteorological station to the hydrological station. Alternatively, when meteorological stations are sparse in a region of the meteorological submap or the sub-basin division is inaccurate, find one or more meteorological stations within or on the boundary of each hydrological station's sub-basin and establish connection edges with them.

[0039] Representing all connecting edges as directed edges constitutes a heterogeneous bi-graph topology connecting the meteorological subgraph and the hydrological subgraph. The heterogeneous bi-graph topology is unidirectional, which clearly reflects the logical relationship of meteorological conditions as input driving force and hydrological state as output response.

[0040] S102, extract time-series features from meteorological and hydrological data to obtain meteorological and hydrological feature representations.

[0041] Specifically, meteorological data is input into a temporal convolutional network. This network captures local variation patterns at different time granularities, ranging from hours to days, through convolution operations of varying scales, yielding the first intermediate meteorological feature. Next, this first intermediate feature is input into a frequency-domain gating unit, which transforms it to the frequency domain using a Fast Fourier Transform (FFT). In the frequency domain, a learnable gating network selectively enhances key periodic frequency components representing diurnal and seasonal variations while suppressing high-frequency noise representing random fluctuations. The data is then inversely transformed back to the time domain and residually connected to the features input to the frequency-domain gating unit to obtain the second intermediate meteorological feature. This feature is then input into a temporal attention unit. This unit automatically identifies and focuses on the most critical historical moments for the current forecasting task by calculating global correlation weights between different time steps in the sequence, aggregating the information from the entire time series into a fixed-dimensional composite vector. This vector is the final meteorological feature representation.

[0042] Hydrological data is first processed by a temporal convolutional network to extract local rises and falls and fluctuation patterns in the flow sequence between adjacent time points, forming the first intermediate hydrological feature. Subsequently, the first intermediate hydrological feature is input into a frequency domain gating unit. Through frequency domain transformation and gating modulation, the inherent daily and annual cycles of fluctuation in the runoff data are highlighted, while random disturbances are filtered out, thus generating the second intermediate hydrological feature. The second intermediate hydrological feature is then fed into a temporal attention unit to evaluate the importance of different time points (such as before the flood peak and during the receding water stage) in representing the current watershed state. Weighted aggregation condenses the information across the entire time dimension into a single feature vector, which is the final hydrological feature representation.

[0043] S103 performs graph convolution operations based on meteorological feature representation, hydrological feature representation, and heterogeneous dual-graph topology to obtain meteorological node features and hydrological node features.

[0044] Specifically, the meteorological static adjacency matrix and the meteorological dynamic similarity matrix, and the hydrological static adjacency matrix and the hydrological dynamic similarity matrix, are weighted and fused to generate meteorological fused adjacency matrices and hydrological fused adjacency matrices, which serve as the connection basis for graph convolution operations. The meteorological static adjacency matrix and the hydrological static adjacency matrix define the inherent connections between meteorological stations based on geographic spatial proximity, and the upstream and downstream confluence relationships between hydrological stations based on river network topology, respectively.

[0045] Based on the meteorological fusion adjacency matrix, graph convolution operations are performed on the meteorological feature representations on the meteorological subgraph. During this process, each meteorological station aggregates neighboring node information and updates its features according to the connection relationships defined in the meteorological fusion adjacency matrix, thereby obtaining the meteorological node features.

[0046] Using the hydrological fusion adjacency matrix as the connection basis, graph convolution operations are performed on the hydrological feature representations on the hydrological subgraph. In this process, each hydrological station aggregates relevant node information and updates its features according to the connection relationships defined by the hydrological fusion adjacency matrix, thereby obtaining the hydrological node features.

[0047] S104. Based on meteorological node features and hydrological node features, cross-map information fusion is performed to obtain the fused hydrological feature representation.

[0048] Specifically, meteorological node features are aggregated to corresponding hydrological nodes based on cross-graph connection edges, and the aggregated meteorological features are fused with the hydrological node's own features through a gating mechanism. Thus, the feature representation of a hydrological node not only includes its own hydrological information and hydrological spatial dependencies, but also incorporates meteorological driving information, forming a fused hydrological feature representation.

[0049] S105, Based on the fused hydrological feature representation, determine the predicted water flow value of the target watershed at future time steps.

[0050] Specifically, the residual decoder is used to output the flow increment of the future time relative to the current time based on the fused hydrological features, and the flow increment is linearly combined with the measured flow value of the current time to obtain the final water flow prediction value of the future time step.

[0051] Please refer to the following: Figure 3 , Figure 3 This is a flowchart illustrating the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided in this application embodiment, as shown below. Figure 3 As shown, this method constructs a heterogeneous dual-graph topology structure using meteorological and hydrological data as inputs, forming a meteorological subgraph based on station similarity and a hydrological subgraph based on river network topology, respectively, and establishing a one-way cross-graph connection from meteorological stations to hydrological stations. Subsequently, through multi-scale temporal feature extraction, the temporal patterns of meteorological and hydrological data are extracted to obtain corresponding feature representations. Then, graph convolution operation is performed to fuse static topology and dynamic similarity to update node features. Next, cross-graph information fusion is performed, and meteorological information is integrated into hydrological features using a gating mechanism. Finally, the predicted water flow value is output based on the fused features.

[0052] In summary, this application determines the spatial proximity of meteorological stations through a meteorological subgraph, constructs the river network topology through a hydrological subgraph, and clarifies the logic of meteorological-driven hydrology by connecting edges across the graph, making the heterogeneous dual-graph topology structure more consistent with the representation of actual watershed physical processes. It combines multi-scale temporal feature extraction, using temporal convolutional networks, frequency domain gating, and temporal attention to capture multi-scale fluctuations and key periodic patterns of flow and rainfall. Furthermore, it integrates static inherent connections and dynamic real-time similarity through dynamic adjacency fusion, allowing graph convolution to adapt to real-time environmental changes, and the updated node features possess both spatial topology and instantaneous interactive semantics. Finally, it achieves adaptive fusion of cross-graph information through a gating mechanism and focuses on flow increment prediction based on residual decoding, effectively reducing accumulated errors. Thus, it optimizes the representational ability and generalization of the prediction model from all dimensions—spatial topology, temporal features, dynamic interaction, and cross-modal fusion—significantly improving the accuracy of runoff flow prediction.

[0053] For example, this embodiment uses historical hydrological and meteorological data from 18 hydrological stations in the Yalong River basin for detailed experimental verification. The method was rigorously compared with existing Long Short-Term Memory (LSTM) networks, conventional Spatio-Temporal Graph Convolutional Networks (STGCN), Temporal Transformer (T-Transformer), GraphWaveNet models, and Spatio-Temporal Transformer (ST-Transformer) models. Please refer to the accompanying documentation. Figure 4 , Figure 4 This is a schematic diagram illustrating the experimental results of the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided in the embodiments of this application, as shown below. Figure 4 As shown, the average prediction metrics for 18 sites are presented respectively. In the long-duration (T+24) validation period prediction scenario, the Nash-Sutcliffe Efficiency (NSE) of the method of this invention can maintain a high level of 0.695 on average, while the existing STGCN model drops to 0.681, and the LSTM model drops sharply to 0.680. At the same time, the root mean square error (RMSE) and mean absolute error (MAE) of the method of this invention are both lower than those of the comparison models. This indicates that the present invention effectively overcomes the instability problem caused by memory decay and error accumulation in traditional deep learning models in long-duration prediction.

[0054] For example, to further demonstrate the fitting effect of the present invention in actual flow processes, please also refer to... Figure 5 , Figure 5 This is a schematic diagram of the flow process fitting results of the flow prediction method based on heterogeneous dual-graph spatiotemporal networks provided in the embodiments of this application, as shown in the figure. Figure 5 As shown, two typical stations within the watershed were selected: Station 1 Ganzi (…). Figure 5 (a) and Station 8 (a) Figure 5 (b) During peak flood periods, this scheme can accurately capture the onset time and peak size of the flood peak, while Long Short-Term Memory networks often exhibit significant flood peak underestimation, and conventional spatiotemporal graph convolutional networks show problems of flood peak time lag and excessive peak smoothing. In addition, during low-flow periods such as the dry season, the prediction curve of this invention can still maintain stable following, without the abnormal fluctuations or numerical amplification phenomena commonly seen in the comparative models.

[0055] In actual raw observation data, data from different sensors or monitoring stations may have inconsistent sampling frequencies and mismatched timestamps. Furthermore, meteorological and hydrological data often have different physical dimensions and numerical ranges. Directly using these data for subsequent model training may lead to difficulties in model convergence, decreased prediction accuracy, or oversensitivity to certain features. Therefore, in a feasible implementation, when acquiring meteorological and hydrological data for the target watershed, the following steps are also specifically performed: Historical meteorological and hydrological observation data sequences of the target watershed are obtained, and time-aligned data sequences are processed to obtain time-aligned meteorological and hydrological data. In this embodiment of the application, time alignment processing refers to adjusting time series data from different data sources or different sampling frequencies to a unified time base to ensure that all relevant data can be accurately matched at the same point in time.

[0056] Specifically, resampling techniques can be used, such as downsampling high-frequency data to the sampling rate of low-frequency data, or upsampling low-frequency data to the sampling rate of high-frequency data through interpolation (such as linear interpolation or spline interpolation); or data can be merged based on a common timestamp, and for missing time points, forward filling, backward filling, or prediction filling based on historical trends can be used.

[0057] The time-aligned meteorological and hydrological data are standardized to obtain preprocessed meteorological and hydrological data.

[0058] In the embodiments of this application, standardization refers to scaling the data so that it falls into a specific numerical range or has specific statistical distribution characteristics, in order to eliminate the influence of different physical dimensions and numerical ranges on model training, avoid certain features with larger values ​​from dominating the model, and thus improve the convergence speed and generalization ability of the model.

[0059] Specifically, Z-score standardization is used, which transforms meteorological and hydrological data into a distribution with a mean of 0 and a standard deviation of 1 by subtracting the mean and dividing by the standard deviation. Alternatively, Min-Max standardization is used, which scales meteorological and hydrological data to a fixed interval of [0, 1] or [-1, 1] through linear transformation.

[0060] For example, suppose the acquired historical meteorological observation data sequence contains hourly rainfall and temperature data, while the historical hydrological observation data sequence contains flow data every 3 hours. During time alignment, a uniform time granularity can be set to hourly. For flow data, linear interpolation or spline interpolation can be used to expand it from 3-hourly data points to hourly data points, thus aligning it temporally with the meteorological data. For instance, if the flow values ​​at a hydrological station at 1:00 and 4:00 are known, the flow values ​​at 2:00 and 3:00 can be calculated through interpolation. After time alignment, all data are standardized. For example, Z-score standardization can be used to calculate the historical mean and standard deviation of rainfall, temperature, and flow, respectively. Then, the mean of the corresponding feature is subtracted from each data point, and the result is divided by the standard deviation. After this processing, the values ​​of all features will follow a distribution with a mean of 0 and a standard deviation of 1, thereby eliminating the differences in the original data units and numerical ranges.

[0061] In summary, this application, by constructing a heterogeneous dual-graph topology, can explicitly distinguish between the two physical processes of meteorological driving and hydrological response, significantly enhancing the physical interpretability of rainfall-runoff modeling. Secondly, by fusing static and dynamic adjacency matrices, it can adaptively characterize the time-varying spatial dependencies between stations under non-stationary conditions such as floods, thereby accurately capturing the dynamic interactions during the confluence process. Thirdly, through a cross-graph gate mechanism, it enables adaptive and selective injection of meteorological information into hydrological information, improving the ability to characterize key hydrological processes such as flood peaks. Finally, the residual decoding strategy is used to predict flow increments, effectively suppressing error accumulation in multi-step predictions. By superimposing the flow increments with measured flow values ​​to obtain the predicted flow values ​​for future time steps, the accuracy of flow prediction and the stability of long-duration predictions in complex watershed scenarios are effectively improved.

[0062] In some embodiments described above in this application, a heterogeneous dual-map topology based on preprocessed meteorological and hydrological data is proposed. However, directly constructing a heterogeneous dual-map structure that can effectively capture complex physical processes within a watershed is not easy. If the inherent physical relationships between meteorological and hydrological elements are not fully considered, the map structure may fail to accurately reflect the true watershed dynamics, thus affecting the accuracy of runoff prediction. Therefore, please refer to [link to relevant documentation]. Figure 6 , Figure 6 This is a flowchart illustrating the traffic prediction method based on a heterogeneous dual-graph spatiotemporal network provided in an embodiment of this application. Figure 6 As shown, the method in this application embodiment may include the following steps S201-S203: S201, construct meteorological submaps based on the spatial correlation between meteorological stations corresponding to meteorological data.

[0063] In this embodiment, the meteorological subgraph is specifically used to represent the spatial relationships between meteorological stations within a watershed. Nodes in the meteorological subgraph represent meteorological stations, and edges represent the spatial correlations between stations. Through sparsification, the meteorological subgraph can effectively capture key meteorological spatial dependencies that significantly impact runoff forecasting.

[0064] In this embodiment, the geographical location information, such as latitude and longitude coordinates, of all meteorological stations within the target watershed is obtained. Based on this location information, the Euclidean distance or geodesic distance between any two meteorological stations is calculated, and the distance is converted into a similarity score using a Gaussian kernel function, thereby generating a similarity matrix between meteorological stations. A pre-set sparsity threshold is used, which can be set empirically or optimized through methods such as cross-validation. For example, only edges with a similarity higher than 0.7 are retained to construct a sparse meteorological subgraph.

[0065] Specifically, the distance between meteorological stations is calculated based on their geographical location information. The distance metric can be Euclidean distance, which is the straight-line distance between two points in a two-dimensional plane or three-dimensional space; it can also be geodesic distance, which is the spherical distance that takes into account the curvature of the earth; or it can be a weighted distance based on geographical features (such as terrain and obstacles).

[0066] The distance metric between meteorological stations is converted into a numerical value representing the similarity or influence strength between stations, resulting in a similarity matrix. The static similarity matrix is ​​a square matrix whose elements represent the static similarity or connection strength between any two meteorological stations. The rows and columns of this static similarity matrix correspond to different meteorological stations. Each value in the matrix reflects the degree of spatial mutual influence between the two stations without considering temporal dynamics.

[0067] Connections with similarity below a threshold are set to zero or removed. Connections with similarity above a sparsity threshold are retained to connect meteorological stations with sufficient spatial correlation, generating a meteorological submap.

[0068] S202, constructing a hydrological sub-map based on the upstream and downstream topological relationships between hydrological stations corresponding to hydrological data.

[0069] In this embodiment, a hydrological submap is constructed based on the upstream and downstream topological relationships between hydrological stations corresponding to preprocessed hydrological data. This aims to determine the inherent hydraulic connections and runoff transport paths between hydrological stations within the watershed. The upstream and downstream topological relationships between hydrological stations form the physical basis of watershed hydrological processes, directly affecting runoff collection and propagation. When constructing the hydrological submap, each hydrological station can be considered a node, and the upstream and downstream relationships between stations determine the direction and existence of directed connection edges. For example, the upstream and downstream relationships between stations can be determined based on river network structure maps or Digital Elevation Model (DEM) analysis results.

[0070] In this embodiment of the application, the upstream and downstream stations of each hydrological station are determined by analyzing the direction of water flow using digital elevation models and river network data.

[0071] Based on the catchment area of ​​each hydrological station, all meteorological stations within its catchment area are identified. For each hydrological station, a one-way connection edge can be established from all meteorological stations within its catchment area to that hydrological station, thus forming a cross-map connection between the meteorological submap and the hydrological submap.

[0072] The river network topology among hydrological stations is obtained. River network topology refers to the physical layout of rivers, streams, and their interconnections within a watershed. Based on the river network topology, the upstream and downstream relationships between hydrological stations are determined. The upstream and downstream relationship refers to the positional relationship of one hydrological station relative to another in the direction of water flow.

[0073] For example, all hydrological stations are traversed. For each pair of stations, it is determined whether there is a direct river connection between them and whether one station is upstream of the other. Once these conditions are met, a directed edge is added to the graph structure from the upstream station to the downstream station; alternatively, this physical relationship can be directly transformed into a directed edge by constructing a connectivity matrix, where the matrix element (i, j) represents whether station i flows directly to station j. Through the above steps, a hydrological subgraph is finally obtained based on the upstream and downstream topological relationships between hydrological stations.

[0074] For example, suppose there are three hydrological stations in a watershed: station A, station B, and station C. Analyzing the river network topology of this watershed reveals that station A is upstream of station B, and there is a direct river connection between them; similarly, station B is upstream of station C, and there is also a direct river connection between them. In this case, the river network topology data, including these three stations and their connecting rivers, is first obtained. Next, based on this river network topology, the upstream and downstream relationships from station A to station B and from station B to station C are determined. Then, according to these relationships, when constructing the hydrological subgraph, a directed edge is established from station A to station B, and a directed edge is established from station B to station C. The final hydrological subgraph will contain three nodes (station A, station B, and station C) and two directed edges (A->B, B->C).

[0075] S203. Establish cross-graph connection edges connecting the meteorological subgraph and the hydrological subgraph to obtain a heterogeneous bigraph topology.

[0076] In this embodiment of the application, cross-graph connection edges are established based on the cross-graph connection relationship in step S202 above, linking meteorological stations with hydrological stations affected by them, thereby explicitly modeling the driving effect of meteorology on hydrology in a heterogeneous dual graph. For example, the connection between meteorological nodes and hydrological nodes can be determined based on the geographical proximity of meteorological stations or causal relationships in historical data.

[0077] For example, if the catchment area of ​​hydrological station A includes meteorological stations X, Y, and Z, then unidirectional connections are established from meteorological nodes X, Y, and Z respectively to hydrological node A. These connections can be assigned specific weights in the graph structure to reflect the degree of influence of different meteorological stations on the runoff of the hydrological station. In the graph convolution operation, the feature information of meteorological nodes X, Y, and Z will be aggregated to hydrological node A through these connections, so that the feature update of hydrological node A can fully consider the meteorological driving factors within its catchment area, thereby characterizing the physical driving process of rainfall runoff.

[0078] Please refer to the following: Figure 7 , Figure 7 This is a flowchart illustrating the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided in this application embodiment, as shown below. Figure 7 As shown, cross-graph connections are established based on the constructed meteorological and hydrological subgraphs, linking meteorological stations to their corresponding hydrological stations. Integrating the meteorological and hydrological subgraphs with these cross-graph connections forms a complete heterogeneous bi-graph topology, providing a topological foundation for subsequent graph convolution and cross-graph fusion.

[0079] In summary, this application's approach constructs meteorological submaps based on the spatial correlations between meteorological stations corresponding to preprocessed meteorological data. This effectively captures the spatial distribution patterns and mutual influences of meteorological elements. For example, rainfall patterns at adjacent meteorological stations often exhibit similarities, which are reflected in the meteorological submaps. Secondly, constructing hydrological submaps based on the upstream and downstream topological relationships between hydrological stations corresponding to preprocessed hydrological data accurately reflects the runoff collection and transmission paths within the watershed, ensuring the physical continuity of hydrological processes. For instance, runoff changes at upstream hydrological stations inevitably affect downstream stations. Finally, by establishing cross-graph connections between the meteorological and hydrological submaps, this application organically combines meteorological driving factors with hydrological response processes, enabling the model to learn how meteorological inputs such as rainfall are transformed into runoff outputs through the watershed's runoff mechanism. This hierarchical and physically driven graph structure construction method allows the heterogeneous dual-graph topology to more accurately represent the complex spatiotemporal dynamics within the watershed.

[0080] Directly utilizing preprocessed data for subsequent processing may fail to fully capture the complex multi-scale time-series patterns and key periodic information contained within meteorological and hydrological data, thus affecting the accuracy of feature representation and predictive performance. Therefore, please refer to [link to relevant documentation / reference]. Figure 8 , Figure 8 This is a flowchart illustrating the traffic prediction method based on a heterogeneous dual-graph spatiotemporal network provided in an embodiment of this application. Figure 8 As shown, the method in this application embodiment may include the following steps S301-S306: S301, meteorological data and hydrological data are respectively input into a preset temporal convolutional layer, and local temporal features are extracted based on the temporal convolutional layer to obtain the first meteorological intermediate feature and the first hydrological intermediate feature.

[0081] Specifically, meteorological and hydrological data are input into a temporal convolutional network consisting of multiple stacked one-dimensional convolutional layers. Each one-dimensional convolutional layer can use different kernel sizes and dilation rates to capture local temporal patterns at different time scales. For example, the first layer can use a kernel size of 3, the second layer can use a kernel size of 5, and residual connections can be introduced to enhance feature transfer. After processing by the temporal convolutional network, the first meteorological intermediate feature and the first hydrological intermediate feature are obtained.

[0082] S302, the first meteorological intermediate feature and the first hydrological intermediate feature are input into the frequency domain gating unit respectively, and the first meteorological intermediate feature and the first hydrological intermediate feature are converted to the frequency domain through fast Fourier transform.

[0083] S303 selectively enhances key frequency components in the frequency domain through a gating network and suppresses high-frequency noise that represents random fluctuations.

[0084] S304 uses inverse Fourier transform to convert the first meteorological intermediate feature and the first hydrological intermediate feature, after frequency domain feature processing, back to the time domain.

[0085] S305, after converting back to the time domain, the first meteorological intermediate feature and the first hydrological intermediate feature are respectively residually connected with the first meteorological intermediate feature and the first hydrological intermediate feature to obtain the second meteorological intermediate feature and the second hydrological intermediate feature.

[0086] Specifically, in S302-S305, the first meteorological intermediate feature and the first hydrological intermediate feature are input into the frequency domain gating unit. The frequency domain gating unit transforms the time-domain features into the frequency domain through a fast Fourier transform, and introduces a learnable parameterized gating mechanism (such as a learnable weight matrix) in the frequency domain to perform weighted modulation on different frequency components. For example, high weights can be assigned to low-frequency components to retain trend information, the weights of specific periodic frequency components can be enhanced, and the weights of high-frequency noise can be reduced.

[0087] The modulated frequency domain features are converted back to the time domain by inverse fast Fourier transform. The first meteorological intermediate features and the first hydrological intermediate features after conversion back to the time domain are then residually connected with the original first meteorological intermediate features and the first hydrological intermediate features to preserve the original information and enhance the effect of frequency domain processing, thereby obtaining the second meteorological intermediate features and the second hydrological intermediate features.

[0088] S306, input the second meteorological intermediate feature and the second hydrological intermediate feature into the time attention unit respectively, and obtain the meteorological feature representation and the hydrological feature representation based on the time attention unit.

[0089] Specifically, the second meteorological intermediate feature and the second hydrological intermediate feature are input into the time attention unit respectively. By calculating the relative weights of different time steps in the sequence, the system dynamically focuses on the most critical historical moment for the current prediction task, thereby aggregating information from the entire time dimension and finally obtaining meteorological and hydrological feature representations.

[0090] In summary, this application, through a multi-scale temporal feature extraction scheme, effectively captures local temporal patterns, key periodic regularities, and long-distance temporal dependencies at different time granularities from preprocessed meteorological and hydrological data. This enables the model to obtain more comprehensive and robust meteorological and hydrological feature representations, significantly improving the expressive power of the features. These high-quality feature representations, when subsequently combined with a heterogeneous dual-graph topology for graph convolution operations, can more accurately reflect the complex dynamics of meteorological and hydrological processes within the watershed, thus providing a more solid data foundation for runoff prediction and effectively solving the problem that relying solely on raw preprocessed data may lead to insufficient feature information and limited prediction accuracy.

[0091] In some embodiments described above in this application, graph convolution operations are proposed based on meteorological feature representation, hydrological feature representation, and heterogeneous dual-graph topology. However, in its implementation, if graph convolution is performed solely based on a pre-defined static graph structure, it may fail to fully capture the complex spatiotemporal relationships of dynamic changes between meteorological and hydrological elements within the watershed, thus limiting the model's adaptability to real-time environmental changes and its prediction accuracy. Therefore, please refer to... Figure 9 , Figure 9 This is a flowchart illustrating the traffic prediction method based on a heterogeneous dual-graph spatiotemporal network provided in an embodiment of this application. Figure 9 As shown, the method in this application embodiment may include the following steps S401-S405: S401, calculate the meteorological dynamic similarity matrix of the meteorological submap based on the meteorological feature representation of the current time step.

[0092] S402, calculate the hydrological dynamic similarity matrix of the hydrological submap based on the hydrological feature representation of the current time step.

[0093] Specifically, the meteorological dynamic similarity matrix corresponding to the meteorological submap and the hydrological dynamic similarity matrix corresponding to the hydrological submap are calculated separately. The formulas for calculating the meteorological dynamic similarity matrix and the hydrological dynamic similarity matrix are as follows:

[0094]

[0095] in, and This is the feature matrix of meteorological nodes and the feature matrix of hydrological nodes for the current batch. This is a meteorological dynamic similarity matrix. This is a hydrological dynamic similarity matrix. S403, the meteorological dynamic similarity matrix and the meteorological static adjacency matrix are weighted and fused to obtain the meteorological fused adjacency matrix.

[0096] S404, weighted fusion of the hydrological dynamic similarity matrix and the hydrological static adjacency matrix, yields the hydrological fused adjacency matrix.

[0097] Specifically, using preset matrix fusion formulas, the meteorological dynamic similarity matrix and the meteorological static adjacency matrix are weighted and fused separately, as are the hydrological dynamic similarity matrix and the hydrological static adjacency matrix. The specific formulas are as follows:

[0098]

[0099] in, This is a meteorological static adjacency matrix. This is a meteorological dynamic similarity matrix. This is a hydrological static adjacency matrix. For learnable balance coefficients, and These are the meteorological fusion adjacency matrix and the hydrological fusion adjacency matrix, respectively, ultimately used for graph convolution. S405, based on the meteorological fusion adjacency matrix and the hydrological fusion adjacency matrix, respectively, graph convolution operations are performed to obtain meteorological node features and hydrological node features.

[0100] Specifically, based on the fused adjacency matrix, a graph convolution operation is performed on the previously obtained meteorological feature representations on the meteorological subgraph. During this process, each meteorological station aggregates neighboring node information and updates its features according to the connection relationships defined by the fused adjacency matrix, thereby obtaining the meteorological node features.

[0101] Using the fused adjacency matrix as the connection basis, graph convolution operations are performed on the hydrological feature representations on the hydrological subgraph. During this process, each hydrological station aggregates relevant node information and updates its features based on the connection relationships defined by the fused adjacency matrix, thereby obtaining the hydrological node features.

[0102] In summary, this application dynamically calculates a dynamic similarity matrix based on the current feature representation and weights it with a static adjacency matrix, thereby ensuring that the graph structure used for graph convolution can adapt to real-time changing interactions and conditions within the watershed. This dynamic adjustment mechanism enables the model to capture transient and evolving spatiotemporal dependencies that a purely static graph structure might miss. Therefore, the updated node features can more accurately reflect the current state and interdependencies of meteorological and hydrological elements, leading to a deeper understanding of the underlying physical processes. This dynamic graph convolution operation can better adapt to the complex and variable spatiotemporal relationships in water flow prediction, thereby improving prediction accuracy and model generalization ability.

[0103] Please see Figure 10 , Figure 10 This is a flowchart illustrating the traffic prediction method based on a heterogeneous dual-graph spatiotemporal network provided in an embodiment of this application. Figure 10 As shown, the method in this application embodiment may include the following steps S501-S503: S501, based on the preset cross-graph adjacency matrix, aggregates meteorological node features to the corresponding hydrological nodes to obtain aggregated meteorological features.

[0104] In the embodiments of this application, the preset cross-graph adjacency matrix is ​​a predefined matrix used to describe the connection relationship between meteorological nodes and hydrological nodes, especially the unidirectional connection from meteorological nodes to hydrological nodes, so as to reflect the physical driving effect of meteorological factors (such as rainfall) on hydrological processes (such as runoff).

[0105] Specifically, the meteorological node features are multiplied by the cross-graph adjacency matrix, thereby distributing and aggregating the meteorological features to hydrological nodes according to a preset connection relationship. Alternatively, a weighted average or summation method can be used to aggregate the features of multiple meteorological nodes to a single hydrological node based on the weights defined in the cross-graph adjacency matrix, thus obtaining aggregated meteorological features.

[0106] S502, the gating coefficient is calculated based on the updated hydrological node features and aggregated meteorological features.

[0107] In the embodiments of this application, the gating coefficient refers to the model not pre-setting fixed rules or weights, but dynamically calculating an optimal coefficient based on the specific data input each time (current hydrological node features and aggregated meteorological features) through its internally trained parameters.

[0108] S503, based on the gating coefficient, the updated hydrological node features and aggregated meteorological features are weighted and fused to obtain the fused hydrological feature representation.

[0109] In this embodiment, the gating coefficient allows the feature processing model to adaptively determine the contribution of meteorological and hydrological features to the final fusion result based on the characteristics of the current input data. The gating coefficient can be calculated using a small neural network (such as a fully connected layer), where the input is a combination of hydrological node features and aggregated meteorological features, and the output is mapped to a preset interval after passing through an activation function (such as the sigmoid function). Alternatively, a simpler linear transformation can be used, combined with the sigmoid function, to map the features to the interval between 0 and 1.

[0110] Weighted fusion combines updated hydrological node features and aggregated meteorological features based on calculated gating coefficients to generate a unified and more representative hydrological feature representation. The specific formula for weighted fusion is as follows:

[0111] in, element-wise multiplication Indicates the characteristics of hydrological nodes, Indicates aggregated meteorological characteristics, Indicates the gating coefficient, This represents the integrated hydrological characteristics.

[0112] In summary, this application aggregates meteorological node features from graph convolutional nodes to corresponding hydrological nodes using a pre-defined cross-graph adjacency matrix, thereby generating aggregated meteorological features. This step explicitly establishes the physical driving relationship between meteorological factors and hydrological processes. Building upon this, the scheme further achieves dynamic weighted fusion of the two heterogeneous features by calculating gating coefficients based on the updated hydrological node features and aggregated meteorological features. The introduction of gating coefficients enables the model to adaptively learn and adjust the relative importance of meteorological driving information and hydrological state information in runoff prediction, thus overcoming the limitations of simple splicing or fixed-weight fusion. This dynamic fusion mechanism ensures that the final fused hydrological feature representation not only includes the local dynamic information of the hydrological nodes themselves but also fully absorbs external driving information from meteorological nodes, making the feature representation more comprehensive and accurate.

[0113] Please see Figure 11 , Figure 11 This is a flowchart illustrating the traffic prediction method based on a heterogeneous dual-graph spatiotemporal network provided in an embodiment of this application. Figure 11 As shown, the method in this application embodiment may include the following steps S601-S603: S601, based on the fused hydrological feature representation, predicts the flow increment at future times relative to the current time through a residual decoder.

[0114] In this embodiment, the residual decoder is a neural network module specifically designed to predict residuals (i.e., the difference between a target value and a baseline value) from input features. It typically consists of one or more fully connected layers, convolutional layers, or recurrent layers, combined with nonlinear activation functions to learn complex nonlinear mapping relationships. The residual decoder's role is to learn and extract patterns related to future flow change trends from complex fused hydrological feature representations, thereby predicting the flow increment relative to the current moment.

[0115] Specifically, the residual decoder can be a network composed of multiple layers of perceptrons, where each layer contains linear transformations and nonlinear activation functions, ultimately outputting a traffic increment that matches the dimension of the traffic increment.

[0116] In another feasible implementation, the residual decoder can also be a structure containing recurrent neural network layers such as gated recurrent units or long short-term memory networks, which can be used to better handle dependencies in time-series data and output traffic increments.

[0117] S602, obtain the measured flow rate value at the current moment.

[0118] Specifically, the measured flow value corresponding to the current time point is obtained from the flow monitoring system of the target watershed.

[0119] S603 superimposes the flow increment with the measured flow value at the current moment to obtain the predicted water flow value at the future time step.

[0120] Specifically, the flow increment predicted by the residual decoder is linearly combined with the measured flow value at the current moment to obtain the final water flow prediction value for the future time step.

[0121] In the embodiments of this application, the predicted water flow rate is... The calculation formula is:

[0122] in, For the current moment The measured flow rate value The model predicts the first Predicted flow changes at each time step.

[0123] In summary, by utilizing a residual decoder to predict the flow increment at future times relative to the current time, and then superimposing this prediction with the current measured flow value, the prediction results are always based on the latest measured data, thus significantly improving the accuracy and robustness of runoff prediction. This prediction method can more accurately capture the dynamic trends of runoff changes, reduce the accumulation of prediction errors, and ensure the physical rationality of the prediction results.

[0124] based on Figure 1 The scene composition is illustrated below, and will be combined with... Figure 12 This paper provides a detailed description of the traffic prediction device based on a heterogeneous dual-graph spatiotemporal network provided in the embodiments of this application. It should be noted that... Figure 12 The traffic prediction device based on heterogeneous dual-graph spatiotemporal network in the present application is used to perform the traffic prediction of this application. Figure 2 - Figure 11 The methods shown in the embodiments are for illustrative purposes only, illustrating the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figure 2 - Figure 11 The embodiment shown includes a traffic prediction device 700 based on a heterogeneous dual-graph spatiotemporal network, which may include a topology construction unit 701, a feature extraction unit 702, a feature structure processing unit 703, a feature fusion unit 704, and a traffic prediction unit 705, as detailed below: The topology construction unit 701 is used to acquire meteorological and hydrological data of the target watershed and construct a heterogeneous dual-graph topology based on the meteorological and hydrological data. The feature extraction unit 702 is used to extract time-series features from meteorological and hydrological data to obtain meteorological feature representations and hydrological feature representations. The feature structure processing unit 703 is used to perform graph convolution operations based on meteorological feature representation, hydrological feature representation and heterogeneous dual graph topology to obtain meteorological node features and hydrological node features. The feature fusion unit 704 is used to perform cross-map information fusion based on meteorological node features and hydrological node features to obtain the fused hydrological feature representation. The flow prediction unit 705 is used to determine the predicted water flow value of the target watershed at future time steps based on the fused hydrological feature representation.

[0125] Optionally, in some embodiments, the topology building unit 701 can be used for: Historical meteorological and hydrological observation data sequences of the target watershed are obtained, and time-aligned data sequences are processed to obtain time-aligned meteorological and hydrological data. The time-aligned meteorological and hydrological data are standardized to obtain preprocessed meteorological and hydrological data.

[0126] Optionally, in some embodiments, the topology building unit 701 can be used for: Meteorological submaps are constructed based on the spatial correlation between meteorological stations corresponding to meteorological data. Hydrological sub-graphs are constructed based on the upstream and downstream topological relationships between hydrological stations corresponding to hydrological data. Establish cross-graph connection edges connecting the meteorological subgraph and the hydrological subgraph to obtain a heterogeneous bigraph topology.

[0127] Optionally, in some embodiments, the feature extraction unit 702 may be used for: Meteorological and hydrological data are respectively input into a preset temporal convolutional layer. Local temporal features are extracted based on the temporal convolutional layer to obtain the first meteorological intermediate feature and the first hydrological intermediate feature. The first meteorological intermediate feature and the first hydrological intermediate feature are respectively input into the frequency domain gating unit, and the first meteorological intermediate feature and the first hydrological intermediate feature are transformed into the frequency domain through fast Fourier transform; In the frequency domain, a gated network is used to selectively enhance key frequency components and suppress high-frequency noise representing random fluctuations. The first meteorological intermediate feature and the first hydrological intermediate feature, after frequency domain feature processing, are converted back to the time domain by inverse Fourier transform. The first meteorological intermediate feature and the first hydrological intermediate feature, after being converted back to the time domain, are respectively residually connected with the first meteorological intermediate feature and the first hydrological intermediate feature to obtain the second meteorological intermediate feature and the second hydrological intermediate feature. The second meteorological intermediate feature and the second hydrological intermediate feature are respectively input into the time attention unit. Based on the time attention unit, the meteorological feature representation and the hydrological feature representation are obtained.

[0128] Optionally, in some embodiments, the feature structure processing unit 703 may be used for: Calculate the meteorological dynamic similarity matrix of the meteorological submap based on the meteorological feature representation of the current time step; Calculate the hydrological dynamic similarity matrix of hydrological submaps based on the hydrological feature representation of the current time step; The meteorological dynamic similarity matrix and the meteorological static adjacency matrix are weighted and fused to obtain the meteorological fused adjacency matrix; The hydrological dynamic similarity matrix and the hydrological static adjacency matrix are weighted and fused to obtain the hydrological fused adjacency matrix; Graph convolution operations are performed on the meteorological fusion adjacency matrix and the hydrological fusion adjacency matrix respectively to obtain meteorological node features and hydrological node features.

[0129] Optionally, in some embodiments, the feature fusion unit 704 may be used for: Based on a pre-defined cross-graph adjacency matrix, meteorological node features are aggregated to the corresponding hydrological nodes to obtain aggregated meteorological features. The gating coefficient is calculated based on the updated hydrological node features and aggregated meteorological features, and the value of the gating coefficient is within a preset range. The updated hydrological node features and aggregated meteorological features are weighted and fused based on the gating coefficient to obtain the fused hydrological feature representation.

[0130] Optionally, in some embodiments, the traffic prediction unit can be used to: Based on the fused hydrological feature representation, the flow increment at future times relative to the current time is predicted using a residual decoder; Obtain the measured flow rate at the current moment; The flow increment is superimposed with the measured flow value at the current moment to obtain the predicted water flow value at the future time step.

[0131] The traffic prediction device 700 based on heterogeneous dual-graph spatiotemporal network provided in the above embodiments can realize the technical solutions described in the above embodiments of the traffic prediction method based on heterogeneous dual-graph spatiotemporal network. The specific implementation principles of each module or unit can be found in the corresponding content in the above embodiments of the traffic prediction method based on heterogeneous dual-graph spatiotemporal network, and will not be repeated here.

[0132] like Figure 13 As shown, the present invention also provides an electronic device 800. The electronic device 800 includes a processor 801, a memory 802, and a display 803. Figure 13Only some components of the electronic device 800 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.

[0133] In some embodiments, processor 801 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 802 or process data, such as the traffic prediction method based on heterogeneous dual-graph spatiotemporal network in this invention.

[0134] In some embodiments, processor 801 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 801 may be local or remote. In some embodiments, processor 801 may be implemented on a cloud platform. In one embodiment, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, internal cloud, multi-cloud, etc., or any combination thereof.

[0135] In some embodiments, memory 802 may be an internal storage unit of electronic device 800, such as a hard disk or memory of electronic device 800. In other embodiments, memory 802 may also be an external storage device of electronic device 800, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 800.

[0136] Furthermore, the memory 802 may include both internal storage units of the electronic device 800 and external storage devices. The memory 802 is used to store application software and various types of data installed on the electronic device 800.

[0137] In some embodiments, display 803 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 803 is used to display information from electronic device 800 and to display a visual user interface. Components 801-803 of electronic device 800 communicate with each other via a system bus.

[0138] In one embodiment, when processor 801 executes a traffic prediction program based on a heterogeneous dual-graph spatiotemporal network stored in memory 802, the following steps can be implemented: Acquire meteorological and hydrological data for the target watershed, and construct a heterogeneous dual-graph topology based on the meteorological and hydrological data; Temporal features are extracted from meteorological and hydrological data to obtain meteorological and hydrological feature representations. Based on meteorological feature representation, hydrological feature representation, and heterogeneous dual-graph topology, graph convolution operation is performed to obtain meteorological node features and hydrological node features; Cross-map information fusion is performed based on meteorological node features and hydrological node features to obtain a fused hydrological feature representation. The predicted water flow value of the target watershed at future time steps is determined based on the fused hydrological feature representation.

[0139] It should be understood that when the processor 801 executes the traffic prediction program based on the heterogeneous dual-graph spatiotemporal network in the memory 802, in addition to the functions mentioned above, it can also perform other functions, as can be found in the description of the corresponding method embodiments above.

[0140] Furthermore, this embodiment of the invention does not specifically limit the type of electronic device 800 mentioned. Electronic device 800 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, electronic device 800 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0141] Accordingly, this application also provides a computer-readable storage medium for storing computer-readable programs or instructions. When the programs or instructions are executed by a processor, they can implement the steps or functions of the traffic prediction method based on heterogeneous dual-graph spatiotemporal networks provided in the above-described method embodiments.

[0142] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0143] The above provides a detailed description of the traffic prediction method, apparatus, electronic device, and storage medium based on heterogeneous dual-graph spatiotemporal networks provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A traffic prediction method based on heterogeneous dual-graph spatiotemporal networks, characterized in that, The method includes: Acquire meteorological and hydrological data of the target watershed, and construct a heterogeneous dual-graph topology based on the meteorological and hydrological data; Time-series feature extraction is performed on the meteorological data and the hydrological data to obtain meteorological feature representations and hydrological feature representations; Based on the meteorological feature representation, the hydrological feature representation, and the heterogeneous dual-graph topology, graph convolution operation is performed to obtain meteorological node features and hydrological node features; Based on the meteorological node features and the hydrological node features, cross-map information fusion is performed to obtain the fused hydrological feature representation; Based on the fused hydrological feature representation, the predicted water flow value of the target watershed at future time steps is determined.

2. The method according to claim 1, characterized in that, The acquisition of meteorological and hydrological data for the target watershed includes: Historical meteorological and hydrological observation data sequences of the target watershed are obtained, and time alignment processing is performed on the historical meteorological and hydrological observation data sequences to obtain time-aligned meteorological and hydrological data. The time-aligned meteorological and hydrological data are standardized to obtain preprocessed meteorological and hydrological data.

3. The method according to claim 1, characterized in that, The construction of a heterogeneous dual-graph topology based on the meteorological data and the hydrological data includes: A meteorological submap is constructed based on the spatial correlation between meteorological stations corresponding to the meteorological data. A hydrological sub-map is constructed based on the upstream and downstream topological relationships between the hydrological stations corresponding to the hydrological data. Establish cross-graph connection edges connecting the meteorological subgraph and the hydrological subgraph to obtain the heterogeneous bigraph topology.

4. The method according to claim 1, characterized in that, The step of extracting time-series features from the meteorological data and the hydrological data to obtain meteorological feature representations and hydrological feature representations includes: The meteorological data and the hydrological data are respectively input into a preset temporal convolutional layer, and local temporal features are extracted based on the temporal convolutional layer to obtain the first meteorological intermediate feature and the first hydrological intermediate feature. The first meteorological intermediate feature and the first hydrological intermediate feature are respectively input into the frequency domain gating unit, and the first meteorological intermediate feature and the first hydrological intermediate feature are converted to the frequency domain through fast Fourier transform; In the frequency domain, a gated network is used to selectively enhance key frequency components and suppress high-frequency noise representing random fluctuations. The first meteorological intermediate feature and the first hydrological intermediate feature, after frequency domain feature processing, are converted back to the time domain by inverse Fourier transform. The first meteorological intermediate feature and the first hydrological intermediate feature after being converted back to the time domain are respectively residually connected with the first meteorological intermediate feature and the first hydrological intermediate feature to obtain the second meteorological intermediate feature and the second hydrological intermediate feature. The second meteorological intermediate feature and the second hydrological intermediate feature are respectively input into the time attention unit, and the meteorological feature representation and the hydrological feature representation are obtained based on the time attention unit.

5. The method according to claim 1, characterized in that, The step of performing graph convolution operations based on the meteorological feature representation, the hydrological feature representation, and the heterogeneous dual-graph topology to obtain meteorological node features and hydrological node features includes: Calculate the meteorological dynamic similarity matrix of the meteorological submap based on the meteorological feature representation of the current time step; Calculate the hydrological dynamic similarity matrix of hydrological submaps based on the hydrological feature representation of the current time step; The meteorological dynamic similarity matrix and the meteorological static adjacency matrix are weighted and fused to obtain the meteorological fused adjacency matrix; The hydrological dynamic similarity matrix and the hydrological static adjacency matrix are weighted and fused to obtain the hydrological fused adjacency matrix; Graph convolution operations are performed on the meteorological fusion adjacency matrix and the hydrological fusion adjacency matrix respectively to obtain meteorological node features and hydrological node features.

6. The method according to claim 1, characterized in that, The process of fusing cross-map information based on the meteorological node features and the hydrological node features to obtain the fused hydrological feature representation includes: Based on a preset cross-graph adjacency matrix, the meteorological node features are aggregated to the corresponding hydrological nodes to obtain aggregated meteorological features; The gating coefficient is calculated based on the updated hydrological node features and the aggregated meteorological features, and the gating coefficient is obtained through adaptive learning; The updated hydrological node features and the aggregated meteorological features are weighted and fused according to the gating coefficient to obtain the fused hydrological feature representation.

7. The method according to claim 1, characterized in that, The determination of the predicted water flow value of the target watershed at future time steps based on the fused hydrological feature representation includes: Based on the fused hydrological feature representation, the residual decoder is used to predict the flow increment at future times relative to the current time. Obtain the measured flow rate at the current moment; The flow rate increment is superimposed with the measured flow rate value at the current moment to obtain the predicted flow rate value at the future time step.

8. A traffic prediction device based on a heterogeneous dual-graph spatiotemporal network, characterized in that, The device includes: A topology construction unit is used to acquire meteorological and hydrological data of the target watershed and construct a heterogeneous dual-graph topology based on the meteorological and hydrological data. The feature extraction unit is used to extract time-series features from the meteorological data and the hydrological data to obtain meteorological feature representations and hydrological feature representations. The feature structure processing unit is used to perform graph convolution operations based on the meteorological feature representation, the hydrological feature representation, and the heterogeneous dual-graph topology to obtain meteorological node features and hydrological node features. The feature fusion unit is used to perform cross-map information fusion based on the meteorological node features and the hydrological node features to obtain the fused hydrological feature representation. A flow prediction unit is used to determine the predicted water flow value of the target watershed at a future time step based on the fused hydrological feature representation.

9. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable program code; A processor for calling and running the executable program code from the memory, causing the electronic device to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 7.