Water quality pollution tracing method and device, electronic equipment and readable storage medium

By combining a dynamic weight model and a Bayesian inference model with a GIS spatiotemporal clustering algorithm, rapid source tracing of water pollution sources was achieved, solving the problems of poor timeliness and low source tracing efficiency in existing technologies, and realizing accurate and efficient location of pollution sources.

CN121525856AInactive Publication Date: 2026-02-13LINYI HUANXIANG WATER METER CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511651805.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-02-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing water quality monitoring technologies are slow and inefficient in tracing pollution sources, making it difficult to meet the needs for rapid response and accurate location of pollution sources.

Method used

A dynamic weighting model is adopted and optimized in real time through machine learning. It combines the pipeline topology and pollutant attenuation coefficient to dynamically calculate the pollution contribution of nodes. A Bayesian inference model is used to integrate the prior probability of historical pollution events and the likelihood probability of current abnormal data. Combined with the spatiotemporal clustering algorithm of GIS, pollution hotspot clusters are identified. Visual heat maps are generated by inverse distance weighted interpolation to help managers locate pollution sources.

Benefits of technology

It improves the accuracy and efficiency of pollution source location, shortens emergency response time, and meets the real-time decision-making needs of the smart water management platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121525856A_ABST
    Figure CN121525856A_ABST
Patent Text Reader

Abstract

The invention discloses a water quality pollution tracing method and device, electronic equipment and a readable storage medium, and belongs to the technical field of environment monitoring. The invention provides a water quality pollution tracing method and device and related equipment. The method comprises the following steps: marking nodes of which monitoring indexes do not conform to a safety range as pollution nodes; calculating a dynamic weight value of the pollution node, wherein the dynamic weight value comprises a historical over-standard frequency and a pollution concentration deviation degree; pollution contribution degrees of all upstream pollution nodes corresponding to the pollution nodes are calculated, a thermodynamic diagram is generated, and nodes with pollution contribution degrees or pollution concentration estimation values exceeding a preset threshold value are screened to serve as candidate pollution sources; calculating the confidence coefficient of the candidate pollution source through a Bayesian inference model so as to position a final pollution source position; through dynamic weight optimization of propagation precision, thermodynamic diagram visualization locking of a high-contribution area, and Bayesian fusion of historical and real-time data, credibility is improved, and rapid positioning of a pollution source is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of water quality monitoring, in particular to a water pollution source tracing method and device, an electronic device and a readable storage medium. BACKGROUND

[0002] With the acceleration of urbanization, water pollution prevention and control has become an important problem to be solved. In the process of water pollution control, the identification and tracing of pollution sources is a key link, which is of great significance for pollution event investigation, river management and urban ecological environment improvement.

[0003] Currently, water quality detection methods mainly rely on manual sampling and laboratory analysis, and water samples need to be sent to the laboratory for physicochemical or microbial detection, which is time-consuming and difficult to reflect water quality changes in a timely manner.

[0004] In recent years, intelligent monitoring technology has been gradually applied to the field of water quality monitoring, using sensors and automated equipment to realize real-time collection of water quality parameters, improving monitoring efficiency. However, the existing technology still has problems such as poor timeliness and low tracing efficiency in pollution tracing, which is difficult to meet the demand for rapid response and accurate positioning of pollution sources.

[0005] To solve the above problems, the present application provides a water pollution source tracing method and device, an electronic device and a readable storage medium. SUMMARY

[0006] The purpose of the present application is to provide a water pollution source tracing method and device, an electronic device and a readable storage medium to solve the technical problems of poor timeliness and low tracing efficiency in the prior art.

[0007] To solve the above technical problems, in a first aspect, the present application provides a water pollution source tracing method, which comprises obtaining current monitoring water quality data, marking nodes whose monitoring indicators do not meet the safety range as pollution nodes; based on the historical water quality information of the pollution nodes, calculating the dynamic weight value of the pollution nodes, the dynamic weight value including the historical exceeding frequency and the pollution concentration deviation degree; according to the dynamic weight value, using a time series propagation algorithm to calculate the pollution contribution degree of all upstream pollution nodes corresponding to the pollution nodes, wherein the dynamic weight value is used to adjust the influence coefficient of the upstream nodes in the time series propagation; according to the pollution contribution degree of each upstream pollution node, the pollution concentration estimation value of the interpolation point is calculated by inverse distance weighted interpolation method, and a heat map is generated to screen nodes whose pollution contribution degree or pollution concentration estimation value exceeds a preset threshold as candidate pollution sources; based on the pollution nodes and the candidate pollution sources, the confidence of the candidate pollution sources is calculated by a Bayesian inference model to locate the final pollution source position.

[0008] In conjunction with the first aspect, in some implementations of the first aspect, the dynamic weight value of the pollution node is calculated based on the historical water quality information of the pollution node, including: determining the measured value of pollutant concentration, the upper limit of the safety threshold corresponding to the pollutant, the upload latency, and the historical credibility score of the pollution node based on the historical water quality information of the pollution node; and calculating the dynamic weight value of the pollution node based on the measured value of pollutant concentration, the upper limit of the safety threshold corresponding to the pollutant, the upload latency, the historical credibility score, and the weight coefficient, wherein the upload latency is the time difference between the time of obtaining the pollution node information and the time of collecting the water quality information.

