Method for dynamically predicting open channel flow based on graph neural network
By using a dynamic graph structure and gating control unit based on graph neural networks, the problem of real-time prediction under gate change scenarios using traditional methods and existing deep learning models is solved, enabling rapid and accurate simulation and prediction of open channel flow, thus ensuring water safety in irrigation areas.
Patent Information
- Application Number
- CN202511792104.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies struggle to achieve real-time, accurate simulation and dynamic prediction of open channel flow under scenarios involving gate changes and abnormal responses. Traditional physical models are computationally time-consuming and have poor adaptability. Deep learning methods cannot adaptively update node association weights when topology changes. Single time-series models ignore spatial dependencies and have lagging response mechanisms, failing to meet real-time water safety requirements.
A graph neural network-based approach is adopted to construct a dynamic graph structure to adapt to the topology changes after gate operation. The gating control unit is introduced to adaptively update the flow transmission weights of nodes. Combined with spatiotemporal feature modeling, a real-time response mechanism is designed. Accurate simulation and prediction of the flow of the entire canal system are achieved through a gated graph convolutional network (Gated-GCN).
When gate changes or anomalies occur, it can accurately simulate and predict the flow of the entire canal system within 1 second, meet the needs of real-time scheduling, and provide reliable water safety.
Smart Images

