Water quality regulation method, device and equipment for water supply network end

By combining a high-resolution water demand model and a multi-component water quality response model, an active drainage intervention scheme is generated, which solves the problem of refined management of water quality control at the end of the water supply network and achieves precise water quality control and resource conservation.

CN122155479APending Publication Date: 2026-06-05GUANGZHOU WATER SUPPLY CO +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU WATER SUPPLY CO
Filing Date
2026-01-13
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing water management strategies are unable to effectively manage water quality at the end of the water supply network, resulting in high flushing costs or poor flushing results, and are unable to effectively address the problem of water quality deterioration at the end of the network.

Method used

By coupling a high-resolution stochastic user water demand model with a multi-component water quality reaction and transport model, a high-resolution pulsed water use sequence is generated. Combined with hydraulic simulation and dynamic reaction models, water quality is predicted and an active drainage intervention scheme is generated to optimize the total drainage volume for precise regulation.

Benefits of technology

It enables precise and dynamic optimization management of water quality at the end of the pipeline network, reduces water consumption and economic costs, improves the foresight and efficiency of water quality control, and avoids the waste of resources associated with traditional flushing strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122155479A_ABST
    Figure CN122155479A_ABST
Patent Text Reader

Abstract

The application relates to a water quality regulation method, device and equipment for a water supply network terminal, which can accurately capture high-frequency water quality dynamics at the terminal of the network by coupling a high-resolution random user water demand model and a multi-component water quality reaction and transportation model considering longitudinal diffusion, and provides a reliable basis for accurate regulation; the multi-component water quality reaction and transportation model is used to screen a candidate scheme set, and a scheme with the lowest water resource consumption and the lowest economic cost is further screened by taking the minimization of total drainage volume as an optimization target, thereby showing great water saving potential and economic benefits and overcoming the defects of resource waste or poor flushing effect of a traditional flushing strategy; for the terminal of the network, which is a high-risk and difficult-to-manage key area, a targeted, dynamic optimization and fine management technical means is provided, and a change from traditional passive response and lag processing to prospective and active risk management based on model prediction is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality management technology for urban water supply networks, and in particular to a method, device, and equipment for regulating water quality at the end of a water supply network. Background Technology

[0002] Drinking water distribution systems are critical infrastructure for safeguarding public health. During the distribution process at the end of the drinking water distribution network, the hydraulic stagnation characteristic leads to areas of prolonged water age, causing water quality deterioration, primarily manifested as: Biological risks: Prolonged water stagnation can cause disinfectant concentrations to drop below the effective threshold, making it unable to inhibit microbial growth and threatening public health and safety. Chemical risks: Prolonged water stagnation can cause corrosion in pipes, especially cast iron pipes, leading to the leaching of heavy metals such as iron and manganese, resulting in "red water" problems and user complaints. Risk of generating byproducts: Disinfectants, such as residual chlorine, can react with organic matter to generate potential carcinogens.

[0003] To address these challenges, existing water management strategies utilize chemical and hydraulic interventions to regulate water quality at the end of the pipe network. However, these methods have significant shortcomings: Chemical intervention: Increasing the amount of residual chlorine added at the water treatment plant can increase the residual chlorine at distant points, but it will significantly increase the risk of disinfection byproducts generated at the front end of the pipeline network. Hydraulic intervention: Setting fixed points and timed flushing; if the flushing frequency is too high, the economic cost will be too high; if the flushing frequency is too low, the flushing effect will be unsatisfactory; it cannot match the high-frequency water quality fluctuations at the end of the pipeline network and cannot manage the water quality at the end of the pipeline network in a refined manner. Summary of the Invention

[0004] Therefore, the purpose of this invention is to provide a method for water quality control at the end of a water supply network, in order to solve the problem that the existing fixed-point or timed flushing of water supply networks cannot accurately manage the water quality of each demand node at the end of the network, resulting in high flushing costs or poor flushing effects.

[0005] A method for water quality control at the end of a water supply network includes the following steps: S10: Obtain water supply data for each demand node in the target pipeline area, perform random simulation processing on the water supply data, and obtain a high-resolution pulsed water consumption sequence for each demand node. S20: Using the pulsed water usage sequence as the input data for hydraulic simulation, and combining it with the set dynamic response file, the water quality of each demand node is predicted for a set time period, and the predicted water quality of each demand node in each time period is obtained. S30: Screen the predicted water quality of each demand node in each time period using a preset water quality safety threshold. If the predicted water quality of any demand node exceeds the water quality safety threshold in a certain time period, mark the demand node as an exceeding node. Perform time series analysis on the exceeding nodes. If the exceeding node has consecutive exceeding periods, set the exceeding node as a risk node and the exceeding period as a risk window. S40: Based on the risk nodes and risk windows, generate a set of decision variables for proactive drainage intervention schemes; perform a Cartesian product operation on the set of decision variables to generate a complete set of candidate schemes containing all discrete combinations; S50: Perform batch water quality prediction on the entire set of candidate schemes according to step S20, screen out the schemes whose predicted water quality compliance rate meets the preset water quality constraints, and form a feasible solution set; with the minimization of total drainage volume as the optimization objective, solve within the feasible solution set to obtain the optimal drainage intervention scheme; S60: Control the discharge devices corresponding to the risk nodes to perform drainage according to the optimal drainage intervention plan.