[0009] In conjunction with the first aspect, in some implementations of the first aspect, based on pollution nodes and candidate pollution sources, the confidence level of candidate pollution sources is calculated using a Bayesian inference model, including: obtaining a historical pollution event database and calculating the prior probability that a candidate pollution source is identified as a pollution source; obtaining historical water quality information of pollution nodes and calculating the likelihood probability that a pollution node is a pollution source; and using a Bayesian inference model, combining the prior probability and the likelihood probability, to calculate the confidence level of candidate pollution sources.

[0010] In conjunction with the first aspect, in certain implementations of the first aspect, based on the pollution contribution of each upstream pollution node, the pollution concentration estimate of the point to be interpolated is calculated by inverse distance weighting interpolation, and a heat map is generated to screen nodes whose pollution contribution or pollution concentration estimate exceeds a preset threshold as candidate pollution sources. This includes: generating a GIS water supply network map based on the pollution contribution and geographic coordinates of each upstream pollution node; using the inverse distance weighting method to interpolate the pollution contribution of discrete nodes in the GIS water supply network map to calculate the pollution concentration estimate of the point to be interpolated; mapping the pollution concentration estimate of the point to be interpolated into a color gradient and overlaying the color gradient onto the GIS water supply network map to generate a heat map; and selecting nodes whose pollution contribution or pollution concentration estimate exceeds a preset threshold as candidate pollution sources based on the heat map.

[0011] In conjunction with the first aspect, some implementations of the first aspect also include: gridding and labeling abnormal water quality information data according to time windows, identifying core points and hotspot clusters based on spatiotemporal clustering algorithms, expanding core points, merging spatiotemporally adjacent abnormal points to form pollution hotspot clusters, and the abnormal water quality information data being the data in the current monitored water quality data that does not meet safety standards; extracting the core points of each cluster, sorting them by time, and for each core point, tracing back layer by layer to the upstream node along the reverse path of the water flow direction of the water supply network, recording the pollution contribution of all upstream nodes corresponding to the pollution node, and marking high-risk candidate pollution sources in conjunction with the historical pollution event database.

[0012] In conjunction with the first aspect, some implementations of the first aspect, after acquiring the current monitored water quality data, also include: determining whether the current monitored water quality data is within a safe range; organizing abnormal water quality information whose monitoring indicators do not meet the safe range according to a preset format to generate formatted abnormal water quality data; using the SHA-256 hash algorithm to perform digest calculation on the formatted abnormal water quality data to generate a unique hash value; packaging the formatted abnormal water quality data and hash value into a block, and adding the newly generated block to the blockchain network through a distributed consensus algorithm; broadcasting the new block to all nodes in the blockchain network, and each node in the network verifies the hash value, timestamp, and hash value of the previous block of the block. After successful verification, the new block is synchronously stored in all nodes, forming a decentralized storage structure.

[0013] In conjunction with the first aspect, in some implementations of the first aspect, after calculating the confidence level of candidate pollution sources based on pollution nodes and candidate pollution sources using a Bayesian inference model, the method further includes: sorting the confidence levels of each candidate pollution source according to their confidence levels to obtain a confidence level ranking result for the candidate pollution sources; determining the final pollution source location based on the confidence level ranking result for the candidate pollution sources; and visually outputting the final pollution source location and real-time early warning information.

[0014] Secondly, embodiments of the present invention also provide an integrated device for an intelligent early warning system for water pollution. This device includes: a monitoring module for acquiring current monitored water quality data and marking nodes whose monitoring indicators do not meet safety limits as pollution nodes; a dynamic weight calculation unit for calculating the dynamic weight value of the pollution node based on its historical water quality information, the dynamic weight value including historical exceedance frequency and pollution concentration deviation; a GIS spatial analysis engine for calculating the pollution contribution of all upstream pollution nodes corresponding to the pollution node using a time-series propagation algorithm based on the dynamic weight value, wherein the dynamic weight value is used to adjust the influence coefficient of the upstream node in the time-series propagation; a GIS spatial interpolation tool for calculating the estimated pollution concentration of the interpolation point based on the pollution contribution of each upstream pollution node using an inverse distance weighted interpolation method, and generating a heat map to screen nodes whose pollution contribution or estimated pollution concentration exceeds a preset threshold as candidate pollution sources; and an inference unit for calculating the confidence level of the candidate pollution source based on the pollution node and the candidate pollution source using a Bayesian inference model to locate the final pollution source location.

[0015] Thirdly, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the water pollution source tracing method mentioned in the first aspect above.

[0016] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the water pollution source tracing method mentioned in the first aspect.

