A water quality monitoring system model construction method, device and computer equipment based on edge computing

The water quality monitoring system, which combines edge computing and deep learning models, solves the real-time and accuracy problems of water quality monitoring systems in existing technologies, achieves rapid response and efficient water quality assessment, and improves the scientificity and efficiency of water resources management.

CN119313220BActive Publication Date: 2025-09-30BEIHANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411566198.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-09-30
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

The existing water quality monitoring system relies on centralized data processing, which has data transmission delays and lacks real-time performance. It cannot adapt to the complex and changing water quality environment, resulting in the inability to detect abnormal situations in a timely manner, affecting the accuracy and efficiency of monitoring.

Method used

A water quality monitoring system model based on edge computing is adopted. Water quality parameters are collected through the edge end, and the water quality monitoring model is constructed using BP neural network and support vector machine. The model parameters are optimized by combining cuckoo search algorithm and Nelder-Mead algorithm. Expert scoring method and logistic regression model are used for anomaly detection, and the comprehensive weighted index method is used to evaluate the water quality status.

Benefits of technology

It achieves rapid response to water quality changes, improves data processing speed and the accuracy of water quality prediction, reduces false alarm rate, can timely identify water quality anomalies and provide reliable decision support, and improves the efficiency of the monitoring system and the scientific nature of water resources management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119313220B_ABST
    Figure CN119313220B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and computer equipment for constructing a water quality monitoring system model based on edge computing, and relates to the field of water quality monitoring technology. The present invention aims to solve the problems of data processing delay and lack of real-time performance in traditional water quality monitoring technology. The key steps include arranging the acquisition end at the key monitoring points of the water body to collect water quality parameters, sending them to the edge end for real-time data processing, and combining BP neural network and support vector machine to perform water quality prediction and anomaly detection to achieve rapid response to water quality changes. At the same time, the combination of deep learning and support vector machine is adopted to improve the accuracy of prediction and anomaly detection capabilities. By comprehensively evaluating the water quality situation through the comprehensive weighted index method, managers can identify pollution sources more quickly and take effective countermeasures. The present invention not only improves the efficiency and accuracy of water quality monitoring, but also provides solid technical support for the sustainable management of water resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of water quality monitoring technology, and specifically to a method, device, and computer equipment for constructing a water quality monitoring system model based on edge computing. Background Art

[0002] Water quality monitoring involves the systematic measurement and analysis of physical, chemical, and biological parameters in water bodies to assess water quality and its impact. With the acceleration of industrialization and urbanization, water pollution is becoming increasingly serious, impacting both human health and the ecological environment. Water quality deterioration stems not only from the discharge of industrial wastewater, agricultural wastewater, and urban and rural sewage, but is also influenced by multiple factors, including climate change, surface water flow, and human activities. Therefore, timely and accurate water quality monitoring is crucial.

[0003] Water quality monitoring technology is a crucial tool for assessing and managing water resources. It aims to ensure that water quality meets environmental standards and safety requirements through regular testing of physical, chemical, and biological indicators in water. This technology, which combines sensors, data collection, and analysis methods, can monitor changes in water pollutant concentrations in real time, identify sources of water pollution, and provide a scientific basis for water resource management. Technological advances, including the application of automated monitoring systems and remote transmission technologies, have made water quality monitoring more efficient and accurate, promoting the protection and sustainable use of the aquatic ecosystem.

[0004] With the acceleration of industrialization and urbanization, water pollution is becoming increasingly serious, impacting the ecological environment and human health. Existing water quality monitoring systems often rely on centralized data processing, which is subject to problems such as data transmission delays, insufficient real-time performance, and limited processing capacity. Furthermore, traditional monitoring technologies often fail to adapt to complex and changing water quality environments, resulting in inability to detect anomalies in a timely manner, thus missing the optimal opportunity for action. These technical bottlenecks limit the accuracy and efficiency of water quality monitoring, making it difficult to meet the growing demand for water resource protection.

[0005] Deficiencies in existing technologies:

[0006] First, traditional methods usually rely on manual sampling and laboratory analysis, which not only leads to low data update frequency, but also slow response when pollution incidents occur, and cannot provide early warning information in a timely manner; second, the sensitivity and accuracy of existing sensors in detecting specific pollutants are often insufficient, and they are easily disturbed by environmental changes, which affects the reliability of monitoring results; in addition, data processing and analysis mostly rely on experience and judgment, lack of systematization and intelligence, resulting in challenges in rapid assessment of water quality status and decision support; finally, the layout and coverage of the monitoring system are often unable to adapt to complex water environments, making it difficult to effectively monitor the water quality conditions in some areas in real time, thus affecting the scientific nature and effectiveness of overall water resources management.

[0007] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention

[0008] The purpose of the present invention is to provide a water quality monitoring system model construction method, device and computer equipment based on edge computing to solve the problems raised in the above background technology.

[0009] To achieve the above object, the present invention provides the following technical solutions:

[0010] A method for constructing a water quality monitoring system model based on edge computing, the specific steps include:

[0011] Step 1: The collection end is placed at a key location in the water body to collect water quality parameters and send them to the edge end. The edge end assigns a corresponding water quality index to each water quality parameter at each timestamp based on an expert scoring method and pre-processes the water quality parameters. The pre-processed water quality parameters are organized into a sample dataset. The water quality parameters include water temperature, pH value, suspended solids, conductivity, oxygen demand, and chemical oxygen demand, a total of six water quality indicators.

[0012] Step 2: Build a water quality monitoring model based on a BP neural network at the edge. The water quality parameters in the sample dataset are used as input, and the corresponding water quality index is used as a label. The water quality monitoring model is trained and the model parameters are optimized using the cuckoo search algorithm and the Nelder-Mead algorithm.

[0013] Step 3: Use a support vector machine (SVM) to build an anomaly detection model at the edge. This model takes the feature vector of water quality parameters as input and the status label of the corresponding timestamp assigned by the expert scoring method as output. The model is trained and the probability of normal water quality is obtained using a logistic regression model.

[0014] Step 4: Collect the current water quality parameters and obtain the single indicator score of each water quality parameter based on the comprehensive weighted index method, and then calculate the comprehensive assessment score based on the single indicator score;

[0015] Step 5: Input the current water quality parameters into the corresponding model to obtain the water quality index and the probability that the water quality is in a normal state, and combine them with the comprehensive assessment score to produce a comprehensive water quality index. Compare the comprehensive water quality index with the preset water quality index threshold to determine the current water quality situation.

[0016] Furthermore, the specific logic for obtaining the water quality parameter sample data set is as follows:

