Automatic water quality detection method and equipment

Through distributed sensor networks and multi-task learning models, the problems of insufficient comprehensiveness and dynamism in water quality detection in existing technologies have been solved, accurate monitoring of water pollution conditions and prediction of dynamic change trends have been achieved, and the accuracy and efficiency of water quality monitoring have been improved.

CN120801647APending Publication Date: 2025-10-17SHENZHEN LANGSHI BIOLOGICAL INSTR CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510932559.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-07
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing water quality detection technologies are insufficient in terms of comprehensiveness and dynamism, making it difficult to accurately reflect the overall pollution status and dynamic change trends of water bodies, and unable to effectively integrate the correlation information between different spatial scales of water bodies.

Method used

A distributed sensor network is used for multi-scale acquisition. By extracting multi-level spatial correlation features and reconstructing features, a feature-enhanced data set is generated. A graph structured processing and multi-task learning model is constructed to output multi-parameter prediction results. Back propagation processing and multi-scale pollution impact assessment are performed to generate a comprehensive water quality monitoring report.

Benefits of technology

It has achieved comprehensive coverage of water bodies at different spatial scales, significantly improved the systematicness and prediction accuracy of data analysis, provided comprehensive decision-making support, and improved the accuracy and efficiency of water quality monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120801647A_ABST
    Figure CN120801647A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of detection, in particular to an automatic water quality detection method and device, and the method comprises the steps: carrying out the multi-scale collection processing of a sample water body based on a distributed sensor network, extracting the spatial correlation features of multiple levels in an original data set, carrying out the feature reconstruction of the original data set according to the spatial correlation features, generating a feature enhancement data set; performing graph structuring processing according to the feature enhancement data set, and outputting to obtain a water quality feature graph; inputting the water quality feature map into a multi-task learning model, optimizing the multi-task learning model based on a loss function, and outputting a multi-parameter prediction result; performing reverse propagation processing on the multi-parameter prediction result to generate a spatial distribution diagram of the water quality parameters; and performing multi-scale pollution influence assessment based on the spatial distribution map, and generating a comprehensive water quality monitoring report. The core problem that the overall pollution condition and the dynamic change trend of the water body are difficult to accurately reflect in the prior art is solved, and the precision and practicability of water quality monitoring are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of detection, in particular to an automatic water quality detection method and device. BACKGROUND

[0002] Water quality detection, as an important part of environmental monitoring, plays a key role in water resource management, pollution prevention and control, and ecological protection. In the prior art, water quality detection is mainly achieved by fixed-point sampling analysis or single sensor equipment, through collecting water samples and performing chemical, physical or biological detection in a laboratory to obtain water quality parameters such as pH value, dissolved oxygen, turbidity, etc. However, due to the sparseness of sampling point distribution and the singleness of detection equipment function, the prior art has significant deficiencies in comprehensiveness and dynamics, making it difficult to accurately reflect the overall pollution status and dynamic change trend of the water body.

[0003] Existing detection methods are usually based on single-point or small-range water sample analysis, which is difficult to cover the diversity characteristics of water bodies at different depths and regions. For example, surface water bodies may be affected by light and wind, while deep water bodies may have sediments or anaerobic environments, and a single sampling method cannot capture these differences. Moreover, the existing technology mainly uses simple statistical analysis in data processing, such as directly aggregating sensor data to generate the average value or local distribution map of water quality parameters, but these methods cannot effectively integrate the correlation information between different spatial scales of water bodies Therefore, there is an urgent need for a water quality detection technology that can realize multi-dimensional data collection, systematic feature analysis and dynamic pollution assessment to overcome the limitations of existing technologies in comprehensively capturing water pollution characteristics. SUMMARY

[0004] The main purpose of the present application is to provide an automatic water quality detection method and device, which aims to overcome the deficiencies of existing water quality detection technologies in comprehensiveness and dynamics, which leads to the technical problem of being difficult to accurately reflect the overall pollution status and dynamic change trend of the water body.

[0005] To solve the above-mentioned problems, the present application provides an automatic water quality detection method, which comprises: Based on a distributed sensor network, a multi-scale collection and processing of a sample water body is performed to obtain an original data set, wherein the multi-scale includes different spatial scales of the surface, middle and bottom layers of the water body; Extracting spatial correlation features of multiple levels in the original data set, reconstructing the original data set according to the spatial correlation features, and generating a feature-enhanced data set; According to the feature-enhanced data set, a graph structure processing is performed, and a water quality feature graph is output. A multi-task learning model is constructed, the water quality feature map is input into the multi-task learning model, the multi-task learning model is optimized based on a loss function, and a multi-parameter prediction result is output; The multi-parameter prediction result is processed by reverse propagation to generate a spatial distribution map of water quality parameters; Based on the spatial distribution map, a multi-scale pollution impact assessment is performed to generate a comprehensive water quality monitoring report.

[0006] Further, the distributed sensor network is used to collect and process the sample water body at multiple scales to obtain an original data set, wherein the multiple scales include different spatial scales of the surface layer, middle layer and bottom layer of the water body, and the steps include: Based on the horizontal sensor and the longitudinal sliding sensor deployed in the sample water body, dynamic frequency sampling is performed to obtain a sampling sequence; The multiple parameters in the sampling sequence are structured and arranged according to spatial coordinates and time sequences to generate a multi-dimensional parameter matrix; An abnormal data point in the multi-dimensional parameter matrix is identified and removed based on a statistical distribution-based anomaly detection algorithm, and missing values are filled in through a neighborhood interpolation algorithm to generate an optimized parameter set; The optimized parameter set is processed by dimension reduction and efficient encoding to output an original data set containing spatial coordinates, time stamps and multiple parameters.

[0007] Further, the step of extracting spatial correlation features at multiple levels in the original data set and reconstructing features of the original data set based on the spatial correlation features to generate a feature-enhanced data set includes: The spatial distance and attribute similarity between each sampling point of the surface layer, middle layer and bottom layer data in the original data set are calculated to construct a spatial correlation matrix reflecting the spatial dependence relationship between the layers of the water body; Feature extraction processing is performed according to the spatial correlation matrix to obtain a multi-level feature set; The contribution weight of each level feature in the multi-level feature set to the overall water quality expression is calculated, and the combination ratio of the features is dynamically adjusted to generate a fusion feature set; The fusion feature set is processed by feature reconstruction based on a generative adversarial network to obtain a feature-enhanced data set.

[0008] Further, the step of performing feature extraction processing according to the spatial correlation matrix to obtain a multi-level feature set includes: Different size convolution kernels are constructed to scan the spatial dependence relationship of the spatial correlation matrix layer by layer to obtain local patterns and global patterns of the surface layer, middle layer and bottom layer data at different spatial scales to generate a preliminary feature set; Correlation information between features at different levels in the preliminary feature set is calculated, and the correlation information across levels is embedded into the preliminary feature set to obtain a multi-level feature set.

[0009] Further, the step of performing graph structuring processing according to the feature enhancement dataset to output a water quality feature graph comprises: According to the multi-scale spatial features in the feature enhancement dataset, the spatial distribution of the water body sample is divided into a plurality of independent sensor nodes to obtain a sensor node set; According to the node features and spatial coordinates in the sensor node set, an edge relationship between nodes is constructed to generate an initial graph structure; The feature vector of each node in the initial graph structure is aggregated with the features of neighbor nodes to generate a node feature update set; The node features and edge relationships in the node feature update set are structurally integrated to obtain a water quality feature graph with spatial semantics.

[0010] Further, the step of constructing a multi-task learning model, inputting the water quality feature graph into the multi-task learning model, optimizing the multi-task learning model based on a loss function, and outputting a multi-parameter prediction result comprises: The node and edge relationships of the water quality feature graph are decomposed into high-dimensional feature vectors to obtain a task-specific feature set; According to the task-specific feature set, a multi-task learning framework is structurally constructed to obtain an initial multi-task learning model, wherein the initial multi-task learning model includes a shared backbone network and a plurality of task-specific branch networks; The initial multi-task learning model parameters are iteratively updated based on the gradient descent method, and the optimization step is dynamically adjusted according to the gradient changes of each task to obtain an optimized learning model; The water quality feature graph is input into the optimized learning model, and after extracting general features through the shared backbone network, the general features are distributed to each task-specific branch network to output a multi-parameter prediction result.

[0011] Further, the step of inputting the water quality feature graph into the optimized learning model, extracting general features through the shared backbone network, and distributing the general features to each task-specific branch network to output a multi-parameter prediction result comprises: The water quality feature graph is input into the first convolutional layer of the shared backbone network, and convolution, activation and pooling operations are performed layer by layer, and multi-layer features are fused through residual connection to output a general feature set; The general feature set is distributed to the input layers of a plurality of task-specific branch networks, and each task-specific branch network predicts a specific water quality parameter; Each of the task-specific branch networks performs feature extraction and conversion on the general feature set, and outputs a corresponding water quality parameter prediction value; The water quality parameter prediction values of each of the task-specific branch networks are integrated to obtain a multi-parameter prediction result set.

