Intelligent water quality detection method and system based on Internet of Things

By dividing the water storage space inside the water tower into horizontal monitoring layers and deploying sensor groups, and using LoRa and LSTM models to predict water quality, the problems of insufficient spatial coverage and delayed response of the water quality detection system were solved, real-time monitoring and early warning of water quality were achieved, and the level of intelligence and refinement of water quality management was improved.

CN120761598APending Publication Date: 2025-10-10DERNTE (JIANGSU) ENVIRONMENTAL TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing water quality monitoring system has problems such as insufficient spatial distribution coverage, poor data reliability and stability, and delayed response to abnormal risks, making it difficult to achieve comprehensive monitoring and timely response to water bodies.

Method used

An intelligent water quality detection method based on the Internet of Things is adopted. By dividing the water storage space inside the water tower into horizontal monitoring layers along the vertical direction, a sensor group is deployed to obtain water quality parameters. The data is transmitted to the central processing system via LoRa for prediction model processing, and the sensor weights are dynamically adjusted. The LSTM model is used to predict water quality and send alarm information in a timely manner.

Benefits of technology

It realizes real-time monitoring and prediction of the water storage space inside the water tower, improves monitoring accuracy and response speed, can detect water quality anomalies in time to avoid losses, provides comprehensive data support, and improves management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120761598A_ABST
    Figure CN120761598A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent water quality detection method and system based on the Internet of Things, and the method comprises the steps: dividing a water storage space in a water tower into a plurality of horizontal monitoring layers which are the same in size and are communicated with one another in the vertical direction, arranging sensor groups in the communicated horizontal monitoring layers, and obtaining the water quality parameters of the water storage space in the water tower; the water quality parameters of the water storage space in the water tower are transmitted to a central processing system through LoRa, and a prediction model built in the central processing system processes the water quality parameters of the water storage space in the water tower; a water tower internal water storage space water quality prediction value is obtained after processing, whether the water quality prediction value exceeds a preset threshold value or not is calculated through a water tower internal water storage space water quality model, and if the water quality prediction value exceeds the preset threshold value, the central processing system sends alarm information to a water plant management terminal. By means of the method and the corresponding system, the intelligence of tap water quality detection is improved, manpower is greatly liberated, and abnormity of water quality parameters of the water storage space in the water tower can be predicted in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention proposes an intelligent water quality detection method and system based on the Internet of Things, and relates to the technical field of water quality detection. Background Art

[0002] With the rapid development of urbanization and residents' high attention to water quality safety, water quality testing has become an important technical means to ensure the safety of urban water supply systems and public health. Existing water quality testing mainly relies on laboratory sampling and analysis and limited online sensor points to achieve quality monitoring of water supply sources, distribution networks and end-user water. In practical applications, the existing online water quality monitoring system generally has the following technical defects: (1) Insufficient spatial distribution coverage: Most of the existing water quality monitoring points are single-point layouts, which makes it difficult to reflect the spatial distribution characteristics of complex water bodies. Affected by temperature stratification, water flow disturbances and bottom sediments, water quality parameters (such as residual chlorine, turbidity, dissolved oxygen, etc.) at different depths and different points often have significant differences. Single measurement point data can easily form a monitoring blind spot and cannot achieve a comprehensive reflection of water quality. (2) Poor data reliability and stability: Water quality online detection sensors work in high humidity, high corrosion and complex water environments for a long time, and are prone to electrode aging, reduced sensitivity, biofilm adhesion and other phenomena. For example, sensors for residual chlorine, conductivity, and turbidity often experience large measurement errors due to drift and contamination, and most existing monitoring systems lack dynamic automatic calibration and self-detection mechanisms, making it difficult to ensure the reliability of data during long-term operation. (3) Delayed response to abnormal risks: Traditional online water quality monitoring often uses a single variable or fixed threshold alarm mechanism (e.g., an alarm is triggered when the residual chlorine concentration falls below a certain limit), failing to fully consider multi-parameter comprehensive analysis and systematic risk prediction. This makes it difficult to detect and locate sudden water pollution or abnormal events in a timely manner, and creates risks such as delayed response and pollution leakage. Summary of the Invention

[0003] The present invention provides an intelligent water quality detection method and system based on the Internet of Things. Taking into account the accuracy and reliability of sensors, different sensors may have different accuracy and stability, so the quality of the data they provide may vary. In this case, weighted fusion is used to obtain the comprehensive water quality parameters of the water storage space inside the entire water tower, and the predicted environmental values ​​are input into the prediction model to check whether they exceed the threshold value, so as to solve the above-mentioned problems:

[0004] The present invention proposes an intelligent water quality detection method based on the Internet of Things, the method comprising:

[0005] The water storage space inside the water tower is divided vertically into several interconnected horizontal monitoring layers of equal volume. Sensor groups are deployed in each of the interconnected horizontal monitoring layers to obtain water quality parameters of the water storage space inside the water tower.

[0006] The water quality parameters of the water storage space inside the water tower are transmitted to the central processing system via LoRa, and the built-in prediction model of the central processing system processes the water quality parameters of the water storage space inside the water tower;

[0007] After processing, the water quality prediction value of the water storage space inside the water tower is obtained. The water quality model of the water storage space inside the water tower is used to calculate whether the water quality prediction value exceeds the preset threshold. If it exceeds the preset threshold, the central processing system sends an alarm message to the water plant management terminal.

[0008] Furthermore, an IoT-based intelligent water quality detection method divides the water storage space inside the water tower into several interconnected horizontal monitoring layers of equal volume along the vertical direction. Sensor groups are deployed in each of the interconnected horizontal monitoring layers to obtain water quality parameters of the water storage space inside the water tower, including:

[0009] The water storage space inside the water tower is divided into several interconnected horizontal monitoring layers along the vertical direction, and a sensor group is deployed in each of the interconnected horizontal monitoring layers. The sensor group includes a residual chlorine sensor, a turbidity sensor, a pH sensor, a conductivity sensor, a temperature sensor, and a water level sensor;

[0010] Collecting environmental factor data measured by the sensor group and preprocessing the environmental factor data, wherein the preprocessing includes filtering, denoising and smoothing;

[0011] After preprocessing, the weight of each sensor is dynamically adjusted based on the sensor performance evaluation results and environmental difference analysis;

[0012] The adjusted weights are used to perform weighted fusion on the sensor data of each area to obtain the water quality parameters of the water storage space inside the water tower.

[0013] Furthermore, an IoT-based intelligent water quality detection method dynamically adjusts the weight of each sensor based on sensor performance evaluation results and environmental difference analysis, including:

[0014] The sensor is placed in an environment with constant environmental parameters for testing, and the stability of the sensor is obtained by calculating the standard deviation of the sensor readings over a period of time;

[0015] The mean absolute error is used to calculate the accuracy evaluation value of the sensor, and the sensor performance evaluation result is obtained based on the stability and accuracy evaluation value of the sensor;

[0016] For each of the environmental factor data, calculate the difference between the data and the standard value, standardize the differences to the same scale, and combine multiple environmental factors to calculate the environmental difference coefficient;

[0017] The sensor weight is obtained according to the sensor performance evaluation results and the environmental difference coefficient.

[0018] Furthermore, an IoT-based intelligent water quality detection method transmits the water quality parameters of the water storage space inside the water tower to a central processing system via LoRa. The built-in prediction model of the central processing system processes the water quality parameters of the water storage space inside the water tower, including:

[0019] The central processing system obtains historical data of the sensor group and performs preliminary processing on the historical data of the sensor group. The preliminary processing includes data cleaning, data transformation and feature extraction. The feature extraction includes extracting statistical features and time series features from the original data. After the preliminary processing, the data is divided into a training set and a test set.

[0020] A water quality index prediction model for the water storage space inside the water tower is constructed by using a long short-term memory network (LSTM), and the water quality index prediction model for the water storage space inside the water tower is trained using a training set from the preliminarily processed data;

[0021] Using the test set in the preliminarily processed data to evaluate and verify the trained water quality index prediction model for the water storage space inside the water tower;

[0022] The water quality parameters of the water storage space inside the water tower are input into the water quality index prediction model of the water storage space inside the water tower to obtain the water quality prediction value of the water storage space inside the water tower.