[0017] The data collection end includes temperature sensors, oxygen demand sensors, chemical oxygen demand sensors, pH sensors, conductivity sensors, and suspended matter sensors. The middle layer, mainstream area, and strong current area of ​​the water body are marked as key locations, and a monitoring point is arranged every 100 meters. Temperature sensors, oxygen demand sensors, and chemical oxygen demand sensors are placed in the middle layer of the water body at the monitoring point to collect temperature, oxygen demand, and chemical oxygen demand data. pH sensors and conductivity sensors are placed in the mainstream area of ​​the water body to collect pH and conductivity data. Suspended matter sensors are placed in the strong current area to collect suspended matter data.

[0018] The collected data is sent to the edge computing device, which preprocesses the collected data and fills the corresponding missing values ​​with the mean of the same type of data from all monitoring points. The Z-score method is used to detect outliers. If the |Z| of the data is greater than 3, it is considered an outlier and is removed. After the outlier detection is completed, the min-max normalization method is used to standardize the data to the [0,1] interval. After the data preprocessing is completed, the mean of the water quality parameters of all monitoring points is calibrated as the water quality parameter of the water body. Based on the expert scoring method, the water quality parameter of each timestamp is assigned a corresponding water quality index. Finally, the preprocessed data is organized into a sample data set.

[0019] Furthermore, it is characterized in that the specific logic based on which the water quality monitoring model is constructed is:

[0020] The edge node divides the sample data set into a training set and a test set with a division ratio of 7:3. The water quality parameters at the same timestamp in the training set form a feature vector, which is input into the water quality monitoring model. The water quality index of the corresponding timestamp is used as the label. The water quality monitoring model is trained based on the BP neural network model. The trained water quality monitoring model is then tested with data from the test set. The mean square error is selected as the loss function. When the mean square error is less than 0.01, the water quality monitoring model training is completed.

[0021] The cuckoo search algorithm and Nelder-Mead algorithm are used to optimize the model. A set of random bird nest locations are generated to represent the weights and biases of the water quality monitoring model. The fitness function is defined as follows:

[0022]

[0023] Among them, F is the value of the fitness function, m is the number of samples in the sample data set, q is the number of output layers, and d o (k), y o (k) represents the expected output and predicted output of the k-th sample of the node respectively;

[0024] After evaluating the fitness of each individual bird's nest, calculating the fitness values ​​of all individual bird's nests and sorting the bird's nest population according to the fitness values, the bird's nest position with poor fitness is replaced by simulating the parasitic reproduction behavior of cuckoos. The update formula is:

[0025] L new =L old +α·Levy(λ)

[0026] Among them, L new and L old are the new and old nest positions respectively, α is the step size factor, and Levy(λ) is the random step size of Levy flight;

[0027] After the replacement is completed, a new population with n individuals will be obtained. Individuals with lower fitness values ​​will be removed from the population. The number of individuals that need to be removed is The parameters are locally optimized using the Nelder-Mead algorithm, which selects the worst, best and intermediate points through the vertices of the current simplex for reflection, expansion or contraction operations, thereby optimizing the location of the bird's nest and the characteristic parameters related to the fitness of the bird's nest.

[0028] Furthermore, it is characterized in that the specific logic based on which the anomaly detection model is constructed is:

[0029] The edge node marks the feature vector composed of the water quality parameters of each collected timestamp based on the expert scoring method, and divides it into two labels: normal and abnormal. The normal label of the feature vector in the normal state is calibrated as +1, and the abnormal label of the feature vector in the abnormal state is calibrated as -1 to construct a sample set. where x i is the characteristic vector of the i-th group of water quality parameters, y i is the corresponding label;

[0030] According to the Mercer condition, a suitable nonlinear kernel function φ(·) is selected to map the input features into a high-dimensional feature space. Here, the Gaussian radial basis function is selected as the kernel function, which is in the form of:

[0031]

[0032] Among them, K(x i ,x) is the kernel function used to transform the input feature x i And the function that maps the new input x to the high-dimensional feature space, δ is the bandwidth parameter of the kernel function;

[0033] According to the principle of structural risk minimization, the objective function is expressed as:

[0034]

[0035] Among them, C is the penalty factor, ζ i is the slack variable, ω is used to define the normal vector of the classification hyperplane;

[0036] Set the constraints as:

[0037] y i (<ω·φ(x i )>+b)≥1-ζ i ,ζ i ≥0

[0038] Where i = 1, 2…, n, n is the total number of groups of water quality parameters in the sample data set;

[0039] According to the KTT condition, the Lagrange multiplier α i The classification problem is converted into a dual problem:

[0040]

[0041] The constraints are:

[0042]

[0043] Where i = 1, 2…, n, n is the total number of groups of water quality parameters in the sample data set;

[0044] Solving the dual problem of quadratic programming can obtain the optimal solution of the original classification problem Then according to α * Calculate the weight vector ω * The formula is:

[0045]

[0046] Where p is the number of support vectors;

[0047] Calculate the offset b * The formula is:

[0048]

[0049] The final classification function is:

[0050]

[0051] According to the above classification function, y = f(x) represents the classification result of the input feature vector x. If f(x) = +1, it indicates that the water quality sample is predicted to be normal. If f(x) = -1, it indicates that the water quality sample is predicted to be abnormal.

[0052] Using the decision value f(x) of the support vector machine as input, the formula for obtaining the probability that the water quality is in a normal state through the logistic regression model is:

[0053]

[0054] Where P(y=+1|x) represents the probability that the characteristic vector x of the input water quality parameter is in a normal state, and A and B are the trained parameters;

[0055] The feature vector is input into the trained anomaly detection model, and the corresponding state label is used as the output. The anomaly detection model is trained using a support vector machine. The receiver operating characteristic curve (ROC) and accuracy are used to evaluate the performance of the anomaly detection model. The ROC curve uses the false alarm rate (FPR) as the horizontal axis and the detection rate (TPR) as the vertical axis. When the area under the ROC curve (AUC) = 0.5, it is a random judgment situation, and AUC < 0.5 does not conform to the actual situation.

[0056] Furthermore, it is characterized in that the specific logic for obtaining the comprehensive evaluation score is:

[0057] For each water quality index, five standard thresholds are set in ascending order, and the hth standard threshold of the zth water quality index is set as S z,h , z is the index of the water quality index, and z∈(1,6), h is the index of the standard threshold, and h∈(1,5), if the value of the z-th water quality index at the current moment is not less than the corresponding h-th standard threshold and less than the corresponding h+1-th standard threshold, then the z-th water quality index at the current moment is considered to belong to the h-1-th level standard, and the score corresponding to the h-1-th level standard is set to I h-1 ;