[0012] Further, the step of performing back propagation processing on the multi-parameter prediction result to generate a spatial distribution map of the water quality parameters comprises: The multi-parameter prediction result is combined with the graph structure of the water quality feature map, and a latent pollution source position is deduced using a back propagation algorithm to obtain a latent pollution source distribution; The water body flow field characteristics of the sample water body are obtained, and the pollution propagation path is simulated according to the latent pollution source distribution and the water body flow field characteristics to obtain a pollution propagation path map; The pollution propagation path map is subjected to spatial interpolation and optimization to obtain a high-resolution pollution distribution field; The high-resolution pollution distribution field is mapped to the nodes and edges of the water quality feature map to generate a spatial distribution map of the water quality parameters.

[0013] Further, the step of performing multi-scale pollution impact evaluation based on the spatial distribution map to generate a comprehensive water quality monitoring report comprises: A graph model is constructed with water body levels as nodes, and a pollution parameter is used as an edge weight to iteratively optimize the spatial distribution map, and a pollution correlation matrix is output; The pollution correlation matrix is subjected to multi-objective quantification processing based on a multi-objective optimization algorithm to obtain a pollution impact score table; According to the pollution impact score table, historical water quality data and pollution source distribution characteristics are combined to perform pollution trend prediction to generate pollution early warning information; The pollution early warning information, the pollution impact score table, the spatial distribution map of the water quality parameters and the multi-parameter prediction result are integrated and processed to generate a comprehensive water quality monitoring report containing detailed water quality conditions and pollution evaluation.

[0014] The application also discloses an automatic water quality detection device adopting the automatic water quality detection method according to any one of the preceding embodiments, which comprises: A box body is provided with a water body containing cavity, and opposite sides of the water body containing cavity are provided with guide rail supports; A distributed sensor network comprises transverse sensors and longitudinal sliding sensors, the transverse sensors are arranged on the upper side of the water body containing cavity, the longitudinal sliding sensors are in sliding connection with the transverse sensors through the guide rail supports and are used for collecting sample data of the surface layer of the water body, and the longitudinal sliding sensors slide along the guide rail supports to collect sample data of the middle layer and the bottom layer of the water body at different depths; A data processor, connected with the distributed sensor network, is configured to receive and process the sample data, execute the automatic water quality detection method according to any one of the preceding embodiments, and output a comprehensive water quality monitoring report.

[0015] Beneficial effects: The present application realizes multi-scale data acquisition of the surface layer, middle layer and bottom layer of the water body through the distributed sensor network, fully covers the spatial heterogeneity of the water body, and overcomes the problems of insufficient comprehensiveness and dynamics caused by sparse sampling points and single equipment function in the traditional technology. By extracting multi-level spatial correlation features of the original data and performing feature reconstruction to generate a feature enhanced data set, and further forming a water quality feature map through graph structuring processing, the systematization and depth of data analysis are significantly improved, and the complex correlation information between different spatial scales of the water body can be effectively captured. Based on the optimization and reverse propagation processing of the multi-task learning model, the multi-parameter prediction results and the water quality parameter spatial distribution map output by the present application improve the prediction accuracy, and the comprehensive water quality monitoring report generated through multi-scale pollution impact evaluation provides comprehensive decision support.

[0016] In summary, the present application solves the core problem that the existing technology cannot accurately reflect the overall pollution condition and dynamic change trend of the water body by integrating multi-dimensional data acquisition, systematic feature analysis and dynamic pollution evaluation, significantly improves the accuracy, efficiency and practicability of water quality monitoring, and provides an innovative and efficient solution for water resource management, pollution prevention and control and ecological protection. BRIEF DESCRIPTION OF DRAWINGS

[0017] Figure 1 is a step schematic block diagram of an automatic water quality detection method in an embodiment of the present application; Figure 2 is a structural schematic diagram of an automatic water quality detection device in an embodiment of the present application; Figure 3 is a structural schematic diagram of a distributed sensor network based on an automatic water quality detection device in an embodiment of the present application.

[0018] BRIEF DESCRIPTION OF DRAWINGS: 1, box; 2, water body containing cavity; 3, guide rail support; 4, distributed sensor network; 41, transverse sensor; 42, longitudinal sliding sensor; 5, data processor; 6, driving member.

[0019] The implementation, functional characteristics and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0020] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.

[0021] Those skilled in the art can understand that the singular forms "a", "an" and "the" used herein include plural forms unless specifically stated otherwise. It should be further understood that the use of the term "include" in the specification of the present application means that a feature, integer, step, operation, element, module and / or assembly exists, but does not exclude the existence or addition of one or more other features, integers, steps, operations, elements, modules, assemblies and / or groups thereof. It should be understood that when an element is said to be "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be an intermediate element. In addition, "connected" or "coupled" used herein can include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any module and all combinations of the associated listed items.

[0022] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as that generally understood by those skilled in the art to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have meanings consistent with those in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as such.

[0023] With reference to Figure 1 The embodiment of the present application provides an automatic water quality detection method, comprising the following steps: S1: based on a distributed sensor network, a sample water body is collected and processed in multiple scales to obtain an original data set, wherein the multiple scales include different spatial scales of the surface layer, the middle layer and the bottom layer of the water body; In step S1, the sample water body refers to the water body to be detected, and the sample water body is placed in the containing cavity, and a distributed sensor network is designed and deployed at the edge of the containing cavity. The distributed sensor network can collect data of the surface layer, middle layer and bottom layer of the water body, with heights of 0-0.5 meters, 0.5-2 meters and >2 meters respectively, to construct a three-dimensional monitoring grid covering the full depth of the water body. The sensor node integrates a multi-parameter detection module and can simultaneously measure multiple water quality parameters such as pH value, dissolved oxygen, turbidity, temperature and heavy metal ion concentration (such as lead and cadmium). In order to adapt to the dynamic environment of the water body, the sensor node is equipped with an adaptive sampling frequency function, which dynamically adjusts the sampling frequency according to the flow velocity. When collecting data, each sensor node records the sampling time and depth information, and packs these information together with the water quality parameters as a data packet, which is transmitted to the central server or cloud platform. Multi-scale collection and processing also involves dynamic sampling point adjustment and data preprocessing to ensure the representativeness and integrity of the original data set. Dynamic sampling point adjustment is based on the flow field characteristics of the water body, and the collected data is stored in a high-dimensional matrix form after preliminary preprocessing, which contains spatial dimensions (longitude, latitude, depth), time dimensions (timestamp) and parameter dimensions (pH, dissolved oxygen, etc.). For example, the matrix can be represented as M(x, y, z, t, p), where x, y, z represent depth, t represents time, and p represents water quality parameters. Preprocessing also includes data cleaning and outlier detection, such as removing abnormal data points caused by sensor failure or external interference through statistical methods (such as median absolute deviation), and filling missing data through interpolation algorithm, thereby generating a structured and clean original data set.

[0024] S2: Extracting spatial correlation features of multiple levels in the original data set, reconstructing features of the original data set according to the spatial correlation features, and generating a feature-enhanced data set; In step S2, the original data set is preprocessed to extract statistical features of multiple levels. These statistical features include mean, variance, spectral energy, etc., which can represent the overall characteristics of the water body at different depths (such as surface layer, middle layer and bottom layer). For example, suppose an original data set of a sample water body is collected, where the temperature mean of the surface layer data is 25°C, the variance is 2°C 2 , and the spectral energy reflects the periodic characteristics of temperature fluctuation over time; the dissolved oxygen mean of the middle layer data is 6 mg / L, and the variance is 0.5 mg / L 2, the spectral energy can show lower fluctuation frequencies. Spatial correlation features are extracted from these data to capture the spatial relationships between different levels of the water body, including indicators such as gradients and correlation coefficients. For example, gradients can be used to describe the trend of water body parameters between the surface layer and the middle layer, or between the middle layer and the bottom layer. Assuming that the dissolved oxygen concentration from the surface layer to the middle layer shows a significant downward trend, by calculating the gradient, the strength and direction of this change can be quantified. Correlation coefficients can be used to measure the correlation between parameters at different levels. For example, the light intensity at the surface layer can have a positive correlation with the dissolved oxygen concentration at the middle layer, because light affects the photosynthesis of algae in the water body, thereby indirectly affecting the distribution of dissolved oxygen. By calculating the correlation coefficient, the cross-scale coupling effect can be quantified. Feature reconstruction is performed on the original data set to generate a feature-enhanced data set, and a deep learning autoencoder can be used to reduce the dimensionality of high-dimensional data and features. In this embodiment, the encoder part of the autoencoder can compress the high-dimensional original data set (such as temperature, dissolved oxygen, pH value, and other multi-parameter data) into a low-dimensional feature vector set. When implementing feature reconstruction, the design of the autoencoder needs to consider the coupling effect between the levels of the water body. For example, the potential impact of surface layer light on middle layer dissolved oxygen can be modeled by introducing specific constraints in the network structure of the autoencoder. For example, a regularization term can be added to the encoder to emphasize the correlation between surface layer light data and middle layer dissolved oxygen data, thereby generating feature vectors that reflect cross-scale correlations. Specifically, assuming that the surface layer light intensity data is Is, the middle layer dissolved oxygen data is OmOm, and the loss function of the autoencoder can add a correlation constraint such as λ·(Is-Om) 2 to enhance the coupling expression between the two. After generating the feature-enhanced data set, these low-dimensional feature vector sets will contain stronger spatial correlation and cross-scale coupling information. For example, the feature-enhanced data set can contain a set of feature vectors, where certain dimensions specifically represent the correlation between surface layer light and middle layer dissolved oxygen, or the spatial gradient relationship between bottom layer turbidity and middle layer nutrients. These feature vectors reduce the dimensionality of the data and also enhance the expressiveness of the data.

