Training method of channel gate flow prediction model
By constructing a multi-scale canal system topology map and explicit propagation training, a canal-pool gate flow prediction model is generated, which solves the problem of topology propagation and conservation consistency in the canal system and improves the stability and accuracy of canal-pool gate flow prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU UNIVERSITY OF TECHNOLOGY
- Filing Date
- 2026-02-03
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies struggle to simultaneously satisfy topology propagation and conservation consistency in complex canal systems, resulting in insufficient predictive stability and portability of canal and pool gate flow forecasts.
A multi-scale canal system topology map is constructed, a multi-scale canal system map structure dataset is generated, and a canal pool gate flow prediction model is generated through symmetric message passing training with explicit transmission of conserved information and latent time advancement training.
It improves the ability to characterize cross-node dependencies and the prediction accuracy of canal and pool gate flow prediction, while optimizing the conservation consistency and interpretability of the prediction model.
Smart Images

Figure CN121614875B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water conservancy prediction technology, and in particular to a training method for a canal, pool, and gate flow prediction model. Background Technology
[0002] With the development of information technology and refined water allocation scheduling in irrigation districts, online data collection of joint operation data of canals, pools and gates is gradually being realized. Conventional methods usually use gate opening, upstream and downstream water levels, flow meter readings, canal and pool water levels, and water intake and discharge measurements to form time series samples. These samples are then combined with external influencing factors such as weather, date type, water use plan, and pump station operating status for time alignment and feature organization. Under a unified sampling interval, sequence learning or graph structure learning is used to predict gate flow to support rolling scheduling and water balance accounting.
[0003] Existing technologies often struggle to simultaneously satisfy structural representation and physical consistency in complex canal systems. On the one hand, when densely distributed canal sections with interconnected gates coexist, single-scale topology struggles to account for both local fine-grained disturbances and global connectivity propagation, making predictions sensitive to topological changes and cross-scale dependencies. On the other hand, if the spatiotemporal writing of influencing factors and boundary source terms is not strictly aligned with the conservation unit fields, it can easily lead to the aliasing of source terms and flux information, resulting in a lack of interpretable residual decomposition under conservation constraints during the training process, thus affecting prediction stability and transferability. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a training method for the gate flow prediction model in a canal system to solve the problem that gate flow prediction under multi-scale canal structures is difficult to balance topology propagation and conservation consistency.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] This invention provides a training method for a channel pool gate flow prediction model, which includes,
[0008] Construct a multi-scale canal system topology map and establish a set of conserved element descriptions for each canal pool node to generate a multi-scale canal system map structure dataset;
[0009] Based on the multi-scale canal system diagram structure dataset, the operation sequence data of gates and canal pools were collected and the influencing factors and boundary source terms were aligned to obtain the spatiotemporal sample pool dataset;
[0010] Perform symmetric message-passing training with explicit transfer of conserved information and latent time-progression training on the spatiotemporal sample pool dataset, update the network parameters, and generate the target model parameter set;
[0011] The target model parameter set is assembled with the multi-scale canal system diagram structure dataset and consistency verification is performed to generate a canal pool gate flow prediction model.
[0012] As a preferred embodiment of the training method for the canal-pool gate flow prediction model of the present invention, the specific steps for constructing the multi-scale canal system topology map are as follows:
[0013] Read the list of canals and pools, the list of gates, and the connection relationships of canal segments, mark the direction of water flow, and generate a set of directed edges;
[0014] Define each canal / pool entry in the canal / pool list as a canal / pool node, and define each gate entry in the gate list as a gate node;
[0015] Pair the canal and pool nodes, gate nodes, and directed edge sets to generate the original directed graph;
[0016] Based on the distribution density of the water distribution outlets, densely populated sections are identified, and node subdivisions are performed in adjacent canal sections to generate local detailed maps;
[0017] Grouping of canal sections and merging of adjacent canal pools and linked gates generates a coarse-grained convergence map;
[0018] By summarizing the original directed graph, the locally refined graph, and the coarse-grained convergence graph and establishing node mapping relationships, a multi-scale canal system topology graph is generated.
[0019] As a preferred embodiment of the training method for the canal-pool gate flow prediction model described in this invention, the specific steps for generating the multi-scale canal system map structure dataset are as follows:
[0020] Based on the multi-scale canal system topology map, the inflow gate set and outflow gate set are determined for each canal pool node, and the water intake set, water outlet set, water level measuring point set and geometric element fields are registered, and the conservation element description set is obtained by summarizing them.
[0021] The propagation delay of each directed edge is calculated based on the channel length and real-time flow velocity and converted into a discrete time step sequence to generate a propagation lag sequence.
[0022] By encapsulating the conserved element description set, node mapping relationship, directed edge set, and propagation lag sequence, a multi-scale canal graph structure dataset is obtained.
[0023] As a preferred embodiment of the training method for the canal-pool gate flow prediction model described in this invention, the specific steps for collecting gate and canal-pool operation sequence data based on a multi-scale canal system diagram structure dataset are as follows:
[0024] Based on the multi-scale canal system diagram structure dataset, gate node identifiers and canal pool node identifiers are extracted. Gate opening, upstream and downstream water levels and flow meter readings are collected and summarized into gate observation sequence. Canal pool water level and intake and discharge water metering are collected and summarized into canal pool observation sequence.
[0025] Perform unified sampling interval resetting and time stamp alignment on the gate observation sequence and the canal pool observation sequence to generate an aligned observation sequence.
[0026] As a preferred embodiment of the training method for the channel and pool gate flow prediction model of the present invention, the specific steps for obtaining the spatiotemporal sample pool dataset are as follows:
[0027] Weather, date type, water use plan and pump station operation status are defined as influencing factors, and upstream water inflow process, water intake and discharge of canals and pools are defined as boundary source terms;
[0028] Influencing factors are written into the aligned observation sequence according to the shared fields of the entire network, and boundary source items are written into the aligned observation sequence according to the water intake set and the water discharge set.
[0029] The written results are processed by missing data completion, outlier removal, and dimensional unification. The results are then merged with the aligned observation sequences to obtain the spatiotemporal sample pool dataset.
[0030] As a preferred embodiment of the training method for the channel and pool gate flow prediction model of the present invention, the specific steps of performing symmetric message passing training with explicit transfer of conserved information on the spatiotemporal sample pool dataset are as follows:
[0031] A set of directed edges is extracted from the multi-scale channel graph structure dataset, and a flux message slot and a source item message slot are established for each directed edge;
[0032] Calculate the gate outflow change segment at the gate node and write it into the corresponding outflow flux message slot. Calculate the water intake and discharge change segments at the channel / pool node and write them into the source term message slot corresponding to the conservation element description set to obtain the flux message set and the source term message set.
[0033] At each canal node, the incoming and outgoing flow messages are collected and arranged in parallel with the source message set to form a conserved message pair.
[0034] Perform symmetry constraint aggregation on the conserved message pairs to generate conserved node message features;
[0035] The conserved node message features are backfilled along the node mapping relationship and cross-scale consistent fusion is completed to generate a batch of conserved features for training iteration.
[0036] As a preferred embodiment of the training method for the channel and pool gate flow prediction model of the present invention, the latent time-progression training specifically includes the following steps.
[0037] Embedding encoding is performed on batches of conserved features to generate a sequence of latent features for nodes;
[0038] The propagation sequence across nodes is determined according to the propagation lag sequence, and the propagation step size of the same node is determined to generate the propagation configuration.
[0039] Based on the advance configuration, first advance the flux-related potential features along the directed edge and write them into the flux receiving position of the downstream node, then merge the source term-related potential features at the channel pool node and write them into the source term receiving position to generate a multi-step potential prediction sequence.
[0040] Perform gated readout mapping on multi-step potential prediction sequences to generate a set of prediction sequences;
[0041] Perform single-step convergence training on the predicted sequence set and output the single-step convergence parameters;
[0042] Perform multi-step unpacking training on the predicted sequence set using single-step convergence parameters, and output multi-step unpacking parameters;
[0043] The single-step convergence parameters and multi-step expansion parameters are merged to generate a time-progressive training parameter set.
[0044] As a preferred embodiment of the training method for the channel and pool gate flow prediction model of the present invention, the specific steps for generating the target model parameter set are as follows:
[0045] Labeled traffic sequences are extracted from the spatiotemporal sample pool dataset to form a label sequence set, and the fitting error between the predicted sequence set and the label sequence set is calculated to form an error record;
[0046] The flow difference between the inflow gate set and the outflow gate set is statistically analyzed for each channel and pool in the conservation element description set, and the boundary source term and channel and pool water level changes are integrated to form a conservation residual record;
[0047] The training loss record is obtained by summarizing the error record and the conserved residual record. Then, the network parameters are updated by performing gradient descent based on the training loss record and archived to generate the target model parameter set.
[0048] As a preferred embodiment of the training method for the canal and pool gate flow prediction model of the present invention, the specific steps for generating the canal and pool gate flow prediction model are as follows:
[0049] Establish network structure instances and write them into a multi-scale canal graph structure dataset, including node mapping relationships, directed edge sets, and propagation lag sequences;
[0050] Load the target model parameter set into the network structure instance and complete the parameter loading;
[0051] On the network structure instance with completed parameter loading, perform forward computation on the validation subset of the spatiotemporal sample pool dataset to generate a validation prediction sequence, and perform node mapping consistency check and output dimension consistency check on the validation prediction sequence.
[0052] When the verification meets the consistency condition, the network structure instance is encapsulated to generate the channel and pool gate flow prediction model.
[0053] As a preferred embodiment of the training method for the channel and pool gate flow prediction model of the present invention, the specific steps of performing symmetry constraint aggregation on the conserved message pairs are as follows:
[0054] For each canal node, the incoming and outgoing flow messages are counted, and the conserved difference is calculated to form a difference message set;
[0055] The differential message set and the source message set are aligned according to the field order of the conserved feature description set and then symmetrically aggregated to generate conserved node message features.
[0056] The beneficial effects of this invention are as follows: By constructing a three-layer structure of the original directed graph, the locally refined graph, and the coarse-grained convergence graph and establishing node mapping relationships, the multi-scale canal system topology graph can simultaneously express the local disturbances in densely populated sections of the water diversion channel and the global coupling of the linkage gate control. The propagation lag sequence further makes the time delay propagation caused by the channel length and real-time flow velocity explicit, thereby improving the ability to characterize cross-node dependencies. By writing the upstream water inflow process and the water intake / return volume of the canal pool as boundary source terms into the aligned observation sequence according to the water intake set and the water return set, the sample organization has consistent field semantics and reusable input specifications. By constructing conservation message pairs through the flux message set and the source term message set and performing symmetry constraint aggregation, the fitting error and conservation residual are used as the only decomposition terms of the training loss record, which promotes the updating of network parameters while optimizing prediction accuracy and conservation consistency. Attached Figure Description
[0057] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 The flowchart shows the training method for the flow prediction model of the canal pool gate.
[0059] Figure 2 This is a flowchart of the data acquisition and preprocessing process.
[0060] Figure 3 Flowchart for training message passing to conserve energy.
[0061] Figure 4 Flowchart for training convergence judgment. Detailed Implementation
[0062] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0063] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0064] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0065] Reference Figures 1-4 As one embodiment of the present invention, this embodiment provides a training method for a channel pool gate flow prediction model, comprising the following steps:
[0066] S1. Construct a multi-scale canal system topology map and establish a set of conserved element descriptions for each canal pool node to generate a multi-scale canal system map structure dataset.
[0067] S1.1. Read the list of canals and pools, the list of gates, and the connection relationships of canal segments from the canal system topology ledger. The list of canals and pools shall at least include the field of canal and pool identifier and the field of canal and pool spatial location. The list of gates shall at least include the field of gate identifier and the field of ...
[0068] Each entry in the canal and pool list is defined as a canal and pool node, and each entry in the gate list is defined as a gate node. Endpoint parsing is performed on each directed edge set. The starting node identifier and the ending node identifier are matched with the canal and pool node identifier table to locate the canal and pool node. Then, the canal segment identifier in the gate list is matched with the canal segment identifier in the directed edge set to locate the edge where the gate node is located. In the original directed graph, the gate node is inserted into the connection sequence of the corresponding directed edge to form the connection relationship of "starting canal and pool node - gate node - ending canal and pool node". The pairing of canal and pool nodes, gate nodes and directed edge sets is completed, and the original directed graph containing the node set and edge set is generated.
[0069] S1.2. Extract the locations of water inlets within the channel segments covered by the original directed graph, and assign the locations of water inlets to adjacent channel segments according to their spatial adjacency, forming dense segment identification units; count the number of water inlets and the length of the covered channel segments for each dense segment identification unit, and calculate the distribution density of water inlets; after identifying dense segments based on the distribution density of water inlets, subdivide the nodes in the adjacent channel segments corresponding to the dense segments, so that the adjacent channel segments are split into multiple segments and new nodes are generated. The new nodes are written into the node set in the form of channel-pool nodes and the directed edge set is updated synchronously to obtain a local refined graph.
[0070] To further explain, the expression for calculating the distribution density at the water divider is:
[0071] ;
[0072] in, It represents the distribution density of water outlets and is used as a discriminant to identify densely populated sections; This indicates the number of water outlets within a densely populated section identification unit, used to characterize the degree of water outlet aggregation; This represents the sum of the lengths of the canal segments covered by the dense segment identification unit, used to eliminate the influence of length differences on distribution judgment.
[0073] S1.3. Perform channel segment grouping on the updated directed edge set. Channel segment grouping is constrained by the set of linkage gate identifiers in the gate list. Adjacent channel pool nodes that share the same set of linkage gate identifiers and are reachable on the original directed graph are grouped into the same group. Adjacent channel pool nodes and linkage gate nodes within the group are merged into convergence nodes. At the same time, the directed edge set relationships between convergence nodes are merged to form a coarse-grained convergence graph.
[0074] By summarizing the original directed graph, the locally refined graph, and the coarse-grained convergence graph, the correspondence between nodes in the original directed graph and nodes in the locally refined graph, and the correspondence between nodes in the original directed graph and convergence nodes in the coarse-grained convergence graph are established. The correspondence is recorded in the form of node mapping relationship, and a multi-scale canal system topology map is generated.
[0075] Based on the multi-scale canal system topology map, the inflow gate set and outflow gate set are determined for each canal pool node, and the intake port set, drainage port set, water level measuring point set and geometric element field are registered. The geometric element field includes the effective water surface area and cross-sectional parameters of the canal pool. The inflow gate set, outflow gate set, intake port set, drainage port set, water level measuring point set and geometric element field are summarized one by one according to the canal pool node to generate a conserved element description set.
[0076] Based on the channel segment length field and real-time flow velocity in the directed edge set, the propagation delay of each directed edge is calculated, and the propagation delay is converted into a discrete time step sequence to obtain the propagation lag sequence. The real-time flow velocity is obtained by collecting flow velocity data from channel segment velocity measurement points, or by calculating the water level time series and cross-sectional parameters from the water level measurement point set (the water level gradient of the channel segment is determined based on the water level difference between adjacent sampling times under a unified sampling interval of the water level measurement point set, and the flow velocity of the channel segment at the current sampling time is calculated by combining the cross-sectional parameters as the real-time flow velocity). When the real-time flow velocity is missing or abnormal, the historical average flow velocity is used to replace the real-time flow velocity to complete the propagation delay calculation.
[0077] To further explain, the expression for calculating the propagation delay is:
[0078] , ;
[0079] in, It represents the propagation delay, which characterizes the time required for water flow to propagate along a directed edge; The field representing the channel segment length corresponding to the directed edge indicates the propagation distance. This indicates the flow velocity under the current operating conditions and is used to characterize the real-time propagation speed. When the real-time flow velocity is available, the real-time flow velocity is used; when the real-time flow velocity is missing or abnormal, the historical average flow velocity is used. This represents a uniform sampling interval, used to convert continuous time into discrete time steps; This represents the number of discrete time steps, used to construct time step entries in the propagation lag sequence; This indicates the floor function, used to ensure that the discrete time step covers the propagation delay.
[0080] By encapsulating the conserved element description set, node mapping relationship, directed edge set, and propagation lag sequence, a multi-scale canal graph structure dataset is obtained.
[0081] S2. Based on the multi-scale canal system diagram structure dataset, collect the timing data of gate and canal pool operation and align the influencing factors and boundary source terms to obtain the spatiotemporal sample pool dataset.
[0082] S2.1. Extract gate node identifiers and canal / pool node identifiers from the multi-scale canal system diagram structure dataset, and establish a gate observation field table according to the gate node identifiers. The gate observation field table includes a gate opening field, an upstream water level field, a downstream water level field, and a flow meter reading field. Establish a canal / pool observation field table according to the canal / pool node identifiers. The canal / pool observation field table includes a canal / pool water level field and an intake / exhaust water metering field. Collect gate opening observation sequences, upstream and downstream water level observation sequences, and flow meter reading observation sequences for each gate node identifier according to the gate observation field table, and summarize them into a gate observation sequence. Collect canal / pool water level observation sequences and intake / exhaust water metering observation sequences for each canal / pool node identifier according to the canal / pool observation field table, and summarize them into a canal / pool observation sequence.
[0083] S2.2. Perform unified sampling interval re-alignment and time stamp alignment on the gate observation sequence and the canal / pool observation sequence. The re-alignment process generates a unified time axis according to the unified sampling interval, and maps the observation point times of the gate observation sequence and the canal / pool observation sequence to the most recent sampling time of the unified time axis to complete the time stamp alignment and generate an aligned observation sequence. In the aligned observation sequence, establish an observation record row arranged according to the unified time axis for each gate node identifier and canal / pool node identifier. The observation record row records the set of observation values of the corresponding node identifier at each sampling time.
[0084] To further explain, the time stamp alignment of the aligned observation sequences can be expressed by the following formula:
[0085] , ;
[0086] in, Indicates the original observation time in the gate observation sequence or canal / pool observation sequence; Indicates the start time of the unified timeline; Represents the first on the unified timeline Each sampling time; This indicates rounding operations, used to map the original observation time to the most recent sampling time and complete time stamp alignment.
[0087] S2.3. Extract weather, date type, water use plan, and pump station operation status from meteorological observation logs, dispatch calendar logs, and water use plan logs, and define them as influencing factors. Among these, weather and date type, as influencing factors, have consistent values for all gate node identifiers and canal / pool node identifiers on a unified time axis. Similarly, water use plan and pump station operation status, as influencing factors, have consistent values for multiple gate node identifiers and canal / pool node identifiers according to dispatch zones on a unified time axis. Then, write weather, date type, water use plan, and pump station operation status as shared fields across the entire network into the aligned observation sequence. A segment represents a set of fields that are independent of specific gate node identifiers or canal / pool node identifiers on a unified time axis and directly reuse the same set of time series values across the entire canal system. The upstream inflow process is extracted from the upstream inflow ledger and defined as a boundary source item. The drainage measurement is extracted from the aligned observation sequence and defined as a boundary source item for canal / pool water intake and drainage. The upstream inflow process, canal / pool water intake and drainage are written into the aligned observation sequence according to the water intake set and drainage set, thus obtaining an aligned writing result containing gate observation fields, canal / pool observation fields, influencing factor fields and boundary source item fields.
[0088] S2.4. Perform missing completion, outlier removal, and dimension unification on the aligned write results.
[0089] Among them, missing data completion refers to filling in missing sampling moments in time segments according to a unified time axis: when the missing sampling moment falls within the irrigation flow period, if the missing duration does not exceed a preset multiple of the unified sampling interval, linear interpolation is used to maintain the continuity of flow changes; if the missing duration exceeds a preset multiple of the unified sampling interval, forward filling is used to avoid false flow fluctuations caused by interpolation; when the missing sampling moment falls within the non-irrigation period, forward filling is used, and when the corresponding field is flow or gate opening, the principle of maintaining the previous steady-state value is followed to avoid introducing non-physical disturbances; the irrigation flow period and the non-irrigation period are determined by the water intake plan ledger of the water intake set, the gate control command record, or the status indicator of the flow field, and the preset multiple of the unified sampling interval is determined based on the channel regulation response time scale and historical sampling stability.
[0090] Outlier removal refers to removing abrupt changes based on the continuity of the time series and the physical effective range of the aligned writing results, while retaining the removal record. The physical effective range is jointly determined by the upper and lower limits of the sensor range corresponding to the field, the feasible value range under the constraints of the channel and pool geometric element fields and cross-sectional parameters, and the statistical distribution of the historical aligned observation sequence. Jump values that exceed hydraulic accessibility are identified as abrupt changes by constraining the rate of change and direction of change of adjacent sampling times. The removal record includes at least the field identifier, timestamp, original value, removal reason, and replacement method identifier.
[0091] Dimension unification refers to converting fields with different dimensions in the alignment results into a consistent dimension representation according to the field dimension specification, and then merging the alignment results with the aligned observation sequences after missing data completion, outlier removal and dimension unification to generate a spatiotemporal sample pool dataset.
[0092] S3. Perform symmetric message passing training with explicit transfer of conserved information and latent time-progression training on the spatiotemporal sample pool dataset, update the network parameters, and generate the target model parameter set.
[0093] S3.1. Extract the directed edge set, node mapping relationship and propagation lag sequence from the multi-scale canal system graph structure dataset, and extract the aligned observation sequence, influencing factor field and boundary source term field from the spatiotemporal sample pool dataset, and align them according to a unified time axis to form a training batch list; for each time slice in the training batch list, establish flux message slots for each edge of the directed edge set, and establish source term message slots for each canal pool of the conserved element description set, to obtain the message slot configuration.
[0094] Based on the message slot configuration, the gate outflow change segment is calculated on the aligned observation sequence corresponding to the gate node identifier and written into the corresponding outgoing flux message slot. The gate outflow change segment is obtained by the difference between the flow meter readings at adjacent sampling times. Based on the message slot configuration, the boundary source term fields of the canal and pool water intake and discharge volume are extracted on the aligned observation sequence corresponding to the canal and pool node identifier to form water intake and discharge change segments. The water intake and discharge change segments are written into the source term message slots in the order of the water intake set and the discharge set in the conservation element description set to obtain the flux message set and the source term message set.
[0095] To further explain, the expression for calculating the change segment of the gate outflow is:
[0096] ;
[0097] in, Indicates the unified timeline The gate outflow change corresponding to each sampling time is used to construct a gate outflow change segment; Indicates the unified timeline Flowmeter readings observed at each sampling time; Indicates the unified timeline Flowmeter readings observed at each sampling time; Represents the first on the unified timeline Each sampling time.
[0098] S3.2. At each channel node identifier, aggregate the flux messages in the inbound flux message slots and the flux messages in the outbound flux message slots to form an inbound flux message set and an outbound flux message set. Simultaneously, read the source item message set in the source item message slots and arrange them side by side according to the field order to obtain conservation message pairs. Perform symmetry constraint aggregation on the conservation message pairs to generate conservation node message features. The symmetry constraint aggregation first performs conservation difference on the inbound flux message set and the outbound flux message set to form a difference message set. Then, perform position alignment on the difference message set and the source item message set according to the field order of the conservation element description set and complete the symmetry aggregation to output the conservation node message features.
[0099] To further explain, the expression for performing the conserved difference is:
[0100] ;
[0101] in, Represents the first on the unified timeline The conserved differences at each sampling time are used to construct the differential message set; This indicates that a certain incoming edge in the incoming edge flux message set occurs at the unified time axis. The flux message value corresponding to each sampling time is obtained by reading the flux message slot from the incoming edge. This represents the first outgoing edge in the outgoing edge flux message set on the unified time axis. The flux message value corresponding to each sampling time is obtained by reading the outgoing edge flux message value from the flux message slot.
[0102] Conservative node message features are backfilled to the corresponding node positions in the multi-scale canal system topology graph along the node mapping relationship, and cross-scale consistent fusion is completed. Cross-scale consistent fusion aligns the conservative node message features of the original directed graph nodes, newly added nodes in the local refined graph, and converged nodes in the coarse-grained convergence graph to the same time slice index according to the node mapping relationship, resulting in a batch of conservative features. Embedding encoding is performed on the batch of conservative features to generate a sequence of node latent features. Embedding encoding concatenates the conservative node message features, influencing factor fields, and boundary source term fields in the field order and maps them to fixed-dimensional node latent feature sequence entries. Flux receiving positions and source term receiving positions are reserved in the node latent feature sequence entries respectively. Flux receiving positions are used to carry the flux-related latent features obtained by propagation along the directed edges, and source term receiving positions are used to carry the source term-related latent features obtained by merging at the canal pool node identifier.
[0103] S3.3. Based on the propagation lag sequence, determine the cross-node advancement order of the node potential feature sequence and determine the advancement step size of the same node to form an advancement configuration; based on the advancement configuration, perform time-delay advancement along the directed edge on the flux-related potential features in the node potential feature sequence and write them into the flux receiving position of the downstream node potential feature sequence entry. The flux-related potential features represent the component set in the node potential feature sequence entry corresponding to the flux message set and the conserved difference; based on the advancement configuration, incorporate the source term-related potential features into the source term receiving position of the node potential feature sequence entry at the channel pool node identifier. The source term-related potential features represent the component set in the node potential feature sequence entry corresponding to the source term message set and the boundary source term field, thus obtaining a multi-step potential prediction sequence.
[0104] A gate readout mapping is performed on the multi-step potential prediction sequence to generate a prediction sequence set. The gate readout mapping first extracts the gate node potential entries from the multi-step potential prediction sequence according to the gate node identifier. Then, the gate node potential entries are subjected to dimension compression and dimension restoration operations according to the dimension of the flow meter reading field of the gate observation field table to obtain the flow prediction value sequence of the gate at multiple future sampling times. The prediction sequence set is then formed by summarizing the prediction values according to the gate node identifier.
[0105] S3.4. Extract labeled flow sequences from the spatiotemporal sample pool dataset along a unified time axis to form a labeled sequence set. Calculate the fitting error between the predicted sequence set and the labeled sequence set for each gate node and each sampling time to form an error record. For the conserved element description set, statistically analyze the flow difference between the inflow gate set and the outflow gate set on a unified time axis for each channel and pool node. Arrange the flow difference, the changes in the boundary source term field, and the channel / pool water level field on the unified time axis to form a conserved residual record. Summarize the error record and the conserved residual record to form a training loss record.
[0106] A training loss sequence is formed from the training loss records, and convergence conditions are determined. The convergence conditions include the relative change threshold of the loss, the number of consecutive stable epochs, and the maximum number of iteration epochs. The relative change threshold of the loss is determined by the statistical value of the relative change rate of the latter part of the training loss sequence and is set to 0.0001. The number of consecutive stable epochs is set to 10, and the maximum number of iteration epochs is set to 200. The relative change rate of the loss is calculated as the ratio of the difference between the training loss records of two adjacent epochs to the training loss record of the previous epoch.
[0107] It should be noted that the relative change threshold of loss is set to 0.0001 because in gradient descent training, a relative change rate of loss as low as tens of thousands usually indicates that the loss improvement brought by continued iteration has entered the range dominated by numerical noise. Using 0.0001 as the stopping criterion can ensure sufficient convergence while avoiding invalid iterations.
[0108] The value of 10 for the continuous stable rounds is because the convergence judgment needs to exclude the accidental "smallness" caused by random batch fluctuations. Using the threshold to be met for multiple consecutive iteration cycles is a common practice. Taking 10 rounds can stably filter short-term oscillations without significantly increasing training overhead.
[0109] The maximum number of iterations is set to 200 because it provides a definite upper limit for training to avoid long periods of stagnation or difficulty in convergence. In engineering practice, 200 iterations is often used as a general upper limit setting that balances convergence chance and computational cost, and can cover the convergence process under most common data sizes and network parameter numbers.
[0110] The network parameters are updated by gradient descent based on the training loss record. The gradient descent update sequentially performs the calculation of the partial derivative of the training loss record with respect to the network parameters, the summarization of the gradient of the network parameters, the adjustment of the step size of the network parameters along the negative gradient direction, and the recalculation of the training loss record after the network parameters are updated. The process is iterated on the training batch list until the convergence condition is met. The convergence condition is met in two cases: the relative change rate of the loss record is not greater than 0.0001 for consecutive rounds, or the maximum number of iterations is reached, and the updated network parameters are obtained.
[0111] Single-step convergence training is performed on the predicted sequence set to obtain single-step convergence parameters. Single-step convergence training selects only the next sampling time as the prediction step size on a unified time axis. Single-step convergence training generates single-step potential prediction sequences according to the advancement configuration and generates single-step prediction sequences through gate readout mapping. Then, single-step training loss records are generated according to the error records and the conserved residual records, and gradient descent is repeated to update them. The single-step training loss records replace the training loss records as the convergence judgment objects. The convergence conditions are adopted, with a relative change threshold of 0.0001, a continuous stable iteration count of 10, and a maximum iteration count of 200, until the single-step training loss records meet the convergence conditions, and the single-step convergence parameters are obtained.
[0112] Multi-step expansion parameters are obtained by performing multi-step expansion training on the prediction sequence set using single-step convergence parameters. Multi-step expansion training selects multiple consecutive sampling times on a unified time axis as prediction step sizes and generates multi-step potential prediction sequences. Multi-step expansion training writes back the gate readout mapping result of the previous prediction step as the corresponding flowmeter reading field entry in the gate observation field table of the next prediction step to form a recursive expansion sequence. Then, the recursive expansion sequence is gradually accumulated to generate multi-step training loss records and repeated gradient descent updates. The multi-step training loss records replace the training loss records as the convergence criterion. The convergence conditions are used, with a relative change threshold of 0.0001, a continuous stable iteration count of 10, and a maximum iteration count of 200, until the multi-step training loss records meet the convergence conditions, thus obtaining the multi-step expansion parameters.
[0113] The updated network parameters, single-step convergence parameters, and multi-step expansion parameters are merged and encapsulated to generate the target model parameter set.
[0114] S4. Assemble the target model parameter set with the multi-scale canal system diagram structure dataset, and perform consistency verification to generate a canal pool gate flow prediction model.
[0115] S4.1. Read the target model parameter set and parse the parameter item names and parameter tensor dimensions within the target model parameter set. Establish a network structure instance corresponding to symmetric message passing training, latent time-progression training, and gate readout mapping. Write the multi-scale channel graph structure dataset into the network structure instance, and write the node mapping relationship, directed edge set, and propagation lag sequence into the structural constraint region of the network structure instance, so that the network structure instance performs cross-scale consistent fusion along the node mapping relationship, performs adjacency dependency propagation along the directed edge set, and performs time-delayed progression order constraints along the propagation lag sequence during the inference phase.
[0116] The target model parameter set is loaded into the parameter carrying area of the network structure instance one by one according to the parameter item name. The parameter loading process includes the equality comparison of parameter item names, the dimensional consistency comparison of parameter tensor dimensions, and the writing operation of parameter tensor values, thereby completing the parameter loading of the network structure instance and obtaining a network structure instance with complete parameter loading. In the network structure instance with complete parameter loading, the standardized input specification is solidified. The standardized input specification includes the field set for aligning the observation sequence, the field set for influencing factors, the field set for boundary source terms, and the sampling interval for the unified time axis, which is used to constrain the field order and time stamp format of the inference input.
[0117] S4.2. Extract a validation subset from the spatiotemporal sample pool dataset, and generate a validation input package from the validation subset according to the standardized input specification. The validation input package should at least include a multi-scale channel system graph structure dataset index, an aligned observation sequence arranged by gate node identifier and channel pool node identifier, an influencing factor field, and a boundary source term field. Perform forward computation on the validation input package on the network structure instance with completed parameter loading. The forward computation sequentially performs the following operations: construction of the flux message set and source term message set corresponding to symmetric message passing training, generation of conserved node message features corresponding to symmetry constraint aggregation, cross-scale consistent fusion corresponding to node mapping relationship, potential time advancement corresponding to propagation lag sequence, and decoding of flow prediction value corresponding to gate readout mapping, and outputs a validation prediction sequence.
[0118] Perform consistency checks on the validation prediction sequence and output check records. The consistency checks include node mapping consistency checks and output dimension consistency checks. The node mapping consistency check verifies the consistency between the gate node identifier set of the validation prediction sequence and the gate node identifier set in the multi-scale channel system graph structure dataset according to the node mapping relationship, and outputs mapping check records. The output dimension consistency check verifies the correspondence between the number of prediction steps of the validation prediction sequence on the unified time axis and the length of the unified time axis in the validation input package, and verifies the consistency between the length of the prediction value sequence corresponding to each gate node identifier in the validation prediction sequence and the output dimension definition of the gate readout mapping, and outputs dimension check records.
[0119] When the mapping verification record and the dimension verification record meet the consistency condition, the network structure instance with loaded parameters is encapsulated, and the channel gate flow prediction model is obtained. The consistency condition includes complete matching of node mapping consistency and passing the output dimension consistency verification. The encapsulation process solidifies the multi-scale channel graph structure dataset, node mapping relationship, directed edge set, propagation lag sequence, standardized input specification and target model parameter set into the channel gate flow prediction model, so that the channel gate flow prediction model can output the flow prediction sequence of the gate at multiple sampling times in the future after receiving the aligned observation sequence, influencing factor field and boundary source term field that conform to the standardized input specification.
[0120] This embodiment also provides a computer device applicable to the training method of a canal and pool gate flow prediction model, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the training method of the canal and pool gate flow prediction model proposed in the above embodiment.
[0121] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0122] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the training method for the channel gate flow prediction model as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0123] In summary, this invention constructs a three-layer structure—the original directed graph, the locally refined graph, and the coarse-grained convergence graph—and establishes node mapping relationships. This enables the multi-scale canal system topology graph to simultaneously express the local disturbances in densely populated sections of the water diversion channel and the global coupling of the linked gate control. The propagation lag sequence further clarifies the time delay propagation caused by the channel length and real-time flow velocity, thereby improving the ability to characterize cross-node dependencies. By using the upstream water inflow process and the water intake / return flow of the canal pool as boundary source terms and writing them into the aligned observation sequence according to the water intake set and the water return set, the sample organization has consistent field semantics and reusable input specifications. By constructing conservation message pairs through the flux message set and the source term message set and performing symmetry constraint aggregation, the fitting error and conservation residual are used as the only decomposition terms of the training loss record, which promotes network parameter updates while optimizing prediction accuracy and conservation consistency.
[0124] Example 2, referring to Table 1, is the second embodiment of the present invention. To further verify the technical solution of the present invention, experimental simulation data of the training method of the channel pool gate flow prediction model are given.
[0125] In a medium-sized irrigation district, the test sections of the East Main Canal, the West Branch Canal, and the main canal combined supply section were selected as test subjects (46 water distribution points and 3 sets of linkage gates).
[0126] The system reads 22 canals and pools, 17 gates, and 39 canal segment connections, marks the water flow direction to generate a set of directed edges, inserts gate nodes to obtain the original directed graph; in 12 dense sections, it subdivides and adds 6 canal and pool nodes to obtain a local refined graph, groups 5 according to the linked gate identifier set and merges them to obtain a coarse-grained convergence graph, establishes node mapping relationships to form a multi-scale canal system topology graph; it summarizes the conservation element description set and calculates the propagation delay to convert the propagation lag sequence, and encapsulates the multi-scale canal system graph structure dataset.
[0127] Continuous data collection for 60 days (10-minute sampling, 8640 points) was performed. Gate observation sequences and canal / pond observation sequences were collected and aligned to obtain an aligned observation sequence. Weather, date type, water usage plan, and pump station operating status were recorded, along with upstream water inflow, canal / pond water intake, and discharge. Missing data (1.8%) was filled in, outliers (0.6%) were removed, and dimensions were standardized to obtain a spatiotemporal sample pool dataset. A training batch list was generated based on sampling time, and flux message slots and source term message slots were configured. Message sets were constructed, and conserved difference and symmetric aggregation were performed to obtain conserved feature batches. A 6-step prediction sequence set was generated based on the propagation lag sequence. Gradient descent was used to update network parameters using training loss records (92 rounds of convergence). Single-step convergence training and multi-step unfolding training were completed, and the target model parameter set was merged and encapsulated. After the validation subset passed the 20% consistency check, the canal / pond gate flow prediction model was encapsulated.
[0128] The details are shown in Table 1 below:
[0129] Table 1. Experimental Comparison Data
[0130]
[0131] Looking at the average indicators of the three canal systems, the average MAPE of the flow prediction in the prior art is 11.77%, while the average MAPE of the flow prediction in this invention is 8.03%, a relative reduction of 31.7%; the average MAE of the flow prediction in the prior art is 2.20 m³ / s, while the average MAE of the flow prediction in this invention is 1.57 m³ / s, a relative reduction of 28.6%. These differences are consistent with the parallel characterization of local refinement and coarse-grained convergence in the multi-scale canal system topology map: after the densely distributed sections of the water distribution outlets are subdivided into nodes, the gate outflow change segments and the water intake and discharge change segments are aligned in conserved units closer to their physical locations, reducing the error sources of "thinning" of local disturbances by the single-scale topology.
[0132] Regarding conservation consistency, the average conservation residual of existing technologies is 0.74 m³ / s, while the average conservation residual of this invention is 0.22 m³ / s, a relative reduction of 70.6%. The 95th percentile of the conservation residual shows a significant decrease in all three canal sections (for example, the main canal decreased from 1.98 m³ / s to 0.78 m³ / s). The symmetric message passing training that explicitly transmits conservation information aligns and symmetrically aggregates the incoming flux messages, outgoing flux messages, and source term messages in the order of the conservation element description set fields. This allows the training objective to simultaneously constrain the fitting error and the conservation residual, avoiding the common problem of "correct numerical fitting but destroyed conservation structure" caused by existing technologies relying solely on fitting loss.
[0133] In terms of robustness and training efficiency, the average MAPE of existing technologies is 15.23% in the scenario with a missing rate of 10%, while the average MAPE of this invention is 10.00%, a relative reduction of 34.4%. This indicates that after missing completion and dimensional unification, the conserved difference and source term slots can still provide stable constraints, reducing the amplification effect of missing values on prediction drift. At the same time, the average number of convergence iterations decreased from 192 to 135, a relative reduction of 29.6%. This shows that the potential time-progression training under the propagation lag sequence constraint reduces gradient oscillations caused by cross-node time delay mismatch, making it easier for the optimization process on the training batch list to achieve stable convergence.
[0134] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A training method of a channel gate flow prediction model, characterized in that: include, Construct a multi-scale canal system topology map and establish a set of conserved element descriptions for each canal pool node to generate a multi-scale canal system map structure dataset; The specific steps for constructing the multi-scale canal system topology map are as follows. Read the list of canals and pools, the list of gates, and the connection relationships of canal segments, mark the direction of water flow, and generate a set of directed edges; Define each canal / pool entry in the canal / pool list as a canal / pool node, and define each gate entry in the gate list as a gate node; Pair the canal and pool nodes, gate nodes, and directed edge sets to generate the original directed graph; Based on the distribution density of the water distribution outlets, densely populated sections are identified, and node subdivisions are performed in adjacent canal sections to generate local detailed maps; Grouping of canal sections and merging of adjacent canal pools and linked gates generates a coarse-grained convergence map; By summarizing the original directed graph, the locally refined graph, and the coarse-grained convergence graph and establishing node mapping relationships, a multi-scale canal system topology graph is generated. Based on the multi-scale canal system diagram structure dataset, the operation sequence data of gates and canal pools were collected and the influencing factors and boundary source terms were aligned to obtain the spatiotemporal sample pool dataset; Perform symmetric message-passing training with explicit transfer of conserved information and latent time-progression training on the spatiotemporal sample pool dataset, update the network parameters, and generate the target model parameter set; The target model parameter set is assembled with the multi-scale canal system diagram structure dataset and consistency verification is performed to generate a canal pool gate flow prediction model.
2. The method of claim 1, wherein: The specific steps for generating the multi-scale canal system map structure dataset are as follows. Based on the multi-scale canal system topology map, the inflow gate set and outflow gate set are determined for each canal pool node, and the water intake set, water outlet set, water level measuring point set and geometric element fields are registered, and the conservation element description set is obtained by summarizing them. The propagation delay of each directed edge is calculated based on the channel length and real-time flow velocity and converted into a discrete time step sequence to generate a propagation lag sequence. By encapsulating the conserved element description set, node mapping relationship, directed edge set, and propagation lag sequence, a multi-scale channel graph structure dataset is obtained.
3. The training method for the channel and pool gate flow prediction model as described in claim 1, characterized in that: The specific steps for collecting the operational sequence data of gates and canals based on the multi-scale canal system diagram structure dataset are as follows. Based on the multi-scale canal system diagram structure dataset, gate node identifiers and canal pool node identifiers are extracted. Gate opening, upstream and downstream water levels and flow meter readings are collected and summarized into gate observation sequence. Canal pool water level and intake and discharge water metering are collected and summarized into canal pool observation sequence. Perform unified sampling interval resetting and time stamp alignment on the gate observation sequence and the canal pool observation sequence to generate an aligned observation sequence.
4. The training method for the channel and pool gate flow prediction model as described in claim 1, characterized in that: The specific steps for obtaining the spatiotemporal sample pool dataset are as follows. Weather, date type, water use plan and pump station operation status are defined as influencing factors, and upstream water inflow process, water intake and discharge of canals and pools are defined as boundary source terms; Influencing factors are written into the aligned observation sequence according to the shared fields of the entire network, and boundary source items are written into the aligned observation sequence according to the water intake set and the water discharge set. The written results are processed by missing data completion, outlier removal, and dimensional unification. The results are then merged with the aligned observation sequences to obtain the spatiotemporal sample pool dataset.
5. The training method for the channel and pool gate flow prediction model as described in claim 1, characterized in that: The specific steps for performing symmetric message passing training with explicit transmission of conserved information on the spatiotemporal sample pool dataset are as follows: A set of directed edges is extracted from the multi-scale channel graph structure dataset, and a flux message slot and a source item message slot are established for each directed edge; Calculate the gate outflow change segment at the gate node and write it into the corresponding outflow flux message slot. Calculate the water intake and discharge change segments at the channel / pool node and write them into the source term message slot corresponding to the conservation element description set to obtain the flux message set and the source term message set. At each channel node, the incoming and outgoing flow messages are collected and arranged in parallel with the source message set to form a conserved message pair. Perform symmetry constraint aggregation on the conserved message pairs to generate conserved node message features; The conserved node message features are backfilled along the node mapping relationship and cross-scale consistent fusion is completed to generate a batch of conserved features for training iteration.
6. The training method for the channel and pool gate flow prediction model as described in claim 1, characterized in that: The specific steps of the potential time-progression training are as follows. Embedding encoding is performed on batches of conserved features to generate a sequence of latent features for nodes; The propagation sequence across nodes is determined according to the propagation lag sequence, and the propagation step size of the same node is determined to generate the propagation configuration. Based on the advance configuration, first advance the flux-related potential features along the directed edge and write them into the flux receiving position of the downstream node, then merge the source term-related potential features at the channel pool node and write them into the source term receiving position to generate a multi-step potential prediction sequence. Perform gated readout mapping on multi-step potential prediction sequences to generate a set of prediction sequences; Perform single-step convergence training on the predicted sequence set and output the single-step convergence parameters; Perform multi-step unpacking training on the predicted sequence set using single-step convergence parameters, and output multi-step unpacking parameters; The single-step convergence parameters and multi-step expansion parameters are merged to generate a time-progressive training parameter set.
7. The training method for the channel and pool gate flow prediction model as described in claim 1, characterized in that: The specific steps for generating the target model parameter set are as follows: Labeled traffic sequences are extracted from the spatiotemporal sample pool dataset to form a label sequence set, and the fitting error between the predicted sequence set and the label sequence set is calculated to form an error record; The flow difference between the inflow gate set and the outflow gate set is statistically analyzed for each channel and pool in the conservation element description set, and the boundary source term and channel and pool water level changes are integrated to form a conservation residual record; The training loss record is obtained by summarizing the error record and the conserved residual record. Then, the network parameters are updated by performing gradient descent based on the training loss record and archived to generate the target model parameter set.
8. The training method for the channel and pool gate flow prediction model as described in claim 1, characterized in that: The specific steps for generating the channel pool gate flow prediction model are as follows: Establish network structure instances and write them into a multi-scale canal graph structure dataset, including node mapping relationships, directed edge sets, and propagation lag sequences; Load the target model parameter set into the network structure instance and complete the parameter loading; On the network structure instance with completed parameter loading, perform forward computation on the validation subset of the spatiotemporal sample pool dataset to generate a validation prediction sequence, and perform node mapping consistency check and output dimension consistency check on the validation prediction sequence. When the verification meets the consistency condition, the network structure instance is encapsulated to generate the channel and pool gate flow prediction model.
9. The training method for the channel and pool gate flow prediction model as described in claim 5, characterized in that: The specific steps for performing symmetry-constrained aggregation on the conserved message pairs are as follows. For each canal node, the incoming and outgoing flow messages are counted, and the conserved difference is calculated to form a difference message set; The differential message set and the source message set are aligned according to the field order of the conserved feature description set and then symmetrically aggregated to generate conserved node message features.
Citation Information
Patent Citations
Water quantity scheduling method and device in water supply project gate station water cut-off period
CN118551994A
Flood peak evolution path and dam break risk early warning method and system
CN120387577A