[0023] Furthermore, an intelligent water quality detection method based on the Internet of Things obtains a predicted value of water quality of the water storage space inside the water tower after processing, calculates whether the predicted value of water quality of the water storage space inside the water tower exceeds a preset threshold through a water quality model of the water storage space inside the water tower, and if it exceeds the preset threshold, the central processing system sends an alarm message to the water plant management terminal, including:

[0024] The water quality prediction value is input into the water quality index model of the water storage space inside the water tower. The water quality model of the water storage space inside the water tower calculates whether the water quality prediction value exceeds the preset threshold. Specifically, the water quality model of the water storage space inside the water tower is

[0025]

[0026] Where CEI is the water quality index, n is the total number of parameters detected by the sensor, and w i is the weight of the i-th parameter, indicating the importance of the parameter to human health, P i is the normalized value of the i-th parameter, indicating the relative position between the current measured value of the parameter and its ideal range, e i is the exponential coefficient of the i-th parameter, which is used to adjust the influence of the parameter on the comprehensive index;

[0027] If the water quality prediction value of the water storage space inside the water tower exceeds a preset threshold, the central processing system sends an alarm message to the mobile device of the water quality inspector.

[0028] The present invention proposes an intelligent water quality detection system based on the Internet of Things, the system comprising:

[0029] The water tower internal water storage space monitoring module is used to divide the water tower internal water storage space into several horizontal monitoring layers of equal volume and interconnected along the vertical direction. Sensor groups are deployed in the interconnected horizontal monitoring layers to obtain water quality parameters of the water tower internal water storage space;

[0030] A module for predicting water quality parameters of the water storage space inside the water tower is used to transmit the water quality parameters of the water storage space inside the water tower to the central processing system via LoRa. The prediction model built into the central processing system processes the water quality parameters of the water storage space inside the water tower;

[0031] The alarm module is used to obtain the water quality prediction value of the water storage space inside the water tower after processing, and calculate whether the water quality prediction value exceeds the preset threshold through the water quality model of the water storage space inside the water tower. If it exceeds the preset threshold, the central processing system sends an alarm message to the water plant management terminal.

[0032] Furthermore, a water quality intelligent detection system based on the Internet of Things, the module for monitoring the water storage space inside the water tower includes:

[0033] Deployment of sensor group module, used to divide the water storage space inside the water tower into several horizontal monitoring layers of equal volume and interconnected along the vertical direction, and deploy sensor groups in each of the interconnected horizontal monitoring layers, the sensor groups including residual chlorine sensor, turbidity sensor, pH sensor, conductivity sensor, temperature sensor, and water level sensor;

[0034] A preprocessing module, configured to collect environmental factor data measured by the sensor group and perform preprocessing on the environmental factor data, wherein the preprocessing includes filtering, denoising, and smoothing;

[0035] Dynamic sensor weight adjustment module, which is used to dynamically adjust the weight of each sensor based on sensor performance evaluation results and environmental difference analysis after preprocessing;

[0036] The water quality parameter acquisition module of the water storage space inside the water tower is used to use the adjusted weights to perform weighted fusion on the sensor data of each area to obtain the water quality parameters of the water storage space inside the water tower.

[0037] Furthermore, in an intelligent water quality detection system based on the Internet of Things, the module for dynamically adjusting sensor weights includes:

[0038] The sensor stability acquisition module is used to test the sensor in an environment with constant environmental parameters and obtain the sensor stability by calculating the standard deviation of the sensor readings over a period of time;

[0039] A module for obtaining sensor performance evaluation results is used to calculate the accuracy evaluation value of the sensor using the mean absolute error, and obtain the sensor performance evaluation result according to the stability and accuracy evaluation value of the sensor;

[0040] An environmental difference coefficient acquisition module is used to calculate the difference between each environmental factor data and the standard value, standardize these differences to the same scale, and combine multiple environmental factors to calculate the environmental difference coefficient;

[0041] The sensor weight obtaining module is used to obtain the sensor weight according to the sensor performance evaluation result and the environmental difference coefficient.

[0042] Furthermore, in an intelligent water quality detection system based on the Internet of Things, the module for predicting water quality parameters of the water storage space inside the water tower includes:

[0043] A preliminary processing module is used for the central processing system to obtain historical data of the sensor group and perform preliminary processing on the historical data of the sensor group. The preliminary processing includes data cleaning, data transformation and feature extraction. The feature extraction includes extracting statistical features and time series features from the original data. After preliminary processing, the data is divided into a training set and a test set;

[0044] A training model module is used to construct a water quality index prediction model for the water storage space inside the water tower through a long short-term memory network (LSTM), and train the water quality index prediction model for the water storage space inside the water tower using a training set in the preliminarily processed data;

[0045] A testing module, for evaluating and verifying the trained water quality index prediction model for the water storage space inside the water tower using a test set in the preliminarily processed data;

[0046] The module for obtaining the water quality prediction value of the water storage space inside the water tower is used to input the water quality parameters of the water storage space inside the water tower into the water quality index prediction model of the water storage space inside the water tower to obtain the water quality prediction value of the water storage space inside the water tower.

[0047] Furthermore, in an intelligent water quality detection system based on the Internet of Things, the alarm module includes:

[0048] The module for calculating whether the water quality exceeds the preset threshold value is used to input the water quality prediction value into the water quality index model of the water storage space inside the water tower, and the water quality model of the water storage space inside the water tower calculates whether the water quality prediction value of the water storage space inside the water tower exceeds the preset threshold value.

[0049] The sending alarm information module is configured to send alarm information to the mobile device of the water quality inspector via the central processing system if the water quality prediction value of the water storage space inside the water tower exceeds the preset threshold.

[0050] The present application has the following advantages: through real-time monitoring and sensor data collection, the system can obtain water quality parameters in real time, and predict and evaluate the water storage space inside the water tower using a prediction model; the central processing system determines whether the water quality prediction value of the water storage space inside the water tower exceeds the preset threshold according to the preset water quality index model of the water storage space inside the water tower; once the prediction value exceeds the threshold, the system triggers an alarm mechanism; with the analysis of the intelligent prediction model, the system can timely discover water quality abnormalities and help the water quality inspector respond quickly to avoid losses caused by water quality abnormalities; the intelligent monitoring system can provide sufficient water quality data support to help the water quality inspector better understand the real-time situation of the water quality inside the water tower; with the intelligent prediction model and alarm mechanism, the system can accurately warn of water quality problems, which helps to avoid unexpected losses and improve monitoring efficiency; the monitoring accuracy and system response speed are improved, which helps to fine-tune the management of the water storage space inside the water tower; the intelligent water storage space monitoring system inside the water tower can realize real-time monitoring and prediction of water quality environmental changes and timely send alarm information, thereby helping the water quality inspector to timely adjust management measures and ensure the stability and health of the water storage space inside the water tower. BRIEF DESCRIPTION OF DRAWINGS

[0051] Figure 1 FIG. 1 is a schematic diagram of the water quality intelligent detection method based on the Internet of Things. DETAILED DESCRIPTION

[0052] The preferred embodiments of the present application are described below with reference to the accompanying drawings, and it should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application.

[0053] In one embodiment of the present application, a water quality intelligent detection method based on the Internet of Things, the method comprises:

[0054] The water storage space inside the water tower is divided into a plurality of horizontal monitoring layers with the same volume and interconnected in the vertical direction, and sensor groups are arranged in the interconnected horizontal monitoring layers to obtain water quality parameters of the water storage space inside the water tower.

[0055] The water quality parameters of the water storage space inside the water tower are transmitted to the central processing system through LoRa, and a prediction model built-in the central processing system processes the water quality parameters of the water storage space inside the water tower.

[0056] The water quality prediction value of the water storage space inside the water tower is obtained after processing, and whether the water quality prediction value exceeds a preset threshold is calculated through a water quality model of the water storage space inside the water tower. If the water quality prediction value exceeds the preset threshold, the central processing system sends an alarm information to the water plant management terminal.

