Urban river network water quality detection method and device
By combining the hierarchical analysis method and the improved entropy weight method, the problem of low river water quality detection accuracy in the existing technology is solved, and a more accurate river network water quality evaluation is achieved.
Patent Information
- Application Number
- CN202411197192.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-31
AI Technical Summary
The existing technology has low accuracy in detecting river water quality, which is mainly due to the use of more subjective evaluation methods and ignores objective factors, resulting in inaccurate detection results.
A method of water quality detection in urban river networks is adopted, combined with hierarchical analysis method and improved entropy weight method, by obtaining the water quality data and detection standards of river networks to be detected in the target city, the entropy value of the judgment matrix to be detected and the index is calculated, and the first level and The weight coefficient at the second level, coupled weights to obtain comprehensive weights, is used to more accurately evaluate the water quality of river networks.
The accuracy of river network water quality detection has been improved, taking into account subjective factors and strengthening the evaluation of objective factors, and obtaining more accurate water quality detection results.
Smart Images

Figure CN119230002A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of water quality detection, and in particular to a method and device for detecting water quality in an urban river network. Background Art
[0002] With the continuous development of science and technology, people's environmental awareness is getting stronger and stronger. As an indispensable resource for life, it is very important to detect the quality of water. As one of the main sources of fresh water, the detection of river water quality is of utmost importance. However, the detection of river water quality will be affected by many factors, such as geographical location. The water quality of rivers near icebergs and rivers near deserts must have different evaluation standards. Subjectively, rivers near icebergs have more stringent evaluation standards, but river water quality has objective evaluation standards. Related technologies usually use more subjective evaluation methods for river water quality detection, such as subjective evaluation methods such as subjective weighting method and hierarchical analysis method to detect river network water quality. However, the detection of river network water quality by related technologies is often less accurate. Therefore, how to more accurately detect river network water quality has become a technical problem that technicians in this field need to solve urgently. Summary of the invention
[0003] Based on the above problems, the present application provides a method and device for detecting water quality of urban river networks to solve the problem of low accuracy of water quality detection of urban river networks in the prior art. The method comprises the following steps:
[0004] Obtain the water quality data and testing standards of the river network to be tested corresponding to the target city, wherein the testing standards include the first level and the second level;
[0005] Generate a judgment matrix to be detected based on the water quality data of the river network to be detected, and generate an index entropy value based on the detection standard, wherein the index entropy value is used to represent the degree of confusion of the detection standard, and generate weight coefficients corresponding to the first level and the second level in the detection standard based on the detection standard;
[0006] Determine at least two samples to be tested in the river network water quality data to be tested, and determine at least two testing indicators in the testing standard;
[0007] Obtaining a first weight corresponding to each of the detection indicators in the first level for each of the samples to be detected based on a hierarchical analysis method;
[0008] Obtaining a second weight corresponding to each of the detection indicators of each of the samples to be detected in the second level based on an improved entropy weight method;
[0009] The first weight and the second weight are coupled to obtain a comprehensive weight corresponding to each of the detection indicators in the second level;
[0010] The weight coefficient and the comprehensive weight are used to determine the water quality test result of each of the river network water quality data to be tested under the test standard.
[0011] In a possible implementation, obtaining the first weight corresponding to each detection indicator of each sample to be detected in the first level based on the hierarchical analysis method includes:
[0012] Obtain the Saaty scale corresponding to the water quality test of the urban river network;
[0013] Based on the Saaty scale, two of the detection indicators are taken as a pair, and each pair of detection indicators is compared to obtain a decision matrix through comparison;
[0014] Determining a consistency index of the detection indicator based on each of the detection indicators;
[0015] Get the random consistency index;
[0016] Determining a consistency coefficient based on the consistency index and the random consistency index;
[0017] The first weight is determined based on the consistency coefficient and the decision matrix.
[0018] In a possible implementation, the decision matrix can be calculated by the following formula:
[0019]
[0020] Among them, A represents the decision matrix, a represents a pair of detection indicators, m represents the serial number of the first detection indicator in each pair of detection indicators, and n represents the serial number of the second detection indicator in each pair of detection indicators.
[0021] The consistency index is calculated by the following formula:
[0022]
[0023] Among them, CI represents the consistency index, n represents the serial number of the detection index, and λ represents the consistency index indicator;
[0024] The consistency coefficient is calculated by the following formula:
[0025]
[0026] Among them, CR represents the consistency coefficient, RI represents the random consistency index, and CI represents the consistency index.
[0027] In a possible implementation, the consistency index λ is calculated by the following formula:
[0028] λ=T×W
[0029] Among them, λ represents the consistency index indicator, T represents the normalized result of the normalization operation corresponding to the feature vector of each detection indicator, and W represents the priority ranking result of each detection indicator.
[0030] In a possible implementation, the normalized result of the normalization operation performed on the feature vector of each detection indicator is calculated by the following formula:
[0031]
[0032] Wherein, T represents the normalized result of the normalization operation corresponding to the feature vector of each detection indicator, W represents the priority ranking result of each detection indicator, and p represents the sequence number of the detection indicator;
[0033] The priority ranking result of each detection indicator is calculated by the following formula:
[0034]
[0035] Wherein, W represents the priority ranking result of each detection indicator, p represents the serial number of the detection indicator, n represents the total number of detection indicators, and q represents the serial number of the detection indicator except p among the n detection indicators.
[0036] In a possible implementation, obtaining the second weight corresponding to each detection indicator of each sample to be detected in the second level based on the improved entropy weight method includes:
[0037] Constructing an original information matrix based on the samples to be detected and the detection indexes, wherein the original information matrix includes index values obtained by detecting the target samples to be detected according to each detection index, and the target samples to be detected are any one of the samples to be detected;
[0038] Performing standardization processing on the original information matrix to obtain a standardization processing result;
[0039] Determine the numerical weight of each detection index of the target sample to be detected;
[0040] The second weight is obtained by using the numerical proportion.
[0041] In a possible implementation, the standardized processing result is obtained by the following formula:
[0042]
[0043] Among them, i represents the target sample to be tested, j represents the serial number of the test index, and Y ij represents the standardized processing result of the target sample under the jth detection index, x ij represents the value of the target sample to be detected in the original information matrix under the jth detection index, x i Indicates the value corresponding to the target sample to be detected;
[0044] The numerical weight is obtained by the following formula:
[0045]
[0046] Among them, P ij Indicates the numerical weight of the target sample to be detected under the jth detection index, Y ij Indicates the standardized processing result of the target sample to be tested under the jth detection index;
[0047] The obtaining the second weight by using the numerical proportion comprises:
[0048] The information entropy corresponding to each detection index is obtained by using the numerical proportion, and the information entropy is obtained by the following formula:
[0049]
[0050] Among them, E j represents the information entropy corresponding to the jth detection index, P ij Indicates the numerical proportion of the target sample to be tested under the jth detection index;
[0051] The second weight is obtained by using the information entropy, and the second weight is obtained by the following formula:
[0052]
[0053] Among them, w 1j represents the second weight, E j Represents the information entropy corresponding to the j-th detection indicator.
[0054] In a possible implementation, the method further includes:
[0055] Optimizing the second weight based on the information entropy to obtain an optimized second weight;
[0056] Using the optimized second weight as the second weight to perform the step of coupling the first weight and the second weight;
[0057] The optimized second weight is obtained by the following formula:
[0058]
[0059] Among them, w j represents the second weight after optimization, w 1j represents the second weight, w 2j Indicates the weight of participating in optimization, E j Represents the information entropy corresponding to the jth detection index;
[0060] The participation optimization weight is obtained by the following formula:
[0061]
[0062] Among them, w 2j Indicates the weight of participating in optimization, E j Represents the information entropy corresponding to the j-th detection indicator.
[0063] In a possible implementation, the method further includes:
[0064] The original matrix is normalized to obtain a normalized result, and the normalized result is obtained by the following formula:
[0065]
[0066] Among them, b ij represents the normalized result, x ij Represents the value of the target sample to be detected in the original information matrix under the jth detection index;
[0067] A weighting matrix is obtained based on the normalization processing result and the comprehensive weight, and the weighting matrix is obtained in the following manner:
[0068] v ij =b ij *w j
[0069] Among them, v ij represents the weighting matrix, b ij represents the normalized result, w j represents the comprehensive weight;
[0070] Based on the weighted matrix, the positive detection ideal and the negative detection ideal of each detection index are obtained, and the positive detection ideal is calculated by the following formula:
[0071]
[0072] in, Indicates positive detection ideal, v i1It represents the weighted value of the target sample to be detected under the first detection index, and n represents the total number of detection indicators;
[0073] The negative detection ideal is calculated by the following formula:
[0074]
[0075] in, Indicates ideal negative detection, v i1 It represents the weighted value of the target sample to be detected under the first detection index, and n represents the total number of detection indicators;
[0076] The positive Euclidean distance between each detection index and the positive detection ideal is determined respectively, and the negative Euclidean distance between each detection index and the negative detection ideal is determined respectively, wherein the positive Euclidean distance is calculated by the following formula:
[0077]
[0078] in, Represents the positive Euclidean distance of the target sample to be detected, v ij represents the weighting matrix, It indicates that the positive detection is ideal;
[0079] The negative Euclidean distance is calculated by the following formula:
[0080]
[0081] in, Indicates the negative Euclidean distance of the target sample to be detected, v ij represents the weighting matrix, indicates that negative detection is ideal;
[0082] The ranking of the water quality test results corresponding to the target sample to be tested among all the water quality test results is determined based on the positive Euclidean distance and the negative Euclidean distance.
[0083] The present application also provides an electronic device, the electronic device comprising a processor and a memory:
[0084] The memory is used to store a computer program and transmit the computer program to the processor;
[0085] The processor is used to execute the steps of the above-mentioned urban river network water quality detection method according to the instructions in the computer program.
[0086] The present application also provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program, and when the computer program is executed by an electronic device, the steps of the above-mentioned urban river network water quality detection method are implemented.
[0087] Compared with the prior art, this application has the following beneficial effects:
[0088] The method provided in this application first obtains the river network water quality data and detection standards to be detected corresponding to the target city. The detection standards include the first level and the second level. The river network water quality can be detected more accurately through different levels. Then, a judgment matrix to be detected is generated based on the river network water quality data to be detected. The judgment matrix to be detected can more objectively represent the river network water quality data to be detected. The index entropy value is generated based on the detection standard. The index entropy value is used to represent the degree of confusion of the detection standard. The detection of water quality through the index entropy value is more accurate. Based on the detection standard, the weight coefficients corresponding to the first level and the second level in the detection standard are generated. The weights of the first level and the second level are adjusted by the weight coefficient, and the river network water quality can be evaluated more subjectively. Then, based on the hierarchical analysis method, the first weight corresponding to each of the detection indicators in the first level of each sample to be detected is obtained. The first weight is a subjective weight, which can evaluate the river network water quality more subjectively. Based on the improved entropy weight method, the second weight corresponding to each of the detection indicators in the second level of each sample to be detected is obtained. The second weight is an objective weight, which can evaluate the river network water quality more objectively. The first weight and the second weight are coupled to obtain a comprehensive weight corresponding to each of the detection indicators in the second level. The comprehensive weight is coupled by the first weight and the second weight, and is neither too subjective nor too objective. By using the weight coefficient and the comprehensive weight, the water quality test results of each river network water quality data to be tested under the test standard are more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0090] Figure 1 A flow chart of a method for detecting water quality in an urban river network provided in an embodiment of the present application;
[0091] Figure 2 A schematic diagram of the structure of a water quality detection device for an urban river network provided in an embodiment of the present application. DETAILED DESCRIPTION
[0092] As described above, the detection of river water quality will be affected by many factors, such as geographical location or weather factors. The water quality of rivers near icebergs and rivers near deserts must have different evaluation standards. Subjectively, rivers near icebergs have more stringent evaluation standards, but river water quality has objective evaluation standards.
[0093] After research, it was found that relevant technologies usually use more subjective evaluation methods for river water quality detection. For example, subjective evaluation methods such as subjective weighting method and hierarchical analysis method are used to detect river network water quality. Only subjective evaluation methods are considered and objective factors are ignored, which ultimately leads to low accuracy in river water quality detection. Therefore, the present application provides a method for detecting water quality of an urban river network, which comprehensively considers subjective and objective factors and can accurately detect water quality of an urban river network.
[0094] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. 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 creative work are within the scope of protection of this application.
[0095] It is understandable that the method provided in the present application can be applied to a processing device, which is a processing device that can obtain the water quality data of the river network to be tested corresponding to the target city, for example, a terminal device or a server that can obtain the water quality data of the river network to be tested corresponding to the target city. The method provided in the present application can be executed independently by a terminal device or a server, and can also be applied to a network scenario in which a terminal device and a server communicate, and is executed by the cooperation of a terminal device and a server. Among them, the terminal device can be a computer, a mobile phone and other devices. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent server or a cluster server.
[0096] Figure 1 A flow chart of a method for detecting water quality in an urban river network provided in this application, the method comprising the following steps:
[0097] S101: Obtain the water quality data and testing standards of the river network to be tested corresponding to the target city.
[0098] The processing equipment obtains the river network water quality data and testing standards to be tested corresponding to the target city. The target city may be a city that needs to test the river network water quality. The testing standards include the first level and the second level. The first level may be the criterion layer, which may be various criteria for evaluating the river network water quality, such as the sediment content criteria corresponding to rivers in different geographical locations, the metal content criteria for the same river in different seasons, etc. The second level may be the indicator layer, which may be various indicators for evaluating the river network water quality, such as water temperature, pH value, and various metal contents.
[0099] S102: Generate a judgment matrix to be tested based on the water quality data of the river network to be tested, generate an index entropy value based on the testing standard, and generate weight coefficients corresponding to the first level and the second level in the testing standard based on the testing standard.
[0100] The processing device can generate a judgment matrix to be detected based on the water quality data of the river network to be detected. The processing device can generate the judgment matrix to be detected in various ways, such as generating a model through the judgment matrix to be detected.
[0101] The processing device can also generate an index entropy value based on the detection standard, and the index entropy value can indicate the degree of confusion of the detection standard.
[0102] The processing equipment can also generate weight coefficients corresponding to the first level and the second level in the detection standard based on the detection standard. In one possible implementation method, the weight coefficient can be set manually. In another possible implementation method, the weight coefficient can be obtained by analyzing historical water quality data of the river network to be detected.
[0103] S103: Determine at least two samples to be tested in the water quality data of the river network to be tested, and determine at least two test indicators in the test standard.
[0104] At least two samples to be tested are determined by the processing equipment in the water quality data of the river network to be tested, and at least two testing indicators are determined by the processing equipment in the testing standards.
[0105] S104: Obtaining a first weight corresponding to each detection indicator of each sample to be detected in the first level based on a hierarchical analysis method.
[0106] The analytic hierarchy process (AHP) is a systematic and hierarchical analysis method that combines qualitative and quantitative methods. The AHP can obtain accurate results in a logical manner in the presence of uncertainty and subjective information. The processing device can obtain the first weight corresponding to each detection indicator in the first level of each sample to be detected based on the AHP.
[0107] Specifically, the processing device can first obtain the Saaty scale corresponding to the urban river network water quality detection. The Saaty scale is a scale used in the hierarchical analysis method. In order to be more suitable for the urban river network water quality detection, the Saaty scale corresponding to the urban river network water quality detection is selected. After that, the processing device can use the Saaty scale as a pair of two detection indicators, and compare each pair of detection indicators to obtain a decision matrix through comparison. Since the processing device determines at least two detection indicators, the solid detection indicators can definitely be paired.
[0108] In a possible implementation, the decision matrix can be obtained by the following formula:
[0109]
[0110] Among them, A represents the decision matrix, a represents a pair of detection indicators, m represents the serial number of the first detection indicator in each pair of detection indicators, and n represents the serial number of the second detection indicator in each pair of detection indicators.
[0111] For example, the processing device determines 10 detection indicators, and the serial numbers of these ten detection indicators are 1-10. Each detection indicator is paired with ten detection indicators including itself. The pairing of the first detection indicator and the first detection indicator is represented as a in the decision matrix. 11 , the pairing corresponding to the fifth detection index and the eighth detection index is represented as a in the decision matrix 58 .
[0112] Thereafter, the processing device may determine a consistency index of each detection indicator based on the detection indicator.
[0113] In a possible implementation, the consistency index can be calculated by the following formula:
[0114]
[0115] Among them, CI represents the consistency index, n represents the serial number of the detection index, and λ represents the consistency index indicator.
[0116] In a possible implementation, the consistency index λ can be calculated by the following formula:
[0117] λ=T×W
[0118] Among them, λ represents the consistency index indicator, T represents the normalized result of the normalization operation corresponding to the feature vector of each detection indicator, and W represents the priority ranking result of each detection indicator.
[0119] In a possible implementation, the normalized result of the normalization operation performed on the feature vector of each detection indicator can be calculated by the following formula:
[0120]
[0121] Wherein, T represents the normalized result of the normalization operation corresponding to the feature vector of each detection indicator, W represents the priority sorting result of each detection indicator, and p represents the sequence number of the detection indicator.
[0122] In a possible implementation, the priority ranking result of each detection indicator can be calculated by the following formula:
[0123]
[0124] Wherein, W represents the priority ranking result of each detection indicator, p represents the serial number of the detection indicator, n represents the total number of detection indicators, and q represents the serial number of the detection indicator except p among the n detection indicators.
[0125] After obtaining the random consistency index, the processing device may determine a consistency coefficient based on the consistency index and the random consistency index.
[0126] In a possible implementation, the consistency coefficient can be calculated by the following formula:
[0127]
[0128] Among them, CR represents the consistency coefficient, RI represents the random consistency index, and CI represents the consistency index.
[0129] RI represents the random consistency index. In one possible implementation, RI can be determined by sampling tests. For example, the processing equipment can conduct 500 sampling tests on the water quality of the river network under different numbers of detection indicators, and take the average value of the consistency index of the sampling tests as the random consistency index. The number of detection indicators can be represented by n. The following are the results of the random consistency index obtained by sampling tests on a river network in a city. When n is 2, RI is 1; when n is 3, RI is 0.52; when n is 4, RI is 0.89; when n is 5, RI is 1.12; when n is 6, RI is 1.26; when n is 7, RI is 1.36; when n is 8, RI is 1.46; when n is 9, RI is 1.46; when n is 10, RI is 1.49; when n is 11, RI is 1.52; when n is 12, RI is 1.54.
[0130] When testing the water quality of the river network, CR can be used for verification. In one possible implementation, the maximum CR allowed during testing is 10%. If CR < 0.1, it indicates that the matrix passes the consistency test. If CR > 0.1, decision makers must re-evaluate the indicator.
[0131] Finally, the processing device may determine a first weight based on the consistency coefficient and the decision matrix.
[0132] S105: Obtaining a second weight corresponding to each detection index of each sample to be detected in the second level based on the improved entropy weight method.
[0133] Improved Entropy Weight (IEWM) is an objective weighting method that determines the weight of an indicator based on the impact of the relative change of the indicator on the overall system by calculating the information entropy of the indicator. Indicators with a large relative change have a larger weight. The processing device can obtain the second weight corresponding to each detection indicator in the second level for each sample to be detected based on the improved entropy weight method.
[0134] Specifically, the processing device can construct an original information matrix based on the samples to be detected and the detection indicators. The original information matrix includes the indicator values obtained by detecting the target samples to be detected according to each detection indicator. The target sample to be detected is any one of the samples to be detected.
[0135] Afterwards, the processing device may perform normalization processing on the original information matrix to obtain a normalization processing result. In a possible implementation, the normalization processing result may be obtained by the following formula:
[0136]
[0137] Among them, i represents the target sample to be tested, j represents the serial number of the test index, and Y ij represents the standardized processing result of the target sample under the jth detection index, x ij represents the value of the target sample to be detected in the original information matrix under the jth detection index, x i Indicates the value corresponding to the target sample to be detected.
[0138] After obtaining the standardized processing result, the processing device can determine the numerical weight of the target sample to be detected corresponding to each detection index. In a possible implementation, the numerical weight can be obtained by the following formula:
[0139]
[0140] Among them, P ij Indicates the numerical weight of the target sample to be detected under the jth detection index, Yij It represents the standardized processing result of the target sample to be detected under the jth detection index.
[0141] Finally, the processing device may obtain the second weight using the numerical weight. In a possible implementation, the processing device may first obtain the information entropy corresponding to each detection indicator using the numerical weight. The information entropy may be obtained by the following formula:
[0142]
[0143] Among them, E j represents the information entropy corresponding to the jth detection index, P ij It indicates the numerical proportion of the target sample to be detected under the jth detection index.
[0144] After the processing device obtains the information entropy, the second weight is obtained by using the information entropy. The second weight can be obtained by the following formula:
[0145]
[0146] Among them, w 1j represents the second weight, E j Represents the information entropy corresponding to the j-th detection indicator.
[0147] When the information entropy value approaches 1, a small change in the entropy value may cause a large difference in the weight. Therefore, the second weight can be optimized. In a possible implementation, the processing device can optimize the second weight based on the information entropy to obtain the optimized second weight.
[0148] The optimized second weight can be obtained by the following formula:
[0149]
[0150] Among them, w j represents the second weight after optimization, w 1j represents the second weight, w 2j Indicates the weight of participating in optimization, E j Represents the information entropy corresponding to the j-th detection indicator.
[0151] The weight of participating in optimization can be obtained by the following formula:
[0152]
[0153] Among them, w 2j Indicates the weight of participating in optimization, E j Represents the information entropy corresponding to the j-th detection indicator.
[0154] S106: The first weight and the second weight are coupled to obtain a comprehensive weight corresponding to each detection indicator in the second level.
[0155] The processing device couples the first weight and the second weight to obtain a comprehensive weight corresponding to each detection indicator in the second level.
[0156] S107: Determine the water quality test result of each river network water quality data to be tested under the test standard by using the weight coefficient and the comprehensive weight.
[0157] The processing equipment uses the weight coefficient and the comprehensive weight to determine the water quality test result of each river network water quality data to be tested under the test standard.
[0158] After obtaining the water quality test results, in order to make it easier for testers to view, the test results can be sorted. In a possible implementation, the processing device can normalize the original matrix to obtain a normalized result. The normalized result is obtained by the following formula:
[0159]
[0160] Among them, b jj represents the normalized result, x ij Represents the value of the target sample to be detected in the original information matrix under the jth detection index.
[0161] The weighting matrix is obtained based on the normalization processing result and the comprehensive weight. The weighting matrix is obtained in the following way:
[0162] v ij =b ij *w j
[0163] Among them, v ij represents the weighting matrix, b ij represents the normalized result, w j Represents the comprehensive weight.
[0164] Based on the weighted matrix, the positive detection ideal and negative detection ideal of each detection indicator are obtained. The positive detection ideal is calculated by the following formula:
[0165]
[0166] in, Indicates positive detection ideal, v i1 It represents the weighted value of the target sample to be detected under the first detection index, and n represents the total number of detection indicators.
[0167] The negative detection ideal is calculated by the following formula:
[0168]
[0169] in, Indicates ideal negative detection, v i1 It represents the weighted value of the target sample to be detected under the first detection index, and n represents the total number of detection indicators.
[0170] The positive Euclidean distance between each detection indicator and the positive detection ideal is determined separately, and the negative Euclidean distance between each detection indicator and the negative detection ideal is determined separately. The positive Euclidean distance is calculated by the following formula:
[0171]
[0172] in, Represents the positive Euclidean distance of the target sample to be detected, v ij represents the weighting matrix, Indicates that the detection is ideal.
[0173] Negative Euclidean distance is calculated by the following formula:
[0174]
[0175] in, Indicates the negative Euclidean distance of the target sample to be detected, v ij represents the weighting matrix, Indicates that negative detection is ideal.
[0176] The ranking of the water quality test results corresponding to the target sample to be tested among all water quality test results is determined based on the positive Euclidean distance and the negative Euclidean distance.
[0177] The method provided in this application first obtains the river network water quality data and detection standards to be detected corresponding to the target city. The detection standards include the first level and the second level. The river network water quality can be detected more accurately through different levels. Then, a judgment matrix to be detected is generated based on the river network water quality data to be detected. The judgment matrix to be detected can more objectively represent the river network water quality data to be detected. The index entropy value is generated based on the detection standard. The index entropy value is used to represent the degree of confusion of the detection standard. The detection of water quality through the index entropy value is more accurate. Based on the detection standard, the weight coefficients corresponding to the first level and the second level in the detection standard are generated. The weights of the first level and the second level are adjusted by the weight coefficient, and the river network water quality can be evaluated more subjectively. Then, based on the hierarchical analysis method, the first weight corresponding to each of the detection indicators in the first level of each sample to be detected is obtained. The first weight is a subjective weight, which can evaluate the river network water quality more subjectively. Based on the improved entropy weight method, the second weight corresponding to each of the detection indicators in the second level of each sample to be detected is obtained. The second weight is an objective weight, which can evaluate the river network water quality more objectively. The first weight and the second weight are coupled to obtain a comprehensive weight corresponding to each of the detection indicators in the second level. The comprehensive weight is coupled by the first weight and the second weight, and is neither too subjective nor too objective. By using the weight coefficient and the comprehensive weight, the water quality test results of each river network water quality data to be tested under the test standard are more accurate.
[0178] The present application also provides a Figure 2 The schematic diagram of the structure of the device for detecting water quality of urban river network shown in FIG. 200 includes the following modules:
[0179] An acquisition module 201 is used to acquire the water quality data and the detection standard of the river network to be detected corresponding to the target city, wherein the detection standard includes the first level and the second level;
[0180] A generating module 202 is used to generate a judgment matrix to be detected based on the water quality data of the river network to be detected, and to generate an index entropy value based on the detection standard, wherein the index entropy value is used to represent the degree of confusion of the detection standard, and to generate weight coefficients corresponding to the first level and the second level in the detection standard respectively based on the detection standard;
[0181] A determination module 203 is used to determine at least two samples to be detected in the river network water quality data to be detected, and to determine at least two detection indicators in the detection standard;
[0182] A first weight module 204, configured to obtain a first weight corresponding to each of the detection indicators of each of the samples to be detected in the first level based on a hierarchical analysis method;
[0183] A second weight module 205, configured to obtain a second weight corresponding to each of the detection indicators of each of the samples to be detected in the second level based on an improved entropy weight method;
[0184] A coupling module 206, configured to couple the first weight and the second weight to obtain a comprehensive weight corresponding to each of the detection indicators in the second level;
[0185] The detection module 207 is used to determine the water quality detection result of each of the river network water quality data to be detected under the detection standard by using the weight coefficient and the comprehensive weight.
[0186] The device provided in the present application first obtains the water quality data and detection standards of the river network to be detected corresponding to the target city. The detection standards include the first level and the second level. The water quality of the river network can be detected more accurately through different levels. Then, a judgment matrix to be detected is generated based on the water quality data of the river network to be detected. The judgment matrix to be detected can more objectively represent the water quality data of the river network to be detected. The index entropy value is generated based on the detection standard. The index entropy value is used to represent the degree of confusion of the detection standard. The detection of water quality through the index entropy value is more accurate. Based on the detection standard, the weight coefficients corresponding to the first level and the second level in the detection standard are generated. The weights of the first level and the second level are adjusted by the weight coefficient, and the water quality of the river network can be evaluated more subjectively. Then, based on the hierarchical analysis method, the first weight corresponding to each of the detection indicators in the first level of each sample to be detected is obtained. The first weight is a subjective weight, which can evaluate the water quality of the river network more subjectively. Based on the improved entropy weight method, the second weight corresponding to each of the detection indicators in the second level of each sample to be detected is obtained. The second weight is an objective weight, which can evaluate the water quality of the river network more objectively. The first weight and the second weight are coupled to obtain a comprehensive weight corresponding to each of the detection indicators in the second level. The comprehensive weight is coupled by the first weight and the second weight, and is neither too subjective nor too objective. By using the weight coefficient and the comprehensive weight, the water quality test results of each river network water quality data to be tested under the test standard are more accurate.
[0187] An embodiment of the present application also provides an urban river network water quality detection device, wherein the device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device performs the steps of the urban river network water quality detection method described in any embodiment of the present application.
[0188] In practical applications, the computer-readable storage medium may be any combination of one or more computer-readable media, which may be a computer-readable signal medium or a computer-readable storage medium.
[0189] 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 (a non-exhaustive list) include: 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 embodiment, the 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.
[0190] 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.
[0191] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0192] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including 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 user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0193] It should be noted that each embodiment in this specification 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. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0194] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for detecting water quality of an urban river network, characterized in that: include: Obtain the water quality data and testing standards of the river network to be tested corresponding to the target city, wherein the testing standards include the first level and the second level; Generate a judgment matrix to be detected based on the water quality data of the river network to be detected, and generate an index entropy value based on the detection standard, wherein the index entropy value is used to represent the degree of confusion of the detection standard, and generate weight coefficients corresponding to the first level and the second level in the detection standard based on the detection standard; Determine at least two samples to be tested in the river network water quality data to be tested, and determine at least two testing indicators in the testing standard; Obtaining a first weight corresponding to each of the detection indicators in the first level for each of the samples to be detected based on a hierarchical analysis method; Obtaining a second weight corresponding to each of the detection indicators of each of the samples to be detected in the second level based on an improved entropy weight method; The first weight and the second weight are coupled to obtain a comprehensive weight corresponding to each of the detection indicators in the second level; The weight coefficient and the comprehensive weight are used to determine the water quality test result of each of the river network water quality data to be tested under the test standard.
2. The method according to claim 1, characterized in that The first weight corresponding to each detection index of each sample to be detected in the first level obtained based on the hierarchical analysis method includes: Obtain the Saaty scale corresponding to the water quality test of the urban river network; Based on the Saaty scale, two of the detection indicators are taken as a pair, and each pair of detection indicators is compared to obtain a decision matrix through comparison; Determining a consistency index of the detection indicator based on each of the detection indicators; Get the random consistency index; Determining a consistency coefficient based on the consistency index and the random consistency index; The first weight is determined based on the consistency coefficient and the decision matrix.
3. The method according to claim 2, characterized in that The decision matrix can be calculated by the following formula: Wherein, A represents a decision matrix, a represents a pair of detection indicators, m represents the serial number of the first detection indicator in each pair of detection indicators, and n represents the serial number of the second detection indicator in each pair of detection indicators; The consistency index is calculated by the following formula: Among them, CI represents the consistency index, n represents the serial number of the detection index, and λ represents the consistency index indicator; The consistency coefficient is calculated by the following formula: Among them, CR represents the consistency coefficient, RI represents the random consistency index, and CI represents the consistency index.
4. The method according to claim 3, characterized in that The consistency index λ is calculated by the following formula: λ=T×W Among them, λ represents the consistency index indicator, T represents the normalized result of the normalization operation corresponding to the feature vector of each detection indicator, and W represents the priority ranking result of each detection indicator.
5. The method according to claim 4, characterized in that The normalized result of the normalization operation performed on the characteristic vector of each detection index is calculated by the following formula: Wherein, T represents the normalized result of the normalization operation corresponding to the feature vector of each detection indicator, W represents the priority ranking result of each detection indicator, and p represents the sequence number of the detection indicator; The priority ranking result of each detection indicator is calculated by the following formula: Wherein, W represents the priority ranking result of each detection indicator, p represents the serial number of the detection indicator, n represents the total number of detection indicators, and q represents the serial number of the detection indicator except p among the n detection indicators.
6. The method according to claim 1, characterized in that The second weight corresponding to each detection index of each sample to be detected in the second level obtained based on the improved entropy weight method includes: Constructing an original information matrix based on the samples to be detected and the detection indexes, wherein the original information matrix includes index values obtained by detecting the target samples to be detected according to each detection index, and the target samples to be detected are any one of the samples to be detected; Performing standardization processing on the original information matrix to obtain a standardization processing result; Determine the numerical weight of each detection index of the target sample to be detected; The second weight is obtained by using the numerical proportion.
7. The method according to claim 6, characterized in that The standardized processing result is obtained by the following formula: Among them, i represents the target sample to be tested, j represents the serial number of the test index, and Y ij represents the standardized processing result of the target sample under the jth detection index, x ij represents the value of the target sample to be detected in the original information matrix under the jth detection index, x i Indicates the value corresponding to the target sample to be detected; The numerical weight is obtained by the following formula: Among them, p ij Indicates the numerical weight of the target sample to be detected under the jth detection index, Y ij Indicates the standardized processing result of the target sample to be tested under the jth detection index; The obtaining the second weight by using the numerical proportion comprises: The information entropy corresponding to each detection index is obtained by using the numerical proportion, and the information entropy is obtained by the following formula: Among them, E j represents the information entropy corresponding to the jth detection index, p ij Indicates the numerical proportion of the target sample to be tested under the jth detection index; The second weight is obtained by using the information entropy, and the second weight is obtained by the following formula: Among them, w 1j represents the second weight, E j Represents the information entropy corresponding to the j-th detection indicator.
8. The method according to claim 7, characterized in that The method further comprises: Optimizing the second weight based on the information entropy to obtain an optimized second weight; Using the optimized second weight as the second weight to perform the step of coupling the first weight and the second weight; The optimized second weight is obtained by the following formula: Among them, w j represents the second weight after optimization, w 1j represents the second weight, w 2j Indicates the weight of participating in optimization, E j Represents the information entropy corresponding to the jth detection index; The participation optimization weight is obtained by the following formula: Among them, w 2j Indicates the weight of participating in optimization, E j Represents the information entropy corresponding to the j-th detection indicator.
9. The method according to claim 8, characterized in that The method further comprises: The original matrix is normalized to obtain a normalized result, and the normalized result is obtained by the following formula: Among them, b ij represents the normalized result, x ij Represents the value of the target sample to be detected in the original information matrix under the jth detection index; A weighting matrix is obtained based on the normalization processing result and the comprehensive weight, and the weighting matrix is obtained in the following manner: v ij =b ij *w j Among them, v ij represents the weighting matrix, b ij represents the normalized result, w j represents the comprehensive weight; Based on the weighted matrix, the positive detection ideal and the negative detection ideal of each detection index are obtained, and the positive detection ideal is calculated by the following formula: in, Indicates positive detection ideal, v i1 It represents the weighted value of the target sample to be detected under the first detection index, and n represents the total number of detection indicators; The negative detection ideal is calculated by the following formula: in, Indicates ideal negative detection, v i1 It represents the weighted value of the target sample to be detected under the first detection index, and n represents the total number of detection indicators; The positive Euclidean distance between each detection index and the positive detection ideal is determined respectively, and the negative Euclidean distance between each detection index and the negative detection ideal is determined respectively, wherein the positive Euclidean distance is calculated by the following formula: in, Represents the positive Euclidean distance of the target sample to be detected, v ij represents the weighting matrix, It indicates that the positive detection is ideal; The negative Euclidean distance is calculated by the following formula: in, Indicates the negative Euclidean distance of the target sample to be detected, v ij represents the weighting matrix, indicates that negative detection is ideal; The ranking of the water quality test results corresponding to the target sample to be tested among all the water quality test results is determined based on the positive Euclidean distance and the negative Euclidean distance.
10. A water quality detection device for an urban river network, characterized in that: include: An acquisition module is used to acquire the water quality data and testing standards of the river network to be tested corresponding to the target city, wherein the testing standards include the first level and the second level; A generating module, used for generating a judgment matrix to be detected based on the water quality data of the river network to be detected, and generating an index entropy value based on the detection standard, wherein the index entropy value is used to indicate the degree of confusion of the detection standard, and generating weight coefficients corresponding to the first level and the second level in the detection standard respectively based on the detection standard; A determination module, used to determine at least two samples to be detected in the river network water quality data to be detected, and to determine at least two detection indicators in the detection standard; A first weight module, used for obtaining a first weight corresponding to each detection index of each sample to be detected in the first level based on a hierarchical analysis method; A second weight module, used for obtaining a second weight corresponding to each of the detection indicators of each of the samples to be detected in the second level based on an improved entropy weight method; A coupling module, used for coupling the first weight and the second weight to obtain a comprehensive weight corresponding to each of the detection indicators in the second level; The detection module is used to determine the water quality detection result of each of the river network water quality data to be detected under the detection standard by using the weight coefficient and the comprehensive weight.