Multi-branch confluence water quality monitoring method, system, equipment and storage medium
By using water quality prediction models and sensors to collect data at multi-channel confluence, the problem of inaccurate water quality monitoring caused by water flow disturbance is solved, and more accurate and reliable water quality monitoring is achieved.
Patent Information
- Application Number
- CN202410783732.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-06-18
AI Technical Summary
The water flow disturbance at the multi-channel confluence makes it difficult for water quality monitoring equipment to accurately monitor water quality. Existing equipment may filter data incorrectly and cannot accurately reflect the water quality.
By obtaining the water quality monitoring time series of multi-channel confluence, input the water quality prediction model to obtain a trusted water quality value, and collect the measured values through the water quality sensor to initialize the monitoring variables. Abnormal determination is made based on the trusted value, and the data is collected repeatedly until the preset number is reached to ensure the accuracy of the data.
The accuracy of water quality monitoring of multi-channel confluence gutters is improved, the reliability and real-time nature of water quality data is ensured, and data errors are avoided due to local water flow disturbances.
Smart Images

Figure CN118797516B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of water quality measurement technology, and in particular to a method, system, equipment and storage medium for monitoring water quality at a multi-branch confluence. Background Art
[0002] Water bodies at multi-branch confluences are often drinking water sources, ecologically sensitive areas, or upstream of downstream water bodies, making them crucial for water quality safety. Multi-branch confluences are often prone to localized flow disturbances, leading to complex hydrological conditions. Therefore, monitoring water quality data such as converging vortices and pollutant concentrations in the confluence fan can easily result in significant fluctuations in instantaneous monitoring results. Water quality monitoring equipment can monitor water environment indicators such as temperature, total phosphorus, turbidity, conductivity, pH, and ammonia nitrogen at the monitoring point in real time. Its built-in simple data processing chip supports data identification, abnormal data filtering, data packet encapsulation, and data transmission. However, due to the severe localized flow disturbances at multi-branch confluences, water quality monitoring equipment may incorrectly filter water quality data at multi-branch confluences. Therefore, current water quality monitoring equipment is not suitable for monitoring water quality at multi-branch confluences and cannot accurately reflect the water quality situation. Summary of the Invention
[0003] The main purpose of the embodiments of the present application is to propose a method, system, device and storage medium for monitoring water quality at a multi-branch confluence, aiming to improve the accuracy of water quality monitoring at a multi-branch confluence.
[0004] To achieve the above objectives, one aspect of an embodiment of the present application provides a method for monitoring water quality at a multi-branch confluence, comprising the following steps:
[0005] Obtaining a water quality monitoring time series at a confluence of multiple branches, wherein the water quality monitoring time series includes true water quality values at different sampling periods;
[0006] Inputting the water quality monitoring time series into the water quality prediction model to obtain a reliable water quality value for the current sampling period;
[0007] Collect the measured water quality value of the current sampling period through the water quality sensor, and initialize the value of the water quality monitoring variable according to the measured water quality value;
[0008] An abnormality determination is performed on the value of the water quality monitoring variable according to the water quality credible value. When the value of the water quality monitoring variable is abnormal, the water quality sensor is controlled to re-collect the actual water quality value of the current sampling period, and the value of the water quality monitoring variable is updated according to the re-collected actual water quality value.
[0009] Repeat the step of determining anomalies of the value of the water quality monitoring variable based on the water quality credible value until a preset number of times is reached, and then record the current value of the water quality monitoring variable as the true value of the water quality in the current sampling period.
[0010] In some embodiments, the method for monitoring water quality at a multi-branch confluence further comprises the following steps:
[0011] When the value of the water quality monitoring variable is normal, the current value of the water quality monitoring variable is recorded as the true value of the water quality in the current sampling period, and the sampling of the measured water quality value in the current sampling period is ended.
[0012] In some embodiments, obtaining a water quality monitoring time series at a multi-branch confluence includes the following steps:
[0013] Record the actual water quality value of each sampling period in the order of sampling time to obtain the historical monitoring time series;
[0014] A plurality of true water quality values of a preset time length before a current sampling period are intercepted from the historical monitoring time series to obtain a water quality monitoring time series.
[0015] In some embodiments, the water quality prediction model is obtained by the following steps:
[0016] Obtain the original water quality data sequence;
[0017] performing a level ratio test on the original water quality data sequence, and when the original water quality data sequence fails the level ratio test, performing a translation process on the original water quality data sequence according to the group interval of the original water quality data sequence to update the original water quality data sequence;
[0018] Performing an accumulation operation on the original water quality data sequence to obtain an accumulation generated sequence;
[0019] A water quality prediction model is constructed based on the cumulatively generated sequence.
[0020] In some embodiments, the step of constructing a water quality prediction model based on the cumulatively generated sequence includes the following steps:
[0021] Using Lagrange quadratic curve interpolation method to calculate interpolation between adjacent data in the cumulative generated sequence to obtain a curve interpolation sequence;
[0022] Cross-combining the cumulative generated sequence and the curve interpolation sequence to obtain a combined sequence;
[0023] Performing integration calculation on the combined sequence by Simpson integration method to obtain a background sequence;
[0024] A grey model is constructed according to the background sequence and the original water quality data sequence, and the parameters of the grey model are solved by the least square method to obtain a water quality prediction model.
[0025] In some embodiments, the step of determining an abnormality of the value of the water quality monitoring variable based on the water quality credibility value comprises the following steps:
[0026] Obtaining a preset deviation amplitude of a monitoring factor corresponding to the value of the water quality monitoring variable;
[0027] Determining a dynamic credible interval based on the water quality credible value and the preset deviation amplitude;
[0028] It is determined whether the value of the water quality monitoring variable belongs to the dynamic credible interval. When the value of the water quality monitoring variable does not belong to the dynamic credible interval, the value of the water quality monitoring variable is abnormal.
[0029] In some embodiments, the method for monitoring water quality at a multi-branch confluence further comprises the following steps:
[0030] Count the total number of times the value of the water quality monitoring variable is abnormal since the last model update node;
[0031] When the total number of times exceeds the total number threshold, the water quality prediction model is updated according to the actual water quality value recorded from the last model update node to the current moment.
[0032] To achieve the above objectives, another aspect of the present application provides a multi-branch confluence water quality monitoring system, comprising:
[0033] The first module is used to obtain a water quality monitoring time series at a multi-branch confluence, wherein the water quality monitoring time series includes the true water quality values of different sampling periods;
[0034] The second module is used to input the water quality monitoring time series into the water quality prediction model to obtain the water quality credible value of the current sampling period;
[0035] The third module is used to collect the measured water quality value of the current sampling period through the water quality sensor, and initialize the value of the water quality monitoring variable according to the measured water quality value;
[0036] The fourth module is used to make an abnormal judgment on the value of the water quality monitoring variable based on the water quality credible value. When the value of the water quality monitoring variable is abnormal, the water quality sensor is controlled to re-collect the actual water quality value of the current sampling period, and the value of the water quality monitoring variable is updated according to the re-collected actual water quality value; the step of making an abnormal judgment on the value of the water quality monitoring variable based on the water quality credible value is repeated until a preset number of times is reached, and the current value of the water quality monitoring variable is recorded as the true water quality value of the current sampling period.
[0037] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes an electronic device, which includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the method described in the above embodiment is implemented.
[0038] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in the above embodiment.
[0039] The present application proposes a method, system, device and storage medium for monitoring water quality at a multi-branched confluence, which predicts by inputting the water quality monitoring time series of the previous sampling period into a water quality prediction model to obtain a credible water quality value for the current sampling period, and then uses a water quality sensor to collect the measured water quality value of the current sampling period, and initializes the value of the water quality monitoring variable based on the measured water quality value. An abnormality determination is made on the value of the water quality monitoring variable based on the credible water quality value. When the value of the water quality monitoring variable is abnormal, the water quality sensor is controlled to re-collect the measured water quality value of the current sampling period, and the value of the water quality monitoring variable is updated based on the re-collected measured water quality value. The steps of determining the abnormality of the water quality monitoring variable are repeated until a preset number of times is reached, indicating that the water quality of the current sampling period has indeed changed. At this time, the current value of the water quality monitoring variable is recorded as the true value of the water quality of the current sampling period, thereby improving the accuracy of water quality monitoring at the multi-branched confluence. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of a method for monitoring water quality at a multi-branch confluence provided in an embodiment of the present application;
[0041] Figure 2 Schematic diagram of the water quality monitoring process at a multi-branch confluence provided in an embodiment of the present application;
[0042] Figure 3This is a schematic diagram of the dynamic credible interval generation process provided by an embodiment of the present application;
[0043] Figure 4 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0045] It should be noted that although the system is divided into functional modules and the flowcharts illustrate a logical sequence, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowcharts. The terms "first," "second," and so on in the specification, claims, and drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence.
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0047] First, let’s analyze some of the terms used in this application:
[0048] The Lagrange quadratic interpolation method is a generalized method based on Lagrange interpolation polynomials. It is used to estimate the value of an unknown function using three known data points. It constructs a quadratic polynomial that has the same value as the original function at the three known data points, allowing it to fit the data points more accurately and improve interpolation accuracy.
[0049] The Simpson integration method is a numerical integration method based on the interpolation principle. It divides the function curve approximately into several small intervals, uses a quadratic polynomial to perform interpolation calculations on each small interval, and performs weighted averaging on the results of all small intervals to obtain the final approximate result.
[0050] The least squares method (LS) is a mathematical optimization technique that finds the best function that matches data by minimizing the sum of squared errors. The basic principle of the least squares method is to use the differences between data points and a pre-defined function called a "model function" to estimate the parameters of the model function.
[0051] Grey Model (GM model for short) is a method that uses a small amount of incomplete information to establish a grey differential prediction model, thereby making a fuzzy long-term description of the development law of things.
[0052] The multi-branch confluence water quality monitoring method, system, equipment and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the multi-branch confluence water quality monitoring method in the embodiments of the present application is described.
[0053] The multi-branch confluence water quality monitoring method provided in the embodiment of the present application relates to the field of water quality measurement technology. The multi-branch confluence water quality monitoring method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the multi-branch confluence water quality monitoring method, etc., but is not limited to the above forms.
[0054] In some embodiments, the terminal can also be an edge monitoring device, comprising a water quality sensor and a processor. The connection between the water quality sensor and the processor can be wireless or wired. The water quality sensor is primarily used to collect water quality data. The processor includes a predictive analysis module and a behavior control module. The predictive analysis module is primarily used to predict a water quality confidence value using a water quality prediction model. The behavior control module is primarily used to determine whether to re-collect actual water quality values based on the confidence value and send instructions to the water quality sensor for re-testing. The behavior control module is capable of receiving instructions from the data analysis module in real time and parsing and executing these instructions using built-in efficient algorithms and logic circuits. Specifically, the behavior control module includes several components: instruction reception, parsing and execution, and execution feedback. The instruction reception component is used to receive re-testing instructions or other control instructions from the data analysis module in real time. The parsing and execution component incorporates efficient algorithms and logic circuits to rapidly parse received instructions and trigger corresponding execution actions based on the parsing results. Based on the instructions from the parsing and execution unit, the module controls the external device or system to perform corresponding operations, such as adjusting parameters or changing paths. The execution feedback component feeds the execution results back to the data analysis module for subsequent data analysis and optimization.
[0055] Figure 1This is an optional flow chart of the multi-branch confluence water quality monitoring method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S105.
[0056] Step S101, obtaining a water quality monitoring time series at a multi-branch confluence, wherein the water quality monitoring time series includes true water quality values at different sampling periods;
[0057] Step S102: input the water quality monitoring time series into the water quality prediction model to obtain the water quality credibility value of the current sampling period;
[0058] Step S103, collecting the measured water quality value of the current sampling period through the water quality sensor, and initializing the value of the water quality monitoring variable according to the measured water quality value;
[0059] Step S104: determining an abnormality of the value of the water quality monitoring variable based on the water quality credibility value. If the value of the water quality monitoring variable is abnormal, the water quality sensor is controlled to re-collect the actual water quality value of the current sampling period, and the value of the water quality monitoring variable is updated based on the re-collected actual water quality value.
[0060] Step S105, repeating step S104 until a preset number of times is reached, and then recording the current value of the water quality monitoring variable as the true value of the water quality in the current sampling period.
[0061] In step S101 of some embodiments, a water quality sensor may be installed at the confluence of multiple branches. During monitoring, the water quality sensor is immersed in the water body and can collect various types of water quality data, such as temperature, pH value, dissolved oxygen, turbidity, ammonia nitrogen, etc. The water quality sensor is controlled by a processor, which collects water quality data according to a sampling period and records the data. For example, assuming that the sampling period is 10 minutes, that is, the sampling operation is triggered every 10 minutes, the processor executes steps S101 to S105 in each sampling period to obtain and record the true water quality value of the current sampling period. A water quality monitoring time series is formed based on the true water quality values of different sampling periods.
[0062] In some embodiments, step S101 may include but is not limited to steps S201 to S202:
[0063] Step S201, recording the actual water quality value of each sampling period in the order of sampling time to obtain a historical monitoring time series;
[0064] Step S202 , intercepting a number of real water quality values of a preset time length before the current sampling period from the historical monitoring time series to obtain a water quality monitoring time series.
[0065] In this embodiment, the processor records the actual water quality values for each sampling period in chronological order, forming a historical monitoring time series. When a sampling period begins, the processor automatically reads the actual water quality values for a preset time period before that moment. For example, it reads the actual water quality values for n consecutive sampling periods before the moment and labels them as 0 to n-1, thus forming a water quality monitoring time series.
[0066] In step S102 of some embodiments, the water quality prediction model is a model that can predict the water quality data at the next moment based on the characteristic distribution of historical water quality data. The water quality prediction model can be a neural network model, a gray model, etc. For example, the water quality monitoring time series includes n water quality data before the current sampling period. By inputting the water quality monitoring time series into the water quality prediction model, the water quality data for the current sampling period can be predicted. This water quality data can be used as the water quality credibility value for the current sampling period to dynamically analyze the reliability of the actual water quality values collected by the water quality sensor during the current sampling period.
[0067] In some embodiments, the water quality prediction model of step S102 may be obtained by, but is not limited to, steps S301 to S304:
[0068] Step S301, obtaining an original water quality data sequence;
[0069] Step S302: performing a level ratio test on the original water quality data sequence. If the original water quality data sequence fails the level ratio test, performing a translation process on the original water quality data sequence according to the group interval of the original water quality data sequence to update the original water quality data sequence.
[0070] Step S303, performing an accumulation operation on the original water quality data sequence to obtain an accumulation generated sequence;
[0071] Step S304: constructing a water quality prediction model based on the accumulated generated sequence.
[0072] In some embodiments of step S301, the original water quality data sequence X(0) can be formed by time-continuous water quality data collected by one or more water quality sensors, and the original water quality data sequence is a continuous non-negative original sequence in the time interval T. For example, a water quality sensor can be set at the junction of multiple branches to collect water quality data, and then the collected data is cleaned, and pre-processing operations such as abnormal or invalid data caused by equipment failure, data transmission errors, etc. are eliminated, thereby forming the original water quality data sequence. In another example, multiple water quality sensors can be set at the junction of multiple branches to collect water quality data, and then the collected data is cleaned, and pre-processing operations such as abnormal or invalid data caused by equipment failure, data transmission errors, etc. are eliminated, and then the weighted average of the corresponding time elements of multiple water quality sensors is taken, thereby forming the original water quality data sequence. Furthermore, the original water quality data sequence can also be subjected to data standardization processing to convert the data into a unified dimension.
[0073] In some embodiments of step S302, the original water quality data sequence X is (0) Perform level ratio test, if the test passes, then execute step S303 to step S304; if the test fails, then perform X (0) The elements of are translated to update the original water quality data sequence, and the step length of each translation is ( w(0) max -X (0) min ) / k, original water quality data sequence X after translation (0) The kth element in Then, the original water quality data sequence is continuously subjected to the level ratio test and updated until the original water quality data sequence passes the level ratio test. The specific process of the level ratio test is to calculate the level ratio of the original water quality data sequence X(0). If the level ratio result sequence all falls within the acceptable coverage interval, the original water quality data sequence passes the level ratio test. This embodiment makes the original water quality data sequence meet the model prediction requirements by continuously accumulating and shifting the original water quality data sequence in small amounts.
[0074] In some embodiments of step S303, the original water quality data sequence that has passed the level ratio test is accumulated to obtain a 1-GAO sequence X. (1) , that is, the cumulative generation sequence, the kth element x of the cumulative generation sequence (1) (k) is the sum of the first k elements in the original water quality data sequence. The data is converted into an exponential form through the accumulation operation, and the converted data sequence is simplified to the evolution law of the exponential function, thereby realizing the subsequent model construction.
[0075] In some embodiments of step S304, step S304 may include but is not limited to steps S401 to S404:
[0076] Step S401, using the Lagrange quadratic curve interpolation method to calculate the interpolation between adjacent data in the cumulative generation sequence to obtain a curve interpolation sequence;
[0077] Step S402, cross-combining the cumulative generated sequence and the curve interpolation sequence to obtain a combined sequence;
[0078] Step S403, performing integration calculation on the combined sequence using the Simpson integration method to obtain a background sequence;
[0079] Step S404: construct a grey model based on the background sequence and the original water quality data sequence, and solve the parameters of the grey model by the least square method to obtain a water quality prediction model.
[0080] In this embodiment, the Lagrange quadratic curve interpolation method is used to calculate the interpolation between adjacent data in the cumulative generation sequence to obtain a curve interpolation sequence including the interpolation between two adjacent data. The curve interpolation sequence and the cumulative generation sequence are then cross-combined to form a new combined sequence with a step length of half the original water quality data sequence step length. The combined sequence is then integrated using the Simpson integral formula to obtain the background sequence Z(1)(k). In this embodiment, the traditional adjacent two terms are averaged to form a model background sequence for model construction, and the model is constructed using As an element of the background sequence, this method has a weak ability to resist the extreme value or abnormal value noise of the sequence. This embodiment uses the LaGrange-Simpson integral method to replace the traditional method, that is, to calculate the combined sequence by LaGrange curve interpolation, and use the Simpson integral of the combined sequence as the model background value, which can weaken the extreme value or abnormal value noise, making the exponential characteristics of the background sequence more obvious, thereby obtaining a more stable prediction result. Further, the cumulative generated sequence X (1) (k) Construct the differential equation of the grey model GM(1,1), and then combine it with the background sequence Z (1) (k) The differential equation can be discretized into a difference equation, and then the coefficients and action of the difference equation can be calculated by the least squares method to obtain the water quality prediction model. When the water quality prediction model is used for water quality prediction, it is necessary to reversely translate the equivalent translation value to obtain the predicted value.
[0081] In this embodiment, the gray model is optimized based on the LaGrange-Simpson integral method to quickly qualitatively and quantitatively predict the water quality of a continuous non-negative sequence in the time interval T in the future. The gray model is a modeling and prediction method based on the gray system, which has the characteristics of less data, high accuracy and simple calculation. The gray model in the related art has a deviation in the prediction accuracy of the evolution of events. For example, when there are extreme abnormal values in the added value of the real-time input, the sequence prediction will often bring fluctuations to the subsequent prediction sequence. In view of this, the background value calculation of the gray model in this embodiment adopts the LaGrange-Simpson integral method, which can improve the reliability of short-term prediction results.
[0082] It is understandable that the training of the water quality prediction model can be implemented in the processor of the edge monitoring device or in the central server. For example, the water quality prediction model can be trained in a remote central server with powerful computing performance, and then the trained water quality prediction model can be installed in the edge monitoring device. The edge monitoring device inputs the water quality data of the recent period (i.e., the water quality monitoring time series) into the water quality prediction model, thereby predicting the water quality data of the current sampling period and obtaining the water quality credibility value of the current sampling period.
[0083] It is understandable that based on the different data types in the original water quality data sequence (such as temperature, oxygen concentration, pollutant concentration, etc.), the water quality prediction model can be a temperature prediction model, an oxygen concentration prediction model, a pollutant concentration prediction model, etc.
[0084] In step S103 of some embodiments, a water quality monitoring variable is defined in each sampling period, and then the measured water quality value of the current sampling period is collected by a water quality sensor, and the value of the water quality monitoring variable is initialized according to the measured water quality value.
[0085] In some embodiments, in steps S104 to S105, after obtaining the credible value of water quality for the current period using the water quality prediction model, the value of the water quality monitoring variable is judged to be abnormal. If the value of the water quality monitoring variable is abnormal, it indicates that the water quality data may be an accidental abnormality of the equipment or that the water quality has changed. At this time, the water quality sensor is controlled to re-collect the measured water quality value of the current sampling period, and the value of the water quality monitoring variable is updated according to the re-collected measured water quality value. Then, step S104 is re-executed to judge the value of the updated water quality monitoring variable to be abnormal. After several (for example, 2) supplementary measurements and still being judged to be abnormal, it can be determined that the water quality has indeed changed. The value of the water quality monitoring variable at this time, that is, the measured water quality value of the last measurement, is recorded as the true value of water quality for the current sampling period. During the abnormality judgment process, if the value of the water quality monitoring variable is normal, the current value of the water quality monitoring variable is recorded as the true value of water quality for the current sampling period, and the sampling of the measured water quality value for the current sampling period is terminated. When entering the next sampling period, steps S101 to S105 are continued to obtain the true value of water quality for the next sampling period.
[0086] In some embodiments, step S104 of determining abnormality of the value of the water quality monitoring variable according to the water quality credibility value may include but is not limited to steps S501 to S503:
[0087] Step S501, obtaining a preset deviation amplitude of a monitoring factor corresponding to a value of a water quality monitoring variable;
[0088] Step S502: determining a dynamic credible interval based on the water quality credible value and a preset deviation amplitude;
[0089] Step S503 , determining whether the value of the water quality monitoring variable belongs to the dynamic credible interval. When the value of the water quality monitoring variable does not belong to the dynamic credible interval, the value of the water quality monitoring variable is abnormal.
[0090] In this embodiment, the memory of the edge monitoring device stores preset deviation amplitudes of various monitoring factors. The monitoring factors can be water quality data types such as temperature, oxygen concentration, and pollutants. For example, the water quality sensor collects a pollutant concentration sequence, and the processor inputs the pollutant concentration sequence into the corresponding pollutant concentration prediction model for prediction to obtain the pollutant concentration credibility value of the current sampling period. The processor obtains the preset deviation amplitude of the pollutant concentration as the monitoring factor from the memory. For example, the preset deviation amplitude is 15%. According to the water quality credibility value P t The dynamic confidence interval can be determined as [0.85P t ,1.15P t]. Determine whether the value of the water quality monitoring variable belongs to the dynamic credible interval. When the value of the water quality monitoring variable does not belong to the dynamic credible interval, the measured water quality value at this time is abnormal. It may be that the water quality has changed or the equipment is abnormal. In order to further determine whether the water quality has really changed, two equal-time supplementary measurements are performed. If the measured values of the two supplementary measurements do not belong to the dynamic feasible interval, it indicates that the water quality environment has indeed changed. The system will record the measured value at this time and adjust the sequence input into the water quality prediction model to make a prediction for the next sampling period.
[0091] In some embodiments, the method for monitoring water quality at a multi-branch confluence according to an embodiment of the present application further includes but is not limited to steps S601 to S602:
[0092] Step S601, starting from the last model update node, counting the total number of times the value of the water quality monitoring variable is abnormal;
[0093] Step S602: When the total number of times exceeds the total number threshold, the water quality prediction model is updated according to the actual water quality value recorded from the last model update node to the current moment.
[0094] In this embodiment, the parameters of the water quality prediction model can be automatically optimized using the newly recorded water quality true value to improve the accuracy of the water quality prediction model. For example, after recording the water quality true value in each sampling period, the model can be built based on the water quality true value. Taking into account that the model update needs to consume more computing resources, in order to reduce resource consumption and improve the real-time performance of the model update, the total number of times the value of the water quality monitoring variable is abnormal under all sampling periods can be counted starting from the last model update node (i.e., the most recent update time of the water quality prediction model). For example, after three sampling periods from the most recent update time of the water quality prediction model, the total number of times the supplementary measurement in each sampling period, i.e., the total number of times the value of the water quality monitoring variable is abnormal, is 0, 1, and 2 respectively. Then the total number is 3 times. Assuming that the total number threshold is 4 times, the total number is less than the number threshold. At this time, there is no need to update the model parameters, thus reducing resource consumption. Continue to count the number of supplementary tests. The number of supplementary tests in the fourth sampling period is 2, so the total number is 5. The total number is greater than the threshold, indicating that the water quality has changed to a certain extent during this period. The previous water quality prediction model may not be applicable to the water quality prediction in the current environment. Therefore, it is necessary to use the actual water quality values recorded during this period to update the model to improve the accuracy of the model's subsequent predictions.
[0095] According to some embodiments of the present application, combined Figure 2 , the water quality monitoring process of this application is described in detail as follows:
[0096] First, use water quality sensors to monitor water quality data in real time. When the water quality sensor collects water quality data at a certain time T, it automatically reads the data of n consecutive times before this time and marks them as 0 to n-1, forming a two-dimensional data table, namely the water quality monitoring time series.
[0097] Second, the two-dimensional data table is converted into a two-dimensional matrix. The predicted value, i.e., the water quality credible value, is obtained through translation, interpolation integration, and gray prediction in the prediction process. The dynamic credible interval of the measured value is obtained based on the amplitude of the deviation between the generated predicted value and the preset value. Specifically, the dynamic credible interval generation process is as follows: Figure 3 As shown in the figure, the original water quality data sequence is first preprocessed, and the preprocessed sequence is used to construct a grey prediction model (i.e., water quality prediction model) based on the background value of the LaGrange-Simpson integral sequence. Then, the predicted value is generated by reverse analysis, and a dynamic credible interval is calculated based on the predicted value and the corresponding preset deviation amplitude.
[0098] Third, the actual water quality value at time T is obtained to determine whether it exceeds the dynamic credible interval. If not, the predicted input sequence is directly updated using the actual water quality value for the next monitoring moment. If so, a supplementary test is performed and the number of supplementary tests at time T is recorded. If the result of the first supplementary test still falls outside the dynamic credible interval, a second supplementary test is performed. If the second supplementary test result still falls outside the credible interval, it can be considered that the water environment monitoring factor has changed at this moment. The final result of the last supplementary test is stored in the memory, and the water quality monitoring time series is updated for subsequent water quality monitoring work, and the model parameters are further optimized.
[0099] This embodiment can learn the historical variation patterns of water quality parameters, construct an accurate prediction model algorithm, and optimize and adjust the preset parameters in the algorithm through continuous feedback verification, so that the square error of the fitting curve at each moment is minimized, and the predicted measured moment can better represent the water environment conditions at the current moment.
[0100] Exemplarily, the dissolved oxygen monitoring data is shown in Table 1.
[0101] Table 1 Schematic table of dissolved oxygen monitoring data
[0102]
[0103] Among them, "1" in the predicted value remark line indicates that the comparison processing has been performed, and "0" indicates that it is to be verified, that is, the predicted value at the current monitoring time.
[0104] According to the monitoring data, it can be further expressed as is the measured value in the time series; P 2j =n is the input sequence number.
[0105] Assuming that the input length of the model prediction sequence is 12 (automatically numbered 0-11), taking the current time T as the benchmark, count forward 12 monitoring values as the prediction input sequence, forming the prediction input sequence X of the water quality prediction model (0) , that is, P 1j The predicted input sequence was fed into the model. Through a process involving a permissible covering interval test, a single accumulation to generate a new sequence, LaGrange-Simpson integral calculation of the background value, and gray prediction, the simulated predicted value for the current moment was 5.66. The pre-set credible deviation amplitude for dissolved oxygen of 15% resulted in a dynamic credible interval of [4.81, 6.51]. Whether the measured value fell within this dynamic credible interval determined whether a retest instruction was issued to further confirm whether significant changes in water quality had occurred.
[0106] The present application also provides a multi-branch confluence water quality monitoring system, including:
[0107] The first module is used to obtain a water quality monitoring time series at the confluence of multiple branches, wherein the water quality monitoring time series includes the actual water quality values at different sampling periods;
[0108] The second module is used to input the water quality monitoring time series into the water quality prediction model to obtain the water quality credible value of the current sampling period;
[0109] The third module is used to collect the measured water quality values of the current sampling period through the water quality sensor and initialize the values of the water quality monitoring variables according to the measured water quality values;
[0110] The fourth module is used to judge the value of the water quality monitoring variable as abnormal based on the water quality credible value. When the value of the water quality monitoring variable is abnormal, the water quality sensor is controlled to re-collect the actual water quality value of the current sampling period, and the value of the water quality monitoring variable is updated according to the re-collected actual water quality value; the step of judging the value of the water quality monitoring variable as abnormal based on the water quality credible value is repeated until the preset number of times is reached, and the current value of the water quality monitoring variable is recorded as the true value of the water quality in the current sampling period.
[0111] It can be understood that the contents of the above-mentioned multi-branch channel confluence water quality monitoring method embodiment are applicable to the present system embodiment. The functions specifically implemented by the present system embodiment are the same as those in the above-mentioned multi-branch channel confluence water quality monitoring method embodiment, and the beneficial effects achieved are also the same as those achieved by the above-mentioned multi-branch channel confluence water quality monitoring method embodiment.
[0112] The present application also provides an electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for enabling communication between the processor and the memory. When the program is executed by the processor, the aforementioned multi-branch confluence water quality monitoring method is implemented. The electronic device can be any smart terminal, including a tablet computer and an in-vehicle computer.
[0113] See also Figure 4 , Figure 4 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:
[0114] The processor 401 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0115] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 402 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program codes are stored in the memory 402 and are called by the processor 401 to execute the multi-branch confluence water quality monitoring method of the embodiment of the present application;
[0116] Input / output interface 403, used to implement information input and output;
[0117] Communication interface 404, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0118] Bus 405 , which transmits information between various components of the device (e.g., processor 401 , memory 402 , input / output interface 403 , and communication interface 404 );
[0119] The processor 401 , the memory 402 , the input / output interface 403 and the communication interface 404 are connected to each other in communication within the device via a bus 405 .
[0120] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned multi-branch confluence water quality monitoring method.
[0121] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0122] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0123] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0124] The system embodiment described above is merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0125] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0126] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0127] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the above units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0129] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0130] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0131] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0132] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A method for monitoring water quality at a multi-branch confluence, characterized in that: The multi-branch confluence water quality monitoring method is applied in each sampling cycle, and the multi-branch confluence water quality monitoring method comprises the following steps: Obtaining a water quality monitoring time series at a confluence of multiple branches, wherein the water quality monitoring time series includes true water quality values at different sampling periods; Inputting the water quality monitoring time series into a water quality prediction model to obtain a reliable value of water quality in the current sampling period; Collect the measured water quality value of the current sampling period through the water quality sensor, and initialize the value of the water quality monitoring variable according to the measured water quality value; An abnormality determination is performed on the value of the water quality monitoring variable according to the water quality credible value. When the value of the water quality monitoring variable is abnormal, the water quality sensor is controlled to re-collect the actual water quality value of the current sampling period, and the value of the water quality monitoring variable is updated according to the re-collected actual water quality value; Repeat the step of determining an abnormality of the value of the water quality monitoring variable based on the water quality credible value until a preset number of times is reached, and then record the current value of the water quality monitoring variable as the true value of the water quality in the current sampling period.
2. The method for monitoring water quality at a multi-branch confluence according to claim 1, characterized in that: The multi-branch confluence water quality monitoring method further comprises the following steps: When the value of the water quality monitoring variable is normal, the current value of the water quality monitoring variable is recorded as the true value of the water quality in the current sampling period, and the sampling of the measured water quality value in the current sampling period ends.
3. The method for monitoring water quality at a multi-branch confluence according to claim 1, characterized in that: The method of obtaining a water quality monitoring time series at a confluence of multiple branches comprises the following steps: Record the actual water quality value of each sampling period in the order of sampling time to obtain the historical monitoring time series; A plurality of water quality real values of a preset time length before a current sampling period are intercepted from the historical monitoring time series to obtain a water quality monitoring time series.
4. The method for monitoring water quality at a multi-branch confluence according to claim 1, characterized in that: The water quality prediction model is obtained by the following steps: Obtaining the original water quality data sequence; Performing a level ratio test on the original water quality data sequence, and when the original water quality data sequence fails the level ratio test, performing a translation process on the original water quality data sequence according to the group distance of the original water quality data sequence to update the original water quality data sequence; Performing an accumulation operation on the original water quality data sequence to obtain an accumulation generated sequence; A water quality prediction model is constructed according to the cumulatively generated series.
5. The method for monitoring water quality at a multi-branch confluence according to claim 4, characterized in that: The method of constructing a water quality prediction model according to the cumulatively generated sequence includes the following steps: The Lagrange quadratic curve interpolation method is used to calculate the interpolation between adjacent data in the cumulatively generated sequence to obtain a curve interpolation sequence; Cross-combining the cumulative generated sequence and the curve interpolation sequence to obtain a combined sequence; Performing integration calculation on the combined sequence by Simpson integration method to obtain a background sequence; A grey model is constructed according to the background sequence and the original water quality data sequence, and the parameters of the grey model are solved by the least square method to obtain a water quality prediction model.
6. The method for monitoring water quality at a multi-branch confluence according to claim 1, characterized in that: The abnormality determination of the value of the water quality monitoring variable according to the water quality credible value comprises the following steps: Obtaining a preset deviation amplitude of a monitoring factor corresponding to the value of the water quality monitoring variable; Determining a dynamic credible interval according to the water quality credible value and the preset deviation amplitude; It is determined whether the value of the water quality monitoring variable belongs to the dynamic credible interval. When the value of the water quality monitoring variable does not belong to the dynamic credible interval, the value of the water quality monitoring variable is abnormal.
7. The method for monitoring water quality at a multi-branch confluence according to claim 1, characterized in that: The multi-branch confluence water quality monitoring method further comprises the following steps: Count the total number of times the value of the water quality monitoring variable is abnormal since the last model update node; When the total number of times exceeds the total number threshold, the water quality prediction model is updated according to the actual value of water quality recorded from the last model update node to the current moment.
8. A water quality monitoring system for a multi-branch confluence, characterized in that: The multi-branch confluence water quality monitoring system is applied in each sampling cycle, and the multi-branch confluence water quality monitoring system includes: The first module is used to obtain a water quality monitoring time series at a confluence of multiple branches, wherein the water quality monitoring time series includes the true values of water quality at different sampling periods; The second module is used to input the water quality monitoring time series into the water quality prediction model to obtain the water quality credible value of the current sampling period; The third module is used to collect the measured water quality value of the current sampling period through the water quality sensor, and initialize the value of the water quality monitoring variable according to the measured water quality value; The fourth module is used to make an abnormal judgment on the value of the water quality monitoring variable according to the water quality credible value. When the value of the water quality monitoring variable is abnormal, the water quality sensor is controlled to re-collect the actual water quality value of the current sampling period, and the value of the water quality monitoring variable is updated according to the re-collected actual water quality value; the step of making an abnormal judgment on the value of the water quality monitoring variable according to the water quality credible value is repeated until a preset number of times is reached, and the current value of the water quality monitoring variable is recorded as the true value of the water quality in the current sampling period.
9. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the method described in any one of claims 1 to 7 are realized.
10. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for generating water quality information map
CN110597934A
Water quality state monitoring method and device based on Bayesian model, and electronic equipment
CN116304913A