Water pollution monitoring method and device based on intelligent sensor

Through intelligent sensor networks and advanced data analysis technology, water body data can be collected and processed in real time, solving the problem of real-time and insufficient data processing capabilities of traditional water pollution monitoring methods, and achieving efficient and accurate water pollution warning.

CN120354309APending Publication Date: 2025-07-22HUBEI YITONG CONSTR ENG CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510492305.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

Traditional water pollution monitoring methods rely on manual sampling and laboratory analysis, and are difficult to reflect the dynamic changes in water pollution in real time. The data processing capacity of the existing sensor monitoring system is limited, so it cannot fully reflect the comprehensive pollution status of water bodies, and lacks effective data analysis and early warning mechanisms.

Method used

Through the intelligent sensor network, water temperature, pollutant concentration and environmental parameters are collected in real time, and technologies such as time series analysis, principal component analysis, random forest algorithm and long-term memory network are used to extract key features, predict potential pollution events and generate early warning signals, and combine Kalman filtering algorithm to process interference data to generate stable water temperature change trends.

Benefits of technology

It realizes fine dynamic monitoring of the water body state, timely discovers potential pollution events, improves the frequency and comprehensiveness of data collection, shortens the time from data collection to early warning, and improves the accuracy and reliability of monitoring results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354309A_ABST
    Figure CN120354309A_ABST
Patent Text Reader

Abstract

The invention discloses a water pollution monitoring method and device based on an intelligent sensor, and the method comprises the steps: collecting the real-time water temperature, pollutant concentration and environmental parameter data of a water body through a sensor network, and storing the data into a distributed database to form a multi-dimensional time series data set; a feature extraction and dimension reduction module is used for obtaining key feature vectors, a potential pollution event marking module is used for screening out a preliminary event candidate set, and an event detection model is trained by means of a random forest algorithm. And when the model judges that a pollution event occurs and the confidence reaches the standard, generating an early warning signal. The water temperature abnormal trend is predicted through a long and short term memory network, Kalman filtering smoothing processing is carried out, finally, a pollution event early warning report is generated according to abnormal points in a stable water temperature change trend sequence, and efficient and accurate monitoring and early warning of water pollution are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of water pollution monitoring, and particularly relates to a water pollution monitoring method and device based on intelligent sensors. Background Art

[0002] Traditional water pollution monitoring methods mainly rely on manual sampling and laboratory analysis, and there are many drawbacks to this approach. On the one hand, the frequency of manual sampling is low, making it difficult to reflect the dynamic changes of water body pollution in real time, which may lead to pollution incidents not being discovered and processed in a timely manner. For example, in the case of some sudden industrial wastewater leakage incidents, if real-time monitoring is not possible, the water body may be continuously polluted for a long time, causing serious ecological damage. On the other hand, the laboratory analysis process is cumbersome, time-consuming, and costly, and is not suitable for large-scale and continuous water quality monitoring.

[0003] To overcome the deficiencies of traditional monitoring methods, some sensor-based automatic monitoring technologies have emerged. Although early sensor monitoring systems were able to achieve a certain degree of real-time data collection, they had problems such as limited data processing capabilities and a single monitoring index. They often could only monitor a few common pollutant indicators and were unable to comprehensively reflect the comprehensive pollution status of the water body. Moreover, these systems lacked effective data analysis and early warning mechanisms, making it difficult to extract valuable information from the vast amount of monitoring data and timely discover potential pollution incidents.

[0004] In addition, existing water pollution monitoring technologies show obvious limitations when dealing with complex and variable environmental factors. Factors such as water temperature and environmental parameters in the water body will affect the distribution and concentration of pollutants, but traditional monitoring methods often ignore the interaction between these factors, resulting in the accuracy and reliability of monitoring results being affected. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a water pollution monitoring method and device based on intelligent sensors, which can collect a variety of parameter data of the water body in real time, use advanced data analysis technologies to mine the information behind the data, timely discover potential pollution incidents, and provide accurate early warnings.

[0006] To solve the above technical problems, the technical solutions adopted by the present invention are as follows:

[0007] A water pollution monitoring method and device based on intelligent sensors, the steps are as follows:

[0008] S1. Obtain real-time water temperature, pollutant concentration, and environmental parameter data from the water body through a sensor network, and store it in a distributed database to obtain a multi-dimensional time series data set;

[0009] S1.1. Obtain real-time data from the water body through the sensor network, including water temperature parameters, pollutant concentrations, and environmental parameters, store them in the distributed database, and obtain a multi-dimensional time series dataset;

[0010] S1.2. If the data collection frequency is higher than the preset threshold, perform sharding processing on the collected data to obtain a sharded dataset;

[0011] S1.3. According to the sharded dataset, use time series analysis methods to extract the change trends of water temperature parameters and pollutant concentrations, and obtain a trend feature set;

[0012] S1.4. For the trend feature set, if the pollutant concentration exceeds the preset threshold, use the anomaly detection algorithm to judge the anomaly points and obtain an abnormal data point set;

[0013] S1.5. According to the abnormal data point set, use the clustering algorithm to group the abnormal points and obtain an abnormal point classification set;

[0014] S1.6. Through the abnormal point classification set, combined with environmental parameters, use the regression analysis method to predict the future changes of pollutant concentrations and obtain a predicted data sequence;

[0015] S1.7. For the predicted data sequence, store it in the distributed database, update the multi-dimensional time series dataset, and obtain an updated dataset.

[0016] S2. Extract the water temperature change rate, pollutant concentration fluctuation characteristics, and environmental parameter periodic characteristics from the multi-dimensional time series dataset, and use the principal component analysis method for dimensionality reduction to obtain a key feature vector set;

[0017] S2.1. Extract the water temperature change rate, pollutant concentration fluctuation characteristics, and environmental parameter periodic characteristics from the multi-dimensional time series dataset, and use the fast Fourier transform to decompose the time series to obtain a periodic component set;

[0018] S2.2. If the frequency components of the periodic component set exceed the preset threshold, use a band-pass filter to extract the main periodic characteristics and generate a periodic feature set;

[0019] S2.3. According to the periodic feature set, use the principal component analysis to perform dimensionality reduction processing on the multi-dimensional dataset to obtain a key feature vector set;

[0020] S2.4. For the key feature vector set, use the K-means clustering algorithm to group the feature vectors and obtain a feature classification set;

[0021] S2.5. If the within-cluster variance of the feature classification set is lower than the preset threshold, use the linear interpolation method to smooth the time series and generate a smoothed time series;

[0022] S2.6. Calculate the water temperature change rate and the fluctuation characteristics of pollutant concentration based on the smoothed time series using the sliding window technique to obtain a set of change trends;

[0023] S2.7. Generate the probability distributions of the water temperature change rate and the pollutant concentration using the kernel density estimation method through the set of change trends to obtain a set of distribution characteristics.

[0024] S3. For the set of key feature vectors, if the water temperature change rate exceeds a preset threshold and the fluctuation characteristics of the pollutant concentration match the historical pollution event pattern, mark it as a potential pollution event to obtain a preliminary event candidate set;

