Hydrological data processing method, system, equipment and medium

By constructing a spatiotemporal graph structure and fusing spatiotemporal features, the dynamic coupling relationship between hydrological elements is calculated, which solves the problem of insufficient prediction of existing hydrological models in complex watersheds and extreme events, realizes more reliable hydrological data processing, and improves the physical consistency and prediction accuracy of the model.

CN121836034APending Publication Date: 2026-04-10YANTAI HYDROLOGY CENT (YANTAI WATER & SOIL CONSERVATION MONITORING STATION)
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing hydrological models lack sufficient prediction accuracy and physical process support when facing complex watersheds and extreme hydrological events. This results in weak generalization ability of the models in extreme events, making them unsuitable for effective application in precise flood control scheduling and water resource management.

Method used

By constructing a spatiotemporal graph structure, graph structure data containing node features and edge features is generated. Spatiotemporal features are fused, dynamic coupling relationships between elements are calculated, coupling relationship weights and dynamic lag times are generated, lag contribution allocation is performed in combination with historical contribution records, prediction context vectors are generated, and finally iterative state prediction is performed to explicitly characterize the key physical coupling mechanisms in the hydrological process.

Benefits of technology

It significantly enhances the physical consistency and reliability of model prediction results, improves prediction reliability under complex scenarios, and provides reliable data support for precise flood control scheduling and water resource management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121836034A_ABST
    Figure CN121836034A_ABST
Patent Text Reader

Abstract

The invention relates to a hydrological data processing method, system and device and a medium. The method comprises the following steps: constructing a space-time diagram structure based on time sequence observation data of each hydrological monitoring station and a hydraulic topological relation between the stations, and generating diagram structure data containing node features and edge features; performing spatio-temporal feature fusion based on the graph structure data to generate a node feature vector representing the spatio-temporal context information of the site; based on the node feature vectors, calculating a dynamic coupling relationship between hydrological elements, and generating a coupling relationship weight and dynamic lag time; based on the coupling relation weight and the dynamic lag time, combining a historical contribution record to carry out lag contribution distribution, and generating a prediction context vector; and performing iterative state prediction based on the prediction context vector, and generating a water level and flow prediction result in a future time period. By adopting the method, a space-time dynamic coupling mechanism among hydrological elements can be explicitly quantified in a data-driven framework, so that the physical interpretability and reliability of flood prediction are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of hydrological data processing technology, and in particular relates to a hydrological data processing method, system, equipment and medium. Background Technology

[0002] With the development of hydrological monitoring technology and artificial intelligence, the field of hydrological forecasting has made significant progress in improving forecast accuracy, and two main technical routes have emerged: mechanistic models based on physical mechanisms and pure data-driven models based on historical data learning.

[0003] In traditional techniques, hydrological models based on physical mechanisms, such as the Xin'anjiang model and the SWAT model, simulate the hydrological response of a watershed by constructing a series of physical equations describing processes such as rainfall, infiltration, and runoff. On the other hand, purely data-driven methods, represented by recurrent neural networks, especially long short-term memory networks, directly learn the complex mapping relationship between input and output from a large amount of historical hydrological observation data, without the need to explicitly construct physical equations.

[0004] However, existing technologies all have significant limitations. While physics-based mechanistic models offer good physical interpretability, their predictive accuracy heavily relies on precise model parameter calibration and spatial discretization. This makes modeling and calibration extremely difficult when dealing with watersheds with complex underlying surfaces and significant human impact. Purely data-driven models, while capable of flexibly fitting complex patterns in data, operate as a "black box" in their learning process. These models cannot reveal or quantify key spatiotemporal dynamic coupling mechanisms, such as "how upstream rainfall affects downstream flood peak formation" and "how river level changes respond to subsequent flow." This results in predictive results lacking physical process support, exhibiting weak generalization ability in extreme hydrological events (such as catastrophic floods) outside the training data distribution, and insufficient reliability and interpretability of predictions, thus limiting their in-depth application in precise flood control scheduling and water resource management. Summary of the Invention

[0005] Therefore, it is necessary to provide a hydrological data processing method, system, device, and medium that can explicitly capture the spatiotemporal dynamic coupling mechanism between hydrological elements to improve the physical interpretability of predictions, in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides a hydrological data processing method, including:

[0007] S1. Based on the time-series observation data of each hydrological monitoring station and the hydraulic topological relationship between the stations, a spatiotemporal graph structure is constructed to generate graph structure data containing node features and edge features.

[0008] S2. Based on graph structure data, perform spatiotemporal feature fusion to generate node feature vectors; node feature vectors are used to represent the spatiotemporal context information of the site.

[0009] S3. Based on node feature vectors, calculate the dynamic coupling relationship between elements and generate coupling relationship weights and dynamic lag times;

[0010] S4. Based on the coupling relationship weights and dynamic lag time, and combined with historical contribution records, lag contribution allocation is performed to generate a prediction context vector.

[0011] S5. Perform iterative state prediction based on the prediction context vector to generate water level and flow prediction results for future periods.

[0012] In one embodiment, S1 includes:

[0013] S11. Based on the time-series observation data, extract the multi-scale statistical features of each station and generate a set of station statistical features;

[0014] S12. The latest values ​​of the time series observation data are fused with the station statistical feature set to generate initial node features;

[0015] S13. Based on the river network topology extracted by the digital elevation model, establish topological edges between stations with upstream and downstream connections.

[0016] S14. Based on the hydraulic distance between stations and the correlation with rainfall, establish hydraulic influence edges and meteorological similarity edges;

[0017] S15. Assign hydraulic attribute features to topological edges, hydraulically affected edges, and meteorologically similar edges to generate an initial edge feature set, and generate graph structure data based on the initial node features and the initial edge feature set.

[0018] In one embodiment, S3 includes:

[0019] S21. Generate relationship-specific query vectors and key vectors based on predefined coupling relationship types and node feature vectors;

[0020] S22. Calculate the matching degree between the query vector and the key vector, and generate the basic association score;

[0021] S23. Based on node feature vectors and edge features, estimate the lag time through a neural network and generate dynamic lag time;

[0022] S24. Based on the hydraulic distance between stations and the dynamic lag time, calculate the spatial attenuation factor and the time lag factor;

[0023] S25. By fusing the basic correlation score, spatial attenuation factor, and time lag factor, a raw coupling relationship score is generated; the formula for calculating the raw coupling relationship score is as follows:

[0024]

[0025] Where S is the original score of the coupling relationship. and These are the query vector and the key vector, respectively. For spatial decay kernel function, For hydraulic distance, For time-lag kernel functions, This refers to the dynamic lag time.

[0026] S26. Normalize the original scores of the coupling relationship and introduce physical constraints to generate the coupling relationship weights.

[0027] In one embodiment, S23 includes:

[0028] S231. For node pairs with coupling relationships, concatenate the node feature vectors and the connecting edge feature vectors of the node pairs to generate combined features.

[0029] S232. Input the combined features into a specific feedforward neural network, perform a nonlinear transformation, and output a preliminary lag time estimate.

[0030] S233. During model training, a smoothness constraint is applied to the preliminary lag time estimates of adjacent time points to generate dynamic lag time.

[0031] In one embodiment, S26 includes:

[0032] S261. Normalize the original scores of coupling relationships at the source node dimension to generate initial attention weights;

[0033] S262. Calculate the mass conservation loss value based on the initial attention weights; the mass conservation loss value is used to constrain the attention weight allocation of the slump nodes to conform to physical laws; the formula for calculating the mass conservation loss value is:

[0034]

[0035] in, The loss value due to mass conservation. For the set of confluence nodes, For the confluence node The set of all upstream nodes, upstream node For nodes Initial attention weights;

[0036] S263. Incorporate the mass conservation loss value into the total loss function of the model for joint optimization to obtain coupling relationship weights that conform to physical constraints.

[0037] In one embodiment, S4 includes:

[0038] S31. Read the historical contribution sequence of the source node from the historical contribution record;

[0039] S32. Based on the dynamic lag time and time lag kernel function, perform weighted convolution on the historical contribution sequence to generate the current effective contribution; the formula for calculating the current effective contribution is:

[0040]

[0041] in, For effective contribution, For dynamic lag time, For a moment Historical contributions;

[0042] S33. Based on the coupling relationship weight, all current effective contributions pointing to the same target node are weighted and aggregated to generate a prediction context vector.

[0043] In one embodiment, S5 includes:

[0044] S41. Based on the prediction context vector and the node's previous state vector, update the node's state vector at the current time.

[0045] S42. Based on the node state vector at the current moment, decode and generate the water level prediction value and flow prediction value at the current moment;

[0046] S43. Merge the current water level prediction value and flow prediction value to generate the node prediction status at the current moment, and write the current flow prediction value into the historical contribution record buffer of the relevant downstream nodes.

[0047] S44. Use the node prediction state at the current moment as the previous moment's state vector for the next moment, and regenerate the prediction context vector for the next moment based on the updated historical contribution record buffer.

[0048] S45. Repeat S41 to S44 until a node prediction state sequence covering all time steps of the preset future period is generated. The node prediction state sequence includes the water level and flow prediction results for the future period.

[0049] Secondly, this application also provides a hydrological data processing system, comprising:

[0050] The spatiotemporal graph structure construction module is used to construct a spatiotemporal graph structure based on the time-series observation data of each hydrological monitoring station and the hydraulic topological relationship between the stations, and generate graph structure data containing node features and edge features;

[0051] The spatiotemporal feature fusion module is used to perform spatiotemporal feature fusion based on graph structure data and generate node feature vectors; the node feature vectors are used to represent the spatiotemporal context information of the site.

[0052] The dynamic coupling relationship calculation module is used to calculate the dynamic coupling relationship between elements based on node feature vectors, and generate coupling relationship weights and dynamic lag times.

[0053] The lag contribution allocation module is used to allocate lag contributions based on coupling relationship weights and dynamic lag time, combined with historical contribution records, and generate a prediction context vector.

[0054] The iterative state prediction module is used to perform iterative state prediction based on the prediction context vector, generating water level and flow prediction results for future time periods.

[0055] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the hydrological data processing method as described in the first aspect.

[0056] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the hydrological data processing method of the first aspect.

[0057] The aforementioned hydrological data processing methods, systems, equipment, and media first construct a spatiotemporal graph structure based on monitoring station data and their hydraulic topological relationships, abstracting the watershed system into graph data containing characteristic nodes and edges, laying the foundation for structured analysis. Then, spatiotemporal feature fusion is performed on this graph data to generate node feature vectors that characterize the spatiotemporal context information of each station. Based on these feature vectors, the dynamic coupling relationships between different hydrological elements (such as rainfall and flow) are calculated, explicitly outputting coupling weights describing the intensity of influence and dynamic lag times characterizing time delays. Next, using the obtained weights and lag times, combined with historical contribution records, a refined time lag allocation is performed on past hydrological influences, generating a prediction context vector that integrates the spatiotemporal coupling mechanism. Finally, iterative state deduction is performed based on this vector to predict water levels and flow rates for future periods. This explicitly characterizes and quantifies the key physical coupling mechanisms in the hydrological process within a data-driven framework, significantly enhancing the physical consistency of model prediction results and their reliability under complex scenarios. Attached Figure Description

[0058] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0059] Figure 1 A flowchart illustrating a hydrological data processing method provided by the present invention;

[0060] Figure 2 A flowchart illustrating a method for generating coupling weights and dynamic lag times in an optional embodiment of the present invention;

[0061] Figure 3 This is a schematic diagram of the structure of a hydrological data processing system provided by the present invention. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0063] In one embodiment, such as Figure 1 As shown, a hydrological data processing method is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps S1 to S5:

[0064] S1. Based on the time-series observation data of each hydrological monitoring station and the hydraulic topological relationship between the stations, a spatiotemporal graph structure is constructed to generate graph structure data containing node features and edge features.

[0065] Optionally, the time-series observation data specifically includes the time-series sequences of hydrological elements such as water level, flow rate, and rainfall continuously collected from each hydrological monitoring station. Hydraulic topology refers to the hydraulic transmission relationships between stations based on the distribution of the watershed's river system and hydrological connectivity, such as upstream and downstream river connections and confluence area affiliations. Specifically, the time-series observation data from each hydrological monitoring station is first retrieved through a data reading interface. Missing values ​​are filled and outliers are removed. Missing value filling uses linear interpolation, and outlier removal uses the 3σ criterion. Simultaneously, spatial information such as geographic coordinates, river direction, and watershed boundaries of each station is extracted using a Geographic Information System (GIS). Combined with hydraulic transmission patterns, a hydraulic topology adjacency matrix is ​​constructed between stations. An element of 1 in the adjacency matrix indicates a direct hydraulic connection between the two corresponding stations, while a value of 0 indicates no direct hydraulic connection. Based on this, a spatiotemporal graph structure is constructed, mapping each hydrological monitoring station to a node in the spatiotemporal graph structure, and mapping the hydraulic connectivity between stations to edges in the spatiotemporal graph structure. Node features are obtained by feature extraction from the time-series observation data of each station. Specifically, the sliding window method is used to segment the time-series observation data, and statistical features such as mean, variance, peak value, and valley value of the data within the window are extracted. These features are combined with the original time-series data to form the initial features of the nodes. Edge features are calculated based on the hydraulic topology and hydrological transmission characteristics between stations. Specifically, the channel length, channel slope, and hydraulic conduction coefficient between two connected stations are calculated. After standardizing the above parameters, edge features are formed. Finally, the node features and edge features are integrated to generate the graph structure data.

[0066] S2. Based on graph structure data, perform spatiotemporal feature fusion to generate node feature vectors; node feature vectors are used to characterize the spatiotemporal context information of the site.

[0067] Optionally, a graph neural network combined with temporal coding is used to achieve spatiotemporal feature fusion. Specifically, the node features in the graph structure data are first encoded in the temporal dimension. For example, a Long Short-Term Memory Network (LSTM) is used to process the temporal feature sequence of each node. The LSTM captures the long-short-term dependencies in the temporal features through the synergistic effect of the input gate, forget gate, and output gate, obtaining the temporal encoded features of each node. Subsequently, a Graph Convolutional Network (GCN) is used. The graph convolutional network (GCNN) performs spatial-dimensional neighborhood aggregation on the temporally encoded node features. Based on the hydraulic topology adjacency matrix between stations, the GCNN performs a weighted sum of the temporally encoded features of each node and the temporally encoded features of its neighboring nodes. The weights are determined by the similarity between the adjacency matrix and the node features. Specifically, the adjacency matrix is ​​normalized and the aggregation weights are calculated by combining the inner product of the node features. Furthermore, the temporally encoded features and spatially aggregated features are concatenated. The concatenated features are then subjected to dimensional adjustment and nonlinear mapping through a fully connected layer. The nonlinear mapping uses the ReLU activation function to finally obtain the node feature vectors that represent the spatiotemporal context information of the stations.

[0068] S3. Based on node feature vectors, calculate the dynamic coupling relationship between elements and generate coupling relationship weights and dynamic lag times.

[0069] Optionally, the dynamic coupling relationship between elements specifically refers to the spatiotemporal influence relationship between hydrological elements (such as water level and flow, upstream water level and downstream water level) corresponding to different hydrological monitoring stations. The dynamic lag time refers to the time difference between the change of hydrological element at one station and the significant impact on the hydrological element at another related station. Specifically, based on node feature vectors, the dynamic coupling relationship between elements is calculated using a method combining mutual information calculation and a sliding window. First, the time range of the sliding window is set. Using the sliding window as the unit, the mutual information value between the feature sequences of hydrological elements corresponding to any two nodes is calculated. The mutual information value is used to characterize the strength of the coupling relationship between the two elements. By traversing different lag times, the mutual information value of the feature sequences of the two elements is calculated at each lag time. The lag time corresponding to the maximum mutual information value is determined as the dynamic lag time. The coupling weight is obtained by normalizing the mutual information value. Specifically, the Softmax function is used to normalize the mutual information value between different elements. The calculation formula of the Softmax function is: ,in Let be the mutual information value of the i-th element pair. Let be the coupling relationship weight of the i-th element pair. After normalization, the sum of the coupling relationship weights of all element pairs is 1, and finally the coupling relationship weight and dynamic lag time are generated.

[0070] S4. Based on the coupling relationship weights and dynamic lag time, and combined with historical contribution records, lag contribution allocation is performed to generate a prediction context vector.

