Water quality monitoring system model construction method and device based on edge calculation and computer equipment
By adopting edge computing and deep learning models in the water quality monitoring system, the problem of delay and insufficient adaptability of data processing in traditional water quality monitoring systems is solved, rapid response and efficient monitoring are achieved, and the accuracy and monitoring efficiency of water quality prediction are improved.
Patent Information
- Application Number
- CN202411566198.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-11-05
AI Technical Summary
The existing water quality monitoring system relies on centralized data processing, resulting in insufficient data transmission delay and real-time performance. Traditional monitoring technology cannot adapt to the complex and changeable water quality environment, resulting in the inability to detect abnormal situations in a timely manner, affecting the accuracy and efficiency of monitoring.
Using the water quality monitoring system model based on edge computing, water quality parameters are collected at the edge end, deep learning models such as BP neural network and support vector machines are trained, and combined with the cuckoo search algorithm and Nelder-Mead optimization algorithm, water quality monitoring and anomalies are constructed. The model is detected and the water quality status is evaluated through the comprehensive weighted index method.
It realizes data processing that responds to water quality changes quickly, improves the accuracy and monitoring efficiency of water quality prediction, can timely identify pollution sources, provide reliable decision-making support, and improves the scientificity and effectiveness of water resource management.
Smart Images