[0058] The standard to which the z-th water quality index measurement value at the current moment belongs is calibrated as the h1-1-th level standard, and h1∈(1,5). The single index score of the z-th water quality index at the current moment is calculated as follows:

[0059]

[0060] Among them, I z is the single index score of the zth water quality index at the current moment, C z is the measured value of the zth water quality index at the current moment, S z,h1 is the h1th standard threshold of the zth water quality indicator, S z,h1+1 is the h1+1th standard threshold of the zth water quality indicator, I h1-1 The score corresponding to the h1-1 level standard;

[0061] Based on the single-index scores of various water quality indicators at the current moment, the formula for calculating the comprehensive evaluation score is as follows:

[0062]

[0063] Among them, G is the comprehensive evaluation score, and β z is the single-index score weight of the z-th water quality indicator, 0 < β1 < β3 < β4 < β2 < β6 < β5, and

[0064] Furthermore, it is characterized in that the specific logic for judging the water quality situation at the current moment is as follows:

[0065] The formula for obtaining the comprehensive water quality indicator is as follows:

[0066] Q = γ1·Y + γ2·P(y = +1|x) + γ3·G

[0067] Among them, Q represents the comprehensive water quality indicator at the current moment, Y is the water quality index predicted by the model, and γ1, γ2, and γ3 are the weights of the corresponding terms respectively, γ1 > γ3 > γ2 > 0, and γ1 + γ2 + γ3 = 1;

[0068] Compare the comprehensive water quality indicator at the current moment with the preset water quality indicator thresholds. According to historical data and environmental standards, three thresholds are preset, namely the mild pollution critical value T1, the moderate pollution critical value T2, and the severe pollution critical value T3. If Q < T1, it is judged that the current water quality is in a normal state. If T < Q < T2, it is judged that the current water quality is in a mild pollution state. If T2 ≤ Q < T3, it is judged that the current water quality is in a moderate pollution state. If Q ≥ pH3, it is judged that the current water quality is in a severe pollution state.

[0069] The present invention also provides a device for constructing a water quality monitoring system model based on edge computing. The device for constructing a water quality monitoring system model is used to implement the above-mentioned method for constructing a water quality monitoring system model, and includes:

[0070] A data collection and preprocessing module, which is used to arrange the collection end at key positions in the water body to collect water quality parameters and send them to the edge end. The edge end assigns corresponding water quality indexes to the water quality parameters of each timestamp based on the expert scoring method, and preprocesses the water quality parameters. The preprocessed water quality parameters are sorted into a sample data set. The water quality parameters include six water quality indicators, namely water temperature, pH value, suspended solids, conductivity, oxygen demand, and chemical oxygen demand;

[0071] The water quality monitoring model construction module is used to build a water quality monitoring model based on the BP neural network at the edge. The water quality parameters in the sample data set are used as input, and the corresponding water quality index is used as a label. The water quality monitoring model is trained and the model parameters are optimized using the cuckoo search algorithm and the Nelder-Mead algorithm.

[0072] The anomaly detection model construction module is used to build an anomaly detection model at the edge using a support vector machine. It takes the feature vector composed of water quality parameters as input and the status label of the corresponding timestamp assigned by the expert scoring method as output. The anomaly detection model is trained and the probability of normal water quality is obtained based on the logistic regression model.

[0073] The comprehensive assessment score calculation module is used to collect the water quality parameters at the current moment, and obtain the single indicator score of each water quality parameter based on the comprehensive weighted index method, and then calculate the comprehensive assessment score based on the single indicator score;

[0074] The real-time water quality assessment and monitoring module is used to input the current water quality parameters into the corresponding model to obtain the water quality index and the probability that the water quality is in a normal state, and generate a comprehensive water quality index based on the comprehensive assessment score. The comprehensive water quality index is compared with the preset water quality index threshold to determine the water quality situation at the current moment.

[0075] The present invention further provides a device comprising a processor and a storage medium, wherein the storage medium stores a computer program therein, and when the computer program is executed by the processor, the above-mentioned method for constructing a water quality monitoring system model based on edge computing can be implemented.

[0076] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0077] By adopting this solution, the water quality monitoring system has achieved significant improvements in many aspects. First, through edge computing, the data processing speed has been greatly improved, and data collection and analysis can be completed within minutes, ensuring a rapid response to changes in water quality. Second, the combination of deep learning models and support vector machines has effectively improved the accuracy of water quality predictions and reduced the false alarm rate, enabling the system to more accurately identify water quality anomalies, thereby providing a reliable basis for relevant decision-making. In addition, the application of the comprehensive weighted index method makes the assessment of water quality conditions more comprehensive, helping managers quickly identify pollution sources and take appropriate measures. Such improvements not only improve the efficiency of the monitoring system, but also lay the foundation for the sustainable management of water resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 Schematic diagram of the overall method flow of the present invention;

[0079] Figure 2Schematic diagram of the structure of the device of the present invention. DETAILED DESCRIPTION

[0080] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to specific embodiments.

[0081] It should be noted that, unless otherwise defined, the technical or scientific terms used in the present invention should have the usual meanings understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.

[0082] Example:

[0083] See also Figure 1 , the present invention provides a technical solution:

[0084] A method for constructing a water quality monitoring system model based on edge computing, the specific steps include:

[0085] Step 1: The collection end is placed at a key location in the water body to collect water quality parameters and send them to the edge end. The edge end assigns a corresponding water quality index to each water quality parameter at each timestamp based on an expert scoring method and pre-processes the water quality parameters. The pre-processed water quality parameters are organized into a sample dataset. The water quality parameters include water temperature, pH value, suspended solids, conductivity, oxygen demand, and chemical oxygen demand, a total of six water quality indicators.

[0086] In this embodiment, the specific logic for obtaining the water quality parameter sample data set is:

[0087] The data collection end includes temperature sensors, oxygen demand sensors, chemical oxygen demand sensors, pH sensors, conductivity sensors, and suspended matter sensors. Areas with water flow velocities exceeding 1 m / s are marked as strong flow areas, and the middle layer, mainstream, and strong flow areas of the water body are marked as key locations. A monitoring point is arranged every 100 meters. Temperature sensors, oxygen demand sensors, and chemical oxygen demand sensors are arranged in the middle layer of the water body at the monitoring point to collect temperature, oxygen demand, and chemical oxygen demand data. pH sensors and conductivity sensors are arranged in the mainstream area of ​​the water body to collect pH and conductivity data. Suspended matter sensors are arranged in the strong flow area to collect suspended matter data.

