Automatic river water quality monitoring and analyzing method and system

By integrating data fusion and multiple analysis methods, a water quality dynamics model is integrated, which solves the problem of insufficient integration between water quality monitoring data and fluid dynamics models in existing technologies. This enables in-depth analysis and prediction of water quality changes, optimizes the allocation of monitoring resources, and improves the real-time performance and efficiency of water quality management.

CN121324602APending Publication Date: 2026-01-13GUIYANG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410326148.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-21
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing technologies, when integrating water quality monitoring data with fluid dynamics models, cannot accurately understand the behavior of complex water systems, make it difficult to quickly identify pollution sources, are inflexible in allocating monitoring resources, have high complexity and uncertainty in predicting water quality change trends, and lack accuracy in assessing the importance of key parameters, thus affecting the real-time performance and efficiency of water quality management.

Method used

By integrating multi-source monitoring information using data fusion technology, and combining finite element analysis, Kalman filtering algorithm, stable isotope analysis, dynamic time bending algorithm, nonlinear dynamics method, random forest and neural network, an integrated water quality dynamics and strategy optimization scheme is generated through multiple linear regression analysis. Through multiple technical means, in-depth analysis and prediction of water quality changes are achieved.

Benefits of technology

It improved the accuracy of the analysis of the relationship between water quality changes and hydrodynamic processes, enhanced the scientific nature of water quality management strategies and the ability to cope with complex environments, optimized the allocation of monitoring resources, improved the response speed and cost-effectiveness of monitoring activities, and improved the accuracy and reliability of water quality trend prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121324602A_ABST
    Figure CN121324602A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of water quality monitoring, in particular to an automatic river water quality monitoring and analyzing method and system.The method comprises the following steps that on the basis of real-time and historical water quality monitoring data, multi-source monitoring information is integrated through the data fusion technology, and flow characteristics of a river water body are simulated through a finite element analysis method; and carrying out weighted average on data collected at multiple time points by implementing a Kalman filtering algorithm to generate an integrated hydrodynamics and spatial distribution prediction result. According to the analysis method, the analysis depth and accuracy of complex water body system behaviors such as rivers are improved through the analysis method integrating the water quality monitoring data and the fluid dynamic model, and the relation between the water quality change and the water flow dynamic process is comprehensively analyzed and predicted. The scientificity and effectiveness of a water quality management strategy are enhanced, and the capability of coping with complicated water environment challenges is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality monitoring technology, and in particular to an automatic monitoring and analysis method and system for river water quality. Background Technology

[0002] Water quality monitoring technology is an important branch of environmental science and engineering, focusing on the systematic collection, analysis, and interpretation of water quality data (such as rivers, lakes, groundwater, and oceans) through various methods and technologies. This field combines knowledge from chemistry, biology, physics, and environmental science to assess the health status of water bodies, monitor pollution levels, protect water resources, and support sustainable water environment management. Technological means include field sampling, laboratory analysis, online monitoring equipment, and remote sensing technology, providing detailed information on the chemical composition, biomass, physical properties, and other associated environmental factors of water bodies.

[0003] An automated monitoring and analysis method for river water quality involves using automated technology to continuously or periodically monitor and analyze the water quality of rivers and other water bodies. Its purpose is to track water quality changes in real-time or near real-time to quickly identify pollution events, assess water quality conditions, predict future trends, and provide a scientific basis for water resource management and protection. The method aims to improve water quality management efficiency, reduce labor costs, and accelerate response times through efficient and accurate monitoring, especially in the face of emergency pollution events.

[0004] While existing technologies have shown some effectiveness in collecting and analyzing the chemical composition, biological content, and physical properties of water bodies, their integration with fluid dynamics models still falls short in terms of depth and accuracy in understanding the behavior of complex water systems. This limits a comprehensive understanding of the relationship between hydrodynamic processes and water quality changes, thus impacting the formulation and optimization of water quality management strategies. Although existing technologies can monitor water quality changes using traditional physicochemical methods, they still have limitations in accuracy and sensitivity in precisely tracking water sources and their changes, particularly in identifying potential pollution sources. This makes it difficult to quickly and accurately locate pollution sources when dealing with pollution incidents of unknown origin, thus affecting the timely implementation of effective remediation measures. While existing technologies support basic analysis of water quality time-series data, they still lack accuracy in matching water quality change patterns when analyzing data with inconsistent sampling frequencies. This limits analytical efficiency and predictive capabilities when identifying periodic changes and abnormal fluctuations, reducing the real-time nature and effectiveness of water quality monitoring and management. Although existing technologies have achieved the basic functions of water quality monitoring, they still lack the flexibility and efficiency in allocating monitoring resources to dynamically adjust monitoring strategies based on water quality data and trends. This impacts the speed and cost-effectiveness of monitoring activities in predicting pollution incidents and responding to emergencies, and also limits the optimization and refined management of monitoring work. While existing technologies provide basic predictions of water quality change trends, there are still shortcomings in the ability to handle the complexity and uncertainty of predictions when applying nonlinear dynamic analysis to accurately predict future water quality trends. This limits a deeper understanding of the dynamic characteristics of water quality changes under the influence of complex environmental factors, reducing the accuracy and reliability of water quality trend predictions. Although existing technologies can perform basic analysis and evaluation of water quality monitoring data, there are still insufficient precision and detail in assessing the importance of key parameters in monitoring data using the coefficient of variation weighting. These limitations affect the emphasis placed on key water quality parameters and the rational allocation of resources in monitoring strategies, reducing the targetedness and efficiency of water quality monitoring and management. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and to propose an automatic monitoring and analysis method and system for river water quality.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: an automatic monitoring and analysis method for river water quality, comprising the following steps:

[0007] S1: Based on real-time and historical water quality monitoring data, data fusion technology is used to integrate multi-source monitoring information, and finite element analysis method is applied to simulate the flow characteristics of river water. By implementing the Kalman filter algorithm, the data collected at multiple time points are weighted and averaged to generate integrated water quality dynamics and spatial distribution prediction results.

[0008] S2: Based on the integrated water quality dynamics and spatial distribution prediction results, the stable isotope analysis method is used to determine the isotope ratio of hydrogen and oxygen in the water sample, trace the source of water quality and identify potential pollution sources, and generate water source and pollution source tracking results.

[0009] S3: Based on the water source and pollution source tracking results, the dynamic time warp algorithm is used to analyze the collected water quality time series data. By measuring and adjusting the differences between time series, the matching path is optimized, the pattern of water quality parameters changing over time is identified, and water quality time series matching results are generated.

[0010] S4: Based on the water quality time series matching results, a nonlinear dynamics method is used to analyze the water quality change trend. By constructing a dynamic model, the sensitivity of water quality changes is analyzed and potential nonlinear changes are predicted, generating water quality change trend prediction results.

[0011] S5: Based on the water quality change trend prediction results, random forest and neural network are used to dynamically adjust the sampling frequency and monitoring point layout. By analyzing the water quality change prediction and current monitoring data, key monitoring areas and times are automatically identified, and monitoring strategy optimization results are generated.

[0012] S6: Based on the optimization results of the monitoring strategy, the variability of water quality parameters is evaluated using the coefficient of variation method. By calculating the coefficient of variation of each parameter and assigning weights, the parameters with the greatest impact on water quality changes are identified, and the importance assessment results of water quality parameters are generated.

[0013] S7: Based on the integrated water quality dynamics and spatial distribution prediction results, water source and pollution source tracking results, water quality time series matching results, water quality change trend prediction results, monitoring strategy optimization results, and water quality parameter importance assessment results, multiple linear regression analysis is used to examine the decision-making basis of the entire data processing process and monitoring strategy, assist in identifying key data indicators, enable the focus of monitoring activities to respond to the needs of water quality changes, and generate strategy adjustment and optimization schemes.

[0014] The present invention improves upon the following: the integrated water quality dynamics and spatial distribution prediction results include flow velocity variation maps of key river basins, water quality distribution prediction tables of key sections, and pollution diffusion range prediction maps; the water source and pollution source tracing results include hydrogen and oxygen isotope composition maps of specified water samples, inferred water source maps, and lists of potential pollution source distributions; the water quality time series matching results include time variation curves of key water quality parameters, records of abnormal fluctuation events, and periodic change analysis; the water quality change trend prediction results include predicted water quality parameter change trend maps, early warning indicators for potential risk events, and confidence interval estimates for future changes; the monitoring strategy optimization results include adjusted monitoring point layout schemes, optimized sampling schedules, and screening criteria for parameters of interest; the water quality parameter importance assessment results include parameter influence rankings, weight allocation of key monitoring indicators, and quantitative analysis of their impact on monitoring strategies; and the strategy adjustment and optimization schemes include data analysis-based monitoring process improvement plans, optimization strategies for key decision points, and measures to improve monitoring efficiency.

[0015] The present invention improves upon real-time and historical water quality monitoring data by integrating multi-source monitoring information using data fusion technology, simulating the flow characteristics of river water using finite element analysis, and weighting and averaging data collected at multiple time points using a Kalman filter algorithm to generate integrated water quality dynamics and spatial distribution prediction results. The specific steps are as follows:

[0016] S101: Based on real-time and historical water quality monitoring data, the pandas.merge method in Python is used to merge datasets from multiple monitoring stations, the pandas.DataFrame.dropna method is used to remove missing values, and sklearn.preprocessing.StandardScaler is used to standardize the data, converting the multi-scale monitoring data into a unified standard form and generating a standardized monitoring dataset.

[0017] S102: Based on the standardized monitoring dataset, the finite element analysis method is used to simulate the flow characteristics of the river. The FLUENT module in ANSYS software is used to define the river geometric model and mesh generation, set boundary conditions, including inlet velocity and outlet pressure, select pressure-based solver to simulate the flow field, adjust the solution parameters including time step and number of iterations, and generate river dynamics simulation results.

[0018] S103: Based on the river dynamics simulation results, the Kalman filter algorithm is used to perform weighted averaging on the data. The initial state estimate and error covariance are set using the kalman function in MATLAB. The filter parameters, including measurement noise and process noise covariance, are adjusted according to the real-time updated monitoring data. The prediction model is dynamically optimized to generate integrated water quality dynamics and spatial distribution prediction results.

[0019] The present invention improves upon the aforementioned integrated water quality dynamics and spatial distribution prediction results by employing stable isotope analysis to determine the isotopic ratio of hydrogen and oxygen in water samples, tracing the source of water quality and identifying potential pollution sources. The specific steps for generating water source and pollution source tracing results are as follows:

[0020] S201: Based on the integrated water quality dynamics and spatial distribution prediction results, formulate a water sampling plan, select key sampling points of the river using GIS software, select the points according to the river flow pattern and potential pollution diffusion areas, cover the entire river from upstream to downstream, and generate a water sampling strategy map.

[0021] S202: Based on the water sample collection strategy map, perform stable isotope ratio calculation and analysis. Use Isodat software to calibrate and analyze the raw isotope ratio data generated by the mass spectrometer, and automatically correct instrument drift and background noise. Calculate the isotope ratios of hydrogen and oxygen in the water sample, including δD and δ¹⁸O. By setting algorithm parameters, ensure consistent analysis results and generate a preliminary isotope characteristic dataset.