[0025] S3: performing graph structuring processing according to the feature-enhanced data set, and outputting a water quality feature graph; In step S3, the water quality monitoring problem is transformed into a graph model to characterize the multi-scale spatial relationships of the water body. Specifically, each sensor node is defined as a node in the graph, and the node's features are composed of the low-dimensional feature vectors extracted in step S2. These feature vectors can be extracted from the original high-dimensional data using dimensionality reduction techniques such as principal component analysis (PCA) or autoencoders. This effectively preserves key information about water quality parameters while reducing noise interference. For example, in the aforementioned lake monitoring scenario, 100 sensor nodes correspond to 100 nodes in the graph. The feature vector of each node may be a 10-dimensional vector containing a comprehensive representation of parameters such as pH, dissolved oxygen, and temperature. Edges between nodes are weighted based on spatial distance and correlation with water quality parameters. Spatial distance can be calculated using the geographic coordinates of the sensor nodes, such as the Euclidean distance. The correlation of water quality parameters can be assessed using statistical methods (such as the Pearson correlation coefficient) or physical models (such as hydrodynamic models). After constructing the graph structure, a graph neural network (GNN) is used to perform convolution processing on the water quality feature graph to capture high-order relationships between nodes. GNN aggregates node features with those of its neighboring nodes through a multi-layer message passing mechanism, thereby generating a more global feature representation. Specifically, each layer of GNN updates node features through message passing. The update formula is: The feature representation of node v in the k+1 layer is: h v (k+1) = σ(W * AGG({h u (k) ,∀u∈N(v)})+B*h v (k) ), where N(v) represents the set of neighbor nodes of node v, AGG is an aggregation function (such as mean or weighted sum), W and B are learnable weight matrices, and σ is an activation function (such as ReLU). Through multiple layers of iteration, GNN is able to capture complex pollution diffusion paths, identify whether the neighboring nodes connected to the node are also affected by similar pollution, and thus infer the possible location and diffusion path of the pollution source. Furthermore, an attention mechanism can be introduced during the training process to dynamically adjust the edge weights and highlight the impact paths of key pollution sources. The attention mechanism enhances attention to important neighbor nodes by assigning an attention score to each edge. For example, the attention score can be calculated based on the similarity of features between nodes or the spatial distance, and the formula is: α uv =softmax(W a * [h u || h u ]), where h u and h u is the feature vector of nodes u and v, || represents vector concatenation, W ais a learnable weight matrix. Edges with higher attention scores are given higher weights in message passing, highlighting the key paths. Through continuous optimization, the GNN generates a feature map that accurately represents the spatial distribution of water quality. The output water quality feature map contains the characteristics of each node, and the high-order correlation between nodes is encoded through the graph structure.

[0026] S4: Construct a multi-task learning model, input the water quality feature map into the multi-task learning model, optimize the multi-task learning model based on a loss function, and output multi-parameter prediction results; In step S4, a multi-task learning model is constructed to simultaneously predict multiple water quality parameters (such as pH value, dissolved oxygen concentration, heavy metal concentration, etc.). The water quality feature map is used as input, containing multi-level spatial features extracted and reconstructed from the original data set. In model design, the multi-task learning model adopts an architecture combining a shared backbone network and task-specific branches to balance feature sharing and task differences. The shared backbone network is based on a deep learning framework, such as a residual network (ResNet), which alleviates the gradient vanishing problem of deep networks through residual connections, thereby extracting deep general features from the water quality feature map. These general features may include patterns of certain basic physical and chemical properties in the water body, such as the potential relationship between temperature and dissolved oxygen. The output of the backbone network is fed into multiple task-specific branches, each of which models a specific water quality parameter (such as pH value or heavy metal concentration). The branch network contains several fully connected layers or convolutional layers to further process the general features and generate prediction values for specific parameters. When training the multi-task learning model, the loss function can use a cross-task loss function, which is a weighted combination of each task (such as pH prediction, dissolved oxygen prediction) with its own loss term (such as mean squared error) and adjusts the importance of different tasks through a weight coefficient. Considering the coupling relationship between parameters, such as the influence of pH value on the solubility of heavy metals, a regularization term can be introduced into the loss function to explicitly model this relationship. For example, if the pH value of a sample water body is low, the solubility of heavy metals may be high, and the model can encourage the prediction results to conform to this physical law through the regularization term, thereby improving the scientificity of the prediction. To optimize the loss function, gradient descent-based algorithms such as the Adam optimizer can be used, which can adaptively adjust the learning rate to accelerate convergence and use Bayesian optimization for hyperparameter tuning, such as determining the number of layers, learning rate, or regularization coefficient of the backbone network. Bayesian optimization builds a probabilistic model of the hyperparameter space and gradually searches for the optimal configuration, which is more efficient than grid search. Finally, the multi-parameter prediction results are output, for example, the model predicts that the pH value of the sample water body at the surface is 7.2, the dissolved oxygen concentration is 8 mg / L, and the heavy metal cadmium concentration is 0.01 mg / L. These predicted values reflect the current state of the water body.

[0027] S5: performing inverse propagation processing on the multi-parameter prediction results to generate a spatial distribution map of the water quality parameters; In step S5, the input data includes two parts: one is the multi-parameter prediction results output by the multi-task learning model, such as the predicted values of key water quality parameters such as dissolved oxygen, pH value, and ammonia nitrogen concentration in the water body; the other is the water quality feature map generated in step S3. The goal of this embodiment is to combine these prediction results with the feature map through inverse propagation processing, to inversely deduce the spatial distribution law of the water quality parameters, and to present it in the form of a spatial distribution map. In terms of specific implementation, the inverse propagation processing is to use an algorithm to inversely deduce the spatial distribution characteristics of the water quality parameters. The inverse propagation algorithm is based on the water quality parameter gradient and the edge weight of the feature map, and traces back the spatial source of parameter changes through gradient calculation. Assuming that the prediction results in step S4 show that the ammonia nitrogen concentration in a certain area of the sample water body abnormally increases, and the water quality feature map records the spatial correlation (such as flow rate, diffusion path, etc.) of the area with the upper or lower layer of water. In the inverse propagation process, the gradient of the ammonia nitrogen concentration, i.e., the rate of change of the concentration in the spatial dimension, is calculated. These gradients can be modeled by partial differential equations (PDEs), combined with the flow field characteristics (such as flow rate, diffusion coefficient) of the water body to simulate the propagation path of the pollutants. For example, the diffusion of pollutants in the water body can be represented by an advection-diffusion equation: ∂C / ∂t = D▽ 2 C-v·▽C, where C is the pollutant concentration, D is the diffusion coefficient, and v is the flow rate vector. By solving this equation, the potential source location of the increased ammonia nitrogen concentration can be inversely deduced. In order to further improve the tracing accuracy, the inverse propagation algorithm also needs to consider the edge weights in the water quality feature map. These edge weights reflect the correlation strength of the distributed sensor network when collecting data at different spatial scales (surface, middle, bottom). For example, the sensors in the surface water body may detect a higher pollutant concentration, while the bottom sensors have more stable data, indicating that the pollution may mainly come from the surface input. The edge weights in the feature map can be calculated by a graph neural network (GNN), and the weight value of the edge can represent the spatial distance between the sensor nodes, the influence of the flow field, or the data correlation. In the inverse propagation process, the algorithm will adjust the gradient direction according to these weights, and preferentially trace the path with higher weights, thereby improving the accuracy of the tracing. When generating the spatial distribution map of the water quality parameters, the GAN can be used to generate a high-resolution spatial distribution map through adversarial training. Specifically, the GAN consists of a generator and a discriminator: the generator takes the multi-parameter prediction results and the water quality feature map as input to generate a preliminary spatial distribution map; the discriminator evaluates the authenticity of the generated map and compares it with the real sensor data. Through adversarial training, the two sides continuously optimize until the generated spatial distribution map is close to the real pollution concentration field in terms of both vision and data.