Figure CN119313220A_ABST
Abstract
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 refers to the systematic measurement and analysis of physical, chemical and biological parameters in water bodies to assess water quality and its changes. With the acceleration of industrialization and urbanization, water pollution is becoming increasingly serious, affecting human health and the ecological environment. The deterioration of water quality is not only caused by the discharge of industrial wastewater, agricultural and urban and rural domestic sewage, but also affected by multiple factors such as climate change, surface water flow and human activities. Therefore, timely and accurate water quality monitoring is particularly important.
[0003] Water quality monitoring technology is an important means of evaluating and managing water resources. It aims to ensure that water quality meets environmental standards and safety requirements by regularly testing physical, chemical and biological indicators in water bodies. This technology combines sensors, data collection and analysis methods to monitor the concentration changes of pollutants in water in real time, identify the source of water pollution, and provide a scientific basis for water resource management. With the advancement of science and technology, the application of automated monitoring systems and remote transmission technologies has made water quality monitoring more efficient and accurate, promoting the protection and sustainable use of the water ecological environment.
[0004] With the acceleration of industrialization and urbanization, water pollution is becoming increasingly serious, affecting the ecological environment and human health. Existing water quality monitoring systems mostly rely on centralized data processing, which has problems such as data transmission delay, lack of real-time performance and limited processing capacity. In addition, traditional monitoring technologies are often unable to adapt to the complex and changing water quality environment, resulting in the inability to detect abnormal conditions in time, thus missing the best time to deal with them. 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 of existing technologies:
[0006] First, traditional methods usually rely on manual sampling and laboratory analysis, which not only leads to a low frequency of data updates, but also a slow response when pollution incidents occur, and fails to 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, thus affecting 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 scientificity 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 constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0008] The purpose of the present invention is to provide a method, device and computer equipment for building a water quality monitoring system model 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 the key position of the water body to collect water quality parameters and send them to the edge end. The edge end assigns the corresponding water quality index to the water quality parameters of each timestamp based on the expert scoring method, and pre-processes the water quality parameters. The pre-processed 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;
[0012] Step 2: 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 hybrid optimization algorithm.
[0013] Step 3: Use support vector machine to build an anomaly detection model at the edge, take the feature vector composed of water quality parameters as input, and the state label of the corresponding timestamp assigned by the expert scoring method as output, train the anomaly detection model, and obtain the probability of water quality being in a normal state based on the logistic regression model;
[0014] Step 4: 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 evaluation 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, the probability that the water quality is in a normal state, and combine 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 water quality situation at the current moment.
[0016] Furthermore, the specific logic for obtaining the water quality parameter sample data set is as follows:
[0017] The collection end includes temperature sensors, oxygen demand sensors, chemical oxygen demand sensors, pH sensors, conductivity sensors, and suspended solids sensors. The middle layer area, mainstream area, and strong current area 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 value and conductivity data. Suspended solids sensors are arranged in the strong current area to collect suspended solids 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 Zs re method is used to detect outliers. If the |Z| of the data is greater than 3, it is regarded as an outlier and 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. The water quality parameter of each timestamp is assigned a corresponding water quality index based on the expert scoring method. 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 a label. The water quality monitoring model is trained based on the BP neural network model. The trained water quality monitoring model is then input into the data in the test set for testing. The mean square error is selected as the loss function. When the mean square error is less than 0.01, it indicates that the training of the water quality monitoring model is completed.
[0021] The cuckoo search algorithm and Nelder-Mead simplex algorithm are used to optimize the model, generate a set of random bird nest locations, represent the weights and biases of the water quality monitoring model, and define the fitness function 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 kth 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 position of the bird's nest with poor fitness is replaced by simulating the parasitic reproduction behavior of the cuckoo. 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 middle 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 vectors composed of the water quality parameters collected at each timestamp based on the expert scoring method, and divides them into two labels: normal and abnormal. The normal label of the feature vector in the normal state is marked as +1, and the abnormal label of the feature vector in the abnormal state is marked as -1, and the sample set is constructed. y i ∈{-1,+1}}, 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 to 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, which is 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 Latgrange multiplier α i The classification problem is transformed 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, the water quality sample is predicted to be normal. If f(x)=-1, 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 of water quality being in a normal state through the logistic regression model is:
[0053]
[0054] Among them, 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 selected 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 measured value of the z-th water quality index belongs at the current moment is calibrated as the h1-1th level standard, and h1∈(1,5), and 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 is the score corresponding to the h-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, where 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 items respectively, where γ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 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.
[0069] The present invention also provides a device for constructing a water quality monitoring system model based on edge computing. The device for constructing the water quality monitoring system model is used to implement the above-mentioned method for constructing the 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 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 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 to train the water quality monitoring model. The cuckoo search algorithm and the Nelder-Mead hybrid optimization algorithm are used to optimize the model parameters.
[0072] The anomaly detection model building module is used to build an anomaly detection model using a support vector machine at the edge, taking the feature vector composed of water quality parameters as input, and the state label of the corresponding timestamp assigned by the expert scoring method as output, to train the anomaly detection model, and obtain the probability that the water quality is in a normal state 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 internally, and when the computer program is executed by the processor, the above-mentioned water quality monitoring system model construction method 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. Secondly, the combination of deep learning models and support vector machines effectively improves the accuracy of water quality predictions and reduces 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 to quickly identify pollution sources and take corresponding 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 It is a schematic diagram of the overall method flow of the present invention;
[0079] Figure 2It is a schematic 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 in conjunction with specific embodiments.
[0081] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "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 positional relationships. When the absolute position of the described object changes, the relative positional 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 the key position of the water body to collect water quality parameters and send them to the edge end. The edge end assigns the corresponding water quality index to the water quality parameters of each timestamp based on the expert scoring method, and pre-processes the water quality parameters. The pre-processed 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;
[0086] In this embodiment, the specific logic for obtaining the water quality parameter sample data set is:
[0087] The collection end includes temperature sensors, oxygen demand sensors, chemical oxygen demand sensors, pH sensors, conductivity sensors, and suspended matter sensors. Areas with water flow speeds higher than 1m / 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 value 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 for outlier detection. If the |Z| of the data is greater than 3, it is regarded as an outlier and 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. The water quality parameters of each timestamp are assigned the corresponding water quality index based on the expert scoring method. Finally, the preprocessed data is organized into a sample data set.
[0089] The collection end sends the collected water quality parameter data to the edge computing device at the edge end through the CoAP communication protocol. The edge computing device performs data preprocessing after receiving the data. The edge end receives, processes and forwards valid data from the collection end, and provides certain storage, computing and decision-making capabilities, and undertakes time-sensitive services such as intelligent perception, security and privacy protection, intelligent computing, process optimization and real-time control. On the other hand, the edge end interacts with the cloud computing layer data and uploads the optimized necessary data to the cloud. The cloud relies on its more powerful computing service capabilities to perform more in-depth data analysis and algorithm operations, such as deep learning and big data analysis. At the same time, the cloud will send the trained water quality prediction model or related rules to the edge end, and the edge end can realize intelligent control according to the water quality monitoring model and rules to improve its intelligence level. The edge end includes devices such as edge gateways, edge controllers, edge clouds and edge managers, which integrate storage, computing and network resources on the edge side to provide the hardware resources necessary for edge computing. In this project, through edge analysis, abnormal points in water quality monitoring data can be discovered in the first time, and fault points of water quality monitoring equipment can be discovered, so as to make a quick response.
[0090] Select key locations of the water body (including the middle layer, mainstream area and strong flow area) for monitoring to ensure that representative water quality data can be obtained. Set a monitoring point 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. Then, data standardization through min-max can eliminate the influence between different dimensions, making the subsequent model algorithm more effective and the model training more stable. The expert scoring method is used to assign water quality parameters to water quality indexes, making water quality assessment more scientific and authoritative.
[0091] Step 2: 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 hybrid optimization 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 a label. The water quality monitoring model is trained based on the BP neural network model. The trained water quality monitoring model is then input into the data in the test set for testing. The mean square error is selected as the loss function. When the mean square error is less than 0.01, it indicates that the training of the water quality monitoring model 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 simplex algorithm are used to optimize the model, generate a set of random bird nest locations, representing the weights and biases of the water quality monitoring model, and define the fitness function 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 kth 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 position of the bird's nest with poor fitness is replaced by simulating the parasitic reproduction behavior of the cuckoo. 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 middle 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] BP neural network is a multi-layer feedforward network that performs back propagation training on errors. It 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 relationship models without revealing the mathematical equations that describe these mapping relationships in advance. Its basic idea is the gradient descent method, which uses gradient search technology to minimize the mean square error between the actual output value and the expected output value of the network. The BP neural network consists of an input layer, a hidden layer, and an output layer. The input layer receives water quality parameters, which are processed by the weighted and activated functions of the hidden layer. Finally, the output layer predicts the water quality index. Through the training and optimization of the BP neural network, the model can more accurately predict the water quality index, thereby improving the reliability of monitoring. The implementation of this process can realize automated water quality monitoring and evaluation, process the latest collected data in real time, and respond quickly to water quality changes. The hybrid optimization of the cuckoo search algorithm and the Nelser-Mead simplex algorithm can achieve a better balance between global and local optimization and improve the generalization ability of the model.
[0102] Step 3: Use support vector machine to build an anomaly detection model at the edge, take the feature vector composed of water quality parameters as input, and the state label of the corresponding timestamp assigned by the expert scoring method as output, train the anomaly detection model, and obtain the probability of water quality being in a normal state based on the logistic regression model;
[0103] In this embodiment, the specific logic for constructing the anomaly detection model is:
[0104] The edge node marks the feature vectors composed of the water quality parameters collected at each timestamp based on the expert scoring method, and divides them into two labels: normal and abnormal. The normal label of the feature vector in the normal state is marked as +1, and the abnormal label of the feature vector in the abnormal state is marked as -1, and the sample set is constructed. y i ∈{-1,+1}}, 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 to 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, which is 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, n 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 transformed 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 >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, the water quality sample is predicted to be normal. If f(x)=-1, 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 of water quality being 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 selected 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 a slight deviation may indicate potential pollution or other dangers. Therefore, building an anomaly detection model can automatically identify these abnormal conditions and reduce human errors and omissions. By marking the data through expert scoring, a data-based model can be established to provide a scientific basis for water quality management, rather than relying solely on expert experience. The anomaly detection model can process and analyze water quality data in real time, allowing managers to respond quickly to potential water quality problems 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, have strong flexibility, and are suitable for various water quality monitoring scenarios. The probability of normal water quality is obtained through a logistic regression model, which provides more intuitive results and enables decision makers to better assess the safety of water quality. The ROC curve and AUC indicators are used to evaluate model performance, allowing managers to intuitively understand the quality of the model and adjust and optimize model parameters based on the evaluation results. Through automated anomaly detection, the reliance on manual monitoring is reduced, which can reduce labor costs while increasing the coverage and frequency of monitoring.
[0133] Step 4: 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 evaluation score based on the single indicator score;
[0134] In this embodiment, the specific logic for obtaining the comprehensive evaluation score is:
[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 measured value of the z-th water quality index belongs at the current moment is calibrated as the h1-1th level standard, and h1∈(1,5), and 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 is the score corresponding to the h-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 scores corresponding to 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 / cm, 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, S 5,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 index 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 an important indicator of water health and ecological balance. Insufficient dissolved oxygen in water can lead to the death of organisms and affect the self-purification capacity of water bodies, so it has the highest weight. Chemical oxygen demand is an important indicator to measure the degree of water pollution, indicating the content of organic matter in water. A high value of chemical oxygen demand means that the water body is seriously polluted, so it plays an important role in water quality assessment, and its weight is only lower than oxygen demand. pH value affects the metabolic process of aquatic organisms and the rate of certain chemical reactions. Too high or too low pH values will cause harm to aquatic organisms, so its weight is also high, only lower than oxygen demand and chemical oxygen demand. Conductivity reflects the total amount of ions and salt concentration in water. Too high may indicate that the water body is polluted. Although important, its impact is relatively small compared to oxygen demand and chemical oxygen demand. The impact of suspended matter on water quality is mainly reflected in the impact on light transmittance and biological respiration. Although its impact cannot be ignored, it has a lower weight than other parameters in water quality monitoring, so the weight of this parameter is only higher than temperature. Temperature has some influence on the growth and metabolism of aquatic organisms, but in general, its influence is more indirect and it is usually used as an auxiliary parameter in monitoring systems, so it has the lowest weight. This constraint ensures that the comprehensive evaluation score is a normalized index, guaranteeing 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, helping 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. 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 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] The critical values of light pollution T1, moderate pollution T2 and severe pollution T3 are set by experts based on historical data, relevant regulations and standards, and the impact on ecology, so as to adjust the thresholds to meet the needs under different environmental conditions. γ1 is used to weigh the impact of the water quality index Y predicted by the model. The water quality index is obtained through historical data and model prediction. Then this indicator is the most important and directly reflects the health of the water body, so the weight will be relatively high. γ2 represents the weight of the probability P(y=+1|x) that the characteristic vector x of the input water quality parameter is in a normal state. This probability value is calculated based on actual measurement data and statistical models, reflecting the degree of deviation of the current state of the water body from the normal state. This weight can be set lower because it is only a possibility and has a relatively small impact. The comprehensive assessment score G is usually based on the comprehensive evaluation results of multiple water quality parameters. This score may consider the weighted average of multiple indicators. Therefore, the size of the γ3 weight depends on the importance of the comprehensive assessment score in decision-making and can usually be set to a medium 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, which is usually a quantitative indicator of the overall water quality status derived from historical data and models. P(y=+1|x) represents the probability that the water quality is in a normal state, reflecting the safety of the current water quality. G represents the comprehensive evaluation score, which is based on the weighted sum of various water quality parameters and reflects the comprehensive evaluation of water quality. In this formula, a positive value of the weight indicates that an increase in each indicator will lead to an increase in the comprehensive water quality index Q. For example, if the water quality index Y increases, or the probability of the normal state P(y=+1|x) and the comprehensive evaluation score G increase, the comprehensive water quality index Q will increase accordingly, indicating that the water quality condition has improved.
[0160] By collecting water quality parameters in real time, the current water quality status can be quickly obtained, problems can be discovered and measures can be taken in a timely manner. Clear threshold standards can clearly classify water quality conditions, making it easier for decision makers to take targeted measures. By analyzing water quality status in a quantitative way, the subjectivity of human judgment can be reduced and the objectivity of evaluation can be improved. The comprehensive water quality indicators can more comprehensively realize real-time monitoring of water quality, provide managers with a scientific basis, and help them make 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, and the water quality monitoring system model construction device 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 position of the water body to collect water quality parameters and send them to the edge end. The edge end assigns the corresponding water quality index 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 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 to train the water quality monitoring model. The cuckoo search algorithm and the Nelder-Mead hybrid optimization algorithm are used to optimize the model parameters.
[0164] The anomaly detection model building module is used to build an anomaly detection model using a support vector machine at the edge, taking the feature vector composed of water quality parameters as input, and the state label of the corresponding timestamp assigned by the expert scoring method as output, to train the anomaly detection model, and obtain the probability that the water quality is in a normal state 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 internally, and when the computer program is executed by the processor, the above-mentioned water quality monitoring system model construction method based on edge computing can be implemented.
[0168] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0169] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods 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 separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for constructing a water quality monitoring system model 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 the key position of the water body to collect water quality parameters and send them to the edge end. The edge end assigns the corresponding water quality index to the water quality parameters of each timestamp based on the expert scoring method, and pre-processes the water quality parameters. The pre-processed 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; Step 2: 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 hybrid optimization algorithm. Step 3: Use support vector machine to build an anomaly detection model at the edge, take the feature vector composed of water quality parameters as input, and the state label of the corresponding timestamp assigned by the expert scoring method as output, train the anomaly detection model, and obtain the probability of water quality being in a normal state based on the logistic regression model; Step 4: 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 evaluation 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 generate a comprehensive water quality index based on the comprehensive assessment score. Compare the comprehensive water quality index with the preset water quality index threshold to determine the current water quality situation.
2. According to the method for constructing a water quality monitoring system model based on edge computing in claim 1, it is characterized in that: The specific logic for obtaining the water quality parameter sample data set is: The collection end includes temperature sensors, oxygen demand sensors, chemical oxygen demand sensors, pH sensors, conductivity sensors, and suspended matter sensors. The middle layer area, mainstream area, and strong current 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 value and conductivity data. Suspended matter sensors are arranged 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 for outlier detection. If the |Z| of the data is greater than 3, it is regarded as an outlier and 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. The water quality parameters of each timestamp are assigned the corresponding water quality index based on the expert scoring method. Finally, the preprocessed data is organized into a sample data set.
3. According to a method for constructing a water quality monitoring system model based on edge computing according to claim 2, it is characterized in that: The specific logic for constructing 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 a label. The water quality monitoring model is trained based on the BP neural network model. The trained water quality monitoring model is then input into the data in the test set for testing. The mean square error is selected as the loss function. When the mean square error is less than 0.01, it indicates that the training of the water quality monitoring model is completed. The cuckoo search algorithm and Nelder-Mead simplex algorithm are used to optimize the model, generate a set of random bird nest locations, represent the weights and biases of the water quality monitoring model, and define the fitness function 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 kth sample of the node respectively; After evaluating the fitness of each individual bird nest, calculating the fitness values of all individual bird nests, and sorting the bird nest population according to the fitness values, the positions of bird nests with poor fitness are 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-Md algorithm, which selects the worst, best and middle 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. According to claim 3, a method for constructing a water quality monitoring system model based on edge computing is characterized in that: The specific logic for building anomaly detection models is: The edge node marks the feature vectors composed of the water quality parameters collected at each timestamp based on the expert scoring method, and divides them into two labels: normal and abnormal. The normal label of the feature vector in the normal state is marked as +1, and the abnormal label of the feature vector in the abnormal state is marked as -1, and the sample set is constructed. 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 to 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, which is 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 transformed 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, the water quality sample is predicted to be normal. If f(x)=-1, 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 of water quality being 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 selected 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. According to the method for constructing a water quality monitoring system model based on edge computing according to claim 4, it is characterized in that: The specific logic for obtaining the comprehensive evaluation 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 measured value of the z-th water quality index belongs at the current moment is calibrated as the h1-1th level standard, and h1∈(1,5), and 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 is the score corresponding to the h-1 level standard; Based on the single index 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 is characterized in that: The specific logic for judging the water quality at the current moment is: 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. Three thresholds are preset according to historical data and environmental standards, namely the light pollution critical value T1, the moderate pollution critical value T2, and the heavy 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 light 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 heavy pollution state.
7. A water quality monitoring system model building device based on edge computing, characterized in that: The water quality monitoring system model construction device is used to implement the water quality monitoring system model construction method described in any one of claims 1-6, including: The data acquisition and preprocessing module is used to arrange the acquisition end at the key positions of the water body to collect water quality parameters and send them to the edge end. The edge end assigns the corresponding water quality index 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: 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 hybrid optimization algorithm are used to optimize the model parameters; The anomaly detection model construction module is used to construct an anomaly 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 anomaly detection model, and the probability of the water quality being 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 of the water quality being in a normal state, 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 water quality monitoring system model construction method based on edge computing described in any one of claims 1-6.
Citation Information
Patent Citations
Cyanobacterial bloom outbreak early warning method based on mutation theory and improved cuckoo algorithm
CN109858132A
Water environment quality evaluation method based on artificial intelligence algorithm
CN112990343A
Water quality monitoring method based on BP neural network
CN115184352A
Water quality monitoring control method and system
CN118861642A
Water quality pollution monitoring system and method based on machine learning
CN118883875A
Cited By
A multi-dimensional intelligent control system for fluorine removal
CN119750684A
A multi-dimensional intelligent control system for defluorination
CN119750684B
Water quality detection system for hydraulic engineering and monitoring method
CN120214252A
Processing method for water quality detection data of new and old wetlands
CN120766813A
Water quality monitoring method and system based on edge calculation
CN121092324A