[0022] S203: Based on the preliminary isotope feature dataset, Iso-Analyze software is used to trace water sources and identify pollution sources. The imported hydrogen and oxygen isotope ratios are analyzed, and the standard values ​​in the international isotope ratio database are compared using a built-in algorithm. Geospatial analysis is performed to plot the distribution of isotope data on a map. Clustering algorithms are used to identify the locations of designated water sources and potential pollution sources, generating water source and pollution source tracing results.

[0023] The present invention improves upon this invention by employing a dynamic time warp algorithm to analyze the collected water quality time series data based on the water source and pollution source tracing results. By measuring and adjusting the differences between time series, it optimizes the matching path, identifies patterns of water quality parameter changes over time, and generates water quality time series matching results. The specific steps are as follows:

[0024] S301: Based on the water source and pollution source tracking results, filter the monitoring point data associated with the tracking results, use a Python script to execute an SQL query, extract historical water quality data of the monitoring points from the database, so that the selected dataset can reflect the water quality change trend of the river from upstream to downstream, and generate a water quality time series dataset.

[0025] S302: Based on the water quality time series dataset, the dynamic time warp algorithm is used for analysis. The dtw function is called through the dtaidistance library in the Python environment. The window parameter is set to 10% of the sequence length to limit the search range. The distance_metric is selected to measure the similarity between Euclidean distances. The best matching path between multiple time series data is captured, the nonlinear deformation of the time series is processed, and the optimized time series matching path is generated.

[0026] S303: Based on the optimized time series matching path, identify water quality change patterns, visualize the data using the matplotlib library, plot the changing trends of water quality parameters at multiple time points, identify water quality change patterns including periodic changes and abnormal fluctuations, reveal the inherent laws of water quality changes, and generate water quality time series matching results.

[0027] The present invention improves upon the aforementioned water quality time series matching results by employing a nonlinear dynamics method to analyze water quality change trends. Through constructing a dynamic model, the sensitivity of water quality changes is analyzed, and potential nonlinear changes are predicted. The specific steps for generating water quality change trend prediction results are as follows:

[0028] S401: Based on the water quality time series matching results, perform data serialization processing, including time series segmentation and resampling. Use Python's pandas.cut method to segment the continuous time series data according to the time window. Each segment represents the average water quality status of a time interval. Use the pandas.resample method to resample the segmented data to generate a serialized time series dataset.

[0029] S402: Based on the serialized time series dataset, nonlinear dynamic analysis is used to analyze water quality changes, including using nolds.lyap_r to calculate the Lyapunov index, setting the embedding dimension to 3 and the delay time to 1, quantifying the uncertainty of water quality changes and the complexity of prediction, and reconstructing the phase space by calculating the embedding dimension and delay of the time series, using the delay method in the nolds library to calculate the optimal delay time based on the given time series data, and generating nonlinear dynamic characteristic analysis results;

[0030] S403: Based on the nonlinear dynamic characteristic analysis results, a water quality change trend prediction model is constructed. The random forest algorithm is used with sklearn.ensemble.RandomForestRegressor, the number of trees is set to 100, the maximum depth is 10, and the cross-validation method sklearn.model_selection.cross_val_score is used with a fold count of 5 to optimize the model parameters and prediction accuracy, and the water quality change trend prediction results are generated.

[0031] The present invention improves upon the water quality change trend prediction results by employing random forests and neural networks to dynamically adjust the sampling frequency and monitoring point layout. The specific steps for automatically identifying key monitoring areas and times and generating optimized monitoring strategy results by analyzing the predicted water quality changes and current monitoring data are as follows:

[0032] S501: Based on the predicted water quality change trend, integrate real-time monitoring data and historical prediction data, merge the data using Python's pandas.concat function, adjust the parameter axis=0 to stack the data vertically, and generate a comprehensive water quality monitoring dataset.

[0033] S502: Based on the comprehensive water quality monitoring dataset, the importance analysis is performed using the random forest algorithm. The model is built from the sklearn.ensemble module using RandomForestClassifier. n_estimators=100 defines the number of trees, and max_depth=10 controls the maximum depth of the trees. The importance of each monitoring point to the water quality change is evaluated through the trained model, and the monitoring point importance evaluation results are generated.

[0034] S503: Based on the importance assessment results of the monitoring points, a neural network model is used to adjust the monitoring strategy. The neural network is built from keras.models using the Sequential model, and a layer of Dense(64, activation=relu) is added to process features. The optimizer is adam, and the loss function is mean_squared_error. The sampling frequency and the layout of monitoring points are dynamically adjusted according to the model prediction results, so that the monitoring strategy can cope with the dynamic needs of water quality changes and generate the optimized monitoring strategy results.

[0035] The present invention improves upon this by using the coefficient of variation method to assess the variability of water quality parameters based on the optimization results of the monitoring strategy. The specific steps for generating the water quality parameter importance assessment results are as follows: By calculating the coefficient of variation of each parameter and assigning weights, the parameters with the greatest impact on water quality changes are identified.

[0036] S601: Based on the optimization results of the monitoring strategy, collect and organize the water quality parameter data of each monitoring point, and use a Python script to execute the pandas.DataFrame.loc method on the dataset to locate and extract the key water quality parameter data of the specified monitoring point and time range, and generate a water quality parameter dataset;

[0037] S602: Based on the water quality parameter dataset, calculate the coefficient of variation for each parameter, calculate the standard deviation using the numpy.std function in Python, obtain the mean using the numpy.mean function, and calculate the coefficient of variation using the formula CV = (standard deviation / mean) × 100%, which reflects the magnitude of parameter change during the monitoring period and generates parameter coefficient of variation results;

[0038] S603: Based on the coefficient of variation results of the parameters, the importance of the water quality parameters is rated. Each parameter is assigned a weight according to the magnitude of the coefficient of variation. The weight allocation is based on the numerical value of the coefficient of variation. The higher the coefficient of variation of a parameter, the more significant its role in monitoring water quality changes. The contribution of the parameters to water quality changes is comprehensively evaluated through a weighted method. The parameter with the most significant impact on water quality changes is selected, and the importance assessment results of the water quality parameters are generated.

[0039] The present invention improves upon the aforementioned integrated water quality dynamics and spatial distribution prediction results, water source and pollution source tracing results, water quality time series matching results, water quality change trend prediction results, monitoring strategy optimization results, and water quality parameter importance assessment results by employing multiple linear regression analysis to verify the decision-making basis of the entire data processing flow and monitoring strategy, assisting in the identification of key data indicators, and ensuring that the focus of monitoring activities can respond to the needs of water quality changes. The specific steps for generating strategy adjustment and optimization schemes are as follows:

[0040] S701: Based on the integrated water quality dynamics and spatial distribution prediction results, water source and pollution source tracking results, water quality time series matching results, water quality change trend prediction results, monitoring strategy optimization results, and water quality parameter importance assessment results, the data is organized, and the data frames are merged along axis=0 using the concat method of the pandas library in Python script, so that each data item is arranged in time order, and a comprehensive analysis dataset is generated.

[0041] S702: Based on the comprehensive analysis dataset, perform multiple linear regression analysis, use the OLS class of statsmodels.api to create a regression model, take the monitoring strategy as the dependent variable, and take the water quality dynamic parameters, isotope analysis results, time series matching characteristics, trend prediction values ​​and the importance of monitoring points as independent variables. Train the model by adjusting the parameters in the fit method, analyze the degree of influence of independent variables on dependent variables, and generate multiple regression analysis results.

[0042] S703: Based on the results of the multivariate regression analysis, identify the most critical factors for adjusting the monitoring strategy, analyze the coefficients and p-values ​​of the independent variables in the model, select the monitoring indicators that have the greatest impact on the water quality monitoring strategy, and adjust the sampling frequency, monitoring point layout and parameter monitoring focus according to the key indicators, so that the monitoring strategy can respond to the current needs of water quality changes and generate strategy adjustment and optimization schemes.

[0043] An automatic monitoring and analysis system for river water quality, the system includes a data integration module, a flow simulation module, an isotope identification module, a time series matching module, a trend prediction module, a strategy adjustment module, a parameter evaluation module, and a decision analysis module;

[0044] The data integration module is based on real-time and historical water quality monitoring data. It uses data integration technology and Python's pandas library to perform data merging operations. It combines the merge and concat methods to unify the datasets from multiple monitoring stations and applies the dropna function to remove any missing values ​​from the dataset to generate a comprehensive dataset.

[0045] The flow simulation module is based on a comprehensive dataset and uses the finite element method to simulate the flow characteristics of river water. It uses ANSYS Fluent software to set simulation parameters, including the inlet velocity of the fluid, boundary conditions and initial flow configuration, and performs dynamic fluid simulation to predict the behavior and changing trend of the water flow, generating flow simulation results.

[0046] The isotope identification module performs stable isotope analysis based on the flow simulation results, uses Isodat software to process water sample data, measures the isotope ratio of hydrogen and oxygen, identifies water quality sources and pollution sources, including mass spectrometry calibration of raw data, isotope ratio calculation, and generates isotope identification results.

[0047] The time series matching module analyzes water quality time series based on isotope identification results and uses a dynamic time warp algorithm. It captures the optimal matching path between sequences using the dtaidistance library in Python, adjusts the time warp to reveal the change pattern of water quality parameters over time, and generates time series matching results.

[0048] The trend prediction module uses nonlinear dynamics and random forest models to predict water quality trends based on time series matching results. It combines Python's sklearn.ensemble library for trend analysis, sets tree number and depth parameters, analyzes potential trends and risk events of water quality changes, and generates trend prediction results.

[0049] The strategy adjustment module intelligently adjusts the layout of monitoring points and sampling frequency based on trend prediction results, combined with random forest and neural network technologies. It uses keras.models.Sequential to build a model, analyzes the difference between predicted data and monitoring data, automatically optimizes the monitoring strategy, and focuses on monitoring key areas and times, generating monitoring strategy adjustment results.

[0050] The parameter evaluation module performs coefficient of variation analysis based on the monitoring strategy adjustment results. It calculates the coefficient of variation of water quality parameters using Python's numpy library, assigns weights to each parameter, identifies the parameters that have the greatest impact on water quality changes, and generates parameter importance evaluation results.

[0051] The decision analysis module, based on flow simulation results, isotope identification results, time series matching results, trend prediction results, monitoring strategy adjustment results, and parameter importance assessment results, employs multiple linear regression analysis and uses statsmodels.api.OLS for data analysis to evaluate the contribution of each factor to the monitoring strategy, assist in formulating monitoring strategies and management decisions, and generate a comprehensive decision support scheme.

