A sewer network external water quantitative calculation method based on bayesian inference
Patent Information
- Application Number
- CN202610814608.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-08
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2046-06-08
AI Technical Summary
但由于成本和时间因素,排水管网中对水质水量的采样点位通常非常有限,导致采样结果存在随机性,而不同采样点位利用传统水质水量平衡方法计算得到的外水定量的结果存在巨大差异,影响外水入侵评估的准确性
[0012]根据本发明,可以通过贝叶斯推断融合历史先验与实测数据,有效提高了仅布设少量监测点的情况下估算总体均值的可靠性;推断过程中,通过t分布似然增强了对观测异常值的鲁棒性,实现利用有限数据进行稳健推断;基于后验预测分布对其他波动点位进行概率化补全,实现了有限样本情况下对总体均值的完整推断。
Smart Images

Figure CN122366205B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of municipal drainage pipe networks, and more specifically, to a method for quantitative calculation of external water in drainage pipe networks based on Bayesian inference. Background Technology
[0002] In recent years, due to the aging of drainage systems, a large amount of external water has entered the sewage pipe network, resulting in a decrease in the concentration of influent to sewage treatment plants and low treatment efficiency. Quantitatively assessing the intrusion of external water using regional water quality and quantity balance relationships is a common method in engineering practice. However, due to cost and time factors, the number of sampling points for water quality and quantity in the drainage pipe network is usually very limited, leading to randomness in the sampling results. Furthermore, the quantitative results of external water intrusion calculated using traditional water quality and quantity balance methods vary significantly between different sampling points, affecting the accuracy of external water intrusion assessments.
[0003] The calculation results based on a single water quality sample are highly random. Therefore, a technical solution is needed to reduce the errors caused by random sampling in actual engineering and improve the accuracy of external water intrusion assessment. Summary of the Invention
[0004] To achieve the above objectives, this application provides a method for quantitative calculation of external water in drainage networks based on Bayesian inference, comprising the following steps: Set up n monitoring points to obtain the total outflow of the area. and total export pollutant concentration ; The qualitative flow weight of the baseline value points is determined based on their locations. and weighted qualitative weights Determine the pollutant concentration value at each monitoring point. ; Construct a Bayesian inference model based on the weighted qualitative weights of each monitoring point. Pollutant concentration values Obtain regional background pollutant concentrations The background pollutant concentration in the region The definition of is the weighted average of the background pollutant concentrations of characteristic pollutants of all runoff units within the region, weighted by the flow rate of that runoff unit; Based on regional background pollutant concentrations Total export pollutant concentration C Calculate the ratio β of external water flow in the region to the sum of flow rates of all generating units, and calculate the total external water flow of the drainage network; The method for calculating the total external water flow of the drainage network is as follows: ,in, For the total external water flow of the drainage pipe network, This represents the total outflow of the region.
[0005] Among them, the total outflow of the region and total export pollutant concentration The data is obtained through flow meters and water quality monitoring equipment at the water outlet; Determine qualitative flow weights First, observe the flow rate at the monitoring points where water quality monitoring equipment was installed during the site survey. Based on the observation results, determine the preliminary classification of the flow rate in the area and assign qualitative weights according to the classification. Weighted qualitative weights The calculation method is as follows: ; pollutant concentration values This represents the average real-time pollutant concentration obtained by each water quality monitoring device within the statistical time period.
[0006] Furthermore, constructing a Bayesian inference model includes: Define the probability density function to obtain the parameters to be estimated for the background concentration. ; Define the likelihood function as follows: ,in, The background concentration parameter to be estimated, c wa For weighted sample mean, ν Let D be the degrees of freedom determined by the sample size. i Pollutant concentration values at each monitoring point The sample set constituted The standard error of the weighted sample mean; Construct the kernel function for the posterior distribution; Generate data that follows the posterior distribution through MCMC sampling. The baseline pollutant concentration for the region is obtained by averaging all values in the sample sequence. Regional background pollutant concentration Used to calculate the total external water flow of the drainage network.
[0007] The probability density function is expressed as: , in, The parameter to be estimated is the background concentration. The total outlet pollutant concentration, The maximum background concentration obtained from prior knowledge. The prior mean, The prior standard deviation; in, and Pollutant concentration values obtained from sampling at each monitoring point Generate by performing weighted calculations.
[0008] The posterior distribution is the normalized result of "prior distribution × likelihood function"; The kernel function of the posterior distribution is expressed as: Where D is i Pollutant concentration values at each monitoring point The sample set constituted This is the logarithmic form of the likelihood function. This is the normalization constant.
[0009] Furthermore, the prior mean is calculated. At that time, the pollutant concentration value As the prior center, ensuring that the prior distribution is consistent with the initial direction of the sample information, it is represented as: ,in, For the first i Pollutant concentration values at each monitoring point The normalized weight of this monitoring point. N c represents the total number of baseline wastewater production points. wa This is the weighted sample mean.
[0010] Calculate the prior standard deviation When the prior mean is set as the weighted sample mean c, wa The scale parameter is set to 5 times the standard error (SE) corrected for finite populations, expressed as: ; in, The standard error of the weighted sample mean, and ,in, Here, denoted as standard deviation, and N represents the total number of baseline wastewater production points. It is a finite population correction factor used to correct sampling errors in small samples.
[0011] The further definition of β, the ratio of external water to the sum of all flow units in the region, is as follows: ,in, This represents the flow rate of each flow-generating unit. This indicates the total external water flow rate of the drainage network; The ratio β of external water to the sum of all runoff units in the region can be calculated by concentration, as follows: , in, This refers to the concentration of external water, which is generally a low value and can be judged based on experience.
[0012] According to the present invention, Bayesian inference can be used to integrate historical prior and measured data, which can effectively improve the reliability of estimating the overall mean when only a small number of monitoring points are set up. During the inference process, the robustness to observed outliers is enhanced by the t-distribution likelihood, so as to achieve robust inference using limited data. Based on the posterior prediction distribution, other fluctuating points are probabilistically completed, so as to achieve complete inference of the overall mean in the case of limited samples. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating the steps of a method for quantitative calculation of external water in a drainage network according to an embodiment of the present invention. Figure 2 This is a simulated regional pipeline network topology diagram provided according to an embodiment of the present invention. Detailed Implementation
[0014] The specific implementation of the present invention will now be described in detail with reference to the accompanying drawings.
[0015] The implementation steps of the Bayesian inference-based external water quantity calculation method for drainage networks provided by this invention are as follows: Figure 1 As shown, it includes: Step S100: Deploy n monitoring points and obtain the total outflow of the area. and total export pollutant concentration , where n is the actual number of monitoring points deployed; When setting up monitoring points, each independent drainage network area is considered a separate region. Flow meters and water quality monitoring equipment are installed at the main outlet of the region to obtain the total outflow of the area. and total pollutant concentration If there are multiple water outlets, a flow meter and water quality monitoring equipment shall be installed at each water outlet. In areas within the region where there is no external water interference (such as septic tank outlets, higher elevation points, or other areas where no external water has entered after on-site surveys), n monitoring points shall be selected and water quality monitoring equipment shall be installed as baseline value points, where n≥3, and the larger n is, the better the calculation effect obtained by this invention.
[0016] Get the total outflow of the region When considering the total outlet pollutant concentration C, if there are multiple outlets, the total outflow rate of the area... The sum of the flow rates collected by the flow meters at each outlet; This is the weighted average concentration obtained from the total outlet water quality monitoring equipment, with the weight being the flow rate.
[0017] This invention provides embodiments to simulate the pipe network structure of a certain area, such as... Figure 2As shown, there are 20 background wastewater production points, numbered 1 to 20, each with fluctuations in water volume and quality; point 21 is the main outlet for the region. To analyze the accuracy of the external water quantity measurement in this invention, points 22 to 25 were designed as external water inlets, each producing 5 MLD of external water, with an external water pollutant concentration of 20 mg / L at each inlet. Therefore, the actual external water quantity in this region is 20 MLD.
[0018] Step S110: Determine the qualitative flow weight of the baseline value points based on the location of the monitoring points. and weighted qualitative weights Determine the pollutant concentration value at each monitoring point. ; Determine qualitative flow weights First, observe the flow rate at the monitoring points where water quality monitoring equipment was installed during the site survey. Based on the observation results, determine the preliminary classification of the regional flow rate as large, medium, and small, and assign qualitative weights of 3, 2, and 1 respectively (or simplify to large and small, assign weights of 2 and 1 respectively, or complicate it to large, medium-large, medium-small, and small, assign weights of 4, 3, 2, and 1 respectively, and so on).
[0019] Weighted qualitative weights Then, based on the qualitative weights of the n monitoring points, The calculation method is as follows: .
[0020] Determine the pollutant concentration value at each monitoring point. First, determine the statistical time period (e.g., 1 hour, 8 hours, or 1 day). Then, average the real-time pollutant concentrations obtained from each water quality monitoring device within this statistical time period to generate the pollutant concentration values for the monitoring points during that time period. .
[0021] In the example provided by this invention, water quality monitoring equipment and a flow meter are installed at point 21. From 1 to 20 product sites, three sites (5, 15, and 17) are randomly selected as monitoring sites. The background pollutant concentration is measured, and the daily average value is calculated as the pollutant concentration value. Based on the classification of flow volume, the qualitative flow weights of the three monitoring points are determined. Calculate the weighted qualitative weights and dirt dye Concentration value As shown in Table 1.
[0022] Table 1: Sampling Point Information
[0023] Step S120: Construct a Bayesian inference model based on the weighted qualitative weights of each monitoring point. Pollutant concentration values Obtain the average background pollutant concentration of characteristic pollutants from all runoff-producing units. ; Constructing a Bayesian posterior inference model includes the following steps: 1) Define the probability density function to obtain the parameters to be estimated for the background concentration; Specifically, the probability density function is defined as: ,in, The parameter to be estimated is the background concentration. The prior mean, This represents the prior standard deviation.
[0024] To achieve weak information guidance, and Pollutant concentration values obtained from sampling at each monitoring point Generate by performing weighted calculations.
[0025] First, the weighted pollutant concentration values As the prior center, ensuring that the prior distribution is consistent with the initial direction of the sample information, it is represented as: ,in, For the first i Pollutant concentration values at each monitoring point The normalized weight of this monitoring point (summing to 1). N c represents the total number of baseline wastewater production points. wa The weighted sample mean; To avoid the prior from having an excessive influence on the posterior, a weakly informative normal prior is used, whose location parameters are data-driven: specifically, the prior mean is set as the weighted sample mean c. wa The scale parameter is set to 5 times the standard error (SE) corrected for finite populations, expressed as: ,in, To determine the standard error of the weighted sample mean, a finite population correction factor (FPC) needs to be considered, calculated as follows: ,in, The standard deviation is N, which is the total number of background wastewater production points (estimated from the pipe network topology of the area). It is a finite population correction factor used to correct sampling errors in small samples.
[0026] However, in practical applications, the outlet concentration is the result of the background concentration mixed with a low concentration of external water, and there is a physical constraint that "background concentration ≥ total outlet concentration" (the equality only exists when there is no external water, so it can be simplified to greater than). Therefore, the prior probability density function needs to be modified, expressed as: , in, This represents the total export concentration value. The maximum background concentration obtained from prior knowledge comes from historical data and daily inspections, which can better demonstrate the impact of adding prior knowledge on the judgment of external water.
[0027] In the logarithmic posterior calculation, this constraint manifests as: if or If the prior value of the logarithm is -∞, then unreasonable parameters are excluded.
[0028] 2) Define the likelihood function as follows: , in, ν Let D be the degrees of freedom determined by the sample size. i Pollutant concentration values at each monitoring point The sample set constituted.
[0029] This step uses t The distribution serves as the basis for modeling the likelihood function; compared to the normal distribution, t The heavy-tailed nature of the distribution naturally reduces the weight of outliers and exhibits stronger robustness when the degrees of freedom are small, denoted as... df = n -1 is suitable for scenarios with small samples.
[0030] The logarithmic form of the likelihood function is expressed as: .
[0031] 3) Construct the kernel function of the posterior distribution based on the prior distribution and the likelihood function; According to Bayes' theorem, the posterior distribution is the normalized result of "prior distribution × likelihood function", and its logarithmic form serves as the kernel function of the posterior distribution, expressed as: Where D is i Pollutant concentration values at each monitoring point The sample set constituted This is the logarithmic form of the likelihood function. This is the normalization constant.
[0032] The weak informational nature of the prior distribution ensures that, after fusing the likelihood function, the central tendency of the posterior distribution is dominated by the weighted sample mean. The prior only corrects for extreme outliers, such as when the sample mean is too high, the prior restricts the posterior from exceeding a reasonable physical range.
[0033] 4) Generate a posterior distribution that follows the given distribution through MCMC sampling. The baseline pollutant concentration for the region is obtained by averaging all values in the sample sequence. It is used to calculate the total external water flow of the drainage network.
[0034] Since the posterior distribution of the background concentration has no closed-form solution and is a non-standard complex function subject to strong physical constraints, traditional point estimation methods cannot reliably characterize the parameters. In this step, a Bayesian numerical inference method based on Markov chain Monte Carlo (MCMC) is adopted: by constructing a Markov chain with a stationary distribution of the target posterior, a sample sequence that follows the posterior distribution is generated, and the sample statistics are used to approximate the true posterior characteristics of the parameters, thereby achieving accurate quantification of parameter uncertainty without relying on analytical solutions and the assumption of standard distribution.
[0035] In the initialization phase, traditional methods often employ random uniform sampling or simple sampling based on prior distributions. However, such approaches tend to cause the chain to linger in low-probability regions for extended periods, prolonging the convergence time. Therefore, this step introduces an optimization-guided initialization strategy: first, the L-BFGS-B optimization algorithm is used to perform local extremum search on the negative log-posterior function to obtain a local optimum; then, near the local optimum, a maximum a posteriori estimate is established with a mean of 10 and a standard deviation of 10. -4 The normal distribution generates 64 initial positions as the starting point for each chain. The initialization strategy causes all chains to start from high-density regions, significantly shortening the "climbing" stage and greatly improving sampling efficiency—experimental results show that this method reduces the burn-out period requirement by an average of about 40%, while enhancing the consistency of multi-chain convergence.
[0036] Finally, MCMC sampling generates a distribution that follows the posterior distribution. The baseline pollutant concentration for the region is obtained by averaging all values in the sample sequence. The background pollutant concentration in this area Used to calculate the total external water flow of the drainage network.
[0037] In the case provided by this invention, the calculation results of the finite population correction factor (FPC) are shown in Table 2.
[0038] Table 2 Calculation results of finite population correction factors
[0039] The prior distribution of the background concentration was calculated using a normal distribution, and the relevant parameters are shown in Table 3. Table 3. Calculation Information for Prior Distribution
[0040] The relevant constraints include: lower bound constraint: the background concentration must be greater than the total outlet concentration (i.e., the time-averaged concentration at point 21, 139.20 mg / L); upper bound constraint: the background concentration ≤ 350 mg / L (based on experience).
[0041] When calculating the likelihood function, the t-distribution is used, and the relevant parameters are shown in Table 4: Table 4 Likelihood function parameter information
[0042] When calculating the posterior probability, according to Bayes' theorem, the posterior distribution is proportional to the product of the prior distribution and the likelihood function.
[0043] Subsequent calculations were performed using MCMC sampling, with parameter settings shown in Table 5 and sampling results shown in Table 6.
[0044] Table 5 MCMC Sampling Parameter Settings
[0045] Table 6 MCMC Sampling Results
[0046] Step S130: Based on the weighted average of characteristic pollutants from all generating units Total export pollutant concentration C Calculate the ratio β of external water flow in the region to the sum of flow rates of all generating units, and calculate the total external water flow of the drainage network based on the water quality and quantity balance equation.
[0047] The calculation process for the total external water flow of the drainage network includes the following steps: 1) Ignoring the flow duration during sewage transport, the mass balance equation satisfied by the total effluent volume of the area is determined as follows: , , Where Q represents the total outflow from the region, and C represents the total pollutant concentration at the outlet. and These represent the pollutant concentration and flow rate of each generating unit, respectively. Indicates the concentration of characteristic pollutants in external water. This indicates the total external water flow rate of the drainage network.
[0048] 2) Define the proportionality coefficient β as the ratio of external water to the sum of all runoff units in the region: ; 3) The mass balance equation is transformed and expressed as: , Divide both sides by , is represented as: ,in, The weighted average of characteristic pollutants from all generating units .
[0049] 4) The proportionality constant β can be expressed as: ; In this invention, a weighted average value can be used. Concentration of characteristic pollutants in external water The total outlet pollutant concentration C is calculated as the ratio of the external water flow to the total flow rate of all producing units in the region, β.
[0050] 5) The method for calculating the total external water volume is expressed as follows: .
[0051] In this step, after obtaining the ratio β of all generating flow units, it is combined with the total outflow of the region. Calculate the total external water volume.
[0052] In the case provided by this invention, the relevant parameters for calculating the external water volume and the proportionality coefficient β are shown in Table 7: Table 7 Parameters for calculating external water volume and external water ratio
[0053] The calculation results of the proportionality coefficient β are shown in Table 8: Table 8 Calculation results of the proportionality coefficient β
[0054] The calculation results of external water volume are shown in Table 9: Table 9 Calculation results of external water volume
[0055] Meanwhile, this invention provides methods for calculating external water quantity using the Bayesian algorithm and traditional methods under conditions of 3 sampling points and 6 sampling points, and calculates the error between the external water quantity and the actual external water quantity (20 MLD); the comparison results are shown in Table 10.
[0056] Table 10: Comparison of External Water Quantity Statistics
[0057] As can be seen, when using only 3 sampling points, the error in calculating external water volume based on the average value method is 45.6%, while the error in the estimation result obtained based on Bayesian inference is 28.9%, significantly improving the accuracy of external water volume estimation. When the number of sampling points is increased to 6, the accuracy of both methods is significantly improved, with the errors decreasing to 26.0% and 18.6%, respectively, indicating that the method of this invention still has an accuracy advantage.
[0058] In this invention, Bayesian inference is used to fuse historical prior and measured data, which effectively improves the reliability of estimating the population mean when only a small number of monitoring points are set up. Based on the posterior prediction distribution, other fluctuating points are probabilistically completed, realizing a complete inference of the population mean with limited samples. In the specific process, the robustness to observed outliers is enhanced by the t-distribution likelihood, and sampling errors are corrected by combining finite population correction. Finally, the posterior distribution and confidence interval of the population mean are output, realizing robust inference using limited data.
[0059] The above-disclosed embodiments are merely a few specific examples of the present invention. However, the present invention is not limited thereto, and any variations that can be conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. A method for quantitative calculation of external water flow in drainage pipe networks based on Bayesian inference, characterized in that, Includes the following steps: Set up n monitoring points to obtain the total outflow of the area. and total export pollutant concentration ; The qualitative flow weight of the baseline value points is determined based on their locations. and weighted qualitative weights Determine the pollutant concentration value at each monitoring point. ; Construct a Bayesian inference model based on the weighted qualitative weights of each monitoring point. Pollutant concentration values Obtain regional background pollutant concentrations The background pollutant concentration in the region The definition of is the weighted average of the background pollutant concentrations of all characteristic pollutants generated per unit flow rate within the region. Based on regional background pollutant concentrations Total export pollutant concentration The ratio β of external water flow to the sum of all flow-generating units in the calculation area is used to calculate the total external water flow of the drainage network; wherein, the method for calculating the total external water flow of the drainage network is as follows: ,in, For the total external water flow of the drainage pipe network, This represents the total outflow of the region. The construction of the Bayesian inference model includes: Define the probability density function to obtain the parameters to be estimated for the background concentration. The probability density function is expressed as: ,in, The background concentration is the parameter to be estimated. The total outlet pollutant concentration, The maximum background concentration obtained from prior knowledge. The prior mean, Let be the prior standard deviation; where, and Pollutant concentration values obtained from sampling at each monitoring point Generate by weighted calculation; calculate the prior mean. At that time, the pollutant concentration value As the prior center, ensuring that the prior distribution is consistent with the initial direction of the sample information, it is represented as: ,in, For the first i Pollutant concentration values at each monitoring point This is the weighted qualitative weight for this monitoring point. N c represents the total number of baseline wastewater production points. wa The weighted sample mean; Define the likelihood function; the likelihood function is expressed as: ,in, The background concentration parameter to be estimated, c wa For weighted sample mean, ν Let D be the degrees of freedom determined by the sample size. i Pollutant concentration values at each monitoring point The sample set constituted The standard error of the weighted sample mean; Construct the kernel function of the posterior distribution; the posterior distribution is the normalized result of "prior distribution × likelihood function"; the kernel function of the posterior distribution is expressed as: Where D is i Pollutant concentration values at each monitoring point The sample set constituted Let be the logarithmic form of the likelihood function. This is the normalization constant; Generate a model that follows the posterior distribution through MCMC sampling. The baseline pollutant concentration for the region is obtained by averaging all values in the sample sequence. The background pollutant concentration in the region Used to calculate the total external water flow of the drainage network.
2. The method for quantitative calculation of external water in drainage networks based on Bayesian inference according to claim 1, characterized in that, Total outflow of the region and total export pollutant concentration The data is obtained through flow meters and water quality monitoring equipment at the water outlet; Determine the qualitative flow weight First, observe the flow rate at the monitoring points where water quality monitoring equipment was installed during the site survey. Based on the observation results, determine the preliminary classification of the flow rate in the area and assign qualitative flow weights according to the classification. The weighted qualitative weights The calculation method is as follows: ; The pollutant concentration value This represents the average real-time pollutant concentration obtained by each water quality monitoring device within the statistical time period.
3. The method for quantitative calculation of external water in drainage networks based on Bayesian inference according to claim 1, characterized in that, Calculate the prior standard deviation When the prior mean is set as the weighted sample mean c, wa The scale parameter is set to 5 times the standard error corrected by a finite population, expressed as: ,in, This is the standard error of the weighted sample mean.
4. The method for quantitative calculation of external water in drainage networks based on Bayesian inference according to claim 3, characterized in that, The standard error of the weighted sample mean The calculation method is as follows: ,in, Here, denoted as standard deviation, and N represents the total number of baseline wastewater production points. It is a finite population correction factor used to correct sampling errors in small samples.
5. The method for quantitative calculation of external water in drainage networks based on Bayesian inference according to claim 1, characterized in that, The ratio β of the external water in the region to the sum of all generating flow units is defined as follows: ,in, This represents the flow rate of each flow-generating unit. This indicates the total external water flow rate of the drainage network; The ratio β of the external water in the region to the sum of the flow rates of all generating units is calculated using the following method: ,in, This represents the concentration of characteristic pollutants in external water.
Citation Information
Patent Citations
A Bayesian statistical traceability method for discharging industrial waste water exceeding the standard of sewage pipe network
CN108897964A
Method and system for tracing and positioning pollution of rainwater pipe network
CN121787023A