[0017] Compared with the prior art, the beneficial effects of the present invention are: A dynamic weighting model is adopted and optimized in real time through machine learning. Combining the pipeline topology and pollutant attenuation coefficient, the pollution contribution of nodes is dynamically calculated. Then, a Bayesian inference model is used to integrate the prior probability of historical pollution events and the likelihood probability of current abnormal data to improve the scientific nature of the confidence calculation of candidate pollution sources. A GIS-based spatiotemporal clustering algorithm is used to identify pollution hotspot clusters. Combined with the historical pollution event database, high-risk emission outlets are quickly associated. Finally, inverse distance weighted interpolation is used to generate a visual heat map to help managers intuitively locate high-incidence pollution areas and achieve accurate and efficient pollution source positioning. Attached Figure Description

[0018] Figure 1 The diagram shows the system architecture of a water pollution source tracing method provided in an embodiment of this application.

[0019] Figure 2 The diagram shown is a flowchart of a water pollution source tracing method provided in an embodiment of this application.

[0020] Figure 3 The diagram shown is a flowchart illustrating the calculation of dynamic weight values ​​according to an embodiment of this application.

[0021] Figure 4 The diagram shown is a schematic flowchart of heat map generation according to an embodiment of this application.

[0022] Figure 5 The diagram shown is a flowchart illustrating the Bayesian model calculation provided in an embodiment of this application.

[0023] Figure 6 The diagram shown is a schematic flowchart of a spatiotemporal clustering extension provided in an embodiment of this application.

[0024] Figure 7 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0026] This application proposes a method, apparatus, and related equipment for tracing water pollution sources, which are used to perform pollution source inference.

[0027] Exemplary System Figure 1 The diagram shows the system architecture of a water pollution source tracing method provided in an embodiment of this application. For example... Figure 1 As shown, the system architecture mentioned in this embodiment includes a monitoring module 100, a data communication module 200, a microprocessor module 300, and a cloud platform 400.

[0028] The system architecture can be implemented based on the cloud platform's 400 functional architecture to perform pollution source inference and feed the results back to the management department. Staff can then verify and determine the location of the pollution source based on the output results.

[0029] The monitoring module 100 is used to acquire current water quality data and monitor key parameters in the water in real time (such as pH value, turbidity, residual chlorine, and conductivity), as well as the sensor identification numbers (IDs) and location information within the monitoring module 100. It determines whether the water quality meets safety standards, marks nodes whose monitoring indicators do not fall within the safe range as pollution nodes, and generates timestamps for abnormal water quality information data that does not meet safety standards. The monitoring module 100 includes: 1. pH sensor; 2. Turbidity sensor; 3. Residual chlorine sensor; 4. Conductivity sensor: measures the dissolved salt concentration in the water (unit: μS / cm), used to identify heavy metals or other dissolved pollutants; 5. Global Positioning System (GPS): acquires current location information; 6. Flow sensor; 7. Pressure sensor (optional); 8. Temperature sensor (optional).

[0030] The data communication module 200 communicates with the external cloud platform using the Narrowband Internet of Things (NB-IoT) communication protocol, providing wide network coverage and making it suitable for urban water supply environments.

[0031] The microprocessor module 300 acquires data collected by the monitoring module and controls the data communication module to transmit data.

[0032] The cloud platform 400 functional architecture includes: an integrated geographic information system 401 (GIS), a database 402, a dynamic weight calculation unit 403, an inference unit 404, and a user interface 405.

[0033] The integrated geographic information system 401 includes a GIS spatial interpolation tool 4011 and a GIS spatial analysis engine 4012. The GIS spatial interpolation tool 4011 calculates the estimated pollution concentration of the point to be interpolated using an inverse distance weighted interpolation method based on the pollution contribution of each upstream pollution node, and generates a heat map to screen nodes whose pollution contribution or estimated pollution concentration exceeds a preset threshold as candidate pollution sources. The GIS spatial analysis engine 4012 calculates the pollution contribution of all upstream pollution nodes corresponding to a pollution node using a time-series propagation algorithm based on dynamic weight values. The dynamic weight values ​​are used to adjust the influence coefficient of upstream nodes in the time-series propagation.

[0034] Database 402: Stores data, including a historical pollution event database, which stores the coordinates of pollution emissions, pollution type, frequency of occurrence, and related information for various pollution events over the past 5 years.

[0035] Dynamic weight calculation unit 403: Based on the historical water quality information of the pollution node, calculate the dynamic weight value of the pollution node. The dynamic weight value includes the historical frequency of exceeding the standard and the degree of deviation of the pollution concentration.

[0036] Inference Unit 404: Based on the contaminated nodes and candidate contaminated sources, calculate and rank the confidence scores of the candidate contaminated sources using a Bayesian inference model.

[0037] User interface 405: Used to visualize and output the final candidate pollution source location and real-time early warning information to staff.

[0038] Exemplary methods Figure 2 The diagram shown is a flowchart illustrating a water pollution source tracing method according to an embodiment of this application. Figure 2 As shown, Figure 2 The illustrated embodiment provides a method for tracing the source of water pollution, including the following steps: Step S200: Obtain the current water quality monitoring data and mark the nodes whose monitoring indicators do not meet the safe range as pollution nodes.