[0025] S3.1. Collect the water temperature change rate and pollutant concentration data in real time through sensors to obtain an original environmental data set;

[0026] S3.2. If the water temperature change rate exceeds the preset threshold, extract the abnormal water temperature data from the original environmental data set to obtain an abnormal water temperature subset;

[0027] S3.3. Use the K-means algorithm to perform clustering analysis on the abnormal water temperature subset and the pollutant concentration data to obtain the fluctuation characteristics of the pollutant concentration;

[0028] S3.4. Obtain the historical pollution event patterns through a pre-established historical pollution event database to obtain a set of pattern characteristics;

[0029] S3.5. If the similarity between the fluctuation characteristics of the pollutant concentration and the set of pattern characteristics exceeds the preset threshold, perform feature matching to determine potential pollution events;

[0030] S3.6. Mark the potential pollution events according to the feature matching results to generate a preliminary event candidate set;

[0031] S3.7. Use the random forest algorithm to classify the preliminary event candidate set to judge the final pollution events to obtain a set of confirmed events.

[0032] S4. Use the random forest algorithm to classify the preliminary event candidate set, combine the historical pollution event data and the environmental parameter characteristics to train an event detection model to obtain an optimized event detection model;

[0033] S4.1. Integrate the historical pollution event data and the environmental parameter characteristics through a data fusion method to obtain a comprehensive feature data set;

[0034] S4.2. Use the random forest algorithm to classify the initial event candidate set, combine the comprehensive feature data set to train an event detection model to obtain a preliminary event detection model;

[0035] S4.3. If the classification accuracy of the preliminary event detection model is lower than the preset threshold, adjust the parameters of the random forest algorithm through model optimization techniques to obtain an optimized event detection model;

[0036] S4.4. Classify the initial event candidate set again according to the optimized event detection model, judge the event detection accuracy of the classification result, and obtain a high-precision event classification result;

[0037] S4.5. Extract key environmental parameter features from the high-precision event classification result through feature extraction techniques to obtain a key feature subset;

[0038] S4.6. Update the comprehensive feature dataset with the key feature subset, and repeat training the random forest algorithm to obtain a final high-precision event detection model;

[0039] S4.7. Classify the new event candidate set through the final high-precision event detection model, judge the probability of a pollution event occurring, and obtain an event detection output.

[0040] S5. Obtain the classification result from the optimized event detection model. If the classification result is a pollution event and the confidence level is higher than the preset threshold, generate a pollution event warning signal to obtain a warning signal sequence;

[0041] S5.1. Obtain the original data stream from the environmental monitoring equipment, and use a preprocessing algorithm to remove noise to obtain a first data sequence;

[0042] S5.2. Input the first data sequence into the event detection model, and use the random forest algorithm for classification to obtain a classification result and a confidence level;

[0043] S5.3. If the classification result is a pollution event and the confidence level is higher than the preset threshold, generate a first warning signal to obtain a signal sequence;

[0044] S5.4. According to the signal sequence, use time series analysis to extract the time features of the signal to obtain a time feature set;

[0045] S5.5. Through the time feature set, use a clustering algorithm to divide the pollution event levels to obtain an event level sequence;

[0046] S5.6. If there are high-level events in the event level sequence, generate a second warning signal to obtain an enhanced signal sequence;

[0047] S5.7. According to the enhanced signal sequence, use message queue technology to push it to the downstream system to obtain a processing confirmation status.

[0048] S6. Use a long short-term memory network to perform time series analysis on the early warning signal sequence, and combine real-time monitoring data to predict the future water temperature anomaly trend, obtaining a water temperature anomaly prediction sequence;

[0049] S6.1. Use a long short-term memory network to perform time series modeling on the early warning signal sequence, obtain time series features, and get the feature extraction result;

[0050] S6.2. Perform data fusion on real-time monitoring data and the feature extraction result to obtain a fusion data set, getting water temperature time series data;

[0051] S6.3. If the time series data of the fusion data set meets the preset integrity threshold, use a long short-term memory network for trend prediction to obtain the water temperature change trend;

[0052] S6.4. According to the water temperature change trend, use an anomaly detection algorithm to judge anomaly points, obtain the anomaly point distribution, and get the water temperature anomaly sequence;

[0053] S6.5. If the number of anomaly points in the water temperature anomaly sequence exceeds the preset frequency threshold, analyze the anomaly sequence through a sliding window to obtain anomaly trend features, getting the anomaly trend description;

[0054] S6.6. According to the anomaly trend description, use a long short-term memory network to predict future time steps, obtain the future water temperature anomaly probability, and get the water temperature anomaly prediction sequence;

[0055] S6.7. Compare the water temperature anomaly prediction sequence with historical data to obtain the prediction deviation, getting the prediction sequence after deviation correction.

[0056] S7. Smooth the water temperature anomaly prediction sequence through the Kalman filter algorithm, and fuse multi-factor interference data to obtain a stable water temperature change trend sequence;

[0057] S7.1. Obtain the original water temperature prediction sequence and multi-factor interference data through sensors and store them as a time series data set;

[0058] S7.2. Use the Kalman filter algorithm to smooth the time series data set and update the state estimate to obtain the smoothed water temperature sequence;

[0059] S7.3. The Kalman filter formula is:

[0060] x k =Fx k-1 +Bu k +w k ,z k =Hx k +v k ,

[0061] where x k is the state vector, F is the state transition matrix, B is the control input matrix, u k is the control vector, w k is the process noise, z k is the observation vector, H is the observation matrix, v k is the observation noise;

[0062] S7.4. If the deviation between the smoothed water temperature sequence and the original sequence exceeds the preset threshold, adjust the sequence by weighted fusion of multi-factor interference data to obtain the corrected water temperature sequence;

[0063] S7.5. The weighted fusion formula is: y = w1y s + w2d i ,

[0064] where y is the corrected sequence, y s is the smoothed sequence, d i is the interference data, and w1 and w2 are the weight coefficients;

[0065] S7.6. According to the corrected water temperature sequence, calculate the mean value within the continuous time window using the moving average algorithm to generate the preliminary water temperature trend sequence;

[0066] S7.7. The moving average formula is:

[0067] m t = (y t-n +... + y t ) / n,

[0068] where m t is the trend value, y t is the corrected sequence value, and n is the window size;

[0069] S7.8. If there are mutation points in the preliminary water temperature trend sequence, smooth the mutation points through the locally weighted regression algorithm to obtain the optimized trend sequence;

[0070] S7.9. The locally weighted regression formula is:

[0071] yo = ∑(wiyi) / ∑(wi),

[0072] where yo is the optimized value, wi is the distance weight, and yi is the adjacent point value;

[0073] S7.10. Extract the long-term change characteristics from the optimized trend sequence to generate the stable water temperature change trend sequence;