[0071] Optionally, historical contribution records refer to the records of the contribution of each hydrological element to the prediction target (water level or flow) within a historical period. Specifically, this refers to the statistical data on the correlation between the coupling relationship weights of each element and the prediction result error within a historical period. Specifically, firstly, different lag periods are divided based on the dynamic lag time, and the feature sequences of each element in different lag periods are extracted. Then, the basic contribution ratio of each element in different lag periods is determined by combining the coupling relationship weights. The basic contribution ratio is equal to the product of the coupling relationship weights and the time decay coefficient of the corresponding lag period. The time decay coefficient is calculated using an exponential decay function, the formula of which is: ,in For the lag time, The attenuation coefficient is... The data is obtained by fitting historical data. Further, historical contribution records are called up to calculate the deviation between the basic contribution ratio and the actual contribution in each lag period within the historical period. The basic contribution ratio is corrected by using the least squares method. The least squares method determines the correction coefficient by minimizing the sum of squares of the deviations. The basic contribution ratio is multiplied by the correction coefficient to obtain the final lag contribution allocation ratio. Finally, the feature vectors of each lag period are weighted and summed according to the lag contribution allocation ratio. The result of the weighted summation is the prediction context vector.

[0072] S5. Perform iterative state prediction based on the prediction context vector to generate water level and flow prediction results for future periods.

[0073] Optionally, an iterative prediction method is used to predict water level and flow rate for future periods. Specifically, the prediction context vector is used as the initial input, and an iterative prediction model is constructed using a gated recurrent unit (GRU). The GRU controls the updating and retention of the model state through update and reset gates, which can effectively capture the dependencies in time series prediction. First, the prediction context vector is input into the GRU model to obtain the water level and flow rate prediction results for the first future period. Then, the prediction results of the first future period are used as new input features and fused with the features of subsequent periods in the original prediction context vector to form the input vector for the next iteration. The above process is repeated to obtain the water level and flow rate prediction results for each subsequent future period. Preferably, in each iteration, the prediction results are validated for rationality. The validation adopts hydrological constraints, such as the correlation between water level and flow rate and the water balance relationship between upstream and downstream stations. If the prediction results violate the constraints, the hidden layer state of the GRU model is adjusted to correct the results, ensuring their rationality, and finally generating complete water level and flow rate prediction results for future periods.

[0074] The aforementioned hydrological data processing method accurately represents the spatiotemporal correlation of hydrological stations through a spatiotemporal graph structure. It achieves deep fusion of spatiotemporal features by combining graph neural networks and temporal coding. Based on mutual information and sliding windows, it quantifies the dynamic coupling relationship and lag time of elements. Then, it completes the allocation of lag contributions through historical contribution correction, and finally outputs future hydrological data through iterative prediction. This method fully integrates hydrological and hydraulic topological relationships and dynamic coupling mechanisms, balancing the flexibility of data-driven approaches with the interpretability of physical processes. It effectively improves the reliability of prediction results and the generalization ability under extreme hydrological events, providing reliable data support for precise flood control scheduling and water resource management.

[0075] In one embodiment, S1 includes:

[0076] S11. Based on the time-series observation data, extract the multi-scale statistical features of each station and generate a set of station statistical features.

[0077] Optionally, multi-scale statistical features refer to multidimensional statistical information obtained by extracting features from time-series observation data based on sliding windows at different time scales. The time-series observation data includes continuous time series such as water level, flow, and rainfall at various hydrological monitoring stations. Specifically, the time-series observation data is first segmented into multiple scales using the sliding window method. The scale of the sliding window is achieved by setting different window lengths and sliding step sizes. For example, three levels of window lengths are set: short, medium, and long. The selection of the window length is determined based on the time scale characteristics of the hydrological process. For the data within the sliding window at each scale, statistical features such as mean, variance, standard deviation, skewness, kurtosis, maximum value, minimum value, range, trend slope, and autocorrelation coefficient are extracted. The trend slope is calculated using a linear regression method, and the autocorrelation coefficient is obtained by calculating the Pearson correlation coefficient between the time-series data and its lagged series. Furthermore, the extracted statistical features at each scale are standardized using the Z-score standardization method, calculated as x'=(x-μ) / σ, where x is the original statistical feature value, μ is the mean of the feature, and σ is the standard deviation of the feature. The standardized statistical features at each scale are then concatenated in scale order to form a multi-scale statistical feature set for each station. During the concatenation process, the dimensional correspondence of each feature is maintained to ensure the integrity and orderliness of the feature set.

[0078] S12. The latest values ​​of the time series observation data are fused with the station statistical feature set to generate initial node features.

[0079] Optionally, the latest value of the time-series observation data refers to the observation data point closest to the current time in the time-series sequence. Specifically, this is achieved by sorting the time-series observation data by timestamp and extracting the single data point at the end of the sorted sequence as the latest value. The latest value is then converted into a vector form consistent with the single feature dimension in the site statistical feature set. Specifically, a dimension expansion method is used to expand the single numerical latest value into a one-dimensional vector. Subsequently, feature concatenation is used to fuse the two, concatenating the expanded latest value vector with the site statistical feature set according to feature dimensions. Preferably, the latest value vector is placed at the beginning of the feature set to highlight the importance of the data at the current time. Further, the concatenated feature vector undergoes dimension verification to ensure no missing or duplicate dimensions. If dimension mismatches exist, adjustments are made through zero-padding or feature pruning. Zero-padding is used to supplement missing dimensions, and feature pruning is used to remove duplicate dimensions. Finally, through the above fusion and verification process, initial node features that comprehensively reflect the current state of the site and multi-scale historical statistical patterns are generated.

[0080] S13. Based on the river network topology extracted from the digital elevation model, establish topological edges between stations with upstream and downstream connections.

[0081] Optionally, a Digital Elevation Model (DEM) is a digital simulation of ground topography using limited terrain elevation data. River network topology refers to the distribution pattern of river channels within a watershed and the attribution and connection relationships between stations and river channels. Specifically, the DEM data is first preprocessed, including depression filling and flat area processing. Depression filling uses an iterative method, gradually raising the elevation values ​​of concave areas to eliminate local low-lying areas in the DEM. Flat area processing uses a method of adding slight slopes to ensure that water flow can naturally converge along the terrain. Subsequently, based on the preprocessed digital elevation model (DEM), a river network was extracted using hydrological analysis methods. Specifically, the starting point of the river channel was determined by calculating the cumulative runoff. The calculation of the cumulative runoff was based on the slope and flow direction of the DEM. The flow direction was determined using the D8 algorithm, meaning that the flow direction of each grid cell points to the adjacent grid cell with the steepest slope. The cumulative runoff was the sum of the number of grid cells upstream of each grid cell that flowed towards that grid cell. Grid cells with a cumulative runoff exceeding a set threshold were identified as river channel grid cells, and these were then connected to form a complete river network. Based on the extracted river network, the location of each hydrological monitoring station within the network was determined. By judging the spatial superposition relationship between the station and the river channel grid cells, the river segment to which the station belonged was identified. Furthermore, based on the river's confluence direction, the upstream and downstream connections between the stations were determined. Stations located in the same river segment and distributed sequentially along the confluence direction were identified as having upstream and downstream connections. Based on this relationship, topological edges were established between the corresponding stations, with the direction of the topological edges consistent with the river's confluence direction.

[0082] S14. Based on the river hydraulic distance and rainfall correlation between stations, establish hydraulic influence edges and meteorological similarity edges.

[0083] Optionally, the hydraulic distance refers to the actual distance between two stations along the river centerline, distinct from the straight-line distance, and reflects the actual transmission path length of hydrological signals; rainfall correlation refers to the degree of linear correlation between the concurrent rainfall time-series data of two stations. Specifically, the calculation of the hydraulic distance is based on the river network centerline extracted by the digital elevation model. Using the Euclidean distance accumulation method, the length of each river segment between the two stations is calculated segment by segment along the river centerline, and the total hydraulic distance is obtained by summing the lengths of each segment. During the calculation, the coordinate sequence of the river centerline is obtained through geographic information system tools, and the straight-line distance of each segment is calculated and accumulated based on the coordinate sequence. The rainfall correlation is calculated using the Pearson correlation coefficient. Specifically, concurrent rainfall time-series data of two stations are selected, and the correlation coefficient is obtained by calculating the ratio of the covariance to the product of the standard deviations of the rainfall data of the two stations. The correlation coefficient ranges from [-1, 1], with a larger absolute value indicating a stronger correlation. Hydraulic influence edges are established based on the hydraulic distance of the river channel. A hydraulic distance threshold is set. When the hydraulic distance between two stations is less than the set threshold, a hydraulic influence edge is established between the two stations. The direction of the hydraulic influence edge is from the upstream station to the downstream station. Meteorological similarity edges are established based on the correlation of rainfall. A correlation threshold is set. The rationality of the threshold is determined through a significance test. When the absolute value of the correlation coefficient between two stations is greater than the set threshold, a meteorological similarity edge is established between the two stations. The meteorological similarity edge is an undirected edge to reflect the reciprocity of rainfall influence.