[0039] Step S201: Based on the historical water quality information of the pollution nodes, calculate the dynamic weight value of the pollution nodes. The dynamic weight value includes the historical frequency of exceeding the standard and the degree of deviation of the pollution concentration.

[0040] In practical applications, the monitoring module directly contacts the flowing water through sensors to acquire current water quality data. This data includes key parameters such as pH, turbidity, residual chlorine concentration, conductivity, sensor location information, and sensor ID. The module then determines whether the current water quality data is within a safe range. The safe range is set based on relevant international and national standards, referencing the "Standards for Drinking Water Quality" (GB 5749-2006) to ensure the scientific rigor and authority of the testing process. The monitoring standards for various pollutants are shown in Table 1. If the data exceeds the safe range, the monitoring module records a timestamp of the water quality data. The microprocessor module performs signal denoising, outlier removal, and data integration. Subsequently, the control data communication module uploads the abnormal water quality information, location information, and sensor ID to the cloud platform, and obtains the timestamp t of the abnormal water quality data at the time of the pollution node information. detect The data is uploaded to the cloud platform. The GIS spatial analysis engine receives the information from the data communication module, marks nodes whose monitoring indicators do not meet the safety range as polluted nodes, and dynamically adjusts the weight coefficients α, β, and γ.

[0041] In some other embodiments, when uploading abnormal water quality data, the Advanced Encryption Standard (AES) encryption algorithm can also be used to encrypt the data to protect the data security during transmission.

[0042]

[0043] Step S202: Based on the dynamic weight values, calculate the pollution contribution of all upstream pollution nodes corresponding to the pollution node using the time-series propagation algorithm, where the dynamic weight values ​​are used to adjust the influence coefficient of upstream nodes in the time-series propagation.

[0044] Step S203: Based on the pollution contribution of each upstream pollution node, calculate the estimated pollution concentration of the point to be interpolated by inverse distance weighting interpolation and generate a heat map to screen nodes whose pollution contribution or estimated pollution concentration exceeds a preset threshold as candidate pollution sources.

[0045] Step S204: Based on the pollution nodes and candidate pollution sources, calculate the confidence level of the candidate pollution sources using a Bayesian inference model to locate the final pollution source location.

[0046] The water pollution source tracing method provided in this application uses a dynamic weighting model to optimize the node influence coefficient in real time by combining historical exceedance frequency and concentration deviation. It uses a time-series propagation algorithm to accurately simulate the attenuation and diffusion patterns of pollutants in the pipeline network, significantly improving the accuracy of pollution contribution calculation. Then, it transforms discrete node data into a continuous spatial heat map through inverse distance weighted interpolation, intuitively locating high contribution areas and effectively solving the location blind spot problem caused by the sparse monitoring points in traditional methods. Finally, it integrates the prior probability of historical events and the likelihood probability of real-time abnormal data based on Bayesian inference to achieve rapid response to sudden pollution events.

[0047] Figure 3 The diagram shown is a flowchart illustrating the dynamic weight value calculation process according to an embodiment of this application. Figure 3 As shown, Figure 3 The illustrated embodiment provides a method for calculating dynamic weight values. Based on historical water quality information of polluted nodes, the dynamic weight values ​​of polluted nodes are calculated, including the following steps: Step 301: Based on the historical water quality information of the pollution node, determine the measured value of pollutant concentration, the upper limit of the safety threshold corresponding to the pollutant, the upload latency, and the historical reliability score of the pollution node.

[0048] Specifically, the cloud platform constructs a linear regression model to obtain the final feature vector and label of the previous pollution event of the polluted node (i.e., when the node is marked as a polluted node), where the feature vector = [α, β, γ, S]. current ,T delay H reliability [Pollution Type], where α, β, and γ are weighting coefficients that measure the importance of each parameter. These weighting coefficients are derived from extensive data inference. Labels = [1 (correct prediction), 0 (incorrect prediction)]. A correct prediction indicates correct pollution source location; otherwise, the prediction fails. Substitute into the feature value calculation function: ; where x 1i =S current, x 2i =T delay x 3i =H reliability y i It is the tag value; S current The measured values ​​of pollutant concentrations at the current monitoring node (pH / turbidity / residual chlorine / conductivity, etc.); T delay The time t for uploading to the cloud platform upload Subtract the time t for the microprocessor module to detect the anomaly detect That is, upload latency T delay =t upload -t detect (Unit: seconds). Assess the historical reliability of this contaminated node. It can be a confidence score of the data anomaly rate (false positive rate) over the past 30 days, calculated using the following formula: , where N false N represents the number of times in the past 30 days that were marked as abnormal but were found to be false alarms upon manual review. total (This represents the total number of anomalies reported by the node in the past 30 days); then, stochastic gradient descent (SGD) is used to update the coefficients every 24 hours, calculated as follows: Similarly, β and γ are updated; where η is the learning rate, initially set to 0.01, and the cloud platform automatically updates the learning rate through learning. If the polluted node has no historical pollution records, the initial values ​​of α, β, and γ can be set manually.

