Method, system and equipment for calculating effective mean value of water quality monitoring data and medium
By automatically identifying and removing over-range, constant values and outliers in the online water quality monitoring system, the effective mean value of the water quality monitoring data is calculated, which solves the problem of abnormal data interference, improves the accuracy and reliability of the data, and supports water quality safety. Assure.
Patent Information
- Application Number
- CN202410693472.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-27
AI Technical Summary
In the online water quality monitoring system, data abnormal values (constant values, over-range, outliers) caused by equipment failure, operation and maintenance level, communication interference and other reasons interfere with the timely and accurate judgment of water quality conditions, and manual review exists. The problem of heavy workload and untimely work.
By determining the time interval for valid data calculation, the determination and deletion of over-range, constant values and outliers are carried out, and the Grubbs test and other methods are used to automatically identify and remove abnormal data, and calculate the water quality monitoring within a given time period. The effective mean of the data.
It realizes the automatic identification and removal of abnormal water quality data, improves the accuracy and reliability of data, and supports the judgment of dynamic changes in water quality and the guarantee of water quality safety.
Smart Images

Figure CN118709098A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of water quality monitoring, and in particular to a method, system, device and medium for calculating an effective mean value of water quality monitoring data. Background Art
[0002] With the rapid development of economy and urban construction, the urban population has increased dramatically, and the domestic water consumption has increased rapidly. At the same time, the water pollution problem has not been effectively solved, and the water supply safety situation is not optimistic. Online water quality monitoring is a comprehensive automatic monitoring system composed of online water quality analysis instruments, using modern sensor technology, automatic measurement technology and computer technology to achieve water sample collection and rapid analysis of water quality parameters.
[0003] Although the online water quality monitoring system plays an important role in the field of water quality monitoring, due to equipment failure, operation and maintenance level, and communication interference, the data uploaded to the monitoring center has constant values, negative values, over-range values, and outliers, which interferes with the manager's timely and accurate judgment of water quality. In order to ensure the quality of online monitoring data, if the data is manually reviewed, there will be problems such as heavy workload and untimely review. Summary of the invention
[0004] The present application provides a method, system, device and medium for calculating the effective mean of water quality monitoring data to solve the above-mentioned problems.
[0005] On the one hand, the present application provides a method, system, device and medium for calculating the effective mean of water quality monitoring data, the method comprising the following steps:
[0006] Step S1: Determine the time interval T for valid data calculation, and obtain the first data set M monitored by the monitoring device; M = {x1, x2, x3, ..., x i}, i = 1, 2, 3, ..., n;
[0007] Step S2: performing over-range determination, constant value determination and outlier determination on the first data set M to obtain a second data set D;
[0008] Step S3: Calculate the average value of the second data set D to obtain the mean value of the water quality detection data in the time interval T.
[0009] In an implementation of the present application, before step S2, the method further includes: performing validity determination on the first data set M, the specific process of which is:
[0010] The theoretical minimum sample size f is calculated based on the following formula:
[0011]
[0012] Where n is the total amount of water quality data; P is usually set to 0.50, the significance level is set to 0.05 (i.e., α = 0.05), and the confidence level used in interval estimation is 1-α = 0.95, at which time the quantile k = 1.96.
[0013] In one implementation of the present application, in step S2, the process of over-range determination is specifically as follows:
[0014] Based on the measurement range preset by the water quality online monitoring device as the judgment standard, the data in the first data set M are judged one by one in order;
[0015] The data that exceeds the range are marked and deleted, and the number of deleted data is recorded as y. At the same time, the theoretical minimum sampling size f0 of the first data set M is calculated according to formula (1), and whether the data exceeds the range is determined based on the minimum sampling size f0.
[0016] In one implementation of the present application, the method further includes: when ny < f0, terminating data processing and issuing an alarm to indicate a device failure; when ny ≥ f0, deleting the out-of-range data, recording a new third data set as Q = {x1, x2, x3, ..., x i}, i=1,2,3,……,ny.
[0017] In one implementation of the present application, in step S2, the process of determining the constant value is specifically as follows:
[0018] Follow x i+1 -x i =0 (i=1, 2, ..., ny) to judge the third data set Q, and at the same time calculate the minimum sampling amount f1 of the data set Q according to formula (1);
[0019] When the number of the first group of continuous constant values w>v, the number of constant values is marked as m1, the number of the second group of continuous constant values is m2, and so on, the judgment of the entire data set Q is completed; where v is a settable number, which is the judgment standard for defining the constant value;
[0020] When any set of constant values x i The number of m i Meet Nym i <f0 or the total number of continuous unchanged values in each group m 总 Meet Nym 总 When <f0, data processing is terminated and an alarm is given to indicate equipment failure. 总 ≥f1 and ≥f0, all constant values are eliminated, and the data set is recorded as R = {x1, x2, x3, ..., x i}, i=1,2,3,…,nym total.
[0021] In one implementation of the present application, in step S2, the process of outlier determination is specifically as follows:
[0022] The Grubbs test method is introduced. In the process of judging suspicious values, the mean value and standard deviation in the normal distribution are introduced to judge the outliers. The mean value of the data set R is calculated using formulas (2) and (3). and standard deviation S, and use formula (4) to calculate the Grubbs G of each data 计算 , take the absolute value, and calculate the minimum sample size f2 of the data set R according to formula (1);
[0023]
[0024] G 计算 Grubbs test value table G 临界值 Compare, if G 计算 Greater than G 临界值 If the data is not equal to 1, the data is deleted and the amount of deleted data is recorded as l; otherwise, the data is retained;
[0025] When nym 总 -l<f0, data processing is terminated and an alarm is issued to indicate device failure; when nym 总 When -l≥f2 and ≥f0, the data is retained and the final data set is recorded as the second data set D.
[0026] The present application also provides a water quality monitoring data effective mean value calculation system, the system comprising:
[0027] The data acquisition module is used to determine the time interval T for effective data calculation and obtain the first data set M monitored by the monitoring device; M = {x1, x2, x3, ..., x i}, i = 1, 2, 3, ..., n;
[0028] A data set determination module, used for performing over-range determination, constant value determination and outlier determination on the first data set M to obtain a second data set D;
[0029] The calculation module is used to calculate the average value of the second data set D to obtain the mean value of the water quality detection data in the time interval T.
[0030] The present application also provides a water quality monitoring data effective mean value calculation device, the device comprising:
[0031] at least one processor; and,
[0032] a memory communicatively connected to the at least one processor; wherein,
[0033] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can complete the aforementioned method for calculating the effective mean of water quality monitoring data.
[0034] The present application also provides a non-volatile computer storage medium for calculating the effective mean of water quality monitoring data, which stores computer executable instructions, and the computer executable instructions are used to execute the aforementioned method for calculating the effective mean of water quality monitoring data.
[0035] The present application provides a method, system, equipment and medium for calculating the effective mean of water quality monitoring data. By establishing a method and model for identifying over-range values, constant values and outliers, the effective mean of online water quality monitoring data within a given time period is analyzed and obtained. This provides a basic method for automatically identifying abnormal water quality data, removing the interference of abnormal data on water quality indicators, and obtaining accurate data. This is of great significance for improving the accuracy and reliability of data, judging dynamic changes in water quality, and supporting water quality safety assurance. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0037] Figure 1 A flow chart of a method for calculating the effective mean of water quality monitoring data provided in an embodiment of the present application;
[0038] Figure 2 A calculation logic flow chart provided for an embodiment of the present application;
[0039] Figure 3 A composition diagram of a water quality monitoring data effective mean value calculation system provided in an embodiment of the present application;
[0040] Figure 4 A schematic diagram of a water quality monitoring data effective mean calculation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0042] The embodiments of the present application provide a method, system, device and medium for calculating the effective mean of water quality monitoring data. The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0043] Figure 1 A flow chart of a method for calculating the effective mean of water quality monitoring data provided in the embodiment of the present application. Figure 1 As shown, the method mainly includes the following steps:
[0044] Step S1: Determine the time interval T for valid data calculation, and obtain the first data set M monitored by the monitoring device; M = {x1, x2, x3, ..., x i}, i = 1, 2, 3, ..., n;
[0045] Step S2: performing over-range determination, constant value determination and outlier determination on the first data set M to obtain a second data set D;
[0046] Step S3: Calculate the average value of the second data set D to obtain the mean value of the water quality detection data in the time interval T.
[0047] The calculation logic flow of the embodiment of the present application is as follows: Figure 2 As shown, the specific contents of the embodiments of the present application are described in detail below.
[0048] In the embodiment of the present application, before the step S2, the method further includes: performing validity determination on the first data set M, the specific process of which is:
[0049] The theoretical minimum sample size f is calculated based on the following formula:
[0050]
[0051] Where n is the total amount of water quality data; P is usually set to 0.50, the significance level is set to 0.05 (i.e., α = 0.05), and the confidence level used in interval estimation is 1-α = 0.95, at which time the quantile k = 1.96.
[0052] In the embodiment of the present application, in step S2, the process of over-range determination is specifically as follows:
[0053] Based on the measurement range preset by the water quality online monitoring device as the judgment standard, the data in the first data set M are judged one by one in order;
[0054] The data that exceeds the range are marked and deleted, and the number of deleted data is recorded as y. At the same time, the theoretical minimum sampling size f0 of the first data set M is calculated according to formula (1), and whether the data exceeds the range is determined based on the minimum sampling size f0.
[0055] In the embodiment of the present application, the method further includes: when ny < f0, terminating data processing and issuing an alarm to indicate device failure; when ny ≥ f0, deleting the out-of-range data, recording the new third data set as Q = {x1, x2, x3, ..., x i}, i=1,2,3,……,ny.
[0056] In the embodiment of the present application, in step S2, the process of constant value determination is specifically as follows:
[0057] Follow x i+1 -x i =0 (i=1, 2, ..., ny) to judge the third data set Q, and at the same time calculate the minimum sampling amount f1 of the data set Q according to formula (1);
[0058] When the number of the first group of continuous constant values w>v, the number of constant values is marked as m1, the number of the second group of continuous constant values is m2, and so on, the judgment of the entire data set Q is completed; where v is a settable number, which is the judgment standard for defining the constant value;
[0059] When any set of constant values x i The number of m i Meet Nym i <f0 or the total number of continuous unchanged values in each group m 总 Meet Nym 总 When <f0, data processing is terminated and an alarm is given to indicate equipment failure. 总 ≥f1 and ≥f0, all constant values are eliminated, and the data set is recorded as R = {x1, x2, x3, ..., x i}, i=1,2,3,…,nym total.
[0060] In the embodiment of the present application, in step S2, the process of outlier determination is specifically as follows:
[0061] The Grubbs test method is introduced. In the process of judging suspicious values, the mean value and standard deviation in the normal distribution are introduced to judge the outliers. The mean value of the data set R is calculated using formulas (2) and (3). and standard deviation S, and use formula (4) to calculate the Grubbs G of each data 计算 , take the absolute value, and calculate the minimum sample size f2 of the data set R according to formula (1);
[0062]
[0063] G 计算 Grubbs test value table G 临界值 Compare, if G 计算 Greater than G临界值 If the data is not equal to 1, the data is deleted and the amount of deleted data is recorded as l; otherwise, the data is retained;
[0064] When nym 总 -l<f0, data processing is terminated and an alarm is issued to indicate device failure; when nym 总 When -l≥f2 and ≥f0, the data is retained and the final data set is recorded as the second data set D.
[0065] The following is an example to further illustrate the embodiment of the present application. The data analysis interval is set: the mean value of the pH water quality online monitoring instrument data within 1500 minutes is analyzed as needed. Here, the analysis interval T = 1500 minutes, and the data set within this interval is recorded as M = {x1, x2, x3, ..., x i}, i=1,2,3,……,n.
[0066] Calculation of data set sample size: Assuming the detection cycle of the online water quality monitoring instrument is 15 min / time, the sample size of data set M is n=1500 min / (15 min / time)=100.
[0067] Table 1 Detection data of a water quality online monitoring device within 1500 minutes
[0068]
[0069]
[0070] Data set sample size validity judgment: According to formula (1), the theoretical minimum sample size is calculated. Within the 95% confidence interval, the minimum sample size is f0=79. The next step is to make an over-range judgment.
[0071] Out-of-range determination: The measurement range of the pH water quality online monitoring equipment is [2,12]. After determination, the maximum value in the data sample is 8.00 and the minimum value is -7.57. The amount of out-of-range data p = 2, which are -7.57 and 1.00 respectively. After deleting these two data, the sample size becomes ny = 100-2 = 98 > f0 = 79. The data set is recorded as Q, and the next step of constant value determination is entered.
[0072] Constant value determination: according to x i+1 -x i =0(i=1,2,…,nlk) to judge the constant value of the data set Q. According to formula (1), the minimum sampling size f1=78 of the data set Q is calculated. If the number of continuous constant values v=6 is set, according to the sample size ny=98, the continuous constant value is 7.56, and the maximum continuous number w=7> the set value v=6, the constant value judgment standard is met, so the 7 continuous data numbers in this group are eliminated, and the data volume becomes nym 总=100-2-7=91>f0=79 and greater than f1=78. The new data set is recorded as R and enters the outlier determination stage.
[0073] Outlier determination: Calculate the average value of the data set according to formulas (2), (3), and (4). Standard Deviation S and G 计算 , respectively 7.58, 0.05, 3.192, after calculating the data G 计算 , where the value of G is 8.00 计算 =8.4, which is greater than 3.223, so it is determined to be an outlier, l = 1, and is deleted. The amount of retained data is nym 总 -l=90,nym 总 -l=90>f0=79. According to formula (1), the effective data volume f2=73 of data set R is calculated. The data volume 90>73 and>79, so the data is valid. The data set is recorded as D, and the effective mean calculation can be performed.
[0074] Table 2 Abnormal data identification and judgment
[0075] Serial number Monitoring data Remark Serial number Monitoring data Remark 1 -7.57 Over range value 6 7.56 Constant value 2 1.00 Over range value 7 7.56 Constant value 3 7.56 Constant value 8 7.56 Constant value 4 7.56 Constant value 9 7.56 Constant value 5 7.56 Constant value 10 8.00 Outliers
[0076] Calculation of effective mean: The mean of 90 effective data of data set D is 7.36.
[0077] In the method of the embodiment of the present application, abnormal data are divided into over-range values, constant values and outliers; the method is applicable to continuous water quality data measured by online water quality monitoring equipment such as conventional five parameters, ammonia nitrogen, permanganate index, total nitrogen, total phosphorus, residual chlorine, chlorine dioxide, etc.; the selection of data volume in the method should generally select time period data, daily data, weekly data or monthly data.
[0078] The above is a method for calculating the effective mean of water quality monitoring data provided by an embodiment of the present application. Based on the same inventive concept, an embodiment of the present application also provides a system for calculating the effective mean of water quality monitoring data. Figure 3 A composition diagram of a water quality monitoring data effective mean value calculation system provided in an embodiment of the present application, such as Figure 3 As shown, the system mainly includes: a data acquisition module 301, which is used to determine the time interval T for effective data calculation and obtain the first data set M monitored by the monitoring device; M = {x1, x2, x3, ..., x i}, i=1,2,3,...,n; a data set determination module 302, used to perform over-range determination, constant value determination and outlier determination on the first data set M to obtain a second data set D; a calculation module 303, used to calculate the average value of the second data set D to obtain the mean value of the water quality detection data in the time interval T.
[0079] The above is a water quality monitoring data effective mean value calculation system provided by the embodiment of the present application. Based on the same inventive concept, the embodiment of the present application also provides a water quality monitoring data effective mean value calculation device. Figure 4 A schematic diagram of a water quality monitoring data effective mean value calculation device provided in an embodiment of the present application, such as Figure 4 As shown, the device mainly includes: at least one processor 401; and a memory 402 communicatively connected to the at least one processor; wherein the memory 402 stores instructions that can be executed by the at least one processor 401, and the instructions are executed by the at least one processor 401 so that the at least one processor 401 can complete the aforementioned method for calculating the effective mean of water quality monitoring data.
[0080] In addition, an embodiment of the present application also provides a non-volatile computer storage medium for calculating the effective mean of water quality monitoring data, which stores computer executable instructions, and the computer executable instructions are used to execute the aforementioned method for calculating the effective mean of water quality monitoring data.
[0081] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0082] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0084] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0085] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0086] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0087] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for calculating the effective mean of water quality monitoring data, characterized in that: The method comprises the following steps: Step S1: Determine the time interval T for valid data calculation, and obtain the first data set M monitored by the monitoring device; M = {x1, x2, x3, ..., x i }, i = 1, 2, 3, ..., n; Step S2: performing over-range determination, constant value determination and outlier determination on the first data set M to obtain a second data set D; Step S3: Calculate the average value of the second data set D to obtain the mean value of the water quality detection data in the time interval T.
2. A method for calculating effective mean of water quality monitoring data according to claim 1, characterized in that: Before step S2, the method further includes: performing validity determination on the first data set M, the specific process of which is: The theoretical minimum sample size f is calculated based on the following formula: Where n is the total amount of water quality data; P is usually set to 0.50, the significance level is set to 0.05 (i.e., α = 0.05), and the confidence level used in interval estimation is 1-α = 0.95, at which time the quantile k = 1.
96.
3. A method for calculating effective mean of water quality monitoring data according to claim 1, characterized in that: In step S2, the process of over-range determination is specifically as follows: Based on the measurement range preset by the water quality online monitoring device as the judgment standard, the data in the first data set M are judged one by one in order; The data that exceeds the range are marked and deleted, and the number of deleted data is recorded as y. At the same time, the theoretical minimum sampling size f0 of the first data set M is calculated according to formula (1), and whether the data exceeds the range is determined based on the minimum sampling size f0.
4. A method for calculating effective mean of water quality monitoring data according to claim 3, characterized in that: The method further includes: when ny<f0, terminating data processing and giving an alarm to indicate equipment failure; when ny≥f0, deleting the out-of-range data and recording a new third data set as Q={x1, x2, x3, . . . , x i }, i=1,2,3,……,ny.
5. A method for calculating effective mean of water quality monitoring data according to claim 1, characterized in that: In step S2, the process of constant value determination is specifically as follows: Follow x i+1 -x i =0 (i=1, 2, ..., ny) to judge the third data set Q, and at the same time calculate the minimum sampling amount f1 of the data set Q according to formula (1); When the number of the first group of continuous constant values w>v, the number of constant values is marked as m1, the number of the second group of continuous constant values is m2, and so on, the judgment of the entire data set Q is completed; where v is a settable number, which is the judgment standard for defining the constant value; When any set of constant values x i The number of m i Meet Nym i <f0 or the total number of continuous unchanged values in each group m 总 Meet Nym 总 When <f0, data processing is terminated and an alarm is given to indicate equipment failure. 总 When ≥f1 and ≥f0, all constant values are eliminated, and the data set is recorded as R = {x1, x2, x3, ..., x i }, i=1,2,3,…,nym total.
6. A method for calculating effective mean of water quality monitoring data according to claim 1, characterized in that: In step S2, the process of outlier determination is specifically as follows: The Grubbs test method is introduced. In the process of judging suspicious values, the mean value and standard deviation in the normal distribution are introduced to judge the outliers. The mean value of the data set R is calculated using formulas (2) and (3). and standard deviation S, and use formula (4) to calculate the Grubbs G of each data 计算 , take the absolute value, and calculate the minimum sample size f2 of the data set R according to formula (1); G 计算 Grubbs test value table G 临界值 Compare, if G 计算 Greater than G 临界值 If the data is not equal to 1, the data is deleted and the amount of deleted data is recorded as l; otherwise, the data is retained; When nym 总 -l<f0, data processing is terminated and an alarm is issued to indicate device failure; when nym 总 When -l≥f2 and ≥f0, the data is retained and the final data set is recorded as the second data set D.
7. A water quality monitoring data effective mean calculation system, characterized in that: The system comprises: The data acquisition module is used to determine the time interval T for effective data calculation and obtain the first data set M monitored by the monitoring device; M = {x1, x2, x3, ..., x i }, i = 1, 2, 3, ..., n; A data set determination module, used for performing over-range determination, constant value determination and outlier determination on the first data set M to obtain a second data set D; The calculation module is used to calculate the average value of the second data set D to obtain the mean value of the water quality detection data in the time interval T.
8. A water quality monitoring data effective mean value calculation device, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can complete the effective mean calculation method for water quality monitoring data described in any one of claims 1-6.
9. A non-volatile computer storage medium for calculating effective mean of water quality monitoring data, storing computer executable instructions, characterized in that: The computer executable instructions are used to execute a method for calculating an effective mean of water quality monitoring data as described in any one of claims 1-6.