[0057] The working principle of the above technical solution is that the water storage space inside the water tower is divided into multiple space regions with the same volume and connected to each other. This division can ensure detailed and comprehensive monitoring of the entire water storage space inside the water tower. In each divided space region, a sensor group is deployed to obtain the water quality parameters of the water storage space inside the water tower in real time, including temperature, dissolved oxygen content, ammonia nitrogen content, etc. Through LoRa (Long Range Radio) communication technology, the sensor group in each space region transmits the collected water quality parameters of the water storage space inside the water tower to the central processing system. LoRa technology is known for its low power consumption and long distance communication capability, which is suitable for the data transmission needs of this distributed monitoring system. After receiving the data, the central processing system processes the water quality parameters of the water storage space inside the water tower using its built-in prediction model. The model predicts the trend of changes in the water storage space inside the water tower based on machine learning. Through a water quality model of the water storage space inside the water tower, the central processing system calculates the water quality prediction value and compares it with the preset threshold. If the prediction value exceeds the preset threshold, it means that some water quality indices may reach or exceed the dangerous level, causing adverse effects. In this case, the central processing system will immediately send an alarm information to the water plant management terminal so that they can take prompt measures to respond.

[0058] The effect of the above technical solution is that through real-time monitoring and sensor data collection, the system can obtain water quality parameters in real time, and use a prediction model to predict and evaluate the water storage space inside the water tower. The central processing system determines whether the water quality prediction value of the water storage space inside the water tower exceeds the preset threshold according to the preset water quality index model of the water storage space inside the water tower. Once the prediction value exceeds the threshold, the system will trigger an alarm mechanism. With the analysis of the intelligent prediction model, the system can timely discover water quality abnormalities and help water quality inspectors respond quickly to avoid losses caused by water quality abnormalities. The intelligent monitoring system can provide sufficient water quality data support to help water quality inspectors better understand the real-time situation of the water storage space inside the water tower. With the intelligent prediction model and alarm mechanism, the system can accurately warn of water quality problems, which helps to avoid unexpected losses. It improves the monitoring accuracy and system response speed, which helps to fine-tune the management of the water storage space inside the water tower. The intelligent water storage space inside the water tower monitoring system can realize real-time monitoring and prediction of water quality environmental changes, and can timely send alarm information, so as to help water quality inspectors timely adjust management measures, ensure the stability and health of the water storage space inside the water tower, and improve the monitoring efficiency.

[0059] One embodiment of the present invention is an IoT-based intelligent water quality detection method that vertically divides the water storage space within a water tower into several interconnected horizontal monitoring layers of equal volume. Sensor groups are deployed in each of the interconnected horizontal monitoring layers to obtain water quality parameters within the water tower, including:

[0060] The water storage space inside the water tower is divided into several interconnected horizontal monitoring layers along the vertical direction, and a sensor group is deployed in each of the interconnected horizontal monitoring layers. The sensor group includes a residual chlorine sensor, a turbidity sensor, a pH sensor, a conductivity sensor, a temperature sensor, and a water level sensor;

[0061] Collecting environmental factor data measured by the sensor group and preprocessing the environmental factor data, wherein the preprocessing includes filtering, denoising and smoothing;

[0062] After preprocessing, the weight of each sensor is dynamically adjusted based on the sensor performance evaluation results and environmental difference analysis;

[0063] The adjusted weights are used to perform weighted fusion on the sensor data of each area to obtain the water quality parameters of the water storage space inside the water tower.

[0064] The working principle of the above technical solution is as follows: the water storage space within the water tower is first carefully divided into multiple interconnected spatial zones of equal volume. Within each of these zones, a sensor group is deployed, including residual chlorine sensors, turbidity sensors, pH sensors, conductivity sensors, temperature sensors, and water level sensors. These sensors provide comprehensive, real-time monitoring of key environmental factors within the zone. The sensor groups continuously collect data on corresponding environmental factors, such as residual chlorine content, temperature, and pH. Before being transmitted to the central processing system, this data undergoes preprocessing, including filtering, denoising, and smoothing. Filtering removes high-frequency noise from the data, denoising further reduces random errors, and smoothing makes the data more stable and continuous. After preprocessing, the system dynamically adjusts the weight of each sensor based on sensor performance evaluation results and environmental variance analysis. This dynamic weight adjustment allows the system to more accurately reflect the actual environmental conditions in each zone. Using the adjusted weights, the system then performs a weighted fusion of the sensor data from each zone to obtain a comprehensive value for each water quality parameter within the water tower's storage space. These comprehensive values ​​not only take into account the raw data of each sensor, but also fully consider the impact of sensor performance and environmental differences on the final results.

[0065] The above technical solution achieves the following effects: through preprocessing and dynamic weight adjustment, the quality and accuracy of sensor data are improved, ensuring the reliability of collected data. A weighted fusion algorithm is used to combine data from different sensors to obtain more comprehensive and comprehensive water quality parameters for the water tower's internal water storage space, providing more complete information for water quality management. Based on sensor performance evaluation and environmental difference analysis, sensor weights are dynamically adjusted to improve the system's adaptability and flexibility. By integrating data from multiple sensors, the system can provide more accurate and complete water quality parameters for the water tower's internal water storage space, helping water quality inspectors to gain a more comprehensive understanding of water quality. Dynamic weight adjustment and data fusion enhance the system's intelligence level, better adapting to the characteristics of different areas within the water tower's internal water storage space and improving the system's intelligence. By providing high-quality environmental parameter data and intelligent data processing, water quality inspectors can optimize management decisions and improve monitoring efficiency. This intelligent water tower internal water storage space monitoring system uses data from multiple environmental factors, performs data preprocessing, and dynamically adjusts weights to achieve more accurate and comprehensive monitoring and evaluation of the water tower's internal water storage space, helping to improve the management efficiency of the water tower's internal water storage space.

[0066] One embodiment of the present invention provides an IoT-based intelligent water quality detection method that dynamically adjusts the weight of each sensor based on sensor performance evaluation results and environmental difference analysis, including:

[0067] The sensor is placed in an environment with constant environmental parameters for testing. The stability of the sensor is obtained by calculating the standard deviation of the sensor readings over a period of time. Specifically, the stability of the sensor can be calculated using the following model:

[0068] P s,i (t)=1-β i (t) / β max

[0069] Among them, P s,i (t) represents the stability of the i-th sensor in the time period t, β i (t) is the standard deviation of the readings of the ith sensor in time period t, and βmax is the maximum standard deviation among all sensors;

[0070] The mean absolute error is used to calculate the accuracy evaluation value of the sensor. The sensor performance evaluation result is obtained based on the stability and accuracy evaluation value of the sensor. Specifically, the accuracy evaluation value of the sensor can be calculated using the following model:

[0071] P a,i (t)=1-M i (t) / M max

[0072] Among them, M i(t) is the mean absolute error of the i-th sensor in time period t, M max is the preset maximum mean absolute error;

[0073] Specifically, the sensor performance evaluation results are obtained based on the stability and accuracy evaluation values ​​of the sensor through the following model:

[0074] P i (t) = W S *P s,i (t)+W a *P a,i (t)

[0075] Among them, W S and W a is the weight of sensor stability evaluation and accuracy evaluation, W S +W a =1.

[0076] For each of the environmental factor data, calculate the difference between the data and the standard value, standardize the differences to the same scale, and combine multiple environmental factors to calculate the environmental difference coefficient;

[0077] Specifically, the environmental difference coefficient is calculated by the following model:

[0078]

[0079] Among them, e tmp,i (t) is the water temperature difference coefficient of the i-th sensor at time t, T i (t) is the water temperature in the area where the i-th sensor is located at time t, Ts is the standard water temperature, T r is the optimal operating temperature range of the sensor. If the optimal operating temperature range of the sensor is 18℃~20℃, then T r =12℃. Here, only the calculation model of the water temperature difference coefficient is given. The calculation models of the difference coefficients of dissolved oxygen, pH, etc. are the same as the calculation model of the water temperature difference coefficient.

[0080] Because there are multiple environmental factors to consider, they are combined using a weighted average approach:

[0081] e i (t) = W tmp* e tmp,i (t)+W dio *e dio,i (t)+……

[0082] Among them, e i (t) is the environmental difference coefficient of sensor i at time t, e dio,i (t) is the dissolved oxygen difference coefficient of the i-th sensor at time t, Wtmp is the weight of the environmental factor water temperature, W dio is the weight of the environmental factor dissolved oxygen.