[0074] S7.11. Verify the stable water temperature change trend sequence through time series analysis and judge the sequence stability. S8. Extract abnormal points from the stable water temperature change trend sequence. If the duration of the abnormal points exceeds the preset threshold, generate a final pollution event warning report to obtain the event warning result;

[0075] S8.1. Obtain the water temperature change trend sequence through time series analysis, extract the data sequence using the sliding window method to obtain the trend sequence;

[0076] S8.2. For the trend sequence, use the Isolation Forest algorithm to detect abnormal points and judge whether the abnormal points deviate from the normal water temperature change to obtain the set of abnormal points;

[0077] S8.3. From the set of abnormal points, obtain the duration of each abnormal point. By comparing the duration with the preset threshold, determine the abnormal points that exceed the threshold;

[0078] S8.4. If the duration of the abnormal points exceeds the preset threshold, extract the time series features of the abnormal points through time window analysis to obtain the event feature set;

[0079] S8.5. According to the event feature set, use the decision tree algorithm to classify the abnormal points, judge whether it is a pollution event, and generate the event determination result;

[0080] S8.6. For the event determination result, obtain the occurrence time and features of the pollution event to generate the warning result;

[0081] S8.7. Through the warning result, use the data serialization method to output the time and features of the pollution event to obtain the final warning data.

[0082] An apparatus for a water pollution monitoring method based on intelligent sensors, comprising:

[0083] Data acquisition and storage module: used to obtain real-time water temperature, pollutant concentration and environmental parameter data from the water body through the sensor network and store them in the distributed database to obtain a multi-dimensional time series data set;

[0084] Feature extraction and dimensionality reduction module: used to extract the water temperature change rate, pollutant concentration fluctuation characteristics and environmental parameter periodic characteristics from the multi-dimensional time series data set, and use the principal component analysis method for dimensionality reduction to obtain the key feature vector set;

[0085] Potential pollution event marking module: used for the key feature vector set. If the water temperature change rate exceeds the preset threshold and the pollutant concentration fluctuation characteristics match the historical pollution event pattern, mark it as a potential pollution event to obtain the preliminary event candidate set;

[0086] Event detection model training module: It is used to classify the preliminary event candidate set through the random forest algorithm, and combine the historical pollution event data and environmental parameter characteristics to train the event detection model, so as to obtain an optimized event detection model;

[0087] Early warning signal generation module: It is used to obtain the classification result from the optimized event detection model. If the classification result is a pollution event and the confidence level is higher than the preset threshold, it generates a pollution event early warning signal to obtain an early warning signal sequence;

[0088] Water temperature anomaly trend prediction module: It is used to perform time series analysis on the early warning signal sequence by using the long short-term memory network, and combine the real-time monitoring data to predict the future water temperature anomaly trend to obtain a water temperature anomaly prediction sequence;

[0089] Water temperature trend smoothing and fusion module: It is used to smooth the water temperature anomaly prediction sequence through the Kalman filter algorithm and fuse multi-factor interference data to obtain a stable water temperature change trend sequence;

[0090] Final early warning report generation module: It is used to extract abnormal points from the stable water temperature change trend sequence. If the duration of the abnormal points exceeds the preset threshold, it generates a final pollution event early warning report to obtain the event early warning result.

[0091] The present invention can achieve the following beneficial effects:

[0092] 1. The water temperature, pollutant concentration and environmental parameters of the water body are collected in real time through the sensor network to form a multi-dimensional time series data set, which can finely capture the dynamic changes of the water body state. Compared with traditional manual sampling and simple sensor monitoring, it greatly improves the frequency and comprehensiveness of data collection, provides a rich and accurate data basis for subsequent analysis, can detect subtle water quality changes in time, and effectively avoids the expansion of pollution problems caused by untimely monitoring.

[0093] 2. Using the principal component analysis method for dimensionality reduction and combining advanced technologies such as the random forest algorithm, it can quickly extract key features from a large amount of data and accurately judge potential pollution events. When a pollution event is confirmed and the confidence level is higher than the preset threshold, an early warning signal is quickly generated. This efficient data processing process greatly shortens the time from data collection to early warning compared with the cumbersome and inefficient analysis methods in traditional monitoring methods, and the early warning accuracy is significantly improved, which saves precious time for water pollution prevention and control.

[0094] 3. During the processing, fully consider the interference of multiple factors, fuse the interference data through the Kalman filter algorithm, smooth the water temperature anomaly prediction sequence, and obtain a stable water temperature change trend sequence. This enables the monitoring method to better adapt to the complex and changeable water environment, effectively reduce the interference of environmental factors on the monitoring results, accurately identify the water temperature anomaly points truly caused by pollution, and then generate the final pollution event warning report, significantly improving the reliability and stability of the monitoring results and providing a solid basis for water pollution prevention and control decision-making. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] The present invention will be further described below in conjunction with the drawings and embodiments:

[0096] Figure 1 is a flow chart of the present invention;

[0097] Figure 2 is a line graph showing the change of water quality indicators over time in a certain time period in this embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0098] The preferred solution is as Figure 1 , 2 shown. A water pollution monitoring method based on intelligent sensors, the steps are: S1. Obtain real-time water temperature, pollutant concentration and environmental parameter data from the water body through a sensor network, and store them in a distributed database to obtain a multi-dimensional time series data set;

[0099] S1.1. Obtain real-time data from the water body through a sensor network, including water temperature parameters, pollutant concentration and environmental parameters, and store them in a distributed database to obtain a multi-dimensional time series data set;

[0100] S1.2. If the data acquisition frequency is higher than the preset threshold, perform sharding processing on the acquired data to obtain a sharded data set;

[0101] S1.3. According to the sharded data set, adopt a time series analysis method to extract the change trends of water temperature parameters and pollutant concentration, and obtain a trend feature set;

[0102] S1.4. For the trend feature set, if the pollutant concentration exceeds the preset threshold, judge the anomaly points through an anomaly detection algorithm to obtain an abnormal data point set;

[0103] S1.5. According to the abnormal data point set, use a clustering algorithm to group the anomaly points to obtain an anomaly point classification set;

[0104] S1.6. Through the anomaly point classification set, combined with environmental parameters, adopt a regression analysis method to predict the future change of pollutant concentration to obtain a prediction data sequence;

[0105] S1.7. For the predicted data sequence, store it in a distributed database, update the multi-dimensional time series dataset, and obtain an updated dataset.