[0006] Compared with existing technologies, the beneficial effects of this invention are as follows: By coupling a high-resolution stochastic user water demand model with a multi-component water quality reaction and transport model that considers longitudinal diffusion, it can accurately capture high-frequency water quality dynamics at the end of the pipe network, providing a reliable basis for precise regulation; by using a multi-component water quality reaction and transport model to screen the entire set of candidate schemes, and further screening the scheme with the lowest water consumption and lowest economic cost with the goal of minimizing the total drainage volume, it demonstrates huge water-saving potential and economic benefits, overcoming the shortcomings of traditional flushing strategies such as resource waste or poor flushing effect; it provides a targeted, precise, and dynamically optimized refined management technology for the high-risk and difficult-to-manage key area at the end of the pipe network, realizing the transformation from traditional passive response and delayed treatment to forward-looking and proactive risk management based on model prediction.

[0007] Further, step S20 includes the following sub-steps: S21: The EPANET hydraulic solver reads the .inp file corresponding to the pulsed water usage sequence and calculates the hydraulic parameters of the pipe segment velocity, flow rate, and flow direction data that change over time in the target pipe network area based on the .inp file; S22: The EPANET-MSX engine reads the chemical monitoring indicators and corresponding reaction kinetic equations and parameters defined in the .msx file, and establishes and solves the equations based on the total iron release rate R. Fe,t A multi-component water quality kinetic model for the decline of total residual chlorine (TRC) and dissolved oxygen (DO); S23: The EPANET-MSX engine reads the effective longitudinal diffusion coefficient and one-dimensional convection-diffusion-reaction differential equations defined in the .msx file; using hydraulic parameters as the convective transport carrier, and combining the solved multi-component water quality dynamics model and effective longitudinal diffusion coefficient, it numerically solves the one-dimensional convection-diffusion-reaction differential equations to obtain the predicted concentration sequences of total iron, total residual chlorine and dissolved oxygen for each demand node within a set time period, thus forming the predicted water quality for each demand node in each time period.

[0008] Furthermore, the one-dimensional convection-diffusion-reaction differential equations in step S23 satisfy:

[0009] Among them, C i,j It is the concentration of substance i in pipe j as a function of distance x; μ j D is the average flow velocity in pipe j; i R is the effective longitudinal diffusion coefficient of substance i; i,j It is the reaction rate of substance i in pipe j; where total iron, total residual chlorine and dissolved oxygen are all calculated using the above formula.

[0010] Furthermore, the multi-component water quality kinetic model in step S22 includes a description of the total iron release rate R. Fe,t The reaction kinetic equations for the decline in total residual chlorine (TRC) and dissolved oxygen (DO) concentrations are as follows:

[0011] in: Indicates the total iron release rate; C Fe,t C represents the total iron concentration at time t; DO,t C represents the dissolved oxygen concentration at time t; TRC,t Let t represent the total residual chlorine concentration at time t; a represent the iron base release rate of the pipeline; m and n represent dimensionless influencing factors; k1 represents the first-order decay coefficient of dissolved oxygen concentration, and k2 represents the first-order decay coefficient of total residual chlorine concentration; {k1,k2,a,m,n} constitute the reaction kinetic parameters.

[0012] Furthermore, the reaction kinetic parameters {k1,k2,a,m,n} were calibrated by fitting experimental data, and the calibration method is as follows: An optimization algorithm is used to solve for the optimal combination of reaction kinetic parameters {k1,k2,a,m,n} with the objective function of minimizing the root mean square error between the model prediction and the actual observation.

[0013] in, This represents the parameter vector to be calibrated. for Model predictions under given conditions is the actual observed value, and n is the total number of observation points.

[0014] Further, step S10 employs a correlated Poisson rectangular pulse model (COR-PRP model) to perform stochastic simulation processing on the water supply data, including the following steps: S11: The continuous raw flow signals of each demand node in the target pipeline area are decomposed into a series of discrete single equivalent rectangular pulse statistical data sets through the pulse extraction algorithm; S12: Derive behavioral parameters from pulse statistics data set; among which, behavioral parameters include: daily variation pattern of pulse arrival rate λ(t), average pulse arrival frequency μ(k), average pulse intensity μ(I), intensity standard deviation σ(I), maximum duration Max(D), average duration of maximum pulse intensity Max(I) μ(D), duration standard deviation σ(D), and the correlation coefficient between the two ρ(D,I). S13: Using the total water supply of the target pipeline area as a constraint, the expected value of the pulse average intensity μ(I) in the behavior parameter is scaled proportionally so that the simulated total water supply of the generated pulse sequence matches the known total water supply. S14: Input the scaling behavior parameters into the COR-PRP model to generate a high-resolution pulsed water use sequence that conforms to random statistical laws; S15: Convert the pulsed water usage sequence according to the standard input format of EPANET software to generate the .inp file corresponding to the pulsed water usage sequence.

[0015] Furthermore, the candidate solution includes a decision variable, which is represented as follows:

[0016] In the formula, X represents the decision variable corresponding to the candidate solution, and t s t is the start time of drainage. d q represents the duration of drainage. f This refers to the instantaneous flow rate of the drainage.

[0017] Furthermore, the feasible solution set satisfies:

[0018] in: Let X be the feasible solution set; let X be the decision variable {t} of a candidate solution. s , t d , q f}; This represents the water quality compliance rate under decision variable X; It is a preset acceptable threshold; The optimal drainage intervention scheme X* satisfies:

[0019] In the formula, arg min (Argument of the Minimum) represents the independent variable that minimizes the function. This represents the total drainage volume under decision variable X. As the objective function of the optimization problem.

[0020] Meanwhile, this invention provides a water quality control device at the end of a water supply network, comprising: a random user water demand model, a multi-component water quality reaction and transport model, a water quality risk identification module, a drainage intervention scheme candidate set generation module, an optimal drainage intervention scheme generation module, and a demand node drainage control module; wherein: A random user water demand model is used to obtain water supply data of each demand node in the target pipeline area, and to simulate and process the water supply data using a random method to obtain a high-resolution pulsed water consumption sequence for each demand node. A multi-component water quality response and transport model is used to take pulsed water use sequences as hydraulic simulation input data, and combine them with a set kinetic response file to predict the water quality of each demand node for a set time period, so as to obtain the predicted water quality of each demand node in each time period. The water quality risk identification module is used to screen the predicted water quality of each demand node in each time period using a preset water quality safety threshold. If the predicted water quality of any demand node exceeds the water quality safety threshold in a certain time period, the demand node is marked as an exceeding node. The exceeding node is analyzed in time series. If the exceeding node has consecutive exceeding periods, the exceeding node is set as a risk node and the exceeding period is set as a risk window. The drainage intervention scheme candidate set generation module is used to generate a set of decision variables for active drainage intervention schemes based on risk nodes and risk windows; and to perform a Cartesian product operation on the set of decision variables to generate a complete set of candidate schemes containing all discrete combinations. The optimal drainage intervention scheme generation module is used to input the entire set of candidate schemes into the multi-component water quality reaction and transport model for batch water quality prediction, screen out the schemes whose predicted water quality compliance rate meets the preset water quality constraints, and form a feasible solution set; with the minimization of total drainage volume as the optimization objective, the optimal drainage intervention scheme is obtained by solving within the feasible solution set; The demand node drainage control module is used to control the corresponding discharge device at the risk node to perform drainage according to the optimal drainage intervention plan.

[0021] Compared with the prior art, the beneficial effects of the water quality control device at the end of the water supply network proposed in this invention are the same as those of the water quality control method at the end of the water supply network, and will not be repeated here. Attached Figure Description

[0022] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings.

[0023] Figure 1 This is a schematic diagram of the water quality control device at the end of the water supply network according to the present invention; Figure 2 This is a flowchart of the water quality control method at the end of the water supply network according to the present invention; Figure 3 This is a schematic diagram of the pipeline structure of an embodiment of the present invention; Figure 4 This is a comparison chart of the calibration results of the multi-component water quality reaction and transport model of the present invention. Figure 4 (a) represents the total residual chlorine (TRC). Figure 4 (b) represents dissolved oxygen (DO). Figure 4 (c) represents total iron; Figure 5 for Figure 3 A spatial distribution map of water quality prior to the implementation of this invention. Figure 5 (a) represents the total iron concentration. Figure 5 (b) represents the total residual chlorine TRC concentration; Figure 6 for Figure 5 A water quality time series analysis diagram of a typical risk node (Node 30) before the implementation of this invention. Figure 6 (a) represents the total residual chlorine (TRC) concentration. Figure 6 (b) represents total iron; Figure 7 for Figure 5 A comparative chart of water quality time series analysis of a typical risk node (Node 30) before and after the implementation of this invention. Figure 7 (a) represents the total residual chlorine (TRC) concentration. Figure 7 (b) represents total iron. Detailed Implementation

[0024] The technical solutions of the present invention will now be clearly and completely described with reference to the accompanying drawings of the embodiments of the present invention. The described embodiments are merely some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the protection scope of the present invention.

[0025] The present invention provides a method for regulating water quality at the end of a water supply network, which is implemented by a water quality regulation device at the end of a water supply network.

[0026] Please see Figure 1 and Figure 2The water quality control device at the end of the water supply network includes a random user water demand model, a multi-component water quality reaction and transport model, a water quality risk identification module, a drainage intervention scheme candidate set generation module, an optimal drainage intervention scheme generation module, and a demand node drainage control module.

[0027] The random user water demand model is used to perform step S10: obtain water supply data of each demand node in the target pipeline area, perform random simulation processing on the water supply data, and obtain a high-resolution pulsed water consumption sequence for each demand node.

[0028] In specific implementation, the water supply data includes total water supply data for the target pipeline area and high-frequency flow monitoring data from user terminals at the pipeline end, such as raw flow data with a 1-second resolution. The target pipeline area includes several designated pipeline ends; for example, please refer to [link to relevant documentation]. Figure 3 The target pipeline area includes 40 pipeline terminals, 34 demand nodes, and 1 water source.

[0029] A Correlated Poisson Rectangular Pulse (COR-PRP) model is used as a stochastic user water demand model. The water supply data is simulated using stochastic methods, specifically including the following steps: S11: The continuous raw flow signals of each demand node in the target pipeline area are decomposed into a series of discrete single equivalent rectangular pulse statistical data sets through the pulse extraction algorithm.

[0030] The specific steps include: SA11: Sets a non-zero flow threshold, and identifies raw flow signals that are continuously higher than the threshold as an independent water use event; SA12: For each identified water usage event, calculate its duration, i.e. the time difference from the start to the end of the event, as the pulse duration D, and calculate the average flow rate during that period as the pulse intensity I; SA13: Transforms the continuously changing raw flow signal into a series of discrete single equivalent rectangular pulses (SERPs) defined by intensity I and duration D, and statistically derives the probability distribution of pulse intensity I and duration D and their correlation parameters.