[0088] The collected data is sent to the edge computing device, which preprocesses the collected data and fills the corresponding missing values ​​with the mean of the same type of data from all monitoring points. The Z-score method is used to detect outliers. If the |Z| of the data is greater than 3, it is considered an outlier and is removed. After the outlier detection is completed, the min-max normalization method is used to standardize the data to the [0,1] interval. After the data preprocessing is completed, the mean of the water quality parameters of all monitoring points is calibrated as the water quality parameter of the water body. Based on the expert scoring method, the water quality parameter of each timestamp is assigned a corresponding water quality index. Finally, the preprocessed data is organized into a sample data set.

[0089] The collection end sends collected water quality parameter data to edge computing devices at the edge using the CoAP communication protocol. Upon receiving the data, the edge computing devices perform data preprocessing. The edge receives, processes, and forwards valid data from the collection end, providing storage, computing, and decision-making capabilities. It undertakes time-sensitive services such as intelligent perception, security and privacy protection, intelligent computing, process optimization, and real-time control. Furthermore, the edge interacts with the cloud computing layer and uploads optimized necessary data to the cloud. The cloud leverages its more powerful computing capabilities for deeper data analysis and algorithmic computation, such as deep learning and big data analytics. Simultaneously, the cloud distributes the trained water quality prediction models or related rules to the edge. The edge can then implement intelligent control based on the water quality monitoring models and rules, enhancing its intelligence level. The edge includes devices such as edge gateways, edge controllers, edge clouds, and edge managers. These devices integrate edge-side storage, computing, and networking resources to provide the necessary hardware resources for edge computing. In this project, edge analysis can immediately identify anomalies in water quality monitoring data and faults in water quality monitoring equipment, enabling rapid response.

[0090] Key locations of the water body (including the middle layer, mainstream area, and strong flow area) are selected for monitoring to ensure that representative water quality data can be obtained. A monitoring point is set up every 100 meters to ensure that the spatial distribution of the data is reasonable and can reflect the overall water quality of the water body. Through reasonable sensor layout and data preprocessing, more accurate and reliable water quality parameters can be obtained, providing a good foundation for subsequent analysis. The use of sensors to collect data in real time can quickly reflect changes in water quality in the water body, and timely discover and deal with water quality problems. The application of the Z-score method can effectively identify and eliminate outliers, reduce data noise, and improve data quality. Data standardization through min-max can eliminate the influence of different dimensions, making subsequent model algorithms more effective and model training more stable. The expert scoring method is used to assign water quality parameters a water quality index, making water quality assessment more scientific and authoritative.

[0091] Step 2: Build a water quality monitoring model based on a BP neural network at the edge. The water quality parameters in the sample dataset are used as input, and the corresponding water quality index is used as a label. The water quality monitoring model is trained and the model parameters are optimized using the cuckoo search algorithm and the Nelder-Mead algorithm.

[0092] In this embodiment, the specific logic for constructing the water quality monitoring model is:

[0093] The edge node divides the sample data set into a training set and a test set with a division ratio of 7:3. The water quality parameters at the same timestamp in the training set form a feature vector, which is input into the water quality monitoring model. The water quality index of the corresponding timestamp is used as the label. The water quality monitoring model is trained based on the BP neural network model. The trained water quality monitoring model is then tested with data from the test set. The mean square error is selected as the loss function. When the mean square error is less than 0.01, the water quality monitoring model training is completed.

[0094] The connection weights between the input layer and the hidden layer, the connection weights between the hidden layer and the output layer, and the biases between the hidden layer and the input layer are encoded together as individuals of the cuckoo algorithm. The cuckoo search algorithm and the Nelder-Mead algorithm are used for model optimization to generate a set of random bird nest locations, representing the weights and biases of the water quality monitoring model. The fitness function is defined as follows:

[0095]

[0096] Among them, F is the value of the fitness function, m is the number of samples in the sample data set, q is the number of output layers, and d o (k), y o (k) represents the expected output and predicted output of the k-th sample of the node respectively;

[0097] After evaluating the fitness of each individual bird's nest, calculating the fitness values ​​of all individual bird's nests and sorting the bird's nest population according to the fitness values, the bird's nest position with poor fitness is replaced by simulating the parasitic reproduction behavior of cuckoos. The update formula is:

[0098] L new =L old +α·Levy(λ)

[0099] Among them, L new and L old are the new and old nest positions respectively, α is the step size factor, and Levy(λ) is the random step size of Levy flight;

[0100] After the replacement is completed, a new population with n individuals will be obtained. Individuals with lower fitness values ​​will be removed from the population. The number of individuals that need to be removed is The parameters are locally optimized using the Nelder-Mead algorithm, which selects the worst, best and intermediate points through the vertices of the current simplex for reflection, expansion or contraction operations, thereby optimizing the location of the bird's nest and the characteristic parameters related to the fitness of the bird's nest.

[0101] The BP neural network, a multi-layer feedforward network trained using backpropagation, is one of the most commonly used neural network models. It can be used to learn and store a large number of input-output mapping models without requiring the mathematical equations describing these mappings to be known in advance. Its fundamental principle is the gradient descent method, which utilizes gradient search techniques to minimize the mean square error between the network's actual and expected outputs. The BP neural network consists of an input layer, hidden layers, and an output layer. The input layer receives water quality parameters, which are then processed by weights and activation functions in the hidden layers. The output layer ultimately predicts the water quality index. Through BP neural network training and optimization, the model can more accurately predict the water quality index, thereby improving monitoring reliability. Implementing this process enables automated water quality monitoring and assessment, real-time processing of newly collected data, and rapid response to water quality changes. Hybrid optimization, combining the Cuckoo Search algorithm with the Nelder-Mead algorithm, achieves a better balance between global and local optimization, enhancing the model's generalization capabilities.

[0102] Step 3: Use a support vector machine (SVM) to build an anomaly detection model at the edge. This model takes the feature vector of water quality parameters as input and the status label of the corresponding timestamp assigned by the expert scoring method as output. The model is trained and the probability of normal water quality is obtained using a logistic regression model.

[0103] In this embodiment, the specific logic for building the anomaly detection model is as follows:

[0104] The edge node marks the feature vector composed of the water quality parameters of each collected timestamp based on the expert scoring method, and divides it into two labels: normal and abnormal. The normal label of the feature vector in the normal state is calibrated as +1, and the abnormal label of the feature vector in the abnormal state is calibrated as -1 to construct a sample set. where x i is the characteristic vector of the i-th group of water quality parameters, y i is the corresponding label;

[0105] According to the Mercer condition, a suitable nonlinear kernel function φ(·) is selected to map the input features into a high-dimensional feature space. Here, the Gaussian radial basis function is selected as the kernel function, which is in the form of:

[0106]

[0107] Among them, K(x i ,x) is the kernel function used to transform the input feature x i And the function that maps the new input x to the high-dimensional feature space, δ is the bandwidth parameter of the kernel function;