[0084] S15. Assign hydraulic attribute features to topological edges, hydraulically affected edges, and meteorologically similar edges to generate an initial edge feature set, and generate graph structure data based on the initial node features and the initial edge feature set.

[0085] Optionally, hydraulic properties refer to parameters that characterize the hydraulic transport properties of a river channel, specifically including channel slope, hydraulic conductivity coefficient, roughness coefficient, and channel cross-sectional area. Specifically, hydraulic properties are assigned to topological edges, hydraulic influence edges, and meteorological similarity edges. The channel slope is calculated as the ratio of the elevation difference between two stations extracted from the digital elevation model to the hydraulic distance of the channel. The hydraulic conductivity coefficient is based on geological information such as the lithology and soil type of the river channel, with typical values ​​for the corresponding region determined by consulting hydrogeological parameter manuals and then corrected according to the actual conditions of the river channel. The roughness coefficient is selected based on factors such as the vegetation cover and the roughness of the channel wall, using typical values ​​of the Manning roughness coefficient. The channel cross-sectional area is calculated using the width and depth data of the channel, which are determined based on the statistical mean of field survey data. The above hydraulic properties are standardized using the min-max standardization method, and the calculation formula is: ,in The original attribute value. The minimum value of this attribute. The maximum value of this attribute is defined, and after standardization, all attribute values ​​fall within the range [0,1]. The standardized hydraulic attribute features are categorized and integrated according to edge type to generate an initial edge feature set. The feature vector corresponding to each edge is formed by concatenating the hydraulic attribute features of its respective edge type in a fixed order. Finally, each hydrological monitoring station is mapped to a node in a graph structure, with the node's attributes being the initial node features. Topological edges, hydraulic influence edges, and meteorological similarity edges are mapped to edges in a graph structure, with the edge attributes being the corresponding edge features in the initial edge feature set, thus generating complete graph structure data.

[0086] In the above embodiments, multi-scale statistical feature extraction captures the temporal patterns of hydrological data, integrates the latest values ​​to enhance real-time state representation, accurately constructs the river network topology and multiple types of edges based on a digital elevation model, and endows the edge information with hydraulic attribute features to generate graph structure data. This embodiment fully integrates the temporal features and spatial correlation characteristics of hydrological data, realizes the structured representation of hydrological data, and effectively preserves key correlation information such as hydraulic conduction and meteorological similarities.

[0087] In one embodiment, S3 includes:

[0088] S21. Based on predefined coupling relationship types and node feature vectors, generate relationship-specific query vectors and key vectors.

[0089] Optionally, the predefined coupling relationship types refer to the interaction types of typical elements clearly defined by hydrophysical processes, specifically including upstream and downstream station water level coupling, rainfall-discharge coupling, river water level-tributary discharge coupling, etc., with each coupling relationship type corresponding to a specific hydrological process association logic. The node feature vector is a feature vector representing the spatiotemporal context information of the station obtained after the fusion of previous spatiotemporal features, including temporal statistical features and spatial association features. Specifically, for each predefined coupling relationship type, a dedicated mapping matrix is ​​constructed, and the dimension of the mapping matrix is ​​determined according to the dimension of the node feature vector and the preset query vector and key vector dimensions. The node feature vector is mapped to the relationship-specific query vector and key vector through a fully connected layer. The input of the fully connected layer is the node feature vector, and the output dimension is the preset query vector and key vector dimensions. The weight parameters of the fully connected layer are obtained through training with historical hydrological data, and the training process uses the mean squared error loss function to minimize the matching error between the query vector and the key vector. For different coupling relationship types, different fully connected layer parameters are used for mapping. For example, the mapping matrix corresponding to upstream and downstream water level coupling has different parameters than that corresponding to rainfall-flow coupling. Finally, a set of query vectors and key vectors corresponding to each coupling relationship type is generated to ensure that the query vectors and key vectors can accurately represent the feature association attributes of the corresponding coupling relationship.

[0090] S22. Calculate the matching degree between the query vector and the key vector to generate the basic association score.

[0091] Optionally, the matching degree is used to quantify the feature similarity between the query vector and the key vector, and the basic association score is a numerical representation of this similarity. Specifically, the matching degree between the query vector and the key vector is calculated using the vector dot product, with the formula Q·Kᵀ, where Q is the query vector and K is the key vector. The magnitude of the dot product directly reflects the similarity between the two vectors; the larger the dot product, the more similar the feature characteristics of the corresponding elements of the query vector and the key vector, and the tighter the coupling relationship. Before calculating the dot product, the query vector and the key vector are first subjected to L2 normalization, with the formula being: ,in For the original vector, The L2 norm of the vector is used for normalization, which eliminates the impact of differences in vector dimensionality on the matching degree calculation. Further, the normalized query vector and key vector are multiplied by a dot product to obtain the initial matching degree value. Then, a linear mapping layer is used to adjust the range of the initial matching degree value. The formula for the linear mapping layer is: y = wx + b, where w is the weight coefficient and b is the bias term. w and b are determined through training with historical data. The training objective is to minimize the deviation between the adjusted basic association score and the actual hydrological coupling strength, ultimately generating a basic association score that accurately reflects the degree of basic association between elements.

[0092] S23. Based on node feature vectors and edge features, estimate the lag time through a neural network to generate dynamic lag time.

[0093] Optionally, dynamic lag time refers to the time difference between changes in hydrological elements at one station and their significant impact on the hydrological elements at another related station. Its estimation requires combining the spatiotemporal information contained in the node feature vectors and the hydraulic transmission information contained in the edge features. Specifically, a Multi-Layer Perceptron (MLP) is used as the neural network model to estimate dynamic lag time. The MLP consists of an input layer, hidden layers, and an output layer. The input layer is a concatenated vector of node and edge features, with the node feature vector first and the edge features last. The dimension of the concatenated vector is the sum of the dimensions of the two features. The hidden layers use the ReLU activation function for non-linear mapping. The number of hidden layers is determined based on the feature complexity; 2-3 hidden layers are typically set, and the number of neurons in each layer is adaptively adjusted based on the feature dimension. The output layer consists of a single neuron using a linear activation function, and the output is the estimated value of the dynamic lag time. The training process of the multilayer perceptron uses historical hydrological data, with the actual observed lag time as the label. A mean squared error loss function is used to minimize the deviation between the predicted and labeled values. The training optimizer employs stochastic gradient descent (SGD). After training, the node feature vectors and edge features to be processed are input into the trained multilayer perceptron to generate the dynamic lag time between each pair of associated stations.

[0094] S24. Based on the hydraulic distance and dynamic lag time between stations, calculate the spatial attenuation factor and the time lag factor.

[0095] Optionally, the spatial attenuation factor is used to characterize the attenuation effect of hydraulic distance on the coupling strength, and the time lag factor is used to characterize the attenuation effect of dynamic lag time on the coupling strength. Specifically, the spatial attenuation kernel function... Using the exponential decay function, the formula for calculating the exponential decay function is: ,in The spatial attenuation coefficient, The data was obtained by fitting historical hydrological data. The fitting process was based on the actual coupling strength at different hydraulic distances to minimize the deviation between the function output value and the actual coupling strength. This represents the hydraulic distance between stations, i.e., the actual transmission distance along the river's centerline. Time lag kernel function. Using the same exponential decay function, the calculation formula is: ,in The time decay coefficient, The goal of fitting the function output with the actual coupling strength under different lag times was determined by fitting historical data. The dynamic lag time is used. In the calculation process, the hydraulic distance between stations and the previously estimated dynamic lag time are first obtained, and then substituted into the corresponding spatial decay kernel function and time lag kernel function to calculate the spatial decay factor and time lag factor. The values ​​of both factors are in the range of (0,1]. The larger the value, the smaller the decay effect and the smaller the influence of distance or lag time on the coupling relationship.

[0096] S25. By fusing the basic correlation score, spatial attenuation factor, and time lag factor, a raw coupling relationship score is generated; the formula for calculating the raw coupling relationship score is as follows:

[0097]

[0098] Where S is the original score of the coupling relationship. and These are the query vector and the key vector, respectively. For spatial decay kernel function, For hydraulic distance, For time-lag kernel functions, This is the dynamic lag time.

[0099] Optionally, the generation of the original coupling score needs to integrate the basic association score, spatial decay factor, and time lag factor through a given formula to achieve a comprehensive quantification of the strength of the element coupling relationship. Specifically, the basic association score is first obtained by calculating the dot product of the query vector Q and the transpose of the key vector K. This dot product operation is a matrix multiplication operation. If Q is an m×n dimension matrix and K is an m×n dimension matrix, then the transpose of K is an n×m dimension matrix, and the dot product result is an m×m dimension matrix, where each element corresponds to the basic association score of a pair of sites. Subsequently, the dot product result matrix is ​​multiplied element-wise with the spatial decay factor matrix, which is m×m dimension, and each element corresponds to the spatial decay factor of a pair of sites. The resulting matrix after multiplication is then multiplied element-wise with the time lag factor matrix, which is also m×m in dimension, with each element corresponding to a pair of time lag factors for each station. During the element-wise multiplication process, it is ensured that the dimensions of the three matrices are completely matched, and the elements at corresponding positions are multiplied respectively. The final matrix is ​​the original coupling relationship score matrix, and each element in the matrix corresponds to the original coupling relationship score of a pair of stations.

[0100] S26. Normalize the original scores of the coupling relationship and introduce physical constraints to generate the coupling relationship weights.

[0101] Optionally, normalization is used to convert the original scores of the coupling relationships into relative values ​​within the range [0,1], and physical constraints are used to ensure that the weights of the coupling relationships conform to hydrophysical laws. Specifically, the normalization process uses the Softmax function, which is calculated as follows: ,in This represents the original score for the coupling relationship between the i-th pair of sites. The function calculates the initial normalized weights for each station pair by summing the exponential sum of their original scores. The physical constraints specifically include upstream-downstream coupling directionality constraints and water balance constraints. The upstream-downstream coupling directionality constraint requires that the coupling weight of an upstream station to a downstream station be greater than the weight of a downstream station to an upstream station. If the initial normalized weights violate this constraint, the weight values ​​are adjusted to satisfy it by multiplying the downstream-to-upstream weight value by a coefficient less than 1, determined based on the constraint strength. The water balance constraint requires that the sum of all input coupling weights and the sum of the output coupling weights at the same station conform to the water conservation law. If this is not satisfied, the weight values ​​are adjusted using linear scaling to ensure compliance with the conservation requirement. Finally, after normalization and physical constraint adjustments, coupling weights that are both reasonable and physically interpretable are generated.

[0102] In the above embodiments, coupling features are captured through relationship-specific vector mapping, the correlation strength is quantified by fusing spatiotemporal attenuation factors, and the weights are optimized by combining normalization and physical constraints. This embodiment balances the accuracy of data-driven approaches with the rationality of hydrological physics. The generated coupling relationship weights can truly reflect the dynamic correlation patterns between elements, improve the reliability of subsequent lag contribution allocation and prediction, and provide core support for the physical interpretability of hydrological prediction.

[0103] In one embodiment, S23 includes:

[0104] S231. For node pairs with coupling relationships, concatenate the node feature vectors and the connecting edge feature vectors of the node pairs to generate combined features.

[0105] Optionally, a node pair with a coupling relationship refers to a combination of stations with a clear hydrological association, determined based on a predefined coupling relationship type, such as upstream and downstream station water level coupling, rainfall-discharge coupling, etc. Each node pair contains nodes corresponding to two interconnected hydrological monitoring stations. The node feature vector is a feature vector representing the spatiotemporal context information of the station, and the connecting edge feature vector is a set of attribute features representing the hydraulic transmission characteristics between the two nodes. Specifically, all node pairs that conform to the predefined coupling relationship type are first selected, and each node pair is labeled with the corresponding coupling relationship type identifier. Then, for each node pair, the node feature vectors of the two nodes and the edge feature vectors connecting the two nodes are extracted. The dimensionality consistency of these three types of vectors is checked. If there is a dimensionality mismatch, zero-padding is used to supplement the shorter-dimensional vector to ensure that the feature dimensions of the three types of vectors are completely consistent. Furthermore, features are concatenated in a fixed order of "the first node's feature vector - the edge feature vector - the second node's feature vector". During the concatenation process, the original semantic association of each feature is maintained. After the concatenation is completed, the combined features are standardized using the Z-score standardization method to eliminate the influence of differences in the magnitude of different feature dimensions. Finally, combined features that can comprehensively reflect the spatiotemporal features and association characteristics of the nodes are generated.

[0106] S232. Input the combined features into a specific feedforward neural network, perform a nonlinear transformation, and output a preliminary lag time estimate.

[0107] Optionally, a relationship-specific feedforward neural network refers to a dedicated feedforward neural network constructed for different predefined coupling relationship types. Each type of coupling relationship corresponds to an independent set of network parameters, ensuring that the network can accurately learn the mapping pattern between features and lag time under the corresponding coupling relationship. The feedforward neural network consists of an input layer, hidden layers, and an output layer. The input of the input layer is the combined features, and the input dimension is consistent with the dimension of the combined features. The hidden layer uses the ReLU activation function to achieve a nonlinear transformation. The calculation formula of the ReLU activation function is: f(x)=max(0,x), which can effectively alleviate the gradient vanishing problem. The number of hidden layers is adaptively set according to the complexity of the combined features, and the number of neurons in each layer is adjusted proportionally according to the feature dimension. The output layer is a single neuron that uses a linear activation function. The output result is the preliminary lag time estimate, which directly corresponds to the time difference estimate of the significant impact of changes in hydrological elements of one node on another node in a node pair. During network training, the actual measured lag times from historical observation data are used as labels. A mean squared error loss function is employed to minimize the deviation between the initial lag time estimate and the label value. The training optimizer uses an Adaptive Moment Estimation (Adam) optimizer, and model convergence is achieved through iterative updates of network parameters. After training, the combined features to be processed are input into a dedicated pre-trained feedforward neural network according to their corresponding coupling relationship types, which outputs the initial lag time estimate for each node pair.

[0108] S233. During model training, a smoothness constraint is applied to the preliminary lag time estimates of adjacent time points to generate dynamic lag time.

[0109] Optionally, smoothness constraints are used to ensure that the estimated lag times between adjacent time points change continuously, conforming to the continuity of the hydrological process, avoiding abrupt changes, and improving the rationality and reliability of the dynamic lag time. Specifically, during model training, in addition to the original mean squared error loss function, a smoothness constraint regularization term is introduced to construct a joint loss function. The formula for the joint loss function is: ,in For the joint loss function value, The value of the mean squared error loss function. These are the smoothness constraint weighting coefficients. The weights of the effects of balancing mean squared error and smoothness constraints were determined using cross-validation. This is a smoothness constraint regularization term. The sum of squares of the differences between the preliminary lag time estimates of the same node pair at adjacent times is obtained, and the calculation formula is as follows: ,in Let be the initial estimate of the lag time at time t. This represents the initial lag time estimate at time t-1. During model training, the parameters of the feedforward neural network are iteratively updated by minimizing the joint loss function, ensuring that the initial lag time estimate output by the model closely matches the actual observation labels while also satisfying the smoothness requirement between adjacent time steps. After training, the lag time estimate output by the model, adjusted for smoothness constraints, becomes the dynamic lag time. This value accurately reflects the changes in the lag characteristics of the coupling relationship between nodes at different time steps.

[0110] In the above embodiments, spatiotemporal and correlational information of node pairs is integrated by splicing and combining features. A relationship-specific feedforward neural network is used to accurately learn the mapping relationship between features and lag times, and smoothness constraints are combined to ensure the continuity of the estimated values. This embodiment fully adapts to the characteristics of different coupling relationships, and the generated dynamic lag times are both accurate and reasonable, conforming to the physical laws of hydrological processes.

[0111] In one embodiment, S26 includes:

[0112] S261. Normalize the original scores of the coupling relationship at the source node dimension to generate initial attention weights.