[0028] S6: Perform multi-scale pollution impact assessment based on the spatial distribution map, and generate a comprehensive water quality monitoring report.

[0029] In step S6, the pollution characteristics of the surface layer, middle layer, and bottom layer are analyzed respectively, and their interactions are analyzed. For example, the deposition of heavy metals in the bottom layer of the water body can indirectly affect the dissolved oxygen level of the middle layer of the water body through water flow diffusion or sediment resuspension. This cross-scale interaction can be quantified through data correlation analysis. A multi-objective optimization algorithm (such as NSGA-II or Pareto optimization) is used to quantitatively evaluate the impact of pollution, which can comprehensively consider the impact of water body ecology, health, and use functions (such as drinking water, agricultural irrigation, fishery, etc.) and generate an impact score matrix. The specific implementation is to extract key indicators (such as pollutant concentration, biological toxicity, ecological risk index, etc.) according to the spatial distribution map of water quality parameters, and then input these indicators into the multi-objective optimization model. The model will calculate the impact of pollution on different functions according to the preset weight or priority and output an impact score matrix. Each row of the matrix represents a water body function (ecology, health, use), each column represents a different spatial scale (surface layer, middle layer, bottom layer), and the matrix elements are specific score values (such as 0 to 100). Then, a propagation model based on graph theory or a partial differential equation model is used to simulate the diffusion, sedimentation, and transformation of pollutants in the water body, combining the spatial correlation characteristics of the water quality feature map and the prediction results of the multi-task learning model. Through the pollution propagation model, it can simulate how these pollutants diffuse from the surface layer to the middle layer and the bottom layer through the water flow, and predict their impact on the bottom layer in the future. The input of the model includes the spatial correlation characteristics (such as pollutant concentration gradient) in the water quality feature map and the predicted pollutant concentration trend of the multi-task learning model, and the output is a dynamic pollution propagation path map showing the migration trajectory and impact range of the pollutants. Based on the above analysis, the comprehensive water quality monitoring report integrates all the analysis results to generate a comprehensive water quality monitoring report, including the location of the pollution source, the pollutant concentration distribution map, the impact score matrix, and the prediction results of the pollution propagation model, and proposes targeted governance suggestions. For these problems, the report can suggest protecting the water source of the sample water body, reducing external pollution source input, or for the change of dissolved oxygen level in the middle layer of the water body, it can propose to increase aeration equipment, improve water circulation, etc. to improve the self-purification ability of the water body; for the problem of heavy metal deposition in the bottom layer, it can consider using techniques such as dredging and ecological restoration to control the pollution. The comprehensive water quality monitoring report aims to provide scientific decision-making basis to take effective measures to improve water quality and protect water environmental health.

[0030] In one embodiment, the steps of performing multi-scale acquisition and processing of sample water bodies based on a distributed sensor network to obtain an original data set, wherein the multi-scale includes different spatial scales of the surface layer, middle layer, and bottom layer of the water body, include: Dynamic frequency sampling is performed based on the lateral sensors and longitudinal sliding sensors deployed in the sample water body to obtain a sampling sequence; Arranging the multiple parameters in the sampling sequence in a structured manner according to spatial coordinates and time series to generate a multidimensional parameter matrix; An anomaly detection algorithm based on statistical distribution identifies and removes abnormal data points in the multidimensional parameter matrix, and fills missing values ​​through a neighborhood interpolation algorithm to generate an optimized parameter set; The optimized parameter set is subjected to dimensionality reduction and efficient encoding, and an original data set including spatial coordinates, timestamps and multiple parameters is output.

[0031] In the above embodiment, the lateral sensor is deployed at the surface layer of the water body to capture the parameter changes in the horizontal direction, and the longitudinal sliding sensor collects the parameter distribution in the vertical direction by sliding motion between different depths of the water body. The combination of such sensors can achieve multi-scale data acquisition, covering the spatial dimensions of the water body from the surface to the deep layer and from the local to the whole. The sensor adjusts the sampling frequency according to the dynamic characteristics of the water body. The processor built-in the sensor analyzes the sampling data at the previous time, and if the parameter fluctuation exceeds a certain threshold, it triggers the high-frequency sampling mode, otherwise it switches to the low-frequency mode, thereby generating a sampling sequence containing time series and spatial position information. The scattered sampling data is integrated into an ordered data structure. First, the data is preprocessed, such as unifying the timestamp format and calibrating the reference system of the spatial coordinates. Through data mapping algorithms, these parameters are organized into a multi-dimensional matrix, where each row of the matrix may correspond to a time point, and each column corresponds to a parameter. Depth or spatial position serves as an additional dimension. In actual operation, the sampling sequence is processed in blocks through parallel computing, and each data block is arranged according to the spatial and temporal resolution, and finally merged into a global multi-dimensional parameter matrix. After generating the multi-dimensional parameter matrix, the abnormal data points are identified and removed based on the statistical distribution anomaly detection algorithm. Abnormal data points may be caused by sensor failure, environmental interference or data transmission error. In order to detect these abnormal points, statistical distribution-based algorithms such as Z-score method or Gaussian mixture model-based anomaly detection can be used. Specifically, the statistical distribution characteristics (such as mean and standard deviation) of each parameter in the matrix are calculated. If the value of a certain data point deviates from the mean by more than a certain multiple of the standard deviation, it is marked as an abnormal point and removed. After removing the abnormal points, data missing may occur in the matrix, which needs to be filled by the neighborhood interpolation algorithm. The neighborhood interpolation algorithm uses the data points adjacent to the abnormal point in time and space to estimate the missing value through weighted average or polynomial fitting, and the generated optimized parameter set has higher data integrity and reliability than the original matrix. Finally, the optimized parameter set is processed by dimension reduction and efficient encoding. Dimension reduction can be achieved by principal component analysis (PCA) or t-SNE algorithms, which map high-dimensional parameter sets to low-dimensional space by extracting the main features of the data. After dimension reduction, the data is efficiently encoded, such as using entropy encoding or dictionary-based compression algorithm, to package the dimension-reduced data with spatial coordinates and timestamps into a compact format. The output raw data set retains the key spatio-temporal information and parameter characteristics.

[0032] In one embodiment, the step of extracting the spatial correlation features of multiple levels in the original data set, reconstructing the original data set according to the spatial correlation features, and generating a feature-enhanced data set includes: Calculate the spatial distance and attribute similarity between each sampling point of the surface layer, middle layer and bottom layer data in the original data set, and construct a spatial correlation matrix reflecting the spatial dependence relationship between the hierarchical water bodies; Perform feature extraction processing according to the spatial correlation matrix to obtain a multi-level feature set; Calculate the contribution weight of each level feature in the multi-level feature set to the overall water quality expression, dynamically adjust the combination proportion of the features, and generate a fusion feature set; Perform feature reconstruction processing on the fusion feature set based on a generative adversarial network to obtain a feature enhanced data set.