[0106] In this step, through the sensor network deployed in the water body, water temperature, pollutant concentrations (such as dissolved oxygen, ammonia nitrogen, heavy metals, etc.), and environmental parameters (such as pH value, turbidity, conductivity, etc.) can be collected in real time. For example, the DS18B20 temperature sensor is used to collect the water temperature with an accuracy of ±0.5°C and a sampling frequency of once per minute; an electrochemical sensor is used to measure dissolved oxygen with an accuracy of ±0.2 mg / L and a sampling interval of once every 5 minutes. These data are transmitted to the edge gateway through LoRa wireless communication technology, and the gateway uploads the data to the cloud distributed database, such as Cassandra, using the MQTT protocol to support high-concurrency writing and massive storage. In the database, the data is organized as a multi-dimensional time series. For example, with the timestamp as the primary key, fields such as water temperature, dissolved oxygen, and pH value are included. For these data, time series analysis algorithms can be used for preprocessing. For example, the moving window method is used to calculate the average value and standard deviation within the past 1 hour, the window size is 60 data points, and the step size is 1. Further, machine learning models can be applied for water quality prediction. For example, an LSTM neural network is used, the input is the multi-dimensional time series data of the past 24 hours, and the output is the water temperature change trend in the next 6 hours. When training the model, the mean squared error (MSE) is used as the loss function, the optimizer is selected as Adam, and the learning rate is set to 0.001. In this way, real-time monitoring and prediction of the water environment can be achieved.

[0107] S2. Extract the water temperature change rate, pollutant concentration fluctuation characteristics, and environmental parameter periodic characteristics from the multi-dimensional time series dataset, and use the principal component analysis method for dimensionality reduction to obtain a set of key feature vectors;

[0108] S2.1. Extract the water temperature change rate, pollutant concentration fluctuation characteristics, and environmental parameter periodic characteristics from the multi-dimensional time series dataset, and use the fast Fourier transform to decompose the time series to obtain a set of periodic components;

[0109] S2.2. If the frequency components of the set of periodic components exceed a preset threshold, then extract the main periodic characteristics through a band-pass filter to generate a set of periodic characteristics;

[0110] S2.3. According to the set of periodic characteristics, use the principal component analysis to perform dimensionality reduction processing on the multi-dimensional dataset to obtain a set of key feature vectors;

[0111] S2.4. For the set of key feature vectors, use the K-means clustering algorithm to group the feature vectors to obtain a set of feature classifications;

[0112] S2.5. If the within-cluster variance of the feature classification set is lower than a preset threshold, smooth the time series by linear interpolation to generate a smoothed time series;

[0113] S2.6. Based on the smoothed time series, use the sliding window technique to calculate the water temperature change rate and the pollutant concentration fluctuation characteristics to obtain a change trend set;

[0114] S2.7. Through the change trend set, use the kernel density estimation method to generate the probability distributions of the water temperature change rate and the pollutant concentration to obtain a distribution feature set.

[0115] In this step, when extracting the water temperature change rate from the multi-dimensional time series dataset, first calculate the water temperature difference between adjacent time points. For example, in the time series, if the water temperature rises from 20°C to 22°C, the change rate is 2°C / hour. For the pollutant concentration fluctuation characteristics, use the standard deviation calculation method. Suppose the measured values of a certain pollutant concentration within a day are [10, 12, 11, 13, 14], and its standard deviation is 1.58, which reflects the degree of concentration fluctuation. The periodic characteristics of environmental parameters are extracted through Fourier transform. For example, after performing Fourier transform on temperature data, it is found that its main period is 24 hours, indicating that the temperature has daily periodicity. Next, use the principal component analysis method to reduce the dimension of the extracted features. Suppose the original feature set contains 10 features such as the water temperature change rate, pollutant concentration fluctuation characteristics, and environmental parameter periodic characteristics. After principal component analysis, the first 3 principal components are obtained, and their cumulative variance contribution rate reaches 85%, indicating that these 3 principal components can better represent the original feature set. Finally, the obtained key feature vector set can be used for subsequent model training and prediction.

[0116] S3. For the key feature vector set, if the water temperature change rate exceeds the preset threshold and the pollutant concentration fluctuation characteristics match the historical pollution event pattern, mark it as a potential pollution event to obtain a preliminary event candidate set;

[0117] S3.1. Real-time collect the water temperature change rate and pollutant concentration data through sensors to obtain an original environmental dataset;

[0118] S3.2. If the water temperature change rate exceeds the preset threshold, extract the abnormal water temperature data from the original environmental dataset to obtain an abnormal water temperature subset;

[0119] S3.3. Use the K-means algorithm to perform clustering analysis on the abnormal water temperature subset and the pollutant concentration data to obtain the pollutant concentration fluctuation characteristics;

[0120] S3.4. Through a pre-established historical pollution event database, obtain the historical pollution event pattern to obtain a pattern feature set;

[0121] S3.5. If the similarity between the pollutant concentration fluctuation characteristics and the pattern feature set exceeds the preset threshold, perform feature matching to determine potential pollution events;

[0122] S3.6. Mark the potential pollution events according to the feature matching results to generate a preliminary event candidate set;

[0123] S3.7. Use the random forest algorithm to classify the preliminary event candidate set, judge the final pollution events, and obtain the confirmed event set.

[0124] In this step, when monitoring the water environment, first collect the water temperature data in real time through sensors and calculate its change rate. For example, at a certain moment, the water temperature is 25 °C, and after 10 minutes, it rises to 28 °C, and the change rate is 0.5 °C / minute. If the preset threshold is 0.3 °C / minute, it is determined that the water temperature change rate exceeds the threshold. At the same time, the pollutant concentration data is obtained through a spectral analyzer, and the time series analysis method is used to calculate its fluctuation characteristics. Assume that the current pollutant concentration is 50 mg / L, and the historical pollution event pattern shows that when the concentration fluctuates between 48 mg / L and 52 mg / L, pollution events usually occur. Through a pattern matching algorithm such as dynamic time warping (DTW), the current fluctuation characteristics are compared with the historical pattern. If the matching degree reaches more than 85%, it is determined as a potential pollution event. Finally, the data points that meet the above conditions are marked as potential pollution events to form a preliminary event candidate set for further analysis and processing.

[0125] S4. Classify the preliminary event candidate set through the random forest algorithm, combine the historical pollution event data and environmental parameter characteristics, train the event detection model, and obtain an optimized event detection model;

[0126] S4.1. Integrate the historical pollution event data and environmental parameter characteristics through a data fusion method to obtain a comprehensive feature data set;

[0127] S4.2. Use the random forest algorithm to classify the initial event candidate set, combine the comprehensive feature data set, and train the event detection model to obtain a preliminary event detection model;

[0128] S4.3. If the classification accuracy of the preliminary event detection model is lower than the preset threshold, adjust the parameters of the random forest algorithm through model optimization techniques to obtain an optimized event detection model;

[0129] S4.4. Re-classify the initial event candidate set according to the optimized event detection model, judge the event detection accuracy of the classification results, and obtain a high-precision event classification result;

[0130] S4.5. Extract the key environmental parameter characteristics from the high-precision event classification results through feature extraction techniques to obtain a key feature subset;

[0131] S4.6. Update the comprehensive feature dataset using the key feature subset, repeat the training of the random forest algorithm, and obtain the final high-precision event detection model;

[0132] S4.7. Classify the new event candidate set through the final high-precision event detection model, judge the probability of the pollution event occurring, and obtain the event detection output.

