A Data-Driven and Physically Constrained Method and System for Predicting and Managing Drinking Water Source Safety Compliance
By collecting data in the catchment area of water sources and using a multi-task safety prediction model and physical transport constraints to generate source contribution vectors, combined with Bayesian decision theory and differentiable river network migration operators, the problems of pollution source attribution errors and broken evidence chains in existing technologies are solved, and intelligent water source safety management is realized.
Patent Information
- Application Number
- CN202611169909.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2046-08-04
AI Technical Summary
Existing technologies have shortcomings in dealing with the spatiotemporal causality and credibility of evidence in complex river networks. The physical uninterpretability of deep learning and the broken evidence chain of source tracing logic lead to incorrect attribution of pollution sources. Furthermore, the fusion of multi-source evidence lacks dynamic modeling and posterior updates, making it unable to effectively cope with noisy data.
Data from the catchment area of the water source is collected, and a source contribution vector is generated by combining a multi-task safety prediction model with physical transmission constraints. Then, risk assessment and source tracing evidence chain verification are carried out using Bayesian decision theory and differentiable river network migration operators to build an intelligent control system.
It has achieved an intelligent closed loop of perception-prediction-source tracing-control, which has improved the physical causality and interpretability of evidence in the location of pollution sources, and enhanced the system's adaptability and prediction accuracy.
Smart Images