[0031] S12: Derive behavioral parameters from pulse statistics data set.

[0032] Specifically, the behavioral parameters include: the daily variation pattern of pulse arrival rate λ(t), the average pulse arrival frequency μ(k), the average pulse intensity μ(I), the intensity standard deviation σ(I), the maximum duration Max(D), the average duration of the maximum pulse intensity Max(I) μ(D), the duration standard deviation σ(D), and the correlation coefficient between the two ρ(D,I).

[0033] S13: Using the total water supply of the target pipeline area as a constraint, the expected value of the pulse average intensity μ(I) in the behavior parameter is scaled proportionally so that the simulated total water supply of the generated pulse sequence matches the known total water supply. S14: Input the scaling behavior parameters into the COR-PRP model to generate a high-resolution pulsed water usage sequence that conforms to random statistical laws.

[0034] Specifically, for a demand node containing N households, the output is Q(t), which is a linear superposition of N independent COR-PRP sequences.

[0035] S15: Convert the pulsed water usage sequence according to the standard input format of EPANET software to generate the .inp file corresponding to the pulsed water usage sequence.

[0036] The final output .inp file of the COR-PRP model serves as the configuration file for the EPANET hydraulic solver, enabling seamless coupling between the stochastic user water demand model and the multi-component water quality reaction and transport model.

[0037] To balance simulation accuracy and computational efficiency, the second-level sequence was averaged into a time pattern with a 5-minute step size and applied to all demand nodes to form high-resolution water demand input data.

[0038] The multi-component water quality reaction and transport model is used to perform step S20: using the pulsed water use sequence as hydraulic simulation input data, and combining it with the set kinetic reaction file to predict the water quality of each demand node for a set time period, so as to obtain the predicted water quality of each demand node in each time period.

[0039] In specific implementation, a multi-component water quality kinetic model coupling total residual chlorine (TRC), dissolved oxygen (DO), and total iron (Fe) is constructed based on the EPANET platform. This model obtains the defined chemical monitoring indicators and their corresponding reaction kinetic parameters by reading the kinetic reaction file. Combined with the hydraulic conditions generated by pulsed water use sequences, a system of differential equations containing convection, diffusion, and reaction terms is numerically solved to obtain the predicted concentration values ​​of chemical monitoring indicators for each demand node at each time period. The kinetic reaction file is a .msx file. The specific steps include the following.

[0040] S21: The EPANET hydraulic solver reads the .inp file corresponding to the pulsed water usage sequence and calculates the hydraulic parameters of the pipe segment velocity, flow rate, and flow direction data that change over time in the target pipe network area based on the .inp file.

[0041] S22: The EPANET-MSX engine reads the chemical monitoring indicators and corresponding reaction kinetic equations and parameters defined in the .msx file, and establishes and solves the equations based on the total iron release rate R. Fe,t A multi-component water quality kinetic model for the decline of total residual chlorine (TRC) and dissolved oxygen (DO) was developed, in which the chemical monitoring indicators included total residual chlorine (TRC), dissolved oxygen (DO), and total iron (Fe).

[0042] The multi-component water quality kinetic model is a reaction kinetic equation coupling total residual chlorine (TRC), dissolved oxygen (DO), and total iron (Fe) decay; where the total iron release rate R... Fe,t The effects of the basic release rate, dissolved oxygen (DO) concentration, and total residual chlorine (TRC) concentration are comprehensively considered, as shown in Equation (1); the decay models of total residual chlorine (TRC) and dissolved oxygen (DO) are modeled using first-order reaction kinetics, as shown in Equations (2) and (3).

[0043]

[0044] Among them, C Fe,t C represents the total iron concentration at time t; DO,t C represents the dissolved oxygen concentration at time t; TRC,t Let t represent the total residual chlorine concentration at time t; a represent the basic release rate of iron from the pipeline; m and n represent dimensionless influencing factors; k1 represents the first-order decay coefficient of dissolved oxygen concentration, and k2 represents the first-order decay coefficient of total residual chlorine concentration. {k1,k2,a,m,n} constitute the reaction kinetic parameters.

[0045] Furthermore, to ensure that the multi-component water quality kinetic model can accurately reflect the water quality change characteristics within the pipe network, the reaction kinetic parameters {k1,k2,a,m,n} were calibrated by fitting experimental data. The specific calibration method is as follows: An optimization algorithm is used to solve for the optimal combination of reaction kinetic parameters {k1,k2,a,m,n} by minimizing the root mean square error between the model prediction and the actual observation, as shown in Equation (5).

[0046]

[0047] in, This represents the parameter vector to be calibrated. for Model predictions under given conditions is the actual observed value, and n is the total number of observation points.

[0048] Specifically, the optimization algorithm uses the Genetic Algorithm (GA).

[0049] S23: The EPANET-MSX engine reads the effective longitudinal diffusion coefficient and one-dimensional convection-diffusion-reaction differential equations defined in the .msx file; using hydraulic parameters as the convective transport carrier, and combining the solved multi-component water quality dynamics model and effective longitudinal diffusion coefficient, it numerically solves the one-dimensional convection-diffusion-reaction differential equations to obtain the predicted concentration sequences of total iron, total residual chlorine and dissolved oxygen for each demand node within a set time period, thus forming the predicted water quality for each demand node in each time period.