[0052] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0053] This invention improves the depth and accuracy of analyzing the behavior of complex water systems such as rivers by integrating water quality monitoring data with fluid dynamics models, enabling a comprehensive analysis and prediction of the relationship between water quality changes and hydrodynamic processes. This not only enhances the scientific rigor and effectiveness of water quality management strategies but also strengthens the ability to address complex aquatic environmental challenges. The use of stable isotope technology for tracing water and pollution sources overcomes the limitations of traditional physicochemical monitoring methods in accurately tracking water sources and their changes, providing a new dimension for identifying potential pollution sources and enhancing the understanding of the factors behind water quality changes and the targeted nature of countermeasures. The application of a dynamic time-warping algorithm optimizes the analysis of water quality time-series data, improving the accuracy and efficiency of matching water quality change patterns under inconsistent sampling frequencies, and enhancing the ability for event detection and trend analysis. An intelligent system that dynamically adjusts sampling frequencies and monitoring point layout automatically optimizes monitoring strategies based on real-time and predicted data, significantly improving the flexibility and efficiency of monitoring resource allocation. This method not only improves the response speed and cost-effectiveness of monitoring activities but also makes monitoring work more optimized and refined. The application of nonlinear dynamics analysis to predict water quality change trends improves the accuracy and reliability of predictions by deeply analyzing the dynamic properties of water quality changes, providing a scientific basis for water quality management and decision-making. Finally, the data importance assessment method using the coefficient of variation weight optimizes the data analysis process, ensuring that the most critical water quality parameters are focused on during assessment and decision-making, thus enhancing the targeting and efficiency of water quality monitoring and management. Attached Figure Description

[0054] Figure 1 The present invention provides a flowchart of an automatic monitoring and analysis method for river water quality;

[0055] Figure 2 This invention provides a detailed flowchart of step S1 in an automatic river water quality monitoring and analysis method.

[0056] Figure 3 This invention provides a detailed flowchart of step S2 in an automatic river water quality monitoring and analysis method.

[0057] Figure 4 This invention provides a detailed flowchart of step S3 in an automatic river water quality monitoring and analysis method.

[0058] Figure 5 This invention provides a detailed flowchart of step S4 in an automatic river water quality monitoring and analysis method.

[0059] Figure 6 This invention provides a detailed flowchart of step S5 in an automatic river water quality monitoring and analysis method.

[0060] Figure 7 This invention provides a detailed flowchart of step S6 in an automatic river water quality monitoring and analysis method.

[0061] Figure 8 This invention provides a detailed flowchart of step S7 in an automatic river water quality monitoring and analysis method.

[0062] Figure 9 This invention proposes a module diagram for an automatic river water quality monitoring and analysis system. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0064] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0065] Example

[0066] Please see Figure 1 This invention provides a technical solution: an automatic monitoring and analysis method for river water quality, comprising the following steps:

[0067] S1: Based on real-time and historical water quality monitoring data, data fusion technology is used to integrate multi-source monitoring information, and finite element analysis method is applied to simulate the flow characteristics of river water. By implementing the Kalman filter algorithm, the data collected at multiple time points are weighted and averaged to generate integrated water quality dynamics and spatial distribution prediction results.

[0068] S2: Based on the integrated water quality dynamics and spatial distribution prediction results, the stable isotope analysis method is used to determine the isotope ratio of hydrogen and oxygen in the water sample, trace the source of water quality and identify potential pollution sources, and generate water source and pollution source tracking results.

[0069] S3: Based on the water source and pollution source tracking results, the dynamic time warp algorithm is used to analyze the collected water quality time series data. By measuring and adjusting the differences between time series, the matching path is optimized, the pattern of water quality parameter change over time is identified, and water quality time series matching results are generated.

[0070] S4: Based on the water quality time series matching results, a nonlinear dynamics method is used to analyze the water quality change trend. By constructing a dynamic model, the sensitivity of water quality changes is analyzed and potential nonlinear changes are predicted, generating water quality change trend prediction results.

[0071] S5: Based on the water quality change trend prediction results, random forest and neural network are used to dynamically adjust the sampling frequency and monitoring point layout. By analyzing the water quality change prediction and current monitoring data, key monitoring areas and times are automatically identified, and monitoring strategy optimization results are generated.

[0072] S6: Based on the optimization results of the monitoring strategy, the coefficient of variation method is used to evaluate the variability of water quality parameters. By calculating the coefficient of variation of each parameter and assigning weights, the parameters with the greatest impact on water quality changes are identified, and the importance assessment results of water quality parameters are generated.

[0073] S7: Based on the integrated water quality dynamics and spatial distribution prediction results, water source and pollution source tracking results, water quality time series matching results, water quality change trend prediction results, monitoring strategy optimization results, and water quality parameter importance assessment results, multiple linear regression analysis is used to examine the decision basis of the entire data processing process and monitoring strategy, assist in identifying key data indicators, enable the focus of monitoring activities to respond to the needs of water quality changes, and generate strategy adjustment and optimization schemes.

[0074] The integrated water quality dynamics and spatial distribution prediction results include flow velocity change maps of key river basins, water quality distribution prediction tables for key sections, and pollution diffusion range prediction maps. Water source and pollution source tracing results include hydrogen and oxygen isotope composition maps of specified water samples, inferred water source maps, and lists of potential pollution source distributions. Water quality time series matching results include time variation curves of key water quality parameters, records of abnormal fluctuation events, and periodic change analysis. Water quality change trend prediction results include predicted water quality parameter change trend maps, early warning indicators for potential risk events, and confidence interval estimates for future changes. Monitoring strategy optimization results include adjusted monitoring point layout schemes, optimized sampling schedules, and selection criteria for parameters of interest. Water quality parameter importance assessment results include parameter influence rankings, weight allocation of key monitoring indicators, and quantitative analysis of their impact on monitoring strategies. Strategy adjustment and optimization schemes include data analysis-based monitoring process improvement plans, optimization strategies for key decision points, and measures to improve monitoring efficiency.

[0075] In step S1, real-time and historical water quality monitoring data from different monitoring stations are integrated using data fusion technology. This includes merging datasets using the `merge` method of Python's pandas library, removing any missing values ​​using the `dropna` method, and further standardizing the data using `StandardScaler` to ensure that monitoring data at different scales can be processed uniformly. Next, the finite element method is applied to simulate the flow characteristics of the river. The `FLUENT` module in the fluid dynamics software ANSYS is used to define the river's geometric model and boundary conditions for flow field simulation. During this process, a pressure-based solver is selected, and solution parameters such as the time step and number of iterations are adjusted to generate river dynamics simulation results. Following this, a Kalman filter algorithm is implemented to perform weighted averaging of the collected multi-time-point data, dynamically optimizing the prediction model and generating integrated water quality dynamics and spatial distribution prediction results. This achieves the effect of improving the accuracy of water quality monitoring and prediction, generating velocity variation maps of key river basins, water quality distribution prediction tables for key sections, and pollution diffusion range prediction maps, providing basic data and prediction models for subsequent analysis.

[0076] In step S2, based on integrated water quality dynamics and spatial distribution prediction results, stable isotope analysis is used to determine the hydrogen and oxygen isotope ratios in water samples to trace water quality sources and identify potential pollution sources. The isotope ratio data generated by the mass spectrometer is processed using Isodat software for calibration and analysis, automatically correcting for instrument drift and background noise. Algorithm parameters are set to ensure the consistency of analytical results and generate a preliminary isotope characteristic dataset. Then, Iso-Analyze software is used for water source tracing and pollution source identification, performing geospatial analysis to map the distribution of isotope data, and using clustering algorithms to identify the locations of specified water sources and potential pollution sources. This step effectively enhances the depth of water quality monitoring, generating a hydrogen and oxygen isotope composition map of the specified water sample, an inferred water source map, and a list of potential pollution source distributions, providing new methods and data support for accurately tracking water sources and their changes.

[0077] In step S3, based on the water source and pollution source tracing results, a dynamic time warp algorithm is used to analyze the collected water quality time series data. This includes using the dtaidistance library in the Python environment to call the dynamic time warp function, setting the window parameter to 10% of the series length to limit the search range, selecting Euclidean distance as the distance metric, and capturing the best matching path between multiple time series data. This process handles the nonlinear deformation of the time series and optimizes the time series matching path. Data visualization is performed using the matplotlib library to plot the changing trends of key water quality parameters such as dissolved oxygen and pH at multiple time points, identifying periodic changes and abnormal fluctuations in water quality, and revealing the inherent laws of water quality changes. This step not only improves the accuracy and efficiency of matching water quality change patterns but also enhances the ability of event detection and trend analysis, generating time change curves of key water quality parameters, records of abnormal fluctuation events, and analysis results of periodic changes.

[0078] In step S4, based on the water quality time series matching results, a nonlinear dynamics method is used to conduct an in-depth analysis of water quality change trends. A dynamic model is constructed, and the Lyapunov exponent is calculated using Python's nolds library. The embedding dimension and delay time are set to quantify the uncertainty and complexity of water quality changes and predictions. During phase space reconstruction, the embedding dimension and optimal delay time of the time series are calculated, generating nonlinear dynamics feature analysis results. A water quality change trend prediction model is constructed using the random forest algorithm via sklearn.ensemble.RandomForestRegressor. The number of trees and maximum depth are set, and cross-validation is used to optimize model parameters and prediction accuracy. This step provides a predictive model for future water quality trends, generating prediction results including predicted water quality parameter change trend maps, early warning indicators for potential risk events, and confidence interval estimates for future changes, significantly improving the understanding and prediction capabilities of water quality change trends.

[0079] In step S5, based on the predicted water quality change trends, random forests and neural networks are used to dynamically adjust the sampling frequency and monitoring point layout. By integrating real-time monitoring data with historical prediction data, the `concat` function of pandas is used to merge the data, ensuring the continuity of the time series. The random forest algorithm is used for importance analysis, evaluating the importance of each monitoring point's impact on water quality changes using `RandomForestClassifier`. The neural network model is used to adjust the monitoring strategy, utilizing the `Sequential` model from `keras.models`, adding a dense layer to process features, selecting `adam` as the optimizer, and using the mean_squared_error loss function. The sampling frequency and monitoring point layout are dynamically adjusted based on the model's prediction results. This step automatically identifies key monitoring areas and times, generating optimized monitoring strategy results, including the adjusted monitoring point layout scheme, optimized sampling schedule, and selection criteria for key parameters, effectively improving the flexibility and efficiency of monitoring resource allocation.

[0080] In step S6, based on the optimized monitoring strategy, the coefficient of variation (CV) method is used to assess the variability of water quality parameters. Water quality parameter data from each monitoring point are collected and organized, and key water quality parameters are located and extracted using the pandas.DataFrame.loc method. The standard deviation is calculated using the `std` function of the NumPy library, and the mean is obtained using the `mean` function. The CV is then calculated using the formula CV = (standard deviation / mean) × 100%, reflecting the magnitude of parameter variation during the monitoring period. Weights are assigned to each parameter based on the magnitude of the CV, and the parameters with the most significant impact on water quality changes are selected. This step generates the water quality parameter importance assessment results, including parameter influence ranking, weight allocation of key monitoring indicators, and quantitative analysis of their impact on the monitoring strategy. This provides a scientific basis for the importance placed on key water quality parameters and the rational allocation of resources in the monitoring strategy.