[0033] In the above embodiments, the spatial distance and attribute similarity between each sampling point in the surface, middle and bottom layers of the original data set can be calculated. The Euclidean distance formula can be used to calculate the straight-line distance between two points based on the three-dimensional coordinates (x, y, z) of the sampling points. This distance reflects the closeness of the sampling points in physical space. The attribute similarity can be calculated through cosine similarity or Pearson correlation coefficient. Specifically, the attribute vectors of two sampling points (such as multi-dimensional vectors containing temperature, salinity, etc.) are compared, and their similarity scores are calculated. The spatial distance and attribute similarity together constitute two dimensions of spatial correlation. In order to construct the spatial correlation matrix, an association value is generated for each pair of sampling points. This value can be obtained by weighted fusion of spatial distance and attribute similarity. For example, the product of the inverse of the spatial distance and the attribute similarity can be used as the association value. Each element of the matrix represents the spatial dependence strength between a pair of sampling points. This matrix captures the spatial relationships between different layers of the water body. The spatial correlation matrix can be regarded as an adjacency matrix of a graph structure, where the sampling points are nodes and the matrix elements are edge weights. The graph convolution network extracts features reflecting local and global spatial dependencies by aggregating node and neighborhood information. The spatial correlation matrix is input into the GCN model, and after multiple convolution operations, a feature vector set containing surface, middle and bottom layer features is generated. The data of each layer is extracted separately, and then the results are integrated into a multi-level feature set. This feature set can comprehensively reflect the variation of the water body at different spatial scales. The contribution weight of each layer feature in the multi-level feature set to the overall water quality expression is calculated, and the combination ratio of the features is dynamically adjusted to generate a fusion feature set. This process is to optimize the expression ability of the feature set, making it more suitable for subsequent water quality analysis tasks. The calculation of the contribution weight can be realized through a model based on the attention mechanism. For example, the system can input the multi-level feature set into an attention network to assign a weight to each layer's feature vector. The weight size reflects the importance of the layer's feature to the overall water quality expression. Specifically, the attention network analyzes the relevance of the feature vector to the key indicators of water quality (such as pollution level or turbidity), and determines the weight value by optimizing an objective function (such as minimizing the prediction error). After obtaining the weights, the combination ratio of the features is dynamically adjusted according to these weights, and a fusion feature set is generated through weighted fusion.The feature reconstruction processing is performed on the fusion feature set based on a generative adversarial network (GAN). The generative adversarial network is composed of a generator and a discriminator. The generator is responsible for generating new feature representations from the fusion feature set. The discriminator evaluates whether the generated features are consistent with the real data distribution. In actual operation, the fusion feature set is taken as the input of the generator. The generator performs nonlinear transformation on the features through a multilayer neural network to generate a new feature vector. The discriminator compares the distribution difference between the generated features and the original features to optimize the parameters of the generator. Finally, the feature enhancement data set retains the key information of the original data and has higher discrimination and generalization ability through the optimization of the generative adversarial network.

[0034] In one embodiment, the step of performing feature extraction processing according to the spatial correlation matrix to obtain a multi-level feature set comprises: Constructing different sizes of convolution kernels, performing layer-by-layer scanning on the spatial dependence relationship of the spatial correlation matrix, obtaining local patterns and global patterns of surface layer, middle layer and bottom layer data at different spatial scales, and generating a preliminary feature set; Calculating the correlation information between the features at each level in the preliminary feature set, embedding the cross-level correlation information into the preliminary feature set, and obtaining a multi-level feature set.

[0035] In the above embodiment, by constructing different sizes of convolution kernels, the spatial dependence of the spatial correlation matrix is scanned layer by layer, and the purpose is to extract local and global pattern features at different spatial scales, so as to generate a preliminary feature set. The size difference of the convolution kernel enables the system to capture different spatial correlation characteristics from local to global, for example, a smaller convolution kernel (such as 3x3) is more suitable for extracting the local dependence between sampling points, reflecting the attribute change law of the water body in a smaller spatial range, while a larger convolution kernel (such as 7x7 or larger) can capture more extensive spatial dependence, reflecting the global pattern between water body levels. The process of scanning layer by layer is realized through a multi-layer convolution network, each layer of convolution operation extracts features from the spatial correlation matrix and passes the extracted features to the next layer. After multi-layer processing, a preliminary feature set is generated, which contains the feature representation of the surface, middle and bottom layer data at different spatial scales. Compared with the original embodiment which directly uses graph convolution network (GCN) for feature extraction, the present embodiment introduces the strategy of different size convolution kernel, making the feature extraction process more flexible and better adapting to the complex changes of water body data at different levels and scales. After generating the preliminary feature set, the correlation information between the features of different levels can be calculated through statistical methods or deep learning models, for example, Pearson correlation coefficient or mutual information method can be used to quantify the correlation between the surface, middle and bottom layer features. These correlation information reflects the mutual dependence of different level features in describing water quality characteristics. For example, the temperature feature of the surface water body may have a strong correlation with the salinity feature of the middle water body, and this cross-level dependence is crucial for water quality analysis. In order to embed these correlation information into the preliminary feature set, an attention mechanism-based model or feature fusion network can be used. Specifically, the feature vectors of each level in the preliminary feature set can be input into a cross-level attention network, which assigns a dynamic weight to each level of feature by analyzing the correlation between the features. After embedding the correlation information, the preliminary feature set and the cross-level correlation information are integrated into a multi-level feature set through feature fusion operation. This feature set not only retains the independent information of each level of feature, but also integrates the interaction information between levels, thus more comprehensively reflecting the change law of water body at different spatial scales.

[0036] In one embodiment, the step of performing graph structuring processing according to the feature enhanced data set to output a water quality feature graph comprises: According to the multi-scale spatial features in the feature enhanced data set, the spatial distribution of the water body sample is divided into a plurality of independent sensor nodes to obtain a sensor node set; According to the node features and spatial coordinates in the sensor node set, the edge relationship between nodes is constructed to generate an initial graph structure; aggregating the feature vector of each node in the initial graph structure with the features of the neighbor nodes to generate a node feature update set; structurally integrating the node features and edge relationships in the node feature update set to obtain a water quality feature graph with spatial semantics.

[0037] In the above embodiments, according to the multi-scale spatial features in the feature-enhanced dataset, the spatial distribution of the water body samples is divided into multiple independent sensor nodes. Using the spatial coordinate information (such as latitude, longitude and depth) in the feature-enhanced dataset, the water body space is divided into several sub-regions by clustering algorithms (such as K-means clustering or DBSCAN algorithm based on density), and the center point of each sub-region is defined as a sensor node. These nodes form a set of sensor nodes, each node carries spatial coordinates and is associated with a corresponding feature vector. These feature vectors are extracted from the feature-enhanced dataset and contain multi-scale spatial features and attribute information in the region, which can simplify the complex water body spatial distribution into a discrete set composed of multiple nodes. Based on the coordinate information of each node, the spatial distance between nodes is calculated, and the similarity of node feature vectors (for example, by calculating the cosine similarity) is combined to evaluate the relevance of nodes in attributes. In order to construct edge relationships, an associated weight is generated for each pair of nodes. This weight can be obtained by weighted fusion of spatial distance and feature similarity. For example, node pairs with closer spatial distance and higher feature similarity will be assigned higher edge weights, and node pairs with farther distance or larger feature difference may not establish edge relationships or be assigned lower weights. In actual operation, a distance threshold or similarity threshold is set to retain only the edge relationships that meet the conditions to reduce computational complexity. In this way, an initial graph structure is generated, in which nodes represent sensor locations and edges represent spatial and feature associations between nodes. Graph neural network (GNN) technology, such as graph convolutional network (GCN) or graph attention network (GAT), is used to implement feature aggregation. In graph convolutional network, the feature vector of each node is weighted and aggregated with the feature vectors of its neighbor nodes, and the weight is determined by the edge weight in the initial graph structure. For example, for a certain node, collect the feature vectors of all its neighbor nodes, perform weighted summation and apply a nonlinear activation function (such as ReLU) to generate a new feature vector. The graph attention network further introduces an attention mechanism to dynamically calculate the contribution weight of each neighbor node to the current node, thereby more accurately capturing the influence of important neighbors. This aggregation process considers direct neighbors (first-order neighbors), and through multi-layer graph neural network iteration, higher-order neighbor information is indirectly integrated, and the generated node feature update set contains updated feature vectors for each node, which fuse spatial and attribute information of the local neighborhood.The feature vector in the node feature update set is combined with the edge relationship of the initial graph structure to form a complete graph representation. The graph representation not only contains the feature information of each node, but also retains the spatial correlation between nodes. In order to realize structured integration, the graph pooling technology (such as global average pooling or maximum pooling) can be used to reduce the dimension of the node feature to generate a global feature vector. At the same time, the edge relationship is retained as the topology of the graph. An additional semantic enhancement step is introduced, for example, by introducing water quality related label information (such as pollution level) to optimize the graph structure to enhance its expression ability in specific tasks. The final generated water quality feature graph is a graph structure data with spatial semantics, which can fully represent the spatial distribution characteristics, attribute information and interaction relationship between nodes of the water sample.

[0038] In one embodiment, the step of constructing a multi-task learning model, inputting the water quality feature graph into the multi-task learning model, optimizing the multi-task learning model based on a loss function, and outputting a multi-parameter prediction result comprises: decomposing the node and edge relationship of the water quality feature graph into a high-dimensional feature vector to obtain a task-specific feature set; structurally constructing and processing a multi-task learning framework according to the task-specific feature set to obtain an initial multi-task learning model, wherein the initial multi-task learning model comprises a shared backbone network and a plurality of task-specific branch networks; iteratively updating the parameters of the initial multi-task learning model based on the gradient descent method, dynamically adjusting and optimizing the step size according to the gradient change of each task, and obtaining an optimized learning model; inputting the water quality feature graph into the optimized learning model, distributing the general features extracted by the shared backbone network to each task-specific branch network after the general features are extracted by the shared backbone network, and outputting a multi-parameter prediction result.