[0050] The spatiotemporal evolution of total iron, total residual chlorine and dissolved oxygen concentrations were all solved using a one-dimensional convection-diffusion-reaction differential equation system, which is shown in (4):

[0051] Among them, C i,j It is the concentration of substance i in pipe j as a function of distance x; μ j D is the average flow velocity in pipe j; i R is the effective longitudinal diffusion coefficient of substance i; i,j The reaction rate of substance i in pipe j is defined by the multi-component water quality kinetic model in step S22 above. An effective longitudinal diffusion coefficient Di is introduced when solving for the concentration to correct the errors of the traditional plug flow model and improve the accuracy of simulation in the low-velocity region at the end of the pipe network.

[0052] The set time period is set to 24h~48h.

[0053] Using pulsed water usage sequences as input data for hydraulic simulation, combined with a predefined kinetic reaction file (.msx file), the EPANET platform is driven to perform multi-component water quality tracking. By coupling hydraulic and water quality processes, the decay patterns of residual chlorine and dissolved oxygen during transport and the impact of iron release on water quality are simulated, predicting the water quality of each demand node at different time periods. This provides a basis for effectively identifying demand nodes prone to water quality deterioration in low-flow-rate areas and nodes with long residence times, and for water quality risk warnings.

[0054] The water quality risk identification module is used to perform step S30: screening the predicted water quality of each demand node in each time period using a preset water quality safety threshold; if the predicted water quality of any demand node exceeds the water quality safety threshold in a certain time period, the demand node is marked as an exceeding node; performing time series analysis on the exceeding nodes; if the exceeding node has consecutive exceeding periods, the exceeding node is set as a risk node, and the exceeding period is set as a risk window.

[0055] In practice, the water quality safety threshold is set according to requirements, such as the total residual chlorine concentration C. TRC ≥0.05 mg / L and total iron concentration C Fe ≤0.3 mg / L.

[0056] The drainage intervention scheme candidate set generation module is used to perform step S40: based on risk nodes and risk windows, generate a set of decision variables for active drainage intervention schemes; perform a Cartesian product operation on the decision variable set to generate a complete set X of candidate schemes containing all discrete combinations. all .

[0057] The candidate solution includes a decision variable, which is represented as follows:

[0058] In the formula, X represents the decision variable corresponding to the candidate solution, and t s t is the start time of drainage. d q represents the duration of drainage. f This refers to the instantaneous flow rate of the drainage.

[0059] In practice, risk nodes are directly used as drainage nodes for proactive intervention, while risk windows provide a basis for the initiation time of subsequent drainage operations.

[0060] The decision variable set of the active drainage intervention scheme includes the candidate set T for the start time. candidate Candidate set of duration T duration Instantaneous flow candidate set Q flush .

[0061] Startup time candidate set T candidate Based on the risk window, it is generated by covering the risk's inception time and its adjacent time periods with a certain time step, and its range is set to [t]. start -Δ tpre , t start The data is then discretized at fixed time intervals (e.g., 5 minutes) consistent with the time step of the water quality prediction described in step S20, aiming to capture the optimal early intervention time to effectively curb water quality deterioration. For example, combining steps S10-S30, if it is predicted that water quality will exceed standards between [8:30-09:30], then the set of initiation times T is... candidate A series of time points will be set before 8:30, such as [07:00, ..., 08:00, 08:05, 08:10, 08:15, 08:20, 08:25], with a time step of 5 minutes, to ensure that drainage is started before the risk window arrives in order to effectively replace the water stuck in the pipe section.

[0062] Duration candidate set T durationBased on the retention volume and displacement efficiency of the terminal pipeline, the system covers a range of possibilities from short-term displacement to deep flushing, balancing displacement precision with solution space scale. For example, the candidate set T for duration... duration The drainage duration is set as [30s, 1min, 2min, 3min, 5min, 8min, 10min, 15min, 30min, 40min, 50min, 1h], covering a variety of working conditions from short-term flushing to full-scale rinsing.

[0063] Instantaneous flow candidate set Q flush Limited by the physical water conveyance capacity of the pipeline network and the operational limits of drainage facilities, the lower limit of the flow rate must meet the minimum flushing velocity requirement to effectively remove deposits from the pipe wall, while the upper limit of the flow rate must be lower than the maximum design flow velocity of the pipeline and the lower limit of the service pressure at the demand node to avoid water hammer effects or the risk of water supply interruption. For example, the instantaneous flow rate candidate set Q... flush Set to [0.1L / s, 0.2L / s, 0.3L / s, 0.5L / s, 0.8L / s, 1.0L / s] to ensure that the minimum flushing velocity is met and does not exceed the safe water delivery capacity of the pipeline.

[0064] For the candidate set T of start time candidate Candidate set of duration T duration Instantaneous flow candidate set Q flush Perform a Cartesian product to generate a complete set X of candidate solutions containing all possible combinations. all .

[0065] The optimal drainage intervention scheme generation module is used to perform step S50: generate the entire set of candidate schemes X all The data is input into a multi-component water quality reaction and transport model for batch simulation. Schemes that predict water quality compliance rates that meet preset water quality constraints are selected, forming a feasible solution set. With the goal of minimizing the total drainage volume, the feasible solution set... The optimal drainage intervention scheme X* is obtained through internal solution.