[0133] In this step, an initial model is constructed through RandomForestClassifier in Scikit-learn, the number of decision trees is set to 200, the maximum depth is 15, the Gini coefficient is used as the splitting criterion, and the sample is divided into a training set and a test set in a 7:3 ratio. In the feature engineering stage, the variance threshold method (threshold 0.01) is used to filter out low-variance features, and then the top 10 important features are selected through the mutual information method. For example, the joint distribution of wind speed and sulfur dioxide concentration shows a significant correlation of 0.35.

[0134] S5. Obtain the classification result from the optimized event detection model. If the classification result is a pollution event and the confidence level is higher than the preset threshold, generate a pollution event warning signal to obtain a warning signal sequence;

[0135] S5.1. Obtain the original data stream from the environmental monitoring equipment, and use a preprocessing algorithm to remove noise to obtain the first data sequence;

[0136] S5.2. Input the first data sequence into the event detection model and use the random forest algorithm for classification to obtain the classification result and the confidence level;

[0137] S5.3. If the classification result is a pollution event and the confidence level is higher than the preset threshold, generate the first warning signal to obtain a signal sequence;

[0138] S5.4. According to the signal sequence, use time series analysis to extract the time features of the signal to obtain a time feature set;

[0139] S5.5. Through the time feature set, use a clustering algorithm to divide the pollution event levels to obtain an event level sequence;

[0140] S5.6. If there are high-level events in the event level sequence, generate the second warning signal to obtain an enhanced signal sequence;

[0141] S5.7. Push the enhanced signal sequence to the downstream system using message queue technology to obtain the processing confirmation status.

[0142] In this step, in the optimized event detection model, first, the convolutional neural network (CNN) is used to extract features from the input environmental monitoring data. Assume that the input data is the air quality index (AQI) sequence of a certain area in the past 24 hours. The model is trained using 3 convolutional layers and 2 fully connected layers. The size of the convolutional kernel is 3, the stride is 1, and the activation function is ReLU. After training, the classification accuracy of the model for pollution events reaches 95%. In the classification stage, the model outputs the classification results and their confidence levels at each time point. For example, the confidence level that a certain time point is classified as a pollution event is 0.92, which is higher than the preset threshold of 0.9. Therefore, a pollution event warning signal is generated. The warning signal sequence is further processed by the time series analysis method. The autoregressive integrated moving average model (ARIMA) is used to smooth and predict the warning signal. Assume that the parameters of the ARIMA model are (p = 2, d = 1, q = 1), and the changing trend of the warning signal in the next 3 hours is predicted. Finally, the warning signal sequence is stored in the database and pushed to the monitoring platforms of relevant departments in real time through the message queue system to ensure timely response and processing. The whole process realizes the fully automated processing from data collection to warning signal generation, improving the efficiency and accuracy of pollution event detection and warning. S6. Use the long short-term memory network to perform time series analysis on the warning signal sequence, combine with real-time monitoring data, predict the future water temperature anomaly trend, and obtain the water temperature anomaly prediction sequence;

[0143] S6.1. Use the long short-term memory network to perform time series modeling on the warning signal sequence, obtain the time series features, and get the feature extraction result;

[0144] S6.2. Through data fusion of the real-time monitoring data and the feature extraction result, obtain the fusion data set and get the water temperature time series data;

[0145] S6.3. If the time series data of the fusion data set meets the preset integrity threshold, use the long short-term memory network for trend prediction to obtain the water temperature changing trend;

[0146] S6.4. According to the water temperature changing trend, use the anomaly detection algorithm to judge the anomaly points, obtain the anomaly point distribution, and get the water temperature anomaly sequence;

[0147] S6.5. If the number of anomaly points in the water temperature anomaly sequence exceeds the preset frequency threshold, analyze the anomaly sequence through a sliding window to obtain the anomaly trend features and get the anomaly trend description;

[0148] S6.6. According to the anomaly trend description, use the long short-term memory network to predict the future time steps, obtain the future water temperature anomaly probability, and get the water temperature anomaly prediction sequence;

[0149] S6.7. By comparing the water temperature anomaly prediction sequence with historical data, obtain the prediction deviation, and get the prediction sequence after deviation correction.

[0150] In this step, construct a long short-term memory network model including an input layer, a hidden layer, and an output layer. The input layer receives the water temperature monitoring data sequence of the past 72 hours, and the time step is set to 6 hours, that is, 12 data points are input at each time step, and the data format is [25.3, 25.5, 25.7,...]. The hidden layer adopts a two-layer LSTM structure, with 128 neurons in each layer. The activation function uses tanh, and the dropout rate is set to 0.2 to prevent overfitting. The output layer is mapped to the water temperature prediction values for the next 24 hours through a fully connected layer, and a linear activation function is used. When training the model, the mean square error is used as the loss function, the optimizer selects Adam, the initial learning rate is set to 0.001, the batch size is 32, and it iterates 100 rounds.

[0151] S7. Smooth the water temperature anomaly prediction sequence through the Kalman filter algorithm, fuse multi-factor interference data, and obtain a stable water temperature change trend sequence;

[0152] S7.1. Obtain the original water temperature prediction sequence and multi-factor interference data through sensors, and store them as a time series data set;

[0153] S7.2. Adopt the Kalman filter algorithm to smooth the time series data set, update the state estimate, and obtain a smoothed water temperature sequence;

[0154] S7.3. The Kalman filter formula is:

[0155] x k =Fx k-1 +Bu k +w k ,z k =Hx k +v k ,

[0156] where x k is the state vector, F is the state transition matrix, B is the control input matrix, u k is the control vector, w k is the process noise, z k is the observation vector, H is the observation matrix, v k is the observation noise;

[0157] S7.4. If the deviation between the smoothed water temperature sequence and the original sequence exceeds the preset threshold, then adjust the sequence by weighted fusion of multi-factor interference data to obtain a corrected water temperature sequence;

[0158] S7.5. The weighted fusion formula is: y=w1y s +w2di ,

[0159] where y is the corrected sequence, y s is the smoothed sequence, d i is the interference data, and w1 and w2 are the weight coefficients;

[0160] S7.6. According to the corrected water temperature sequence, use the moving average algorithm to calculate the mean value within the continuous time window to generate the preliminary water temperature trend sequence;

[0161] S7.7. The moving average formula is:

[0162] m t =(y t-n +...+y t ) / n,

[0163] where m t is the trend value, y t is the corrected sequence value, and n is the window size;

[0164] S7.8. If there is a mutation point in the preliminary water temperature trend sequence, smooth the mutation point through the locally weighted regression algorithm to obtain the optimized trend sequence;

[0165] S7.9. The locally weighted regression formula is:

[0166] y o =∑(w i y i ) / ∑(w i ),

[0167] where y o is the optimized value, w i is the distance weight, and y i is the neighboring point value;

[0168] S7.10. Extract the long-term change characteristics from the optimized trend sequence to generate the stable water temperature change trend sequence;

[0169] S7.11. Verify the stable water temperature change trend sequence through time series analysis to judge the sequence stability. S8. Extract the abnormal points from the stable water temperature change trend sequence. If the duration of the abnormal points exceeds the preset threshold, generate the final pollution event warning report to obtain the event warning result;