[0081] In step S7, based on the previous analysis results, multiple linear regression analysis was used to verify the decision-making basis of the entire data processing flow and monitoring strategy. The data frames were merged along axis=0 using the `concat` method of the pandas library, ensuring that each data item was arranged in chronological order, creating a comprehensive analysis dataset. A regression model was created using the OLS class of the `statsmodels.api`, with the monitoring strategy as the dependent variable and water quality dynamic parameters, isotope analysis results, time series matching characteristics, trend prediction values, and the importance of monitoring points as independent variables. The model was trained by adjusting the parameters in the `fit` method, and the influence of the independent variables on the dependent variable was analyzed. This step helped identify key data indicators and generated strategy adjustment and optimization plans, including a data analysis-based monitoring process improvement plan, optimization strategies for key decision points, and measures to improve monitoring efficiency, ensuring that the focus of monitoring activities effectively responded to the needs of water quality changes.

[0082] Please see Figure 2 Based on real-time and historical water quality monitoring data, data fusion technology is used to integrate multi-source monitoring information, and the finite element analysis method is applied to simulate the flow characteristics of river water. By implementing the Kalman filter algorithm, the data collected at multiple time points are weighted and averaged to generate integrated water quality dynamics and spatial distribution prediction results. The specific steps are as follows:

[0083] S101: Based on real-time and historical water quality monitoring data, the pandas.merge method in Python is used to merge datasets from multiple monitoring stations, the pandas.DataFrame.dropna method is used to remove missing values, and sklearn.preprocessing.StandardScaler is used to standardize the data, converting the multi-scale monitoring data into a unified standard form and generating a standardized monitoring dataset.

[0084] S102: Based on a standardized monitoring dataset, the finite element analysis method is used to simulate the flow characteristics of river water. The FLUENT module in ANSYS software is used to define the river geometry model and mesh generation, set boundary conditions, including inlet velocity and outlet pressure, select pressure-based solver to simulate the flow field, adjust the solution parameters including time step and number of iterations, and generate river dynamics simulation results.

[0085] S103: Based on the results of river dynamics simulation, the Kalman filter algorithm is used to perform weighted averaging of the data. The initial state estimate and error covariance are set using the kalman function in MATLAB. The filter parameters, including measurement noise and process noise covariance, are adjusted according to the real-time updated monitoring data. The prediction model is dynamically optimized to generate integrated water quality dynamics and spatial distribution prediction results.

[0086] In substep S101, real-time and historical water quality monitoring data are first collected from multiple monitoring stations. This data exists in time-series format and includes measurements of water quality parameters such as temperature, pH, and dissolved oxygen. Using the `merge` method from Python's pandas library, these datasets from different data sources are merged to form a more comprehensive dataset. Data missing issues encountered during the merging process are addressed using the `dropna` method. Next, to resolve the scale inconsistency issue between different data sources, the data is standardized using `StandardScaler` from `sklearn.preprocessing`, transforming all monitoring data to a unified standard scale. This process generates a clean and standardized monitoring dataset, laying the foundation for subsequent fluid dynamics simulations and water quality prediction analysis.

[0087] In sub-step S102, based on the standardized monitoring dataset generated in step S101, the finite element method (FEM) is used to simulate the flow characteristics of the river in detail. Using the FLUENT module in ANSYS software, the geometric model of the river was first defined and meshed to ensure the accuracy and detail of the simulation. Subsequently, boundary conditions were set for the model, such as the flow velocity at the inlet and the pressure at the outlet, and a pressure-based solver was selected for flow field simulation. By adjusting the solution parameters, such as the time step and the number of iterations, numerical simulations of fluid dynamics were performed, generating river dynamics simulation results. This step not only simulates the dynamic changes of river flow but also provides important foundational data for further prediction of water quality dynamics and spatial distribution.

[0088] In sub-step S103, the river dynamics simulation results generated in step S102 are used to perform weighted averaging of the data using the Kalman filter algorithm. This process is performed in the MATLAB environment, using the kalman function to initialize the filter's state estimate and error covariance, and adjusting the filter parameters, including the covariance of measurement noise and process noise, based on real-time updated monitoring data. This dynamically optimized prediction model can effectively integrate monitoring data and fluid dynamics simulation results from different time points, generating integrated prediction results for water quality dynamics and spatial distribution. These results not only provide velocity variation maps of key river basins and water quality distribution prediction tables for key cross-sections, but also prediction maps of pollution diffusion ranges. Through this series of refinement operations, accurate predictions of river water quality changes and spatial distribution characteristics are achieved, providing a scientific basis and support for subsequent water quality management and decision-making.

[0089] Suppose we are conducting automated water quality monitoring and analysis on a section of a river, collecting data including parameters such as temperature, pH, dissolved oxygen, and turbidity. This data also includes data from three different monitoring stations: Station A, Station B, and Station C. Within a specific monitoring period, Station A's temperature data is 18.5℃, pH is 7.2, dissolved oxygen is 8 mg / L, and turbidity is 5 NTU; Station B's temperature data is 19.0℃, pH is 7.5, dissolved oxygen is 7.8 mg / L, and turbidity is 4.5 NTU; and Station C's temperature data is 17.8℃, pH is 7.1, dissolved oxygen is 8.2 mg / L, and turbidity is 5.5 NTU. By integrating multi-source monitoring information using data fusion technology and applying finite element analysis to simulate the flow characteristics of river water, and then using the Kalman filter algorithm to perform weighted averaging of the data, the resulting integrated water quality dynamics and spatial distribution prediction results show that the flow velocity in the key river basin is expected to increase slightly during the future monitoring period. This will lead to a slight increase in temperature at downstream station D to 19.2℃, a stable pH value at around 7.4, a decrease in dissolved oxygen to 7.5 mg / L, and an increase in turbidity to 6 NTU. These simulated values ​​provide early warning information for water quality management departments, helping them to formulate more effective water quality management and pollution control strategies.

[0090] Please see Figure 3 Based on integrated water quality dynamics and spatial distribution prediction results, stable isotope analysis is used to determine the isotopic ratio of hydrogen and oxygen in water samples, trace the source of water quality and identify potential pollution sources, and generate water source and pollution source tracing results. The specific steps are as follows:

[0091] S201: Based on the integrated water quality dynamics and spatial distribution prediction results, formulate a water sampling plan, select key sampling points of the river using GIS software, select the points according to the river flow pattern and potential pollution diffusion areas, cover the entire river from upstream to downstream, and generate a water sampling strategy map.

[0092] S202: Based on the water sample collection strategy map, the stable isotope ratio is calculated and analyzed. Isodat software is used to calibrate and analyze the raw isotope ratio data generated by the mass spectrometer, and automatically correct instrument drift and background noise. The isotope ratios of hydrogen and oxygen in the water sample, including δD and δ^18O, are calculated. By setting the algorithm parameters, the analysis results are made consistent, and a preliminary isotope characteristic dataset is generated.

[0093] S203: Based on the preliminary isotope feature dataset, Iso-Analyze software is used to trace water sources and identify pollution sources. The imported hydrogen and oxygen isotope ratios are analyzed, and the standard values ​​in the international isotope ratio database are compared with the built-in algorithm. Geospatial analysis is performed to draw the distribution of isotope data on the map. The location of the specified water source and potential pollution source is identified through clustering algorithm, and the water source and pollution source tracing results are generated.

[0094] In sub-step S201, a water sampling plan is developed by integrating water quality dynamics and spatial distribution prediction results. First, Geographic Information System (GIS) software is used to select key sampling points based on river flow patterns and potential pollution diffusion areas. These points cover the entire area from upstream to downstream of the river. The GIS software precisely marks the sampling point locations based on the river's specific geographical features and simulated water flow dynamics information, generating a water sampling strategy map. This map details the geographical location of each sampling point, ensuring that sampling activities comprehensively cover key areas and providing a solid foundation for accurately tracing water quality sources and identifying potential pollution sources.

[0095] In substep S202, stable isotope ratios are calculated and analyzed based on the water sample collection strategy map. The raw isotope ratio data obtained through mass spectrometry is processed using Isodat software. This software calibrates and analyzes the data, automatically correcting for instrument drift and background noise to ensure the accuracy of the analytical results. The isotope ratios of hydrogen and oxygen in the water sample, i.e., δD and δ¹⁸O, are calculated, and the consistency of the analytical results is ensured by precisely setting the algorithm parameters. This step generates a preliminary isotope characteristic dataset, providing key isotope indicators for the accurate tracking of water sources and pollution sources, thus making the scientific basis for water quality monitoring and pollution source identification more comprehensive.

[0096] In substep S203, based on the preliminary isotopic characteristic dataset, Iso-Analyze software is used for water source tracing and pollution source identification. This software analyzes the imported hydrogen and oxygen isotope ratios and compares them with standard values ​​in the international isotope ratio database, performing geospatial analysis to plot the distribution of isotopic data on a map. Through clustering algorithms, the software can identify the precise locations of designated water sources and potential pollution sources. This step generates water source and pollution source tracing results, including a hydrogen and oxygen isotope composition map of the specified water sample, an inferred water source map, and a list of potential pollution source distributions. These results provide precise traceability information for water quality management, greatly improving the targeting and effectiveness of water quality monitoring, and enabling water quality protection and pollution control measures to be implemented more precisely against specific pollution sources.

[0097] Suppose a scenario involving automated water quality monitoring and analysis of a river segment involves a series of water sample collections and isotope analyses. First, based on fluid dynamics simulation results, GIS software was used to select two sampling points each in the upstream, midstream, and downstream sections of the river, for a total of six points. The simulation data includes the hydrogen isotope ratio (δD) and oxygen isotope ratio (δ¹⁸O) for each point. The upstream points have hydrogen isotope ratios of -85‰ and -80‰, and oxygen isotope ratios of -11.5‰ and -10‰, respectively; the midstream points have hydrogen isotope ratios of -75‰ and -70‰, and oxygen isotope ratios of -9‰ and -8‰, respectively; and the downstream points have hydrogen isotope ratios of -65‰ and -60‰, and oxygen isotope ratios of -7‰ and -6‰, respectively. After calibrating and analyzing these raw data using Isodat software, a standardized isotope characteristic dataset was obtained. Subsequently, Iso-Analyze software was used for water source tracing and pollution source identification analysis. Potential pollution sources identified through clustering algorithms were mainly concentrated in industrial areas near the middle reaches of the river. Detailed data and simulated values ​​demonstrated how isotope technology can be effectively used to track water quality changes and identify pollution sources, providing precise scientific evidence for river water quality management.

[0098] Please see Figure 4 Based on the results of water source and pollution source tracing, a dynamic time warp algorithm is used to analyze the collected water quality time series data. By measuring and adjusting the differences between time series, the matching path is optimized, the pattern of water quality parameter changes over time is identified, and the specific steps for generating water quality time series matching results are as follows:

[0099] S301: Based on the results of water source and pollution source tracing, filter the monitoring point data associated with the tracing results, use Python scripts to execute SQL queries, extract historical water quality data of the monitoring points from the database, so that the selected dataset can reflect the water quality change trend of the river from upstream to downstream, and generate a water quality time series dataset.

