A nonlinear entry flow inversion and joint optimization method and system
By using graph theory-based directed graph inverse retrieval and nonlinear time-varying flow calculation, combined with the finite memory quasi-Newton method and Nash efficiency coefficient, the problem of relying on manual experience and wasting computing power for inflow parameter calibration in large-scale urban drainage networks is solved, and high-fidelity, low-time dynamic inflow extrapolation is achieved.
Patent Information
- Application Number
- CN202611421010.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-11-24
AI Technical Summary
In large-scale urban drainage networks, existing technologies rely on manual experience for inflow parameter calibration, result in distorted simulations of flood peaks during extreme rainstorms, and lead to wasted computing power due to global optimization algorithms, making it difficult to achieve high-fidelity, low-time-consuming dynamic inflow simulations.
A graph-theoretic directed graph reverse retrieval algorithm is used to trace upstream connected nodes, construct a nonlinear time-varying alternative flow calculation equation, and combine the finite memory quasi-Newton method and the Nash efficiency coefficient iterative termination mechanism to achieve two-dimensional joint optimization of the total network inflow parameters and the anti-peak shaving index parameters.
It achieves precise source tracing of complex pipeline spatial boundaries, high-fidelity reconstruction of nonlinear extreme flood peaks, and constructs a control closed loop with extremely low computing power, ensuring the efficiency and accuracy of flood control emergency simulation.
Smart Images