[0170] In this step, in the Kalman filter algorithm, it is first necessary to establish a state space model of the water temperature. Assuming that the change in water temperature follows a linear dynamic system, the state vector is the current water temperature value, and the observation vector is the water temperature value measured by the sensor. Set the initial water temperature to 25°C, the state transition matrix to 1, the process noise covariance to 0.1, and the observation noise covariance to 0.5. Through the prediction step of the Kalman filter, using the state transition matrix and the process noise covariance, predict the water temperature at the next moment to be 25.1°C. In the update step, combine the observed value and the predicted value, calculate the Kalman gain to be 0.167, and update the state estimate to 25.083°C. In order to fuse multi-factor interference data, introduce external factors such as air temperature and wind speed as input variables, and establish a multi-variable state space model. Assume the air temperature is 30°C and the wind speed is 5 m / s. Through the extended Kalman filter algorithm, incorporate the external factors into the state vector, and recalculate the state transition matrix and the observation matrix. After multiple iterations, obtain the smoothed water temperature change trend sequence, such as 25.083°C, 25.167°C, 25.250°C, etc. These sequences can effectively remove noise and reflect the true change trend of the water temperature.

[0171] S8.1. Obtain the water temperature change trend sequence through time series analysis, adopt the sliding window method to extract the data sequence, and obtain the trend sequence;

[0172] S8.2. For the trend sequence, adopt the isolation forest algorithm to detect outliers, and determine whether the outliers deviate from the normal water temperature change to obtain the outlier set;

[0173] S8.3. From the outlier set, obtain the duration of each outlier, and determine the outliers exceeding the threshold by comparing the duration with the preset threshold;

[0174] S8.4. If the duration of the outlier exceeds the preset threshold, then through time window analysis, extract the time series features of the outlier to obtain the event feature set;

[0175] S8.5. According to the event feature set, adopt the decision tree algorithm to classify the outliers and determine whether it is a pollution event to generate the event determination result;

[0176] S8.6. For the event determination result, obtain the occurrence time and features of the pollution event to generate the early warning result;

[0177] S8.7. Through the early warning result, adopt the data serialization method to output the time and features of the pollution event to obtain the final early warning data.

[0178] An apparatus for a water pollution monitoring method based on intelligent sensors, comprising:

[0179] Data Acquisition and Storage Module: It is used to obtain real-time water temperature, pollutant concentration, and environmental parameter data from water bodies through a sensor network, store them in a distributed database, and obtain a multi-dimensional time series data set;

[0180] Feature Extraction and Dimensionality Reduction Module: It is used to extract the water temperature change rate, pollutant concentration fluctuation characteristics, and environmental parameter periodic characteristics from the multi-dimensional time series data set, and use the principal component analysis method for dimensionality reduction to obtain a key feature vector set;

[0181] Potential Pollution Event Marking Module: It is used to target the key feature vector set. If the water temperature change rate exceeds the preset threshold and the pollutant concentration fluctuation characteristics match the historical pollution event pattern, it is marked as a potential pollution event to obtain a preliminary event candidate set;

[0182] Event Detection Model Training Module: It is used to classify the preliminary event candidate set through the random forest algorithm, combine historical pollution event data and environmental parameter characteristics, and train an event detection model to obtain an optimized event detection model;

[0183] Early Warning Signal Generation Module: It is used to obtain the classification result from the optimized event detection model. If the classification result is a pollution event and the confidence level is higher than the preset threshold, it generates a pollution event early warning signal to obtain an early warning signal sequence;

[0184] Water Temperature Abnormal Trend Prediction Module: It is used to perform time series analysis on the early warning signal sequence using a long short-term memory network, combine real-time monitoring data, and predict the future water temperature abnormal trend to obtain a water temperature abnormal prediction sequence;

[0185] Water Temperature Trend Smoothing and Fusion Module: It is used to smooth the water temperature abnormal prediction sequence through the Kalman filter algorithm, fuse multi-factor interference data, and obtain a stable water temperature change trend sequence;

[0186] Final Early Warning Report Generation Module: It is used to extract abnormal points from the stable water temperature change trend sequence. If the duration of the abnormal points exceeds the preset threshold, it generates a final pollution event early warning report to obtain the event early warning result.

[0187] In this step, the original data sequence collected from the water temperature monitoring sensor is smoothed by the sliding window method. The window width is set to 10 minutes, and the median filtering algorithm is used to eliminate instantaneous fluctuations. For example, when the sequence values at a certain moment are [25.1, 25.3, 24.9, 25.0, 38.6, 25.2, 25.1], the stable sequence [25.1, 25.1, 25.0, 25.1] is output after filtering, and 38.6 is identified as noise and removed. The 3σ principle is used to detect anomalies in the processed sequence. When a data point deviates from the mean by more than 3 times the standard deviation, it is marked as an anomaly. For example, when the sequence mean is 25.0 °C and the standard deviation is 0.2 °C, 26.0 °C will be determined as an anomaly. For continuous anomaly points, the duration threshold is used for judgment. The threshold is set to 30 minutes. If the anomaly lasts longer than the threshold, an early warning is triggered. For example, if abnormal values of 26.1 - 26.5 °C continuously appear in a certain water area from 12:00 to 12:35, the system automatically generates a pollution event report, which includes core parameters such as the start time of the anomaly, the duration, and the maximum deviation value (such as +1.5 °C). The pollution probability is evaluated through the Bayesian network model. When the probability exceeds 85%, a red early warning is pushed to the supervision platform.

[0188] The above embodiments are only the preferred technical solutions of the present invention and should not be regarded as limitations on the present invention. The protection scope of the present invention shall be the technical solutions recorded in the claims, including the equivalent replacement solutions of the technical features in the technical solutions recorded in the claims. That is, the equivalent replacement improvements within this scope are also within the protection scope of the present invention.

Claims

1. A water pollution monitoring method based on intelligent sensors, characterized in that including the following methods: Obtain real-time water temperature, pollutant concentration, and environmental parameter data from the water body through a sensor network, and store it in a distributed database to obtain a multi-dimensional time series dataset; Extract the water temperature change rate, pollutant concentration fluctuation characteristics, and environmental parameter periodic characteristics from the multi-dimensional time series dataset, and use the principal component analysis method for dimensionality reduction to obtain a key feature vector set; For the key feature vector set, if the water temperature change rate exceeds the preset threshold and the pollutant concentration fluctuation characteristics match the historical pollution event pattern, mark it as a potential pollution event to obtain a preliminary event candidate set; Use the random forest algorithm to classify the preliminary event candidate set, combine historical pollution event data and environmental parameter characteristics, and train an event detection model to obtain an optimized event detection model; Obtain the classification result from the optimized event detection model. If the classification result is a pollution event and the confidence level is higher than the preset threshold, generate a pollution event warning signal to obtain a warning signal sequence; Use a long short-term memory network to perform time series analysis on the warning signal sequence, combine real-time monitoring data, and predict the future water temperature anomaly trend to obtain a water temperature anomaly prediction sequence; Use the Kalman filter algorithm to smooth the water temperature anomaly prediction sequence, fuse multi-factor interference data, and obtain a stable water temperature change trend sequence; Extract abnormal points from the stable water temperature change trend sequence. If the duration of the abnormal points exceeds the preset threshold, generate a final pollution event warning report to obtain the event warning result.