[0039] In the above embodiment, the water quality feature map is processed by a feature decomposition algorithm to separate multi-dimensional features and obtain a task-shared feature set and a task-specific feature set. The specific calculation process is to input the water quality feature map into a backbone feature extractor based on a deep convolutional network, decompose the spatial correlation features of the water quality feature map layer by layer using multi-scale convolution kernels, extract shared features reflecting the general physical and chemical laws between water quality parameters (such as the correlation pattern between water turbidity and dissolved oxygen), and separate the unique features of each parameter through a task-specific branch (such as the local chemical gradient of pH value). According to the task-specific feature set, a network topology design algorithm is used to structurally construct the multi-task learning framework to obtain an initial multi-task learning model. The calculation process involves designing a shared backbone network and multiple task-specific branch networks. The shared backbone network uses a deep residual network structure to extract general patterns in the task-shared feature set through multiple layers of convolution and skip connections. The branch network designs an independent subnetwork for each water quality parameter (such as pH, dissolved oxygen, and heavy metal concentration) to extract personalized features using the task-specific feature set. In multi-task learning, the loss function of different tasks may have different magnitudes and convergence speeds, so special attention should be paid to the balance between tasks during optimization. In the implementation, a joint sorax weighted sum loss function can be used to weight and sum the losses of multiple tasks to form a joint loss function. Gradient descent is the core method of optimization, which updates the parameters along the gradient descent direction by calculating the gradient of the joint loss function with respect to the model parameters. To prevent the loss of a certain task from dominating the optimization process, the weights of the loss function can be dynamically adjusted, such as through the Uncertainty Weighting method, which automatically adjusts the weights based on the difficulty or data distribution of the task. After multiple iterations, the model parameters converge gradually to obtain an optimized learning model. The optimized multi-task learning model receives the water quality feature map as input, and the shared backbone network first processes the input feature map to extract general features, such as the underlying correlation patterns between water quality parameters or global pollution trends. These general features are then distributed to each task-specific branch network. The output multi-parameter prediction results can be continuous values (such as concentration values) or discrete values (such as pollution levels), depending on the task definition. To ensure the accuracy of the prediction results, cross-validation or an independent test set can be introduced during training to evaluate the model's performance on different tasks.

[0040] In one embodiment, the step of inputting the water quality feature map into the optimized learning model, extracting general features through the shared backbone network, and distributing them to each task-specific branch network to output multi-parameter prediction results includes: inputting the water quality feature map into the first convolutional layer of the shared backbone network, performing convolution, activation, and pooling operations layer by layer, fusing multi-layer features through residual connections, and outputting a general feature set; distributing the general feature set to input layers of a plurality of task-specific branch networks, each task-specific branch network predicting a specific water quality parameter; Each of the task-specific branch networks performs feature extraction and transformation on the general feature set, outputting a corresponding water quality parameter prediction value; integrating water quality parameter prediction values of each of the task-specific branch networks to obtain a multi-parameter prediction result set.

[0041] In the above embodiments, the water quality feature map is input to the first convolutional layer of the shared backbone network, and the input feature map is calculated by the convolution kernel through the sliding window to extract the spatial features of the local area. The first convolutional layer uses multiple convolution kernels to generate multi-channel feature maps to capture different types of features. The activation function (such as ReLU) is applied to the convolution result to introduce a nonlinear transformation and enhance the model's ability to express complex patterns. The pooling operation (such as max pooling or average pooling) is used to reduce the dimension of the feature map, reduce the amount of calculation, and retain important feature information. Convolution, activation, and pooling operations are performed layer by layer, indicating that the shared backbone network adopts a multi-layer convolutional neural network (CNN) structure, which extracts more and more abstract features layer by layer and fuses multi-layer features through residual connection. The residual connection directly adds the input of the previous layers to the output of the subsequent layers. This design can effectively alleviate the gradient vanishing problem in deep networks and promote the fusion of multi-scale features, thereby generating a more comprehensive general feature set. After generating the general feature set, it is distributed to the input layers of a plurality of task-specific branch networks, each of which is responsible for predicting a specific water quality parameter, such as pH value, dissolved oxygen, or chemical oxygen demand, etc. The distribution process can be understood as copying and inputting the general feature set into each branch network, and each branch network performs individualized feature processing according to its target task. In the task-specific branch network, the general feature set will undergo further feature extraction and transformation. Feature extraction includes additional convolution operations or fully connected layer operations to capture unique patterns related to specific water quality parameters. The conversion process maps the extracted features to prediction values, such as outputting continuous prediction values (such as specific values of pH) through a regression layer or discrete prediction results (such as water quality grades) through a classification layer. The output of each branch network is an independent water quality parameter prediction value, and the outputs of all branch networks are arranged into a structured vector or matrix containing the prediction values of all target water quality parameters. In practical applications, this result set also needs to be post-processed, such as calibrating the prediction values to ensure their physical meaning (such as ensuring that the pH value is within the range of 0-14), or comparing with the true value to evaluate the model performance. In addition, in order to improve the overall performance of the model, joint optimization of the shared backbone network and the task-specific branch network may be required during the training process, such as balancing the contributions of different tasks through a weighted loss function.

[0042] In one embodiment, the step of performing back propagation processing on the multi-parameter prediction result to generate a spatial distribution map of water quality parameters comprises: combining the multi-parameter prediction result with the graph structure of the water quality feature map, using a back propagation algorithm to deduce the location of the potential pollution source, and obtaining a potential pollution source distribution; obtaining water body flow field characteristics of the sample water body, simulating a pollutant propagation path according to the potential pollution source distribution and the water body flow field characteristics, and obtaining a pollutant propagation path map; performing spatial interpolation and optimization on the pollutant propagation path map to obtain a high-resolution pollution distribution field; mapping the high-resolution pollution distribution field to the nodes and edges of the water quality feature map to generate a spatial distribution map of water quality parameters.

[0043] In the above embodiments, by combining the multi-parameter prediction results with the graph structure of the water quality feature map, the backpropagation algorithm can utilize these predicted values and graph structure information to deduce the location of potential pollution sources, and reverse engineer the possible location of pollution sources from the known water quality parameter distribution. For example, assuming that the pH value in a certain area is abnormally low, the backpropagation algorithm can trace back through the edges in the graph structure to the location of the pollution source that may have caused this anomaly, such as the surface layer or the middle layer. The specific implementation can construct an objective function that combines the multi-parameter prediction results with the node features and edge weights in the graph structure, and optimize it through methods such as gradient descent or Bayesian inference to obtain the distribution of potential pollution sources. After obtaining the distribution of potential pollution sources, the water flow field characteristics of the sample water body are obtained, and the pollution propagation path is simulated according to the distribution of potential pollution sources and the water flow field characteristics. The water flow field characteristics include the flow rate, flow direction, and turbulence characteristics of the water body, which can be measured by physical sensors or simulated by fluid mechanics models (such as the Navier-Stokes equation). For example, by simulating the flow of the sample water body in the original water source, the diffusion path of the pollutant after its release from the potential pollution source can be tracked. Through numerical simulation, the path of the pollutant propagating along the water flow direction from the potential source can be tracked, and a pollution propagation path map can be generated. This path map may be presented in two or three dimensions, showing the dynamic propagation trajectory of the pollutant in the water body. Spatial interpolation and optimization are performed on the pollution propagation path map to generate a high-resolution pollution distribution field. Spatial interpolation is a technique for extending discrete data points to continuous space, and common methods include Kriging interpolation, inverse distance weighting (IDW), or spline interpolation. In the pollution propagation path map, the path points may be discrete, such as having pollutant concentration data only at certain sampling points or simulation points. Through spatial interpolation, the system can deduce a continuous pollutant concentration distribution between these discrete points, forming a high-resolution pollution distribution field. For example, Kriging interpolation can utilize the spatial correlation between path points to estimate the pollutant concentration in unsampled areas, thereby generating a smooth distribution field. The optimization process may involve correcting the interpolated results, such as eliminating unreasonable distribution patterns by introducing additional constraints (such as water body boundaries or physical laws), or improving the accuracy of the distribution field by minimizing an error function. Optimization may also include filtering of noisy data to ensure the reliability of the pollution distribution field. This high-resolution pollution distribution field provides a basis for subsequent generation of water quality parameter spatial distribution maps, enabling the display of pollutant distribution in the water body with higher spatial resolution. The high-resolution pollution distribution field is mapped to the nodes and edges of the water quality feature map to generate a spatial distribution map of water quality parameters. This process is to reassociate the pollution distribution field with the graph structure of the water quality feature map, embedding continuous pollution distribution information into the topology of the graph. The specific implementation may involve assigning concentration values of the pollution distribution field to the nodes of the graph and adjusting the relevance between nodes according to the weights of the edges.Through the mapping, the high-resolution pollution distribution field can be converted into a graph-structured water quality parameter distribution to generate a final water quality parameter spatial distribution graph.