[0049] Step 302, based on the measured pollutant concentration S at the pollution node current The upper limit of the safety threshold S corresponding to pollutants max Upload latency T delay Historical credibility score H reliability And weighting coefficients, to calculate the dynamic weight value of the polluted node.

[0050] The upload latency is the time difference between acquiring pollution node information and collecting water quality information.

[0051] Specifically, the cloud platform obtains the dynamically adjusted weight coefficients α, β, and γ, which satisfy α + β + γ = 1, and calculates the dynamic weight value W of the contaminated node. i The calculation formula is: S max These are the safety thresholds for pollutants (pH / turbidity / residual chlorine / conductivity).

[0052] The water pollution source tracing method provided in this application sets dynamic weight coefficients to ensure the reliability of dynamic weight data, improve the scientific nature of node weight calculation, and reflect the real-time nature of data upload latency. Historical reliability reduces false alarm interference and enhances the accuracy of source tracing.

[0053] Figure 4 The diagram shown is a schematic representation of the heatmap generation process provided in an embodiment of this application. Figure 4 As shown, based on the pollution contribution of each upstream pollution node, the pollution concentration estimate of the point to be interpolated is calculated by inverse distance weighted interpolation, and a heat map is generated to screen nodes whose pollution contribution or pollution concentration estimate exceeds a preset threshold as candidate pollution sources, including: Step S401: Generate a GIS water supply network map based on the pollution contribution and geographical coordinates of each upstream pollution node.

[0054] For example, the GIS spatial analysis engine within the cloud platform obtains the pollution contribution of each upstream pollution node (C). j ) and geographic coordinates (x j y j The interpolation area is divided into a 100m×100m grid, and a GIS water supply network map is generated.

[0055] Step S402: Using the inverse distance weighting method, the pollution contribution of discrete nodes in the GIS water supply network map is interpolated to calculate the estimated pollution concentration of the point to be interpolated.

[0056] Specifically, the cloud platform calculates the distance d from each grid point (x, y) in the GIS water supply network map to all known nodes. j And calculate the weight (W) of each known node with respect to the current grid point (x,y). j ): (p is a power parameter, taken as p=2), the cloud platform uses the inverse distance weighted method (IDW) to interpolate the pollution contribution of discrete nodes in the GIS water supply network map into a continuous spatial distribution surface, where the estimated pollution concentration of the point (x,y) to be interpolated is calculated: .

[0057] Step S403: Based on the heat map, nodes whose pollution contribution or pollution concentration estimate exceeds a preset threshold are selected as candidate pollution sources.

[0058] Specifically, the cloud platform maps the interpolation results to color gradients (e.g., red indicates high pollution, blue indicates low pollution) and overlays these color gradients onto the GIS water supply network map. High-contribution areas are marked in red as candidate pollution sources, forming a visual heat map that intuitively presents high-pollution areas (red high-contribution areas), assisting manual personnel in quickly locating investigation targets. For high-contribution areas, the estimated pollution concentrations of all interpolation points are sorted from highest to lowest. For example, the estimated pollution concentrations of the top 10% can be used as a threshold, which can be set by the staff. High-contribution areas in the heat map and historical pollution sources (such as chemical plants) within a 1km radius are screened; if a match is found, these are prioritized as candidate pollution sources.

[0059] The water pollution source tracing method provided in this application uses nodes whose pollution contribution or pollution concentration estimate exceeds a preset threshold as candidate pollution sources. The setting of dynamic thresholds further improves the flexibility of pollution source tracing.

[0060] Figure 5 The diagram shown is a schematic flowchart of Bayesian model calculation provided in an embodiment of this application. Figure 5As shown, in one embodiment, based on the obtained contaminated nodes and candidate contaminated sources, the cloud platform verifies and calculates the confidence level of determining the candidate contaminated source as the final contaminated source, further verifying and determining the location of the contaminated source. The specific steps are as follows: Step S501: Obtain the historical pollution event database and calculate the prior probability of a candidate pollution source being identified as a pollution source.