Figure CN122693928B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water resource protection and intelligent environmental management technology, and in particular to a method and system for predicting and controlling the safety compliance of drinking water sources based on data-driven and physical constraints. Background Technology
[0002] The safety of drinking water sources is the cornerstone of safeguarding public health and social stability. With the increasing complexity of industrial layouts in river basins and the frequent occurrence of extreme weather events, the risks to water sources are characterized by their suddenness, high concealment, and complex evolution paths. Traditional passive monitoring models are no longer sufficient to meet the needs, and building intelligent systems with forward-looking prediction and control capabilities has become a trend in the industry.
[0003] Currently, water source management mainly relies on online sensor networks for real-time status monitoring, combined with hydrodynamic models or general deep learning algorithms (such as Long Short-Term Memory networks (LSTM) and Graph Convolutional Networks (GCN)) to extrapolate water quality trends. In terms of pollution source tracing, existing technologies mostly employ attribution methods based on correlation analysis, or utilize multi-indicator scoring systems to statically rank potential pollution sources, combined with simple threshold alarm mechanisms to assist manual decision-making.
[0004] However, existing technologies have shortcomings in handling the spatiotemporal causality and credibility of evidence in complex river networks, mainly manifested in the physical uninterpretability of deep learning and the broken evidence chain of source tracing logic. Specifically, general attention mechanisms only assign weights based on statistical correlation of data, ignoring the physical laws of time lag and attenuation that pollutants must follow in the propagation of river networks. This leads to the current emissions from distant sources often being incorrectly attributed to the main cause of short-term water quality changes, resulting in accurate predictions but incorrect attributions. In addition, existing multi-source evidence fusion lacks dynamic modeling and post-hoc update mechanisms for the credibility of the evidence itself. When faced with noisy data generated by online public opinion or faulty sensors, it is impossible to conduct effective cross-validation, making it difficult to form a verifiable closed-loop evidence chain. Summary of the Invention
[0005] The purpose of this invention is to provide a data-driven and physically constrained method and system for predicting and controlling the safety compliance of drinking water sources, in order to solve one of the problems existing in the prior art.
[0006] The technical solution, a data-driven and physically constrained method for predicting and controlling the safety compliance of drinking water sources, includes:
[0007] Water quality monitoring data, hydrological and meteorological data, pollution source activity data, and social perception data are collected from the catchment area of the water source. After spatiotemporal alignment processing, a water source state feature tensor is generated.
[0008] The tensor of the water source status features is input into a multi-task security prediction model that is pre-trained and stored on a server. The model outputs the probability distribution of compliance for a future preset time period and generates the source contribution vector of each upstream node based on physical transmission constraints.
[0009] A risk assessment is conducted on the probability distribution of compliance, a risk budget indicator is calculated, and a source tracing trigger signal is generated when the risk budget indicator meets the preset trigger conditions.
[0010] In response to the source tracing trigger signal, a candidate source set is constructed based on the source contribution vector, and the candidate source set is verified posteriorly by combining the source tracing evidence chain to determine the pollution source location result;
[0011] A tiered control plan is generated based on the pollution source location results, and target control instructions are selected and issued for execution based on preset assessment rules.
[0012] Specifically, the source contribution vector of each upstream node is generated based on physical transmission constraints, including:
[0013] Based on the hydrological velocity data and river network topology in the water source state characteristic tensor, the hydraulic transmission time from each upstream node to the water source intake is calculated.
[0014] Based on the difference between the hydraulic transmission time and the current predicted time window, a hydraulic reachability soft mask is constructed using a differentiable activation function to characterize the physical reachability of each upstream node.
[0015] In the process of feature encoding of the water source state feature tensor in the multi-task security prediction model, the original attention weights calculated by the attention mechanism layer are extracted, and the original attention weights are fused with the hydraulic accessibility soft mask element by element. After normalization, the source contribution vector that satisfies the physical causal constraints is obtained.
[0016] The hydraulic reachability soft mask is constructed using the Sigmoid function, and the formula for calculating the source contribution vector satisfies:
[0017] M soft (j,Δt)=σ((Δt-T travel (j)) / τ temp );
[0018] w j =α j ·M soft (j,Δt) / Σ k=1 N α k ·M soft (k,Δt);
[0019] Among them, M soft(j,Δt) is the hydraulic reachability soft mask for the j-th upstream node within the prediction time window Δt, where T travel (j) represents the hydraulic transmission time, τ temp The preset temperature parameter is σ(·), which is the Sigmoid function, and α is the α value. j and α k For the original attention weights, w j Let represent the value of the j-th element in the normalized source contribution vector, and N be the total number of upstream nodes.
[0020] This includes conducting a risk assessment of the probability distribution of compliance and calculating risk budget indicators, specifically including:
[0021] Construct a decision loss matrix, which includes the underreporting cost corresponding to the actual exceedance but no warning, and the false alarm cost corresponding to the actual meetability but warning issued, with the underreporting cost being greater than the false alarm cost.
[0022] Based on Bayesian decision theory, with the goal of minimizing the expected decision loss, the optimal Bayesian warning threshold is calculated.
[0023] The expected value of the probability distribution of compliance is compared with the optimal Bayesian warning threshold to generate a risk budget indicator.
[0024] The formula for calculating the optimal Bayesian warning threshold is as follows:
[0025] τ * =C miss / (C miss +C false );
[0026] Where, τ * For the optimal Bayesian warning threshold, C miss To underreport costs, C false Cost of false alarms;
[0027] The costs of underreporting and false reporting are cost parameters that are pre-configured and stored according to the protection level of the water source.
[0028] Specifically, the source contribution vector of each upstream node is generated based on physical transmission constraints, including:
[0029] Based on the river network topology and hydrodynamic parameters of the water source catchment area, a differentiable river network migration operator is constructed to describe the spatiotemporal evolution of pollutants from each upstream node to the water intake.
[0030] Using the encoder layer of the multi-task safety prediction model, the source water condition feature tensor is mapped to the source load latent variable of each upstream node. The source load latent variable represents the initial pollution discharge intensity before transmission through the river network.
[0031] The source load latent variable is spatiotemporally convolved with the differentiable river network migration operator to reconstruct the downstream response reconstruction value of the water intake. The proportion of each node component in the spatiotemporal convolution operation to the downstream response reconstruction value is extracted as the source contribution vector.
[0032] The formula for constructing the differentiable river network migration operator is as follows:
[0033] T i→s (δ)=exp(-κ i→s ·δ)·I(δ=round(Dist i→s / v' i→s ));
[0034] Among them, T i→s (δ) represents the transmission intensity from upstream node i to water intake s during the lag time δ, κ i→s Dist is the equivalent attenuation coefficient pre-calculated based on the river water quality degradation coefficient and dilution coefficient. i→s v' represents the shortest path distance along the river network. i→s Let I(·) be the path average velocity, and let I(·) be the indicator function. When the time lag δ equals the theoretical lag time round(Dist) i→s / v' i→s The value is 1 when the condition is met, and 0 otherwise.
[0035] The formula for calculating the downstream response reconstruction value is:
[0036] z s (t+h)=Σ i∈V Σ δ=0 D T i→s (δ)·L i (t+h-δ);
[0037] Among them, z s (t+h) represents the reconstructed downstream response value at the predicted time, L i Let V be the source load latent variable, V be the set of upstream nodes, and D be the maximum time lag window.
[0038] This includes conducting posterior verification of the candidate source set based on the source tracing evidence chain to determine the pollution source location result, specifically including:
[0039] The multi-source sensing data in the water source state feature tensor is converted into a structured evidence object in a unified format, and a preset learnable evidence credibility parameter is assigned to each structured evidence object.
[0040] Using the source contribution vector as the prior probability, a Bayesian probabilistic graphical model is constructed based on the structured evidence object and the corresponding evidence credibility parameter.
[0041] The risk probability of each node in the candidate source set is updated posteriorly using a Bayesian probabilistic graphical model to obtain the corrected posterior probability distribution, and the posterior probability distribution is determined as the pollution source location result.
[0042] The formula for calculating the posterior update satisfies:
[0043] π i ∝w i ·П e∈Eset (P(e|i))^r e ;
[0044] Where, π i Let w be the posterior probability of node i. i Let be the value of the i-th element in the source contribution vector. Eset Let be the set of evidence at the current moment, e be a single structured evidence object, P(e|i) be the likelihood probability of evidence e obtained based on a pre-built likelihood probability table when assuming the pollution source is node i, ^ be a superscript symbol, and r be the likelihood probability of the evidence. e ∈[0,1] is the evidence credibility parameter.
[0045] According to another aspect of the embodiments of this application, a drinking water source safety compliance prediction and control system based on data-driven and physical constraints is also provided, and the drinking water source safety compliance prediction and control method based on the above-mentioned data-driven and physical constraints includes:
[0046] The multi-source sensing and feature construction module is used to collect water quality monitoring data, hydrological and meteorological data, pollution source activity data and social perception data in the water source catchment area, and generate water source state feature tensors after spatiotemporal alignment processing.
[0047] The physical constraint prediction module is used to input the water source state feature tensor into a pre-trained and stored multi-task safety prediction model on the server, output the compliance probability distribution for a future preset period, and generate the source contribution vector of each upstream node based on the physical transmission constraints.
[0048] The risk budget early warning module is used to conduct risk assessment on the probability distribution of compliance, calculate risk budget indicators, and generate a source tracing trigger signal when the risk budget indicators meet the preset trigger conditions.
[0049] The evidence chain tracing module is used to construct a candidate source set based on the source contribution vector in response to the source tracing trigger signal, and to perform posterior verification of the candidate source set in combination with the source tracing evidence chain to determine the pollution source location result;
[0050] The intelligent control and management decision-making module is used to generate a graded control plan based on the pollution source location results, select target control instructions based on preset assessment rules, and issue them for execution.
[0051] Beneficial effects: This invention improves upon the problems of insufficient physical causality and unclear source evidence in existing models, and can realize an intelligent closed loop of perception-prediction-source tracing-control. Attached Figure Description
[0052] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0053] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart illustrating the overall architecture of the data-driven and physical constraint-based method for predicting and controlling the safety of drinking water sources in this application.
[0055] Figure 2 This is a flowchart illustrating the steps of generating the source contribution vector of each upstream node based on physical transmission constraints in this embodiment of the application.
[0056] Figure 3 This is a flowchart illustrating the steps for determining the location of the pollution source in an embodiment of this application.
[0057] Figure 4 This is a flowchart illustrating the steps for calculating the lower bound compliance probability in an embodiment of this application.
[0058] Figure 5 This is a flowchart illustrating the steps for selecting the target control instruction in the embodiments of this application. Detailed Implementation
[0059] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0060] Example 1
[0061] like Figure 1 As shown, this embodiment describes the overall architecture, basic sensing network construction, and core data processing flow of the drinking water source safety compliance prediction and control method based on data-driven and physical constraints of the present invention.
[0062] Step 101: Collect water quality monitoring data, hydrological and meteorological data, pollution source activity data and social perception data in the catchment area of the water source, and generate the water source state feature tensor after spatiotemporal alignment processing.
[0063] In this embodiment, the catchment area of a water source refers to all rainwater collection areas that directly or indirectly affect the water quality of the water source, typically including upstream tributaries, riverside industrial and mining areas, and agricultural non-point source runoff areas. To achieve comprehensive sensing, this invention constructs a multi-source heterogeneous monitoring and sensing network. Water quality monitoring data is collected in real time by online water quality sensors deployed at water intakes, major tributary inlets, and key sewage outlets. The collected indicators include, but are not limited to: pH, dissolved oxygen (DO), permanganate index (CODMn), ammonia nitrogen (NH3-N), total phosphorus (TP), heavy metals (such as arsenic (As) and cadmium (Cd)), and characteristic organic pollutants. The sampling frequency is preferably set to once per hour, and can be increased to once every 15 minutes for high-risk areas. Hydrological and meteorological data are derived from automatic rain gauges, river level and flow stations, and meteorological radar grid products within the watershed, specifically including rainfall, river level, cross-sectional flow, and flow velocity.
[0064] Accordingly, pollution source activity data is primarily obtained by connecting with the business systems of the ecological environment and agricultural departments. This includes: online monitoring data and daily discharge permits for industrial enterprises; livestock numbers and manure removal records for large-scale livestock farms; and fertilization plans and crop types for farmland. Socially-sensed data is collected in real-time from social media and local news websites using web crawling technology. For the collected unstructured text data, the system employs a pre-trained, robust, optimized BERT pre-training method, namely the RoBERTa domain adaptive model, for semantic analysis, identifying high-risk keywords such as odor, dead fish, and illegal discharge, and assigning them a risk score between 0 and 1.
[0065] Optionally, after acquiring the aforementioned multi-source data, spatiotemporal alignment processing is required to generate a standardized input tensor. Specifically, all data points with spatial attributes are uniformly projected onto the CGCS2000 coordinate system, and aggregated using sub-catchments as the smallest spatial unit. Temporally, various types of data are resampled or interpolated to a uniform time granularity (e.g., 1 hour). For missing values, spatiotemporal kriging interpolation or linear interpolation is used for imputation. The generated source water condition feature tensor X can be represented as a three-dimensional tensor with dimensions (T, N, F). Here, T represents the historical time step (e.g., the past 72 hours), N represents the number of sub-catchment nodes, and F represents the fusion feature dimension of each node, including features such as water quality, hydrology, pollution source activity intensity, and public opinion risk score.
[0066] Furthermore, the anomaly handling mechanism specifically includes the following: During data acquisition, if a sensor detects continuous data loss exceeding a preset duration (e.g., 2 hours) or data mutation exceeding a reasonable threshold (e.g., 3 times the standard deviation), the system automatically marks the data source as abnormal and replaces it with a weighted average of the spatiotemporally neighboring stations. If the number of abnormal stations exceeds a preset proportion of the total number of stations (e.g., 30%), the system automatically degrades its operation, suspends the issuance of automatic control commands, and sends a manual intervention request to the on-duty personnel.
[0067] Step 102: Input the water source status feature tensor into the pre-trained and stored multi-task security prediction model on the server, output the compliance probability distribution for the future preset time period, and generate the source contribution vector of each upstream node based on physical transmission constraints.
[0068] In this embodiment, the multi-task safety prediction model is a deep learning network architecture used to simultaneously solve the problems of water quality prediction, pollutant identification, and source apportionment. This model is deployed on a cloud computing platform, receiving water source status feature tensors uploaded from the edge. The preset time period refers to a future prediction time window, such as the next 24, 48, or 72 hours. The compliance probability distribution is not only a specific predicted value but also includes information about the uncertainty of the prediction. Specifically, through deep ensemble technology, M (e.g., M=5) sub-models with different initializations but identical structures are trained. By statistically analyzing the output results of the M sub-models, the mean μ and variance σ of the compliance probability are obtained. 2 A probability distribution for meeting the standard was constructed.
[0069] Optionally, physical transport constraints (such as differentiable migration operators or hydraulic masks) are used to constrain the behavior of the purely data-driven model to conform to hydrodynamic laws. In one basic implementation, this constraint is embodied in explicit modeling of the hydraulic transport time from the upstream node to the intake, ensuring that only pollution sources that are physically likely to reach the intake are assigned a contribution. The source contribution vector w is a vector of length N, where the i-th element w i Let represent the relative contribution of the i-th sub-catchment area to the water quality risk at the intake at the current predicted time, and satisfy Σw i =1. In this way, the model outputs the water quality compliance judgment result and pollution cause attribution, providing a basis for subsequent source tracing.
[0070] Step 103: Conduct a risk assessment on the compliance probability distribution, calculate the risk budget index, and generate a source tracing trigger signal when the risk budget index meets the preset trigger conditions.
[0071] In this embodiment, the risk assessment does not rely on the threshold determination of a single predicted value, but is based on the probability distribution to calculate the risk. The risk budget index is a calculated index that comprehensively considers the possibility of exceeding the standard and the consequences of exceeding the standard.
[0072] In one optional implementation, the indicator can be the difference between the predicted average probability of compliance and a preset safety threshold; in another optional implementation, the indicator can be the sum of accumulated risk gaps over a future period, i.e., the risk budget. The preset trigger conditions are flexibly set according to the protection level of the water source. For example, for a primary protection zone, the trigger conditions may be set more strictly (e.g., triggering when the probability of compliance is below 99%); while for a quasi-protected zone, they may be relatively lenient. When the system detects that the risk budget indicator exceeds the allowable range, it automatically generates a source tracing trigger signal, activating the downstream source tracing module.
[0073] Step 104: In response to the source tracing trigger signal, construct a candidate source set based on the source contribution vector, and perform posterior verification of the candidate source set in conjunction with the source tracing evidence chain to determine the pollution source location result.
[0074] Specifically, upon receiving a source tracing trigger signal, the system does not conduct a full-basin investigation. Instead, it uses physically consistent source contribution vectors to initially screen nodes with high contributions, constructing a candidate source set and introducing a source tracing evidence chain for secondary verification. This source tracing evidence chain includes, but is not limited to: sudden changes in online monitoring data near the node, abnormal records of enterprise operating conditions, land use changes in remote sensing imagery, and related public opinion reports. The system uses Bayesian inference or evidence fusion algorithms to calculate the posterior probability that this type of evidence supports the candidate source as a real pollution source. The determined pollution source location result includes a list of several high-risk pollution sources and their confidence levels, for example, node A with 85% confidence; node B with 60% confidence.
[0075] Step 105: Generate a graded control plan based on the pollution source location results, select target control instructions based on preset assessment rules, and issue them for execution.
[0076] Optionally, in this embodiment, the control decision module pre-configures a control resource library, including backup water source scheduling permissions, a contact list of key polluting units, encrypted configuration templates for monitoring stations, and control interfaces for river ecological water replenishment gates. Based on the pollution source location results and risk levels, the system automatically generates three-level response plans: Level 1 plans correspond to emergency situations where pollution levels are confirmed to exceed standards, with measures including activating backup water sources and requiring high-risk enterprises to cease production; Level 2 plans correspond to high-risk warnings, with measures including increasing monitoring frequency (e.g., increasing to once every 15 minutes) and pushing out emission restriction suggestions; Level 3 plans correspond to potential risk alerts, with measures including drone patrols and issuing public warnings. The system utilizes a pre-trained reinforcement learning strategy network to comprehensively evaluate the overall benefits of each plan in terms of water quality improvement, social costs, and response time, selecting the plan with the highest score as the target control instruction, and automatically issuing and executing it through an IoT interface or government platform to achieve closed-loop control.
[0077] Example 2
[0078] This embodiment describes a specific method for implementing physical transmission constraints using the hydraulic reachability time mask (HTTCA) and for implementing dynamic early warning using a Bayesian risk perception threshold.
[0079] According to one aspect of this application, the source contribution vector of each upstream node is generated analytically based on physical transmission constraints, such as... Figure 2 As shown, it specifically includes:
[0080] Step 201: Based on the hydrological velocity data and river network topology in the water source state feature tensor, calculate the hydraulic transmission time from each upstream node to the water source intake.
[0081] As an optional implementation, to introduce physical constraints into the attention mechanism, it is necessary to calculate the theoretical transport time of pollutants in the river network. The system constructs a directed acyclic graph (DAG) of the river network based on a digital elevation model (DEM), where nodes represent sub-catchments and edges represent channels. For any upstream node j to the intake s, the hydraulic transport time T is calculated. travel (j) The calculation formula is:
[0082] T travel (j)=Σ k∈Path(j,s) ·L k / U k (t);
[0083] Among them, L k U is the length of the k-th segment of the river along the path. k (t) represents the average cross-sectional velocity of the river segment at the current time t. k (t) can be calculated from measured data at hydrological stations or from hydrodynamic models. This calculation process is dynamically updated; during the flood season when flow velocities are high, T... travel (j) will decrease; during the dry season when the flow rate is low, it will increase.
[0084] Step 202: Based on the difference between the hydraulic transmission time and the current predicted time window, construct a hydraulic reachability soft mask using a differentiable activation function to characterize the physical reachability of each upstream node.
[0085] Furthermore, this embodiment constructs a differentiable soft gating mechanism. For a given prediction time window Δt (e.g., predicting water quality for the next 6 hours), this type of model focuses on sources with transmission times close to 6 hours, while suppressing sources with transmission times much greater than 6 hours that have not yet arrived or sources with transmission times much less than 6 hours that have already flowed. To this end, a hydraulic reachability soft mask M is constructed. soft The calculation formula is as follows:
[0086] Msoft (j,Δt)=σ((Δt-T travel (j)) / τ temp );
[0087] Among them, M soft (j,Δt) is the hydraulic reachability soft mask for the j-th upstream node within the prediction time window Δt, where T travel (j) represents the hydraulic transmission time, τ temp A preset temperature parameter (e.g., 1.0 hour) is used to control the smoothness of the mask boundaries, and σ(·) is the Sigmoid function. τ temp The value ranges from 0.5 to 2.0 hours; the smaller the value, the steeper the mask boundary and the stricter the selection of transmission time; the larger the value, the smoother the boundary and the greater the time tolerance allowed. When Δt is greater than T travel When (j), M soft A value close to 1 indicates that the source is physically reachable; conversely, a value close to 0 indicates that the source is physically reachable.
[0088] Step 203: In the process of feature encoding of the water source state feature tensor in the multi-task security prediction model, the original attention weights calculated by the attention mechanism layer are extracted, and the original attention weights are fused with the hydraulic accessibility soft mask element by element. After normalization, the source contribution vector that satisfies the physical causal constraints is obtained.
[0089] In multi-task models, data-driven attention modules (such as Self-Attention in Transformers) generate a set of raw attention weights α. j This reflects the correlation at the data level. To incorporate physical constraints, α... j With M soft Element-wise multiplication of (j, Δt) followed by renormalization yields the final source contribution w. j :w j =α j ·M soft (j,Δt) / Σ k=1 N α k ·M soft (k,Δt);
[0090] Among them, M soft (j,Δt) is the hydraulic reachability soft mask for the j-th upstream node within the prediction time window Δt, α j and α k For the original attention weights, w j Let represent the value of the j-th element in the normalized source contribution vector, and N be the total number of upstream nodes.
[0091] In this way, correlation is presented only on the data, i.e., α. j The height and height physically satisfy the transmission time condition, i.e., α j ·M s A higher final contribution can only be obtained when all nodes meet the requirements. j .
[0092] According to one aspect of this application, a risk assessment is performed on the probability distribution of compliance, and a risk budget indicator is calculated, specifically including:
[0093] Optionally, a decision loss matrix is constructed, which includes the underreporting cost corresponding to the actual exceedance but no warning, and the false alarm cost corresponding to the actual compliance but warning issued, and the value of the underreporting cost is greater than the false alarm cost.
[0094] As an optional implementation, in the early warning stage, to reduce the subjectivity of traditional experience thresholds, this embodiment introduces Bayesian decision theory. Define the decision loss matrix L. Let C... miss To cover the costs of underreporting, including public health risks, public opinion crises, and subsequent governance costs resulting from the failure to issue warnings of exceeding standards; C false The cost of false alarms covers the consumption of emergency resources and social disruption caused by false warnings. In the drinking water source scenario, assuming safety is ensured, therefore, C is set as... miss Much larger than C false For example, in a normal operating scenario, C can be set. miss =50,C false =1; however, during the flood season or major event security period, due to lower risk tolerance, it can automatically adjust to C. miss =200,C false =1. The system has a built-in scenario-cost adjustment table that can automatically switch cost parameters based on the current date, weather forecast, and event calendar.
[0095] Optionally, based on Bayesian decision theory, the optimal Bayesian warning threshold is calculated with the goal of minimizing the expected decision loss.
[0096] Accordingly, based on the above loss matrix, if an early warning is issued, the expected loss is C. false • P (meets the target); if no warning is issued, the expected loss is C. miss • P (exceeding the limit). Setting them equal, we can derive the Bayesian optimal warning threshold τ that minimizes the total expected loss. * :
[0097] τ * =C miss / (C miss +C false );
[0098] Where, τ* For the optimal Bayesian warning threshold, C miss To underreport costs, C false The cost of false alarms; the cost of underreporting and the cost of false alarms are cost parameters that are pre-configured and stored according to the protection level of the water source.
[0099] When C miss =100,C false When τ = 1, * ≈0.990. The system is considered safe and does not issue a warning only when the model predicts a success rate of over 99%; if the success rate is below 99%, it is considered risky and a warning should be triggered.
[0100] According to another aspect of this application, the method further includes risk correction of the Bayesian optimal warning threshold based on prediction uncertainty, including:
[0101] Optionally, the compliance probability distribution can be fitted to a β distribution using the moment matching method, and the cumulative probability of the β distribution at the Bayesian optimal warning threshold can be calculated.
[0102] Accordingly, to fully utilize the distribution information output by Deep Ensemble, not only the mean, this embodiment performs risk correction on the threshold. Assuming the predicted probability of achieving the target follows a β distribution, the predicted mean μ is used... p and variance σ p 2 Perform moment matching parameter estimation:
[0103] α=μ p (μ p (1-μ p ) / σ p 2 -1);
[0104] β=(1-μ p )(μ p (1-μ p ) / σ p 2 -1);
[0105] Furthermore, the distribution of β at the baseline threshold τ is calculated. * The cumulative probability P(p<τ) * |α,β), this probability reflects the possibility that the actual probability of meeting the standard is lower than the benchmark requirement.
[0106] Optionally, a modified risk perception threshold is calculated based on the cumulative probability and a preset risk sensitivity coefficient, and the risk perception threshold is used as the final benchmark for generating risk budget indicators.
[0107] According to one aspect of this application, the final risk perception threshold τrisk The calculation expression is as follows:
[0108] τ risk =min(1,τ) * +κ·P(p<τ * |α,β));
[0109] Where κ is the risk sensitivity coefficient (e.g., κ=0.05), and α and β are the parameters of the β distribution. This formula means that if the predicted distribution shows significant uncertainty or left skewness, i.e., a higher probability of falling into the low-probability-of-meeting range, the cumulative probability term increases, leading to a higher final warning threshold τ. risk This further improves the system's performance. Essentially, when uncertainty is high, the system automatically becomes more conservative and cautious, further reducing the risk of missed detections. The average real-time predicted probability of achieving the target is then compared with this τ. risk By making comparisons, risk budget indicators can be generated.
[0110] Example 3
[0111] This embodiment describes the use of a differentiable river network migration operator to replace the traditional attention mechanism, thereby achieving source term inversion that satisfies physical time delay and decay constraints.
[0112] In one possible implementation, the source contribution vector of each upstream node is generated analytically based on physical transmission constraints, specifically including:
[0113] Step 301: Based on the river network topology and hydrodynamic parameters of the water source catchment area, construct a differentiable river network migration operator to describe the spatiotemporal evolution of pollutants from each upstream node to the water intake.
[0114] In this embodiment, the differentiable river network migration operator is a pre-computed, fixed, or semi-learnable tensor that encapsulates the complex physical transport process into a linear operator. Specifically, during construction, the shortest path distance Dist from any upstream node i to the water intake s is determined based on the river network topology. i→s Combined with the average flow velocity v' along the path i→s Calculate the theoretical lag time δ=round(Dist i→s / v' i→s Simultaneously, an equivalent attenuation coefficient κ is introduced. i→s To simulate the degradation and dilution of pollutants during transport. The differential river network migration operator T i→s The formula for constructing (δ) is:
[0115] T i→s (δ)=exp(-κ i→s ·δ)·I(δ=round(Dist i→s / v' i→s ));
[0116] Among them, T i→s (δ) represents the transmission intensity from upstream node i to water intake s during the lag time δ, κ i→s Dist is the equivalent attenuation coefficient pre-calculated based on the river water quality degradation coefficient and dilution coefficient. i→s v' represents the shortest path distance along the river network. i→s Let I(·) be the path average velocity, and let I(·) be the indicator function. When the time lag δ equals the theoretical lag time round(Dist) i→s / v' i→s The value is 1 when the condition is met, and 0 otherwise.
[0117] Step 302: Using the encoder layer of the multi-task safety prediction model, the source water condition feature tensor is mapped to the source load latent variables of each upstream node. The source load latent variables represent the initial pollution discharge intensity before transmission through the river network.
[0118] In this embodiment, to interface the data-driven features with the physical operators, the model needs to invert the initial emissions of each node. The encoder layer can specifically employ a time-fusion Transformer or a GCN structure. After processing by the encoder, the input tensor no longer directly outputs the downstream concentration, but instead outputs the source load latent variable L of each node i at time t. i (t). The physical meaning of this latent variable is the pollution load generated by this node at the current moment, assuming no river network transmission delay. It should be noted that L... i (t) is a latent space variable whose value is directly proportional to the actual pollutant emissions (e.g., kg / s) and is obtained through supervised training.
[0119] Step 303: Perform spatiotemporal convolution operation on the source load latent variable and the differentiable river network migration operator to reconstruct the downstream response reconstruction value of the water intake, and extract the proportion of each node component in the spatiotemporal convolution operation to the downstream response reconstruction value as the source contribution vector.
[0120] In this embodiment, the physical superposition process of pollutants is simulated through convolution operations. The downstream response reconstruction value z s The formula for calculating (t+h) is:
[0121] z s (t+h)=Σ i∈V Σ δ=0 D T i→s (δ)·L i (t+h-δ);
[0122] Among them, z s (t+h) represents the reconstructed downstream response value at the predicted time; L iV represents the latent variable of the source load; V is the set of upstream nodes; D is the maximum time lag window, which can be determined based on the maximum hydraulic transmission time from the farthest upstream node in the river network to the water intake. Those skilled in the art can select an appropriate value based on the actual river network topology and hydrological conditions. In this embodiment, D is set to 72 hours.
[0123] The physical meaning of this formula is: the concentration at the water intake at time t+h is equal to the load L generated by all upstream nodes i at the historical time t+h-δ. i After attenuation T i→s The sum is then transmitted to the water intake. Based on this, the physical contribution component of the i-th node can be defined: g i (t+h)=Σ δ=0 D T i→s (δ)·L i (t+h-δ). The final source contribution vector w i Then, through normalization calculation, we obtain: w i =g i / (Σg j +ε). This calculation method ensures that the contribution w follows the laws of physical transmission, that is, only nodes that are at the right time, meet the lag δ, discharge sufficient load, have a large L, still have residue after decay, and have T not equal to 0 can obtain a high contribution.
[0124] According to one aspect of this application, in response to a source tracing trigger signal, a candidate source set is constructed based on the source contribution vector, specifically including:
[0125] Optionally, based on the differentiable river network migration operator, the cumulative transmission intensity from each upstream node to the water intake is calculated.
[0126] As a further constraint on candidate source generation, the system evaluates the physical properties of the river network. The cumulative transmission intensity S is calculated. T (i)=Σ δ T i→s (δ); This index reflects the degree of hydraulic connection between node i and the intake. For nodes that are far away or have slow flow velocities, leading to near-complete attenuation, S T A value close to 0 provides a static physical filter.
[0127] Optionally, the source contribution vector of each upstream node is obtained; nodes that simultaneously satisfy the condition that the cumulative transmission strength is greater than a preset transmission threshold and the source contribution vector is greater than a preset contribution threshold are selected to form a candidate source set, and interference nodes that are physically unreachable or have weak contributions are excluded.
[0128] In this embodiment, a dual threshold strategy based on both physical reachability and dynamic contribution is used to filter candidate sources. A preset transmission threshold η is used. TUsed to remove physically unreachable edge nodes (e.g., S). T Nodes with a value <0.01); preset contribution threshold η w Used to remove nodes that have no emissions in the current time period (e.g., w). i Nodes with a value less than 0.05. Only nodes that satisfy both of these conditions can enter the candidate source set C. set For example, although a certain node is physically close, S T If the value is high, but there is currently no pollution discharge, and low L leads to low w, then it is excluded; if a node currently discharges a large amount of pollution and has high L, but the distance is too great for it to decay completely, then S... T Low values are also excluded. This dual filtering narrows down the tracing scope, improving computational efficiency and accuracy.
[0129] Example 4
[0130] This embodiment describes how, after obtaining the physical contribution, multi-source heterogeneous evidence is introduced for Bayesian inference to achieve interpretable, highly accurate source tracing with adaptive iterative capabilities.
[0131] In one possible implementation, the candidate source set is validated posteriorly by combining the source tracing evidence chain to determine the pollution source location result, such as... Figure 3 As shown, it specifically includes:
[0132] Step 401: Convert the multi-source sensing data in the water source state feature tensor into a structured evidence object in a unified format, and assign a preset learnable evidence credibility parameter to each structured evidence object; wherein, the multi-source sensing data are water quality monitoring data, hydrological and meteorological data, pollution source activity data and social perception data.
[0133] In this embodiment, in order to integrate heterogeneous data such as text, images, and numerical values, a unified evidence tuple structure e = <type, region, time, value, r> is defined. e ,φ e >. Where, type represents the type of evidence (e.g., public opinion, online monitoring, ledger); region represents the associated sub-catchment ID; value represents the specific numerical value or feature vector of the evidence; r e ∈[0,1] represents the credibility parameter of the evidence; φ e This is the likelihood function interface. The system pre-sets the initial confidence level for different types of evidence, such as the initial r of water quality monitoring station data after regular calibration. e The initial value was set at 0.9; while unofficial sentiment data from social media had an initial value of 0.9. e Set to 0.4. It is important to emphasize that r... e These are learnable parameters that iterate continuously as the system runs.
[0134] Step 402: Using the source contribution vector as the prior probability, construct a Bayesian probabilistic graphical model based on the structured evidence object and the corresponding evidence credibility parameter.
[0135] In this embodiment, the physical source contribution *w* is used as the prior probability *Prior* for source tracing. A Bayesian graph model is constructed, with candidate sources as latent variables and various types of evidence as observed variables. For each type of evidence, a likelihood function *P(e|i)* is defined. For example, for public opinion evidence, if node *i* is indeed a pollution source, the probability of *dead fish* public opinion appearing in that area is relatively high (e.g., 0.8); if node *i* is not a pollution source, the probability of *dead fish* public opinion appearing is relatively low (e.g., 0.1).
[0136] Step 403: Use the Bayesian probabilistic graphical model to perform a posterior update on the risk probability of each node in the candidate source set to obtain the corrected posterior probability distribution, and determine the posterior probability distribution as the pollution source location result.
[0137] As an optional implementation, posterior update is a step in information fusion. Based on Bayes' theorem and combined with the evidence confidence parameter, the posterior probability π... i The calculation formula is:
[0138] π i ∝w i ·∏ e∈Eset (P(e|i))^r e ;
[0139] Where, π i Let w be the posterior probability of node i. i Let be the value of the i-th element in the source contribution vector. Eset Let be the set of evidence at the current moment, e be a single structured evidence object, P(e|i) be the likelihood probability of evidence e obtained based on a pre-built likelihood probability table when assuming the pollution source is node i, ^ be a superscript symbol, and r be the likelihood probability of the evidence. e ∈[0,1] is the evidence credibility parameter.
[0140] Accordingly, this formula reflects the corrective effect of evidence on physical priors. The exponent r e Its function is to adjust the weight of evidence: when r e When r approaches 1, the evidence e affects the posterior probability; when r... e When the value approaches 0, the evidence is considered unreliable noise and has almost no impact on the results.
[0141] Furthermore, the following example illustrates this further: Suppose there are two candidate sources A and B, and the physical model gives a contribution of w. A =0.3,w B=0.7, B is more suspicious. At this time, the system receives a report of illegal discharge in region A, evidence e. The likelihood probability of this evidence is P(e|A)=0.9 when A is the source, and P(e|B)=0.1 when B is the source. If the report comes from an official channel, the credibility r is... e If π = 1.0, then the updated posterior probability ratio π A :π B ∝(0.3×0.9):(0.7×0.1)=0.27:0.07, π after normalization A The result is approximately 0.79, reversing the initial assessment, making A the prime suspect. If the report originated from an anonymous account, the credibility r is... e =0.1, then π A :π B ∝(0.3×0.9 0.1 ):(0.7×0.1 0.1 The result is approximately 0.3 × 0.99: (0.7 × 0.79) ≈ 0.3: 0.55, and the result is not reversed, still based on the physical model.
[0142] According to another aspect of this application, the method also includes self-calibration of the credibility of the evidence:
[0143] Optionally, actual law enforcement feedback data on the pollution source location results can be obtained, which includes information confirming or disproving the pollution source location results.
[0144] Specifically, after the control operation is completed, law enforcement officers will enter the on-site verification results (such as confirming that Company A was illegally discharging or that no abnormalities were found in Area B) into the system, which constitutes a label for supervision and learning.
[0145] Optionally, based on actual law enforcement feedback data, the evidence credibility parameters corresponding to each structured evidence object involved in generating the pollution source location results are updated. If a certain type of evidence appears more frequently than the preset benchmark in the confirmed correct location results, its corresponding evidence credibility parameter is increased; otherwise, it is decreased.
[0146] Accordingly, this embodiment enables the system to have adaptive update capabilities. The system updates r using gradient descent or heuristic rules. e The specific update formula is as follows:
[0147] r e ←clip(r e +ρ·(I correct -0.5), 0, 1);
[0148] Where ρ is the learning rate; I correct`clip` is an indicator variable; it is 1 when the evidence points to the same conclusion as the enforcement result, and 0 otherwise; `clip` is a truncation function. The system establishes an evidence source evaluation model and performs weighted analysis on different evidence sources based on historical results. Simultaneously, as the operating cycle increases, the system automatically increases the weight of evidence sources that frequently align with the conclusion, and dynamically decreases or blocks evidence sources with high false alarm rates. Through this closed-loop feedback mechanism, the source tracing logic is continuously optimized, achieving iterative improvements in source tracing accuracy.
[0149] Example 5
[0150] According to one aspect of this application, a coverage guarantee calibration is performed on the compliance probability distribution, and a lower bound compliance probability is calculated, such as... Figure 4 As shown, it specifically includes:
[0151] Step 501: Obtain the predicted success rate and true label on the pre-stored calibration dataset, and calculate the inconsistency score to measure the degree of deviation between the model prediction and the true label.
[0152] In this embodiment, the prediction results output by Deep Ensemble are processed on an independent calibration dataset. The inconsistency score s is defined. n This is used to measure the degree of confidence bias in model predictions. The specific formula is: s n =max(0,τ0-p' n );
[0153] Where τ0 is the standard threshold for compliance (e.g., 1.0), p' n This is the predicted probability of the model for the true class of the nth calibration sample. The higher the score, the more the model's prediction deviates from reality.
[0154] Step 502, calculate the quantile q of the inconsistent scores. 1-α , where 1-α is the preset confidence level.
[0155] Sort the inconsistency scores of all samples in the calibration set, and select the 1-α quantile (e.g., if α=0.05, then select the 95th quantile) as the calibration factor q. 1-α The statistical meaning of this value is that in 95% of cases, the model's prediction error will not exceed this value.
[0156] In one possible implementation, the risk budget metric is calculated, specifically including:
[0157] Optionally, the compliance probability distribution is calibrated to ensure coverage, and the lower bound compliance probability at a preset confidence level is calculated. The lower bound compliance probability represents the conservative water quality state after eliminating statistical uncertainty.
[0158] The lower bound probability of achieving the target is obtained by calibrating the predicted probability of achieving the target at the current time based on the quantile. L Using the calculated quantiles, a conservative correction is made to the real-time predicted probability of achievement, p'. The calculation formula is as follows:
[0159] p L =max(0,p'-q 1-α );
[0160] The probability of achieving the lower bound p L With a pre-set confidence level, i.e., under statistical reliability of 1-α, the actual probability of water quality meeting the standard is at least p. L It is more robust than the traditional μ-1.96σ and is applicable to predictions of non-normal distributions.
[0161] Optionally, the difference between the lower bound compliance probability and the early warning benchmark threshold is calculated to obtain the risk gap at a single moment; based on the preset time decay weight, the risk gap at a single moment in the future preset period is weighted and summed to obtain the cumulative risk budget value, and the cumulative risk budget value is used as the risk budget indicator.
[0162] Furthermore, traditional early warning systems are typically triggered immediately upon triggering a warning signal, making them susceptible to interference from instantaneous noise. This embodiment employs a risk budgeting mechanism. The risk gap at a single moment is calculated as R(t+h)=max(0,τ). * -p L (t+h)); if p L Above the baseline threshold τ * If the gap is zero, then the shortfall is 0. Calculate the cumulative risk budget B(t) for a future period (e.g., 12 hours): B(t) = Σ h=1 H ω h ·R(t+h); where ω h Time decay weights (e.g., ω) h =0.9 h This reflects the principle that near-term risks are more important than long-term risks. When the accumulated risk budget B(t) exceeds the preset total budget threshold B... th The warning will only be triggered at that time.
[0163] This mechanism allows for minor fluctuations in water quality over a short period of time, as long as the budget is not exhausted. However, it can trigger an alarm for persistent, albeit minor, but accumulating risks, thus meeting the needs of long-term safety monitoring of water sources.
[0164] Example 6
[0165] This embodiment describes the design of the training objectives for a multi-task security prediction model, as well as the adaptive update strategy for evidence credibility.
[0166] According to one aspect of this application, the multi-task safety prediction model is obtained by pre-training by minimizing a comprehensive loss function, which includes: a prediction error loss term for measuring the accuracy of water quality prediction; and a KL divergence regularization term for measuring the consistency of source tracing. The KL divergence regularization term is obtained by calculating the relative entropy between the source contribution vector and the posterior probability distribution, thereby constraining the source contribution vector generated by the multi-task safety prediction model during training to approximate the posterior probability distribution updated based on the evidence chain.
[0167] As an optional implementation, during model training, the optimization objective is not limited to improving prediction accuracy, but also further incorporates constraints on attribution consistency. To this end, a comprehensive loss function L containing multiple constraints is designed. total This function consists of three parts: prediction error loss L. pred sparse regularization term L sparse and consistency regularization term L consist The overall loss function is expressed as:
[0168] L total =L pred +λ w ·L sparse +λ e ·L consist ;
[0169] Where, λ w and λ e To balance the weights of each task, a hyperparameter is used. In the configuration, λ... w The value range of λ is 0.01~0.1. e The value range of λ is 0.1 to 1.0. e When λ is large, the model emphasizes consistency in tracing the source, making it suitable for scenarios requiring high accuracy in tracing the source; when λ is large... e When the value is small, the model focuses more on prediction accuracy.
[0170] Specifically, the prediction error loss term L pred Binary cross-entropy loss is used for the probability of meeting the standard, while multi-label classification loss is used for the pollutant category output. The sparsity regularization term L... sparse The source contribution vector w is constrained using the L1 norm, i.e., L sparse =Σ|w i In most pollution events, there are usually only a few major pollution sources, so the model should tend to output a sparse distribution of contribution rather than a uniform distribution.
[0171] KL divergence regularization term L consist The calculation formula is:
[0172] Lconsist =KL(π||w)=Σ i π i ·log(π i / w i );
[0173] Here, π is the posterior probability distribution updated based on the evidence chain, and w is the prior source contribution vector derived from the physical operator inversion. The mechanism of this regularization term is as follows: during the training phase, the more reliable posterior result π generated by the source tracing module is used as a soft label to supervise the contribution output w of the prediction model. If the physical model represents A as the source, and the evidence chain (such as on-site monitoring and public opinion) is associated with B, the resulting high-amplitude KL divergence loss will adjust the encoder parameters of the physical model through the backpropagation algorithm, driving the model to extract features that make B the true source and correct its estimation of the latent variable L. This mechanism achieves evidence-based prediction.
[0174] Furthermore, as a preferred implementation, physical monotonicity constraints are embedded during the training process. Specifically, if there is no rainfall and no new pollution source activity in a certain period, i.e., no significant increase in input features, a penalty term is added to the loss function, ensuring that the model's output probability of meeting the standard is no lower than that of the previous period. This further ensures that the model's behavior conforms to the continuous pattern of water environment quality changes, avoiding abrupt predictions that violate physical principles.
[0175] According to one aspect of this application, the method also includes a self-calibration step for the credibility of evidence: obtaining actual law enforcement feedback data on the pollution source location results, the actual law enforcement feedback data containing confirmation or disproving information on the pollution source location results; based on the actual law enforcement feedback data, updating the credibility parameters of each structured evidence object involved in generating the pollution source location results, if a certain type of evidence appears more frequently than a preset benchmark in the confirmed correct location results, then its corresponding credibility parameter is increased, otherwise it is decreased.
[0176] As an optional implementation, this embodiment enables the system to incorporate the accumulated experience of those skilled in the art. Evidence credibility parameter r e It is not static, but evolves continuously as the system operates. The system maintains an evidence source reputation database, recording the historical performance of various types of evidence (such as online monitoring of Plant A's discharge outlet, reports from grid workers in Area B, and public opinion capture from Platform C).
[0177] After a pollution incident is resolved, the on-site verification results from law enforcement officers are entered into the system. The system uses gradient-based updates or heuristic rules to adjust r. e For example, the following truncated update formula can be used: r e (new) = clip(r) e (old)+ρ(y confirm-0.5), 0, 1);
[0178] Where ρ is the learning rate (e.g., 0.05); y confirm As a feedback label, if the source pointed to by the evidence is confirmed to be a pollution source, then y confirm =1, otherwise 0.
[0179] In one example, suppose a social media channel frequently publishes exaggerated information about dead fish in a reservoir, and in the past 10 incidents, the source tracing results generated by the system based on this evidence have been disproven by law enforcement officers in 8 of them, meaning there were no abnormalities at the scene. Through multiple iterations of the above formula, the credibility parameter r corresponding to this source of evidence... e The value will gradually decrease from the initial 0.5 to 0.1 or even lower. In future source tracing calculations, even if the channel emits a signal again, due to its r... e The value is lower, and it appears lower in the Bayesian update formula π∝w·P^r. e The weights in the algorithm will be suppressed, automatically filtering out false noise. Conversely, if the data consistency of a new sensor remains high, its reliability will gradually approach 1, becoming the dominant criterion of the system.
[0180] Example 7
[0181] This embodiment describes the generation logic of a hierarchical control scheme based on reinforcement learning, as well as the overall hardware architecture of the system.
[0182] According to one aspect of this application, a tiered control scheme is generated based on the pollution source location results, and target control instructions are selected, such as... Figure 5 As shown, it specifically includes:
[0183] Step 701: Based on the pollution source location results and the pre-set control resource library, generate a set of candidate control schemes containing different response levels.
[0184] In this embodiment, the control and management decision module reads a pre-set control and management resource database, which stores digital information on all available emergency resources. Specifically, this includes: the status of switching valves and maximum water supply at backup water sources; contact persons and remote control interfaces for key sewage discharge units; encrypted sampling instruction sets for monitoring stations; location information of agricultural non-point source pollution interception projects; and the current opening degree and maximum discharge flow of river ecological water replenishment gates.
[0185] Based on the pollution source location results, the main body discharging the pollutant and the predicted risk level were identified, the degree of hazard was assessed, and the system automatically generated three structured candidate control plans:
[0186] Level 1 Emergency Response Plan: Applicable to high-risk scenarios (such as a compliance probability of less than 50% or confirmed exceedance). Measures include: immediately sending an instruction to the water supply department to activate the backup water source; sending shutdown orders to the top three high-contribution polluting enterprises identified through source tracing; and simultaneously initiating the on-site investigation process of the environmental enforcement team.
[0187] Level 2 Early Warning Plan: Applicable to high-risk warning scenarios (such as when the probability of compliance is between 50% and the warning threshold). Measures include: increasing the water quality monitoring frequency at the intake and upstream sections from once per hour to once every 15 minutes; sending discharge restriction recommendations to relevant enterprises; and scheduling upstream reservoirs to increase the discharge flow to dilute pollutants.
[0188] The Level 3 Prevention Plan is applicable to situations where risks are initially identified but have not yet reached the warning threshold. Measures include: sending risk alert requests to local water and environmental departments; automatically planning drone routes for aerial surveillance of suspected areas; and issuing drinking water safety reminders through government platforms.
[0189] Step 702: Using a pre-trained reinforcement learning policy network, evaluate the comprehensive benefit function of each scheme in the candidate control scheme set. The comprehensive benefit function includes a water quality improvement benefit term, a social operating cost penalty term, and a response execution time penalty term. Select the scheme with the largest comprehensive benefit function value as the target control instruction.
[0190] In this embodiment, to find a balance among multiple objectives, a reinforcement learning (RL) decision model is introduced. Before calculating the comprehensive reward function, the water quality improvement magnitude, socioeconomic cost, and response time are normalized and mapped to a dimensionless unified scale. Based on the normalized indicators, the comprehensive reward function is defined, and its R expression is as follows:
[0191] R=α·δQ water -β·C social -γ·T response ;
[0192] Where, δQ water The expected improvement in water quality (e.g., the reduction in CODMn concentration); C social The socio-economic costs of implementing the plan (e.g., output loss due to business shutdowns, operating costs of switching to backup water sources); T response α represents the time required to execute the plan; α, β, and γ are the weighting coefficients for each objective.
[0193] The RL agent predicts the overall benefit of executing each candidate solution based on the current environmental conditions, including water quality, weather conditions, and resource availability. For example, in a scenario of water scarcity and no backup water source, the social cost C of switching water sources is calculated. social At higher water quality levels, the agent might tend to choose a combination of increasing upstream water supply and restricting industrial emissions, even though the water quality improvement is slightly slower, because it yields the greatest overall benefit. Through extensive training in historical simulation environments, the RL policy network can automatically weigh the pros and cons and output optimal decision recommendations.
[0194] According to another aspect of this application, a data-driven and physical constraint-based drinking water source safety compliance prediction and control system, based on the method described in any of the above embodiments, includes: a multi-source sensing and feature construction module; a physical constraint prediction module; a risk budget early warning module; an evidence chain tracing module; and an intelligent control decision module.
[0195] The multi-source sensing and feature construction module is used to collect water quality monitoring data, hydrological and meteorological data, pollution source activity data and social perception data in the catchment area of the water source. After spatiotemporal alignment processing, it generates the water source state feature tensor.
[0196] The physical constraint prediction module is used to input the water source state feature tensor into a pre-trained and stored multi-task security prediction model on the server, output the compliance probability distribution for a future preset period, and generate the source contribution vector of each upstream node based on the physical transmission constraints.
[0197] The risk budget early warning module is used to assess the risk of the compliance probability distribution, calculate the risk budget index, and generate a source tracing trigger signal when the risk budget index meets the preset trigger conditions.
[0198] The evidence chain tracing module is used to respond to the tracing trigger signal, construct a candidate source set based on the source contribution vector, and perform posterior verification of the candidate source set in combination with the tracing evidence chain to determine the pollution source location result.
[0199] The intelligent control and management decision-making module is used to generate a graded control plan based on the pollution source location results, select target control instructions based on preset assessment rules, and issue them for execution.
[0200] This embodiment constructs a cloud-edge collaborative system architecture. The multi-source perception and feature construction module is deployed at the junction of edge computing nodes and cloud servers. The edge side is responsible for filtering sensor signals, anomaly removal, and time synchronization; the cloud side is responsible for remote sensing image interpretation, natural language processing, and high-dimensional tensor construction. The physical constraint prediction module, risk budget early warning module, and evidence chain tracing module are deployed on a high-performance cloud computing cluster, utilizing GPUs to accelerate deep learning inference and Bayesian graph computation. The intelligent control and decision-making module interfaces with the business management platform, supporting manual one-click confirmation or fully automated command issuance.
[0201] Specifically, the physical constraint prediction module incorporates either an HTTCA submodule or a migration operator inversion submodule, supporting dynamic switching based on computing resources. The evidence chain tracing module maintains a dynamic evidence database. The intelligent control and decision-making module connects to on-site execution units (such as IoT gate controllers and drone base stations), enabling seamless command flow from the cloud-based brain to the physical execution units. Through the collaborative work of these modules, the system achieves a fully intelligent closed loop from perception to prediction, early warning, tracing, and control.
[0202] This scheme employs a source contribution inversion method based on physical transport constraints. Specifically, by constructing a differentiable river network migration operator Scheme2 or a hydraulic transport time mask Scheme1, the time delay and attenuation laws in hydrodynamics are embedded into the prediction process of the neural network. This allows the model to no longer rely solely on data correlation, but to allocate weights under the premise of satisfying physical reachability, thereby eliminating spurious correlation attribution and achieving physical consistency of the prediction results.
[0203] Simultaneously, a Bayesian evidence chain posterior update mechanism was constructed to address the issues of broken evidence chains and lack of credibility modeling in source tracing. By assigning learnable credibility parameters to multi-source evidence and utilizing actual law enforcement feedback for closed-loop self-calibration, the system can automatically identify and suppress low-quality evidence (such as false public opinion), enhance the weight of high-quality evidence, simulate the reasoning process of ordinary technical personnel in the field to distinguish truth from falsehood, and achieve interpretable, verifiable, and adaptive iterative capabilities for source tracing results.
[0204] In addition, to improve the problem of rigid early warning decision-making, this solution introduces a Bayesian asymmetric cost threshold and risk budget mechanism, combined with coverage guarantee lower bound probability, to realize dynamic risk calculation and adaptive early warning for specific application scenarios.
[0205] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0206] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for predicting and controlling the safety compliance of drinking water sources based on data-driven and physical constraints, characterized in that, include: Water quality monitoring data, hydrological and meteorological data, pollution source activity data, and social perception data are collected from the catchment area of the water source. After spatiotemporal alignment processing, a water source state feature tensor is generated. The tensor of the water source status features is input into a multi-task security prediction model that is pre-trained and stored on a server. The model outputs the probability distribution of compliance for a future preset time period and generates the source contribution vector of each upstream node based on physical transmission constraints. A risk assessment is conducted on the probability distribution of compliance, a risk budget indicator is calculated, and a source tracing trigger signal is generated when the risk budget indicator meets the preset trigger conditions. In response to the source tracing trigger signal, a candidate source set is constructed based on the source contribution vector, and the candidate source set is verified posteriorly by combining the source tracing evidence chain to determine the pollution source location result; A tiered control plan is generated based on the pollution source location results, and target control instructions are selected and issued for execution based on preset assessment rules. The source contribution vector of each upstream node is generated based on physical transmission constraints, specifically including: Based on the river network topology and hydrodynamic parameters of the water source catchment area, a differentiable river network migration operator is constructed to describe the spatiotemporal evolution of pollutants from each upstream node to the water intake. Using the encoder layer of the multi-task safety prediction model, the source water condition feature tensor is mapped to the source load latent variable of each upstream node. The source load latent variable represents the initial pollution discharge intensity before transmission through the river network. The source load latent variable is spatiotemporally convolved with the differentiable river network migration operator to reconstruct the downstream response reconstruction value of the water intake, and the proportion of each node component in the spatiotemporal convolution operation to the downstream response reconstruction value is extracted as the source contribution vector. The multi-task security prediction model is obtained through pre-training by minimizing a comprehensive loss function, which includes: The prediction error loss term used to measure the accuracy of water quality predictions; By combining the chain of evidence for tracing the source, a posterior verification of the candidate source set is performed to determine the pollution source location result, specifically including: The multi-source sensing data in the water source state feature tensor is converted into a structured evidence object in a unified format, and a preset learnable evidence credibility parameter is assigned to each structured evidence object. Using the source contribution vector as the prior probability, a Bayesian probabilistic graphical model is constructed based on the structured evidence object and the corresponding evidence credibility parameter. The risk probability of each node in the candidate source set is updated posteriorly using a Bayesian probabilistic graphical model to obtain the corrected posterior probability distribution, and the posterior probability distribution is determined as the pollution source location result. The formula for calculating the posterior update satisfies: π i ∝w i ·P e∈Eset (P(e|i))^r e 4 Where, π i Let w be the posterior probability of node i. i Let E be the value of the i-th element in the source contribution vector. set Let be the set of evidence at the current moment, e be a single structured evidence object, P(e|i) be the likelihood probability of evidence e obtained based on a pre-built likelihood probability table when assuming the pollution source is node i, ^ be a superscript symbol, and r be the likelihood probability of the evidence. e ∈[0,1] represents the credibility parameter of the evidence; The KL divergence regularization term L used to measure consistency in traceability. consist ; L consist =KL(π||w)=Σ i p i ·log(π i / w i ); Where π is the posterior probability distribution updated based on the evidence chain, and w is the prior source contribution vector inverted based on the physical operator. The KL divergence regularization term is obtained by calculating the relative entropy between the source contribution vector and the posterior probability distribution, so as to constrain the source contribution vector generated by the multi-task security prediction model during training to approximate the posterior probability distribution updated based on the evidence chain.
2. The method according to claim 1, characterized in that, The source contribution vector of each upstream node is generated based on physical transmission constraints, specifically including: Based on the hydrological velocity data and river network topology in the water source state characteristic tensor, the hydraulic transmission time from each upstream node to the water source intake is calculated. Based on the difference between the hydraulic transmission time and the current predicted time window, a hydraulic reachability soft mask is constructed using a differentiable activation function to characterize the physical reachability of each upstream node. In the process of feature encoding of the water source state feature tensor in the multi-task security prediction model, the original attention weights calculated by the attention mechanism layer are extracted, and the original attention weights are fused with the hydraulic accessibility soft mask element by element. After normalization, the source contribution vector that satisfies the physical causal constraints is obtained.
3. The method according to claim 2, characterized in that, The hydraulic reachability soft mask is constructed using the Sigmoid function, and the formula for calculating the source contribution vector satisfies: M soft (j,Δt)=σ((Δt-T travel (j)) / t temp ); w j =a j ·M soft (j,Δt) / Σ k=1 N a k ·M soft (k,Δt); Among them, M soft (j, Δt) is the hydraulic reachability soft mask for the j-th upstream node within the prediction time window Δt, where T travel (j) represents the hydraulic transmission time, τ temp Here are the preset temperature parameters, σ(·) is the Sigmoid function, and α j and α k For the original attention weights, w j Let represent the value of the j-th element in the normalized source contribution vector, and N be the total number of upstream nodes.
4. The method according to claim 1, characterized in that, A risk assessment is conducted on the probability distribution of compliance, and risk budget indicators are calculated, including: Construct a decision loss matrix, which includes the underreporting cost corresponding to the actual exceedance but no warning, and the false alarm cost corresponding to the actual meetability but warning issued, with the underreporting cost being greater than the false alarm cost. Based on Bayesian decision theory, with the goal of minimizing the expected decision loss, the optimal Bayesian warning threshold is calculated. The expected value of the probability distribution of compliance is compared with the optimal Bayesian warning threshold to generate a risk budget indicator.
5. The method according to claim 4, characterized in that, The formula for calculating the optimal Bayesian warning threshold is: τ * =C miss / (C miss +C false ); Where, τ * For the optimal Bayesian warning threshold, C miss To underreport costs, C false Cost of false alarms; The costs of underreporting and false reporting are cost parameters that are pre-configured and stored according to the protection level of the water source.
6. The method according to claim 1, characterized in that, The formula for constructing the migration operator of a differentiable river network is: T i→s (δ)=exp(-κ i→s ·δ)·I(δ=round(Dist i→s / v' i→s )); Among them, T i→s (δ) represents the transmission intensity from upstream node i to water intake s during the lag time δ, κ i→s Dist is the equivalent attenuation coefficient pre-calculated based on the river water degradation coefficient and dilution coefficient. i→s v' represents the shortest path distance along the river network. i→s Let I(·) be the path average velocity, and let I(·) be the indicator function. When the time lag δ equals the theoretical lag time, round(Dist) i→s / v' i→s The value is 1 when the condition is met, and 0 otherwise. The formula for calculating the downstream response reconstruction value is: z s (t+h)=Σ i∈V S δ=0 D T i→s (d)·L i (t+h-δ); Among them, z s (t+h) represents the reconstructed value of the downstream response at the predicted time, L i Let V be the source load latent variable, V be the set of upstream nodes, and D be the maximum time lag window.
7. A data-driven and physical-constrained predictive and control system for drinking water source safety compliance, based on the method described in any one of claims 1-6, characterized in that, include: The multi-source sensing and feature construction module is used to collect water quality monitoring data, hydrological and meteorological data, pollution source activity data and social perception data in the water source catchment area, and generate water source state feature tensors after spatiotemporal alignment processing. The physical constraint prediction module is used to input the water source state feature tensor into a pre-trained and stored multi-task safety prediction model on the server, output the compliance probability distribution for a future preset period, and generate the source contribution vector of each upstream node based on the physical transmission constraints. The risk budget early warning module is used to conduct risk assessment on the probability distribution of compliance, calculate risk budget indicators, and generate a source tracing trigger signal when the risk budget indicators meet the preset trigger conditions. The evidence chain tracing module is used to construct a candidate source set based on the source contribution vector in response to the source tracing trigger signal, and to perform posterior verification of the candidate source set in combination with the source tracing evidence chain to determine the pollution source location result; The intelligent control and management decision-making module is used to generate a graded control plan based on the pollution source location results, select target control instructions based on preset assessment rules, and issue them for execution.
Citation Information
Patent Citations
Risk monitoring and early warning method based on data intelligent decision
CN121303801A
Analysis method and system of industrial park water pollution multi-modal large model
CN122174159A
Pollution tracing method and system for sewage draining exit entering river
CN122220757A