[0100] S302: Based on a water quality time series dataset, the dynamic time warp algorithm is used for analysis. The dtw function is called through the dtaidistance library in the Python environment. The window parameter is set to 10% of the sequence length to limit the search range. The distance_metric is selected to measure the similarity between Euclidean distances. The algorithm captures the best matching path between multiple time series data, processes the nonlinear deformation of the time series, and generates an optimized time series matching path.

[0101] S303: Based on the optimized time series matching path, water quality change patterns are identified, and the data is visualized using the matplotlib library. The changing trends of water quality parameters at multiple time points are plotted, and water quality change patterns including periodic changes and abnormal fluctuations are identified. The inherent laws of water quality changes are revealed, and water quality time series matching results are generated.

[0102] In sub-step S301, data from monitoring points closely related to the source and pollution source tracing results are filtered. This process involves using Python scripts to execute SQL queries to accurately extract historical water quality data from the database corresponding to the geographical locations of the identified water and pollution sources. The selected dataset format includes timestamps, measured values ​​of water quality parameters (such as temperature, pH, dissolved oxygen, turbidity, etc.), ensuring that the data reflects the water quality change trend from upstream to downstream of the river. The result of this step is a water quality time series dataset that not only contains water quality change data from each monitoring point but is also arranged chronologically, providing a foundation for further time series analysis.

[0103] In substep S302, a dynamic time warping algorithm is employed for in-depth analysis based on the water quality time series dataset. By utilizing the `dtaidistance` library in the Python environment and calling the `dtw` function, the algorithm measures and adjusts the differences between time series to find the optimal matching path. During execution, the `window` parameter is set to 10% of the series length to limit the search range, and Euclidean distance is chosen as the metric for similarity between series. This refinement operation enables the algorithm to effectively handle nonlinear deformations of the time series, ultimately generating optimized time series matching paths. The results provide a precise matching framework for in-depth analysis of water quality change trends, contributing to a better understanding of the patterns of water quality parameter changes over time.

[0104] In sub-step S303, water quality change patterns were identified based on the time series matching path optimized by the dynamic time warp algorithm. The matplotlib library was used to visualize the data, plotting the trends of water quality parameters (such as dissolved oxygen and pH) at multiple time points. This process not only revealed water quality change patterns such as periodic variations and anomalous fluctuations, but also clearly demonstrated the inherent laws governing the changes of water quality parameters over time. The generated water quality time series matching results provide an intuitive and scientific basis for subsequent water quality management and decision-making, including providing accurate timing and direction for taking corresponding water quality improvement measures in identifying key periods and trends of water quality changes.

[0105] Suppose an automated water quality monitoring and analysis scenario is implemented for a river flowing through a city. Water quality parameter data (A, B, C, D, E) are collected from five monitoring points (A, B, C, D, E) from upstream to downstream, including dissolved oxygen (mg / L), pH value, turbidity (NTU), and temperature (°C). Over a one-month period, monitoring point A shows dissolved oxygen 9.8 mg / L, pH 7.2, turbidity 15 NTU, and temperature 18°C; monitoring point B shows dissolved oxygen 8.5 mg / L, pH 7.5, turbidity 20 NTU, and temperature 20°C; monitoring point C shows dissolved oxygen 7.0 mg / L, pH 7.8, turbidity 25 NTU, and temperature 22°C; monitoring point D shows dissolved oxygen 6.5 mg / L, pH 8.0, turbidity 30 NTU, and temperature 24°C; and monitoring point E shows dissolved oxygen 5.8 mg / L, pH 8.2, turbidity 35 NTU, and temperature 25°C. The dynamic time warp algorithm was used to analyze these time series data, with a search window set at 10% of the series length, and Euclidean distance was used to measure the similarity between series. After processing, the algorithm identified the changing trends of water quality parameters over time, including dissolved oxygen and turbidity showing a clear downstream decreasing trend, while pH and temperature gradually increased. Data visualization revealed evidence of increasing anthropogenic impacts on river water quality, especially in the area from monitoring points C to E, due to industrial discharges or direct discharge of urban sewage along the river. This effectively demonstrates the application of the dynamic time warp algorithm in water quality time series analysis, providing accurate scientific evidence for river water quality management and pollution source identification.

[0106] Please see Figure 5 Based on the water quality time series matching results, a nonlinear dynamics method is used to analyze the water quality change trend. By constructing a dynamic model, the sensitivity of water quality changes is analyzed and potential nonlinear changes are predicted. The specific steps for generating water quality change trend prediction results are as follows:

[0107] S401: Based on the water quality time series matching results, data serialization processing is performed, including time series segmentation and resampling. The continuous time series data is segmented according to the time window using Python's pandas.cut method. Each segment represents the average water quality status of a time interval. The pandas.resample method is used to resample the segmented data to generate a serialized time series dataset.

[0108] S402: Based on the serialized time series dataset, nonlinear dynamic analysis is used to analyze water quality changes. This includes using nolds.lyap_r to calculate the Lyapunov index, setting the embedding dimension to 3 and the delay time to 1, quantifying the uncertainty and complexity of water quality changes and prediction. Phase space reconstruction is performed by calculating the embedding dimension and delay of the time series, using the delay method in the nolds library to calculate the optimal delay time based on the given time series data, and generating nonlinear dynamic feature analysis results.

[0109] S403: Based on the nonlinear dynamics characteristic analysis results, a water quality change trend prediction model is constructed. The random forest algorithm is used with sklearn.ensemble.RandomForestRegressor, the number of trees is set to 100, the maximum depth is 10, and the cross-validation method sklearn.model_selection.cross_val_score is used with a fold count of 5 to optimize the model parameters and prediction accuracy, and the water quality change trend prediction results are generated.

[0110] In substep S401, the dataset is prepared through data serialization based on the water quality time series matching results. This process involves segmenting the continuous time series data according to a set time window, with each segment representing the average water quality condition within that time interval. The `cut` method from Python's pandas library is used to segment the time series into equally spaced intervals, and then the `resample` method is used to resample these segmented data to ensure a uniform distribution of the data over time. This serialized time series dataset is formatted into a data structure that includes the average water quality parameters for each time period, providing a homogenized and standardized data foundation for subsequent nonlinear dynamic analysis.

[0111] In substep S402, based on the serialized time-series dataset, a nonlinear dynamics analysis method is employed to deeply analyze the dynamic properties of water quality changes. The Lyapunov exponent is calculated, and the `lyap_r` function from the `nolds` library is used to quantify the uncertainty of water quality changes and the degree of chaos in the system. An embedding dimension of 3 and a delay time of 1 are set to construct a phase space reconstruction of the time series, and the optimal delay time is calculated using the `delay` method to optimize the phase space representation of the time-series data. This step reveals the inherent nonlinear dynamic characteristics of the water quality time-series data, providing a new perspective and in-depth analysis for understanding water quality changes, and generating analytical results including nonlinear dynamic characteristics, such as the predictive complexity and sensitivity assessment of the system.

[0112] In substep S403, a water quality change trend prediction model was constructed based on the nonlinear dynamics characteristic analysis results. Using the random forest algorithm, the RandomForestRegressor class in sklearn.ensemble was called, setting the number of trees to 100 and the maximum depth to 10 to build the water quality change prediction model. Cross-validation was employed, using the cross_val_score function in sklearn.model_selection with a fold count of 5 to optimize the model parameters and evaluate the prediction accuracy. This method not only utilizes the nonlinear dynamics characteristics of water quality time series but also combines the powerful predictive capabilities of machine learning to generate prediction results for water quality change trends. These prediction results provide scientifically analyzed future change trends for water quality management, contributing to the development of more effective water quality monitoring and management strategies.

[0113] Consider a scenario involving automated water quality monitoring and analysis of a river flowing through a city, with the analysis period covering one month in spring. Daily average values ​​of water temperature (°C), pH, dissolved oxygen (mg / L), and turbidity (NTU) are included. During this period, monitoring data show water temperatures from upstream to downstream as follows: 15°C, 17°C, 19°C, 20°C, 21°C; pH values ​​as follows: 7.0, 7.2, 7.4, 7.6, 7.8; dissolved oxygen values ​​as follows: 12 mg / L, 10 mg / L, 8 mg / L, 7 mg / L, 5 mg / L; and turbidity values ​​as follows: 10 NTU, 15 NTU, 20 NTU, 25 NTU, 30 NTU. Using a nonlinear dynamic analysis method, the time-series data is first serialized and resampled to ensure data uniformity. Subsequently, the Lyapunov exponent is calculated with an embedding dimension of 3 and a delay time of 1, revealing the uncertainty of water quality changes and the chaotic characteristics of the system. Based on these nonlinear dynamic characteristics, a water quality change trend prediction model was constructed using the random forest algorithm. The model was set with 100 trees and a maximum depth of 10, and the model parameters and prediction accuracy were optimized using a 5-fold cross-validation method. The generated water quality change trend prediction results indicate that in the next month, water temperature will continue to gradually rise downstream, pH will maintain a slow upward trend, while dissolved oxygen will continue to decline due to rising water temperature and potential increase in organic pollution. Turbidity will also increase due to the arrival of the rainy season and increased agricultural activities upstream.

[0114] Please see Figure 6 Based on the predicted water quality change trends, random forests and neural networks are used to dynamically adjust the sampling frequency and monitoring point layout. By analyzing the predicted water quality changes and current monitoring data, key monitoring areas and times are automatically identified, and the specific steps for generating optimized monitoring strategies are as follows:

[0115] S501: Based on the prediction results of water quality change trends, real-time monitoring data and historical prediction data are integrated, and the data are merged using the pandas.concat function in Python. The parameter axis=0 is adjusted to stack the data vertically to generate a comprehensive water quality monitoring dataset.

[0116] S502: Based on the comprehensive water quality monitoring dataset, the importance analysis is performed using the random forest algorithm. The model is built from the sklearn.ensemble module using RandomForestClassifier. n_estimators=100 defines the number of trees, and max_depth=10 controls the maximum depth of the trees. The importance of each monitoring point to the water quality change is evaluated through the trained model, and the monitoring point importance evaluation results are generated.

[0117] S503: Based on the assessment results of the importance of monitoring points, a neural network model is used to adjust the monitoring strategy. The neural network is built from keras.models using the Sequential model, with Dense(64, activation=relu) layers added to process features. The optimizer is adam, and the loss function is mean_squared_error. The sampling frequency and the layout of monitoring points are dynamically adjusted according to the model prediction results, so that the monitoring strategy can cope with the dynamic needs of water quality changes and generate the optimized monitoring strategy results.

[0118] In substep S501, a comprehensive water quality monitoring dataset is constructed by integrating real-time monitoring data with historical forecast data. This process utilizes the `concat` function from Python's pandas library to vertically stack newly collected real-time monitoring data and existing historical forecast data (axis=0) to maintain data continuity over time. The data format includes timestamps, monitoring point locations, and measured values ​​of various water quality parameters, such as temperature, pH, dissolved oxygen, and turbidity. Finally, a comprehensive dataset is generated, containing complete and wide-ranging time-series water quality monitoring data, providing a foundation for subsequent analysis.