[0061] Specifically, this includes retrieving historical data from the cloud platform and counting the number of pollution events N within a 1km radius of node i over the past year. i And calculate the prior probability P(S) that node i is a pollution source. i ): Where m is the number of candidate pollution source nodes in the same high-contribution area; if there are historical pollution sources within 1km of node i, then P(S i Increase by 20%; the cloud platform calls the historical pollution event database to calculate the average value of each parameter (pH value, turbidity, residual chlorine, conductivity) in the historical pollution events of node i. The calculation formula is as follows: ,in is the parameter value of the kth pollution event at node i (param = pH value, turbidity, residual chlorine, conductivity).

[0062] Step S502: Obtain historical water quality information of the polluted node and calculate the likelihood probability that the polluted node is the source of pollution.

[0063] Specifically, the standard deviation of each parameter (pH value, turbidity, residual chlorine, conductivity) in the historical pollution events at node i is calculated using the following formula: The cloud platform calculates the likelihood probability of the currently observed anomalous data D occurring under the assumption that node i is the pollution source, using a formula. : .

[0064] Step S503: Using a Bayesian inference model, combining prior probability and likelihood probability, calculate the confidence level of candidate pollution sources.

[0065] Specifically, the cloud platform obtains the calculated likelihood probabilities and substitutes them into the Bayesian inference model to calculate the confidence level of each candidate pollution source. : .

[0066] The water pollution source tracing method provided in this application generates a priority investigation list based on confidence level (resources are tilted towards high confidence targets), and forms a "one map" command interface by overlaying real-time early warning information on a GIS map, which shortens the emergency response time by 70% and meets the real-time decision-making needs of the smart water affairs platform.

[0067] In one embodiment of this application, the water pollution source tracing method provided in this application, after calculating the confidence level of the candidate pollution sources based on pollution nodes and candidate pollution sources using a Bayesian inference model, further includes: sorting the confidence levels of each candidate pollution source according to their confidence levels to obtain a confidence level ranking result for the candidate pollution sources; determining the final pollution source location based on the confidence level ranking result for the candidate pollution sources; and visually outputting the final pollution source location and real-time early warning information.

[0068] Specifically, the cloud platform sorts each pollution source according to its confidence level and displays the results visually to relevant staff, shortening emergency response time and facilitating rapid investigation.

[0069] Figure 6 The diagram shown is a schematic representation of a spatiotemporal clustering extension provided in an embodiment of this application. Figure 6 As shown, Figure 6 The illustrated embodiment provides a method for extending spatiotemporal clustering, including the following steps: Step S601: The abnormal water quality information data is tagged in a grid according to the time window.

[0070] Specifically, the abnormal data is segmented into time slices based on time windows, with a window size of 1 hour, generating a time-series dataset. The cloud platform divides the GIS map into 100m×100m grids, segments the abnormal data into time slices based on time windows, with a window size of 1 hour, generating a time-series dataset, and counts the number of anomalies within each grid. A spatiotemporal label (time window ID, grid ID) is attached to each data point (node). The cloud platform sets the parameter: maximum branch distance r of the pipeline network. s =200m, time radius r t =2h; minimum number of points minP ts =3.

[0071] Step S602: Identify core points and hotspot clusters based on spatiotemporal clustering algorithm, expand core points, merge spatiotemporally adjacent abnormal points to form contaminated hotspot clusters.

[0072] Specifically, the cloud platform iterates through each data point, and for the data point being accessed, checks its r s Does minP exist in the neighborhood? ts There are points and the time difference is ≤r. t If the condition is met, it is marked as a core point. Expansion begins from the core point, merging spatiotemporally neighboring points (i.e., their r...). s Within the neighborhood and time difference ≤ r tAnomalies are identified and clustered into pollution hotspots. After traversal, the clustering results are output: Core point list: the earliest or densest anomalies in each cluster; Hotspot cluster boundary: spatiotemporal coverage (time window + geographic coordinates); The cloud platform takes the core points of each cluster, sorts them by time (prioritizing the earliest anomalies), and for each core point, traces the upstream discharge outlet (e.g., factory discharge outlet) layer by layer along the reverse path of the water flow direction of the water supply network, records the pollution contribution of all upstream nodes corresponding to the pollution node, and, combined with the historical pollution event database (e.g., factory location), marks high-risk candidate pollution sources to facilitate investigation and inspection by staff.

[0073] The water pollution source tracing method provided in this application is based on spatiotemporal clustering for pollution hotspot analysis, which efficiently identifies multi-point pollution events (spatiotemporal clustering solves complex pollution diffusion problems), improves the efficiency of multi-pollution source scene positioning, and provides faster calculation results when multiple pollution sources cause pollution to different nodes.

[0074] In practical applications, data storage and usage may encounter situations where data is tampered with or difficult to trace. To address this issue, this application proposes an embodiment to solve the above problems, the details of which are as follows: The water pollution tracing method provided in this application, after obtaining the current monitored water quality data, further includes: determining whether the current monitored water quality data is within a safe range; organizing the abnormal water quality information whose monitoring indicators do not meet the safe range according to a preset format to generate formatted abnormal water quality data; using the SHA-256 hash algorithm to perform digest calculation on the formatted abnormal water quality data to generate a unique hash value; packaging the formatted abnormal water quality data and hash value into a block, and adding the newly generated block to the blockchain network through a distributed consensus algorithm; broadcasting the new block to all nodes in the blockchain network, and each node in the network verifies the hash value, timestamp, and hash value of the previous block of the block. After verification, the new block is synchronously stored in all nodes, forming a decentralized storage structure.

[0075] This storage method utilizes the blockchain storage module in the water pollution tracing system to ensure data immutability (chain storage + timestamp) and enable traceability of abnormal events.

[0076] Specifically, the blockchain storage module includes: 1. a blockchain node client; 2. a data signature unit; 3. a distributed storage module; and 4. a smart contract module. The monitoring module directly contacts the flowing water through sensors to acquire current water quality data and determine whether the data is within a safe range. If the data exceeds the safe range, the monitoring module records a timestamp of the water quality data. The microprocessor module performs signal denoising, outlier removal, and data integration. Then, the control data communication module transmits the abnormal water quality information, location information, sensor ID, and the timestamp t of the abnormal water quality data obtained from the time of pollution node information. detect The data is uploaded to the cloud platform, and the blockchain storage module is simultaneously controlled to transmit the data to the blockchain network. Upon receiving the signal from the microprocessor, the blockchain node client organizes the data collected by the sensor according to a preset format, generating formatted abnormal water quality data. For example, the preset format is: {Sensor ID, Collection Timestamp, pH Value, Turbidity Value, Residual Chlorine Concentration, Conductivity, Sensor Location Coordinates, System Status}. Then, the SHA-256 hash algorithm is used to calculate a digest of the formatted data, generating a unique hash value. The formatted abnormal water quality data and the hash value are packaged into a block, with the following information appended: the hash value of the previous block (forming a chain structure to ensure the immutability of the block); the timestamp of the current block (recording the data generation time); the newly generated block is added to the blockchain network using a distributed consensus algorithm (PoW). The new block is broadcast to all nodes in the blockchain network. Each node in the network verifies the hash value, timestamp, and hash value of the previous block. After successful verification, the new block is synchronously stored on all nodes, forming a decentralized storage structure.

[0077] Based on the above, managers can use a blockchain explorer to query historical data of a specified sensor and quickly trace the occurrence time, sensor ID, and pollution location of a water quality anomaly through the blockchain's timestamps and chain structure.

[0078] In practical applications, sensor malfunctions may occur, leading to errors in reporting normal water quality information. For example, when the monitoring module determines whether the current water quality data is within a safe threshold, if it exceeds the safe range, it can broadcast its sensor ID, abnormal parameters, timestamp, and geographic coordinates via the blockchain module. Nodes within a 1km radius receiving this broadcast check whether their own sensor data is within the threshold range. If their own sensor data shows an anomaly for the same parameter, they reply with a confirmation message to the broadcasting node; if normal, they reply with a negative message. The blockchain module obtains the feedback messages from each node and calculates the confirmation ratio: Confirmation Ratio = Number of Confirmations / (Number of Confirmations + Number of Negations). If the confirmation ratio is ≥70%, it is determined to be a genuine pollution event.

[0079] Figure 7The diagram shown is a structural schematic of an electronic device provided in an exemplary embodiment of this application. Figure 7 As shown, the electronic device 700 includes one or more processors 701 and memory 702.

[0080] The processor 701 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 700 to perform desired functions.

[0081] The memory 702 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 701 may execute the program instructions to implement the water pollution tracing methods of the various embodiments of this application described above and / or other desired functions. Various content, such as historical water quality information of pollution nodes, may also be stored in the computer-readable storage medium.

[0082] In one example, the electronic device 700 may also include an input device 703 and an output device 704, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).