[0113] Optionally, the source node dimension refers to the dimension direction that normalizes the original scores of the coupling relationships of all upstream source nodes corresponding to a single confluence node, taking the upstream influencing nodes of each confluence node as the source nodes. The original coupling relationship score is a quantified value obtained after fusing the basic correlation score, spatial decay factor, and time lag factor in the early stage. The initial attention weight is the relative weight that can characterize the degree of influence of the upstream source node on the confluence node after normalization. Specifically, based on the previously constructed river network topology, a corresponding set of upstream source nodes is matched for each confluence node to clarify the coupling relationship between each upstream source node and the confluence node. Then, for each confluence node, the original scores of the coupling relationships between all its corresponding upstream source nodes and the confluence node are extracted to form a unique set of original upstream source node scores for that confluence node. Each element in the set uniquely corresponds to a pair of original coupling relationship scores between upstream source nodes and confluence nodes. Subsequently, the original set of upstream source nodes corresponding to each confluence node is normalized using the Softmax function. The calculation formula of the Softmax function is: ,in upstream source node For the merge node The initial attention weights, upstream source node For the merge node The original score of the coupling relationship. For this confluence node The normalization process is to ensure that the original score set of the upstream source nodes corresponding to each sink node is complete and without omissions, duplications, or invalid original score data. This process makes the sum of the initial attention weights of all upstream source nodes corresponding to each sink node approach 1, which aligns with the core logic of subsequent quality conservation constraints from a data perspective. This achieves accurate relative quantification of the influence of upstream source nodes on sink nodes, and finally generates an initial attention weight matrix, in which each element precisely corresponds to a pair of initial attention weights between upstream source nodes and sink nodes.

[0114] S262. Calculate the mass conservation loss value based on the initial attention weights; the mass conservation loss value is used to constrain the attention weight allocation of the slump nodes to conform to physical laws; the formula for calculating the mass conservation loss value is:

[0115]

[0116] in, The loss value due to mass conservation. For the set of confluence nodes, For the confluence node The set of all upstream nodes, upstream node For nodes The initial attention weights.

[0117] Optionally, the set of confluence nodes refers to the set of hydrological monitoring stations within the watershed that are located in the hydrological confluence area and receive water from multiple upstream nodes. This set is determined based on the confluence relationship of the river network topology and is typically a key station such as a river confluence or the watershed outlet. The set of all upstream nodes of confluence node s refers to the set of all hydrological monitoring stations that can directly or indirectly transport water to confluence node s through the river channel, based on the hydraulic topology. The core function of the mass conservation loss value is to constrain the initial attention weights to meet the mass conservation requirements of the hydrological confluence process by quantifying the deviation between the initial attention weight allocation and the physical law of water conservation. Specifically, based on the previously constructed river network topology, all hydrological monitoring stations are traversed, and stations with multiple upstream water inflow nodes are selected to form the set of confluence nodes. At the same time, for each confluence node s, all corresponding upstream node sets are matched to generate a confluence node-upstream node mapping table to ensure accurate correspondence between upstream and downstream relationships. Subsequently, based on this mapping table, the initial attention weights of all upstream nodes j corresponding to each confluence node s are extracted. Calculate all The sum of these values ​​is then squared, and the difference between the sum and 1 is used to obtain the quality conservation bias term for a single confluence node. Further, all stations in the confluence node set are iterated over, and the quality conservation bias term for each station is summed, following the calculation logic of the given quality conservation loss value calculation formula. Finally, the quality conservation loss value, which quantifies the degree to which the initial attention weights deviate from the quality conservation law, is obtained.

[0118] S263. Incorporate the mass conservation loss value into the total loss function of the model for joint optimization to obtain coupling relationship weights that conform to physical constraints.

[0119] Optionally, the model's total loss function is a joint loss function that integrates the previous prediction loss and the mass conservation loss. The goal of joint optimization is to minimize the total loss function by iteratively adjusting the model parameters, thereby ensuring both the prediction accuracy and physical rationality of the initial attention weights. Specifically, the basic loss function of the model is first defined. This basic loss function is the loss function used in the previous dynamic lag time estimation or coupling relationship score prediction process. For example, the mean squared error loss function is used to quantify the deviation between the model output value and the actual observed value. Then, the mass conservation loss value is incorporated into the basic loss function to construct the total loss function. The formula for the total loss function is: ,in This is the total loss function value. Based on the value of the loss function, The mass conservation loss weighting coefficient, The values ​​of these weights are determined through cross-validation, balancing the basic prediction accuracy with the strength of physical constraints to ensure a balance between the two. The joint optimization process employs an adaptive moment estimator optimizer, aiming to minimize the total loss function value. It iteratively updates the parameters related to the initial attention weights in the model, calculating the total loss function value in real time during iteration. Iteration stops when the loss value stabilizes or reaches a preset convergence condition. Ultimately, this joint optimization process yields coupling weights that meet both prediction accuracy requirements and strictly adhere to the physical law of mass conservation.

[0120] In the above embodiments, initial attention weights are generated by normalizing the source node dimension, and loss values ​​are calculated based on the law of mass conservation. Joint optimization achieves a balance between the accuracy and physical rationality of the weights. This embodiment effectively constrains the coupling relationship weights to conform to the physical laws of hydrological confluence, avoids weight allocation deviating from the actual hydrological process, and improves the physical interpretability and reliability of the coupling relationship weights.

[0121] In one embodiment, S4 includes:

[0122] S31. Read the historical contribution sequence of the source node from the historical contribution record.

[0123] Optionally, the historical contribution record refers to the time-series record of the contribution of each source node to the hydrological prediction results of the target node within a historical period. This record includes the source node identifier, the target node identifier, the contribution value, and the corresponding timestamp, and is stored in the form of a time-series database or a structured file. The source node is the hydrological influence source station with a coupling relationship determined in the early stage. Specifically, firstly, a matching query is performed in the historical contribution record using the unique identifier of the source node to filter out all record entries containing the source node identifier; then, the contribution value and corresponding timestamp are extracted from the filtered entries, and sorted in ascending order by timestamp to generate the historical contribution sequence of the source node; further, the temporal continuity of the generated sequence is checked. If there are missing or duplicate timestamps, missing entries are filled in by timestamp interpolation and duplicate entries are removed to ensure the temporal integrity and uniqueness of the historical contribution sequence, and finally, a historical contribution sequence that can accurately reflect the temporal changes of the historical contributions of the source nodes is obtained.

[0124] S32. Based on the dynamic lag time and time lag kernel function, perform weighted convolution on the historical contribution sequence to generate the current effective contribution; the formula for calculating the current effective contribution is:

[0125]

[0126] in, For effective contribution, For dynamic lag time, For a moment Its historical contributions.

[0127] Optionally, the dynamic lag time is the time difference estimated by a neural network and optimized by smoothness constraints in the early stage. The time lag kernel function adopts the previously defined exponential decay function, and the weighted convolution selects the historical contribution components that are effective for the current prediction by assigning different weights to the historical contributions at different historical moments. Specifically, the dynamic lag time is first used as the basis for prediction. Determine the range of valid historical moments τ, and select only those timestamps that satisfy the criteria. For historical moments (where Δt is within a reasonable error range), ensure that only historical contributions that may have a valid impact on the current moment t are considered; then, for each valid historical moment τ, calculate the time lag kernel function value: ,in Let t be the time interval from historical time τ to current time t, and let the kernel function value vary. The absolute value of the kernel function decreases as the time interval approaches the dynamic lag time, meaning that the kernel function value approaches 1, corresponding to the maximum weight of the historical contribution. Furthermore, the kernel function value corresponding to each valid historical time τ is compared with the historical contribution at that time. Multiply the values ​​to obtain the weighted historical contribution; finally, sum all the weighted historical contributions, following the calculation logic of the given current effective contribution formula, to generate the current effective contribution that can accurately represent the current effective contribution of the source node to the target node.

[0128] S33. Based on the coupling relationship weight, all current effective contributions pointing to the same target node are weighted and aggregated to generate a prediction context vector.

[0129] Optionally, the target node is a hydrological monitoring station that receives contributions from multiple source nodes, the coupling relationship weight is a weight value that characterizes the coupling influence of the source node on the target node after joint optimization with mass conservation constraints, and the prediction context vector is a feature vector that integrates the effective contributions of all source nodes and is used for subsequent hydrological prediction. Specifically, firstly, all current effective contributions are grouped according to the unique identifier of the target node, and the current effective contributions of different source nodes pointing to the same target node are grouped into the same group, ensuring that the effective contributions in each group correspond to the same target node. Then, the coupling relationship weight between each source node and the corresponding target node in each group is extracted. The weight values ​​have been physically constrained to ensure that they conform to the hydrological confluence law. Further, the current effective contribution of each source node in each group is multiplied by the corresponding coupling relationship weight to obtain the weighted effective contribution. Different source nodes are assigned different degrees of influence based on the weights. Finally, all weighted effective contributions in the same group are concatenated according to the fixed sorting rules of the source nodes. The dimensions of the concatenated features are adjusted through a fully connected layer to ensure that the feature dimensions meet the input requirements of the subsequent prediction model. Finally, a prediction context vector that can comprehensively reflect the current effective contributions of all associated source nodes of the target node is generated.