Figure SMS_19 
Figure SMS_20 
Figure SMS_21
Abstract
Description
Technical Field
[0001] This invention relates to the field of interdisciplinary technology of water conservancy engineering and artificial intelligence, specifically to a method for dynamic prediction of open channel flow based on graph neural networks, which is applicable to the refined management of water resources in large and medium-sized irrigation areas and complex canal network systems. Background Technology
[0002] Against the backdrop of global climate change and the development of large-scale and precision agricultural irrigation, open canal systems, as the core carriers of water conveyance in irrigation districts, require stable flow control and real-time monitoring to ensure water security (such as preventing canal overflow and water flow interruption) and improve irrigation efficiency. Open canal flow is significantly affected by dynamic factors such as gate regulation operations, sudden changes in water inflow, and localized siltation. These changes rapidly alter the water flow transmission relationships within the canal system. Failure to obtain the flow distribution of the entire canal system in a timely manner can easily lead to risks such as water waste, canal damage, and even farmland waterlogging. How to quickly achieve accurate simulation and dynamic prediction of open canal system flow under gate operation or abnormal fluctuation scenarios has become a core problem urgently needing to be solved in modern agricultural water management.
[0003] Traditional open channel flow simulation and prediction methods primarily rely on physical models, typically including numerical methods based on Saint-Venant's equations (such as the finite difference method and the finite volume method) and empirical models like Manning's formula. Saint-Venant's equations, by characterizing the continuity and momentum conservation of water flow, can describe the motion of open channel flow at a mechanistic level. However, its solution process involves complex partial differential equation iterations, requiring extremely high accuracy in parameters such as channel roughness and cross-sectional dimensions, and is computationally time-consuming (a single full-channel simulation typically takes several minutes), failing to meet the real-time response requirements under gate changes or abnormal scenarios. While empirical models like Manning's formula are computationally simple, they rely on the ideal assumption of "uniform cross-sections and stable flow." Under dynamic scenarios such as frequent gate adjustments and sudden flow changes, prediction errors can reach over 20%, making it difficult to guarantee water safety. Furthermore, traditional methods are mostly based on fixed channel topology relationships; when gate opening and closing alters the water flow transmission path, the model structure needs to be readjusted, resulting in extremely poor adaptability.
[0004] With the development of data-driven technologies, deep learning methods are increasingly being applied to open channel flow prediction. Long Short-Term Memory (LSTM) networks, with their gated structure, can capture the temporal patterns of flow changes, demonstrating certain advantages in single-section flow prediction. Graph Convolutional Networks (GCNs) can model the spatial relationships between canal system nodes through graph structures, enabling preliminary spatial reasoning of flow across the entire canal system. Compared to traditional physical models, these methods offer improvements in computational efficiency and nonlinear fitting capabilities, and to some extent, adapt to the complex characteristics of open channel flow variations.
[0005] However, existing deep learning methods still have significant limitations when dealing with gate changes and abnormal response scenarios: First, most models use a static canal topology graph structure, which cannot adaptively update the correlation weights between nodes when the opening and closing of gates changes the water flow conduction relationship, resulting in a sharp increase in flow prediction deviation; Second, single time series models (such as LSTM) ignore the spatial conduction dependence between canal nodes and cannot achieve collaborative prediction of the flow of the entire canal system; Third, the response mechanism of existing models is lagging. When faced with gate operation or sudden flow changes, multiple sets of historical data need to be re-inputted for iterative calculation, and it is impossible to output the flow result of the entire canal system within 1 second, making it difficult to support real-time water safety management. Summary of the Invention
[0006] To overcome the above-mentioned shortcomings, this invention proposes a method for dynamic prediction of open channel flow based on graph neural networks. This method adapts to the topological changes after gate operation by constructing a dynamic graph structure and introduces a gating control unit to adaptively update the flow transmission weights of nodes. At the same time, it integrates spatiotemporal feature modeling capabilities, which can complete the accurate simulation and prediction of the flow of the entire canal system within 1 second when gate changes or anomalies occur. This effectively fills the application gap of traditional methods and existing deep learning models in dynamic scenarios, and provides reliable technical support for water safety in irrigation areas.
[0007] This invention combines the spatial feature extraction advantages of graph neural networks to construct an integrated technical system of "spatial modeling-dynamic response," which solves the shortcomings of traditional methods in terms of limited data adaptation, topological correlation characterization, and real-time prediction and protection.
[0008] This method is based on the Gates model of graph convolutional networks (spatial modeling and dynamic response). With gated graph convolutional networks (Gated-GCN) as the core, it achieves full-channel flow prediction under limited data conditions through "local measured flow input + channel topology spatial association + dynamic event gating adjustment". For dynamic scenarios such as gate opening and closing and flow fluctuations, a real-time response mechanism is designed to output the flow distribution of all nodes within 1 second, meeting the needs of real-time scheduling. The core advantage lies in the adaptive adjustment of flow transmission weights by the gating unit and the rapid capture of dynamic events.
[0009] A method for dynamic prediction of open channel flow based on graph neural networks includes the following steps:
[0010] S1: Data Processing
[0011] (1) Definition of canal system structure: Key facilities such as gates, main and branch canal sections, and reservoirs in the canal system are set as nodes. The node attributes include flow rate, water level, gate opening, etc. The water flow connection relationship between nodes is set as edges. The edge weight is determined by parameters such as canal section length, roughness, and water conveyance capacity. A canal system topology diagram that fits the reality is constructed.
[0012] (2) Data input types: Node features: measured flow rate Q, water level H, gate status S, and cross-sectional area A at key cross-sections, where gate status S is 0 = closed / 1 = open; Edge features: channel length L, roughness n, slope i, and cross-sectional shape coefficient f; Dynamic event data: gate opening and closing trigger signal , flow change signal ;
[0013] S2: Preprocessing steps
[0014] (1) Missing value handling: K-nearest neighbor filling is used, and the missing gate status is filled with the previous time value.
[0015] (2) Normalization: Node features Q and H are normalized using Z-score, and edge features L, n, and i are normalized to [0,1] using Min-Max.
[0016] (3) Graph structure construction: Node set V: There are N key sections of the canal system. Edge set E: Canal segments between adjacent nodes, undirected edge adjacency matrix. Nodes i and j are directly connected. =0, not connected;
[0017] (4) Data set partitioning: The training / validation / test sets are divided into 7:1:2 time series. The test set includes three types of dynamic scenarios: gate opening and closing, small-amplitude flow fluctuation, and large-amplitude flow fluctuation.
[0018] (5) Data format output:
[0019] Input tensor: B = batch size, d v =Node feature dimension=4; M = number of edges, d e =Edge feature dimension=4; ;
[0020] Dynamic event input: , , One-hot encoding.
[0021] S3: Model Architecture
[0022] (1) Mathematical definition of graph structure
[0023] Canal system map ,in N is the number of nodes in the canal system; E = {( , )}, the channel section between adjacent nodes; , , which are the flow rate, water level, gate status, and cross-sectional area of node i, respectively; , , respectively, the length, roughness, slope, and shape coefficient of canal segment ij.
[0024] (2) Gating unit formula
[0025] The flow transmission gated unit (FGU) is designed to adaptively adjust the flow transmission weights between nodes, as shown in the following formula:
[0026]
[0027]
[0028]
[0029]
[0030] Update Gate : Controls the fusion ratio of current features and historical features; Reset gate : Controlling the degree to which historical transmission information is retained; candidate transmission features : Node features after gating adjustment; gating weights Final traffic propagation weight, 0≤ ≤1. Wherein, ∈[0,1], 0 = completely discard historical information, 1 = completely retain; ∈[0,1], 0 = prioritize current features, 1 = prioritize historical features; ∈[0,1], the effectiveness of flow transmission from i to j, such as when the gate is closed. →0;
[0031] parameter: , , ∈ , =Gated feature dimension=16; , σ = Sigmoid activation function; ⊙ = element-wise product.
[0032] (3) Gated GCN propagation formula
[0033] Combined with gating weights The spatial feature propagation of traditional GCN is improved, and the formula is as follows:
[0034]
[0035] Where N(i) is the set of adjacent nodes of node i; , , =Output feature dimension=32, GCN layer parameters; , which are residual connection parameters to alleviate oversmoothing; It is the feature of node i after propagation through GCN.
[0036] (4) Dynamic response update formula
[0037] When a gate opening or closing is detected (T_s=1), or a sudden change in flow (T_q=1), a rapid weight update is triggered, as shown in the following formula:
[0038]
[0039]
[0040] Where Δt = 1 second, the dynamic response time step; β = response coefficient, empirical value = 0.8, controlling the update amplitude; The sudden change in traffic at node i; The state of gate j changes as follows: 0 = no change, 1 = open, -1 = closed; The dynamic adjustment factor is δ, which increases as the impact of the event grows. , , Dynamic response layer parameters.
[0041] (5) Flow forecast formula
[0042] Features are mapped to the flow output through a fully connected layer:
[0043]
[0044] in, Let be the predicted flow rate of node i, in m³ / s; , Prediction layer parameters.
[0045] S4: Model Training Process
[0046] (1) Training objectives
[0047] Main objective: Minimize the overall node traffic prediction error while ensuring response accuracy in dynamic scenarios;
[0048] Loss function: Overall base error MSE; + dynamic scenario-weighted loss;
[0049]
[0050]
[0051]
[0052] Where γ = dynamic loss weight; It is a set of nodes affected by dynamic events; = Size of the set.
[0053] (2) Training parameters
[0054] The optimizer uses the Adam optimizer with an initial learning rate of 5e-4, dynamically decaying; a batch size of B=32 to balance training efficiency and memory usage; 200 training epochs with an early stopping strategy; and regularization using Dropout and L2 regularization.
[0055] (3) Phased training strategy
[0056] Pre-training phase: Freeze the dynamic response module and train only the gated GCN and prediction module to learn the spatial correlation features of the canal system.
[0057] Fine-tuning phase: Unfreeze the dynamic response module, add dynamic scene samples, jointly train the entire module, and optimize the accuracy of mutation response.
[0058] (4) Training environment
[0059] Framework: PyTorch + PyTorchGeometric;
[0060] Training duration: Single round of training ≤ 30 seconds, total training duration ≤ 2 hours. Detailed Implementation
[0061] This embodiment provides a method for dynamic prediction of open channel flow based on graph neural networks, which includes the following steps:
[0062] S1: Data Processing
[0063] (1) Definition of canal system structure: Key facilities such as gates, main and branch canal sections, and reservoirs in the canal system are set as nodes. The node attributes include flow rate, water level, gate opening, etc. The water flow connection relationship between nodes is set as edges. The edge weight is determined by parameters such as canal section length, roughness, and water conveyance capacity. A canal system topology diagram that fits the reality is constructed.
[0064] (2) Data input types: Node features: measured flow rate (Q), water level (H), gate status (S, 0=closed / 1=open), cross-sectional area (A) at key cross-sections Edge features: channel length (L), roughness (n), slope (i), cross-sectional shape coefficient (f, such as f=width / height for rectangular channels) Dynamic event data: gate opening and closing trigger signal ( Boolean value), flow change signal ( (Triggered when the rate of change in traffic exceeds the threshold).
[0065] S2: Preprocessing steps
[0066] (1) Missing value handling: K-nearest neighbor filling (based on spatial topological similarity) is used, and the missing gate state is filled with the value of the previous time step.
[0067] (2) Normalization: Node features (Q, H) are normalized using Z-score (to adapt to GCN numerical stability), and edge features (L, n, i) are normalized to [0,1] using Min-Max.
[0068] (3) Graph structure construction: Node set V: N key sections of the canal system (inlet, gate, branch outlet, outlet). Edge set E: Adjacency matrix of undirected edges (bidirectional water flow transmission) between adjacent nodes. (Nodes i and j are directly connected). =0 (not connected).
[0069] (4) Data set partitioning: The training / validation / test sets are divided into 7:1:2 time series. The test set includes 3 types of dynamic scenarios (gate opening and closing, small flow fluctuations, and large flow fluctuations).
[0070] (5) Data format output: Input tensor: (B = batch size, d) v =Node feature dimension=4) (M = number of edges, d) e =Edge feature dimension=4), (Fixed topology, batch sharing); Dynamic event input: ( , (one-hot encoding).
[0071] S3: Model Architecture
[0072] (1) Mathematical definition of graph structure
[0073] Canal system map ,in (N is the number of nodes in the canal system, such as the inlet) , gate Outlet ); E={( , (Ditch segments between adjacent nodes, such as) → Corresponding canal section 1); , (Flow rate, water level, gate status, and cross-sectional area of node i); , (Length, roughness, slope, and shape coefficient of canal segment ij).
[0074] (2) Gating unit formula (flow-specific gating)
[0075] Design a flow transmission gating unit (FGU) to adaptively adjust the flow transmission weights between nodes, as shown in the following formula:
[0076]
[0077]
[0078]
[0079]
[0080] Update Gate : Controls the fusion ratio of current features and historical features; Reset gate : Controlling the degree to which historical transmission information is retained; candidate transmission features : Node features after gating adjustment; gating weights Final traffic propagation weight (0≤ ≤1, the larger the value, the more efficient the conduction. ∈[0,1] (0 = completely discard historical information, 1 = completely retain it); ∈[0,1] (0 = prioritize current features, 1 = prioritize historical features); ∈[0,1] (the effectiveness of flow transmission from i to j, such as when the gate is closed) →0)
[0081] parameter: , , ∈ ( =Gated feature dimension=16); , σ = Sigmoid activation function; ⊙ = element-wise product.
[0082] (3) Gated GCN propagation formula
[0083] Combined with gating weights The spatial feature propagation of traditional GCN is improved, and the formula is as follows:
[0084]
[0085] Where N(i) is the set of adjacent nodes of node i (such as the upstream and downstream nodes of gate i). , ( =Output feature dimension=32, GCN layer parameters); (Residual connection parameters to mitigate oversmoothing); It is the feature of node i after propagation through GCN (integrating the traffic information of adjacent nodes).
[0086] (4) Dynamic response update formula
[0087] When a gate opening or closing (T_s=1) or a sudden change in flow (T_q=1) is detected, a rapid weight update is triggered, as shown in the following formula:
[0088]
[0089]
[0090] Where Δt = 1 second (dynamic response time step), β = response coefficient (empirical value = 0.8, controlling the update amplitude); (The sudden change in traffic at node i); (The state of gate j changes: 0 = no change, 1 = open, -1 = closed). (Dynamic adjustment factor; the greater the impact of the event, the larger δ becomes) , (Dynamic response layer parameters).
[0091] (5) Flow forecast formula
[0092] Features are mapped to the flow output through a fully connected layer:
[0093]
[0094] in, It is the predicted flow rate (m³ / s) of node i. , (Prediction layer parameters).
[0095] S4: Model Training Process
[0096] (1) Training objectives
[0097] Main objective: Minimize the overall node traffic prediction error while maintaining response accuracy in dynamic scenarios.
[0098] Loss function: Combined MSE (baseline error) + dynamic scenario-weighted loss (enhanced event response)
[0099]
[0100]
[0101]
[0102] Where γ = dynamic loss weight (empirical value = 1.5); It is a set of nodes affected by dynamic events; = Size of the set.
[0103] (2) Training parameters
[0104] The optimizer uses the Adam optimizer with an initial learning rate of 5e-4 and dynamic decay (the validation set error decays to 1 / 10 after 10 epochs). The batch size B is 32 to balance training efficiency and memory usage. The number of training epochs is 200, with an early stopping strategy (the validation set error stops after 30 epochs if it does not decrease). Regularization includes Dropout (probability = 0.1, only for GCN layers) and L2 regularization (weight decay = 1e-6).
[0105] (3) Phased training strategy
[0106] Pre-training phase (rounds 1-100): Freeze the dynamic response module and train only the gated GCN and prediction module to learn the spatial correlation features of the canal system.
[0107] Fine-tuning phase (rounds 101-200): Unfreeze the dynamic response module, add dynamic scene samples, jointly train the entire module, and optimize the accuracy of mutation response.
[0108] (4) Training environment
[0109] Framework: PyTorch + PyTorchGeometric (Graph Data Processing)
[0110] Training duration: Single training session ≤ 30 seconds, total training duration ≤ 2 hours (to ensure project feasibility).
[0111] S5: Model Validation Process
[0112] (1) Design of validation dataset
[0113] Basic scenario: No dynamic events, only input of 10% of the measured flow rate of key nodes (inlet, main gate).
[0114] Dynamic Scenario 1: Gate opening and closing (randomly select 3 gates and simulate opening / closing operations with an interval of 30 seconds).
[0115] Dynamic Scenario 2: Small flow fluctuations (inlet flow rate ±10% sudden change, lasting 60 seconds).
[0116] Dynamic Scenario 3: Large flow fluctuations (abrupt changes in inlet flow rate of ±30%, lasting for 60 seconds).
[0117] Data size: The test set has a total of 1000 time steps (500 basic steps + 500 dynamic steps).
[0118] (2) Evaluation indicators
[0119] Mean Absolute Error (MAE), target value ≤ 0.05 m³ / s, formula:
[0120]
[0121] Mean Absolute Percentage Error (MAPE), relative error can reflect prediction accuracy, target value ≤5%, formula:
[0122]
[0123] Nash efficiency coefficient (NSE), goodness of fit, the closer to 1 the better, target value ≥ 0.90, formula:
[0124]
[0125] Dynamic response time, i.e., the time from event triggering to outputting the prediction result, aims to be within 1 second; Fluctuation response error (FRE), with a target value ≤ 0.10 m³ / s, is calculated using the formula:
[0126]
[0127] (3) Ablation Experiment Design
[0128] To verify the effectiveness of the core module, three sets of comparative experiments were set up: baseline model: traditional GCN (no gating + no dynamic response); gated GCN only (gating + no dynamic response); complete model (gated GCN + dynamic response).
[0129] Comparison metrics: MAE, MAPE, NSE, dynamic response time, FRE.
[0130] (4) Verification process
[0131] Offline verification: Calculate the above indicators on the test set and compare the results of the ablation experiment.
[0132] Online verification: Build a real-time testing platform to simulate the operation of the canal system (input actual flow rate + dynamic events) and record response time and prediction error.
[0133] Stability verification: Run continuously for 24 hours and monitor the fluctuation of the model output (standard deviation ≤ 0.02m³ / s).
[0134] S6: Key Design of Dynamic Response Mechanism
[0135] (1) Sudden signal detection unit
[0136] Flow change detection: Calculate the flow change rate ΔQ / Δt between adjacent time steps, and trigger T when it > 0.05 m³ / s・s. q =1.
[0137] Gate status detection: Monitors changes in gate status S ( T is triggered when ) s =1.
[0138] Detection time: ≤0.1 seconds (based on simple threshold judgment, without complex calculation).
[0139] (2) Fast weight update strategy
[0140] Event impact range determination: Based on the adjacency matrix, mark the first and second order adjacent nodes of the event node as the affected nodes.
[0141] Weight update priority: The gating weights of nodes that are affected are updated first, while the weights of nodes that are not affected are kept as they were (to reduce the amount of computation).
[0142] Update time: ≤0.3 seconds (only some node weights are updated, no need to recalculate the entire graph).
[0143] (3) Real-time guarantee
[0144] Lightweight model: Total number of parameters ≤ 1M, computational cost per forward propagation ≤ 1e6FLOPs.
[0145] Hardware compatibility: Supports real-time CPU operation without relying on high-end GPUs.
[0146] Parallel computing: Feature extraction and dynamic detection are performed in parallel, with a total time of ≤1 second.
[0147] S7: Environment Deployment
[0148] (1) Hardware selection
[0149] Edge computing devices: Select industrial-grade edge gateways (such as NVIDIA Jetson Nano or Intel Atom series), which must meet the following requirements: CPU computing power ≥ 40 GFLOPS, memory ≥ 4GB, storage ≥ 32GB, and support IP65 protection level to adapt to the outdoor environment of irrigation areas.
[0150] Sensor integration: Connect flow sensors (such as ultrasonic flow meters) and gate position sensors (such as magnetostrictive displacement sensors) at key nodes of the canal system, and collect data in real time via RS485 / Modbus protocol, with the sampling frequency set to 1Hz.
[0151] (2) Software environment configuration
[0152] Operating System: Install a Linux embedded system and configure real-time kernel patches to ensure deterministic task scheduling.
[0153] Runtime environment: Deploy the PyTorchLite inference framework, generate a lightweight inference engine based on the model quantization results, and keep memory usage within 1GB.
[0154] (3) Model pruning and quantization
[0155] Channel pruning: The convolutional layers of the gated GCN are structurally pruned to remove feature channels with a contribution of less than 5%, reducing the number of parameters by 30%.
[0156] INT8 quantization: Quantizes model weights and activation values from floating-point to 8-bit integers, increasing inference speed by 2 times while keeping accuracy loss within 0.5%.
[0157] (4) Service-oriented encapsulation
[0158] Using Docker container technology, the model inference, data acquisition, and dynamic response modules are encapsulated as microservices, and prediction interfaces are provided to the outside world through RESTful API.
Claims
1. A method for open channel flow dynamic prediction based on graph neural network, characterized in that, Comprising the following steps: S1: data processing (1) Channel system graph structure definition: set the key facilities in the channel system as nodes; set the water flow connection relationship between nodes as edges to construct a practical channel system topology graph; (2) Data input type: node characteristics, edge characteristics, dynamic event data; S2: preprocessing step Preprocessing, dividing the data set into training, validation and test sets; S3: build model architecture, including: (1) Mathematical definition of graph structure (2) Gating unit formula (3) Gating GCN propagation formula (4) Dynamic response update formula (5) Flow prediction formula Gates model based on graph convolution network, taking gated graph convolution network as the core, through local measured flow input, channel topology space correlation and dynamic event gating adjustment, realizing full channel flow prediction under the condition of less data; S4: model training Training by adopting a phased training strategy, including a pre-training phase and a fine-tuning phase.
2. The method of claim 1, wherein, The specific method of step S1 is: (1) Channel system graph structure definition: set the key facilities in the channel system as nodes, including the flow, water level, gate opening of the nodes; set the water flow connection relationship between nodes as edges, and the edge weight is determined by the length of the channel section, roughness and water conveying capacity parameters, to construct a practical channel system topology graph; (2) Data input type: node characteristics: measured flow Q, water level H, gate state S, cross-section area A, among which the gate state S, 0=close / 1=open; Side features: length of channel section L, roughness n, slope i, cross-section shape coefficient f; dynamic event data: gate opening and closing trigger signal , flow mutation signal .
3. The method of claim 1, wherein, The specific method of S2 is: (1) Missing value processing: K-nearest neighbor filling, missing gate state is completed by the previous time value; (2) Normalization: node characteristics Q, H are normalized by Z-score, and edge characteristics L, n, i are normalized to [0,1] by Min-Max; (3) Graph structure construction: node set V: N canal key section; edge set E: adjacent nodes between the canal section, undirected edge adjacency matrix , node i, j directly connected, = 0, not connected; (4) Data set division: divide the training / validation / test set according to the time sequence 7:1:2, and the test set contains 3 types of dynamic scenarios, i.e. gate opening and closing, small amplitude flow fluctuation, and large amplitude flow fluctuation; (5) Data format output: Input tensors: , B = batch size, d v = node feature dimension = 4; , M = number of edges, d e = edge feature dimension = 4; ; Dynamic event input: , , one-hot encoding.
4. The method of claim 1, wherein, S3 specifically includes: (1) Mathematical definition of graph structure Channel system diagram where N is the number of channel nodes; E={( , )} is the channel section between adjacent nodes; , Qi, hi, gi, Ai are the flow, water level, gate status, cross-sectional area of node i, respectively; , Li, ni, gi, ki are the length, roughness, slope, shape coefficient of channel section ij, respectively; (2) Gating unit formula Design flow conduction gate FGU to adaptively adjust the flow transmission weight between nodes, the formula is as follows: ; ; ; ; Updating gate : control the fusion ratio of current features and historical features; reset gate : control the degree of preservation of history conduction information; candidate conduction feature : fuse the node features adjusted by the gating Gating weights : final flow conductance weight, 0≤ ≤1; where, ∈[0,1], 0 = completely discard history information, 1 = completely retain; ∈[0,1], 0 = prioritize current features, 1 = prioritize history features; ∈[0,1], conductance effectiveness of flow from i to j, as gate closes → 0; Parameters: , , ∈ , = gating feature dimension = 16; , ; σ = Sigmoid activation function; ⊙ = element-wise product; (3) Gating GCN propagation formula Gating weights , which improves the spatial feature propagation of traditional GCN, is as follows: ; where N(i) is the set of neighboring nodes of node i; 、 , = output feature dimension = 32, GCN layer parameters; , are residual connection parameters, mitigating over-smoothing; is the feature of node i after GCN propagation; (4) Dynamic response update formula When detecting gate opening and closing, i.e. T_s=1, or flow mutation, i.e. T_q=1, trigger weight rapid update, the formula is as follows: ; ; Where, Δt = 1 second, dynamic response time step; β = response coefficient, empirical value = 0.8, control update amplitude; , the flow mutation value of node i; , the state change of gate j, 0 = no change, 1 = open, -1 = close; , dynamic adjustment factor, the greater the event influence, the greater the δ; 、 , dynamic response layer parameters; (5) Flow prediction formula Map the characteristics to the flow output through the fully connected layer: ; wherein is the predicted flow of node i, m3 / s; , , predicted layer parameters.
5. The method of claim 1, wherein, The model training process of S4 is specifically: (1) Training target Main target: minimize the full node flow prediction error, and consider the response accuracy under dynamic scenarios; Loss function: comprehensive basic error MSE; + dynamic scenario weighted loss; ; ; ; where γ = dynamic loss weight; is the set of nodes affected by the dynamic event; = size of the set (2) Training parameters Optimizer: Adam optimizer, initial learning rate=5e-4, dynamic decay; batch size B=32, balance training efficiency and memory occupation; training rounds=200 rounds, early stopping strategy; regularization: Dropout, L2 regularization; (3) Phased training strategy Pre-training phase: freeze the dynamic response module, only train the gating GCN and prediction module, and learn the channel space correlation characteristics; Fine-tuning stage: unfreeze dynamic response module, add dynamic scene samples, jointly train the whole module, and optimize the mutation response accuracy; (4) Training environment Framework: PyTorch + PyTorchGeometric; Training duration: single round of training ≤ 30 seconds, total training duration ≤ 2 hours.