[0083] The input device 703 may include, for example, a keyboard, a mouse, etc.

[0084] The output device 704 can output various information to the outside, including candidate pollution sources. The output device 704 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0085] Of course, for the sake of simplicity, Figure 7 Only some of the components of the electronic device 700 relevant to this application are shown in this illustration; components such as buses, input / output interfaces, etc., are omitted. In addition, the electronic device 700 may include any other suitable components depending on the specific application.

[0086] In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the water pollution source tracing methods according to various embodiments of this application as described above.

[0087] Computer program products can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this application. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0088] Furthermore, embodiments of this application may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the water pollution source tracing methods according to various embodiments of this application described above.

[0089] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0090] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the application to the necessity of employing the aforementioned specific details for implementation.

[0091] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0092] It should also be noted that in the apparatus, equipment, and methods of this application, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions of this application.

[0093] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0094] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

[0095] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications or equivalent substitutions made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for tracing the source of water pollution, characterized in that, include: Obtain current water quality monitoring data and mark nodes whose monitoring indicators do not meet the safe range as pollution nodes; Based on the historical water quality information of the pollution nodes, the dynamic weight value of the pollution nodes is calculated, and the dynamic weight value includes the historical frequency of exceeding the standard and the degree of deviation of the pollution concentration. Based on the dynamic weight value, the pollution contribution of all upstream pollution nodes corresponding to the pollution node is calculated using the time-series propagation algorithm, wherein the dynamic weight value is used to adjust the influence coefficient of the upstream node in the time-series propagation. Based on the pollution contribution of each upstream pollution node, the pollution concentration estimate of the point to be interpolated is calculated by inverse distance weighting interpolation, and a heat map is generated to screen nodes whose pollution contribution or pollution concentration estimate exceeds a preset threshold as candidate pollution sources. Based on the pollution nodes and the candidate pollution sources, the confidence level of the candidate pollution sources is calculated using a Bayesian inference model to locate the final pollution source.