Figure CN123159200A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of urban drainage network hydrodynamic simulation, digital twin water affairs and intelligent scheduling technology, specifically involving a nonlinear inflow inversion and joint optimization method. Background Technology
[0002] With the deepening of smart city and digital twin water management construction, hydrodynamic simulation of urban drainage networks has become a core supporting tool for urban flood risk assessment, network bottleneck diagnosis, and real-time flood control scheduling. However, when performing model calibration and inflow boundary condition inversion for large-scale, highly complex urban pipe networks, existing technologies generally have the following limitations: (1) Accurate pipeline hydrodynamic calibration is highly dependent on high-quality node inflow monitoring data. However, in practical engineering applications, flow meters are deployed at a much lower density than water level gauges, which are simple in structure and stable in operation, due to their high installation cost, difficult maintenance, and large measurement errors at low flow velocities and in full pipe conditions. Most pipeline nodes only have discrete water level monitoring sequences, and there are strong nonlinear and time-varying lag characteristics between water level fluctuations and the actual upstream inflow. Existing technologies usually cannot directly overcome the data conversion problem across physical quantities and lack mathematical means to use pure water level sequences for high-fidelity inverse deduction of the inflow process.
[0003] (2) Urban drainage networks have extremely complex tree-like or ring-like spatial connections. When the water level at a specific monitoring node fluctuates abnormally, traditional parameter optimization methods often rely on the prior experience of engineers, manually identifying upstream catchment areas by comparing drawings, and then setting static baseflow parameters in the hydrodynamic model file. Faced with urban-level network models with tens of thousands of nodes, this manual intervention method is not only time-consuming and cumbersome, but also prone to omissions. Furthermore, it cannot dynamically capture the inflow differences in the spatiotemporal distribution of upstream nodes under complex water systems, resulting in a serious deviation of the spatial mapping of hydraulic loads from physical reality.
[0004] (3) Existing inversion models often use linear scaling or constant coefficient mapping when dealing with the conversion from water level to flow rate. However, in extreme rainstorm scenarios, due to the nonlinear confluence and backwater characteristics of confined pipe sections, a small surge in water level often corresponds to a violent burst of inflow peak. Traditional models, lacking targeted mathematical compensation logic, are prone to severely underestimating the simulated flood peak and distorting the process line during inversion and deduction. This makes it impossible for the simulated water level sequence to truly reproduce the extreme peak of the measured signal, directly weakening the reliability of the model in high-risk urban flooding early warning.
[0005] (4) To obtain the optimal model parameters, existing automated calibration methods generally employ global heuristic optimization algorithms for massive iterations. A single full-process calculation of a hydrodynamic engine is extremely time-consuming, and traditional optimization strategies lack real-time monitoring and feedback intervention mechanisms for model fidelity. In actual simulations, even if the parameter combination has achieved a model fitting accuracy that meets extremely high engineering practical standards, the algorithm will still mechanically complete the remaining preset iteration rounds. This redundant search, lacking a dynamic iteration termination mechanism, results in a significant waste of computational resources and cannot meet the timeliness requirements of flood control emergency simulations under sudden weather conditions.
[0006] Patent document CN 121167961 A discloses an optimization method for drainage system level monitoring equipment under no-rainfall conditions. This scheme utilizes graph theory to analyze the connection logic of the pipe network and calculates the steady-state flow velocity and lag time under typical operating conditions based on Manning's formula. However, this scheme is strictly limited to static steady-flow analysis and cannot cope with highly nonlinear hydrodynamic evolution processes such as full pipes and overflows under extreme rainstorms. Furthermore, it fails to provide a solution for inverting the inflow driving sequence during rainfall using dynamic water levels.
[0007] Patent document CN 110909485 A discloses a method for self-calibrating parameters of a SWMM model based on a BP neural network. This method generates a massive parameter sequence through Latin hypercube sampling, drives the underlying model to run, extracts water depth data, and then trains the BP neural network to fit the parameter relationships. This "black box" proxy model heavily relies on time-consuming, massive preliminary simulations to build a sample library, which not only severs the physical and hydraulic connections of pipeline spatial tracing but also fails to perform dynamic calculation truncation during underlying execution to save computing power.
[0008] Patent document CN 121787245 A discloses a SWMM parameter calibration method combining data dimensionality reduction and a sparrow search algorithm. This scheme generates multiple sets of parameter samples offline and runs the hydraulic model in its entirety. Then, it uses kernel principal component analysis (KPCA) to extract principal components for dimensionality reduction, and finally uses an optimized surrogate network for parameter inversion. Although this method improves the processing capability for high-dimensional data, it still does not escape the computationally intensive paradigm of "first offline massive sampling, then training the network." Due to the lack of an adaptive iterative termination mechanism based on model fit fidelity (such as the Nash efficiency coefficient), this scheme cannot fundamentally avoid the computational redundancy and timeliness bottlenecks faced in large-scale pipeline network inversion. Summary of the Invention
[0009] The purpose of this invention is to provide a nonlinear inflow inversion and joint optimization method and system to solve the problems of heavy reliance on manual experience in boundary delineation, distortion in the simulation of flood peaks during extreme rainstorms, and waste of computing power caused by blind iteration of global optimization algorithms in the calibration of inflow parameters of traditional pipe network models. This enables high-fidelity, fully automated and low-time-consuming inference driven by dynamic inflow in large-scale complex drainage pipe networks.
[0010] To achieve the above objectives, the present invention provides the following technical solution: A nonlinear inflow inversion and joint optimization method includes the following steps: Obtain the original drainage network model file of the target area, extract the hydraulic connection relationship between nodes and pipe segments and reconstruct it into a directed graph space topology model; input the target water level monitoring node, use graph theory pathfinding algorithm to search in reverse and extract the set of all upstream connected nodes of the target water level monitoring node as the boundary framework for inflow space allocation; The measured water level time series of the target water level monitoring node within a preset time window is extracted, resampling and missing value repair are performed, and the steady-state water level mean is calculated; the total inflow parameter and the anti-peak shaving index parameter of the whole network are introduced, and a nonlinear time-varying alternative flow calculation equation is constructed based on the dynamic ratio of the real-time observed water level and the steady-state water level mean. The total simulated inflow sequence is generated using the nonlinear time-varying alternative flow calculation equation. Based on the total number of nodes in the upstream connected node set, the total simulated inflow sequence is proportionally mapped to each upstream connected node to generate an independent node inflow time series. The network hydraulic configuration file is dynamically rewritten through the underlying logic to clear the historical static dry day flow and inject the newly generated node inflow time series as time-series driving data without loss. With the objective function of minimizing the root mean square error between the simulated water level sequence and the measured water level time sequence, under given physical boundary constraints, a two-dimensional joint optimization and calibration of the total inflow parameter and the anti-peak reduction index parameter is performed using the finite memory quasi-Newton method. In each iteration, the hydrodynamic engine is called to execute the reconstructed network hydraulic configuration file, and the node simulated water level sequence is output and reconstructed. During the iterative process of the two-dimensional joint optimization calibration, a model performance monitoring and evaluation mechanism based on the Nash efficiency coefficient is established. When the Nash efficiency coefficient calculated in a single iteration reaches or exceeds the preset fitting fidelity threshold, an adaptive iteration termination mechanism is triggered to intercept global redundant search and determine that the combination of the total network inflow parameters and the anti-peak shaving index parameters when the mechanism is triggered is the optimal parameter combination.
[0011] Furthermore, the extraction of the set of all upstream connected nodes of the target water level monitoring node specifically includes: extracting the entire pipe segment information using the hydraulic engine application interface, constructing a directed graph network model conforming to the water flow direction with the inlet node of the pipe segment as the starting point and the outlet node as the ending point; starting from the target water level monitoring node, using a breadth-first search algorithm or a depth-first search algorithm to traverse the directed graph network model in reverse, retrieving and storing all connected upstream water collection nodes to form the set of upstream connected nodes; when the directed graph network model has local broken links or anomalies that cause the reverse traversal to fail, the target water level monitoring node itself is used as the minimum boundary constraint through the underlying anomaly capture mechanism to generate the final inflow space allocation node set.
[0012] Furthermore, the calculation of the steady-state average water level and the construction of a nonlinear time-varying alternative flow calculation equation based on the dynamic ratio of the real-time observed water level to the steady-state average water level specifically include: during the set model warm-up period and evaluation period, performing fixed-time-step resampling and linear interpolation completion on the measured water level time series to generate a continuous equidistant water level time series; extracting the water level time series data during the evaluation period and calculating its mathematical expectation as the steady-state average water level; using the anti-peak reduction index parameter as the power function exponent, and using the ratio of the real-time observed water level to the steady-state average water level as the base, multiplying by the total inflow parameter of the entire network to establish an exponential time-varying derivation formula as the nonlinear time-varying alternative flow calculation equation.
[0013] Furthermore, the step of dynamically rewriting the pipeline hydraulic configuration file through underlying logic, clearing historical static dry-day flow, and losslessly injecting newly generated node inflow time series as time-series driving data specifically includes: distributing the total simulated inflow sequence according to the total number of nodes in the upstream connected node set with equal weights, generating independent inflow time series data for each upstream connected node; when reconstructing the pipeline hydraulic configuration file at the text level, locating the node basic parameter module, and forcibly zeroing the static dry-day flow parameters of the relevant upstream connected nodes; locating the time series module and the inflow mounting module respectively, retrieving and safely erasing historical driving data in reverse order based on the node identifier, then appending the independent inflow time series data and driving mounting instructions, and synchronously updating the global simulation time window parameters of the hydrodynamic engine.
[0014] Furthermore, the objective function is to minimize the root mean square error between the simulated water level sequence and the measured water level time series. Under given physical boundary constraints, a finite-memory quasi-Newton method is used to perform two-dimensional joint optimization and calibration of the total inflow parameter and the anti-peak shaving index parameter. Specifically, this includes: setting the physical search boundaries for the total inflow parameter and the anti-peak shaving index parameter; within the optimization iteration domain, after each new parameter combination is generated by the finite-memory quasi-Newton method, driving the underlying hydrodynamic engine to execute the reconstructed network hydraulic configuration file and outputting the simulated water level sequence of the target water level monitoring node; calculating the root mean square error between the simulated water level sequence and the measured water level time series as the descent target of the algorithm gradient, and performing parameter iterative updates.
[0015] Furthermore, the establishment of a model performance monitoring and evaluation mechanism based on the Nash efficiency coefficient specifically includes: simultaneously calculating the root mean square error in each iteration, and simultaneously solving the Nash efficiency coefficients of the simulated water level sequence and the measured water level time series; and deploying event listeners in the iteration loop to monitor the Nash efficiency coefficient value of each iteration in real time.
[0016] Furthermore, the adaptive triggering iteration termination mechanism intercepts global redundant searches and determines the optimal parameter combination of the total network inflow parameters and the anti-peak shaving index parameters when the mechanism is triggered. Specifically, this includes: when the event listener detects that the Nash efficiency coefficient of a single iteration reaches or exceeds the preset fitting fidelity threshold, the system actively throws a custom global interruption exception to forcibly block subsequent gradient search iterations of the finite memory quasi-Newton method; extracting the current parameter combination that triggers the custom global interruption exception from the cache stack, and determining the current parameter combination as the optimal parameter combination.
[0017] Furthermore, the model performance monitoring and evaluation mechanism also includes: simultaneously calculating the root mean square error in each iteration, and simultaneously solving the Kling-Gupta efficiency coefficients of the simulated water level sequence and the measured water level time sequence, to assist in evaluating the model fitting performance.
[0018] This invention also provides a nonlinear inflow inversion and joint optimization system, comprising: a pipeline spatial topology tracing module for importing the original pipeline model file and adaptively extracting the upstream connected node set of the target water level monitoring node using a directed graph algorithm; a nonlinear flow extrapolation module for processing the measured water level time series, calculating the steady-state water level mean, and generating a time-varying inflow driving sequence based on the exponential hydrodynamic equation; a hydraulic configuration dynamic reconstruction engine for performing low-level file input / output operations, clearing historical static dry-day flow and losslessly mounting the newly generated time-varying inflow driving sequence; and a multi-dimensional joint optimization engine with an early-stop mechanism, which internally encapsulates a hydrodynamic solver and a nonlinear optimizer, aims to minimize the root mean square error, uses a finite-memory quasi-Newton method to adaptively calibrate the total inflow parameters and anti-peak-shaving index parameters of the entire network, and establishes an iteration termination monitoring mechanism using the Nash efficiency coefficient, forcibly terminating the iteration when the Nash efficiency coefficient reaches a preset threshold, and outputting the optimal parameter combination.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) It breaks through the bottleneck of manual dependence on the spatial boundary definition of complex pipeline networks: It innovatively introduces the graph theory directed graph reverse retrieval algorithm to adaptively complete the accurate source tracing of the upstream influence domain of hydraulics of the target monitoring node, avoiding the spatial allocation distortion phenomenon that is easily generated by manual configuration in pipeline networks with tens of thousands of nodes.
[0020] (2) Achieved high-fidelity reproduction of nonlinear extreme flood peaks: The original exponential time-varying alternative flow calculation equation, by introducing the anti-peak reduction index parameter, under the premise of ensuring the conservation of water and material, truly reflects the nonlinear response law of the sudden rise in water level in the restricted pipe section during the rainstorm period corresponding to the surge in inflow, and greatly reduces the flood peak reduction error that is easily caused by the traditional linear distribution model.
[0021] (3) A control loop that balances engine stability and extreme computing power saving was constructed: a two-way cleaning mechanism was used at the bottom layer to ensure seamless hot replacement between the algorithm optimizer and the engineering hydraulic software; at the same time, an adaptive iteration termination mechanism based on the Nash efficiency coefficient was established. Once the model fidelity meets the standard, the bottom layer interruption exception is triggered to intercept the remaining search. While ensuring high accuracy, it saves a lot of computing power and time for flood control emergency simulation. Attached Figure Description
[0022] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1A flowchart illustrating a nonlinear inflow inversion and joint optimization method provided in this application embodiment; Figure 2 This is a detailed flowchart illustrating the multidimensional joint optimization and adaptive iterative termination mechanism in the method described in this invention. Figure 3 A schematic diagram showing the spatial topology distribution of a city's drainage network and the location of target monitoring nodes. Figure 4 A time-series comparison and verification chart of simulated and measured water levels driven by the optimal parameter combination is presented. Figure 5 The system equipment diagram provided for this application. Detailed Implementation
[0024] Detailed embodiments of the invention are disclosed herein as needed; however, it should be understood that the disclosed embodiments are merely illustrative of the invention, and the invention may be implemented in different and alternative forms. The drawings are not necessarily drawn to scale, and certain features may be exaggerated or reduced to show details of specific components. Therefore, the specific structural and functional details disclosed herein should not be construed as limiting, but rather as a representative basis to teach those skilled in the art to employ the invention differently. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of this invention.
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0026] In the description of this invention, it should be noted that the terms "upstream" and "downstream," etc., indicate the orientation or positional relationship based on the physical law of water flowing from high to low under the action of gravity. They are only used to facilitate the description of this invention and to simplify the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.
[0027] In the description of this invention, it should be understood that the terms "hydraulic engine" and "hydraulic solver" refer to computer programs or software toolkits capable of performing hydraulic calculations on urban drainage pipe networks. These programs can read pipe network structure configuration files, perform unsteady flow calculations based on the Saint-Venant equations or their simplified forms, and output hydraulic state variables such as water level and flow rate at each node. Typical examples include the dynamic wave calculation kernel of stormwater flood management model software, or commercial or open-source computing engines with equivalent hydraulic calculation capabilities. "Pipe network hydraulic configuration file" refers to a structured text or binary file read by the hydraulic engine that describes the pipe network topology, node parameters, pipe segment parameters, and boundary conditions; a typical example is the INP format file of SWMM software.
[0028] In the description of this invention, it is important to understand that the "Nash-Sutcliffe Efficiency (NSE)" is a standardized statistical index used in hydrology and hydraulics to evaluate the performance of model simulations. Its value ranges from negative infinity to 1; the closer it is to 1, the higher the agreement between the simulated and observed sequences. Generally, an NSE greater than 0.5 is considered acceptable, and a value greater than 0.75 indicates good model performance. The "Kling-Gupta Efficiency (KGE)" is another comprehensive model evaluation index. It integrates the errors of the Pearson correlation coefficient, the standard deviation ratio, and the mean ratio, providing a more comprehensive characterization of the simulated sequence's fit performance in terms of morphology, dispersion, and bias. The "Root Mean Square Error (RMSE)" measures the square root of the ratio of the square of the deviation between the simulated and observed values to the number of observations. Its dimensions are consistent with the original observations, and in this invention, it serves as the objective function for the gradient descent optimization algorithm.
[0029] In the description of this invention, it is important to understand that a "directed graph space topology model" is a data structure in graph theory, consisting of a set of nodes and a set of edges, with each edge having a definite directional attribute. In this invention, physical nodes of the pipe network (such as manholes, rainwater inlets, and discharge outlets) are used as graph nodes, pipe segments connecting the nodes (such as pipes and culverts) are used as graph edges, and the direction of water flow is used as the direction of the edges, thereby constructing a directed graph reflecting the connectivity of water flow in the pipe network. Both "Breadth-First Search (BFS)" and "Depth-First Search (DFS)" are classic graph traversal algorithms in graph theory. The former expands the access to nodes layer by layer, while the latter delves into a single path to the end and then backtracks.
[0030] In the description of this invention, it is important to understand that the "Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS-B)" is a quasi-Newton-like algorithm for solving large-scale bounded nonlinear optimization problems. The classic BFGS method guides the gradient descent direction by constructing and storing the complete approximate inverse of the Hessian matrix, but this incurs huge storage overhead when dealing with large-scale parameter optimization problems. The L-BFGS method implicitly approximates the inverse of the Hessian matrix by retaining only the vector pairs from the most recent iterations, significantly reducing memory usage. The suffix "-B" indicates that the method supports setting explicit physical lower and upper bound constraints on the optimization variables, ensuring that the optimization search always occurs within a reasonable physical parameter space.
[0031] In the description of this invention, it is important to understand that the "anti-peak-shaving index parameter" is a power function exponent uniquely introduced in this invention, used to nonlinearly amplify the peak inflow during stormwater runoff in the alternative flow calculation equation. In traditional schemes that calculate inflow based on linear proportionality of water level, when the monitored water level reaches an extreme peak, the calculated peak inflow is often severely weakened; this phenomenon is known as the "peak-shaving effect." The anti-peak-shaving index parameter typically takes a value greater than 1. When the measured water level exceeds the steady-state average water level, the nonlinear amplification characteristic of the power function allows the increase in inflow to be much greater than the increase in water level, thus accurately reproducing the nonlinear physical response of a slight rise in water level within the confined pipe section corresponding to a sharp increase in inflow.
[0032] like Figure 1 The diagram shown is a flowchart illustrating the overall framework of a nonlinear inflow inversion and joint optimization method provided in this embodiment. This flowchart fully demonstrates the five core processing stages of the present invention: pipeline spatial connectivity analysis and upstream connectivity tracing, monitoring sequence processing and nonlinear flow calculation model construction, flow spatial mapping and dynamic reconstruction of pipeline configuration files, multidimensional error decoupling and joint optimization, adaptive early stopping and final state locking. The following will combine... Figures 1 to 4 The technical details of each step in this embodiment will be described in detail.
[0033] Step S101: Pipeline spatial connection analysis and upstream connectivity tracing.
[0034] In the traditional process of constructing and calibrating large-scale urban drainage network hydrodynamic models, when engineers need to calibrate inflow parameters for a specific water level monitoring node, the first step is to determine which upstream nodes contribute hydraulically to the water level response of that monitoring node. This step traditionally relies entirely on manual interpretation of network drawings by engineers: tracing pipe connections segment by segment and manually delineating catchment boundaries. For urban-level network models with tens of thousands of nodes, this method is not only extremely time-consuming but also highly susceptible to spatial distortion due to human error, such as omitting branches or incorrectly including irrelevant nodes, leading to deviations in subsequent spatial mapping of hydraulic loads.
[0035] Step S101 introduces graph theory algorithms to achieve automated and accurate tracing of upstream connected components, fundamentally solving the aforementioned problem of reliance on manual methods. The specific implementation process is as follows.
[0036] First, obtain the complete original hydrodynamic model configuration file of the drainage network in the target area. Taking the SWMM model as an example, its INP input file is in structured plain text format, and the data is organized using segmented tags. The [JUNCTIONS] section stores information such as the number of each manhole node, bottom elevation, maximum depth, initial depth, and maximum allowable water accumulation area; the [OUTFALLS] section stores the boundary attributes of the network outlet nodes; the [STORAGE] section stores the volume curve parameters of the storage tank nodes; and the [CONDUITS] section stores the pipe (or culvert) number, inlet node identifier, outlet node identifier, pipe length, roughness coefficient, inlet offset, and outlet offset, as well as other geometric and hydraulic parameters.
[0037] By calling the hydraulic engine's application programming interface or writing a dedicated text parsing program, the above configuration segments are read and parsed sequentially to extract the following key information to construct a directed graph spatial topology model G=(V, E): The set of nodes V is composed of all hydraulically significant nodes (including manhole nodes, outlet nodes, storage nodes, diverters, etc.); the set of directed edges E is composed of all pipe segments (pipelines, culverts, etc.). The direction of the edges is strictly determined according to the physical water flow direction: the node corresponding to the inlet node identifier of the pipe segment is the starting point of the directed edge, and the node corresponding to the outlet node identifier of the pipe segment is the ending point of the directed edge. This construction method ensures that the direction of any edge in the directed graph is strictly consistent with the actual water flow direction in the pipe network, providing a correct physical basis for subsequent reverse tracing.
[0038] After constructing the directed graph space topological model G, input the unique identifier of the target water level monitoring node to be studied (e.g., monitoring node number "JDYS097096"). Using this target node as the starting node for tracing, call the graph theory traversal algorithm to perform a reverse search. The "reverse search" is a search strategy relative to the direction of water flow. Since the direction of the edges in the directed graph is the direction of water flow (from upstream to downstream), the specific implementation of the reverse search is: starting from the target node, traverse and search along the reverse direction defined by the directed edges (i.e., traversing back from the end point of the edge to the starting point of the edge).
[0039] For the traversal algorithm, either breadth-first search (BFS) or depth-first search (DFS) can be used. BFS uses the target node as the root node and expands outwards level by level, visiting all nodes that are directly inversely adjacent to the current node, then visiting their inverse adjacent nodes, until all reachable upstream nodes have been visited. DFS starts from the target node, follows a reverse path to the furthest upstream node, then backtracks, exploring other branch paths. Both algorithms are equivalent in terms of retrieval completeness, both fully covering the entire upstream influence domain of the target node.
[0040] During the traversal, a set data structure U is set up to store all retrieved upstream connected nodes. Whenever the algorithm successfully visits a node that has not yet been recorded along a reverse edge, its identifier is added to set U. The traversal terminates when all upstream nodes with reverse adjacent edges have been visited and no new upstream nodes can be added. After the traversal is complete, set U contains the complete set of all upstream connected catchment nodes of the target water level monitoring node in a hydraulic sense.
[0041] Furthermore, to address potential topological anomalies in actual pipeline network model files, this invention employs a robust anomaly handling mechanism. When the graph structure exhibits local chain breaks (e.g., the identifiers of inlet or outlet nodes in a pipe segment are missing from the node segment), isolated subgraphs, or reverse traversal is interrupted due to file format corruption, the underlying program provides fallback through an anomaly capture mechanism. Specifically, if an anomaly is triggered during traversal or an empty set is returned, the system uses the target water level monitoring node itself as a minimum boundary constraint; that is, the final inflow space allocation node set only contains the target node itself. This fault-tolerant design ensures that the method can still operate safely and provide a reasonable minimum boundary even when faced with model files containing data defects.
[0042] Finally, the target node itself is merged with set U (if the traversal is successful, set U usually no longer contains the target node itself; this merging operation is for logical completeness), forming the final boundary node set for dynamic inflow space allocation. Let N be the number of elements in this set (i.e., the total number of upstream connected nodes). The value of N directly determines the weight of the flow space allocation in the subsequent step S103.
[0043] Figure 3 This embodiment illustrates the spatial topology distribution of a city's drainage network and the location of target monitoring nodes. The radial and circular interwoven lines represent pipe segments, and the intersections or endpoints of these lines represent network nodes. The target water level monitoring node JDYS097096, highlighted in the diagram, is located in the middle and lower reaches of the network system. Using the graph theory-based reverse tracing algorithm in step S101, the system automatically identifies all upstream water catchment nodes distributed in a fan shape, their spatial range as shown below. Figure 3 The area covered by the thick line indicates that it encompasses multiple upstream branch sub-basins. It is worth emphasizing that the identification of this upstream influence area is completed automatically by the algorithm within seconds, without any human intervention. Moreover, it can accurately capture all potential branch confluence paths in complex tree-like or ring-shaped pipe networks, completely avoiding omissions and misjudgments that are very easy to occur in manual interpretation.
[0044] Step S102: Monitoring sequence processing and nonlinear flow calculation model construction.
[0045] After determining the physical boundaries of the inflow space allocation through step S101, this step addresses another core challenge of the invention: how to deduce, from a single water level monitoring sequence signal, the total inflow time series that drives the corresponding water level response across the entire upstream influence domain. The essence of this problem is to achieve a reverse transformation across physical quantities from the state variable of "water level" to the driving variable of "inflow." Traditional methods based on linear proportional conversion or constant coefficient mapping cannot reflect the strong nonlinear confluence characteristics of urban drainage networks under heavy rainfall conditions.
[0046] The specific implementation process of step S102 is divided into two sub-stages: monitoring sequence preprocessing and nonlinear alternative flow equation construction.
[0047] Sub-stage 1: Monitoring sequence preprocessing.
[0048] First, the measured water level time series Hobs(t) of the target water level monitoring node within the preset analysis time window is extracted from the data acquisition system or monitoring database. The preset analysis time window needs to cover two stages: the model warm-up period and the evaluation period. The warm-up period is set to allow the hydraulic state of the pipeline system to transition from arbitrary initial conditions to a dynamic equilibrium state consistent with the actual situation before the formal calculation and evaluation period of the hydrodynamic engine, thereby eliminating the influence of the uncertainty of the initial conditions on the simulation results during the evaluation period. Generally speaking, the length of the warm-up period should not be less than 10% to 20% of the evaluation period, and can be appropriately adjusted according to the hydraulic response time constant of the pipeline system.
[0049] After acquiring the raw water level sequence, the original data may contain issues such as discontinuous timestamps, missing data at individual time points, or abnormal jumps due to factors such as power supply instability, communication interruptions, and instantaneous sensor disturbances. Therefore, this step performs strict time series standardization: First, a fixed time step Δt is defined, which should be coordinated with the subsequent calculation step of the hydrodynamic engine (typically 1 minute, 5 minutes, or 15 minutes). Then, starting from the beginning of the preset analysis time window, a standard equidistant timestamp sequence is generated at intervals of Δt. Finally, a linear interpolation algorithm is used to calculate the water level value at the standard timestamps between the original data points. For missing sections of the original data, linear interpolation or extrapolation of adjacent valid data is used to complete the sequence. This generates a continuous equidistant water level time series, providing a well-organized data foundation for subsequent mathematical operations.
[0050] After the time-series data is normalized, all water level data points within the assessment period are extracted, and their expected value, i.e., the arithmetic mean, is calculated. This mean physically represents the benchmark water level of the pipeline system under quasi-steady-state operating conditions without severe rainfall disturbance during the assessment period, and is denoted as the steady-state water level mean Hmean. Hmean plays the role of a benchmark reference surface in this invention, and subsequent inflow extrapolation uses it as the normalization reference benchmark.
[0051] Sub-phase two: Construction of nonlinear alternative flow equations.
[0052] After obtaining the real-time observed water level sequence Hobs(t) and the steady-state mean water level Hmean, this sub-stage constructs the original nonlinear time-varying alternative flow calculation equation of this invention. This equation serves as a mathematical bridge connecting the water level observation signal and the upstream total inflow sequence, and its analytical expression is: ; in, Q represents the total simulated replacement traffic at the current time step; Q is the total inbound traffic parameter of the entire network to be optimized (baseline traffic). The parameters for the anti-peak erosion index are to be optimized. When the measured water level... When extreme peaks occur, through the index Due to the power function amplification effect, the model can realistically reproduce the highly nonlinear inflow surge physical process inside the confined pipe section.
[0053] The physical meaning and design logic of each variable and parameter in this equation are explained in detail below: : This represents the total simulated alternative flow generated at the current time step t. Its physical meaning is the sum of the inflow flows of all nodes in the upstream connected node set determined in step S101 (i.e., the total upstream inflow). This variable will be used as the total flow for spatial allocation in the subsequent step S103.
[0054] Q: This is the total inflow parameter of the entire network to be optimized, also known as the base flow baseline. Its physical meaning is the total upstream inflow under quasi-steady-state conditions (i.e., when the measured water level is exactly equal to the mean steady-state water level). When Hobs(t) = Hmean, the ratio is 1, and Qproxy(t) = Q. Therefore, Q essentially characterizes the system's base flow level. Since the true value of Q in the actual pipeline network is unknown, this parameter is set as one of the target variables for subsequent optimization.
[0055] : This is the anti-peak-shaving index parameter to be optimized. This parameter is the core variable innovatively introduced in this invention to solve the problem of distortion in the simulation of extreme rainstorm peaks. The physical mechanism is explained in detail below: Under rainstorm conditions, especially when the pipeline network is overloaded or under full-pipe pressure flow, due to the nonlinear flow characteristics of the pipeline cross-section and the backlog effect of the manhole, a small increase in the inflow can lead to a large jump in the water level; conversely, from the perspective of inferring the inflow from the water level signal, the sharp rise in the observed water level corresponds to a larger proportion of explosive growth in the inflow. The traditional linear conversion model (i.e., a special case when p=1, Qproxy(t) ∝ Hobs(t)) cannot mathematically capture this amplification effect, resulting in the simulated flood peak being artificially "flattened". This invention introduces a power function form into the substitution equation, sets p as an adjustable parameter greater than 1, and utilizes the mathematical property that the derivative of the power function in the upper half of the interval (base greater than 1) is greater than 1 and monotonically increasing, to achieve nonlinear amplification compensation for the flood peak inflow. When the real-time water level Hobs(t) exceeds the steady-state mean Hmean, the ratio is greater than 1. The power function amplifies the ratio by an exponential p, and the larger the p value, the more significant the amplification effect. Conversely, when the water level falls below the steady-state mean during the receding period, the ratio is less than 1. The power function causes the inflow to contract accordingly, ensuring that the total water volume is reasonably distributed within the framework of material conservation.
[0056] It should be noted that the design of this alternative flow equation follows the principle of water and material conservation. Although the equation introduces a nonlinear transformation in form, the joint optimization process of the two parameters Q and p is subject to the dual constraints of the subsequent objective function and physical boundaries, which ensures that the total inflow volume, the system discharge capacity, and the water level change amplitude during the calculation are physically self-consistent, avoiding unreasonable situations where water is generated or disappears out of thin air.
[0057] Step S103: Flow space mapping and dynamic reconstruction of pipeline configuration files.
[0058] After generating the continuous total simulated inflow sequence Qproxy(t) in step S102, it needs to be reasonably allocated to each node in the upstream connected node set determined in step S101, and the allocated inflow time sequence of each node is injected into the pipeline hydraulic configuration file for the hydrodynamic engine to call and calculate. The implementation of this step S103 includes two closely linked links: flow space equal weight mapping and dynamic reconstruction of the pipeline configuration file.
[0059] Traffic space equal weight mapping process: As mentioned above, the output of step S101 is the set of upstream connected nodes, denoted as N, where the total number of nodes in the set is N. Since in actual engineering projects, without measured diversion ratio data, it is difficult to accurately determine the diversion ratio of each upstream branch during a rainstorm, and the subsequent joint optimization mechanism of this invention can absorb the systematic deviation caused by spatial allocation as a whole, this embodiment adopts an engineering-feasible and robust equal-weight allocation strategy. Specifically, the calculation method is: single-node inflow Qi(t) = Qproxy(t) / N, where i = 1, 2, ..., N are the indices of the upstream nodes in the set.
[0060] The physical rationale for the equal-weight allocation strategy lies in the fact that when the upstream influence area covers a large area and the surface characteristics (such as impermeability and slope) of each sub-catchment are not significantly different, the runoff generation and confluence processes of each branch are statistically homogeneous to a certain extent. Even if spatial heterogeneity exists, the joint optimization process in step S104 will compensate for the bias introduced by this simplification to a certain extent by adjusting the global parameters Q and p. For large and complex pipe networks with significant spatial heterogeneity, the initial allocation provided by the equal-weight strategy can still provide a reasonable search starting point for the optimization algorithm.
[0061] Dynamic reconstruction of pipeline configuration files: After generating independent inflow time-series data for each upstream node, it needs to be written to and mounted into the network hydraulic configuration file (using the SWMM's INP file as an example). This process is not a simple file append operation, but involves a thorough cleaning of historical driving data, forced zeroing of static flow parameters, and secure injection of new time-series data; it is a dynamic reconstruction process performed at the underlying text level. The specific operations performed in this step are as follows: First, bidirectional positioning and dirty data cleaning—node basic parameter module processing. The text content of the INP file is parsed to accurately locate the [JUNCTIONS] segment. For each node in the upstream connected node set, its corresponding parameter line in that segment is retrieved. In the SWMM INP format, each node in the [JUNCTIONS] segment can contain one or more optional parameters, including parameters specifying "average inflow" or similar static dry-day flow baseline values. The system performs a dirty data cleaning mechanism: if a node is found to have a non-zero static baseline flow parameter, the parameter value is forcibly rewritten to zero through string replacement or regular expression matching. The purpose of this operation is to completely shield any legacy static inflow assumptions, ensuring that the inflow driving force for subsequent hydrodynamic calculations comes entirely from newly injected dynamic time-series data, and preventing duplicate calculations or conflicts caused by the coexistence of old and new boundary conditions.
[0062] Second, the process of securely erasing historical data and injecting new time-series data—time series module processing—is performed. The [TIMESERIES] section of the INP file is located. This section defines the time-series data; each time series has a unique name identifier and contains a series of "time-value" pairs. Based on preset naming rules (e.g., generating time-series names with node identifiers as prefixes or suffixes), the system first searches the [TIMESERIES] section in reverse order (from the end of the section to the beginning) to determine if a historical time-series entry corresponding to that node already exists. If it does, the entry and all its subordinate time-series data lines are securely erased. "Secure erasure" means deleting the entire block without leaving any residual data lines, avoiding hydrodynamic engine parsing errors caused by inconsistencies in the length of the old and new sequences or overlapping time ranges. Subsequently, the newly generated time-series entry is appended to the end of the [TIMESERIES] section, written in the format: sequence name, flow value corresponding to time step one, flow value corresponding to time step two, and so on, up to the end of the evaluation period time step. All N upstream nodes are processed sequentially using this process.
[0063] Third, the inflow driver mount command update—processed by the inflow mount module. Locate the [INFLOWS] section of the INP file. This section is used to mount the defined inflow time series to specific network nodes and specify the inflow type (e.g., FLOW type represents direct flow injection into the node). Similarly, reverse retrieval and secure erasure are performed to remove the node's old mount command lines, and then a new mount command line is appended, in the format: node identifier, inflow type keyword (FLOW), corresponding time series name, scaling factor, and other parameters. Through this step, the driver mount relationship between the upstream node and the dynamic inflow time series is established.
[0064] Fourth, update the global simulation time window parameters. Locate the [OPTIONS] section or equivalent global control section in the INP file, which contains global time control parameters such as simulation start time, simulation end time, and calculation step size. According to the preset analysis time window (including the warm-up period and evaluation period), synchronously update these time control parameters to ensure that the start and end times of the hydrodynamic engine calculation are strictly aligned with the time range of the newly injected inflow timing data.
[0065] Through the above four sub-steps, the pipeline hydraulic configuration file completes a full and safe thermal reconfiguration at the bottom layer. This dynamic reconfiguration mechanism builds a data interaction bridge between the upper-level optimization algorithm and the hydrodynamic engine: the upper-level algorithm only needs to change the values of parameters Q and p to generate a new Q_proxy(t) and push it down to the reconfiguration engine; the reconfiguration engine then automatically completes file cleaning and injection, forming a complete data closed loop, providing a technical basis for the iterative optimization in step S104.
[0066] Steps S104 and S105: Multidimensional error decoupling, joint optimization and adaptive iterative termination.
[0067] Steps S104 and S105 together constitute the core of this invention's "multi-dimensional joint optimization with early stopping mechanism" closed-loop process, such as... Figure 2 As shown. Figure 2 This is a detailed flowchart illustrating the multidimensional joint optimization and adaptive iterative termination mechanism in the method described in this invention. The flowchart describes all the logical nodes and decision branches of the optimization algorithm from initialization to final state locking.
[0068] The following combination Figure 2 The process number is used to break down the specific implementation details of these two steps layer by layer.
[0069] S201: Parameter Boundaries and Optimizer Initialization.
[0070] Before initiating joint optimization, it is necessary to first define the physical search boundaries for two parameters to be optimized—the total inflow parameter Q and the anti-peak shaving index parameter p. Boundary setting must be constrained by prior engineering knowledge and physical rationality: the lower bound of Q can be set to a positive number close to zero (e.g., 0.001 cubic meters per second), while the upper bound is set based on a comprehensive estimate of the upstream influence area, the maximum possible rainfall intensity, and the pipeline's water conveyance capacity (for example, for an upstream area with a service area of approximately 2 square kilometers, the upper limit of the total inflow under extreme rainfall may be set in the range of 50 to 100 cubic meters per second); the lower bound of p is usually set to a value slightly greater than 1 (e.g., 1.0), because when p equals 1, the equation degenerates into a linear mapping, failing to reflect the nonlinear amplification effect, while p greater than 1 is necessary to exert the anti-peak shaving effect. The upper bound of p can be set empirically to 5.0 to 10.0; excessively high p values may lead to numerical overflow or generate unreasonable flow pulses.
[0071] After setting the parameter boundaries, the L-BFGS-B optimizer is initialized. Internally, the optimizer maintains a finite-sized storage space for historical vector pairs (typically with memory parameter m set to 10 to 20) to approximate the inverse of the Hessian matrix. The optimizer's gradient tolerance and function value tolerance can be set according to the magnitude of RMSE (e.g., gradient tolerance set to 1e-5, function value tolerance set to 1e-4). Simultaneously, a preset fitting fidelity threshold (e.g., NSE = 0.85) is set, which serves as the basis for subsequent adaptive early stopping decisions. Furthermore, a global exception capture stack is deployed at the code level to provide a receiving environment for the custom interrupt exception in step S209.
[0072] S202: Generate or update trial parameter combinations.
[0073] Before the iteration begins, the optimizer generates a new set of tentative parameters (Qk, pk) based on initial guesses (e.g., Q is the median of the estimated flow rate in the pipeline during dry weather, and p is 2.0) or based on gradient information from the previous iteration. Here, k represents the current iteration number.
[0074] S203: Invoke the refactoring engine to inject new configuration.
[0075] The latest parameter combination (Qk, pk) generated in step S202 is passed to the reconstruction engine. Following the nonlinear substitution flow equation described in step S102, the reconstruction engine recalculates the total simulated inflow sequence Qproxy(t) for the entire evaluation period. Then, following the flow space equal-weight mapping and network configuration file dynamic reconstruction process described in step S103, it updates the inflow timing of each upstream node and rewrites the INP file. This step is fully automated and requires no manual intervention.
[0076] S204: Full-process calculation of driving the hydrodynamic engine.
[0077] The solver interface of the underlying hydrodynamic engine is invoked, the reconstructed pipeline hydraulic configuration file from step S203 is loaded, and a complete unsteady flow hydrodynamic calculation is performed. The calculation time range covers the warm-up period and the evaluation period. After the calculation is completed, the simulated water level time series H_sim(t) of the target water level monitoring node during the entire evaluation period is extracted from the engine output. This series is obtained by the hydrodynamic engine accurately solving the mass and momentum conservation equations of each node in the pipeline network based on the Saint-Venant equations or their simplified forms (such as dynamic waves and diffusion waves), comprehensively reflecting the nonlinear hydraulic processes such as pipeline regulation, return water, and overflow.
[0078] S205: Multidimensional error decoupling and performance index calculation.
[0079] After obtaining the simulated water level sequence Hsim(t) and the measured water level sequence Hobs(t), this node performs multidimensional error decoupling calculation. The so-called "multidimensional error decoupling" refers to extracting indicators characterizing the simulation performance from different dimensions to comprehensively evaluate the advantages and disadvantages of the current parameter combination.
[0080] The first metric calculated is the root mean square error (RMSE), which is calculated using the following formula: ; Where T is the total number of time steps during the evaluation period. The magnitude of RMSE_k directly reflects the average difference between the simulated water level and the measured water level in terms of absolute deviation, and its dimension is consistent with that of the water level. In the joint optimization framework of this invention, RMSE plays the role of optimizing the objective function, and the L-BFGS-B algorithm searches along the gradient descent direction of RMSE in the parameter space.
[0081] The second metric calculated is the Nash efficiency coefficient (NSE), which is calculated using the following formula: ; Where Hobs is the average value of the measured water level sequence during the assessment period. NSEk is a dimensionless standardized index that characterizes the fidelity of the simulated sequence to the overall dynamic process of the measured sequence. This index is used as the core basis for adaptive early termination triggering decision.
[0082] The third optional auxiliary calculation indicator is the Kling-Gupta efficiency coefficient (KGE), which is calculated using the following formula: ; Where r is the Pearson linear correlation coefficient between Hsim(t) and Hobs(t), α is the ratio of the standard deviation of the simulated sequence to the standard deviation of the measured sequence, and β is the ratio of the mean of the simulated sequence to the mean of the measured sequence. KGE comprehensively evaluates the simulation quality from three dimensions: correlation, variability similarity, and bias, providing engineers with more comprehensive performance diagnostic information.
[0083] At this node, the event listeners deployed by the system make a logical decision on the NSEk value of the current iteration. Specifically, NSEk is compared with a preset fitting fidelity threshold (e.g., 0.85). This decision step is one of the key innovations of this invention. Its design logic is as follows: In the engineering practice of calibrating drainage network hydrodynamic models, when NSE reaches 0.85 or higher, the simulated water level sequence can highly realistically reproduce the dynamic trend and peak characteristics of the measured sequence, and the model accuracy fully meets the engineering practical requirements of downstream application scenarios such as urban flooding early warning and network diagnosis. Continuing iterative optimization at this accuracy level leaves extremely limited room for marginal improvement in RMSE, while the computation time consumed by each round of full-process calculation by the hydrodynamic engine is considerable (a single calculation for a large-scale network may take several minutes to tens of minutes). Therefore, once NSE reaches the target, the marginal benefit of continuing iteration is far lower than the marginal computational cost, and termination should be triggered.
[0084] S207: Update parameters along the RMSE gradient (determine the path that did not meet the standard).
[0085] If the decision in S206 is "No," meaning NSEk has not yet reached the threshold, it indicates that the model accuracy still has room for improvement, and the optimization process continues. The L-BFGS-B algorithm, based on the current parameter combination (Qk, pk) and its calculated RMSEk value, combined with internally maintained historical gradient information, approximates the gradient direction of the RMSE objective function with respect to the two parameters Q and p at the current point, and updates the parameters along this direction, generating a new parameter combination (Q{k+1}, p{k+1}). Subsequently, the program control flow returns to S202, starting the (k+1)th iteration. The process from S203 to S206 repeats cyclically until the "Yes" decision in S206 is triggered or the maximum number of iterations set by the optimizer is reached.
[0086] S208: Quasi-Newton gradient descent guidance.
[0087] This step provides the algorithmic basis for parameter updates in S207. The L-BFGS-B algorithm has a significant advantage in convergence speed compared to the traditional gradient descent method because it uses curvature information (through the approximation of the Hessian matrix) to adjust the search direction, enabling it to more efficiently approximate the global optimum in the "canyon" terrain of the parameter space.
[0088] S209: Throw a custom global interrupt exception (judgment compliance path).
[0089] If the decision result of S206 is "yes", i.e., NSEk ≥ the preset threshold, the adaptive iteration termination mechanism is immediately activated. The system actively throws a user-defined global interruption exception. In the programming implementation, this exception is a specific type of exception object that inherits from the base exception class, designed to be caught by the global exception capture stack located outside the iteration loop. The effect of throwing the exception is to immediately interrupt the currently executing L-BFGS-B iteration loop, and all subsequent unexecuted iterations are forcibly skipped.
[0090] S210: Lock the optimal parameters and render the final state.
[0091] After the global exception capture stack intercepts the custom exception thrown in step S209, it performs the following final state processing operations: extracts the current parameter combination (Qk, pk) that triggered the interruption exception from the optimizer cache stack and locks it as the globally optimal parameter combination; uses this optimal parameter combination and the corresponding reconstructed pipeline hydraulic configuration file to drive the hydrodynamic engine to perform a final complete calculation and outputs all simulation results, including but not limited to the simulated water level process line of the target node, the simulated inflow process line of each upstream node, and the flow rate and water depth process lines of each pipe segment; saves the optimal parameter values, the corresponding performance indicators (RMSE, NSE, KGE), and the final pipeline model file to the specified directory for subsequent engineering applications.
[0092] Example effect verification: To further verify the reliability and computational efficiency of the method described in this invention in real-world complex urban drainage networks, this embodiment selects a key monitoring node JDYS097096 in a certain urban drainage network and performs a continuous time-series inversion simulation for 15 days. The upstream influence domain of this node covers the combined sewer system and part of the separate stormwater sewer system in the old city area. The network topology exhibits a mixed ring and branching pattern, with a total of 127 nodes (N). A single hydrodynamic calculation takes approximately 3.2 minutes.
[0093] The preset early stopping fit fidelity threshold NSE is 0.85. The initial guesses for the L-BFGS-B optimizer are Q = 1.5 m³ / s and p = 2.0. The boundaries of Q are set to [0.01, 80.0] m³ / s, and the boundaries of p are set to [1.01, 5.0]. The system executes... Figure 1 The entire process is a closed-loop iteration, as shown.
[0094] The experimental results show that during the optimization process of L-BFGS-B, when the algorithm iterated to the 13th round, the NSE index jumped to 0.909, breaking through the preset threshold of 0.85, and immediately triggering... Figure 2The adaptive early stopping mechanism in S206→S209 forcibly intercepts the subsequent preset maximum number of iterations (50). The optimal parameter combination for this round is: Q = 2.37 m³ / s, p = 3.15. Compared to the traditional strategy that requires running the maximum number of iterations, this method saves approximately 74% of the computation time, which is equivalent to gaining more than two hours of valuable advance warning for flood control emergency simulation scenarios.
[0095] Figure 4 This figure shows a time series comparison of simulated and measured water levels driven by the optimal parameter combination in this embodiment. The solid black line represents the measured water level sequence H_obs(t), and the dashed black line represents the simulated water level sequence H_sim(t). The horizontal axis represents the time axis (dates from April 9th to April 17th), and the vertical axis represents the water level elevation. Figure 4 The following key features can be observed visually: First, during the entire 15-day assessment period, the simulated water level sequence and the measured water level sequence showed a high degree of consistency in their overall dynamic trends. The peaks and troughs of the two were precisely aligned in time phase, and the decay rates of the receding water curves were also basically consistent.
[0096] Secondly, during the extreme rainstorm and flood peak period from April 12th to 13th, the measured water level rose sharply and exceeded 3.0 meters. Thanks to the strong nonlinear amplification effect of the peak reduction index p = 3.15, the simulated water level curve accurately matched this measured flood peak exceeding 3.0 meters. This is extremely difficult to achieve in traditional inversion models based on linear conversion or constant coefficient mapping, which often result in a systematic underestimation of the flood peak by 0.3 to 0.8 meters (i.e., the "peak reduction" phenomenon). The simulation results of this method confirm the superior ability of the nonlinear alternative flow calculation equation to reconstruct the flood peak under extreme conditions.
[0097] In terms of numerical accuracy, the Kling-Gupta efficiency coefficient (KGE) corresponding to the optimal model reaches 0.842, indicating that the simulated sequence and the measured sequence perform well in terms of correlation, dispersion, and average deviation. The root mean square error (RMSE) is only 0.1275 meters, which is within the allowable range of practical engineering accuracy for urban drainage systems with water level fluctuations exceeding 3 meters.
[0098] In summary, this embodiment fully demonstrates that the nonlinear inflow inversion and joint optimization method provided by the present invention, through the organic integration of spatially accurate source tracing, nonlinear temporal reconstruction and adaptive early stopping mechanism, effectively solves the problems of flood peak reduction and process line distortion in traditional pipeline calibration, while significantly improving computational efficiency. It also well balances the high fidelity of large-scale complex pipeline hydrodynamic models with the timeliness requirements of flood control emergency simulation, and has strong engineering practical value and broad prospects for promotion and application.
[0099] like Figure 5 As shown, a nonlinear inflow inversion and joint optimization device includes: Memory 30 is used to store computer programs; The processor 31 is used to execute a computer program to implement the steps of the nonlinear inflow inversion and joint optimization method mentioned in the above embodiments.
[0100] The nonlinear inflow inversion and joint optimization device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.
[0101] The processor 31 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 31 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 31 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 31 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 31 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0102] The memory 30 may include one or more computer-readable storage media, which may be non-transitory. The memory 30 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 30 is used to store at least the following computer program, which, after being loaded and executed by the processor 31, is capable of implementing the relevant steps of the nonlinear inflow inversion and joint optimization method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 30 may also include an operating system and data, and the storage method may be temporary or permanent. The operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, the nonlinear inflow inversion and joint optimization method.
[0103] In some embodiments, the nonlinear inflow inversion and joint optimization device may further include a display screen, input / output interfaces, communication interfaces, a power supply, and a communication bus.
[0104] Those skilled in the art will understand that Figure 2 The structure shown does not constitute a limitation on the nonlinear inflow inversion and joint optimization apparatus and may include more or fewer components than shown.
[0105] The nonlinear inflow inversion and joint optimization device provided in this application includes a memory 30 and a processor 31. When the processor 31 executes the program stored in the memory 30, it can realize the nonlinear inflow inversion and joint optimization method.
[0106] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.
[0107] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0108] The foregoing provides a detailed description of a nonlinear inflow inversion and joint optimization method, apparatus, device, and medium provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0109] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A nonlinear flow-inversion and joint optimization method, characterized in that, The method comprises the following steps: obtaining a raw sewer network model file of a target area, extracting the hydraulic connection relationship of nodes and pipe sections and reconstructing into a directed graph space topology model; inputting a target water level monitoring node, using a graph theory routing algorithm to reversely search and extract all upstream connected node sets of the target water level monitoring node as a boundary framework for inflow space allocation; extracting a measured water level time series of the target water level monitoring node within a preset time window, performing resampling and missing value repair processing, and calculating a steady-state water level mean value; introducing a total inflow parameter and an anti-peak clipping index parameter of the whole network, constructing a nonlinear time-varying alternative flow calculation equation based on the dynamic ratio of the real-time observed water level to the steady-state water level mean value; generating a total simulated inflow sequence using the nonlinear time-varying alternative flow calculation equation, and based on the total number of nodes in the upstream connected node set, proportionally mapping the total simulated inflow sequence to each upstream connected node to generate independent node inflow time series; through bottom layer logic dynamic rewriting of the pipe network hydraulic configuration file, clearing historical static dry day flow, and losslessly injecting the newly generated node inflow time series as time series driving data; taking the minimization of the root mean square error of the simulated water level sequence and the measured water level time series as an objective function, under the given physical boundary constraint, using a limited memory quasi-Newton method to perform two-dimensional joint optimization calibration of the total inflow parameter and the anti-peak clipping index parameter of the whole network; in each iteration, calling a hydrodynamic engine to execute the reconstructed pipe network hydraulic configuration file, outputting and reconstructing the node simulated water level sequence; in the iteration process of the two-dimensional joint optimization calibration, a model performance monitoring and evaluation mechanism based on the Nash efficiency coefficient is established; when the Nash efficiency coefficient calculated in a single iteration reaches or breaks through a preset fitting fidelity threshold, an iteration termination mechanism is adaptively triggered, global redundant search is intercepted, and the total inflow parameter and the anti-peak clipping index parameter combination at the time when the mechanism is triggered are determined as the optimal parameter combination.
2. The nonlinear traveltime inversion and joint optimization method of claim 1, wherein, The extraction of all upstream connected node sets of the target water level monitoring node specifically comprises: extracting global pipe section information using a hydraulic engine application programming interface, constructing a directed graph network model conforming to the direction of water flow with the water inlet node of the pipe section as the starting point and the water outlet node as the end point; using a breadth-first search algorithm or a depth-first search algorithm to reversely traverse the directed graph network model starting from the target water level monitoring node, searching and storing all connected upstream water collecting nodes to form the upstream connected node set; when the directed graph network model has local chain breaks or abnormalities that cause reverse traversal failure, the target water level monitoring node itself is generated as the minimum boundary constraint through a bottom layer exception capture mechanism to generate a final inflow space allocation node set.
3. The nonlinear traveltime inversion and joint optimization method of claim 1, wherein, The calculation of the steady-state water level mean value and the construction of the nonlinear time-varying alternative flow calculation equation based on the dynamic ratio of the real-time observed water level to the steady-state water level mean value specifically comprises: in the set model warm-up period and evaluation period, performing fixed time step resampling and linear interpolation completion on the measured water level time series to generate a continuous equidistant water level time series; Intercepting the water level time series data in the evaluation period, calculating its mathematical expectation as the steady-state water level mean; Taking the anti-chipping index parameter as the power function index, taking the ratio of the real-time observed water level to the steady-state water level mean as the base, multiplying the total network inflow parameter to establish an exponential time-varying deduction formula as the nonlinear time-varying replacement flow calculation equation.
4. The nonlinear traveltime inversion and joint optimization method of claim 1, wherein, The bottom layer logic dynamically rewrites the pipe network hydraulic configuration file, clears the historical static dry day flow, and losslessly injects the newly generated node inflow time series as time sequence driving data, specifically including: The total simulation inflow sequence is inversely distributed according to the node total number of the upstream connected node set, generating independent inflow time sequence data of each upstream connected node; When reconstructing the pipe network hydraulic configuration file at the text level, locate the node basic parameter module, and forcibly set the static dry day flow parameters of the relevant upstream connected nodes to zero; Respectively locate the time sequence module and the inflow mounting module, retrieve and safely erase the historical driving data in reverse order according to the node identifier, then append the independent inflow time sequence data and driving mounting instructions, and synchronously update the global simulation time window parameter of the hydrodynamic engine.
5. The nonlinear traveltime inversion and joint optimization method of claim 1, wherein, The objective function is to minimize the root mean square error between the simulation water level sequence and the measured water level time sequence, and the two-dimensional joint optimization rate setting of the total network inflow parameter and the anti-chipping index parameter is carried out under the given physical boundary constraint by using the limited memory quasi-Newton method, specifically including: Set the physical search boundary of the total network inflow parameter and the anti-chipping index parameter; In the optimization iteration domain, the limited memory quasi-Newton method generates a new parameter combination each time, then drives the bottom layer hydrodynamic engine to execute the reconstructed pipe network hydraulic configuration file, and outputs the simulation water level sequence of the target water level monitoring node; Calculate the root mean square error between the simulation water level sequence and the measured water level time sequence as the descent target of the algorithm gradient, and update the parameters iteratively.
6. The nonlinear traveltime inversion and joint optimization method of claim 5, wherein, The model performance monitoring and evaluation mechanism based on the Nash efficiency coefficient is established, specifically including: At the same time of each iteration calculation of the root mean square error, the Nash efficiency coefficient of the simulation water level sequence and the measured water level time sequence is solved simultaneously; In the iteration loop, an event listener is arranged to monitor the Nash efficiency coefficient value of each iteration in real time.
7. The nonlinear traveltime inversion and joint optimization method of claim 6, wherein, The adaptive trigger iteration termination mechanism intercepts the global redundant search, and determines that the combination of the total network inflow parameter and the anti-chipping index parameter when triggering the mechanism is the optimal parameter combination, specifically including: When the event listener monitors that the Nash efficiency coefficient of a single iteration reaches or breaks through the preset fitting fidelity threshold, the system actively throws a custom global interrupt exception, forcibly blocking the subsequent gradient search iteration of the limited memory quasi-Newton method; Extract the current parameter combination in the cache stack that triggers the custom global interrupt exception, and determine the current parameter combination as the optimal parameter combination.
8. The nonlinear traveltime inversion and joint optimization method of claim 6, wherein, The model performance monitoring and evaluation mechanism further includes: At the same time of calculating the root mean square error in each iteration, the Kline-Gupta efficiency coefficient of the simulated water level sequence and the measured water level time sequence is solved to assist in evaluating the model fitting performance.
9. A nonlinear flow-inversion and joint optimization system, comprising: The computer program is executed by a processor to implement the nonlinear inflow inversion and joint optimization method in any one of claims 1-8. A pipe network spatial topology tracing module is configured to import an original pipe network model file and adaptively extract an upstream connected node set of a target water level monitoring node by using a directed graph algorithm. A nonlinear flow deduction module is configured to process the measured water level time sequence, solve a steady-state water level mean value, and generate a time-varying inflow driving sequence according to an exponential water power equation. A hydraulic configuration dynamic reconstruction engine is configured to perform a bottom file input and output operation, clear historical static dry weather flow, and losslessly mount the newly generated time-varying inflow driving sequence. A multi-dimensional joint optimization engine with an early stop mechanism is internally encapsulated with a water dynamics solver and a nonlinear optimizer, takes the minimization of the root mean square error as an objective, uses a limited memory quasi-Newton method to adaptively parameterize total inflow parameters and anti-peak clipping index parameters of the whole network, and uses a Nash efficiency coefficient to establish an iteration termination monitoring mechanism. When the Nash efficiency coefficient reaches a preset threshold, the iteration is forcibly terminated, and an optimal parameter combination is output.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the nonlinear inflow inversion and joint optimization method in any one of claims 1-8.
Citation Information
Patent Citations
SWMM model parameter self-calibration method based on BP neural network
CN110909485A
Method and system for optimizing drainage system pipeline liquid level monitoring equipment under rainfall-free working condition
CN121167961A
SWMM model parameter automatic calibration method
CN121787245A