[0130] In the above embodiment, historical contribution time-series data of the source nodes are first read, and effective contributions that meet the dynamic lag characteristics are filtered through weighted convolution. Then, the prediction context vector is generated by aggregating and weighting the data according to the target node. This embodiment incorporates historical contribution patterns and dynamic lag characteristics to ensure that the contribution allocation conforms to the hydrological time-series coupling mechanism, and the generated prediction context vector has both the accuracy of data-driven approaches and the rationality of physical processes.

[0131] In one embodiment, S5 includes:

[0132] S41. Based on the prediction context vector and the node's previous state vector, update the node's state vector at the current time.

[0133] Optionally, the prediction context vector is a comprehensive feature vector obtained by weighted aggregation of previous lagged contributions, containing the current effective contribution information of all source nodes to the target node; the previous time step state vector of the node is a vector representing the hydrological state of the node predicted in the previous time step, containing water level, flow-related features and implicit state information at that time. Specifically, a gated recurrent unit is used to update the node state vector at the current time step. The gated recurrent unit dynamically fuses the current contribution information of the prediction context vector with the historical time-series information of the previous time step state vector through the synergistic effect of the reset gate and the update gate. First, the prediction context vector and the previous time step state vector are concatenated, and the concatenated vector is used as the input of the gated recurrent unit; then, the outputs of the reset gate and the update gate are calculated. The reset gate is calculated using the Sigmoid activation function, with a value range of [0,1], used to control the degree of retention of the previous time step state vector, and the calculation formula is: ,in The state vector from the previous time step. To predict the context vector, To reset the gate weight matrix, The gate bias term is reset; the update gate is also calculated using the Sigmoid activation function, which controls the fusion ratio between the previous state vector and the current candidate state. The calculation formula is: ,in To update the gate weight matrix, To update the gate bias term; candidate states are calculated based on the reset gate output. The candidate states are generated using the tanh activation function, and the calculation formula is as follows: Where ⊙ represents element-wise multiplication, The candidate state weight matrix, The candidate state bias term is used; finally, the previous state vector and the candidate state are fused through the update gate output to obtain the node state vector at the current time step, calculated as follows: All weight matrices and bias terms of the gated recurrent unit are obtained through training with historical hydrological data. The training uses the mean square error loss function to minimize the deviation between the predicted state and the actual state.

[0134] S42. Based on the node state vector at the current moment, decode and generate the water level prediction value and flow prediction value at the current moment.

[0135] Optionally, the node state vector at the current moment contains comprehensive hydrological features that integrate historical time-series information and current contribution information. The decoding process is achieved by mapping the high-dimensional state vector to specific water level and flow prediction values. Specifically, a decoding network is constructed using two fully connected layers. The input of the first fully connected layer is the node state vector at the current moment, which is non-linearly mapped using the ReLU activation function to enhance the expressive power of the features. The output dimension of the first layer is adaptively set according to the feature complexity. The input of the second fully connected layer is the output feature of the first layer, which uses a linear activation function and has an output dimension of 2, corresponding to the water level prediction value and the flow prediction value, respectively. The training of the decoding network is carried out simultaneously with the training of the gated recurrent units in the early stage. A joint loss function is used, which is the sum of the mean square error between the water level prediction value and the actual water level value, and the mean square error between the flow prediction value and the actual flow value. An adaptive moment estimation optimizer is used for training, and the model convergence is achieved by iteratively updating the network parameters. After training, the node state vector at the current moment is input into the trained decoding network, and the water level prediction value and flow prediction value at the current moment can be directly output, realizing the mapping from abstract state features to specific hydrological element prediction values.

[0136] S43. Merge the current water level prediction value and flow prediction value to generate the node prediction status at the current moment, and write the current flow prediction value into the historical contribution record buffer of the relevant downstream nodes.

[0137] Optionally, the node prediction status is a comprehensive data structure representing the hydrological condition of the node at the current moment, including the current time stamp, predicted water level, and predicted flow rate. The historical contribution record buffer is a memory area that temporarily stores the contribution data of the source node to downstream related nodes, used to provide real-time updated historical contribution information for the generation of the prediction context vector at the next moment. Specifically, the current water level prediction value and flow rate prediction value are combined in the format of "time stamp - predicted water level value - predicted flow rate value" to generate the node prediction status at the current moment. During the combination process, the accuracy of the timestamp is ensured, and it strictly corresponds to the current prediction time step. Subsequently, based on the previously constructed river network topology, all downstream related nodes of the current node are determined. Downstream related nodes refer to nodes that are directly or indirectly affected by the current node through the river channel. The current flow rate prediction value is extracted as the basic data for the contribution of the current node to downstream related nodes, and the current node identifier, downstream related node identifier, and current timestamp are added to it to generate historical contribution record entries. Finally, the generated historical contribution record entries are written to the historical contribution record buffer. The buffer adopts a first-in-first-out storage strategy, automatically removing old record entries that are outside the preset historical time range to ensure the timeliness and validity of the buffer data.

[0138] S44. Use the node prediction state at the current moment as the previous moment's state vector for the next moment, and regenerate the prediction context vector for the next moment based on the updated historical contribution record buffer.

[0139] Optionally, the state vector of the previous moment in the next moment needs to inherit the hydrological time series characteristics of the current moment to ensure the temporal continuity of the iterative prediction; the regenerated prediction context vector of the next moment needs to incorporate the latest historical contribution information to improve the real-time performance and accuracy of the prediction. Specifically, the node prediction state of the current moment is directly converted into a vector form as the state vector of the previous moment in the next moment. During the conversion process, the core features of the node prediction state are retained to ensure the effective transmission of temporal dependencies. At the same time, the data in the updated historical contribution record buffer is read, and combined with the previously determined dynamic lag time and coupling relationship weights, the relevant steps of lag contribution allocation are repeated to recalculate the current effective contribution of each source node to the corresponding target node. Then, based on the coupling relationship weights, all effective contributions pointing to the same target node are weighted and aggregated to generate the prediction context vector of the next moment. When regenerating the prediction context vector, the newly added historical contribution record entries of the current moment in the buffer are used to ensure that the prediction of the next moment can capture the latest contribution transmission information and achieve synchronous matching between the prediction process and the hydrological contribution transmission process.

[0140] S45. Repeat S41 to S44 until a node prediction state sequence covering all time steps of the preset future period is generated. The node prediction state sequence includes the water level and flow prediction results for the future period.

[0141] Optionally, the preset future time period is a time interval for hydrological forecasting pre-defined by the user. The time step is the smallest time unit for forecasting, and the node prediction state sequence is a set of all future moment node prediction states arranged in time step order, used to fully present the changing trends of hydrological elements in the future time period. Specifically, the total number of time steps in the preset future time period is first obtained and used as the iteration termination condition. During the initial iteration, the latest actual observed state vector is used as the first previous moment state vector to generate the prediction context vector for the first prediction time step. Operations S41 to S44 are executed to obtain the node prediction state for the first future moment. Subsequently, the node prediction state for the first future moment is used as the previous moment state vector to generate the prediction context vector for the second prediction time step. Operations S41 to S44 are executed again to obtain the node prediction state for the second future moment. This logic is repeated iteratively, recording the node prediction state for each future moment after each iteration, until the number of iterations reaches the total number of time steps in the preset future time period, at which point the iteration stops. Finally, all the generated future time node prediction states are arranged in ascending order of time steps to generate a node prediction state sequence covering all time steps of the preset future period. Each element in the sequence contains the water level and flow prediction results for the corresponding time step, fully reflecting the evolution of hydrological elements in the future period.

[0142] In the above embodiments, a gated loop unit is used to achieve iterative updates of the temporal state, and a decoding network is used to generate specific predicted values. Historical contribution information is simultaneously transmitted to support the prediction of the next moment. This embodiment effectively captures the temporal dependencies of hydrological processes, ensuring the continuity and coherence of predictions. The integration of real-time contribution information improves the accuracy of predictions, and the generated future time period prediction results can provide a comprehensive and reliable decision-making basis for flood control scheduling and water resource management.