[0108] According to the principle of structural risk minimization, the objective function is expressed as:

[0109]

[0110] Among them, C is the penalty factor, ζ i is the slack variable, ω is used to define the normal vector of the classification hyperplane;

[0111] Set the constraints as:

[0112] y i (<ω·φ(x i )>+b)≥1-ζ i ,ζ i ≥0

[0113] Where i = 1, 2…, n, b is the total number of groups of water quality parameters in the sample data set;

[0114] According to the KTT condition, the Lagrange multiplier α i The classification problem is converted into a dual problem:

[0115]

[0116] The constraints are:

[0117]

[0118] Where i = 1, 2…, n, n is the total number of groups of water quality parameters in the sample data set;

[0119] Solving the dual problem of quadratic programming can obtain the optimal solution of the original classification problem Then according to α * Calculate the weight vector ω * The formula is:

[0120]

[0121] Among them, p is the number of support vectors, that is, the number of samples that have a direct impact on the decision boundary during the training process. During the training of the support vector machine, all training samples are evaluated and the Lagrange multiplier α is calculated. i , only when α i When >0, the sample is called a support vector, and p is the total number of support vectors;

[0122] Calculate the offset b * The formula is:

[0123]

[0124] The final classification function is:

[0125]

[0126] According to the above classification function, y = f(x) represents the classification result of the input feature vector x. If f(x) = +1, it indicates that the water quality sample is predicted to be normal. If f(x) = -1, it indicates that the water quality sample is predicted to be abnormal.

[0127] Using the decision value f(x) of the support vector machine as input, the formula for obtaining the probability that the water quality is in a normal state through the logistic regression model is:

[0128]

[0129] Where P(y=+1|x) represents the probability that the characteristic vector x of the input water quality parameter is in a normal state, and A and B are the trained parameters;

[0130] The feature vector is input into the trained anomaly detection model, and the corresponding state label is used as the output. The anomaly detection model is trained using a support vector machine. The receiver operating characteristic curve (ROC) and accuracy are used to evaluate the performance of the anomaly detection model. The ROC curve uses the false alarm rate (FPR) as the horizontal axis and the detection rate (TPR) as the vertical axis. When the area under the ROC curve (AUC) = 0.5, it is a random judgment situation, and AUC < 0.5 does not conform to the actual situation.

[0131] Water quality monitoring involves multiple parameters, and even slight deviations can indicate potential contamination or other hazards. Therefore, building an anomaly detection model can automatically identify these anomalies, reducing human error and omissions. By labeling data using expert scoring, a data-based model can be established, providing a scientific basis for water quality management, rather than relying solely on expert judgment. Anomaly detection models can process and analyze water quality data in real time, enabling managers to quickly respond to potential water quality issues and take timely measures to protect water resources and public health.

[0132] Support vector machines perform well when processing high-dimensional data and can effectively handle complex nonlinear relationships between water quality parameters, thereby improving the accuracy of anomaly detection. They can also adapt to different data sets and water quality parameter combinations, offering strong flexibility and suitability for a variety of water quality monitoring scenarios. Obtaining the probability of normal water quality through a logistic regression model provides more intuitive results, enabling decision makers to better assess water quality safety. Using ROC curves and AUC metrics to evaluate model performance allows managers to intuitively understand the quality of the model and adjust and optimize model parameters based on the evaluation results. Automated anomaly detection reduces reliance on manual monitoring, lowering labor costs while increasing monitoring coverage and frequency.

[0133] Step 4: Collect the current water quality parameters and obtain the single indicator score of each water quality parameter based on the comprehensive weighted index method, and then calculate the comprehensive assessment score based on the single indicator score;

[0134] In this embodiment, the specific logic for obtaining the comprehensive evaluation score is as follows:

[0135] For each water quality index, five standard thresholds are set in ascending order, and the hth standard threshold of the zth water quality index is set as S z,h , z is the index of the water quality index, and z∈(1,6), h is the index of the standard threshold, and h∈(1,5), if the value of the z-th water quality index at the current moment is not less than the corresponding h-th standard threshold and less than the corresponding h+1-th standard threshold, then the z-th water quality index at the current moment is considered to belong to the h-1-th level standard, and the score corresponding to the h-1-th level standard is set to I h-1 ;

[0136] The standard to which the z-th water quality index measurement value at the current moment belongs is calibrated as the h1-1-th level standard, and h1∈(1,5). The single index score of the z-th water quality index at the current moment is calculated as follows:

[0137]

[0138] Among them, I zis the single index score of the zth water quality index at the current moment, C z is the measured value of the zth water quality index at the current moment, S z,h1 is the h1th standard threshold of the zth water quality indicator, S z,h1+1 is the h1+1th standard threshold of the zth water quality indicator, I h1-1 The score corresponding to the h1-1 level standard;

[0139] The indexes of the six water quality indicators, temperature, pH value, suspended solids, conductivity, oxygen demand and chemical oxygen demand, are 1, 2, 3, 4, 5 and 6 respectively. Each water quality indicator is divided into five levels, namely 0, 1, 2, 3 and 4. The corresponding scores of each level are as follows:

[0140] I0=0, I1=20, I2=40, I3=6, I4=80, I4=80;

[0141] The corresponding standard threshold S z,h1 as follows:

[0142] Temperature: S 1,0 =0℃, S 1,1 =15℃,S 1,2 =25℃, S 1,3 =30℃, S 1,4 =35℃;

[0143] pH value: S 2,0 =6.5, S 2,1 =7.0, S 2,2 =7.5, S 2,3 =8.0, S 2,4 =9.0;

[0144] Suspended matter: S 3,0 =0mg / L, S 3,1 =10mg / l, S 3,2 =20mg / L, S 3,3 =30mg / l, S 3,4 =50mg / L;

[0145] Conductivity: S 4,0 =50μS / cm, S 4,1 =100μS / cm, S 4,2 =300μS / c,,S 4,3 =500μS / cm, K=4,S 4,4 =1000μS / cm;

[0146] Oxygen demand: S 5,0 =0mg / L, S 5,1 =2mg / L, S5,2 =5mg / L, S 5,3 =10mg / L, S 5,4 =20mg / L;

[0147] Chemical oxygen demand: S 6,0 =0mg / L, S 6,1 =20mg / L, S 6,2 =30mg / L, S 6,3 =40mg / L, S 6,4 =100mg / L;

[0148] Based on the single indicator scores of various water quality indicators at the current moment, the formula for calculating the comprehensive assessment score is:

[0149]

[0150] Among them, G is the comprehensive evaluation score, β z is the single indicator score weight of the z-th water quality indicator, 0<β1<β3<β4<β2<β6<β5, and