[0044] In an embodiment, the step of generating a comprehensive water quality monitoring report based on the spatial distribution graph includes: A graph model is constructed with water body levels as nodes, and pollution parameters are used as edge weights to iteratively optimize the spatial distribution graph and output a pollution correlation matrix. Based on a multi-objective optimization algorithm, the pollution correlation matrix is subjected to multi-objective quantitative processing to obtain a pollution impact score table. According to the pollution impact score table, historical water quality data and pollution source distribution characteristics are combined to predict pollution trends and generate pollution early warning information. The pollution early warning information, pollution impact score table, spatial distribution graph of water quality parameters, and multi-parameter prediction results are integrated and processed to generate a comprehensive water quality monitoring report containing detailed water quality conditions and pollution assessment.

[0045] In the above embodiment, the graph model is constructed with water body levels as nodes, i.e., the water body is divided into different levels of nodes, which can represent different areas of the water body or different types of monitoring points (such as fixed monitoring stations or mobile sampling points). The edges in the graph model represent the relationship between nodes, such as water flow direction, spatial proximity, or pollutant propagation path. Pollution parameters (such as pollutant concentration, chemical oxygen demand, etc.) are used as edge weights to reflect the strength of pollution influence between nodes. The process of iteratively optimizing the spatial distribution graph involves algorithms such as graph neural networks (GNN) or weighted least squares, which continuously adjust edge weights and node features to make the graph model more accurately reflect the spatial distribution characteristics of pollutants, outputting a pollution correlation matrix. The matrix is a symmetric or asymmetric matrix whose elements represent the pollution correlation strength between different water body nodes. Based on the multi-objective optimization algorithm, the pollution correlation matrix is quantitatively processed, and the multi-objective optimization algorithm is used to balance multiple conflicting objectives, which can define multiple objective functions, such as maximizing the coverage of pollution influence, minimizing the pollution concentration in key areas, or optimizing the assessment of ecological risk. Based on the pollution correlation matrix, a set of scores is generated through iterative calculation, reflecting the degree of pollution influence of each water body node or area. These scores are arranged into a pollution influence score table, presented in the form of a table or matrix, listing the pollution influence value, risk level, or other quantitative indicators of each node or area (such as the surface layer or the middle layer). Combining historical water quality data and pollution source distribution characteristics, pollution trend prediction is performed to generate pollution warning information. Historical water quality data provides a time dimension reference for trend prediction. Historical water quality data can include water quality parameters (such as pH value, dissolved oxygen) of monitoring points in the past period and records of pollution events, which can be processed through time series analysis or machine learning models (such as long short-term memory network LSTM) to identify periodic changes or long-term trends of pollution. Pollution source distribution characteristics come from the potential pollution source distribution in the previous step, and the implementation of pollution trend prediction can be achieved by building a prediction model to combine the current state in the pollution influence score table with historical data and pollution source characteristics to predict the change of pollutant concentration or distribution in the future period. Finally, the pollution warning information, pollution influence score table, spatial distribution graph of water quality parameters, and multi-parameter prediction results are integrated and processed to generate a comprehensive water quality monitoring report. This process is a comprehensive analysis and formatting presentation of the output results of the previous steps to generate a report containing detailed water quality conditions and pollution assessment. The specific implementation may involve data fusion and visualization techniques. For example, pollution warning information can be presented in the form of text or alert levels, describing high-risk areas and recommended management measures; the pollution influence score table can be embedded in the report in the form of a table or chart, showing the pollution scores and priorities of each area; the spatial distribution graph of water quality parameters can be visualized in the form of a heat map or contour map, highlighting the spatial distribution characteristics of pollutants; and the multi-parameter prediction results provide the current values and predicted values of each water quality parameter, providing data support for the report.

[0046] Referring to Figure 2 and Figure 3 The application further discloses an automatic water quality detection device adopting the automatic water quality detection method as any one of the above. The device comprises a box body 1, a water body containing cavity 2 arranged in the box body 1, and guide rail supports 3 arranged on opposite sides of the water body containing cavity 2. A distributed sensor network 4 comprises transverse sensors 41 arranged on the upper side of the water body containing cavity 2 and longitudinal sliding sensors 42 in sliding connection with the guide rail supports 3 and the transverse sensors 41 for collecting sample data of the surface layer of the water body. The longitudinal sliding sensors 42 slide along the guide rail supports 3 to collect sample data of the middle layer and the bottom layer of the water body at different depths. A data processor 5 is connected with the distributed sensor network 4 and is used for receiving and processing the sample data, executing the automatic water quality detection method as any one of the above, and outputting a comprehensive water quality monitoring report.

[0047] In this embodiment, the box 1 is the physical carrier of the entire detection system, and the water body containing cavity 2 is arranged inside for containing the sample water body to be detected. The water body containing cavity 2 inside the box 1 is a closed space, which is wrapped with a layer of glass on the outside, facilitating observation of the water body state, providing protection for the distributed sensor network 4 and the sample water body, and preventing external pollutants or mechanical damage from affecting the work of the sensor. The glass layer needs to be made of high-transparency, corrosion-resistant and high-strength material, such as tempered glass or special corrosion-resistant glass, to adapt to the water body environment that may contain acidic or alkaline substances. The water body containing cavity 2 is provided with guide rail supports 3 on opposite sides, and the guide rail supports 3 are longitudinally distributed. The distributed sensor network 4 includes transverse sensors 41 and longitudinal sliding sensors 42 for realizing multi-scale acquisition and processing. The transverse sensors 41 are fixed on the upper side of the water body containing cavity 2 and are responsible for collecting sample data of the surface layer of the water body. These sensors can include optical sensors, chemical sensors or electrochemical sensors for measuring parameters such as pH value, dissolved oxygen and turbidity of the surface layer of the water body. The transverse sensors 41 can include multiple sensors capable of covering a larger area of the surface layer of the water body to obtain representative data. The longitudinal sliding sensors 42 are connected to the guide rail supports 3 through sliding connection to realize movement at different depths, thereby collecting sample data of the middle and bottom layers of the water body. This sliding mechanism can be realized through driving elements 6 such as stepper motors or servo motors, which cooperate with high-precision guide rail systems to ensure that the sensors can be accurately positioned to the specified depth during movement. The longitudinal sliding sensors 42 are also equipped with multiple types of sensor modules to capture water quality parameters at different depths, such as temperature, salinity, heavy metal content, etc. Through the cooperative work of the transverse sensors 41 and the longitudinal sliding sensors 42, the device can realize multi-scale data acquisition in the surface, middle and bottom layers of the water body, forming a comprehensive raw data set to lay the foundation for subsequent data processing. The data processor 5 is connected to the distributed sensor network 4 and is responsible for receiving and processing sample data collected by the sensors and performing detection. The data processor 5 needs to have strong computing power and efficient data processing procedures, and can include the following modules inside: a data acquisition module responsible for receiving raw data transmitted by the transverse sensors 41 and the longitudinal sliding sensors 42, and performing preliminary formatting and preprocessing such as removing noise and calibrating sensor data. A feature extraction and reconstruction module extracts spatial correlation features at multiple levels in the raw data set, such as through spatial autocorrelation analysis or convolutional neural networks to extract spatial distribution features of water quality parameters at different depths and regions, and reconstructs these features to generate a feature-enhanced data set. A graph structure processing module is responsible for converting the feature-enhanced data set into a water quality feature map, which can be realized through a graph neural network (GNN) to model the spatial distribution of water quality parameters as a graph structure of nodes and edges, thereby capturing the complex relationships between parameters.A multi-task learning module is constructed and optimized to build a multi-task learning model. The water quality feature map is taken as input, and the model is optimized through a loss function (such as mean square error or cross-entropy loss). The output is a multi-parameter prediction result, such as predicting the concentration and distribution trend of pollutants in the water body. A reverse propagation processing module is used to further process the multi-parameter prediction result to generate a spatial distribution map of water quality parameters. The prediction result is converted into an intuitive spatial distribution image by combining the back propagation algorithm and visualization technology. A comprehensive evaluation and report generation module is used to perform multi-scale pollution impact evaluation based on the spatial distribution map, and to comprehensively analyze the pollution degree of the water body at different depths and regions. Finally, a comprehensive water quality monitoring report containing detailed monitoring results is generated. These modules work together to ensure that the data processor 5 can efficiently perform all steps. In addition, the box 1 can contain multiple sample water bodies, and is connected to the water body containing cavity 2 through a pipeline to realize continuous or batch water quality detection and improve detection efficiency.