[0143] The aforementioned hydrological data processing methods, systems, equipment, and media focus on addressing the inherent limitations of mechanistic models and purely data-driven models in hydrological forecasting. First, a spatiotemporal graph structure integrating multi-scale statistical features and multi-type edge features is constructed based on hydrological monitoring time-series data and hydraulic topological relationships. Spatiotemporal feature fusion is achieved through graph neural networks and time-series coding. Then, through relationship-specific vector mapping, spatiotemporal attenuation factor fusion, and mass conservation constraint optimization, the dynamic coupling relationships and weights of elements are accurately quantified. Combined with dynamic lag time, historical contributions are weighted and allocated to generate a prediction context vector. Finally, a gated cyclic unit iteratively updates node states, decodes and generates predicted values, and synchronously transmits contribution information, achieving continuous prediction of water level and flow for future periods. This technical solution effectively integrates the advantages of hydrological physical mechanisms and data-driven approaches, solving the problems of difficult parameter calibration of mechanistic models, the lack of physical support in purely data-driven models (which are essentially black boxes), and weak generalization to extreme events. It improves prediction accuracy and interpretability, providing reliable support for precise flood control scheduling and water resource management.

[0144] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0145] Based on the same inventive concept, this application also provides a system for implementing the hydrological data processing method described above. The solution provided by this system is similar to the solution described in the above method; therefore, the specific limitations in one or more hydrological data processing system embodiments provided below can be found in the limitations of the hydrological data processing method described above, and will not be repeated here.

[0146] In one exemplary embodiment, such as Figure 3 As shown, a hydrological data processing system 10 is provided, comprising:

[0147] The spatiotemporal graph structure construction module 11 is used to construct a spatiotemporal graph structure based on the time-series observation data of each hydrological monitoring station and the hydraulic topological relationship between the stations, and generate graph structure data containing node features and edge features.

[0148] The spatiotemporal feature fusion module 12 is used to perform spatiotemporal feature fusion based on graph structure data to generate node feature vectors; the node feature vectors are used to represent the spatiotemporal context information of the site.

[0149] The dynamic coupling relationship calculation module 13 is used to calculate the dynamic coupling relationship between elements based on the node feature vector, and generate the coupling relationship weight and dynamic lag time.

[0150] The lag contribution allocation module 14 is used to allocate lag contributions based on coupling relationship weights and dynamic lag time, combined with historical contribution records, and generate a prediction context vector.

[0151] The iterative state prediction module 15 is used to perform iterative state prediction based on the prediction context vector to generate water level and flow prediction results for future periods.

[0152] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the hydrological data processing method as described above.

[0153] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the hydrological data processing method as described above.

[0154] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0155] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. A hydrological data processing method, characterized in that, The method includes: S1. Based on the time-series observation data of each hydrological monitoring station and the hydraulic topological relationship between the stations, a spatiotemporal graph structure is constructed to generate graph structure data containing node features and edge features. S2. Based on the graph structure data, perform spatiotemporal feature fusion to generate node feature vectors; the node feature vectors are used to characterize the spatiotemporal context information of the sites. S3. Based on the node feature vector, calculate the dynamic coupling relationship between elements and generate the coupling relationship weight and dynamic lag time; S4. Based on the coupling relationship weights and the dynamic lag time, and combined with historical contribution records, lag contribution allocation is performed to generate a prediction context vector. S5. Based on the predicted context vector, perform iterative state prediction to generate water level and flow prediction results for future time periods.

2. The method according to claim 1, characterized in that, S1 includes: S11. Based on the time-series observation data, extract the multi-scale statistical features of each station and generate a set of station statistical features; S12. The latest value of the time series observation data is fused with the site statistical feature set to generate initial node features; S13. Based on the river network topology extracted by the digital elevation model, establish topological edges between stations with upstream and downstream connections. S14. Based on the hydraulic distance between stations and the correlation with rainfall, establish hydraulic influence edges and meteorological similarity edges; S15. Assign hydraulic attribute features to the topological edges, the hydraulically affected edges, and the meteorologically similar edges to generate an initial edge feature set, and generate the graph structure data based on the initial node features and the initial edge feature set.

3. The method according to claim 1, characterized in that, S3 includes: S21. Based on the predefined coupling relationship type and the node feature vector, generate a relationship-specific query vector and key vector; S22. Calculate the matching degree between the query vector and the key vector, and generate a basic association score; S23. Based on the node feature vector and edge features, estimate the lag time through a neural network and generate the dynamic lag time; S24. Based on the hydraulic distance between stations and the dynamic lag time, calculate the spatial attenuation factor and the time lag factor; S25. The basic correlation score, the spatial attenuation factor, and the time lag factor are fused to generate the original coupling relationship score; the calculation formula for the original coupling relationship score is as follows: Where S is the original score of the coupling relationship. and These are the query vector and the key vector, respectively. For spatial decay kernel function, For hydraulic distance, For time-lag kernel functions, The dynamic lag time; S26. Normalize the original score of the coupling relationship and introduce physical constraints to generate the weight of the coupling relationship.

4. The method according to claim 3, characterized in that, S23 includes: S231. For node pairs that have a coupling relationship, concatenate the node feature vector and the connection edge feature vector of the node pair to generate a combined feature; S232. Input the combined features into a specific feedforward neural network, perform a nonlinear transformation, and output a preliminary lag time estimate. S233. During model training, a smoothness constraint is applied to the preliminary lag time estimates at adjacent time points to generate the dynamic lag time.

5. The method according to claim 3, characterized in that, S26 includes: S261. Normalize the original score of the coupling relationship at the source node dimension to generate initial attention weights; S262. Calculate the mass conservation loss value based on the initial attention weights; the mass conservation loss value is used to constrain the attention weight allocation of the merging nodes to conform to physical laws; the formula for calculating the mass conservation loss value is: in, The loss value due to mass conservation. For the set of confluence nodes, For the confluence node The set of all upstream nodes, upstream node For nodes The initial attention weights; S263. The mass conservation loss value is incorporated into the total loss function of the model for joint optimization to obtain the coupling relationship weights that conform to physical constraints.

6. The method according to claim 1, characterized in that, S4 includes: S31. Read the historical contribution sequence of the source node from the historical contribution record; S32. Based on the dynamic lag time and time lag kernel function, perform a weighted convolution on the historical contribution sequence to generate the current effective contribution; the formula for calculating the current effective contribution is: in, For effective contribution, The dynamic lag time is... For a moment Historical contributions; S33. Based on the coupling relationship weight, all the current effective contributions pointing to the same target node are weighted and aggregated to generate the prediction context vector.

7. The method according to claim 1, characterized in that, S5 includes: S41. Based on the predicted context vector and the node's previous state vector, update the node's current state vector. S42. Based on the node state vector at the current moment, decode and generate the water level prediction value and flow prediction value at the current moment; S43. Merge the current water level prediction value and flow prediction value to generate the node prediction status at the current time, and write the current flow prediction value into the historical contribution record buffer of the downstream related nodes. S44. Use the node prediction state at the current moment as the previous moment state vector for the next moment, and regenerate the prediction context vector for the next moment based on the updated historical contribution record buffer. S45. Repeat S41 to S44 until a node prediction state sequence covering all time steps of a preset future period is generated, wherein the node prediction state sequence includes the water level and flow prediction results for the future period.

8. A hydrological data processing system, characterized in that, The system includes: The spatiotemporal graph structure construction module is used to construct a spatiotemporal graph structure based on the time-series observation data of each hydrological monitoring station and the hydraulic topological relationship between the stations, and generate graph structure data containing node features and edge features; The spatiotemporal feature fusion module is used to perform spatiotemporal feature fusion based on the graph structure data to generate node feature vectors; the node feature vectors are used to characterize the spatiotemporal context information of the stations. The dynamic coupling relationship calculation module is used to calculate the dynamic coupling relationship between elements based on the node feature vector, and generate the coupling relationship weight and dynamic lag time; The lag contribution allocation module is used to allocate lag contributions based on the coupling relationship weights and the dynamic lag time, combined with historical contribution records, and generate a prediction context vector. The iterative state prediction module is used to perform iterative state prediction based on the prediction context vector to generate water level and flow prediction results for future time periods.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.