[0151] Oxygen demand directly affects the survival of aquatic organisms and is a key indicator of water health and ecological balance. Insufficient dissolved oxygen in water can lead to biological death and compromise the water's self-purification capacity, thus receiving the highest weighting. Chemical oxygen demand (COD) is a key indicator of water pollution, indicating the content of organic matter in water. High COD values ​​indicate severe water pollution, thus playing a significant role in water quality assessment, with a weighting second only to oxygen demand. pH affects the metabolic processes of aquatic organisms and the rates of certain chemical reactions. Both excessively high and low pH values ​​can be harmful to aquatic life, thus receiving a high weighting, surpassing only oxygen demand and COD. Conductivity reflects the total amount of ions and salt concentration in water; excessively high values ​​may indicate water pollution. While important, its impact is less significant than that of oxygen demand and COD. Suspended solids primarily affect water quality through their effects on light transmittance and biological respiration. While their impact cannot be ignored, their weighting in water quality monitoring is relatively low compared to other parameters, surpassing only temperature. Temperature has a certain impact on the growth and metabolism of aquatic organisms, but in general, its impact is more indirect and is usually used as an auxiliary parameter in monitoring systems, so its weight is the lowest. This constraint ensures that the comprehensive evaluation score is a normalized index, ensuring that the total contribution of the weighted combination of the six water quality indicators is 100%. The quality of water often involves multiple parameters. Through the comprehensive weighted index method, these multi-dimensional parameters can be uniformly evaluated, facilitating an intuitive understanding of the overall water quality situation. In water quality assessment, different parameters have different degrees of influence on water quality. By assigning weights to each water quality parameter, those indicators with a greater impact on water quality can be emphasized, thereby improving the accuracy and effectiveness of the comprehensive evaluation. Here, the weight assignment of water quality parameters can be carried out according to the expert scoring method. The calculation of the comprehensive evaluation score can provide convenient and intuitive information for decision-makers to help them quickly make decisions regarding water quality management and protection.

[0152] Step 5: Input the water quality parameters at the current moment into the corresponding model to obtain the water quality index, the probability that the water quality is in a normal state, and generate a comprehensive water quality indicator in combination with the comprehensive evaluation score. Compare the comprehensive water quality indicator with the preset water quality indicator threshold to determine the water quality situation at the current moment.

[0153] In this embodiment, the specific logic for determining the water quality situation at the current moment is as follows:

[0154] The formula for obtaining the comprehensive water quality indicator is:

[0155] Q = γ1·Y + γ2·P(y = +1|x) + γ3·G

[0156] where Q represents the comprehensive water quality indicator at the current moment, Y is the water quality index predicted by the model, γ1, γ2, and γ3 are the weights of the corresponding terms respectively, γ1 > γ3 > γ2 > 0, and γ1 + γ2 + γ3 = 1;

[0157] Compare the comprehensive water quality indicator at the current moment with the preset water quality indicator threshold. Preset three thresholds according to historical data and environmental standards, namely the mild pollution critical value T1, the moderate pollution critical value T2, and the severe pollution critical value T3. If Q < T1, it is determined that the current water quality is in a normal state. If T1 ≤ Q < T2, it is determined that the current water quality is in a mild pollution state. If T2 ≤ Q < T3, it is determined that the current water quality is in a moderate pollution state. If Q ≥ T3, it is determined that the current water quality is in a severe pollution state.

[0158] Experts set the thresholds for light pollution (T1), moderate pollution (T2), and severe pollution (T3) based on historical data, relevant regulations and standards, and ecological impacts, allowing for adjustments to meet the needs of different environmental conditions. γ1 is used to weigh the impact of the model-predicted water quality index (Y). Since the water quality index is derived from historical data and model predictions, this metric is the most important and directly reflects the health of the water body. Therefore, its weight is relatively high. γ2 represents the weight of the probability P(y = +1|x) that the eigenvector x of the input water quality parameters is in a normal state. This probability is calculated based on actual measured data and statistical models, reflecting the degree to which the current state of the water body deviates from normal. This weight can be set low, as it is only a possibility and has a relatively small impact. The comprehensive assessment score G is typically based on a comprehensive assessment of multiple water quality parameters. This score may take into account the weighted average of multiple indicators. Therefore, the weight of γ3 depends on the importance of the comprehensive assessment score in decision-making and can generally be set to a moderate value. The constraint condition of γ1+γ2+γ3=1 ensures that the comprehensive water quality index is a normalized index, ensuring that the total contribution of the weighted combination of the three factors is 100%.

[0159] Y represents the water quality index, a quantitative indicator of overall water quality derived from historical data and models. P(y = +1|x) represents the probability of normal water quality, reflecting the safety of the current water quality. G represents the comprehensive assessment score, a weighted sum of various water quality parameters, reflecting the comprehensive evaluation of water quality. In this formula, positive weights indicate that an increase in any of the indicators will lead to an increase in the comprehensive water quality index Q. For example, if the water quality index Y increases, or if the probability of normal water quality P(y = +1|x) or the comprehensive assessment score G increases, the comprehensive water quality index Q will also increase, indicating an improvement in water quality.

[0160] By collecting water quality parameters in real time, the current water quality status can be quickly determined, allowing problems to be identified and measures to be taken promptly. Clear threshold standards can clearly classify water quality conditions, facilitating targeted measures for decision-makers. Quantitative analysis of water quality reduces the subjectivity of human judgment and improves the objectivity of assessment. Comprehensive water quality indicators enable more comprehensive real-time monitoring of water quality, providing managers with a scientific basis for making more accurate water quality management decisions.

[0161] See also Figure 2 The present invention further provides a water quality monitoring system model construction device based on edge computing, which is used to implement the above-mentioned water quality monitoring system model construction method, including:

[0162] The data collection and preprocessing module is used to place the collection end at the key location of the water body to collect water quality parameters and send them to the edge end. The edge end assigns a corresponding water quality index to the water quality parameter of each timestamp based on the expert scoring method, and preprocesses the water quality parameters. The preprocessed water quality parameters are organized into a sample data set. The water quality parameters include water temperature, pH value, suspended solids, conductivity, oxygen demand, and chemical oxygen demand, a total of six water quality indicators;

[0163] The water quality monitoring model construction module is used to build a water quality monitoring model based on the BP neural network at the edge. The water quality parameters in the sample data set are used as input, and the corresponding water quality index is used as a label. The water quality monitoring model is trained and the model parameters are optimized using the cuckoo search algorithm and the Nelder-Mead algorithm.