[0083] The sensor weight is obtained according to the sensor performance evaluation results and the environmental difference coefficient.

[0084]

[0085] Among them, W i (t) is the weight of the i-th sensor at time t, P i (t) is the performance evaluation result of the i-th sensor at time t, N is the total number of sensors of this type in the entire water storage space inside the water tower, e i (t) is the environmental difference coefficient of the i-th sensor at time t.

[0086] The working principle and effect of the above technical solution are as follows: a sensor is placed in an environment with constant environmental parameters for testing. Sensor stability is assessed by recording sensor readings over a period of time and calculating the standard deviation of these readings. A smaller standard deviation indicates that the sensor output is relatively stable with less fluctuation. The sensor's accuracy is calculated using the mean absolute error (MABS). By comparing the difference between the sensor reading and the true or standard value, a numerical value representing the sensor's accuracy is obtained. A smaller MABS value indicates a higher sensor accuracy. For each environmental factor data (such as temperature and dissolved oxygen), the difference between the sensor reading and the standard or ideal value is calculated. These differences are then normalized to the same scale to enable comparison and combination of multiple environmental factors. Finally, a comprehensive environmental difference coefficient is calculated by combining multiple environmental factors to represent the degree of difference between the current environment and the standard or ideal environment. Based on the sensor's stability assessment results, accuracy assessment value, and environmental difference coefficient, a sensor weight is derived. The weight reflects the importance and reliability of the sensor in the current environment and can be used in subsequent sensor data fusion or decision-making processes. By comprehensively considering the sensor's stability and accuracy, as well as the impact of environmental factors on sensor performance, sensor performance can be more accurately assessed. This evaluation method is more objective and comprehensive, avoiding the one-sidedness of single-metric evaluation. Based on the sensor performance evaluation results and the environmental variation coefficient, sensors can be selected and used more effectively. In complex and changing environments, sensor weights can be adjusted according to actual needs to improve overall system performance and reliability. By calculating the environmental variation coefficient, the impact of different environmental factors on sensor performance can be quantified. This enables sensors to better adapt to diverse operating environments and improve their accuracy and stability under various conditions. The performance evaluation, accuracy evaluation, and comprehensive performance evaluation formulas are designed to quantify sensor performance, facilitating sensor comparison and selection. These formulas provide an objective and comparable method for measuring sensor performance, avoiding subjective assumptions and uncertainty. Specifically, the stability and accuracy evaluation formulas are designed to measure performance based on the difference between sensor readings and ideal or reference values. By normalizing these differences (using mean absolute error) and comparing the results to the maximum possible difference, an evaluation value between 0 and 1 is obtained. This design makes the evaluation results more intuitive and easy to understand, and also facilitates performance comparisons between different sensors. The comprehensive performance evaluation formula is designed to combine multiple performance indicators to form a comprehensive evaluation result. By using methods such as weighted averaging, different performance indicators can be assigned different weights based on actual needs, resulting in a comprehensive evaluation value that better meets actual needs. This design can more comprehensively reflect the performance of the sensor and avoid the one-sidedness of a single indicator evaluation.The calculation of the water temperature environmental variation coefficient and the comprehensive environmental variation coefficient quantifies the difference between the environmental conditions in the sensor's area and standard or ideal conditions. This difference may affect sensor performance and therefore needs to be included in the performance evaluation. By calculating the variation coefficient, a relatively objective metric can be obtained for comparing the performance of different sensors in different environments. This calculation can more accurately reflect the performance of sensors in real-world applications, providing a more reliable basis for sensor selection and use. These formulas provide a standardized and comparable method for measuring sensor performance, avoiding subjective assumptions and uncertainty, and making the evaluation results more accurate and reliable. The function for calculating sensor weights ensures that all weights sum to 1, and the output can be interpreted as a probability distribution, making it well-suited for multi-classification tasks. Through the exponential function, the function amplifies the differences between different input values, giving larger input values ​​greater weights, thereby highlighting important features. The function is continuous and differentiable, making it suitable for use in gradient-based optimization algorithms. i (t) as the numerator, which means that sensors with better performance will receive a greater weight; This part uses the environmental difference coefficient ei((t)) to adjust the weight, but avoids the problems that may be caused by directly using its reciprocal (such as the weight becoming too large when ei(t) approaches zero). By adding 1 and then taking the reciprocal, it ensures that when the environmental difference increases, the weight will decrease smoothly instead of suddenly becoming very large or very small.

[0087] One embodiment of the present invention provides an IoT-based intelligent water quality detection method, which transmits water quality parameters of the water storage space inside the water tower to a central processing system via LoRa. The prediction model built into the central processing system processes the water quality parameters of the water storage space inside the water tower, including:

[0088] The central processing system obtains historical data of the sensor group and performs preliminary processing on the historical data of the sensor group. The preliminary processing includes data cleaning, data transformation and feature extraction. The feature extraction includes extracting statistical features and time series features from the original data. After the preliminary processing, the data is divided into a training set and a test set.

[0089] A water quality index prediction model for the water storage space inside the water tower is constructed by using a long short-term memory network (LSTM), and the water quality index prediction model for the water storage space inside the water tower is trained using a training set from the preliminarily processed data;

[0090] Using the test set in the preliminarily processed data to evaluate and verify the trained water quality index prediction model for the water storage space inside the water tower;

[0091] The water quality parameters of the water storage space inside the water tower are input into the water quality index prediction model of the water storage space inside the water tower to obtain the water quality prediction value of the water storage space inside the water tower.

[0092] The working principle and effect of the above technical solution are as follows: The central processing system first obtains historical data from the sensor group. This data may contain noise and outliers, so it requires preliminary processing. Preliminary processing includes data cleaning, data transformation, and feature extraction. Data cleaning aims to remove noise and outliers, while data transformation converts the data into a format suitable for model processing, such as standardization or normalization. Feature extraction extracts meaningful statistical and temporal features from the raw data. These features are used for model training and evaluation. The preliminarily processed data is divided into training and test sets. The training set is used for model training, while the test set is used to evaluate model performance. A water quality index prediction model for the water storage space inside the water tower is constructed using a long short-term memory (LSTM) network. LSTM is a recurrent neural network suitable for processing time series data. The model is trained using the training set, and the model parameters are adjusted through an optimization algorithm to minimize the difference between the predicted and actual values. The trained model is evaluated and validated using the test set. Evaluation metrics may include precision, recall, and F1 score to measure the model's performance on unseen data. The validation process ensures the model's good generalization capabilities and ability to provide accurate predictions in real-world applications. Actual water quality parameters for the water tower's internal storage space are input into the trained model to obtain predicted values ​​for the water tower's internal storage space. These predicted values ​​provide water quality inspectors with information about future environmental conditions, helping them make informed testing decisions. Preliminary processing and dataset partitioning ensure high-quality data input to the model, thereby improving its predictive accuracy. The LSTM model captures long-term dependencies in time series data, further enhancing prediction accuracy. Accurate environmental predictions help water quality inspectors proactively understand future environmental changes, thereby optimizing testing strategies, reducing risks, and increasing production. By combining sensor technology with machine learning models, intelligent monitoring and prediction of water tower internal storage spaces are achieved, which will help modernize and intelligentize water quality testing and enhance management capabilities.

[0093] One embodiment of the present invention provides an intelligent water quality detection method based on the Internet of Things. After processing, a predicted water quality value of a water storage space inside a water tower is obtained. A water quality model of the water storage space inside the water tower is used to calculate whether the predicted water quality value of the water storage space inside the water tower exceeds a preset threshold. If the preset threshold is exceeded, a central processing system sends an alarm message to a water plant management terminal, including:

[0094] The water quality prediction value is input into the water tower internal water storage space water quality index model. The water tower internal water storage space water quality model calculates whether the water quality prediction value exceeds a preset threshold. Specifically, the water tower internal water storage space water quality model is

[0095]

[0096] where CEI is the water quality index, n is the total number of water quality parameters detected by the sensor, w j is the weight of the jth parameter, indicating the importance of the parameter to human health, x j is the prediction value of the jth parameter, x min ≤x j ≤x max , x min and x max are the minimum and maximum possible values of the parameter that are suitable for human reference standards, and ej is the exponential coefficient of the jth parameter, used to adjust the degree of influence of the parameter on the comprehensive index.