[0119] In substep S502, based on the generated integrated water quality monitoring dataset, a random forest algorithm is used to analyze the importance of monitoring points. This analysis is implemented by calling the `RandomForestClassifier` class from the `sklearn.ensemble` module, where the `n_estimators` parameter is set to 100 to define the number of trees, and the `max_depth` parameter is set to 10 to control the maximum depth of the trees. Through model training, the algorithm evaluates the importance of each monitoring point to water quality changes and generates monitoring point importance assessment results. These results help identify monitoring points with a key impact on the overall water quality change trend, providing a basis for optimizing the monitoring network.

[0120] In sub-step S503, a neural network model is used to adjust the monitoring strategy based on the assessment results of the monitoring point importance. The neural network is built using the Sequential model from the Keras library, with a Dense layer added and ReLU activation function selected to handle features. The optimizer is Adam, and the loss function is mean_squared_error, trained on a model predicting water quality change trends. Based on the model's prediction results, the sampling frequency and monitoring point layout are dynamically adjusted to ensure the monitoring strategy can flexibly respond to the dynamic needs of water quality changes. Finally, the optimized monitoring strategy results are generated, effectively improving the efficiency and responsiveness of the water quality monitoring network, ensuring that key areas and times receive focused attention, and providing more scientific and rational decision support for water quality management.

[0121] Suppose a water quality monitoring project on a suburban river collects a series of detailed data items, including water temperature (°C), pH, dissolved oxygen (mg / L), turbidity (NTU), and the concentration of a specific organic compound (μg / L). During a quarterly monitoring period, simulated data shows that water temperature gradually increases from upstream to downstream, from 14°C to 20°C; pH fluctuates between 7.0 and 8.5; dissolved oxygen decreases from 12 mg / L to 6 mg / L; turbidity increases from 10 NTU to 50 NTU; and the concentration of the specific organic compound peaks at the downstream monitoring point, increasing from 5 μg / L to 30 μg / L. Based on this data, a random forest algorithm is applied to analyze the importance of data at each monitoring point, confirming that the downstream area, due to receiving urban emissions, has the most significant impact on water quality changes. Subsequently, using a constructed neural network model, the monitoring strategy is automatically adjusted based on existing water quality trend predictions and real-time monitoring data. The adjustment results indicate that, to more effectively monitor and manage water quality, it is necessary to increase the monitoring frequency in the downstream area and add monitoring points in areas with abnormally high concentrations of the specific organic compound.

[0122] Please see Figure 7 Based on the optimization results of the monitoring strategy, the coefficient of variation method is used to evaluate the variability of water quality parameters. By calculating the coefficient of variation of each parameter and assigning weights, the parameters with the greatest impact on water quality changes are identified, and the specific steps for generating the water quality parameter importance assessment results are as follows:

[0123] S601: Based on the optimization results of the monitoring strategy, collect and organize the water quality parameter data of each monitoring point, and use a Python script to execute the pandas.DataFrame.loc method on the dataset to locate and extract the key water quality parameter data of the specified monitoring point and time range, and generate a water quality parameter dataset;

[0124] S602: Based on the water quality parameter dataset, calculate the coefficient of variation for each parameter, calculate the standard deviation using Python's numpy.std function, obtain the mean using the numpy.mean function, and calculate the coefficient of variation using the formula CV = (standard deviation / mean) × 100%, reflecting the magnitude of parameter change during the monitoring period, and generate parameter coefficient of variation results;

[0125] S603: Based on the parameter coefficient of variation results, water quality parameters are rated for importance. Each parameter is assigned a weight according to the magnitude of the coefficient of variation. The higher the coefficient of variation of a parameter, the more significant its role in monitoring water quality changes. The contribution of parameters to water quality changes is comprehensively evaluated through a weighted method. The parameter with the most significant impact on water quality changes is selected, and the water quality parameter importance assessment results are generated.

[0126] In substep S601, the `DataFrame.loc` method of the pandas library in Python is used to locate and extract water quality parameter data collected at each monitoring point. The dataset mainly contains date and time, monitoring point identification, and measured values ​​of various water quality parameters (such as dissolved oxygen, pH, and turbidity). This ensures accurate selection of data relevant to the monitoring strategy optimization results within a specific time range from a broad monitoring database, providing an accurate foundational dataset for subsequent analysis and generating a detailed dataset file containing key water quality parameters.

[0127] In substep S602, the standard deviation and mean of each water quality parameter are calculated using the `std` and `mean` functions from Python's NumPy library, and then the coefficient of variation (CV) for each parameter is calculated. The formula for the coefficient of variation is CV = (standard deviation / mean) × 100%, which aims to quantify the magnitude of change of each water quality parameter during the monitoring period. Finally, a result file containing the coefficients of variation for each water quality parameter is generated, intuitively reflecting the stability or volatility of different parameters during the monitoring period, providing a quantitative basis for assessing the importance of parameters in evaluating water quality changes.

[0128] In substep S603, the importance of water quality parameters is assessed based on the coefficient of variation calculated in the previous step. By analyzing the magnitude of the coefficient of variation, a weight is assigned to each parameter, based on the relative level of its coefficient of variation. A higher coefficient of variation indicates a greater magnitude of change during the monitoring period, thus indicating a more significant role in monitoring water quality changes. Finally, a weighted comprehensive method is used to select the parameters most significantly affecting water quality changes, and a water quality parameter importance assessment result document is generated. This provides crucial information for further optimization of monitoring point layout and sampling frequency, helping decision-makers identify and focus on the parameters with the greatest impact on water quality changes, and optimize water quality monitoring and management strategies.

[0129] Imagine an automated water quality monitoring and analysis scenario for a river flowing through a city. The monitoring period is spring 2024, with 10 monitoring points distributed from upstream to downstream. Detailed data include water temperature (average 15℃, ranging from 10℃ to 20℃), pH (average 7.5, ranging from 7 to 8), dissolved oxygen (average 8 mg / L, ranging from 5 mg / L to 11 mg / L), turbidity (average 30 NTU, ranging from 10 NTU to 50 NTU), and specific organic matter concentration (average 25 μg / L, ranging from 10 μg / L to 40 μg / L). Real-time and historical water quality monitoring data were integrated using data fusion technology. Then, finite element analysis and Kalman filtering algorithms were used to simulate and predict the river's flow characteristics, hydrodynamics, and spatial distribution. Stable isotope analysis revealed potential sources of water quality changes, while a dynamic time-warping algorithm helped identify patterns in water quality parameter changes over time. Nonlinear dynamics methods were used to analyze water quality change trends in depth and predict future trends. Finally, random forest and neural network algorithms were used to optimize sampling frequency and monitoring point layout, ensuring that monitoring resources were concentrated in key areas and at key times. The variability of water quality parameters was assessed using the coefficient of variation method, identifying specific organic matter concentration and dissolved oxygen as the parameters most significantly affecting water quality changes.

[0130] Please see Figure 8 Based on integrated water quality dynamics and spatial distribution prediction results, water source and pollution source tracing results, water quality time series matching results, water quality change trend prediction results, monitoring strategy optimization results, and water quality parameter importance assessment results, multiple linear regression analysis is used to examine the decision-making basis of the entire data processing process and monitoring strategy, assisting in the identification of key data indicators, so that the focus of monitoring activities can respond to the needs of water quality changes. The specific steps for generating strategy adjustment and optimization schemes are as follows:

[0131] S701: Based on the integrated water quality dynamics and spatial distribution prediction results, water source and pollution source tracking results, water quality time series matching results, water quality change trend prediction results, monitoring strategy optimization results, and water quality parameter importance assessment results, the data is organized, and the data frames are merged along axis=0 using the concat method of the pandas library in Python script, so that each data item is arranged in time order, and a comprehensive analysis dataset is generated.

[0132] S702: Based on the comprehensive analysis dataset, perform multiple linear regression analysis, use the OLS class of statsmodels.api to create a regression model, take the monitoring strategy as the dependent variable, and take the water quality dynamic parameters, isotope analysis results, time series matching characteristics, trend prediction values ​​and the importance of monitoring points as independent variables. Train the model by adjusting the parameters in the fit method, analyze the degree of influence of independent variables on dependent variables, and generate multiple regression analysis results.

[0133] S703: Based on the results of multiple regression analysis, identify the most critical factors for adjusting the monitoring strategy, analyze the coefficients and p-values ​​of the independent variables in the model, select the monitoring indicators that have the greatest impact on the water quality monitoring strategy, and adjust the sampling frequency, monitoring point layout and parameter monitoring focus according to the key indicators, so that the monitoring strategy can respond to the current needs of water quality changes and generate strategy adjustment and optimization plans.

[0134] In substep S701, data from different monitoring stages and technical methods are comprehensively organized to form a comprehensive analytical foundation. First, using Python's pandas library, particularly the `concat` method, datasets from hydrodynamic prediction, isotope analysis results, time series matching results, trend prediction, and monitoring strategy optimization are merged. This operation ensures data consistency and temporal sequence, laying the foundation for subsequent in-depth analysis. Data format standardization ensures all datasets are aligned on the timeline, facilitating multiple linear regression analysis.

[0135] In substep S702, multiple linear regression analysis is performed to delve into the relationships between the data. Using the OLS class of the statsmodels.api, a regression model is constructed with the monitoring strategy as the dependent variable and water quality dynamic parameters, isotope analysis results, time series matching characteristics, trend predictions, and the importance of monitoring points as independent variables. By adjusting the parameters in the fit method, not only is the model trained, but the actual impact of each independent variable on the monitoring strategy is also analyzed, generating detailed regression analysis results. This step provides a scientific basis for decision-making and reveals the key factors influencing the adjustment of monitoring strategies.

[0136] In sub-step S703, a thorough analysis of the multiple regression analysis results identified the most critical factors for adjusting the monitoring strategy. The coefficients and p-values ​​of each independent variable in the model were analyzed, thus determining the key indicators affecting the adjustment of the water quality monitoring strategy. Based on these key indicators, the sampling frequency, monitoring point layout, and focus of parameter monitoring were adjusted to ensure that the monitoring strategy can sensitively respond to the real-time needs of water quality changes. This step generated specific strategy adjustment and optimization schemes, achieving precise positioning of monitoring activities and efficient allocation of resources, thereby improving the pertinence and effectiveness of water quality monitoring and management.