[0164] The anomaly detection model construction module is used to build an anomaly detection model at the edge using a support vector machine. It takes the feature vector composed of water quality parameters as input and the status label of the corresponding timestamp assigned by the expert scoring method as output. The anomaly detection model is trained and the probability of normal water quality is obtained based on the logistic regression model.

[0165] The comprehensive assessment score calculation module is used to collect the water quality parameters at the current moment, and obtain the single indicator score of each water quality parameter based on the comprehensive weighted index method, and then calculate the comprehensive assessment score based on the single indicator score;

[0166] The real-time water quality assessment and monitoring module is used to input the current water quality parameters into the corresponding model to obtain the water quality index and the probability that the water quality is in a normal state, and generate a comprehensive water quality index based on the comprehensive assessment score. The comprehensive water quality index is compared with the preset water quality index threshold to determine the water quality situation at the current moment.

[0167] The present invention further provides a device comprising a processor and a storage medium, wherein the storage medium stores a computer program therein, and when the computer program is executed by the processor, the above-mentioned method for constructing a water quality monitoring system model based on edge computing can be implemented.

[0168] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.

[0169] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraints of the technical solution.

[0170] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment as needed.

[0171] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.

Claims

1. A water quality monitoring system model construction method based on edge computing, characterized in that: The method is applicable to a water quality monitoring system having a collection end and an edge end, and the specific steps include: Step 1: The collection end is placed at a key location in the water body to collect water quality parameters and send them to the edge end. The edge end assigns a corresponding water quality index to each water quality parameter at each timestamp based on an expert scoring method and pre-processes the water quality parameters. The pre-processed water quality parameters are organized into a sample dataset. The water quality parameters include water temperature, pH value, suspended solids, conductivity, oxygen demand, and chemical oxygen demand, a total of six water quality indicators. Step 2: Build a water quality monitoring model based on a BP neural network at the edge. The water quality parameters in the sample dataset are used as input, and the corresponding water quality index is used as a label. The water quality monitoring model is trained and the model parameters are optimized using the cuckoo search algorithm and the Nelder-Mead algorithm. Step 3: Use a support vector machine (SVM) to build an anomaly detection model at the edge. This model takes the feature vector of water quality parameters as input and the status label of the corresponding timestamp assigned by the expert scoring method as output. The model is trained and the probability of normal water quality is obtained using a logistic regression model. Step 4: Collect the current water quality parameters and obtain the single indicator score of each water quality parameter based on the comprehensive weighted index method, and then calculate the comprehensive assessment score based on the single indicator score; Step 5: Input the current water quality parameters into the corresponding model to obtain the water quality index and the probability that the water quality is in a normal state, and combine the comprehensive assessment score to generate a comprehensive water quality index. Compare the comprehensive water quality index with the preset water quality index threshold to determine the current water quality situation.

2. The method for constructing a water quality monitoring system model based on edge computing according to claim 1, characterized in that: The specific logic for obtaining the water quality parameter sample dataset is as follows: The data collection end includes temperature sensors, oxygen demand sensors, chemical oxygen demand sensors, pH sensors, conductivity sensors, and suspended matter sensors. The middle layer, mainstream area, and strong current area of ​​the water body are marked as key locations, and a monitoring point is arranged every 100 meters. Temperature sensors, oxygen demand sensors, and chemical oxygen demand sensors are placed in the middle layer of the water body at the monitoring point to collect temperature, oxygen demand, and chemical oxygen demand data. pH sensors and conductivity sensors are placed in the mainstream area of ​​the water body to collect pH and conductivity data. Suspended matter sensors are placed in the strong current area to collect suspended matter data. The collected data is sent to the edge computing device, which preprocesses the collected data and fills the corresponding missing values ​​with the mean of the same type of data from all monitoring points. The Z-score method is used to detect outliers. If the |Z| of the data is greater than 3, it is considered an outlier and is removed. After the outlier detection is completed, the min-max normalization method is used to standardize the data to the [0,1] interval. After the data preprocessing is completed, the mean of the water quality parameters of all monitoring points is calibrated as the water quality parameter of the water body. Based on the expert scoring method, the water quality parameter of each timestamp is assigned a corresponding water quality index. Finally, the preprocessed data is organized into a sample data set.

3. The method for constructing a water quality monitoring system model based on edge computing according to claim 2, characterized in that: The specific logic for building the water quality monitoring model is: The edge node divides the sample data set into a training set and a test set with a division ratio of 7:

3. The water quality parameters at the same timestamp in the training set form a feature vector, which is input into the water quality monitoring model. The water quality index of the corresponding timestamp is used as the label. The water quality monitoring model is trained based on the BP neural network model. The trained water quality monitoring model is then tested with data from the test set. The mean square error is selected as the loss function. When the mean square error is less than 0.01, the water quality monitoring model training is completed. The cuckoo search algorithm and Nelder-Mead algorithm are used to optimize the model. A set of random bird nest locations are generated to represent the weights and biases of the water quality monitoring model. The fitness function is defined as follows: Among them, F is the value of the fitness function, m is the number of samples in the sample data set, q is the number of output layers, and d o (k), y o (k) represents the expected output and predicted output of the k-th sample of the node respectively; After evaluating the fitness of each individual bird's nest, calculating the fitness values ​​of all individual bird's nests, and sorting the bird's nest population according to the fitness values, the bird's nest position with poor fitness is replaced by simulating the parasitic reproduction behavior of cuckoos. The update formula is: L new =L old +α·Levy(λ) Among them, L new and L old are the new and old nest positions respectively, α is the step size factor, and Levy(λ) is the random step size of Levy flight; After the replacement is completed, a new population with n individuals will be obtained. Individuals with lower fitness values ​​will be removed from the population. The number of individuals that need to be removed is The parameters are locally optimized using the Nelder-Mead algorithm, which selects the worst, best and intermediate points through the vertices of the current simplex for reflection, expansion or contraction operations, thereby optimizing the location of the bird's nest and the characteristic parameters related to the fitness of the bird's nest.