[0097] If the water tower internal water storage space water quality prediction value exceeds the preset comprehensive environmental index threshold, the central processing system sends an alarm message to the water quality inspector's mobile device.

[0098] It should be noted that the predicted values of each environmental parameter should be compared with the pre-stored environmental parameter threshold in the central processing system in advance. If the predicted value of a certain environmental parameter exceeds the threshold, the water quality inspector is directly sent a message that the environmental parameter will exceed the threshold, guiding the water quality inspector to make adjustments. If none of the predicted environmental parameters exceed the threshold, the predicted values of each environmental parameter are input into the water tower internal water storage space water quality index model.

[0099] In the monitoring of the water tower internal water storage space, the fact that a single parameter does not exceed the threshold does not mean that the overall environmental condition is safe. The environment is a complex system, and various parameters may interact and influence each other. Sometimes, even if each individual environmental parameter is within the normal range, when they are considered together, unexpected effects may occur. The comprehensive environmental index model is designed to solve this problem. It considers multiple environmental parameters and combines them into an index value through a certain algorithm. This index value can more comprehensively reflect the overall condition of the environment, providing a more accurate basis for judgment. Therefore, even if each parameter does not exceed the threshold, after inputting into the comprehensive environmental index model, it may still be found that the overall environmental condition exceeds the preset threshold. In this case, timely measures should be taken to adjust and improve to ensure the sustainability and safety of the water tower internal water storage space.

[0100] The working principle and effect of the above technical solution are as follows: the water quality prediction value obtained by the LSTM model is input into the water quality index model of the water storage space inside the water tower. This environmental index model is a mathematical model that integrates multiple environmental parameters and is used to evaluate the overall condition of the water storage space inside the water tower; the water quality model of the water storage space inside the water tower will calculate whether the water quality prediction value exceeds these thresholds based on the preset environmental parameter thresholds. These thresholds are usually set based on drinking water safety standards; if the water quality prediction value exceeds the preset threshold, it means that the current or upcoming environmental conditions may have an adverse effect on water supply users. At this time, the central processing system will trigger an alarm mechanism; the central processing system will send an alarm message through the connected mobile network or other communication way, sending alarm information to the mobile device of the water quality inspector; by inputting the water quality prediction value into the environmental index model in real time, the system can continuously monitor the status of the water storage space inside the water tower and issue a timely warning when adverse conditions are predicted; since the alarm information is sent directly to the mobile device of the water quality inspector, this ensures that the water quality inspector can quickly receive notification of environmental anomalies, so that the necessary measures can be taken as soon as possible to reduce or avoid potential losses; through timely environmental warnings and rapid responses, water quality inspectors can better manage and monitor the water storage space inside the water tower; the entire process is highly automated, which reduces the frequency and intensity of manual inspections, improves the intelligence level of water quality monitoring, and helps promote the modernization of water quality monitoring. The model is used to calculate the comprehensive environmental index (CEI) to evaluate water quality, Part of the standardization process is to convert the parameter value into the range of [0,1] to facilitate the comparison and weighting between different parameters. j represents the weight of the jth parameter, reflecting the importance of the parameter to the suitability of the water storage space inside the water tower. The larger the weight, the greater the impact of the parameter on the comprehensive index. j is the exponential coefficient of the jth parameter, which is used to adjust the nonlinear effect of the parameter on the comprehensive index. j The value of can be used to amplify or minimize the impact of parameter changes on the comprehensive index. By adjusting the weights and index coefficients, it can flexibly adapt to different water storage spaces within water towers. This formula comprehensively considers multiple water quality parameters, providing a comprehensive assessment framework that can more accurately reflect the overall suitability of water storage spaces within water towers. This formula allows for the integration of multiple water quality parameters into a single index, which helps provide a comprehensive and concise environmental assessment indicator, allowing decision makers to quickly understand the overall status of the current environment.

[0101] One embodiment of the present invention provides an intelligent water quality detection system based on the Internet of Things, the system comprising:

[0102] The water tower internal water storage space monitoring module is used to divide the water tower internal water storage space into a plurality of horizontal monitoring layers with the same volume and mutual communication in the vertical direction, and a sensor group is arranged in each of the horizontal monitoring layers to obtain water quality parameters of the water tower internal water storage space.

[0103] The predicted water tower internal water storage space water quality parameter module transmits the water quality parameters of the water tower internal water storage space to a central processing system through LoRa, and a prediction model built in the central processing system processes the water quality parameters of the water tower internal water storage space.

[0104] The alarm module is used to calculate whether the water quality prediction value exceeds a preset threshold value through a water quality model of the water tower internal water storage space when the water quality prediction value of the water tower internal water storage space is obtained after processing, and if the preset threshold value is exceeded, the central processing system sends an alarm information to a water quality inspector water plant management terminal.

[0105] The working principle of the above technical solution is that the water tower internal water storage space is divided into a plurality of space regions with the same volume and mutual connection, which can ensure that the entire water tower internal water storage space is monitored in detail and comprehensively, and a sensor group is arranged in each divided space region to obtain water quality parameters of the water tower internal water storage space in the region in real time, including temperature, dissolved oxygen content, ammonia nitrogen content, etc. Through LoRa (long-range radio) communication technology, the sensor group in each space region transmits the collected water quality parameters of the water tower internal water storage space to a central processing system. LoRa technology is known for its low power consumption and long-distance communication capability, and is suitable for data transmission requirements of such a distributed monitoring system; after receiving the data, the central processing system processes the water quality parameters of the water tower internal water storage space by using a prediction model built in the central processing system. The model predicts the trend of the water tower internal water storage space based on machine learning, and through a water quality model of the water tower internal water storage space, the central processing system calculates a water quality prediction value and compares it with a preset threshold value. If the prediction value exceeds the preset threshold value, it means that some environmental parameters may reach or exceed a dangerous level, and in this case, the central processing system will immediately send an alarm information to a water plant management terminal so that they can take prompt measures to respond.

[0106] The above technical solution achieves the following: Through real-time monitoring and sensor data collection, the system can obtain water quality parameters in real time and use a predictive model to predict and evaluate the water storage space within the water tower. Based on a pre-set water quality index model for the water tower's internal water storage space, the central processing system determines whether the predicted water quality value within the water tower's internal water storage space exceeds a preset threshold. If the predicted value exceeds the threshold, the system triggers an alarm mechanism. Through analysis using the intelligent predictive model, the system can promptly detect water quality anomalies, enabling water quality inspectors to respond quickly and avoid losses caused by abnormal water quality. The intelligent monitoring system provides sufficient water quality data support, helping water quality inspectors better understand the real-time conditions within the water tower's internal water storage space. The intelligent predictive model and alarm mechanism provide accurate warnings of water quality issues, helping to avoid unexpected losses. Improved monitoring accuracy and system response speed facilitate refined management of the water tower's internal water storage space. This intelligent water tower internal water storage space monitoring system can monitor and predict water quality changes in real time and issue timely alarms, enabling water quality inspectors to promptly adjust management measures to ensure the stability and health of the water tower's internal water storage space.

[0107] One embodiment of the present invention is an IoT-based intelligent water quality detection method that vertically divides the water storage space inside a water tower into several interconnected horizontal monitoring layers of equal volume. Sensor groups are deployed in each of the interconnected horizontal monitoring layers to obtain water quality parameters, including:

[0108] Deployment of sensor group module, used to divide the water storage space inside the water tower into several horizontal monitoring layers of equal volume and interconnected along the vertical direction, and deploy sensor groups in each of the interconnected horizontal monitoring layers, the sensor groups including residual chlorine sensor, turbidity sensor, pH sensor, conductivity sensor, temperature sensor, and water level sensor;

[0109] A preprocessing module, configured to collect environmental factor data measured by the sensor group and perform preprocessing on the environmental factor data, wherein the preprocessing includes filtering, denoising, and smoothing;

[0110] Dynamic sensor weight adjustment module, which is used to dynamically adjust the weight of each sensor based on sensor performance evaluation results and environmental difference analysis after preprocessing;