2. The water pollution monitoring method based on an intelligent sensor according to claim 1, wherein: The method of obtaining real-time water temperature, pollutant concentration, and environmental parameter data from the water body through a sensor network, storing it in a distributed database, and obtaining a multi-dimensional time series dataset; includes the following steps: S1.

1. Obtain real-time data from the water body through a sensor network, including water temperature parameters, pollutant concentration, and environmental parameters, and store it in a distributed database to obtain a multi-dimensional time series dataset; S1.

2. If the data collection frequency is higher than the preset threshold, perform sharding processing on the collected data to obtain a sharded dataset; S1.

3. According to the sharded dataset, use the time series analysis method to extract the change trends of water temperature parameters and pollutant concentration to obtain a trend feature set; S1.

4. For the trend feature set, if the pollutant concentration exceeds the preset threshold, use an anomaly detection algorithm to judge abnormal points to obtain an abnormal data point set; S1.

5. According to the abnormal data point set, use a clustering algorithm to group the abnormal points to obtain an abnormal point classification set; S1.

6. Through the abnormal point classification set, combine environmental parameters, and use the regression analysis method to predict the future change of pollutant concentration to obtain a prediction data sequence; S1.

7. For the prediction data sequence, store it in a distributed database, update the multi-dimensional time series dataset, and obtain an updated dataset.

3. The water pollution monitoring method based on an intelligent sensor according to claim 1, characterized in that: The method of extracting the water temperature change rate, pollutant concentration fluctuation characteristics, and environmental parameter periodic characteristics from the multi-dimensional time series dataset, and using the principal component analysis method for dimensionality reduction to obtain a key feature vector set; includes the following steps: S2.

1. Extract the water temperature change rate, pollutant concentration fluctuation characteristics, and environmental parameter periodic characteristics from the multi-dimensional time series dataset. Use the fast Fourier transform to decompose the time series to obtain a set of periodic components. S2.

2. If the frequency components of the set of periodic components exceed a preset threshold, extract the main periodic characteristics through a band-pass filter to generate a set of periodic characteristics. S2.

3. According to the set of periodic characteristics, perform dimensionality reduction processing on the multi-dimensional dataset using principal component analysis to obtain a set of key feature vectors. S2.

4. For the set of key feature vectors, use the K-means clustering algorithm to group the feature vectors to obtain a set of feature classifications. S2.

5. If the within-cluster variance of the set of feature classifications is lower than a preset threshold, smooth the time series through linear interpolation to generate a smoothed time series. S2.

6. According to the smoothed time series, use the sliding window technique to calculate the water temperature change rate and pollutant concentration fluctuation characteristics to obtain a set of change trends. S2.

7. Through the set of change trends, use the kernel density estimation method to generate the probability distributions of the water temperature change rate and pollutant concentration to obtain a set of distribution characteristics.

4. A water pollution monitoring method based on intelligent sensors according to claim 1, characterized in that: Regarding the set of key feature vectors, if the water temperature change rate exceeds a preset threshold and the pollutant concentration fluctuation characteristics match the historical pollution event pattern, it is marked as a potential pollution event to obtain a preliminary event candidate set; it includes the following steps: S3.

1. Real-time collect the water temperature change rate and pollutant concentration data through sensors to obtain an original environmental dataset. S3.

2. If the water temperature change rate exceeds a preset threshold, extract the abnormal water temperature data from the original environmental dataset to obtain an abnormal water temperature subset. S3.

3. Use the K-means algorithm to perform clustering analysis on the abnormal water temperature subset and pollutant concentration data to obtain the pollutant concentration fluctuation characteristics. S3.

4. Through a pre-established historical pollution event database, obtain the historical pollution event patterns to obtain a set of pattern characteristics. S3.

5. If the similarity between the pollutant concentration fluctuation characteristics and the set of pattern characteristics exceeds a preset threshold, perform feature matching to determine potential pollution events. S3.

6. According to the feature matching results, mark the potential pollution events to generate a preliminary event candidate set. S3.

7. Use the random forest algorithm to classify the preliminary event candidate set to judge the final pollution events to obtain a set of confirmed events.

5. A water pollution monitoring method based on intelligent sensors according to claim 1, characterized in that: Regarding the classification of the preliminary event candidate set through the random forest algorithm, combine the historical pollution event data and environmental parameter characteristics to train an event detection model to obtain an optimized event detection model. It includes the following steps: S4.

1. Integrate the historical pollution event data and environmental parameter characteristics through a data fusion method to obtain a comprehensive feature dataset. S4.

2. Use the random forest algorithm to classify the initial event candidate set, and combine the comprehensive feature dataset to train an event detection model to obtain a preliminary event detection model. S4.

3. If the classification accuracy of the preliminary event detection model is lower than a preset threshold, adjust the parameters of the random forest algorithm through model optimization techniques to obtain an optimized event detection model. S4.

4. Reclassify the initial event candidate set according to the optimized event detection model, judge the event detection accuracy of the classification result, and obtain the event classification result with high accuracy; S4.

5. Extract the key environmental parameter features from the event classification result with high accuracy through feature extraction technology to obtain the key feature subset; S4.

6. Update the comprehensive feature dataset with the key feature subset, retrain the random forest algorithm, and obtain the final event detection model with high accuracy; S4.

7. Classify the new event candidate set through the final event detection model with high accuracy, judge the probability of the pollution event occurring, and obtain the event detection output.

6. The water pollution monitoring method based on an intelligent sensor according to claim 1, wherein: Obtaining the classification result from the optimized event detection model, if the classification result is a pollution event and the confidence level is higher than the preset threshold, generating a pollution event warning signal to obtain a warning signal sequence; including the following steps: S5.

1. Obtain the original data stream from the environmental monitoring device, and use the preprocessing algorithm to remove noise to obtain the first data sequence; S5.

2. Input the first data sequence into the event detection model, and use the random forest algorithm for classification to obtain the classification result and the confidence level; S5.

3. If the classification result is a pollution event and the confidence level is higher than the preset threshold, generate a first warning signal to obtain a signal sequence; S5.

4. According to the signal sequence, use time series analysis to extract the time features of the signal to obtain the time feature set; S5.

5. Through the time feature set, use the clustering algorithm to divide the pollution event levels to obtain the event level sequence; S5.

6. If there is a high-level event in the event level sequence, generate a second warning signal to obtain an enhanced signal sequence; S5.

7. Push to the downstream system according to the enhanced signal sequence using the message queue technology to obtain the processing confirmation status.