4. The method for constructing a water quality monitoring system model based on edge computing according to claim 3 is characterized in that: The specific logic behind building anomaly detection models is: The edge node marks the feature vector composed of the water quality parameters of each collected timestamp based on the expert scoring method, and divides it into two labels: normal and abnormal. The normal label of the feature vector in the normal state is calibrated as +1, and the abnormal label of the feature vector in the abnormal state is calibrated as -1 to construct a sample set. where x i is the characteristic vector of the i-th group of water quality parameters, y i is the corresponding label; According to the Mercer condition, a suitable nonlinear kernel function φ(·) is selected to map the input features into a high-dimensional feature space. Here, the Gaussian radial basis function is selected as the kernel function, which is in the form of: Among them, K(x i ,x) is the kernel function used to transform the input feature x i and the function that maps the new input x to the high-dimensional feature space, δ is the bandwidth parameter of the kernel function; according to the principle of structural risk minimization, the objective function is constructed as: Among them, C is the penalty factor, ζ i is the slack variable, ω is used to define the normal vector of the classification hyperplane; Set the constraints as: y i (<ω·φ(x i )>+b)≥1-ζ i ,g i ≥0 Where i = 1, 2…, n, n is the total number of groups of water quality parameters in the sample data set; According to the KTT condition, the Lagrange multiplier α i The classification problem is converted into a dual problem: The constraints are: Where i = 1, 2…, n, n is the total number of groups of water quality parameters in the sample data set; Solving the dual problem of quadratic programming can obtain the optimal solution of the original classification problem Then according to α * Calculate the weight vector ω * The formula is: Where p is the number of support vectors; Calculate the offset b * The formula is: The final classification function is: According to the above classification function, y = f(x) represents the classification result of the input feature vector x. If f(x) = +1, it indicates that the water quality sample is predicted to be normal. If f(x) = -1, it indicates that the water quality sample is predicted to be abnormal. Using the decision value f(x) of the support vector machine as input, the formula for obtaining the probability that the water quality is in a normal state through the logistic regression model is: Where P(y=+1|x) represents the probability that the characteristic vector x of the input water quality parameter is in a normal state, and A and B are the trained parameters; The feature vector is input into the trained anomaly detection model, and the corresponding state label is used as the output. The anomaly detection model is trained using a support vector machine. The receiver operating characteristic curve (ROC) and accuracy are used to evaluate the performance of the anomaly detection model. The ROC curve uses the false alarm rate (FPR) as the horizontal axis and the detection rate (TPR) as the vertical axis. When the area under the ROC curve (AUC) = 0.5, it is a random judgment situation, and AUC < 0.5 does not conform to the actual situation.

5. The method for constructing a water quality monitoring system model based on edge computing according to claim 4 is characterized in that: The specific logic for obtaining the comprehensive assessment score is as follows: For each water quality index, five standard thresholds are set in ascending order, and the hth standard threshold of the zth water quality index is set as S z,h , z is the index of the water quality index, and z∈(1,6), h is the index of the standard threshold, and h∈(1,5), if the value of the z-th water quality index at the current moment is not less than the corresponding h-th standard threshold and less than the corresponding h+1-th standard threshold, then the z-th water quality index at the current moment is considered to belong to the h-1-th level standard, and the score corresponding to the h-1-th level standard is set to I h-1 ; The standard to which the z-th water quality index measurement value at the current moment belongs is calibrated as the h1-1-th level standard, and h1∈(1,5). The single index score of the z-th water quality index at the current moment is calculated as follows: Among them, I z is the single index score of the zth water quality index at the current moment, C z is the measured value of the zth water quality index at the current moment, S z,h1 is the h1th standard threshold of the zth water quality indicator, S z,h1+1 is the h1+1th standard threshold of the zth water quality indicator, I h1-1 The score corresponding to the h1-1 level standard; Based on the single indicator scores of various water quality indicators at the current moment, the formula for calculating the comprehensive assessment score is: Among them, G is the comprehensive evaluation score, β z is the single indicator score weight of the z-th water quality indicator, 0<β1<β3<β4<β2<β6<β5, and 6. The method for constructing a water quality monitoring system model based on edge computing according to claim 5, characterized in that: The specific logic for judging the current water quality is as follows: The formula for obtaining the comprehensive water quality index is: Q = γ1·Y + γ2·P(y = +1|x) + γ3·G Where, Q represents the comprehensive water quality index at the current moment, Y is the water quality index predicted by the model, γ1, γ2, and γ3 are the weights of the corresponding terms respectively, γ1 > γ3 > γ2 > 0, and γ1 + γ2 + γ3 = 1; Compare the comprehensive water quality index at the current moment with the preset water quality index threshold. According to historical data and environmental standards, three thresholds are preset, namely the mild pollution critical value T1, the moderate pollution critical value T2, and the severe pollution critical value T3. If Q < T1, it is judged that the current water quality is in a normal state. If T1 ≤ Q < T2, it is judged that the current water quality is in a mild pollution state. If T2 ≤ Q < T3, it is judged that the current water quality is in a moderate pollution state. If Q ≥ T3, it is judged that the current water quality is in a severe pollution state.

7. A water quality monitoring system model construction device based on edge computing, characterized in that: The device for constructing the water quality monitoring system model is used to implement the method for constructing the water quality monitoring system model according to any one of claims 1-6, and includes: The data acquisition and preprocessing module is used to arrange the acquisition end at key positions of the water body to collect water quality parameters and send them to the edge end. The edge end assigns corresponding water quality indexes to the water quality parameters of each timestamp based on the expert scoring method, and preprocesses the water quality parameters. The preprocessed water quality parameters are sorted into a sample data set. The water quality parameters include six water quality indexes, namely water temperature, pH value, suspended solids, conductivity, oxygen demand, and chemical oxygen demand; The water quality monitoring model construction module is used to construct a water quality monitoring model based on the BP neural network at the edge end. The water quality parameters in the sample data set are used as inputs, and the corresponding water quality indexes are used as labels to train the water quality monitoring model, and the cuckoo search algorithm and the Nelder-Mead algorithm are used to optimize the model parameters; The abnormal detection model construction module is used to construct an abnormal detection model using a support vector machine at the edge end. The feature vector composed of water quality parameters is used as the input, and the status label of the corresponding timestamp assigned based on the expert scoring method is used as the output to train the abnormal detection model, and the probability that the water quality is in a normal state is obtained based on the logistic regression model; The comprehensive evaluation score calculation module is used to collect the water quality parameters at the current moment, obtain the single-index scores of each index of the water quality parameters based on the comprehensive weighted index method, and then calculate the comprehensive evaluation score according to the single-index scores; The real-time water quality evaluation and monitoring module is used to input the water quality parameters at the current moment into the corresponding model to obtain the water quality index and the probability that the water quality is in a normal state, and generate a comprehensive water quality index in combination with the comprehensive evaluation score, and compare the comprehensive water quality index with the preset water quality index threshold to judge the water quality situation at the current moment.

8. A device, characterized in that: The device includes a processor and a storage medium. The storage medium stores a computer program internally. When the computer program is executed by the processor, it can implement the method for constructing the water quality monitoring system model based on edge computing according to any one of claims 1-6.

Citation Information

Patent Citations

  • Water quality monitoring control method and system

    CN118861642A

  • Water quality pollution monitoring system and method based on machine learning

    CN118883875A