[0111] The water quality parameter acquisition module is used to use the adjusted weights to perform weighted fusion on the sensor data of each area to obtain the water quality parameters of the water storage space inside the water tower.

[0112] The working principle of the above technical solution is as follows: the water storage space within the water tower is first carefully divided into multiple interconnected spatial zones of equal volume. Within each of these zones, a sensor set is deployed, including a dissolved oxygen sensor, a temperature sensor, a pH sensor, an ammonia nitrogen sensor, a total phosphorus sensor, a total nitrogen sensor, and a turbidity sensor. These sensors provide comprehensive, real-time monitoring of key environmental factors within the zone. The sensor set continuously collects data on corresponding environmental factors, such as dissolved oxygen content, temperature, and pH. Before being transmitted to the central processing system, this data undergoes preprocessing, including filtering, denoising, and smoothing. Filtering removes high-frequency noise from the data, denoising further reduces random errors, and smoothing makes the data more stable and continuous. After preprocessing, the system dynamically adjusts the weight of each sensor based on sensor performance evaluation results and environmental variance analysis. This dynamic weighting allows the system to more accurately reflect the actual environmental conditions in each zone. Using the adjusted weights, the system then performs a weighted fusion of the sensor data from each zone to obtain a comprehensive value for each water quality parameter within the water tower's storage space. These comprehensive values ​​not only take into account the raw data of each sensor, but also fully consider the impact of sensor performance and environmental differences on the final results.

[0113] The above technical solution achieves the following effects: through preprocessing and dynamic weight adjustment, the quality and accuracy of sensor data are improved, ensuring the reliability of collected data. A weighted fusion algorithm is used to combine data from different sensors to obtain more comprehensive and comprehensive water quality parameters for the water tower's internal water storage space, providing more complete information for water quality inspectors. Based on sensor performance evaluation and environmental difference analysis, sensor weights are dynamically adjusted to improve the system's adaptability and flexibility. By integrating data from multiple sensors, the system can provide more accurate and complete water quality parameters for the water tower's internal water storage space, helping water quality inspectors to gain a more comprehensive understanding of water quality. Dynamic weight adjustment and data fusion enhance the system's intelligence level, better adapting to the characteristics of different areas within the water tower's internal water storage space and improving the system's intelligence. By providing high-quality environmental parameter data and intelligent data processing methods, it can help water quality inspectors optimize management decisions. This intelligent water tower internal water storage space monitoring system uses data from multiple environmental factors, performs data preprocessing and dynamic weight adjustment, achieving more accurate and comprehensive monitoring and assessment of the water tower's internal water storage space, helping to improve the quality of water bodies within the water tower and management efficiency.

[0114] In one embodiment of the present invention, a water quality intelligent detection system based on the Internet of Things, the module for dynamically adjusting sensor weights includes:

[0115] The sensor stability module is used to test the sensor in an environment with constant environmental parameters. The sensor stability is obtained by calculating the standard deviation of the sensor readings over a period of time. Specifically, the sensor stability can be calculated using the following model:

[0116] P s,i (t)=1-β i (t) / β max

[0117] Among them, P s,i (t) represents the stability of the i-th sensor in the time period t, β i (t) is the standard deviation of the readings of the ith sensor in time period t, and βmax is the maximum standard deviation among all sensors;

[0118] The module for obtaining sensor performance evaluation results is used to calculate the accuracy evaluation value of the sensor using the mean absolute error. The sensor performance evaluation result is obtained based on the stability and accuracy evaluation value of the sensor. Specifically, the accuracy evaluation value of the sensor can be calculated using the following model:

[0119] P a,i (t)=1-M i (t) / M max

[0120] Among them, M i (t) is the mean absolute error of the i-th sensor in time period t, M max is the preset maximum mean absolute error;

[0121] Specifically, the sensor performance evaluation results are obtained based on the stability and accuracy evaluation values ​​of the sensor through the following model:

[0122] P i (t) = W S *P s,i (t)+W a *P a,i (t)

[0123] Among them, W S and W a is the weight of sensor stability evaluation and accuracy evaluation, W S +W a =1.

[0124] An environmental difference coefficient acquisition module is used to calculate the difference between each environmental factor data and the standard value, standardize these differences to the same scale, and combine multiple environmental factors to calculate the environmental difference coefficient;

[0125] Specifically, the environmental difference coefficient is calculated by the following model:

[0126]

[0127] Among them, e tmp,i (t) is the water temperature difference coefficient of the i-th sensor at time t, T i (t) is the water temperature in the area where the i-th sensor is located at time t, ts is the standard water temperature, T r is the optimal operating temperature range of the sensor. If the optimal operating temperature range of the sensor is 18℃~20℃, then T r =12℃. Here, only the calculation model of the water temperature difference coefficient is given. The calculation models of the difference coefficients of dissolved oxygen, pH, etc. are the same as the calculation model of the water temperature difference coefficient.

[0128] Because there are multiple environmental factors to consider, they are combined using a weighted average approach:

[0129] e i (t) = W tmp* e tmp,i (t)+W dio *e dio,i (t)+……

[0130] Among them, e i (t) is the environmental difference coefficient of sensor i at time t, e dio,i (t) is the dissolved oxygen difference coefficient of the i-th sensor at time t, W tmp is the weight of the environmental factor water temperature, W dio is the weight of the environmental factor dissolved oxygen.

[0131] The sensor weight module is used to obtain the sensor weight based on the sensor performance evaluation results and the environmental difference coefficient. Specifically, the weight calculation model is as follows:

[0132]

[0133] Among them, W i (t) is the weight of the i-th sensor at time t, P i (t) is the performance evaluation result of the i-th sensor at time t, N is the total number of sensors of this type in the entire water storage space inside the water tower, e i (t) is the environmental difference coefficient of the i-th sensor at time t.

[0134] The working principle and effect of the above technical solution are: placing the sensor in an environment with constant environmental parameters for testing. By recording the sensor readings over a period of time and calculating the standard deviation of these readings, the stability of the sensor can be evaluated. A smaller standard deviation means that the sensor's output is relatively stable with less fluctuation. The precision evaluation value of the sensor is calculated using the average absolute error. By comparing the differences between the sensor readings and the true or standard values, a value representing the sensor's precision can be obtained. A smaller average absolute error value indicates that the sensor has higher precision. For each environmental factor data (such as temperature, dissolved oxygen, etc.), the difference between it and the standard or ideal value is calculated. Then, these differences are standardized to the same scale to enable comparison and combination of multiple environmental factors. Finally, a comprehensive environmental difference coefficient is calculated by combining multiple environmental factors, which represents the degree of difference between the current environment and the standard or ideal environment. Based on the stability evaluation result and precision evaluation value of the sensor, as well as the environmental difference coefficient, the weight of the sensor can be comprehensively obtained. The weight reflects the importance and reliability of the sensor in the current environment and can be used in subsequent sensor data fusion or decision-making processes. By considering the stability and precision of the sensor and the influence of environmental factors on the performance of the sensor, the performance of the sensor can be more accurately evaluated. This evaluation method is more objective and comprehensive, avoiding the one-sidedness of single indicator evaluation; based on the performance evaluation result of the sensor and the environmental difference coefficient, the sensor can be more targetedly selected and used. In a complex and variable environment, the weight of the sensor can be adjusted according to actual needs to improve the performance and reliability of the entire system; by calculating the environmental difference coefficient, the degree of influence of different environmental factors on the performance of the sensor can be quantified. This enables the sensor to better adapt to different working environments, improving its accuracy and stability under various conditions. The formula design for performance evaluation, precision evaluation, and comprehensive performance evaluation is to quantify the performance of the sensor, making it easier to compare and select sensors. These formulas provide an objective and comparable method to measure the performance of the sensor, avoiding subjective speculation and uncertainty. Specifically, the design idea of the stability evaluation and precision evaluation formulas is to measure the performance of the sensor based on the difference between its readings and the ideal or reference values. By standardizing the difference (using the average absolute error) and comparing it with the possible maximum difference, an evaluation value between 0 and 1 can be obtained. This design makes the evaluation result more intuitive and easy to understand, and also facilitates the comparison of the performance of different sensors; the design of the comprehensive performance evaluation formula is to combine multiple performance indicators to form a comprehensive evaluation result. By using methods such as weighted average, different weights can be assigned to different performance indicators according to actual needs, resulting in a more practical comprehensive evaluation value. This design can more comprehensively reflect the performance of the sensor, avoiding the one-sidedness of single indicator evaluation.The calculation of the water temperature environment difference coefficient and the comprehensive environment difference coefficient is to quantify the difference between the environment conditions of the sensor's area and the standard conditions or ideal conditions, which may affect the performance of the sensor, and therefore needs to be included in the performance evaluation. By calculating the difference coefficient, a relatively objective measurement standard can be obtained for comparing the performance of different sensors in different environments. Such calculation can more accurately reflect the performance of the sensor in actual application, providing a more reliable basis for the selection and use of the sensor. These formulas provide a standardized and comparable method to measure the performance of the sensor, avoiding subjective speculation and uncertainty, making the evaluation results more accurate and reliable. The function for calculating the weight of the sensor ensures that the sum of all weights is 1, and the output can be interpreted as a probability distribution, which is very suitable for multi-classification tasks; through the exponential function, the function amplifies the difference between different input values, so that the weight corresponding to the relatively large input value is larger, thereby highlighting the important features; the function is continuous and differentiable, which makes it can be used in gradient-based optimization algorithms;P. i (t) the molecule means that the sensor with better performance will get a larger weight; This part uses the environment difference coefficient ei((t) to adjust the weight, but avoids the problem that the direct use of its inverse may cause (such as when ei(t) is close to zero, the weight becomes too large). By taking the inverse after adding 1, it is ensured that when the environmental difference increases, the weight will decrease smoothly, and will not suddenly become very large or very small.