[0066] Feasible solution set satisfy:

[0067] in: Let X be the set of all possible candidate solutions; let X be the decision variable {t} of a candidate solution. s ,t d , q f}; It is the water quality compliance rate under decision variable X; It is a preset acceptable threshold, for example, such as setting... =95%.

[0068] The optimal drainage intervention scheme X* is represented as:

[0069] In the formula: arg min (Argument of the Minimum) represents finding the independent variable that minimizes the function, i.e., the value of the decision variable X. This represents the total drainage volume under decision variable X. As the objective function of the optimization problem.

[0070] This operation means finding feasible solutions that meet water quality requirements. In the process, the volume of flushing that makes the objective function effective is selected. The scheme that reaches the minimum value is identified as the optimal drainage intervention scheme X*.

[0071] By using a multi-component water quality reaction and transport model, the changes in total residual chlorine concentration, total iron concentration, and dissolved oxygen concentration at each demand node in the pipeline network under various candidate schemes were calculated. The optimal drainage intervention scheme, which minimizes costs and ensures water quality indicators remain within acceptable limits during the predicted period of exceedance, was then selected. This intervention scheme comprehensively considers drainage volume, operation frequency, and water quality response effects, outputting the optimal solution X*={t s , t d , q f}and The minimum value is reached, and control commands are triggered to the corresponding emission device for execution.

[0072] This solution achieves precise control of water quality risks through dynamic optimization, minimizing water waste while ensuring water supply security. Combining real-time monitoring data with predictive models, the device can automatically update the candidate set and re-evaluate the optimal strategy, adapting to changes in pipeline network operating conditions. The final generated instructions include precise start-up times, discharge durations, and instantaneous flow rates, ensuring intervention measures are executed at the right time and with appropriate intensity, thereby effectively maintaining stable water quality at the end of the pipeline network.

[0073] The demand node drainage control module is used to execute step S60: control the corresponding discharge device of the risk node to perform drainage according to the optimal drainage intervention plan X*.

[0074] Implementation Cases Please see Figure 3The target pipeline area in this embodiment of the invention includes 40 pipeline terminals, 34 demand nodes, and 1 water source. The 40 pipeline terminals are divided into 6 groups. Using the observation data from 10 designated monitoring demand nodes (7, 13, 15, 16, 20, 31, 32, 33, 35, 36) as a benchmark, a genetic algorithm (GA) is used as the optimization tool. The demand nodes are selected with the objective of minimizing the root mean square error (RMSE) between the simulated and observed values. Calibration is performed on the five dynamic parameters θ={k1,k2, a, m, n} of the 6 groups of pipelines.

[0075] Please see Figure 4 The calibration results show that the predicted values ​​of the multi-component water quality response and transport model are in high agreement with the observed values, with the scatter plots closely distributed around the 1:1 diagonal. The coefficients of determination (R²) for total residual chlorine (TRC), dissolved oxygen (DO), and total iron reached 0.996, 0.998, and 0.991, respectively; indicating that the calibrated model has high fidelity and can be used for subsequent prediction and control.

