Water quality line sticking range determination method and interfered water quality monitoring point position identification method
Through cluster analysis, it is solved to determine the water quality patch range and identify the disturbed water quality monitoring points, and the problem of difficult to effectively identify the artificially disturbed water quality monitoring points in the existing technology is solved, and the accuracy and reliability of water quality monitoring data are improved. .
Patent Information
- Application Number
- CN202411820827.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The prior art is difficult to effectively identify water quality monitoring points that are subject to human interference, which affects the accuracy and reliability of water quality monitoring data.
The water quality patching range is determined through cluster analysis, and abnormal points are identified based on the patching range, and the disturbed water quality monitoring points are identified. The specific methods include clustering analysis of the water quality monitoring data at the monitoring points, calculating the clustering error and value under each cluster number, determining the number of elbow clusters, and selecting the number of clusters larger than the number of elbow clusters as the selection. The number of clusters is finally determined based on the upper and lower limits of the cluster cluster corresponding to the selected cluster number.
The water quality patch range determined through cluster analysis can better identify disturbed water quality monitoring points, improve the accuracy and reliability of water quality monitoring data, and reduce regulatory risks.
Smart Images

Figure CN119474937A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of environmental screening, and in particular to a method for determining a water quality line range and a method for identifying disturbed water quality monitoring points. Background Art
[0002] Driven by motivations such as meeting water quality performance assessment standards, some polluting enterprises or administrative departments with regulatory responsibilities for polluted water bodies may achieve water quality standards by artificially interfering with the water quality of monitoring points. Accordingly, how to identify the aforementioned monitoring points where artificial interference occurs, and then exclude the corresponding water quality monitoring data and trace back to the relevant responsible parties, is an important task of environmental protection supervision. How to identify the water body data characteristics of the aforementioned monitoring points that have been interfered with by humans, and then reversely identify the monitoring points where the data has been interfered with based on the water body data characteristics, is the first technical problem that needs to be solved.
[0003] At present, environmental protection supervision departments still patrol and inspect water quality monitoring points to prevent relevant responsible parties from interfering with water quality at water quality monitoring points. However, the aforementioned method is too costly and cannot effectively identify some organized and targeted numerical interference behaviors. In order to avoid the aforementioned problems, relevant technologies propose a method of determining the line range based on water quality monitoring indicators and identifying abnormal points based on the line range. However, the aforementioned line range is easy to identify, and the responsible party who actively interferes with water quality will also actively interfere in a way that causes the water quality monitoring data to be outside the aforementioned line range. Summary of the invention
[0004] The embodiments of the present disclosure provide a method for determining a water quality line range and a method for identifying disturbed water quality monitoring points.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for determining a water quality line range, comprising: Use each cluster number to perform cluster analysis on the water quality monitoring data of the existing monitoring points, and determine the cluster set of water quality monitoring data under each cluster number; The corresponding clustering errors and values are calculated based on the clustering sets under each clustering number, and the number of elbow clusters is determined based on the clustering errors and values corresponding to each clustering number; A selected number of clusters is selected from the number of clusters greater than the number of elbow clusters, and the upper and lower limits of the cluster clusters including the water quality assessment index in the cluster set corresponding to the selected number of clusters are used as the upper and lower limits of the water quality line range.
[0006] Optionally, selecting a selected number of clusters from a number of clusters greater than the number of elbow clusters comprises: S1: Determine the number of i-th clusters and the number of i+1-th clusters after the number of elbow clusters, where the initial value of i is 0; S2: Calculate the reduction ratio of the clustering error and value corresponding to the i-th cluster number and the i+1-th cluster number, and determine whether the reduction ratio is less than the preset reduction ratio; if so, execute S3; if not, execute S4; S3: taking the i+1th number of clusters as the selected number of clusters; S4: Set i=i+1 and execute S1.
[0007] Optionally, selecting a selected number of clusters from a number of clusters greater than the number of elbow clusters comprises: S1: Determine the number of i-th clusters and the number of i+1-th clusters after the number of elbow clusters, where the initial value of i is 0; S2: Calculate the difference between the clustering error and the value corresponding to the i-th cluster number and the i+1-th cluster number, and determine whether the difference is less than a set difference threshold; if so, execute S3; if not, execute S4; S3: taking the i+1th number of clusters as the selected number of clusters; S4: Set i=i+1 and execute S1.
[0008] Optionally, the S3 includes: S31: taking the i+1th number of clusters as the number of clusters to be selected, and determining the upper and lower limits of the clusters including the water quality assessment index in the cluster set corresponding to the number of clusters to be selected as the upper and lower limits to be selected; S32: Determine whether the water quality assessment index is within the middle area determined based on the upper and lower limits to be selected, and the upper and lower limits of the middle area are within the upper and lower limits to be selected; if so, execute S33; if not, execute S4; S33: Taking the (i+1)th number of clusters as the selected number of clusters.
[0009] Optionally, the calculating of corresponding clustering errors and values based on cluster sets under each number of clusters respectively includes: For each cluster under a certain number of clusters, calculate the corresponding cluster center respectively; Based on the intra-cluster center of each cluster and the intra-cluster water quality monitoring data, the intra-cluster distance and value are calculated; The clustering error and value are calculated based on the intra-cluster distance and value of each cluster cluster under a certain number of clusters.
[0010] Optionally, determining the number of elbow clusters based on the clustering errors and values corresponding to each number of clusters includes: Calculate the first-order difference value of the adjacent cluster number, and calculate the difference value ratio between the adjacent first-order difference value and the adjacent first-order difference value; The first cluster number that makes the difference value ratio smaller than the preset ratio is selected as the elbow cluster number.
[0011] In a second aspect, an embodiment of the present disclosure provides a method for identifying disturbed water quality monitoring points, including: Obtain a historical monitoring data sequence of the water quality monitoring point to be identified, and count the number of on-line monitoring data in the historical monitoring data sequence; the on-line monitoring data is monitoring data located within a water quality on-line range, and the water quality on-line range is determined by the water quality on-line range determination method as described above; Based on the amount of the on-line monitoring data and the total amount of data in the historical monitoring data sequence, the proportion of the on-line data of the water quality monitoring point to be identified is calculated; Determine whether the proportion of the line-fitting data is greater than an upper threshold of the proportion; When the proportion of the line-fitting data is greater than the upper threshold of the proportion, it is determined that the water quality monitoring point to be identified is a disturbed water quality monitoring point.
[0012] Optionally, before determining whether the proportion of the line-fitting data is greater than an upper threshold of the proportion, the method further includes: Based on the historical monitoring data series of all monitoring points, the proportion of line data at each monitoring point is counted respectively; Conduct statistical analysis on the proportion of line-attached data at each monitoring point to determine the mean and mean square error of the proportion; The upper threshold of the proportion is determined based on the mean proportion and the mean square error of the proportion.
[0013] Optionally, the acquiring of a historical monitoring data sequence of the water quality monitoring point to be identified and counting the number of on-line monitoring data in the historical monitoring data sequence includes: acquiring various types of water quality monitoring data of the water quality monitoring point to be identified, and counting the number of on-line monitoring data in various types of water quality monitoring data respectively; Calculating the proportion of in-line data of the water quality monitoring point to be identified, including: calculating the proportion of in-line data of various types of water quality monitoring data at the water quality monitoring point to be identified; The determining whether the proportion of the line-fitting data is greater than a preset upper threshold of the proportion includes: determining whether the proportion of the line-fitting data of various types of water quality monitoring data is greater than the corresponding preset upper threshold of the proportion; In the case where the proportion of the line data is greater than the upper limit threshold of the proportion, the water quality monitoring point to be identified is determined to be a disturbed water quality monitoring point, including: in the case where the proportion of the line data of a water quality monitoring data is greater than the corresponding preset upper limit threshold of the proportion, the water quality monitoring point to be identified is determined to be a disturbed water quality monitoring point.
[0014] In a third aspect, an embodiment of the present disclosure provides a computing device, including a processor and a memory, wherein the memory is used to store a computer program; when the computer program is loaded by the processor, the processor executes the water quality line range determination method as described above or the disturbed water quality monitoring point identification method as described above.
[0015] The embodiment scheme of the present disclosure determines the cluster sets under each cluster number by the method of cluster analysis, and determines the elbow cluster number according to the cluster error and value of each cluster number cluster set, and then determines a larger cluster number as the selected cluster number according to the elbow cluster number, and finally uses the upper and lower limits of the cluster clusters including the water quality assessment index in the cluster set corresponding to the selected cluster number as the upper and lower limits of the water quality line range. Because a cluster number greater than the elbow cluster number is used as the selected cluster number, the problem of the upper and lower limits of the determined line range being too large can be eliminated. Because the upper and lower limits of the water quality line range determined by the embodiment of the present disclosure can be obtained based on the monitoring data of a large number of water quality monitoring points and cluster analysis based on unsupervised learning, it is not easy to predict, so it is also possible to better identify whether there is a problem of line adhesion affecting water quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work, including: Figure 1 is a flow chart of a method for determining a water quality line range provided by an embodiment of the present disclosure; Figure 2 is a flow chart of a method for identifying disturbed water quality monitoring points provided by an embodiment of the present disclosure; Figure 3 It is a schematic diagram of the structure of a computing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0019] The term "including" and its variations used in this document are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. In this document, relational terms such as "first" and "second" are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0020] The disclosed embodiment starts from the perspective of the actual water quality responsible party. While achieving the goal of meeting water quality standards through cheating, it will consider achieving water quality standards at the lowest possible cost and reducing regulatory risks caused by significant data falsification. The corresponding water quality monitoring data will be based on water quality assessment indicators and have obvious line-changing characteristics. According to the above analysis, this scheme analyzes the water quality monitoring data of a large number of monitoring points to find a water quality line range, and uses the above line range as the basis for screening the disturbed water quality monitoring points. Specifically, this scheme provides a method for determining a water quality line range, and a method for identifying disturbed water quality monitoring points based on the water quality line range determined by the above method.
[0021] Figure 1 : is a flow chart of a method for determining a water quality line range provided by an embodiment of the present disclosure. Figure 1 As shown, the method for determining the water quality line range provided by the embodiment of the present disclosure includes S110-S130.
[0022] S110: performing cluster analysis on the water quality monitoring data of the existing monitoring points using each cluster number, and determining a cluster set of the water quality monitoring data under each cluster number.
[0023] Before the implementation of the disclosed solution, water quality monitoring data of a large number of monitoring points for long-term water quality monitoring are obtained. The monitoring points in the implementation of the disclosed solution are points set for water quality monitoring for specific types of water bodies or pollution discharges.
[0024] For example, when it is necessary to evaluate the water environment quality of surface water such as rivers, lakes and seas, the monitoring points are set at the main locations or key locations of rivers, lakes and seas. For another example, when it is necessary to monitor whether the pollution discharged by an enterprise meets the standards, the monitoring point is the location where the enterprise's sewage culvert is connected to the surface water body, or a location adjacent to the aforementioned connection location.
[0025] Correspondingly, there will be different types of water quality assessment indicators for monitoring points in different types of locations. For example, according to the current water quality standards and specifications, surface water is divided into five categories of water bodies, among which the water quality evaluation indicators of Class I water bodies such as source water and national nature reserve water bodies include chemical oxygen demand ≤15mg / L, five-day biochemical oxygen demand ≤2mg / L, Class II water bodies (mainly applicable to the first-level protection areas of centralized drinking water surface water sources, habitats of rare aquatic organisms, spawning grounds of fish and shrimp, and feeding grounds for fry and young fish) include chemical oxygen demand ≤30mg / L, five-day biochemical oxygen demand ≤5mg / L, chemical oxygen demand ≤15mg / L, Class III water bodies (mainly applicable to centralized drinking water surface water The water quality evaluation indicators for Class II water bodies (such as fish and shrimp wintering grounds, migration channels, aquaculture areas, and swimming areas) include chemical oxygen demand ≤40mg / L and five-day biochemical oxygen demand ≤6mg / L. The water quality evaluation indicators for Class IV water bodies (mainly applicable to general industrial water areas and recreational water areas that are not directly in contact with the human body) include chemical oxygen demand ≤60mg / L and five-day biochemical oxygen demand ≤10mg / L. The water quality evaluation indicators for Class V water bodies (mainly applicable to agricultural water areas and water bodies with general landscape requirements) include chemical oxygen demand ≤100mg / L and five-day biochemical oxygen demand ≤15mg / L. In addition, there are corresponding indicators such as ammonia nitrogen content, potassium permanganate index, and total phosphorus content for various water bodies, which are no longer clustered here.
[0026] It should be noted here that existing monitoring points include those that may interfere with the water body and affect the water quality monitoring data, such as subsequent monitoring points to be evaluated. In specific implementation, the types of interference with the water body that affect the water quality monitoring data include spraying pesticides, aeration, stirring the water body, and setting up sewage culverts to dilute the concentration of pollutants.
[0027] Preferably, the aforementioned water quality monitoring data includes water quality monitoring data under various seasons and rainfall conditions (e.g., flood season, drought season), so as to ensure that the large amount of water quality monitoring data obtained is widely representative and has the characteristic of significantly changing with the river water level. In addition, in the specific implementation, in order to ensure the rationality of clustering itself, water quality monitoring data of rivers with similar water characteristic conditions should be used for clustering analysis as much as possible.
[0028] In the disclosed embodiment, each cluster number is used to perform cluster analysis on the water quality monitoring data of the existing monitoring points. Each cluster number is used as a hyperparameter, and the water quality monitoring data is clustered using the aforementioned hyperparameters.
[0029] In the specific implementation, the cluster analysis method adopted is the K-means cluster analysis method or a method with the same clustering nature. The K-means cluster analysis method first randomly selects K initial data as cluster centers, calculates the distance between each water quality monitoring data and the initial cluster center, so as to minimize the distance between all water quality monitoring data and the initial cluster center to construct a loss function and determine K clusters; after determining the K clusters, recalculate the K cluster centers according to the water quality monitoring data in each cluster, and repeat the above method until the cluster center no longer changes or the maximum number of iterations is reached. The above distance can be a Euclidean distance or a square sum distance.
[0030] After clustering the water quality monitoring data of the existing monitoring points using each cluster number, the cluster set under the corresponding cluster number can be obtained. In the embodiment of the present disclosure, considering that a small number of clusters does not achieve the meaning of clustering, and a large number of clusters does not meet the needs of water quality monitoring, the number of clusters in actual applications can start from 3 until it reaches a value of about 20, and no larger or smaller number of clusters is used.
[0031] S120: Calculate the corresponding clustering errors and values based on the cluster sets under each clustering number, and determine the number of elbow clusters based on the clustering errors and values corresponding to each clustering number.
[0032] After obtaining the cluster sets under each cluster number, the cluster sets under each cluster number are then used to calculate the corresponding clustering errors and values. In specific implementations, the clustering errors and values can be the loss function obtained by the last clustering, or data that characterizes the clustering characteristics of the entire water quality monitoring data by other methods.
[0033] In some embodiments, the clustering error and value may be calculated using the following S121 - S123 .
[0034] S121: For each cluster under a certain number of clusters, the corresponding cluster center is calculated respectively.
[0035] In a specific implementation, the aforementioned intra-cluster center may be the center determined when the cluster center is determined for the last time during cluster analysis, or may be the centroid of the internal water quality monitoring data of each cluster determined by a centroid calculation method.
[0036] S122: Calculate the intra-cluster distance and value based on the intra-cluster center of each cluster and the intra-cluster water quality monitoring data.
[0037] After obtaining the intra-cluster center of each cluster, the distance from each water quality monitoring data to the corresponding intra-cluster center is calculated respectively, and the intra-cluster distance and value can be obtained by adding the aforementioned distances.
[0038] S123: Calculate the clustering error and value based on the intra-cluster distance and value of each cluster under a certain number of clusters.
[0039] After obtaining the intra-cluster distances and values of all clusters, the intra-cluster distances and values are added together to obtain the clustering error and value.
[0040] After obtaining the clustering errors and values corresponding to each number of clusters, the number of elbow clusters can be determined based on the clustering errors and values corresponding to each number of clusters. The number of elbow clusters is the point at which the change characteristics of the clustering errors and values decrease rapidly. In a specific implementation, the number of elbow clusters can be determined according to the following S124-S125.
[0041] S124: Calculate the first-order difference value of the adjacent cluster quantity, and calculate the difference value ratio between the adjacent first-order difference value and the adjacent first-order difference value.
[0042] Assume that there are 5 clusters, 5, 6, 7, 8, 9, and the corresponding clustering errors and values are x5, x6, x7, x8, and x9, and the corresponding first-order difference values are x6-x5, x7-x6, x8-x7, and x9-x8. According to the basic principle of cluster analysis, x5>x6>x7>x8>x9, and the corresponding x6-x5, x7-x6, x8-x7, and x9-x8 are all negative.
[0043] Then, by dividing the latter first-order difference value by the former first-order difference value, we can get the corresponding difference value ratios, which are (x7-x6) / (x6-x5), (x8-x7) / (x7-x6), and (x8-x7 / )(x9-x8) respectively.
[0044] S125: Select the first cluster number that makes the difference value ratio smaller than a preset ratio as the elbow cluster number.
[0045] After calculating each difference ratio, the difference ratio is then compared with the preset ratio from front to back. The preset ratio is a value predetermined based on experience. In the case where the first difference ratio is less than the preset ratio, the number of clusters that makes the corresponding difference ratio less than the preset ratio is determined to be the number of elbow clusters. For example, if (x7-x6) / (x6-x5) is the first number of clusters that makes the difference ratio less than the preset ratio, the corresponding 6 is the number of elbow clusters.
[0046] S130: Selecting a selected number of clusters from the number of clusters that is greater than the number of elbow clusters, and using the upper and lower limits of the clusters of the water quality assessment indicators included in the cluster set corresponding to the selected number of clusters as the upper and lower limits of the water quality line range.
[0047] After determining the elbow number of clusters, the selected number of clusters may then be selected among the number of clusters greater than the elbow number of clusters.
[0048] In the embodiment of the present disclosure, an attempt was made to determine whether the upper and lower limits of the clusters including the water quality assessment indicators in the corresponding cluster set can be used as the upper and lower limits of the water quality line range based on the number of elbow clusters as the selected number of clusters. However, through a large amount of big data analysis, it was found that the values between the upper and lower limits of the water quality line range determined when the number of elbow clusters was selected as the selected number of clusters were large, and the upper and lower limits of the clusters including the water quality assessment indicators directly determined by the number of elbow clusters were not suitable as the upper and lower limits of the water quality line range.
[0049] Therefore, in this scheme, the selected number of clusters is selected from the number of clusters greater than the number of elbow clusters, and the upper and lower limits of the cluster clusters containing water quality assessment indicators in the cluster set corresponding to the selected number of clusters are used as the upper and lower limits of the water quality line range.
[0050] In some embodiments, the computing device determines the selected number of clusters using S131 - S134 as follows.
[0051] S131: Determine the number of i-th clusters and the number of i+1-th clusters after the number of elbow clusters.
[0052] The initial value of i is 0.
[0053] S132: Calculate the reduction ratio of the clustering error and value corresponding to the i-th cluster number and the i+1-th cluster number, and determine whether the reduction ratio is less than the preset reduction ratio; if so, execute S133; if not, execute S134.
[0054] To calculate the reduction ratio of the clustering error sum corresponding to the i-th cluster number and the i+1-th cluster number, the clustering error sum corresponding to the i+1-th cluster number is subtracted from the clustering error sum corresponding to the i-th cluster number to obtain the absolute value of the difference, and then the absolute value of the difference is compared with the clustering error corresponding to the i-th cluster number to obtain the reduction ratio.
[0055] S133: Taking the i+1th number of clusters as the selected number of clusters.
[0056] S134: Set i=i+1 and execute S131.
[0057] If the reduction ratio corresponding to the i+1th number of clusters is less than the preset reduction ratio, it means that the corresponding clustering error and value will not change much if the number of clusters changes again. Therefore, the i+1th number of clusters can be used as the selected number of clusters.
[0058] In some embodiments, the aforementioned S133 may specifically include the following S1331-S1333.
[0059] S1331: The i+1th number of clusters is used as the number of clusters to be selected, and the upper and lower limits of the clusters including the water quality assessment indicators in the cluster set corresponding to the number of clusters to be selected are determined as the upper and lower limits to be selected.
[0060] S1332: Determine whether the water quality assessment index is within the middle area determined based on the upper and lower limits to be selected, and the upper and lower limits of the middle area are within the upper and lower limits to be selected; if so, execute 1333; if not, execute S134.
[0061] S1333: Taking the i+1th number of clusters as the selected number of clusters.
[0062] In actual applications, there may be a problem that one of the upper and lower limits of the cluster cluster containing the water quality assessment index in the cluster set corresponding to the i+1th cluster number is too close to the water quality assessment index, and it is not reasonable to use this upper and lower limit. To avoid this problem, after obtaining the upper and lower limits of the water quality assessment index corresponding to the aforementioned number of clusters to be selected (that is, the upper and lower limits to be selected), first determine whether the water quality assessment index is in the middle area determined based on the upper and lower limits to be selected. Only when it is determined that the water quality assessment index is in the middle area determined by the upper and lower limits to be selected, the i+1th cluster number will be used as the selected cluster number, and then the upper and lower limits to be selected will be used as the selected upper and lower limits. If it is determined that the water quality assessment index is not in the middle area determined by the upper and lower limits to be selected, then continue to execute S134 to determine whether the subsequent cluster number can be used as the selected cluster number.
[0063] The aforementioned middle area is an area whose upper and lower limits are located between the upper and lower limits to be selected. In a specific implementation, the middle area can be the middle one-third area of the area determined by the upper and lower limits to be selected.
[0064] In some other embodiments, the computing device determines the selected number of clusters using S135 - S138 as follows.
[0065] S135: Determine the number of i-th clusters and the number of i+1-th clusters after the number of elbow clusters.
[0066] The initial value of i is 0.
[0067] S136: Calculate the difference between the clustering error and the value corresponding to the i-th cluster number and the i+1-th cluster number, and determine whether the difference is less than the set difference threshold; if so, execute S137; if not, execute S138.
[0068] S137: Taking the i+1th number of clusters as the selected number of clusters.
[0069] S138: Set i=i+1 and execute S131.
[0070] Comparing S135-S138 with the aforementioned S131-S134, the only difference is in determining the difference value of the sum of the clustering errors and judging whether the difference value is less than the set difference threshold. It can be imagined that here, whether to use the i+1th cluster number as the selected cluster number is determined by comparing the absolute values.
[0071] In the foregoing, it is mentioned that the selected number of clusters is determined by calculation, and then the upper and lower limits of the water quality line range are determined. In other embodiments, a broken line can be drawn between the cluster error and the number of clusters, and then an experienced technician observes the broken line and selects the selected number of clusters from the number of clusters greater than the number of elbow clusters, and then determines the upper and lower limits of the water quality line range according to the selected number of clusters.
[0072] The embodiment scheme of the present disclosure determines the cluster sets under each number of clusters by the method of cluster analysis, and determines the number of elbow clusters according to the clustering errors and values of the cluster sets under each number of clusters, and then determines a larger number of clusters as the selected number of clusters according to the number of elbow clusters, and finally uses the upper and lower limits of the cluster clusters including the water quality assessment indicators in the cluster set corresponding to the selected number of clusters as the upper and lower limits of the water quality line range. That is, the embodiment scheme of the present disclosure provides a method for determining the upper and lower limits of the water quality line range by the method of cluster analysis. Because the upper and lower limits of the water quality line range determined by the embodiment of the present disclosure are obtained based on cluster analysis of unsupervised learning, the water quality line range obtained is not determined subjectively by people, but is determined based on the water quality monitoring data of a large number of water quality monitoring points, and it is not easy to predict. Therefore, it is also possible to better identify whether there is a problem of line adhesion affecting water quality.
[0073] In addition to providing the aforementioned method for determining the water quality line range, the embodiment of the present disclosure also provides a method for identifying disturbed water quality monitoring points. The method for identifying disturbed water quality monitoring points uses the water quality line range determined by the aforementioned method for determining the water quality line range. Figure 2 is a flow chart of the method for identifying disturbed water quality monitoring points provided by the embodiment of the present disclosure. Figure 2 As shown, the method for identifying disturbed water quality monitoring points includes S210-S240.
[0074] S210: Obtain a historical monitoring data sequence of the water quality monitoring point to be identified, and count the number of on-line monitoring data in the historical monitoring data sequence.
[0075] The on-line monitoring data refers to the monitoring data within the water quality line range.
[0076] S220: Based on the number of on-line monitoring data and the total amount of data in the historical monitoring data series, calculate the proportion of on-line data of the water quality monitoring point to be identified.
[0077] S230: Determine whether the proportion of line-fitting data is greater than an upper threshold of the proportion; if so, execute S240.
[0078] S240: Determine that the water quality monitoring point to be identified is a disturbed water quality monitoring point.
[0079] The disclosed embodiment is based on a premise: if the proportion of on-line monitoring data at a certain monitoring point is too large, there may be two reasons: (1) the water quality may indeed meet the standard; (2) the water quality is considered to be disturbed. However, the possibility of the aforementioned (1) occurring is small, and it is likely that the aforementioned reason (2) causes the proportion of on-line monitoring data to be too large, so the water quality monitoring point to be identified is identified as a disturbed water quality monitoring point.
[0080] When executing the above method, it is also necessary to determine a preset upper threshold of the proportion. In some embodiments, the upper threshold of the proportion is not a determined upper threshold, but is determined objectively. In a specific implementation, the following S250-S270 can be used to determine the upper threshold of the proportion.
[0081] S250: Based on the historical monitoring data series of all monitoring points, the proportion of line data of each monitoring point is counted respectively.
[0082] S260: Statistically analyze the proportion of the line-attached data at each monitoring point to determine the proportion mean and proportion mean square error; S270: Determine an upper threshold of the proportion based on the proportion mean and the proportion mean square error.
[0083] According to statistical principles, when the number of disturbed water quality monitoring points among the monitoring points is small, the proportion of their line data does not conform to the characteristics of the proportion of line data in a large number of monitoring points. Based on this, the mathematical statistical characteristics of the proportion of line data for most monitoring points are determined in the embodiment of the present disclosure, and a reasonable range of line data proportion is determined based on the mathematical statistical characteristics. If the proportion of line data at a certain monitoring point is outside the aforementioned reasonable range of line data proportion, this monitoring point is determined to be a disturbed water quality monitoring point. Accordingly, it is necessary to determine the upper limit threshold of the proportion based on the mathematical statistical characteristics. In specific implementation, the upper limit threshold of the proportion can be obtained by adding the simple mean and 3 times the mean square error of the proportion obtained by statistical analysis of the proportion of line data at each monitoring point.
[0084] In actual implementation, it is necessary to monitor various types of water quality, for example, it is necessary to monitor the potassium permanganate index, COD content, phosphorus content, and ammonia nitrogen content. Accordingly, the aforementioned S210 can be to obtain various types of water quality monitoring data of the water quality monitoring point to be identified, and respectively count the number of on-line monitoring data in various types of water quality monitoring data; the aforementioned S220 can be to respectively calculate the proportion of on-line data of various types of water quality monitoring data at the water quality monitoring point to be identified; the aforementioned S230 can be to respectively determine whether the proportion of on-line data of various types of water quality monitoring data is greater than the corresponding preset upper limit threshold of proportion; the aforementioned S240 is specifically: when the proportion of on-line data of a type of water quality monitoring data is greater than the corresponding preset upper limit threshold of proportion, the water quality monitoring point to be identified is determined to be a disturbed water quality monitoring point.
[0085] In a specific implementation, the upper and lower limits of the line-fitting range determined by the above method are shown in Table 1 Table 1 Upper and lower limits of the line range After obtaining the data in Table 1 above, the water quality monitoring location that was disturbed was then determined according to the upper and lower limits determined in Table 1. Through on-site investigation, it was found that there was a trace of floating white matter around the water intake of a certain monitoring point, and a box containing white unidentified objects was placed on the shore. It was determined that this water quality monitoring point was suspected to be disturbed. Looking back at the historical monitoring data sequence of this water quality monitoring point, 30 monitoring data were obtained, of which 21 sets of data were within the line range, that is, 70% of the data were within the line range, which was not normal. Therefore, the water quality monitoring point here was determined to be an interfered monitoring point.
[0086] In specific implementation, statistical analysis can also be performed on the historical monitoring data of each monitoring point. When the data assessment status of a certain monitoring point changes from qualified to 20%-30% unqualified, the above-mentioned method can be used to check it out; or when the data assessment status changes from qualified to continuously exceeding the standard over a period of time, and then becomes close to the line and meets the data assessment indicators, it can be checked out.
[0087] The embodiment of the present disclosure also provides a computing device for implementing the aforementioned method. Figure 3 Schematic diagram of the structure of the computing device provided by the embodiment of the present disclosure. Figure 3 , which shows a schematic diagram of the structure of a computing device 300 suitable for implementing the method of the embodiment of the present disclosure. Figure 3 The computing device shown is only an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present disclosure.
[0088] like Figure 3As shown, the computing device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory ROM 302 or a program loaded from a storage device 308 to a random access memory RAM 303. Various programs and data required for the operation of the computing device 300 are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output I / O interface 305 is also connected to the bus 304.
[0089] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a camera, a microphone, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the computing device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The computing device 300 is shown with various devices, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.
[0090] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0091] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable storage medium, a computer-readable signal medium, or any combination of the above two.
[0092] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0093] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0094] In some embodiments, the client and server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks (“LANs”). N ”), Wide Area Network (“WA N ”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), and any network now known or developed in the future.
[0095] The computer-readable medium may be included in the computing device, or may exist independently without being incorporated into the computing device.
[0096] Computer program code for performing operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the tester's computer, partially on the tester's computer, as a separate software package, partially on the tester's computer and partially on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the tester's computer through any type of network, including a local area network (LAN). N ) or Wide Area Network (WA N )—connects to the tester computer, or, can connect to an external computer (e.g., via the Internet using an Internet service provider).
[0097] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system based on hardware that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0098] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the unit does not limit the unit itself in some cases. The functions described above in this article may be at least partially performed by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), and hardware logic components such as CPUs, CPUs, and other hardware components. I C), application-specific standard products (ASSP), system on chip (SOC), complex programmable logic devices (CPLD), etc.
[0099] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for determining a water quality line range, characterized in that: include: Use each cluster number to perform cluster analysis on the water quality monitoring data of the existing monitoring points, and determine the cluster set of water quality monitoring data under each cluster number; The corresponding clustering errors and values are calculated based on the clustering sets under each clustering number, and the number of elbow clusters is determined based on the clustering errors and values corresponding to each clustering number; A selected number of clusters is selected from the number of clusters greater than the number of elbow clusters, and the upper and lower limits of the cluster clusters including the water quality assessment index in the cluster set corresponding to the selected number of clusters are used as the upper and lower limits of the water quality line range.
2. The determination method according to claim 1, characterized in that: Selecting a selected number of clusters among the number of clusters greater than the number of clusters in the elbow includes: S1: Determine the number of i-th clusters and the number of i+1-th clusters after the number of elbow clusters, where the initial value of i is 0; S2: Calculate the reduction ratio of the clustering error and value corresponding to the i-th cluster number and the i+1-th cluster number, and determine whether the reduction ratio is less than the preset reduction ratio; if so, execute S3; if not, execute S4; S3: taking the i+1th number of clusters as the selected number of clusters; S4: Set i=i+1 and execute S1.
3. The determination method according to claim 1, characterized in that: Selecting a selected number of clusters among the number of clusters greater than the number of clusters in the elbow includes: S1: Determine the number of i-th clusters and the number of i+1-th clusters after the number of elbow clusters, where the initial value of i is 0; S2: Calculate the difference between the clustering error and the value corresponding to the i-th cluster number and the i+1-th cluster number, and determine whether the difference is less than a set difference threshold; if so, execute S3; if not, execute S4; S3: taking the i+1th number of clusters as the selected number of clusters; S4: Set i=i+1 and execute S1.
4. The determination method according to claim 2 or 3, characterized in that: The S3 includes: S31: taking the i+1th number of clusters as the number of clusters to be selected, and determining the upper and lower limits of the clusters including the water quality assessment index in the cluster set corresponding to the number of clusters to be selected as the upper and lower limits to be selected; S32: Determine whether the water quality assessment index is within the middle area determined based on the upper and lower limits to be selected, and the upper and lower limits of the middle area are within the upper and lower limits to be selected; if so, execute S33; if not, execute S4; S33: Taking the (i+1)th number of clusters as the selected number of clusters.
5. The determination method according to any one of claims 1 to 3, characterized in that: The clustering errors and values corresponding to the clustering sets under each clustering quantity are calculated respectively, including: For each cluster under a certain number of clusters, calculate the corresponding cluster center respectively; Based on the intra-cluster center of each cluster and the intra-cluster water quality monitoring data, the intra-cluster distance and value are calculated; The clustering error and value are calculated based on the intra-cluster distance and value of each cluster cluster under a certain number of clusters.
6. The determination method according to any one of claims 1 to 3, characterized in that: The step of determining the number of elbow clusters based on the clustering errors and values corresponding to each number of clusters includes: Calculate the first-order difference value of the adjacent cluster number, and calculate the difference value ratio between the adjacent first-order difference value and the adjacent first-order difference value; The first cluster number that makes the difference value ratio smaller than the preset ratio is selected as the elbow cluster number.
7. A method for identifying disturbed water quality monitoring points, characterized in that: include: Obtaining a historical monitoring data sequence of the water quality monitoring point to be identified, and counting the number of on-line monitoring data in the historical monitoring data sequence; The on-line monitoring data is monitoring data located within the water quality on-line range, and the water quality on-line range is determined by the water quality on-line range determination method according to any one of claims 1 to 6; Based on the amount of the on-line monitoring data and the total amount of data in the historical monitoring data sequence, the proportion of the on-line data of the water quality monitoring point to be identified is calculated; Determine whether the proportion of the line-fitting data is greater than an upper threshold of the proportion; When the proportion of the line-fitting data is greater than the upper threshold of the proportion, it is determined that the water quality monitoring point to be identified is a disturbed water quality monitoring point.
8. The identification method according to claim 7, characterized in that: Before determining whether the proportion of the line-fitting data is greater than an upper threshold of the proportion, the method further includes: Based on the historical monitoring data series of all monitoring points, the proportion of line data at each monitoring point is counted respectively; Conduct statistical analysis on the proportion of line-attached data at each monitoring point to determine the mean and mean square error of the proportion; The upper threshold of the proportion is determined based on the mean proportion and the mean square error of the proportion.
9. The identification method according to claim 7, characterized in that: The step of obtaining a historical monitoring data sequence of the water quality monitoring point to be identified and counting the number of on-line monitoring data in the historical monitoring data sequence comprises: obtaining various types of water quality monitoring data of the water quality monitoring point to be identified and counting the number of on-line monitoring data in the various types of water quality monitoring data respectively; Calculating the proportion of in-line data of the water quality monitoring point to be identified, including: calculating the proportion of in-line data of various types of water quality monitoring data at the water quality monitoring point to be identified; The determining whether the proportion of the line-fitting data is greater than a preset upper threshold of the proportion includes: determining whether the proportion of the line-fitting data of various types of water quality monitoring data is greater than the corresponding preset upper threshold of the proportion; In the case where the proportion of the line data is greater than the upper limit threshold of the proportion, the water quality monitoring point to be identified is determined to be a disturbed water quality monitoring point, including: in the case where the proportion of the line data of a water quality monitoring data is greater than the corresponding preset upper limit threshold of the proportion, the water quality monitoring point to be identified is determined to be a disturbed water quality monitoring point.
10. A computing device, characterized in that: It includes a processor and a memory, and the memory is used to store a computer program; when the computer program is loaded by the processor, the processor executes the method for determining the water quality line range as described in any one of claims 1 to 6 or the method for identifying the disturbed water quality monitoring point as described in any one of claims 7 to 9.
Citation Information
Patent Citations
Cluster number determination method, system and device in clustering algorithm and storage medium
CN110443300A
Abnormal data recognition method and system based on clustering analysis, and storage medium
CN110941648A
Data clustering method and device, storage medium and electronic equipment
CN114330584A
Pollution discharge data prediction method, device, equipment and medium
CN114492935A
Power grid user data analysis method based on improved k-means clustering algorithm
CN116894744A