7. A water pollution monitoring method based on an intelligent sensor according to claim 1, characterized in that: Performing time series analysis on the warning signal sequence using the long short-term memory network, combining with real-time monitoring data, and predicting the future water temperature anomaly trend to obtain the water temperature anomaly prediction sequence; including the following steps: S6.

1. Perform time series modeling on the warning signal sequence using the long short-term memory network to obtain the time series features and obtain the feature extraction result; S6.

2. Perform data fusion on the real-time monitoring data and the feature extraction result to obtain the fusion dataset and obtain the water temperature time series data; S6.

3. If the time series data of the fusion dataset meets the preset integrity threshold, use the long short-term memory network for trend prediction to obtain the water temperature change trend; S6.

4. According to the water temperature change trend, use the anomaly detection algorithm to judge the anomaly points, obtain the anomaly point distribution, and obtain the water temperature anomaly sequence; S6.

5. If the number of anomaly points in the water temperature anomaly sequence exceeds the preset frequency threshold, analyze the anomaly sequence through a sliding window to obtain the anomaly trend features and obtain the anomaly trend description; S6.

6. According to the anomaly trend description, use the long short-term memory network to predict the future time steps to obtain the future water temperature anomaly probability and obtain the water temperature anomaly prediction sequence; S6.

7. Compare the water temperature anomaly prediction sequence with the historical data to obtain the prediction deviation and obtain the prediction sequence after deviation correction.

8. A water pollution monitoring method based on intelligent sensors according to claim 1, characterized in that: The abnormal prediction sequence of water temperature is smoothed by the Kalman filtering algorithm, and multi-factor interference data is fused to obtain a stable water temperature change trend sequence, including the following steps: S7.

1. Obtain the original water temperature prediction sequence and multi-factor interference data through sensors and store them as a time series data set; S7.

2. Use the Kalman filtering algorithm to smooth the time series data set and update the state estimation to obtain a smoothed water temperature sequence; S7.

3. The Kalman filtering formula is: x k = Fx k-1 + Bu k + w k ,z k = Hx k + v k , where x k is the state vector, F is the state transition matrix, B is the control input matrix, u k is the control vector, w k is the process noise, z k is the observation vector, H is the observation matrix, v k is the observation noise; S7.

4. If the deviation between the smoothed water temperature sequence and the original sequence exceeds the preset threshold, adjust the sequence by weighted fusion of multi-factor interference data to obtain a corrected water temperature sequence; S7.

5. The weighted fusion formula is: y = w1y s + w2d i , where y is the corrected sequence, y s is the smoothed sequence, d i is the interference data, and w1 and w2 are the weight coefficients; S7.

6. According to the corrected water temperature sequence, use the moving average algorithm to calculate the mean value within a continuous time window to generate a preliminary water temperature trend sequence; S7.

7. The moving average formula is: m t = (y t-n +... + y t ) / n, where m t is the trend value, y t is the corrected sequence value, and n is the window size; S7.

8. If there are mutation points in the preliminary water temperature trend sequence, smooth the mutation points through the locally weighted regression algorithm to obtain an optimized trend sequence; S7.

9. The locally weighted regression formula is: y o = ∑(w i y i ) / ∑(w i ), where y o is the optimized value, w i is the distance weight, and y i is the neighboring point value; S7.

10. Extract the long-term change characteristics from the optimized trend sequence to generate a stable water temperature change trend sequence; S7.

11. Verify the stable water temperature change trend sequence through time series analysis and judge the sequence stability.

9. A water pollution monitoring method based on an intelligent sensor according to claim 1, characterized in that: The abnormal points are extracted from the stable water temperature change trend sequence. If the duration of the abnormal points exceeds the preset threshold, a final pollution event warning report is generated to obtain the event warning result, including the following steps: S8.

1. Obtain the water temperature change trend sequence through time series analysis, and use the sliding window method to extract the data sequence to obtain the trend sequence; S8.

2. For the trend sequence, use the isolation forest algorithm to detect abnormal points and judge whether the abnormal points deviate from the normal water temperature change to obtain an abnormal point set; S8.

3. From the abnormal point set, obtain the duration of each abnormal point, and determine the abnormal points exceeding the threshold by comparing the duration with the preset threshold; S8.

4. If the duration of the abnormal points exceeds the preset threshold, extract the time series characteristics of the abnormal points through time window analysis to obtain an event feature set; S8.

5. According to the event feature set, use the decision tree algorithm to classify the abnormal points to judge whether it is a pollution event and generate an event determination result; S8.

6. For the event determination result, obtain the occurrence time and characteristics of the pollution event to generate a warning result; S8.

7. Through the warning result, use the data serialization method to output the time and characteristics of the pollution event to obtain the final warning data.

10. The device for a water pollution monitoring method based on an intelligent sensor according to any one of claims 1-9, characterized in that: Including: Data acquisition and storage module: used to obtain real-time water temperature, pollutant concentration and environmental parameter data from the water body through a sensor network and store them in a distributed database to obtain a multi-dimensional time series data set; Feature extraction and dimensionality reduction module: used to extract the water temperature change rate, pollutant concentration fluctuation characteristics and environmental parameter periodic characteristics from the multi-dimensional time series data set, and use the principal component analysis method for dimensionality reduction to obtain a key feature vector set; Potential Pollution Event Marking Module: For the key feature vector set, if the water temperature change rate exceeds the preset threshold and the pollutant concentration fluctuation characteristics match the historical pollution event pattern, it is marked as a potential pollution event to obtain a preliminary event candidate set; Event Detection Model Training Module: Used to classify the preliminary event candidate set through the random forest algorithm, and combine historical pollution event data and environmental parameter characteristics to train the event detection model to obtain an optimized event detection model; Early Warning Signal Generation Module: Used to obtain the classification result from the optimized event detection model. If the classification result is a pollution event and the confidence level is higher than the preset threshold, a pollution event early warning signal is generated to obtain an early warning signal sequence; Water Temperature Abnormal Trend Prediction Module: Used to perform time series analysis on the early warning signal sequence using a long short-term memory network, and combine real-time monitoring data to predict the future water temperature abnormal trend to obtain a water temperature abnormal prediction sequence; Water Temperature Trend Smoothing and Fusion Module: Used to smooth the water temperature abnormal prediction sequence through the Kalman filter algorithm and fuse multi-factor interference data to obtain a stable water temperature change trend sequence; Final Early Warning Report Generation Module: Used to extract abnormal points from the stable water temperature change trend sequence. If the duration of the abnormal points exceeds the preset threshold, a final pollution event early warning report is generated to obtain the event early warning result.

Citation Information

Cited By

  • Urban atmospheric environment monitoring method and system based on big data analysis

    CN120561655A

  • Sewage pipe network rainfall-inflow event identification method based on semi-supervised iterative training

    CN120597183A

  • Industrial wastewater treatment pollutant discharge monitoring method and system

    CN120975559A

  • Sudden pollution abnormity early warning method and system for multi-dimensional water quality index correlation analysis

    CN121616128A