[0137] In a simulated river environment, water quality data were collected from 30 different monitoring points in the upper, middle, and lower reaches of a river, including parameters such as dissolved oxygen (6-12 mg / L), pH (6.5-8.5), and turbidity (5-100 NTU). Each monitoring point was sampled four times daily for one month to collect sufficient data for analysis. Data fusion technology was used to integrate real-time and historical water quality monitoring data from different monitoring points, and the river's flow characteristics were simulated using finite element analysis. Furthermore, a Kalman filter algorithm was applied to perform a weighted average of the collected data, generating integrated water quality dynamics and spatial distribution prediction results. For example, the simulation results showed a trend of pollution diffusion in the downstream area during the rainy season, and the flow velocity change map revealed possible diffusion paths of pollutants. Stable isotope analysis was used to determine the isotopic ratios of hydrogen and oxygen in the water samples, successfully tracing the water quality source and identifying potential agricultural pollution sources. Isotope ratio data showed that the δ¹⁸O value of the water samples in the downstream area changed significantly compared to the upstream area, pointing to agricultural runoff as one of the main pollution sources. A dynamic time-warping algorithm was used to analyze water quality time-series data, identifying patterns of water quality parameter changes over time. Water quality trend predictions revealed a risk that dissolved oxygen in the downstream area might drop below standard levels within the next week. Random forests and neural networks were used to dynamically adjust the monitoring strategy, optimizing the layout of monitoring sites and sampling frequency. For example, the prediction results guided an increase in the monitoring frequency in the downstream area from four times a day to six times a day, and two new monitoring sites were added to more accurately monitor pollutant dispersion.

[0138] Please see Figure 9 An automatic monitoring and analysis system for river water quality, the system includes a data integration module, a flow simulation module, an isotope identification module, a time series matching module, a trend prediction module, a strategy adjustment module, a parameter evaluation module, and a decision analysis module;

[0139] The data integration module is based on real-time and historical water quality monitoring data. It uses data integration technology and Python's pandas library to perform data merging operations. It combines the merge and concat methods to unify the datasets from multiple monitoring stations and applies the dropna function to remove any missing values ​​in the dataset to generate a comprehensive dataset.

[0140] The flow simulation module is based on a comprehensive dataset and uses the finite element method to simulate the flow characteristics of river water. It uses ANSYS Fluent software to set simulation parameters, including the inlet velocity of the fluid, boundary conditions and initial flow configuration, and performs dynamic fluid simulation to predict the behavior and trend of water flow, generating flow simulation results.

[0141] The isotope identification module performs stable isotope analysis based on the flow simulation results, uses Isodat software to process water sample data, determines the isotope ratio of hydrogen and oxygen, identifies water quality sources and pollution sources, including mass spectrometry calibration of raw data, isotope ratio calculation, and generates isotope identification results.

[0142] The time series matching module is based on isotope identification results and uses a dynamic time warping algorithm to analyze water quality time series. It uses the dtaidistance library in Python to capture the optimal matching path between series, adjusts the time warp to reveal the change pattern of water quality parameters over time, and generates time series matching results.

[0143] The trend prediction module uses nonlinear dynamics and random forest models to predict water quality trends based on time series matching results. It combines Python's sklearn.ensemble library for trend analysis, sets the number and depth of trees, analyzes potential trends and risk events of water quality changes, and generates trend prediction results.

[0144] The strategy adjustment module intelligently adjusts the layout of monitoring points and sampling frequency based on trend prediction results, combined with random forest and neural network technologies. It uses keras.models.Sequential to build a model, analyzes the difference between predicted data and monitoring data, automatically optimizes the monitoring strategy, and focuses on monitoring key areas and times, generating monitoring strategy adjustment results.

[0145] Based on the monitoring strategy adjustment results, the parameter evaluation module performs coefficient of variation analysis, calculates the coefficient of variation of water quality parameters using Python's numpy library, assigns weights to each parameter, identifies the parameters with the greatest impact on water quality changes, and generates parameter importance assessment results.

[0146] The decision analysis module, based on flow simulation results, isotope identification results, time series matching results, trend prediction results, monitoring strategy adjustment results, and parameter importance assessment results, employs multiple linear regression analysis and uses statsmodels.api.OLS to perform data analysis, evaluate the contribution of each factor to the monitoring strategy, assist in formulating monitoring strategies and management decisions, and generate a comprehensive decision support solution.

[0147] The data integration module efficiently merges data from multiple monitoring stations, removes missing values, and performs standardization, providing an accurate and unified foundational dataset for the entire system. This step ensures the reliability and effectiveness of subsequent analyses and reduces the impact of data noise on the results.

[0148] The flow simulation module uses the finite element method to perform detailed simulations of water flow characteristics, providing a deep understanding of water flow behavior and pollutant diffusion paths. This is crucial for identifying pollution sources and assessing the extent of pollutant diffusion, and helps in accurately locating monitoring points and optimizing monitoring strategies.

[0149] The isotope identification module performs stable isotope analysis, enabling the tracing of water sources and the identification of pollution origins. This function enhances the source tracing capabilities of water quality monitoring, providing crucial information for determining the source and type of pollutants, and helping to develop more effective pollution prevention and control measures.

[0150] The time series matching module employs a dynamic time warping algorithm to accurately match the changing patterns of water quality parameters over time. This module enables the effective identification and analysis of water quality change trends even when sampling frequencies are inconsistent, providing support for early warning and risk assessment.

[0151] The trend prediction module combines nonlinear dynamics methods and machine learning models to predict future water quality trends. This module enhances the foresight and proactivity of water quality management, enabling management decisions to be based on scientific predictions of future water quality changes.

[0152] The strategy adjustment module intelligently adjusts the layout of monitoring points and sampling frequency by analyzing forecast results and current monitoring data. The implementation of this module improves the efficiency of monitoring resource utilization, ensures that key areas and times are monitored effectively, and enhances the response speed and accuracy of the monitoring strategy.

[0153] The parameter evaluation module uses coefficient of variation analysis to identify the most critical parameters affecting water quality changes, improving the relevance of monitoring data analysis. By assigning weights to each parameter, this module optimizes the allocation of monitoring resources, enhancing the effectiveness and efficiency of monitoring activities.

[0154] The decision analysis module integrates all analysis results and uses multiple linear regression analysis to assess the impact of various factors on monitoring strategies, providing comprehensive data support for formulating scientific monitoring strategies and management decisions. The implementation of this module enhances the scientific rigor and effectiveness of water quality management, providing strong decision support for ensuring water resource security.

[0155] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. An automatic monitoring and analysis method for river water quality, characterized in that, Includes the following steps: Based on real-time and historical water quality monitoring data, data fusion technology is used to integrate multi-source monitoring information, and finite element analysis method is applied to simulate the flow characteristics of river water. By implementing the Kalman filter algorithm, the data collected at multiple time points are weighted and averaged to generate integrated water quality dynamics and spatial distribution prediction results. Based on the integrated water quality dynamics and spatial distribution prediction results, the stable isotope analysis method is used to determine the isotope ratio of hydrogen and oxygen in the water sample, trace the source of water quality and identify potential pollution sources, and generate water source and pollution source tracking results. Based on the water source and pollution source tracking results, the dynamic time warp algorithm is used to analyze the collected water quality time series data. By measuring and adjusting the differences between time series, the matching path is optimized, the pattern of water quality parameter change over time is identified, and water quality time series matching results are generated. Based on the water quality time series matching results, a nonlinear dynamics method is used to analyze the water quality change trend. By constructing a dynamic model, the sensitivity of water quality changes is analyzed and potential nonlinear changes are predicted, generating water quality change trend prediction results. Based on the predicted water quality change trend, random forest and neural network are used to dynamically adjust the sampling frequency and monitoring point layout. By analyzing the predicted water quality change and current monitoring data, key monitoring areas and times are automatically identified, and monitoring strategy optimization results are generated. Based on the optimization results of the monitoring strategy, the coefficient of variation method is used to evaluate the variability of water quality parameters. By calculating the coefficient of variation of each parameter and assigning weights, the parameters with the greatest impact on water quality changes are identified, and the importance assessment results of water quality parameters are generated. Based on the integrated water quality dynamics and spatial distribution prediction results, water source and pollution source tracking results, water quality time series matching results, water quality change trend prediction results, monitoring strategy optimization results, and water quality parameter importance assessment results, multiple linear regression analysis is used to examine the decision-making basis of the entire data processing process and monitoring strategy, assist in identifying key data indicators, and enable the focus of monitoring activities to respond to the needs of water quality changes, thereby generating strategy adjustment and optimization schemes.

2. The automatic monitoring and analysis method for river water quality according to claim 1, characterized in that: The integrated water quality dynamics and spatial distribution prediction results include flow velocity change maps of key river basins, water quality distribution prediction tables for key sections, and pollution diffusion range prediction maps. The water source and pollution source tracing results include hydrogen and oxygen isotope composition maps of specified water samples, inferred water source maps, and lists of potential pollution source distributions. The water quality time series matching results include time variation curves of key water quality parameters, records of abnormal fluctuation events, and periodic change analysis. The water quality change trend prediction results include predicted water quality parameter change trend maps, early warning indicators for potential risk events, and confidence interval estimates for future changes. The monitoring strategy optimization results include adjusted monitoring point layout schemes, optimized sampling schedules, and screening criteria for parameters of interest. The water quality parameter importance assessment results include parameter influence rankings, weight allocation of key monitoring indicators, and quantitative analysis of their impact on the monitoring strategy. The strategy adjustment and optimization schemes include monitoring process improvement plans based on data analysis, optimization strategies for key decision points, and measures to improve monitoring efficiency.

3. The automatic monitoring and analysis method for river water quality according to claim 1, characterized in that: Based on real-time and historical water quality monitoring data, data fusion technology is used to integrate multi-source monitoring information, and the finite element analysis method is applied to simulate the flow characteristics of river water. By implementing the Kalman filter algorithm, the data collected at multiple time points are weighted and averaged to generate integrated water quality dynamics and spatial distribution prediction results. The specific steps are as follows: Based on real-time and historical water quality monitoring data, the pandas.merge method in Python was used to merge datasets from multiple monitoring stations, the pandas.DataFrame.dropna method was used to remove missing values, and sklearn.preprocessing.StandardScaler was used to standardize the data, converting the multi-scale monitoring data into a unified standard form and generating a standardized monitoring dataset. Based on the standardized monitoring dataset, the finite element analysis method was used to simulate the flow characteristics of the river. The FLUENT module in ANSYS software was used to define the river geometry model and mesh generation, set boundary conditions including inlet velocity and outlet pressure, select pressure-based solver to simulate the flow field, and adjust the solution parameters including time step and number of iterations to generate river dynamics simulation results. Based on the river dynamics simulation results, the Kalman filter algorithm is used to perform weighted averaging on the data. The initial state estimate and error covariance are set using the kalman function in MATLAB. The filter parameters, including measurement noise and process noise covariance, are adjusted according to the real-time updated monitoring data. The prediction model is dynamically optimized to generate integrated water quality dynamics and spatial distribution prediction results.

