A method and system for tracing the source of surface water pollution based on Bayesian inference
By introducing the likelihood function and Bayesian inversion based on concentration and gradient information, the instability problem of tracing multiple pollution sources under low-precision observation conditions is solved, and efficient source tracing with automatic determination of the number of pollution sources and multi-source inversion is achieved.
Patent Information
- Application Number
- CN202611348889.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-02
- Publication Date
- 2026-11-17
AI Technical Summary
Existing surface water pollution source tracing methods based on Bayesian inference are unstable under low-precision observation conditions, have difficulty handling scenarios with multiple pollution sources, and require a preset number of pollution sources, leading to unstable and failed source tracing results.
By acquiring pollutant concentration and gradient information, a likelihood function is constructed. Combining Bayes' theorem and the DE-MCMC algorithm, the number of pollution sources is automatically determined. Multi-source inversion is performed using the joint error function of concentration and gradient, and a physical constraint prior space is introduced to avoid label switching problems.
It improves the robustness of source tracing under low-precision observation conditions, can automatically determine the number of pollution sources, simplifies the multi-source inversion process, and enhances the practicality and automation of source tracing.
Smart Images

Figure CN123117544A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pollution source tracing technology, and in particular to a method and system for tracing the source of surface water pollution based on Bayesian inference. Background Technology
[0002] Sudden water pollution incidents are characterized by their high degree of concealment, wide range of harm, and short emergency response time. After a pollution incident occurs, quickly and accurately tracing the location of the pollution source, the start time of discharge, and the discharge volume is crucial for determining responsibility, implementing source control, and developing emergency response plans. Existing source tracing methods are mainly divided into two categories: deterministic methods and uncertainty methods. Deterministic methods include regularization methods and optimization methods, which solve for pollution source parameters by minimizing the difference between simulated and observed concentrations through the construction of optimization models. However, these methods typically only provide a single optimal solution and are difficult to quantify the uncertainty of the inversion results. Uncertainty methods based on Bayesian inference transform the source tracing problem into a sampling problem of the posterior probability density of parameters, providing the posterior probability distribution and uncertainty interval of pollution source parameters, and are widely used in the field of surface water pollution source tracing. Among them, Markov chain Monte Carlo (MCMC) and its improved algorithms (such as differential evolution MCMC, or DE-MCMC) are commonly used posterior sampling methods.
[0003] However, existing source tracing methods based on the Bayesian-MCMC framework still have the following shortcomings. First, the likelihood function is generally based on the sum of squared residuals between the observed and simulated concentrations, utilizing only the concentration observations themselves and completely ignoring the temporal gradient information of the concentration. In actual emergency scenarios with low water quality sensor observation accuracy and high noise, the point-by-point concentration deviation is easily dominated by noise, leading to divergent posterior distributions and unstable source tracing results. Second, most methods only perform inversion for a single pollution source. When there are multiple pollution sources in a river, the concentration time series at the downstream monitoring section is a superposition of contributions from multiple sources. Directly applying a single-source inversion model will lead to difficulties in MCMC sampling convergence and severe ambiguity due to parameter dimensionality explosion. Although some multi-source methods use high-dimensional joint inversion, the parameter search spaces of each pollution source overlap, which easily leads to the "label switching" problem, that is, the parameters of different sources interchange identities during the sampling process, causing the posterior statistics to lose their physical meaning. Third, existing methods typically require pre-setting the number of pollution sources before inversion, but the number of pollution sources is often unknown in actual emergency scenarios, and incorrect pre-setting will directly lead to source tracing failure. Therefore, there is an urgent need for a water pollution source tracing method that can maintain robustness under low-precision observation conditions, efficiently handle multi-pollution source scenarios, and automatically determine the number of pollution sources. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a method and system for tracing the source of surface water pollution based on Bayesian inference.
[0005] To achieve the above objectives, in a first aspect, the present invention provides a method for tracing the source of pollution in surface water bodies based on Bayesian inference. The method includes the following steps: acquiring the time series of pollutant concentrations in the river to be traced, performing preprocessing and concentration gradient extraction to obtain a smoothed concentration time series and a first-order concentration gradient time series of the pollutants; determining the initial number of pollution sources based on the smoothed concentration time series and the first-order concentration gradient time series, and determining the physical constraint prior space of the pollution source parameters; obtaining the theoretical values of pollutant concentrations and first-order concentration gradients based on the ADE equation, and constructing a likelihood function by combining the smoothed concentration time series and the first-order concentration gradient time series; sampling the posterior probability distribution of the pollution source parameters within the physical constraint prior space based on the likelihood function and Bayes' theorem, thereby obtaining preliminary source tracing results; adjusting the initial number of pollution sources to obtain multiple candidate pollution source numbers, and determining the optimal number of pollution sources based on the DIC criterion to adjust the preliminary source tracing results, thus obtaining the final source tracing results. This invention achieves accurate inversion of parameters from multiple pollution sources by introducing the concentration gradient into the likelihood function and using analytical physical constraints at the peak of pollutant concentration to guide the prior distribution, thereby improving the robustness of source tracing under low-precision observation conditions.
[0006] Optionally, the step of obtaining the pollutant concentration time series of the river to be traced, performing preprocessing and concentration gradient extraction to obtain a smoothed concentration time series and a first-order concentration gradient time series of the pollutants includes the following steps: Pollutant concentrations were collected at fixed time intervals at downstream monitoring sections of the river to be traced, and preprocessed to obtain a time series of pollutant concentrations. The concentration smoothing and first-order gradient calculation of the pollutant concentration time series are completed by using an SG convolution smoothing filter, resulting in the smoothed concentration time series and the first-order concentration gradient time series.
[0007] Optionally, the pollution source parameters include the emission location, emission start time, and emission amount of the pollutants.
[0008] Optionally, determining the initial number of pollution sources and the physical constraint prior space of the pollution source parameters based on the smoothed concentration time series and the first-order concentration gradient time series includes the following steps: Zero-crossing detection is performed on the first-order concentration gradient time series to identify local peaks in pollutant concentration; If the smoothed concentration corresponding to the local peak is greater than the concentration threshold, then the local peak and the corresponding time are recorded as the target peak and the peak time, respectively, and the number of the target peaks is the number of the initial pollution sources; By differentiating the ADE equation with respect to the transport time and setting the derivative to zero, we obtain the quadratic equation satisfied by the peak transport time, and then obtain the analytical expression for the peak transport time. The physical constraint prior space of the discharge location is determined based on the upstream and downstream geographical boundaries of the river section to be traced, and the discharge start time is calculated based on the peak time and the analytical expression. The upper and lower limits of the emission start time are determined by using the physical constraint prior space of the emission location, thereby determining the physical constraint prior space of the emission start time; The zero-order moment of pollutant concentration is calculated using the smoothed concentration time series, and the estimated emission of pollutants is calculated based on the zero-order moment. The emission estimate is scaled to determine the upper and lower limits of the emission, thereby obtaining the physical constraint prior space of the emission.
[0009] Optionally, the transport time is the difference between the current time and the emission start time.
[0010] Optionally, the step of obtaining the theoretical values of pollutant concentration and first-order concentration gradient based on the ADE equation, and constructing a likelihood function by combining the smoothed concentration time series and the first-order concentration gradient time series, includes the following steps: Differentiating the transport time of the ADE equation yields the analytical expression for the concentration gradient; The theoretical values of pollutant concentrations are calculated using the ADE equation, thereby obtaining a time series of theoretical pollutant concentration values for the monitoring period. The pollutant concentration gradient calculated using the analytical expression of the concentration gradient is used as the theoretical value of the first-order concentration gradient, thereby obtaining the time series of the theoretical value of the first-order concentration gradient for the monitoring period. The total concentration residual for the monitoring period is calculated based on the smoothed concentration time series and the theoretical value time series of pollutant concentrations, and the total gradient residual for the monitoring period is calculated based on the first-order concentration gradient time series and the theoretical value time series of the first-order concentration gradient. A concentration gradient weighted joint error function is constructed using the total concentration residual and the total gradient residual, and then a likelihood function is constructed based on the concentration gradient weighted joint error function.
[0011] Optionally, obtaining preliminary source tracing results of pollution sources through Bayesian inversion based on the physical constraint prior space and the likelihood function includes the following steps: Within the physical constraint prior space, based on the likelihood function and Bayes' theorem, the pollution source parameters are sampled using DE-MCMC, and a full-iteration periodic sample sequence is output. The full-iteration cycle sample sequence is subjected to combustion processing to obtain valid posterior samples; Based on the effective posterior samples, the posterior mean of each pollution source parameter is calculated to obtain the preliminary source tracing results.
[0012] Optionally, adjusting the initial number of pollution sources to obtain multiple candidate pollution source numbers, and determining the optimal number of pollution sources based on the DIC criterion to adjust the preliminary source tracing results to obtain the final source tracing results, includes the following steps: The initial number of pollution sources is adjusted to obtain multiple candidate pollution source numbers, and the DIC value under the initial number of pollution sources is calculated based on the DIC criterion. If the number of candidate pollution sources is less than the number of initial pollution sources, the smallest target peak value is removed and Bayesian inversion is performed again to calculate the DIC value under the number of candidate pollution sources. If the number of candidate pollution sources is greater than the number of initial pollution sources, then the gradient residual sequence at the downstream monitoring section is obtained. Find the second most significant peak in the gradient residual sequence, treat it as a new pollution source, and perform Bayesian inversion again to calculate the DIC value for the number of candidate pollution sources. The initial number of pollution sources or the number of candidate pollution sources corresponding to the smallest DIC value is taken as the final number of pollution sources, and the corresponding source tracing result is the final source tracing result.
[0013] Optionally, if the number of candidate pollution sources is greater than the initial number of pollution sources, then obtaining the gradient residual sequence at the downstream monitoring section includes the following steps: Given the location of the downstream monitoring section and the preliminary source tracing results of each initial pollution source, the time series of the theoretical values of the first-order concentration gradient of each initial pollution source is calculated based on the analytical expression of the concentration gradient. For any time within the prediction period, calculate the sum of the theoretical values of the first-order concentration gradients of all initial pollution sources, and record it as the theoretical concentration gradient sum at that time, thereby obtaining the theoretical concentration gradient and time series for the monitoring period. The difference between the first-order concentration gradient and the theoretical concentration gradient at the corresponding time is taken as the gradient residual at that time. Then, the gradient residual sequence is obtained by using the first-order concentration gradient time series and the theoretical concentration gradient time series.
[0014] In summary, this method has at least the following beneficial effects: 1. This method improves the source tracing robustness under low-precision observation conditions by introducing a concentration gradient as augmented observation information; 2. This method significantly compresses the search space for pollution source parameters and effectively avoids the "label switching" problem in multi-source inversion by determining the physical constraint prior space of pollution source parameters. 3. This method uses the total concentration residual and the total gradient residual to construct a concentration gradient weighted joint error function, and then constructs a likelihood function based on the concentration gradient weighted joint error function. When there is low noise, concentration matching is the main factor, and when there is high noise or multi-peak fusion, gradient matching is the main factor. This construction method of the likelihood function not only gives the concentration and gradient independent constraints, but also adapts to the actual needs under different monitoring conditions through the flexible configuration of the weight coefficients. 4. This method is based on the source number automatic determination mechanism of deviation information criterion, which enables the scheme to complete multi-source inversion without pre-setting the number of pollution sources, thus improving the practicality and automation of the method. 5. This method only requires a one-dimensional concentration time series of a single monitoring section, without the need for multi-section collaborative observation, signal pre-decomposition, or neural network post-training. It has a simple structure and is easy to deploy in emergencies.
[0015] Secondly, the present invention provides a surface water pollution tracing system based on Bayesian inference. The surface water pollution tracing system based on Bayesian inference includes: a data acquisition device, a data output device, a processor, and a storage device. The storage device includes a computer-readable storage medium storing a computer program. The computer program includes program instructions, which, when executed by the processor, cause the processor to implement the surface water pollution tracing method based on Bayesian inference provided by the present invention. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating a method for tracing the source of surface water pollution based on Bayesian inference, according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the framework of a surface water pollution tracing system based on Bayesian inference, according to an embodiment of the present invention. Detailed Implementation
[0018] Specific embodiments of the present invention will now be described in detail. It should be noted that the embodiments described herein are for illustrative purposes only and are not intended to limit the invention. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be apparent to those skilled in the art that these specific details are not necessary to practice the invention. In other instances, well-known circuits, software, or methods have not been specifically described to avoid obscuring the invention.
[0019] Throughout this specification, references to "an embodiment," "an embodiment," "an example," or "an example" mean that a particular feature, structure, or characteristic described in connection with that embodiment or example is included in at least one embodiment of the invention. Therefore, the phrases "in an embodiment," "in an embodiment," "an example," or "an example" appearing in various places throughout the specification do not necessarily refer to the same embodiment or example. Furthermore, specific features, structures, or characteristics can be combined in one or more embodiments or examples in any suitable combination and / or sub-combination. Moreover, those skilled in the art will understand that the illustrations provided herein are for illustrative purposes and are not necessarily drawn to scale.
[0020] It should be noted in advance that, in one alternative embodiment, except for independent descriptions, the same symbols or letters appearing in all formulas have the same meaning.
[0021] In one optional embodiment, please refer to Figure 1 This invention provides a method for tracing the source of surface water pollution based on Bayesian inference, the method comprising the following steps: S1. Obtain the pollutant concentration time series of the river to be traced and perform preprocessing and concentration gradient extraction to obtain the smoothed concentration time series and first-order concentration gradient time series of pollutants.
[0022] Step S1 specifically includes the following steps: S11. Pollutant concentrations are collected at fixed time intervals at downstream monitoring sections of the river to be traced and pre-processed to obtain a time series of pollutant concentrations.
[0023] Specifically, in this embodiment, monitoring points are set up at the downstream monitoring section of the river to be traced, and online water quality sensors are deployed at the monitoring points at fixed time intervals. Pollutant concentrations were collected to obtain the original pollutant concentration time series. Then, preprocessing operations such as outlier identification, outlier removal, and missing value imputation were performed on the original pollutant concentration time series to obtain the final pollutant concentration time series. The pollutants mainly refer to dissolved pollutants, such as dissolved oxygen, total nitrogen, and total phosphorus.
[0024] More specifically, time interval A 5-minute timeframe is used to ensure the completeness of the rising, peak, and declining branch patterns of the pollutant breakthrough curve (BTC). Additionally, [the following is used]... Outlier identification is performed in principle, and missing values are filled using linear interpolation.
[0025] S12. The SG convolution smoothing filter is used to smooth the concentration time series of the pollutant and calculate the first-order gradient to obtain the smoothed concentration time series and the first-order concentration gradient time series.
[0026] Specifically, in this embodiment, since directly performing numerical differentiation on the pollutant concentration time series would amplify observation noise, this step employs a Savitzky-Golay (SG) convolutional smoothing filter with a window length of 11 and a polynomial order of 3 to complete the concentration smoothing and first-order gradient calculation of the pollutant concentration time series, obtaining the smoothed concentration time series and the first-order concentration gradient time series. Specifically, for the i-th sampling point in the smoothed concentration time series and the first-order concentration gradient time series, the corresponding smoothed concentration and first-order concentration gradient are calculated according to the following convolution formulas:
[0027]
[0028] in, for The smoothed concentration at any given time, in mg / L. for The first-order concentration gradient at time t, is the sampling time corresponding to the i-th sampling point; m is the half-length of the window of the SG convolutional smoothing filter, m=5; These are the smoothed convolution coefficients of the SG convolution smoothing filter (corresponding to the zeroth-order polynomial coefficients). The first derivative of the SG convolution smoothing filter is the convolution coefficient (corresponding to the first-order coefficient of the polynomial). Both are pre-analyzed and solidified into convolution kernels by least-squares fitting of the third-order polynomial on equally spaced nodes, without the need for online solution. For the i-th sampling point within the sliding window The sampling time of each neighboring point; for The concentration of pollutants at any given time. or At time (boundary points), the window data is supplemented using a mirror extension method.
[0029] Furthermore, the pollutant concentration, smoothed concentration, and first-order concentration gradient were obtained for the pollutants over a continuous 30 minutes prior to the pollution event. The average pollutant concentration was then calculated using these 30-minute concentrations. Simultaneously, the standard deviations of the smoothed concentration and the first-order concentration gradient within these 30 minutes are calculated and denoted as the smoothed concentration noise standard deviation. and the standard deviation of the first-order concentration gradient noise .
[0030] S2. Determine the initial number of pollution sources based on the smoothed concentration time series and the first-order concentration gradient time series, and determine the physical constraint prior space of the pollution source parameters.
[0031] Pollution source parameters include the emission location, emission start time, and emission volume of pollutants. Step S2 specifically includes the following steps: S21. Zero-crossing detection is performed on the first-order concentration gradient time series to identify local peaks in pollutant concentration.
[0032] Specifically, in this embodiment, the zero-crossing point where the first-order concentration gradient of the pollutant changes from positive to negative corresponds to the local peak value of the pollutant concentration, and the zero-crossing point where the first-order concentration gradient changes from negative to positive corresponds to the local valley value.
[0033] More specifically, for a first-order concentration gradient time series, if the first-order concentration gradient of a pollutant is 0 at a certain sampling time, and the first-order concentration gradient at the previous sampling time is positive and the first-order concentration gradient at the next sampling time is negative, then the pollutant concentration at that sampling time is a local peak; if the first-order concentration gradient of a pollutant is positive at a certain sampling time, and the first-order concentration gradient at the next sampling time is negative, then the pollutant concentration at that sampling time is a local peak.
[0034] S22. If the smoothed concentration corresponding to the local peak is greater than the concentration threshold, the local peak and the corresponding time are recorded as the target peak and the peak time, respectively. The number of target peaks is the number of initial pollution sources.
[0035] Specifically, in this embodiment, for each detected local peak, it is further determined whether the smoothed concentration at the corresponding sampling time is greater than a concentration threshold, wherein the concentration threshold is... If the smoothed concentration corresponding to a local peak is greater than the concentration threshold, then the local peak and the corresponding sampling time are recorded as the target peak and the peak time, respectively.
[0036] For instantaneous point source emissions in a one-dimensional river, the BTC curve generated by each pollution source presents a single concentration peak at the downstream monitoring section, and the time gradient corresponding to this peak changes from positive to negative. Therefore, the number of zero-crossing points in the first-order concentration gradient time series that change from positive to negative is physically equal to the number of resolvable concentration peaks at the downstream monitoring section, i.e., the number of target peaks, which is the initial number of pollution sources. The initial number of pollution sources refers to the number of pollution sources initially determined. Whether these can be directly used as the final number of pollution sources needs to be determined in step S5. Before this, it is uncertain whether these pollution sources actually exist; therefore, they are called initial pollution sources.
[0037] S23. Differentiate the ADE equation with respect to the transport time and set the derivative to zero to obtain the quadratic equation satisfied by the peak transport time, and then obtain the analytical expression of the peak transport time.
[0038] Specifically, in this embodiment, a physical constraint relationship is established between the peak time and the pollution source parameters. For the case of instantaneous point source emissions in a one-dimensional river, the location... The pollutant concentration at the monitoring point at time t is described by the analytical solution of the convection-diffusion-attenuation equation (ADE equation), that is:
[0039] in, Pollution source parameter vector Below, position The pollutant concentration at time t, M represents emissions, in kg. The location of pollutant discharge is the longitudinal (X-axis) distance from the pollution source to the reference point, in meters. The reference point is the origin of the coordinate system, which can be directly set at the monitoring point. The X-axis points upstream along the main flow of the river, and the Y-axis is a horizontal line perpendicular to the main flow of the river. The Y-axis coordinate is physically locked to zero. The starting time of pollutant emission, expressed in "min"; The transport time is expressed in minutes. A represents the longitudinal distance between the downstream monitoring section and the pollution source, in meters (m); A represents the cross-sectional area of the river, in square meters (m²). 2 ”; The longitudinal dispersion coefficient is expressed in meters. 2 / min”; The average flow velocity of the river is expressed in m / min. The first-order degradation coefficient of pollutants, expressed in "min". -1"Among them, river parameters such as river cross-sectional area, longitudinal dispersion coefficient, average river flow velocity, and primary degradation coefficient of pollutants are obtained through on-site hydrological measurements or historical monitoring data, which are existing technical means."
[0040] Differentiating the ADE equation with respect to transport time and setting the derivative to zero, we obtain a quadratic equation satisfied by the peak transport time, namely:
[0041] When t equals the peak time At that time, the corresponding peak shift time It should also satisfy this quadratic equation.
[0042] Taking the physically meaningful positive root of this quadratic equation, we obtain the analytical expression for the peak transport time:
[0043] Therefore, peak time The following deterministic relationship exists between the emission location and the emission start time:
[0044] This formula is the analytical expression for the peak transport time, which shows that, given the river parameters and monitoring location, a given peak time... The emission location and start time of the pollution source are strictly constrained on a one-dimensional curve, rather than the entire two-dimensional parameter plane.
[0045] S24. Determine the physical constraint prior space of the discharge location based on the upstream and downstream geographical boundaries of the river section to be traced, and calculate the discharge start time based on the peak time and the analytical expression.
[0046] Specifically, in this embodiment, for the j-th initial pollution source, its emission location The physical constraint prior space is determined by the upstream and downstream geographical boundaries of the river segment to be traced. Let the upstream boundary of the river segment to be traced be... The downstream boundary is Then the physical constraint prior space of the emission location of the j-th initial pollution source is: Within this physical constraint prior space, the prior distribution of emission locations is assumed to be uniform:
[0047] This uniform distribution means that, in the absence of any prior information, the initial source of pollution is equally likely to be located anywhere within the river section to be traced.
[0048] Furthermore, regarding the j-th initial pollution source, its emission start time... The following relationship must be satisfied:
[0049] in, This represents the peak time corresponding to the j-th initial pollution source.
[0050] S25. Determine the upper and lower limits of the emission start time using the physical constraint prior space of the emission location, and then determine the physical constraint prior space of the emission start time.
[0051] Specifically, in this embodiment, the upper and lower limits of the emission start time satisfy the following relationships:
[0052]
[0053] in, This is the upper limit for the start time of emissions. This is the lower bound of the emission start time. Therefore, the physical constraint prior space for the emission start time of the j-th initial pollution source is: Within this physically constrained prior space, the prior distribution at the start of emission is uniform:
[0054] S26. Calculate the zero-order moment of pollutant concentration using the smoothed concentration time series, and calculate the estimated emission of pollutants based on the zero-order moment.
[0055] Specifically, in this embodiment, the zeroth moment of the entire smoothed concentration BTC is calculated using the trapezoidal rule numerical integration with a smoothed concentration time series. :
[0056] in, The sampling time corresponding to the first sampling point. This represents the sampling time corresponding to the Nth sampling point, where N is the number of sampling points. This represents the sampling time corresponding to the (i+1)th sampling point. That is, the monitoring period. Let be the smoothed concentration at time t. for Smooth concentration over time.
[0057] Using the mass conservation principle in a one-dimensional river, the estimated pollutant discharge is calculated by the following formula:
[0058] in, This is an estimate of the pollutant emissions, calculated from the initial emissions from each pollution source. Time to The estimated total mass of pollutants emitted at any given time, expressed in kg. This formula ignores degradation losses, especially when the degradation coefficient is large. This will underestimate actual emissions, but this is only used to determine the order of magnitude of the prior interval. The underestimation does not affect the prior interval's coverage of the true value, because step S27 will... Obtain the upper and lower limits of emissions.
[0059] S27. Scale the emission estimate to determine the upper and lower limits of the emission, thereby obtaining the physical constraint prior space of the emission.
[0060] Specifically, in this embodiment, after obtaining the estimated emissions of pollutants, the values are scaled to determine the upper and lower limits of emissions from each initial pollution source, i.e.:
[0061]
[0062] in, Let be the lower limit of the emissions from the j-th initial pollution source. Let be the upper limit of the emissions from the j-th initial pollution source. and In this embodiment, the scaling factor is used. and Let's take values of 0.1 and 10 respectively. Therefore, the physical constraint prior space for the emissions of the j-th initial pollution source is: Within this physical constraint prior space, the prior distribution of emissions is assumed to be uniform:
[0063] in, Let be the emissions from the j-th initial pollution source.
[0064] Furthermore, based on determining the corresponding emissions according to the prior distribution of emissions from each initial pollution source, it is also necessary to meet the following requirements: , This is the sum of emissions from all initial pollution sources. This represents the initial number of pollution sources.
[0065] S3. Obtain the theoretical values of pollutant concentration and first-order concentration gradient based on the ADE equation, and construct the likelihood function by combining the smoothed concentration time series and the first-order concentration gradient time series.
[0066] Step S3 specifically includes the following steps: S31. Differentiate the transport time of the ADE equation to obtain the analytical expression for the concentration gradient.
[0067] Specifically, in this embodiment, by differentiating the transport time of the ADE equation and using the chain rule, the analytical expression for the pollutant concentration gradient generated by the j-th pollution source at the monitoring section is obtained as follows:
[0068] in, Pollution source parameter vector Below, position The pollutant concentration gradient at time t; Pollution source parameter vector Below, position The pollutant concentration at time t, ; Let be the transport time from the j-th initial pollution source.
[0069] S32. Calculate the theoretical value of pollutant concentration using the ADE equation, and then obtain the time series of the theoretical value of pollutant concentration during the monitoring period.
[0070] Specifically, in this embodiment, for a given pollution source parameter of the j-th initial pollution source, substituting it into the ADE equation allows us to calculate the location of the initial pollution source at time t. The pollutant concentration is calculated and recorded as the theoretical value of the pollutant concentration. Then, the theoretical value of the pollutant concentration at each sampling time during the monitoring period can be calculated, thus obtaining the time series of the theoretical value of the pollutant concentration.
[0071] S33. The pollutant concentration gradient calculated through the concentration gradient analytical expression is used as the theoretical value of the first-order concentration gradient, thereby obtaining the time series of the theoretical value of the first-order concentration gradient for the monitoring period.
[0072] Specifically, in this embodiment, for a given pollution source parameter of the j-th initial pollution source, substituting it into the concentration gradient analytical expression allows us to calculate the location of the initial pollution source at time t. The pollutant concentration gradient is calculated, and the result is used as the theoretical value of the first-order concentration gradient. Then, the theoretical value of the first-order concentration gradient of the initial pollution source at each sampling time during the monitoring period can be calculated, and the time series of the theoretical value of the first-order concentration gradient can be obtained.
[0073] S34. Calculate the total concentration residual for the monitoring period based on the smoothed concentration time series and the theoretical value time series of pollutant concentrations, and simultaneously calculate the total gradient residual for the monitoring period based on the first-order concentration gradient time series and the theoretical value time series of the first-order concentration gradients.
[0074] Specifically, in this embodiment, when there is in the river When the initial pollution source is located, The theoretical values of pollutant concentration and first-order concentration gradient at time t are linear superpositions of the contributions from each initial pollution source, i.e.:
[0075]
[0076] in, Given a set of pollution source parameter vectors In this case, location The theoretical value of pollutant concentration at time t. ; Given a set of pollution source parameter vectors In this case, location The theoretical value of the first-order concentration gradient at time t.
[0077] Define the concentration residual and gradient residual as follows:
[0078]
[0079] in, Let be the concentration residual at the i-th sampling time. Given a set of pollution source parameter vectors In this case, location exist The theoretical value of pollutant concentration at any given time; Let be the gradient residual at the i-th sampling time. Given a set of pollution source parameter vectors In this case, location exist The theoretical value of the first-order concentration gradient at time t.
[0080] Furthermore, the total concentration residual and total gradient residual for the monitoring period can be calculated as follows:
[0081]
[0082] in, The total concentration residual, This represents the total gradient residual.
[0083] S35. Construct a concentration gradient weighted joint error function using the total concentration residual and the total gradient residual, and then construct a likelihood function based on the concentration gradient weighted joint error function.
[0084] Specifically, in this embodiment, a concentration gradient weighted joint error function is constructed using the total concentration residual and the total gradient residual. The concentration gradient weighted joint error function satisfies the following relationship:
[0085] in, Given a set of pollution source parameter vectors The concentration gradient weighted joint error is as follows: and These are the weighting coefficients. .
[0086] When the observation noise level is low ( ,in When the maximum value of the smoothed concentration in the smoothed concentration time series is taken, the pollutant concentration information is already sufficiently reliable. , The primary method is matching pollutant concentration; when the noise level is moderate ( When taking , The two are equally weighted; when the noise level is high ( When the pollutant concentration gradient is at this time, the relative discernibility is higher. , Gradient matching is the primary method.
[0087] Based on the concentration gradient weighted joint error function, the following likelihood function is constructed:
[0088] Here, obs represents the observation data, which includes smoothed concentration time series and first-order concentration gradient time series; This represents a given set of pollution source parameter vectors. Given the following conditions, the probability of observing obs is calculated. The probability interpretation of this likelihood function is as follows: considering the smoothed concentration and the first-order concentration gradient as two sets of observations, given the set of pollution source parameter vectors... Under the condition that each follows an independent Gaussian distribution, the joint likelihood is the product of the two Gaussian likelihoods. The smoothed concentration output of the SG convolution smoothing filter is given by the zeroth-order coefficient of the polynomial, and the first-order concentration gradient is given by the first-order coefficient. The two are orthogonal in the least squares sense. Therefore, the correlation between the smoothed concentration noise and the first-order concentration gradient noise is weak, and the independence assumption holds in engineering.
[0089] S4. Based on the physical constraint prior space and the likelihood function, obtain preliminary source tracing results of pollution sources through Bayesian inversion.
[0090] Step S4 specifically includes the following steps: S41. Within the physical constraint prior space, based on the likelihood function and Bayes' theorem, DE-MCMC sampling is performed on the pollution source parameters, and a full-iteration periodic sample sequence is output.
[0091] Specifically, in this embodiment, according to Bayes' theorem, the posterior probability density function of all pollution source parameters is:
[0092] in, for The posterior probability density; for The prior distribution (the product of the prior distributions of the parameters of each initial pollution source).
[0093] The Differential Evolution Markov Chain Monte Carlo (DE-MCMC) algorithm is used to sample pollution source parameters. The specific implementation steps of the DE-MCMC algorithm are as follows.
[0094] 1. Parameter initialization. Set the population size. Differential evolution scaling factor F=0.8, crossover probability CR=0.9, maximum number of iterations Within the physical constraint prior space of each pollution source parameter, an initial population is randomly generated. The r-th individual A group containing all Candidate solutions for the pollution source parameters of an initial pollution source. , Let be the emission amount of the j-th initial pollution source in the r-th individual. Let be the emission location of the j-th initial pollution source in the r-th individual. Let be the emission start time of the j-th initial pollution source in the r-th individual.
[0095] 2. Mutation operation. For the first... Each individual in the population Randomly select three distinct individuals from the current population whose indices are all not equal to r. , , Generate mutation vector , , For the first The first generation of the population Individual, For the first The b-th individual in the population, For the first The c-th individual in the population, where F is the differential evolution scaling factor that controls the scaling magnitude of the difference vector.
[0096] 3. Crossover operation. For the mutated vector... With target individuals Perform binomial crossover to generate test vectors. : Generate each dimension of the pollution source parameter vector For any dimension, if the corresponding random number is less than the crossover probability or if that dimension is a randomly selected dimension that requires forced crossover, then... Take in this dimension Components in that dimension, otherwise take The components in this dimension.
[0097] 4. Acceptance-Rejection Judgment. Calculate the trial vector based on Bayes' theorem. The corresponding posterior probability density and The corresponding posterior probability density Then, the Metropolis acceptance probability is calculated:
[0098] generate A uniformly random number rnd in the interval, if Then accept and order , For the first The r-th individual in the population; otherwise, retain the original individual, let .
[0099] Repeat steps 2 to 4 until the maximum number of iterations is reached. Finally, output the individuals for the entire iteration cycle. Treat each individual as a sample and arrange them in ascending order of the number of iterations to obtain the full iteration cycle sample sequence.
[0100] S42. The full-iteration periodic sample sequence is burned to obtain valid posterior samples.
[0101] Specifically, in this embodiment, after obtaining the full iteration cycle sample sequence, the first 40% of the iteration samples are discarded as the burning period (preheating period), and only the remaining samples are retained as valid posterior samples.
[0102] S43. Calculate the posterior mean of each pollution source parameter based on the effective posterior sample to obtain the preliminary source tracing results.
[0103] Specifically, in this embodiment, the posterior sample mean, standard deviation, and 95% confidence interval for the emission amount, emission location, and emission start time of each initial pollution source are calculated for the valid posterior sample to obtain preliminary source tracing results, namely:
[0104] in, The result of the pollution source parameter vector inversion for the j-th initial pollution source represents the preliminary source tracing result for the j-th initial pollution source. The posterior sample mean of the emissions from the j-th initial pollution source is the mean of the emissions from the j-th initial pollution source among all valid posterior samples. Let be the posterior sample mean of the emission locations of the j-th initial pollution source, calculated using the method described in [reference needed]. The calculation method; Let be the posterior sample mean at the start time of emissions from the j-th initial pollution source, calculated using the method described in [reference needed]. The calculation method.
[0105] It should be noted that, since the prior center of each initial pollution source in step S2 is anchored by its corresponding peak time, and the target peaks are arranged in chronological order, the physical constraint prior spaces of any two initial pollution sources on the (emission location, emission time) two-dimensional plane do not overlap, and the emission location and emission time form a one-to-one deterministic relationship through the peak time constraint, the "label switching" problem commonly seen in traditional multi-source joint inversion will not occur in the DE-MCMC sampling process, and the posterior statistics have a clear physical correspondence.
[0106] S5. Adjust the initial number of pollution sources to obtain multiple candidate pollution source numbers, and determine the optimal number of pollution sources based on the DIC criterion to adjust the preliminary source tracing results, thereby obtaining the final source tracing results.
[0107] Step S5 specifically includes the following steps: S51. Adjust the initial number of pollution sources to obtain multiple candidate pollution source numbers, and calculate the DIC value under the initial number of pollution sources based on the DIC criterion.
[0108] Specifically, in this embodiment, the number of candidate pollution sources includes , and For a given number of candidate pollution sources, the following deviation function is defined:
[0109] in, for The deviation value below.
[0110] According to the Deviation Information Criterion (DIC), after obtaining the preliminary source tracing results for each initial pollution source, the DIC value can be calculated using the following formula:
[0111] Wherein, DIC is the set of pollution source parameter vectors. The DIC value below, ; The effective number of parameters (a measure of model complexity) is calculated using the following formula:
[0112] in Let be the average of the bias function over the valid posterior sample, i.e.:
[0113] in, For the effective posterior sample size, For the s-th valid posterior sample, for The deviation value below.
[0114] S52. If the number of candidate pollution sources is less than the number of initial pollution sources, the smallest target peak value is removed and Bayesian inversion is performed again to calculate the DIC value under the number of candidate pollution sources.
[0115] Specifically, in this embodiment, if the number of candidate pollution sources is Then, the smallest target peak value is removed and step S4 is repeated to obtain the number of candidate pollution sources. The initial traceability results are used, and the corresponding DIC value is calculated with reference to the content of step S51. If If so, skip the Bayesian inversion and directly assign a very large DIC value, such as 1×10. 5 .
[0116] S53. If the number of candidate pollution sources is greater than the number of initial pollution sources, then obtain the gradient residual sequence at the downstream monitoring section.
[0117] Step S53 specifically includes the following steps: S531. Given the location of the downstream monitoring section and the preliminary source tracing results of each initial pollution source, calculate the time series of the theoretical values of the first-order concentration gradient of each initial pollution source according to the analytical expression of the concentration gradient.
[0118] Specifically, in this embodiment, if the number of candidate pollution sources is greater than the number of initial pollution sources, then, given the location of the downstream monitoring section, the preliminary source tracing results of each initial pollution source are substituted into the concentration gradient analytical expression to calculate the theoretical value of the first-order concentration gradient of each initial pollution source at each sampling time, thereby obtaining the time series of the theoretical value of the first-order concentration gradient of each initial pollution source.
[0119] S532. For any time within the prediction period, calculate the sum of the theoretical values of the first-order concentration gradients of all initial pollution sources, and record it as the theoretical concentration gradient sum at that time, thereby obtaining the theoretical concentration gradient and time series of the monitoring period.
[0120] Specifically, in this embodiment, for any sampling time within the prediction period, the sum of the theoretical values of the first-order concentration gradients of all initial pollution sources is calculated, and the calculation result is recorded as the theoretical concentration gradient sum at that sampling time, thereby obtaining the theoretical concentration gradient and time series of the monitoring period.
[0121] S533. The difference between the first-order concentration gradient and the theoretical concentration gradient at the corresponding time is taken as the gradient residual at that time, and then the gradient residual sequence is obtained by using the first-order concentration gradient time series and the theoretical concentration gradient time series.
[0122] Specifically, in this embodiment, the difference between the first-order concentration gradient and the theoretical concentration gradient at the corresponding sampling time is used as the gradient residual at that sampling time (the corresponding calculation formula is given in step S34). Then, the gradient residual sequence of the monitoring period can be obtained by using the first-order concentration gradient time series and the theoretical concentration gradient time series.
[0123] S54. Find the second most significant peak in the gradient residual sequence, treat it as a new pollution source, and perform Bayesian inversion again to calculate the DIC value under the number of candidate pollution sources.
[0124] Specifically, in this embodiment, after obtaining the gradient residual sequence in step S533, the maximum positive value of the gradient residual is found as the second most significant peak value, which is then used as a new pollution source, and step S4 is re-executed to obtain the number of candidate pollution sources. The initial source tracing results are used, and the corresponding DIC value is calculated with reference to the content of step S51. If the sampling time corresponding to the second most significant peak coincides with the sampling time of a certain identified peak, it means that the signal has been captured by the previous inversion and should not be regarded as a new pollution source. At this time, the second largest positive value is found in the gradient residual sequence as the second most significant peak, and step S4 is executed again to calculate the corresponding DIC value. If the sampling time of the second largest gradient residual still overlaps with the sampling time of a certain local peak, it is determined that the number of pollution sources will not exceed the initial number of pollution sources. Only the case where the number of candidate pollution sources is equal to or less than the initial number of pollution sources needs to be considered, and steps S53 and S54 are not executed.
[0125] S55. The initial number of pollution sources or the number of candidate pollution sources corresponding to the smallest DIC value is taken as the final number of pollution sources, and the corresponding source tracing result is the final source tracing result.
[0126] Specifically, in this embodiment, the number of initial pollution sources or candidate pollution sources corresponding to the smallest DIC value is taken as the final number of pollution sources. This can alleviate the problem that the number of pollution sources may be underestimated when the emission times of multiple pollution sources are too close and their BTC curve peaks are severely merged. This improves the accuracy of pollution source tracing.
[0127] It should be noted that in some cases, the actions described in the specification can be performed in different orders and still achieve the desired results. In this embodiment, the order of steps is given only to make the embodiment clearer and easier to explain, and is not intended to limit it.
[0128] In an optional embodiment, to improve the practicality and facilitate the promotion of this method, please refer to [link to relevant documentation]. Figure 2 The present invention also provides a surface water pollution tracing system based on Bayesian inference. The surface water pollution tracing system based on Bayesian inference includes: a data acquisition device 1, a data output device 2, a processor 3, and a storage device 4. The storage device 4 includes a computer-readable storage medium storing a computer program. The computer program includes program instructions. When the program instructions are executed by the processor 3, the processor 3 performs the contents described in steps S1 to S5.
[0129] In summary, this method has at least the following beneficial effects: 1. The likelihood function of the existing Bayesian-MCMC method is only based on the pointwise concentration residuals. When the observation noise is large, the posterior distribution is prone to divergence. However, this method uses SG filtering to simultaneously obtain the smoothed concentration and its first-order concentration gradient. Then, the gradient residual and the concentration residual are weighted together to construct the likelihood function. The first-order concentration gradient changes drastically near the concentration peak and is much more sensitive to the emission location and emission start time than the concentration itself. Moreover, the gradient noise and the concentration noise are approximately orthogonal in the least squares sense, which can provide independent constraint information for the inversion of pollution source parameters. Even in emergency monitoring scenarios with limited sensor accuracy, the addition of gradient information still makes the posterior distribution sharp and stable, overcoming the defect of traditional methods failing in source tracing under low signal-to-noise ratio conditions.
[0130] 2. This method starts from the ADE equation, derives an analytical expression for the peak transport time, and then determines the deterministic analytical relationship between the time of concentration peak occurrence and the emission location and emission start time of the pollution source. Furthermore, it determines the physical constraint prior space of the pollution source parameters. After these physical constraints are embedded in the Bayesian prior distribution, the emission location and emission start time of each pollution source are no longer searched across the entire two-dimensional plane, but are restricted to a physical curve determined by the observed peak time, reducing the search area by more than an order of magnitude. Simultaneously, since each pollution source is anchored by the peak time of the pollutant concentration, and the peak concentrations are arranged chronologically, the prior intervals of each pollution source do not overlap, avoiding the "label switching" problem caused by parameter identity interchange in traditional high-dimensional joint inversion, and ensuring that the multi-source tracing results have a clear physical correspondence.
[0131] 3. This method constructs a concentration gradient weighted joint error function using the total concentration residual and the total gradient residual. Then, it constructs a likelihood function based on this function. Under low noise conditions, concentration matching is prioritized, while under high noise or multi-peak fusion conditions, gradient matching is prioritized. This method of constructing the likelihood function provides independent constraints for both concentration and gradient, and the flexible configuration of weighting coefficients adapts to the actual needs under different monitoring conditions. Furthermore, the gradient residual calculation is based on the analytical expression of the concentration gradient, requiring no additional numerical differencing and introducing no additional computational errors, thus ensuring the accuracy and stability of the likelihood function.
[0132] 4. This method takes the initial number of pollution sources as the center, performs a complete Bayesian inversion on the three adjacent candidate pollution source numbers and calculates their respective DIC values. By comparing the comprehensive performance of goodness of fit and model complexity, the optimal number of sources is automatically selected. This mechanism enables the solution to objectively determine the number of pollution sources in actual emergency scenarios without relying on human guessing, improving the practicality and automation of the method. It can also alleviate the problem to some extent that when the emission times of multiple pollution sources are too close and their BTC curve peaks are severely merged, the first-order concentration gradient time series may only show a zero-crossing point from positive to negative, which may lead to an underestimation of the number of pollution sources, thus improving the accuracy of pollution source tracing.
[0133] 5. The only input to this method is the time series data of a single pollutant index at a single downstream cross section. All gradient information is extracted from the same set of data by SG filtering. The physical constraint prior space of the pollution source parameters does not need to rely on multi-section monitoring. Compared with existing methods that rely on multi-section monitoring, high-dimensional matrix factorization, or a large amount of pre-training data, this method has low data requirements, low computational overhead, and low implementation threshold. It is suitable for actual emergency scenarios with limited monitoring facilities and tight response time in sudden water pollution events.
[0134] 6. A system adapted to the method is provided, which not only improves the practicality of the method but also facilitates its promotion.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A method for surface water body pollution source tracing based on Bayesian inference, characterized in that, Includes the following steps: The pollutant concentration time series of the river to be traced were obtained and preprocessed and concentration gradient extracted to obtain the smoothed concentration time series and the first-order concentration gradient time series of the pollutants. The number of initial pollution sources is determined based on the smoothed concentration time series and the first-order concentration gradient time series, and the physical constraint prior space of the pollution source parameters is determined. The theoretical values of pollutant concentration and first-order concentration gradient are obtained based on the ADE equation, and a likelihood function is constructed by combining the smoothed concentration time series and the first-order concentration gradient time series. Based on the physical constraint prior space and the likelihood function, preliminary source tracing results of pollution sources are obtained through Bayesian inversion; The initial number of pollution sources is adjusted to obtain multiple candidate pollution source numbers, and the optimal number of pollution sources is determined based on the DIC criterion to adjust the preliminary source tracing results, thus obtaining the final source tracing results.
2. The method for tracing the source of surface water pollution based on Bayesian inference according to claim 1, characterized in that, The process of obtaining the pollutant concentration time series of the river to be traced, performing preprocessing and concentration gradient extraction to obtain the smoothed concentration time series and first-order concentration gradient time series of the pollutants includes the following steps: Pollutant concentrations were collected at fixed time intervals at downstream monitoring sections of the river to be traced, and preprocessed to obtain a time series of pollutant concentrations. The concentration smoothing and first-order gradient calculation of the pollutant concentration time series are completed by using an SG convolution smoothing filter, resulting in the smoothed concentration time series and the first-order concentration gradient time series.
3. The method for tracing the source of surface water pollution based on Bayesian inference according to claim 1, characterized in that: The pollution source parameters include the location of pollutant emission, the start time of emission, and the emission amount.
4. The method for tracing the source of surface water pollution based on Bayesian inference according to claim 3, characterized in that, The step of determining the initial number of pollution sources and the physical constraint prior space of pollution source parameters based on the smoothed concentration time series and the first-order concentration gradient time series includes the following steps: Zero-crossing detection is performed on the first-order concentration gradient time series to identify local peaks in pollutant concentration; If the smoothed concentration corresponding to the local peak is greater than the concentration threshold, then the local peak and the corresponding time are recorded as the target peak and the peak time, respectively, and the number of the target peaks is the number of the initial pollution sources; By differentiating the ADE equation with respect to the transport time and setting the derivative to zero, we obtain the quadratic equation satisfied by the peak transport time, and then obtain the analytical expression for the peak transport time. The physical constraint prior space of the discharge location is determined based on the upstream and downstream geographical boundaries of the river section to be traced, and the discharge start time is calculated based on the peak time and the analytical expression. The upper and lower limits of the emission start time are determined by using the physical constraint prior space of the emission location, thereby determining the physical constraint prior space of the emission start time; The zero-order moment of pollutant concentration is calculated using the smoothed concentration time series, and the estimated emission of pollutants is calculated based on the zero-order moment. The emission estimate is scaled to determine the upper and lower limits of the emission, thereby obtaining the physical constraint prior space of the emission.
5. The method for tracing the source of surface water pollution based on Bayesian inference according to claim 4, characterized in that: The transport time is the difference between the current time and the emission start time.
6. The method for tracing the source of surface water pollution based on Bayesian inference according to claim 5, characterized in that, The process of obtaining theoretical values of pollutant concentration and first-order concentration gradient based on the ADE equation, and constructing a likelihood function by combining the smoothed concentration time series and the first-order concentration gradient time series, includes the following steps: Differentiating the transport time of the ADE equation yields the analytical expression for the concentration gradient; The theoretical values of pollutant concentrations are calculated using the ADE equation, thereby obtaining a time series of theoretical pollutant concentration values for the monitoring period. The pollutant concentration gradient calculated using the analytical expression of the concentration gradient is used as the theoretical value of the first-order concentration gradient, thereby obtaining the time series of the theoretical value of the first-order concentration gradient for the monitoring period. The total concentration residual for the monitoring period is calculated based on the smoothed concentration time series and the theoretical value time series of pollutant concentrations, and the total gradient residual for the monitoring period is calculated based on the first-order concentration gradient time series and the theoretical value time series of the first-order concentration gradient. A concentration gradient weighted joint error function is constructed using the total concentration residual and the total gradient residual, and then a likelihood function is constructed based on the concentration gradient weighted joint error function.
7. The method for tracing the source of surface water pollution based on Bayesian inference according to claim 1, characterized in that, The preliminary source tracing results of pollution sources obtained through Bayesian inversion based on the physical constraint prior space and the likelihood function include the following steps: Within the physical constraint prior space, based on the likelihood function and Bayes' theorem, the pollution source parameters are sampled using DE-MCMC, and a full-iteration periodic sample sequence is output. The full-iteration cycle sample sequence is subjected to combustion processing to obtain valid posterior samples; Based on the effective posterior samples, the posterior mean of each pollution source parameter is calculated to obtain the preliminary source tracing results.
8. The method for tracing the source of surface water pollution based on Bayesian inference according to claim 6, characterized in that, The process of adjusting the initial number of pollution sources to obtain multiple candidate pollution sources, and determining the optimal number of pollution sources based on the DIC criterion to adjust the preliminary source tracing results, to obtain the final source tracing results, includes the following steps: The initial number of pollution sources is adjusted to obtain multiple candidate pollution source numbers, and the DIC value under the initial number of pollution sources is calculated based on the DIC criterion. If the number of candidate pollution sources is less than the number of initial pollution sources, the smallest target peak value is removed and Bayesian inversion is performed again to calculate the DIC value under the number of candidate pollution sources. If the number of candidate pollution sources is greater than the number of initial pollution sources, then the gradient residual sequence at the downstream monitoring section is obtained; Find the second most significant peak in the gradient residual sequence, treat it as a new pollution source, and perform Bayesian inversion again to calculate the DIC value for the number of candidate pollution sources. The initial number of pollution sources or the number of candidate pollution sources corresponding to the smallest DIC value is taken as the final number of pollution sources, and the corresponding source tracing result is the final source tracing result.
9. A method for tracing the source of surface water pollution based on Bayesian inference according to claim 8, characterized in that, If the number of candidate pollution sources is greater than the initial number of pollution sources, then the gradient residual sequence at the downstream monitoring section is obtained, including the following steps: Given the location of the downstream monitoring section and the preliminary source tracing results of each initial pollution source, the time series of the theoretical values of the first-order concentration gradient of each initial pollution source is calculated based on the analytical expression of the concentration gradient. For any time within the prediction period, calculate the sum of the theoretical values of the first-order concentration gradients of all initial pollution sources, and record it as the theoretical concentration gradient sum at that time, thereby obtaining the theoretical concentration gradient and time series for the monitoring period. The difference between the first-order concentration gradient and the theoretical concentration gradient at the corresponding time is taken as the gradient residual at that time. Then, the gradient residual sequence is obtained by using the first-order concentration gradient time series and the theoretical concentration gradient time series.
10. A surface water pollution source tracing system based on Bayesian inference, characterized in that, The surface water pollution tracing system based on Bayesian inference includes: a data acquisition device, a data output device, a processor, and a storage device. The storage device includes a computer-readable storage medium storing a computer program. The computer program includes program instructions, which, when executed by the processor, cause the processor to implement the surface water pollution tracing method based on Bayesian inference as described in any one of claims 1-9.