[0135] In one embodiment of the present application, a water quality intelligent detection system based on Internet of Things, the water quality parameter prediction module of the internal water storage space of the water tower comprises:

[0136] The preliminary processing module is used for the central processing system to acquire historical data of the sensor group, and to perform preliminary processing on the historical data of the sensor group. The preliminary processing includes data cleaning, data transformation and feature extraction. The feature extraction includes extracting statistical features and time series features from the original data. After preliminary processing, the data is divided into a training set and a test set;

[0137] The training model module is used for constructing a water tower internal water storage space water quality index prediction model through a long short-term memory network (LSTM), and training the water tower internal water storage space water quality index prediction model using the training set in the preliminary processed data;

[0138] The test module is used for evaluating and verifying the trained water tower internal water storage space water quality index prediction model using the test set in the preliminary processed data;

[0139] The module for obtaining the water quality prediction value of the water storage space inside the water tower is used to input the water quality parameters of the water storage space inside the water tower into the water quality index prediction model of the water storage space inside the water tower to obtain the water quality prediction value of the water storage space inside the water tower.

[0140] The working principle and effect of the above technical solution are as follows: The central processing system first obtains historical data from the sensor group. This data may contain noise and outliers, so it requires preliminary processing. Preliminary processing includes data cleaning, data transformation, and feature extraction. Data cleaning aims to remove noise and outliers, while data transformation converts the data into a format suitable for model processing, such as standardization or normalization. Feature extraction extracts meaningful statistical and temporal features from the raw data. These features are used for model training and evaluation. The preliminarily processed data is divided into training and test sets. The training set is used for model training, while the test set is used to evaluate model performance. A water quality index prediction model for the water storage space inside the water tower is constructed using a long short-term memory (LSTM) network. LSTM is a recurrent neural network suitable for processing time series data. The model is trained using the training set, and the model parameters are adjusted through an optimization algorithm to minimize the difference between the predicted and actual values. The trained model is evaluated and validated using the test set. Evaluation metrics may include precision, recall, and F1 score to measure the model's performance on unseen data. The validation process ensures the model's good generalization capabilities and its ability to provide accurate predictions in real-world applications. Actual water quality parameters for the water tower's internal storage space are input into the trained model to obtain predicted values ​​for the water tower's internal storage space. These predicted values ​​provide water quality inspectors with information about future environmental conditions, helping them make informed regulatory decisions. Preliminary processing and dataset partitioning ensure high-quality data input to the model, thereby improving its predictive accuracy. The LSTM model, capable of capturing long-term dependencies in time series data, further enhances prediction accuracy. By combining sensor technology with machine learning models, intelligent monitoring and prediction of water tower internal storage spaces are achieved, which will help modernize and intelligentize water quality monitoring, improving production efficiency and management levels.

[0141] In one embodiment of the present invention, an intelligent water quality detection system based on the Internet of Things, the alarm module includes:

[0142] The module for calculating whether the water quality exceeds the preset threshold value is used to input the water quality prediction value into the water quality index model of the water storage space inside the water tower. The water quality model of the water storage space inside the water tower calculates whether the water quality prediction value exceeds the preset threshold value. Specifically, the water quality model of the water storage space inside the water tower is

[0143]

[0144] Where CEI is the water quality index, n is the total number of water quality parameters detected by sensors, and w j is the weight of the jth parameter, indicating the importance of the parameter to human health, x j is the predicted value of the jth parameter, x min ≤x j ≤x max , x min and x max are the minimum and maximum possible values ​​of the parameter that are suitable for human reference standards, respectively. ej is the exponential coefficient of the jth parameter, which is used to adjust the degree of influence of the parameter on the comprehensive index.

[0145] The alarm information sending module is used to send an alarm message to the mobile device of the water quality inspector if the water quality prediction value of the water storage space inside the water tower exceeds the preset comprehensive environmental index threshold.

[0146] The working principle and effect of the above technical solution are as follows: the water quality prediction value obtained by the LSTM model is input into the water quality index model of the water storage space inside the water tower. This environmental index model is a mathematical model that integrates multiple environmental parameters and is used to evaluate the overall condition of the water storage space inside the water tower; the water quality model of the water storage space inside the water tower will calculate whether the water quality prediction value exceeds these thresholds based on the preset environmental parameter thresholds. These thresholds are usually set based on the national drinking water hygiene standards; if the water quality prediction value exceeds the preset threshold, it means that the current or upcoming environmental conditions may have an adverse effect on the water supply users. At this time, the central processing system will trigger the alarm mechanism; the central processing system will send a warning to the user through the connected mobile network or other communication methods. The water quality inspector's mobile device sends an alarm message; by inputting the water quality prediction value into the environmental index model in real time, the system can continuously monitor the status of the water storage space inside the water tower and issue a timely warning when adverse conditions are predicted; since the alarm information is sent directly to the water quality inspector's mobile device, this ensures that the water quality inspector can quickly receive notification of environmental anomalies, so that the necessary measures can be taken as soon as possible to reduce or avoid potential losses; through timely environmental warnings and rapid responses, water quality inspectors can better manage the water storage space inside the water tower while reducing the risks caused by sudden environmental changes; the entire process is highly automated, which reduces the frequency and intensity of manual inspections, improves the level of intelligent monitoring, and helps promote the modernization of tap water quality monitoring. The model is used to calculate the comprehensive water quality index (CEI) to evaluate tap water quality, Part of the standardization process is to convert the parameter value into the range of [0,1] to facilitate the comparison and weighting between different parameters. jrepresents the weight of the jth parameter, reflecting the importance of the parameter to the suitability of the water storage space inside the water tower. The larger the weight, the greater the impact of the parameter on the comprehensive index. j is the exponential coefficient of the jth parameter, which is used to adjust the nonlinear effect of the parameter on the comprehensive index. j The value of can be used to amplify or minimize the impact of parameter changes on the comprehensive index. By adjusting the weights and index coefficients, it can flexibly adapt to different water storage spaces within water towers. This formula comprehensively considers multiple environmental parameters, providing a comprehensive assessment framework that can more accurately reflect the overall suitability of water storage spaces within water towers. This formula allows for the integration of multiple environmental parameters into a single index, which helps provide a comprehensive and concise environmental assessment indicator, allowing decision makers to quickly understand the overall status of the current environment.