[0076] Please see Figure 5 In the implementation case, the water quality deterioration areas were highly concentrated at the end branches of the pipe network, such as near the demand node Node 30, characterized by high total iron concentration ( Figure 5 (a) and low total residual chlorine TRC concentration ( Figure 5 (b) overlaps.

[0077] Then, Node 30, the required node, was selected for time series analysis. Please refer to [link / reference]. Figure 6 During the simulation period, the total residual chlorine (TRC) concentration at this node repeatedly fell below the threshold of 0.05 mg / L. Figure 6 The red shaded area in (a) also indicates that the total iron concentration exceeds the standard. Figure 6 The red shaded area in (b) shows a peak concentration exceeding 0.32 mg / L. Based on this, Node 30 is identified as a risk node, and... Figure 6 The period indicated by the shaded area is designated as the risk window.

[0078] Based on the aforementioned risk nodes and risk windows, 34,500 candidate solutions, encompassing all discrete combinations, were generated. Water quality simulations were then performed on these 34,500 candidate solutions using parallel computing. After screening, 24,576 solutions were found to meet the water quality constraints, meaning they completely eliminated [the constraints]. Figure 6 The risks shown constitute a feasible solution set, with feasible solutions accounting for 71.2%.

[0079] From the 24,576 feasible solutions mentioned above, the optimal solution was found with the goal of minimizing the total drainage volume. The final determined optimal drainage strategy is: to start the drainage process at 03:30 AM every day (t...). s ), lasting 105 minutes (t)d The drainage flow rate is 0.568 L / s (q f The water consumption for a single intervention in this scheme is 3577.2L.

[0080] The above optimal drainage strategy was applied to the model for verification, and the results are as follows: Figure 7 As shown. Figure 7 The blue curve in the figure represents the baseline simulation without intervention (i.e., before regulation, the baseline). Figure 6 The red curve represents the simulation results after implementing the optimal strategy of this invention. For example... Figure 7 As shown in (a), after the control measures were implemented, the total residual chlorine (TRC) concentration that had previously fallen below the 0.05 mg / L threshold (blue curve) was completely eliminated, and the total residual chlorine (TRC) remained stably above the safe threshold throughout the entire cycle (red curve). Figure 7 As shown in (b), after the regulation was implemented, the peak total iron concentration, which originally exceeded 0.3 mg / L, was significantly reduced and remained below the safety limit (red curve).

[0081] Compared with existing technologies, the beneficial effects of this invention are as follows: By coupling a high-resolution stochastic user water demand model with a multi-component water quality reaction and transport model considering longitudinal diffusion, it can accurately capture high-frequency water quality dynamics at the end of the pipeline network, providing a reliable basis for precise regulation; the hierarchical optimization framework ensures that the solution with the lowest water consumption and economic cost is selected from all solutions that can solve the problem, demonstrating huge water-saving potential and economic benefits, and overcoming the resource waste defects of traditional flushing strategies; it provides a targeted, precise, and dynamically optimized refined management technology for the high-risk and difficult-to-manage critical area at the end of the pipeline network, realizing the transformation from traditional passive response and delayed treatment to forward-looking and proactive risk management based on model prediction.

[0082] Meanwhile, the water quality control device at the end of the water supply network is stored in an electronic device and is executed by the electronic device to implement the water quality control method at the end of the water supply network.

[0083] The electronic devices include, but are not limited to, memory, processor, and network interface that can communicate with each other via a device bus.

[0084] The electronic device can be a rack server, blade server, tower server, or cabinet server, or other computing device. The electronic device can be a standalone server or a server cluster composed of multiple servers. The memory includes at least an SD card and an electrically erasable programmable read-only memory (EEPROM). The memory can be an internal storage unit of the electronic device, such as a hard drive or RAM. The memory can also be an external storage device of the electronic device, such as a plug-in hard drive or a Secure Digital (SD) card. The memory may also include both internal and external storage units of the electronic device.

[0085] The processor can be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. This processor is typically used to control the overall operation of the electronic device, such as performing control and processing related to data interaction or communication with the electronic device. The processor is used to run program code stored in the memory or process data, for example, to run the water quality control method at the end of the water supply network.

[0086] The network interface may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the electronic device and other electronic devices. For example, the network interface is used to connect the electronic device to an external data platform via a network, establishing a data transmission channel and communication connection between the electronic device and the external data platform. The network may be an intranet, the Internet, Global System for Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, or other wireless or wired networks.

[0087] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.

[0088] Furthermore, the use of terms such as "first" and "second" in this invention is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" and "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.

[0089] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and the present invention also intends to include these modifications and variations.

Claims

1. A method for water quality control at the end of a water supply network, characterized in that, Includes the following steps: S10: Obtain water supply data for each demand node in the target pipeline area, perform random simulation processing on the water supply data, and obtain a high-resolution pulsed water consumption sequence for each demand node. S20: Using the pulsed water usage sequence as the input data for hydraulic simulation, and combining it with the set dynamic response file, the water quality of each demand node is predicted for a set time period, and the predicted water quality of each demand node in each time period is obtained. S30: Screen the predicted water quality of each demand node in each time period using a preset water quality safety threshold. If the predicted water quality of any demand node exceeds the water quality safety threshold in a certain time period, mark the demand node as an exceeding node. Perform time series analysis on the exceeding nodes. If the exceeding node has consecutive exceeding periods, set the exceeding node as a risk node and the exceeding period as a risk window. S40: Generate a set of decision variables for proactive drainage intervention schemes based on risk nodes and risk windows; Perform a Cartesian product operation on the set of decision variables to generate a complete set of candidate solutions containing all discrete combinations; S50: Perform batch water quality prediction on the entire set of candidate schemes according to step S20, screen out the schemes whose predicted water quality compliance rate meets the preset water quality constraints, and form a feasible solution set; with the minimization of total drainage volume as the optimization objective, solve within the feasible solution set to obtain the optimal drainage intervention scheme; S60: Control the discharge devices corresponding to the risk nodes to perform drainage according to the optimal drainage intervention plan.

2. The water quality control method at the end of a water supply network according to claim 1, characterized in that, Step S20 includes the following sub-steps: S21: The EPANET hydraulic solver reads the .inp file corresponding to the pulsed water usage sequence and calculates the hydraulic parameters of the pipe segment velocity, flow rate, and flow direction data that change over time in the target pipe network area based on the .inp file; S22: The EPANET-MSX engine reads the chemical monitoring indicators and corresponding reaction kinetic equations and parameters defined in the .msx file, and establishes and solves the equations based on the total iron release rate R. Fe,t A multi-component water quality kinetic model for the decline of total residual chlorine (TRC) and dissolved oxygen (DO); S23: The EPANET-MSX engine reads the effective longitudinal diffusion coefficient and one-dimensional convection-diffusion-reaction differential equations defined in the .msx file; using hydraulic parameters as the convective transport carrier, and combining the solved multi-component water quality dynamics model and effective longitudinal diffusion coefficient, it numerically solves the one-dimensional convection-diffusion-reaction differential equations to obtain the predicted concentration sequences of total iron, total residual chlorine and dissolved oxygen for each demand node within a set time period, thus forming the predicted water quality for each demand node in each time period.

3. The water quality control method at the end of the water supply network according to claim 2, characterized in that, The one-dimensional convection-diffusion-reaction differential equations in step S23 satisfy: Among them, C i,j It is the concentration of substance i in pipe j as a function of distance x; μ j D is the average flow velocity in pipe j; i R is the effective longitudinal diffusion coefficient of substance i; i,j It is the reaction rate of substance i in pipe j; where total iron, total residual chlorine and dissolved oxygen are all calculated using the above formula.

4. The water quality control method at the end of the water supply network according to claim 3, characterized in that, The multi-component water quality dynamics model in step S22 includes a description of the total iron release rate R. Fe,t The reaction kinetic equations for the decline in total residual chlorine (TRC) and dissolved oxygen (DO) concentrations are as follows: in: Indicates the total iron release rate; C Fe,t C represents the total iron concentration at time t; DO,t C represents the dissolved oxygen concentration at time t; TRC,t Let t represent the total residual chlorine concentration at time t; a represent the iron base release rate of the pipeline; m and n represent dimensionless influencing factors; k1 represents the first-order decay coefficient of dissolved oxygen concentration, and k2 represents the first-order decay coefficient of total residual chlorine concentration; {k1,k2,a,m,n} constitute the reaction kinetic parameters.

5. The water quality control method at the end of the water supply network according to claim 4, characterized in that, The reaction kinetic parameters {k1,k2,a,m,n} were calibrated by fitting experimental data, and the calibration method is as follows: An optimization algorithm is used to solve for the optimal combination of reaction kinetic parameters {k1,k2,a,m,n} with the objective function of minimizing the root mean square error between the model prediction and the actual observation. in, This represents the parameter vector to be calibrated. for Model predictions under given conditions is the actual observed value, and n is the total number of observation points.

6. The water quality control method at the end of a water supply network according to claim 1, characterized in that, Step S10 uses a correlated Poisson rectangular pulse model (COR-PRP model) to simulate the water supply data using a stochastic method, including the following steps: S11: The continuous raw flow signals of each demand node in the target pipeline area are decomposed into a series of discrete single equivalent rectangular pulse statistical data sets through the pulse extraction algorithm; S12: Derive behavioral parameters from pulse statistics data set; among which, behavioral parameters include: daily variation pattern of pulse arrival rate λ(t), average pulse arrival frequency μ(k), average pulse intensity μ(I), intensity standard deviation σ(I), maximum duration Max(D), average duration of maximum pulse intensity Max(I) μ(D), duration standard deviation σ(D), and the correlation coefficient between the two ρ(D,I). S13: Using the total water supply of the target pipeline area as a constraint, the expected value of the pulse average intensity μ(I) in the behavior parameter is scaled proportionally so that the simulated total water supply of the generated pulse sequence matches the known total water supply. S14: Input the scaling behavior parameters into the COR-PRP model to generate a high-resolution pulsed water use sequence that conforms to random statistical laws; S15: Convert the pulsed water usage sequence according to the standard input format of EPANET software to generate the .inp file corresponding to the pulsed water usage sequence.

7. The method for water quality control at the end of a water supply network according to claim 1, characterized in that, The candidate solution includes a decision variable, which is represented as follows: In the formula, X represents the decision variable corresponding to the candidate solution, and t s t is the start time of drainage. d q represents the duration of drainage. f This refers to the instantaneous flow rate of the drainage.

8. The method for water quality control at the end of a water supply network according to claim 1, characterized in that, The feasible solution set satisfies: in: Let X be the feasible solution set; let X be the decision variable {t} of a candidate solution. s , t d , q f }; This represents the water quality compliance rate under decision variable X; It is a preset acceptable threshold; The optimal drainage intervention scheme X* satisfies: In the formula, arg min (Argument of the Minimum) represents the independent variable that minimizes the function. This represents the total drainage volume under decision variable X. As the objective function of the optimization problem.

9. A water quality control device at the end of a water supply network, characterized in that, This includes a stochastic user water demand model, a multi-component water quality response and transport model, a water quality risk identification module, a drainage intervention candidate set generation module, an optimal drainage intervention generation module, and a demand node drainage control module; among which: A random user water demand model is used to obtain water supply data of each demand node in the target pipeline area, and to simulate and process the water supply data using a random method to obtain a high-resolution pulsed water consumption sequence for each demand node. A multi-component water quality response and transport model is used to take pulsed water use sequences as hydraulic simulation input data, and combine them with a set kinetic response file to predict the water quality of each demand node for a set time period, so as to obtain the predicted water quality of each demand node in each time period. The water quality risk identification module is used to screen the predicted water quality of each demand node in each time period using a preset water quality safety threshold. If the predicted water quality of any demand node exceeds the water quality safety threshold in a certain time period, the demand node is marked as an exceeding node. The exceeding node is analyzed in time series. If the exceeding node has consecutive exceeding periods, the exceeding node is set as a risk node and the exceeding period is set as a risk window. The drainage intervention scheme candidate set generation module is used to generate a set of decision variables for active drainage intervention schemes based on risk nodes and risk windows; and to perform a Cartesian product operation on the set of decision variables to generate a complete set of candidate schemes containing all discrete combinations. The optimal drainage intervention scheme generation module is used to input the entire set of candidate schemes into the multi-component water quality reaction and transport model for batch water quality prediction, screen out the schemes whose predicted water quality compliance rate meets the preset water quality constraints, and form a feasible solution set; with the minimization of total drainage volume as the optimization objective, the optimal drainage intervention scheme is obtained by solving within the feasible solution set; The demand node drainage control module is used to control the corresponding discharge device at the risk node to perform drainage according to the optimal drainage intervention plan.

10. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, and when the programs or instructions are executed by the processor, they implement the steps of the water quality control method at the end of the water supply network according to any one of claims 1 to 8.