2. The water pollution source tracing method according to claim 1, characterized in that, The calculation of the dynamic weight value of the pollution node based on its historical water quality information includes: Based on the historical water quality information of the pollution node, the measured value of pollutant concentration, the upper limit of the safety threshold corresponding to the pollutant, the upload latency, and the historical reliability score of the pollution node are determined. Based on the measured pollutant concentration of the pollutant node, the upper limit of the safety threshold corresponding to the pollutant, the upload latency, the historical reliability score, and the weight coefficient, the dynamic weight value of the pollutant node is calculated, wherein the upload latency is the time difference between the time of obtaining the pollutant node information and the time of collecting the water quality information.

3. The water pollution source tracing method according to claim 1, characterized in that, The step of calculating the confidence level of the candidate pollution source based on the pollution node and the candidate pollution source using a Bayesian inference model includes: Obtain a historical pollution event database and calculate the prior probability that the candidate pollution source is identified as a pollution source; Obtain historical water quality information of the pollution node and calculate the likelihood probability that the pollution node is the pollution source; The confidence level of the candidate pollution source is calculated using a Bayesian inference model, combining the prior probability and the likelihood probability.

4. The water pollution source tracing method according to claim 1, characterized in that, The step of calculating the estimated pollution concentration of the point to be interpolated using an inverse distance weighted interpolation method based on the pollution contribution of each upstream pollution node, and generating a heat map to screen nodes whose pollution contribution or estimated pollution concentration exceeds a preset threshold as candidate pollution sources includes: A GIS water supply network map is generated based on the pollution contribution and geographical coordinates of each upstream pollution node. The pollution contribution of discrete nodes in the GIS water supply network map is interpolated using the inverse distance weighting method to calculate the estimated pollution concentration of the points to be interpolated. The estimated pollution concentration values ​​of the interpolation points are mapped to color gradients, and the color gradients are overlaid on the GIS water supply network map to generate a heat map. Based on the heat map, nodes whose pollution contribution or pollution concentration estimate exceeds a preset threshold are selected as candidate pollution sources.

5. The water pollution source tracing method according to any one of claims 1 to 4, characterized in that, Also includes: Abnormal water quality information data is tagged in a grid according to time windows, and core points and hot spot clusters are identified based on spatiotemporal clustering algorithms. Core points are expanded and spatiotemporally adjacent abnormal points are merged to form pollution hot spot clusters. The abnormal water quality information data refers to the data in the current monitored water quality data that does not meet safety standards. Extract the core points of each cluster, sort them by time, and for each core point, trace back to the upstream node layer by layer along the reverse path of the water flow direction of the water supply network. Record the pollution contribution of all upstream nodes corresponding to the pollution node, and mark high-risk candidate pollution sources in combination with the historical pollution event database.

6. The water pollution source tracing method according to any one of claims 1 to 4, characterized in that, After acquiring the current monitored water quality data, the method further includes: Determine whether the current monitored water quality data is within a safe range; The abnormal water quality information where the monitoring indicators do not meet the safe range is organized according to the preset format to generate formatted abnormal water quality data. The formatted abnormal water quality data is digested using the SHA-256 hash algorithm to generate a unique hash value. The formatted abnormal water quality data and the hash value are packaged into a block, and the newly generated block is added to the blockchain network through a distributed consensus algorithm; The new block is broadcast to all nodes in the blockchain network. Each node in the network verifies the hash value, timestamp, and hash value of the previous block of the new block. After the verification is successful, the new block is synchronously stored in all nodes, forming a decentralized storage structure.

7. The water pollution source tracing method according to any one of claims 1 to 4, characterized in that, After calculating the confidence level of the candidate pollution source using a Bayesian inference model based on the pollution node and the candidate pollution source, the method further includes: Based on the confidence levels of the candidate pollution sources, the confidence levels of each candidate pollution source are ranked to obtain the confidence ranking result of the candidate pollution sources. Based on the confidence ranking results of the candidate pollution sources, the location of the final pollution source is determined, and the location of the final pollution source and real-time early warning information are visualized and output.

8. A water pollution source tracing device, characterized in that, include: The monitoring module is used to acquire current water quality data and mark nodes whose monitoring indicators do not meet the safe range as pollution nodes. The dynamic weight calculation unit is used to calculate the dynamic weight value of the pollution node based on the historical water quality information of the pollution node. The dynamic weight value includes the historical frequency of exceeding the standard and the degree of deviation of the pollution concentration. The GIS spatial analysis engine is used to calculate the pollution contribution of all upstream pollution nodes corresponding to the pollution node using a time-series propagation algorithm based on the dynamic weight value, wherein the dynamic weight value is used to adjust the influence coefficient of the upstream node in the time-series propagation. A GIS spatial interpolation tool is used to calculate the estimated pollution concentration of the point to be interpolated by interpolation using the inverse distance weighting method based on the pollution contribution of each upstream pollution node, and to generate a heat map to screen nodes whose pollution contribution or estimated pollution concentration exceeds a preset threshold as candidate pollution sources. The inference unit is used to calculate the confidence level of the candidate pollution source based on the pollution node and the candidate pollution source using a Bayesian inference model, so as to locate the final pollution source location.

9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the water pollution source tracing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps in the water pollution tracing method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Bacterial pollution tracing method for drinking water pipe network

    CN122112552A