[0048] In actual implementation, the data processor can use an embedded system or a high-performance microprocessor as the hardware basis, such as a processor based on ARM architecture or an FPGA chip, to support complex computing tasks. At the same time, the data processor needs to be equipped with sufficient storage space for saving raw data sets, feature enhancement data sets, and generated reports. In addition, the data processor can also be connected to external devices through wired or wireless communication modules (such as Wi-Fi or Bluetooth) to facilitate the transmission of monitoring reports to user terminals or cloud platforms. The presence of the glass layer not only protects the sensor and the water body, but also provides a stable environment for the operation of the data processor, reducing the influence of external interference on the accuracy of data processing.

[0049] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media provided herein and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).

[0050] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An automated water quality detection method, characterized in that: include: Perform multi-scale acquisition and processing of sample water bodies based on a distributed sensor network to obtain an original data set, wherein the multi-scale includes different spatial scales of the surface, middle and bottom layers of the water body; Extracting spatial correlation features at multiple levels from the original dataset, and reconstructing features of the original dataset based on the spatial correlation features to generate a feature-enhanced dataset; Performing graph structuring processing on the feature enhancement data set to output a water quality feature map; Constructing a multi-task learning model, inputting the water quality characteristic map into the multi-task learning model, optimizing the multi-task learning model based on a loss function, and outputting a multi-parameter prediction result; Performing back propagation processing on the multi-parameter prediction results to generate a spatial distribution map of water quality parameters; A multi-scale pollution impact assessment is performed based on the spatial distribution map to generate a comprehensive water quality monitoring report.

2. The automated water quality detection method according to claim 1, wherein: The step of performing multi-scale acquisition and processing of the sample water body based on the distributed sensor network to obtain the original data set, wherein the multi-scale includes different spatial scales of the surface layer, middle layer and bottom layer of the water body, comprises: Dynamic frequency sampling is performed based on the lateral sensors and longitudinal sliding sensors deployed in the sample water body to obtain a sampling sequence; Arranging the multiple parameters in the sampling sequence in a structured manner according to spatial coordinates and time series to generate a multidimensional parameter matrix; An anomaly detection algorithm based on statistical distribution identifies and removes abnormal data points in the multidimensional parameter matrix, and fills missing values ​​through a neighborhood interpolation algorithm to generate an optimized parameter set; The optimized parameter set is subjected to dimensionality reduction and efficient encoding, and an original data set including spatial coordinates, timestamps and multiple parameters is output.

3. The automated water quality detection method according to claim 1, wherein: extracting spatial correlation features at multiple levels from the original data set, and reconstructing features of the original data set based on the spatial correlation features, The steps to generate feature-enhanced datasets include: Calculate the spatial distance and attribute similarity between the sampling points of the surface, middle and bottom layers in the original data set, and construct a spatial correlation matrix reflecting the spatial dependency relationship between water body layers; Perform feature extraction processing according to the spatial correlation matrix to obtain a multi-level feature set; Calculating the contribution weight of each level feature in the multi-level feature set to the overall water quality expression, dynamically adjusting the combination ratio of the features, and generating a fusion feature set; The fused feature set is subjected to feature reconstruction processing based on a generative adversarial network to obtain a feature enhanced data set.

4. The automated water quality detection method according to claim 3, wherein: The step of performing feature extraction processing according to the spatial correlation matrix to obtain a multi-level feature set includes: Convolution kernels of different sizes are constructed to scan the spatial dependency relationship of the spatial correlation matrix layer by layer, obtain local and global patterns of surface, middle and bottom layer data at different spatial scales, and generate a preliminary feature set; The correlation information between the features at each level in the preliminary feature set is calculated, and the cross-level correlation information is embedded into the preliminary feature set to obtain a multi-level feature set.

5. The automated water quality detection method according to claim 1, wherein: The step of performing graph structuring processing according to the feature enhancement data set to output a water quality feature map includes: According to the multi-scale spatial features in the feature enhancement dataset, the spatial distribution of the water body samples is divided into multiple independent sensor nodes to obtain a sensor node set; According to the node features and spatial coordinates in the sensor node set, edge relationships between nodes are constructed to generate an initial graph structure; Aggregating the feature vector of each node in the initial graph structure with the features of neighboring nodes to generate an updated node feature set; The node features and edge relationships in the node feature update set are structured and integrated to obtain a water quality feature map with spatial semantics.

6. The automated water quality detection method according to claim 1, wherein: The steps of constructing a multi-task learning model, inputting the water quality characteristic map into the multi-task learning model, optimizing the multi-task learning model based on a loss function, and outputting a multi-parameter prediction result include: Decomposing the nodes and edge relationships of the water quality characteristic graph into high-dimensional feature vectors to obtain a task-specific feature set; Performing a structured construction process on a multi-task learning framework according to the task-specific feature set to obtain an initial multi-task learning model, wherein the initial multi-task learning model includes a shared backbone network and a plurality of task-specific branch networks; Iteratively updating the initial multi-task learning model parameters based on the gradient descent method, dynamically adjusting the optimization step size according to the gradient changes of each task, and obtaining an optimized learning model; The water quality characteristic map is input into the optimization learning model, and after the common features are extracted by the shared backbone network, they are distributed to each of the task-specific branch networks to output multi-parameter prediction results.

7. The automated water quality detection method according to claim 6, wherein: The step of inputting the water quality characteristic map into the optimization learning model, extracting common features through the shared backbone network, distributing the common features to each of the task-specific branch networks, and outputting multi-parameter prediction results includes: Inputting the water quality feature map into the first convolutional layer of the shared backbone network, performing convolution, activation, and pooling operations layer by layer, fusing multi-layer features through residual connections, and outputting a universal feature set; Distributing the universal feature set to input layers of multiple task-specific branch networks, each task-specific branch network predicting a specific water quality parameter; Each of the task-specific branch networks extracts and converts features from the universal feature set and outputs corresponding water quality parameter prediction values; The water quality parameter prediction values ​​of each task-specific branch network are integrated to obtain a multi-parameter prediction result set.

8. The automated water quality detection method according to claim 1, wherein: The step of performing back propagation processing on the multi-parameter prediction results to generate a spatial distribution map of water quality parameters includes: Combining the multi-parameter prediction results with the graph structure of the water quality characteristic map, using the back propagation algorithm to deduce the location of the potential pollution source to obtain the potential pollution source distribution; Acquiring the water flow field characteristics of the sample water body, simulating the pollutant propagation path according to the potential pollution source distribution and the water flow field characteristics, and obtaining a pollutant propagation path map; Performing spatial interpolation and optimization on the pollutant propagation path map to obtain a high-resolution pollution distribution field; The high-resolution pollution distribution field is mapped to the nodes and edges of the water quality characteristic map to generate a spatial distribution map of water quality parameters.

9. The automated water quality detection method according to claim 1, wherein: The step of performing a multi-scale pollution impact assessment based on the spatial distribution map and generating a comprehensive water quality monitoring report includes: Constructing a graph model with water body layers as nodes, iteratively optimizing the spatial distribution graph using pollution parameters as edge weights, and outputting a pollution correlation matrix; Performing multi-objective quantitative processing on the pollution correlation matrix based on a multi-objective optimization algorithm to obtain a pollution impact score table; Based on the pollution impact score sheet, combined with historical water quality data and pollution source distribution characteristics, pollution trend forecasting is performed to generate pollution warning information; The pollution warning information, pollution impact score sheet, spatial distribution map of water quality parameters and multi-parameter prediction results are integrated and processed to generate a comprehensive water quality monitoring report containing detailed water quality status and pollution assessment.

10. An automated water quality testing device, characterized in that: The automated water quality detection method according to any one of claims 1 to 9 comprises: A box body (1), wherein a water body accommodating chamber (2) is provided in the box body (1), and guide rail brackets (3) are provided on opposite sides of the water body accommodating chamber (2); A distributed sensor network (4) includes a transverse sensor (41) and a longitudinal sliding sensor (42), wherein the transverse sensor (41) is arranged on the upper side of the water body receiving chamber (2), and the longitudinal sliding sensor (42) is slidably connected to the guide rail bracket (3). The transverse sensor (41) is used to collect sample data of the surface layer of the water body, and the longitudinal sliding sensor (42) slides along the guide rail bracket (3) to collect sample data of the middle layer and the bottom layer of the water body at different depths; A data processor (5) is connected to the distributed sensor network (4) and is used to receive and process the sample data, execute the automated water quality detection method according to any one of claims 1 to 9, and output a comprehensive water quality monitoring report.

Citation Information

Cited By

  • Remote management method and system for multi-terminal water quality analyzer cluster

    CN121165675A

  • Multi-source data fused environmental sanitation operation quality intelligent evaluation method and system

    CN121436772A

  • Surface water sampling, storing and transporting system based on unmanned aerial vehicle

    CN121871771A

  • Intelligent dosing control method based on water quality on-line monitoring

    CN121978045A