[0147] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A water quality intelligent detection method based on the Internet of Things, characterized in that: The method comprises: The water storage space inside the water tower is divided vertically into several interconnected horizontal monitoring layers of equal volume. Sensor groups are deployed in each of the interconnected horizontal monitoring layers to obtain water quality parameters of the water storage space inside the water tower. The water quality parameters of the water storage space inside the water tower are transmitted to the central processing system via LoRa, and the built-in prediction model of the central processing system processes the water quality parameters of the water storage space inside the water tower; After processing, the water quality prediction value of the water storage space inside the water tower is obtained. The water quality model of the water storage space inside the water tower is used to calculate whether the water quality prediction value exceeds the preset threshold. If it exceeds the preset threshold, the central processing system sends an alarm message to the water plant management terminal.

2. The method for intelligent water quality detection based on the Internet of Things according to claim 1, characterized in that: The water storage space inside the water tower is divided vertically into several interconnected horizontal monitoring layers of equal volume. Sensor groups are deployed in each of the interconnected horizontal monitoring layers to obtain water quality parameters of the water storage space inside the water tower, including: The water storage space inside the water tower is divided into several interconnected horizontal monitoring layers along the vertical direction, and a sensor group is deployed in each of the interconnected horizontal monitoring layers. The sensor group includes a residual chlorine sensor, a turbidity sensor, a pH sensor, a conductivity sensor, a temperature sensor, and a water level sensor; Collecting environmental factor data measured by the sensor group and preprocessing the environmental factor data, wherein the preprocessing includes filtering, denoising and smoothing; After preprocessing, the weight of each sensor is dynamically adjusted based on the sensor performance evaluation results and environmental difference analysis; The adjusted weights are used to perform weighted fusion on the sensor data of each area to obtain the water quality parameters of the water storage space inside the water tower.

3. The method for intelligent water quality detection based on the Internet of Things according to claim 2, characterized in that: Based on sensor performance evaluation results and environmental difference analysis, the weight of each sensor is dynamically adjusted, including: The sensor is placed in an environment with constant environmental parameters for testing, and the stability of the sensor is obtained by calculating the standard deviation of the sensor readings over a period of time; The mean absolute error is used to calculate the accuracy evaluation value of the sensor, and the sensor performance evaluation result is obtained based on the stability and accuracy evaluation value of the sensor; For each of the environmental factor data, calculate the difference between the data and the standard value, standardize the differences to the same scale, and combine multiple environmental factors to calculate the environmental difference coefficient; The sensor weight is obtained according to the sensor performance evaluation results and the environmental difference coefficient.

4. The method for intelligent water quality detection based on the Internet of Things according to claim 1, characterized in that: The water quality parameters of the water storage space inside the water tower are transmitted to the central processing system via LoRa. The built-in prediction model of the central processing system processes the water quality parameters of the water storage space inside the water tower, including: The central processing system obtains historical data of the sensor group and performs preliminary processing on the historical data of the sensor group. The preliminary processing includes data cleaning, data transformation and feature extraction. The feature extraction includes extracting statistical features and time series features from the original data. After the preliminary processing, the data is divided into a training set and a test set. A water quality index prediction model for the water storage space inside the water tower is constructed by using a long short-term memory network (LSTM), and the water quality index prediction model for the water storage space inside the water tower is trained using a training set from the preliminarily processed data; Using the test set in the preliminarily processed data to evaluate and verify the trained water quality index prediction model for the water storage space inside the water tower; The water quality parameters of the water storage space inside the water tower are input into the water quality index prediction model of the water storage space inside the water tower to obtain the water quality prediction value of the water storage space inside the water tower.

5. The method for intelligent water quality detection based on the Internet of Things according to claim 1, characterized in that: After processing, a predicted value of water quality of the water storage space inside the water tower is obtained. The water quality model of the water storage space inside the water tower is used to calculate whether the predicted value of water quality of the water storage space inside the water tower exceeds a preset threshold. If the preset threshold is exceeded, the central processing system sends an alarm message to the water plant management terminal, including: The water quality prediction value is input into the water quality index model of the water storage space inside the water tower, and the water quality model of the water storage space inside the water tower calculates whether the water quality prediction value exceeds a preset threshold; If the water quality prediction value of the water storage space inside the water tower exceeds a preset threshold, the central processing system sends an alarm message to the mobile device of the water quality inspector.

6. An intelligent water quality detection system based on the Internet of Things, characterized in that: The system comprises: The water tower internal water storage space monitoring module is used to divide the water tower internal water storage space into several horizontal monitoring layers of equal volume and interconnected along the vertical direction. Sensor groups are deployed in the interconnected horizontal monitoring layers to obtain water quality parameters of the water tower internal water storage space; A module for predicting water quality parameters of the water storage space inside the water tower is used to transmit the water quality parameters of the water storage space inside the water tower to the central processing system via LoRa. The prediction model built into the central processing system processes the water quality parameters of the water storage space inside the water tower; The alarm module is used to obtain the water quality prediction value of the water storage space inside the water tower after processing, and calculate whether the water quality prediction value exceeds the preset threshold through the water quality model of the water storage space inside the water tower. If it exceeds the preset threshold, the central processing system sends an alarm message to the water plant management terminal.

7. The water quality intelligent detection system based on the Internet of Things according to claim 6 is characterized in that: The water storage space module for monitoring the water tower includes: Deployment of sensor group module, used to divide the water storage space inside the water tower into several horizontal monitoring layers of equal volume and interconnected along the vertical direction, and deploy sensor groups in each of the interconnected horizontal monitoring layers, the sensor groups including residual chlorine sensor, turbidity sensor, pH sensor, conductivity sensor, temperature sensor, and water level sensor; A preprocessing module, configured to collect environmental factor data measured by the sensor group and perform preprocessing on the environmental factor data, wherein the preprocessing includes filtering, denoising, and smoothing; Dynamic sensor weight adjustment module, which is used to dynamically adjust the weight of each sensor based on sensor performance evaluation results and environmental difference analysis after preprocessing; The water quality parameter acquisition module is used to use the adjusted weights to perform weighted fusion on the sensor data of each area to obtain the water quality parameters of the water storage space inside the water tower.

8. The water quality intelligent detection system based on the Internet of Things according to claim 7 is characterized in that: The dynamic sensor weight adjustment module includes: The sensor stability acquisition module is used to test the sensor in an environment with constant environmental parameters and obtain the sensor stability by calculating the standard deviation of the sensor readings over a period of time; A module for obtaining sensor performance evaluation results is used to calculate the accuracy evaluation value of the sensor using the mean absolute error, and obtain the sensor performance evaluation result according to the stability and accuracy evaluation value of the sensor; An environmental difference coefficient acquisition module is used to calculate the difference between each environmental factor data and the standard value, standardize these differences to the same scale, and combine multiple environmental factors to calculate the environmental difference coefficient; The sensor weight obtaining module is used to obtain the sensor weight according to the sensor performance evaluation result and the environmental difference coefficient.

9. The water quality intelligent detection system based on the Internet of Things according to claim 6, characterized in that: The module for predicting water quality parameters of water storage space inside the water tower includes: A preliminary processing module is used for the central processing system to obtain historical data of the sensor group and perform preliminary processing on the historical data of the sensor group. The preliminary processing includes data cleaning, data transformation and feature extraction. The feature extraction includes extracting statistical features and time series features from the original data. After preliminary processing, the data is divided into a training set and a test set; A training model module is used to construct a water quality index prediction model for the water storage space inside the water tower through a long short-term memory network (LSTM), and train the water quality index prediction model for the water storage space inside the water tower using a training set in the preliminarily processed data; A testing module, for evaluating and verifying the trained water quality index prediction model for the water storage space inside the water tower using a test set in the preliminarily processed data; The module for obtaining the water quality prediction value of the water storage space inside the water tower is used to input the water quality parameters of the water storage space inside the water tower into the water quality index prediction model of the water storage space inside the water tower to obtain the water quality prediction value of the water storage space inside the water tower.

10. The water quality intelligent detection system based on the Internet of Things according to claim 6, characterized in that: The alarm module includes: A module for calculating whether the water quality exceeds a preset threshold value is used to input the water quality prediction value into a water quality index model of the water storage space inside the water tower, and the water quality model of the water storage space inside the water tower calculates whether the water quality prediction value of the water storage space inside the water tower exceeds a preset threshold value; The alarm information sending module is used to send an alarm message to the mobile device of the water quality inspector if the water quality prediction value of the water storage space inside the water tower exceeds a preset threshold.