4. The automatic monitoring and analysis method for river water quality according to claim 1, characterized in that: Based on the integrated water quality dynamics and spatial distribution prediction results, the stable isotope analysis method is used to determine the isotopic ratio of hydrogen and oxygen in the water sample, trace the source of water quality and identify potential pollution sources, and generate water source and pollution source tracing results. The specific steps are as follows: Based on the integrated water quality dynamics and spatial distribution prediction results, a water sampling plan is formulated. Key sampling points of the river are selected using GIS software. The locations of the points are selected according to the river's flow pattern and potential pollution diffusion areas, covering the entire river from upstream to downstream, and a water sampling strategy map is generated. Based on the water sample collection strategy map, the stable isotope ratio is calculated and analyzed. Isodat software is used to calibrate and analyze the raw isotope ratio data generated by the mass spectrometer, and automatically correct instrument drift and background noise. The isotope ratios of hydrogen and oxygen in the water sample, including δD and δ¹⁸O, are calculated. By setting algorithm parameters, the analysis results are made consistent, and a preliminary isotope characteristic dataset is generated. Based on the preliminary isotope feature dataset, Iso-Analyze software was used to trace water sources and identify pollution sources. The imported hydrogen and oxygen isotope ratios were analyzed, and the standard values ​​in the international isotope ratio database were compared using a built-in algorithm. Geospatial analysis was performed to plot the distribution of isotope data on a map. Clustering algorithms were used to identify the locations of specified water sources and potential pollution sources, generating water source and pollution source tracing results.

5. The automatic monitoring and analysis method for river water quality according to claim 1, characterized in that: Based on the water source and pollution source tracing results, a dynamic time warp algorithm is used to analyze the collected water quality time series data. By measuring and adjusting the differences between time series, the matching path is optimized, the pattern of water quality parameter changes over time is identified, and the specific steps for generating water quality time series matching results are as follows: Based on the water source and pollution source tracking results, the monitoring point data associated with the tracking results are screened, and SQL queries are executed using Python scripts to extract historical water quality data of the monitoring points from the database, so that the selected dataset can reflect the water quality change trend of the river from upstream to downstream, and generate a water quality time series dataset. Based on the water quality time series dataset, the dynamic time warp algorithm is used for analysis. The dtw function is called through the dtaidistance library in the Python environment. The window parameter is set to 10% of the sequence length to limit the search range. The distance_metric is selected to measure the similarity between Euclidean distances. The algorithm captures the best matching path between multiple time series data, processes the nonlinear deformation of the time series, and generates an optimized time series matching path. Based on the optimized time series matching path, water quality change patterns are identified, and the data is visualized using the matplotlib library to plot the changing trends of water quality parameters at multiple time points. Water quality change patterns, including periodic changes and abnormal fluctuations, are identified, revealing the inherent laws of water quality changes and generating water quality time series matching results.

6. The automatic monitoring and analysis method for river water quality according to claim 1, characterized in that: Based on the water quality time series matching results, a nonlinear dynamics method is used to analyze the water quality change trend. By constructing a dynamic model, the sensitivity of water quality changes is analyzed and potential nonlinear changes are predicted. The specific steps for generating water quality change trend prediction results are as follows: Based on the water quality time series matching results, data serialization processing is performed, including time series segmentation and resampling. The continuous time series data is segmented according to time windows using the pandas.cut method of Python, with each segment representing the average water quality status of a time interval. The pandas.resample method is used to resample the segmented data to generate a serialized time series dataset. Based on the serialized time series dataset, a nonlinear dynamic analysis method is used to analyze water quality changes. This includes using nolds.lyap_r to calculate the Lyapunov index, setting the embedding dimension to 3 and the delay time to 1, quantifying the uncertainty of water quality changes and the complexity of prediction. Phase space reconstruction is performed by calculating the embedding dimension and delay of the time series, using the delay method in the nolds library to calculate the optimal delay time based on the given time series data, and generating nonlinear dynamic feature analysis results. Based on the nonlinear dynamics characteristic analysis results, a water quality change trend prediction model was constructed. The random forest algorithm was used with sklearn.ensemble.RandomForestRegressor, with the number of trees set to 100 and the maximum depth to 10. The cross-validation method sklearn.model_selection.cross_val_score was used with a fold count of 5 to optimize the model parameters and prediction accuracy, and the water quality change trend prediction results were generated.

7. The automatic monitoring and analysis method for river water quality according to claim 1, characterized in that: Based on the predicted water quality change trends, random forests and neural networks are used to dynamically adjust the sampling frequency and monitoring point layout. By analyzing the predicted water quality changes and current monitoring data, key monitoring areas and times are automatically identified, and the specific steps for generating optimized monitoring strategies are as follows: Based on the predicted water quality change trend, real-time monitoring data and historical prediction data are integrated, and the data are merged using the pandas.concat function in Python. The parameter axis=0 is adjusted to stack the data vertically, generating a comprehensive water quality monitoring dataset. Based on the comprehensive water quality monitoring dataset, the importance analysis was performed using the random forest algorithm. The model was built from the sklearn.ensemble module using RandomForestClassifier, with n_estimators=100 defining the number of trees and max_depth=10 controlling the maximum depth of the trees. The importance of each monitoring point to water quality changes was evaluated using the trained model, and the monitoring point importance evaluation results were generated. Based on the importance assessment results of the monitoring points, a neural network model is used to adjust the monitoring strategy. The neural network is built from keras.models using the Sequential model, with Dense(64, activation=relu) layers added to process features. The optimizer is adam, and the loss function is mean_squared_error. The sampling frequency and the layout of monitoring points are dynamically adjusted according to the model prediction results, so that the monitoring strategy can cope with the dynamic needs of water quality changes and generate the optimized monitoring strategy results.

8. The automatic monitoring and analysis method for river water quality according to claim 1, characterized in that: Based on the optimization results of the monitoring strategy, the coefficient of variation method is used to evaluate the variability of water quality parameters. By calculating the coefficient of variation of each parameter and assigning weights, the parameters with the greatest impact on water quality changes are identified, and the specific steps for generating the water quality parameter importance assessment results are as follows: Based on the optimization results of the monitoring strategy, water quality parameter data for each monitoring point are collected and organized. The pandas.DataFrame.loc method is executed on the dataset using a Python script to locate and extract key water quality parameter data for the specified monitoring points and time range, thereby generating a water quality parameter dataset. Based on the water quality parameter dataset, the coefficient of variation for each parameter is calculated. The standard deviation is calculated using the numpy.std function in Python, the mean is obtained using the numpy.mean function, and the coefficient of variation is calculated using the formula CV = (standard deviation / mean) × 100%. This reflects the magnitude of the parameter's change during the monitoring period, and the parameter coefficient of variation results are generated. Based on the coefficient of variation results of the parameters, the importance of water quality parameters is rated. Each parameter is assigned a weight according to the magnitude of its coefficient of variation. The higher the coefficient of variation of a parameter, the more significant its role in monitoring water quality changes. The contribution of parameters to water quality changes is comprehensively evaluated through a weighted method. The parameter with the most significant impact on water quality changes is selected, and the importance assessment results of water quality parameters are generated.

9. The automatic monitoring and analysis method for river water quality according to claim 1, characterized in that: Based on the integrated water quality dynamics and spatial distribution prediction results, water source and pollution source tracing results, water quality time series matching results, water quality change trend prediction results, monitoring strategy optimization results, and water quality parameter importance assessment results, multiple linear regression analysis is used to verify the decision-making basis of the entire data processing process and monitoring strategy, assisting in the identification of key data indicators, so that the focus of monitoring activities can respond to the needs of water quality changes. The specific steps for generating strategy adjustment and optimization schemes are as follows: Based on the integrated water quality dynamics and spatial distribution prediction results, water source and pollution source tracking results, water quality time series matching results, water quality change trend prediction results, monitoring strategy optimization results, and water quality parameter importance assessment results, the data is organized, and the data frames are merged along axis=0 using the concat method of the pandas library in Python script, so that each data item is arranged in time order, generating a comprehensive analysis dataset; Based on the comprehensive analysis dataset, a multiple linear regression analysis was performed. A regression model was created using the OLS class of statsmodels.api, with the monitoring strategy as the dependent variable and water quality dynamic parameters, isotope analysis results, time series matching characteristics, trend prediction values, and the importance of monitoring points as independent variables. The model was trained by adjusting the parameters in the fit method, and the influence of the independent variables on the dependent variable was analyzed to generate the multiple regression analysis results. Based on the results of the multiple regression analysis, the most critical factors for adjusting the monitoring strategy are identified, the coefficients and p-values ​​of the independent variables in the model are analyzed, the monitoring indicators that have the greatest impact on the water quality monitoring strategy are selected, and the sampling frequency, monitoring point layout and parameter monitoring focus are adjusted according to the key indicators so that the monitoring strategy can respond to the current needs of water quality changes and generate strategy adjustment and optimization schemes.

10. An automatic river water quality monitoring and analysis system, characterized in that, The automatic monitoring and analysis method for river water quality according to any one of claims 1-9 is implemented, wherein the system includes a data integration module, a flow regime simulation module, an isotope identification module, a time series matching module, a trend prediction module, a strategy adjustment module, a parameter evaluation module, and a decision analysis module; The data integration module is based on real-time and historical water quality monitoring data. It uses data integration technology and Python's pandas library to perform data merging operations. It combines the merge and concat methods to unify the datasets from multiple monitoring stations and applies the dropna function to remove any missing values ​​from the dataset to generate a comprehensive dataset. The flow simulation module is based on a comprehensive dataset and uses the finite element method to simulate the flow characteristics of river water. It uses ANSYS Fluent software to set simulation parameters, including the inlet velocity of the fluid, boundary conditions and initial flow configuration, and performs dynamic fluid simulation to predict the behavior and changing trend of the water flow, generating flow simulation results. The isotope identification module performs stable isotope analysis based on the flow simulation results, uses Isodat software to process water sample data, measures the isotope ratio of hydrogen and oxygen, identifies water quality sources and pollution sources, including mass spectrometry calibration of raw data, isotope ratio calculation, and generates isotope identification results. The time series matching module analyzes water quality time series based on isotope identification results and uses a dynamic time warp algorithm. It captures the optimal matching path between sequences using the dtaidistance library in Python, adjusts the time warp to reveal the change pattern of water quality parameters over time, and generates time series matching results. The trend prediction module uses nonlinear dynamics and random forest models to predict water quality trends based on time series matching results. It combines Python's sklearn.ensemble library for trend analysis, sets tree number and depth parameters, analyzes potential trends and risk events of water quality changes, and generates trend prediction results. The strategy adjustment module intelligently adjusts the layout of monitoring points and sampling frequency based on trend prediction results, combined with random forest and neural network technologies. It uses keras.models.Sequential to build a model, analyzes the difference between predicted data and monitoring data, automatically optimizes the monitoring strategy, and focuses on monitoring key areas and times, generating monitoring strategy adjustment results. The parameter evaluation module performs coefficient of variation analysis based on the monitoring strategy adjustment results. It calculates the coefficient of variation of water quality parameters using Python's numpy library, assigns weights to each parameter, identifies the parameters that have the greatest impact on water quality changes, and generates parameter importance evaluation results. The decision analysis module, based on flow simulation results, isotope identification results, time series matching results, trend prediction results, monitoring strategy adjustment results, and parameter importance assessment results, employs multiple linear regression analysis and uses statsmodels.api.OLS for data analysis to evaluate the contribution of each factor to the monitoring strategy, assist in formulating monitoring strategies and management decisions, and generate a comprehensive decision support scheme.

Citation Information

Cited By

  • Intelligent sensing-based cherax quadricarinatus fermented feed accurate feeding method and system

    CN122219159A