Water quality grade evaluation method, device and medium
By screening the average weights of water quality evaluation factors and constructing a related vector machine model, the problem of high complexity of the water quality grade evaluation model was solved and the evaluation efficiency was improved.
Patent Information
- Application Number
- CN202210653644.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-10
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-06-10
AI Technical Summary
The existing water quality grade evaluation model is highly complex and has low evaluation efficiency, making it difficult to effectively reduce it.
By obtaining a set of water quality samples, the average weight of the water quality evaluation factors is determined, the target water quality evaluation factor combination is screened out, and a related vector machine model is constructed to determine the water quality grade.
The complexity of the water quality grade evaluation model is reduced and the evaluation efficiency is improved.
Smart Images

Figure CN114971354B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of water quality grade evaluation, and in particular to a water quality grade evaluation method, device and medium. Background Art
[0002] In today's rapidly developing industrialized world, factories generate large amounts of untreated industrial wastewater daily and discharge it directly into rivers. This has led to a series of problems, including eutrophication, wetland depletion, and a decrease in aquatic life. The aquatic ecosystem is deteriorating, and water pollution control is urgent. Water quality assessment is a major component of water environment quality research. It provides a scientific basis for the rational development and utilization of the water environment and the comprehensive prevention and control of water pollution. It also provides a basis for formulating scientific plans and implementing effective remediation measures, which is of great significance to the protection of water resources.
[0003] In the actual water quality evaluation process, a variety of water quality evaluation factors will be involved. Different water quality evaluation factors have different weights and different degrees of contribution to the water quality evaluation. The current water quality evaluation model evaluates water quality based on a large number of water quality evaluation factors, which has a large workload and low efficiency.
[0004] Therefore, how to reduce the complexity of the water quality grade evaluation model and improve the efficiency of water quality grade evaluation is an urgent problem that technical personnel in this field need to solve. Summary of the Invention
[0005] The purpose of this application is to provide a water quality grade evaluation method, device and medium for reducing the complexity of the water quality grade evaluation model and improving the efficiency of water quality grade evaluation.
[0006] To solve the above technical problems, this application provides a water quality evaluation method, including:
[0007] Obtaining a water quality sample set; wherein the sample set includes the water quality grade to which each sample belongs, and each sample includes water quality parameters corresponding to each water quality evaluation factor;
[0008] Determining an average weight of each of the water quality evaluation factors according to the sample set, and screening out target water quality evaluation factors according to the average weight to determine a target water quality evaluation factor combination;
[0009] According to the target water quality evaluation factor combination, the target water quality parameters corresponding to the target water quality evaluation factors in each sample are screened to obtain a target sample set;
[0010] Determine the mapping relationship between the target water quality parameter and the water quality grade of each target sample in the target sample set, and configure a relevant vector machine based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water quality according to the water quality grade evaluation model.
[0011] Preferably, determining the average weight of each of the water quality evaluation factors according to the sample set includes:
[0012] Step A: randomly selecting a target sample from the sample set, selecting a preset number of samples from the same type of samples to form a first sample set, and selecting the preset number of samples from the different types of samples to form a second sample set; wherein the same type of samples are samples of the same water quality grade as the target sample, and the different types of samples are samples of a different water quality grade than the target sample;
[0013] Step B: Calculating the weight of each water quality evaluation factor using the ReliefF algorithm according to the target sample, the first sample set, the second sample set, and the preset number;
[0014] Repeat step A and step B N times to obtain N weights of each water quality evaluation factor;
[0015] The average value of the weights is calculated based on the N weights to determine the average weight of each of the water quality evaluation factors.
[0016] Preferably, screening out target water quality evaluation factors according to the average weight to determine a target water quality evaluation factor combination includes:
[0017] Set M thresholds;
[0018] Select one threshold value from the M threshold values in sequence as the current threshold value, and form a water quality evaluation factor combination with the water quality evaluation factors whose average weight is greater than the current threshold value;
[0019] After all thresholds are taken, M combinations of water quality evaluation factors are obtained;
[0020] Calculating the CSI index of each of the M water quality evaluation factor combinations according to the sample set to obtain M CSI indices;
[0021] The water quality evaluation factor combination corresponding to the smallest CSI index among the M CSI indices is determined as the target water quality evaluation factor combination.
[0022] Preferably, the calculating the CSI index of each of the M water quality evaluation factor combinations based on the sample set to obtain M CSI indices includes:
[0023] Selecting a water quality evaluation factor combination from the M water quality evaluation factor combinations as the current water quality evaluation factor combination;
[0024] Calculate the intra-class dispersion and inter-class dispersion of the water quality evaluation factors in the current water quality evaluation factor combination according to the sample set;
[0025] The similarity of the two types of water quality grade samples is calculated according to the intra-class dispersion and the inter-class dispersion;
[0026] Obtaining the CSI index of the current water quality evaluation factor combination according to the similarity calculation;
[0027] When all the M water quality evaluation factor combinations are taken, the M CSI indices are obtained.
[0028] Preferably, the calculating, based on the sample set, the intra-class dispersion and inter-class dispersion of the water quality evaluation factors in the current water quality evaluation factor combination comprises:
[0029] The intra-class dispersion is calculated according to a first preset formula, where the first preset formula is:
[0030]
[0031] The inter-class dispersion is calculated according to a second preset formula, which is:
[0032] C ij =||M ci -M cj ||
[0033] Among them, the C ii is the dispersion in the class;
[0034] The C ij is the inter-class dispersion;
[0035] The X ci The sample is of Class Ci water quality level;
[0036] The L is the number of samples of Class ci water quality level;
[0037] The M ci is the mean value of the ci-th water quality evaluation factor sample in the current water quality evaluation factor combination;
[0038] The M cj It is the mean value of the cjth (ci≠cj) water quality evaluation factor sample in the current water quality evaluation factor combination.
[0039] Preferably, the similarity between the two types of water quality grade samples is calculated based on the intra-class discreteness and the inter-class discreteness, including:
[0040] The similarity is calculated according to a third preset formula, which is:
[0041]
[0042] Among them, the S ij is the similarity;
[0043] The C ii is the dispersion in the class;
[0044] The C ij is the inter-class dispersion.
[0045] Preferably, the CSI index of the current water quality evaluation factor combination is obtained by calculating the similarity, including:
[0046] The similarity is calculated according to a fourth preset formula, which is:
[0047]
[0048] Wherein, said l is the number of categories of said water quality grade;
[0049] The S ij is the similarity.
[0050] The present application also provides a water quality evaluation device, comprising:
[0051] An acquisition module is used to acquire a water quality sample set; wherein the sample set includes the water quality grade to which each sample belongs, and each sample includes water quality parameters corresponding to each water quality evaluation factor;
[0052] A first screening module is configured to determine an average weight of each of the water quality evaluation factors according to the sample set, and screen out target water quality evaluation factors according to the average weight to determine a target water quality evaluation factor combination;
[0053] A second screening module is used to screen the target water quality parameters corresponding to the target water quality evaluation factors in each sample according to the target water quality evaluation factor combination to obtain a target sample set;
[0054] A construction module is used to determine the mapping relationship between the target water quality parameter of each target sample in the target sample set and the water quality grade, and configure a relevant vector machine based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water quality according to the water quality grade evaluation model.
[0055] The present application also provides a water quality grade evaluation device, comprising a memory for storing a computer program;
[0056] A processor is used to implement the steps of the water quality grade evaluation method when executing the computer program.
[0057] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the water quality grade evaluation method are implemented.
[0058] The present application provides a water quality grade evaluation method, comprising: obtaining a water quality sample set; determining the average weight of each water quality evaluation factor based on the sample set, and screening target water quality evaluation factors based on the average weight to determine a target water quality evaluation factor combination; screening target water quality parameters corresponding to the target water quality evaluation factors in each sample based on the target water quality evaluation factor combination to obtain a target sample set; determining a mapping relationship between the target water quality parameter and the water quality grade of each target sample in the target sample set, and configuring a related vector machine based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water according to the water quality grade evaluation model. By screening out water quality evaluation factors that contribute greatly to the water quality grade evaluation and constructing a water quality grade evaluation model, the complexity of the water quality evaluation model is reduced and the efficiency of the water quality grade evaluation is improved.
[0059] The beneficial effects of the water quality grade evaluation device and medium provided in this application correspond to the method, and the effects are as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. 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 any creative work.
[0061] Figure 1 A flow chart of a water quality evaluation method provided in an embodiment of the present application;
[0062] Figure 2 A structural diagram of a water quality evaluation device provided in an embodiment of the present application;
[0063] Figure 3 This is a structural diagram of another water quality grade evaluation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0065] The core of this application is to provide a water quality grade evaluation method, device and medium.
[0066] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0067] Figure 1 A flow chart of a water quality evaluation method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown in Figure 2, water quality evaluation methods include:
[0068] S10: Obtain a water quality sample set; wherein the sample set includes the water quality grade to which each sample belongs, and each sample includes water quality parameters corresponding to each water quality evaluation factor.
[0069] S11: Determine the average weight of each water quality evaluation factor based on the sample set, and screen out the target water quality evaluation factor based on the average weight to determine the target water quality evaluation factor combination.
[0070] S12: Filter the target water quality parameters corresponding to the target water quality evaluation factors in each sample according to the target water quality evaluation factor combination to obtain a target sample set.
[0071] S13: Determine the mapping relationship between the target water quality parameters and the water quality grade of each target sample in the target sample set, and configure a relevant vector machine based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water according to the water quality grade evaluation model.
[0072] In step S10, water quality samples can be collected with the help of the National Surface Water Quality Automatic Monitoring Real-time System, and all samples are collectively referred to as a sample set. According to the "Surface Water Environmental Quality Standard" (GB3838-2002) and the National Surface Water Quality Automatic Monitoring Real-time System, surface water quality levels are divided into 6 categories (Class I, Class II, Class III, Class IV, Class V and Class V), of which 8 water quality evaluation factors are selected, namely: pH value, ammonia nitrogen, dissolved oxygen, conductivity, turbidity, permanganate index, total phosphorus and total nitrogen. Each sample includes the 8 water quality evaluation factors and the water quality parameters corresponding to the 8 water quality evaluation factors.
[0073] In step S11, the method for determining the average weight of each water quality evaluation factor based on the sample set is as follows:
[0074] Step A: Randomly select a target sample from the sample set, select a preset number of samples from the same type of samples to form a first sample set, and select a preset number of samples from the different types of samples to form a second sample set; wherein, the same type of samples are samples with the same water quality grade as the target sample, and the different types of samples are samples with a different water quality grade than the target sample; Step B: Calculate the weight of each water quality evaluation factor using the ReliefF algorithm based on the target sample, the first sample set, the second sample set, and the preset number; Repeat steps A and B N times to obtain N weights for each water quality evaluation factor; Calculate the average of the weights based on the N weights to determine the average weight of each water quality evaluation factor. The specific process is as follows:
[0075] (1) The water quality parameters corresponding to each water quality evaluation factor are combined into a sample set, that is: X = [x1, x2, ..., x i ], each sample contains m (m = 8) water quality evaluation factors, namely x i ={f1, f2, ..., f m}, C={c1, c2…, c l} is the water quality grade to which the sample belongs, and there are l (l=6) grades in total.
[0076] (2) Randomly select a sample (target sample) x from X i , sample x i The water quality evaluation factor variable f in j (1≤j≤m), select d distances x from samples of the same category i The most recent samples constitute the first sample set H n , select d distances x in each heterogeneous sample i The most recent samples constitute the second sample set M n (c), c is the water quality grade, 1≤c≤l;
[0077] (3) Calculate the weight w of water quality evaluation factor through ReliefF algorithm i , the initial weight is 0; the calculation formula is as follows:
[0078]
[0079] Among them, w i is the weight of the water quality evaluation factor, and the initial weight is zero;
[0080] f j is the water quality evaluation factor;
[0081] xi is the target sample;
[0082] H n is the first sample set;
[0083] M n (c) is the second sample set, where c is the water quality grade;
[0084] l is the number of water quality grades;
[0085] d is the preset number;
[0086] p(c) is the probability of occurrence of a sample with water quality level c;
[0087] t is the iteration number, that is, the number of calculations.
[0088] (4) Go to step (2) and iterate t (1<t) times.
[0089] (5) Calculate the weight of each water quality evaluation factor. Each water quality evaluation factor corresponds to a weight set.
[0090] (6) The weight set W of each evaluation factor obtained by multiple calculations n , calculate the arithmetic mean The average weight of each evaluation factor is obtained as the final weight of the evaluation factor. The formula is as follows:
[0091]
[0092] Among them, N is the number of calculations, that is, the number of weights corresponding to each water quality evaluation factor. If each water quality evaluation factor is calculated N times, N weights will be obtained.
[0093] In step S11, the target water quality evaluation factors are screened out according to the average weights to determine a target water quality evaluation factor combination. The method is as follows:
[0094] Set M thresholds; take one threshold from the M thresholds in turn as the current threshold, and form a water quality evaluation factor combination with the water quality evaluation factors whose average weight is greater than the current threshold; after all thresholds are taken, M water quality evaluation factor combinations are obtained; calculate the CSI index of each water quality evaluation factor combination in the M water quality evaluation factor combinations according to the sample set to obtain M CSI indices; determine the water quality evaluation factor combination corresponding to the smallest CSI index among the M CSI indices as the target water quality evaluation factor combination.
[0095] Water quality evaluation factors with an average weight below the threshold are considered invalid and discarded, completing the screening of evaluation factors. By setting multiple (M) thresholds, M water quality evaluation factor combinations are obtained. The Clustering Separation Index (CSI) of each of the M water quality evaluation factor combinations is calculated. The water quality evaluation factor combination with the lowest CSI is selected as the optimal combination, completing the screening of the optimal water quality evaluation factor combination and determining the target water quality evaluation factor combination.
[0096] The process of determining the target water quality evaluation factor combination is as follows:
[0097] (1) Select one water quality evaluation factor combination from the M water quality evaluation factor combinations as the current water quality evaluation factor combination.
[0098] (2) Calculate the intra-class dispersion and inter-class dispersion of the water quality evaluation factors in the current water quality evaluation factor combination based on the sample set. The specific formula is as follows:
[0099]
[0100] C ij =||M ci -M ij ||
[0101] Among them, C ii is the dispersion within the class;
[0102] C ij is the inter-class dispersion;
[0103] X ci The sample is of Class Ci water quality level;
[0104] L is the number of samples of water quality level ci;
[0105] M ci is the mean value of the ci-th water quality evaluation factor sample in the current water quality evaluation factor combination;
[0106] M cj It is the mean value of the cjth (ci≠cj) water quality evaluation factor sample in the current water quality evaluation factor combination.
[0107] (3) The similarity of the two water quality grade samples is calculated based on the intra-class dispersion and inter-class dispersion. When S ij The smaller the value, the stronger the separability of the two types of samples. The formula is as follows:
[0108]
[0109] Among them, S ijis the similarity;
[0110] C ii is the dispersion within the class;
[0111] C ij is the inter-class dispersion.
[0112] (4) The CSI index of the current water quality evaluation factor combination is calculated based on the similarity, and the CSI index is quantified to determine the overall separability of all l-class water quality grade samples. The CSI index uses the mean of the most difficult-to-distinguish inter-class similarity between each two water quality samples as the separability of the entire sample. The smaller the CSI value, the better the overall separability of the sample. The formula is as follows:
[0113]
[0114] Where l is the number of water quality levels;
[0115] S ij For similarity.
[0116] (5) When all M water quality evaluation factor combinations are taken, M CSI indices are obtained. The water quality evaluation factor combination corresponding to the smallest CSI index among the M CSI indices is determined as the target water quality evaluation factor combination, completing the screening of the optimal evaluation factor combination.
[0117] In step S12, the target water quality parameters corresponding to the target water quality evaluation factors in each sample are screened based on the target water quality evaluation factor combination to obtain a target sample set. In the above steps, there are originally eight water quality evaluation factors. After screening the water quality evaluation factors, some water quality evaluation factors that contribute little to the water quality grade evaluation are discarded. The number of target water quality evaluation factors in the target water quality evaluation factor combination is less than eight, and can be five or three, etc. The target water quality parameters corresponding to the target water quality evaluation factors in each sample are then screened to obtain a target sample set. Each sample in the target sample set only contains the target water quality parameters of the target water quality evaluation factors, and the water quality grade of each sample in the target sample set remains unchanged.
[0118] In step S13, the mapping relationship between the target water quality parameter and the water quality grade of each target sample in the target sample set is determined, and a relevant vector machine is configured based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water according to the water quality grade evaluation model.
[0119] Compared with the support vector machine, the relevance vector machine (RVM) has the characteristics of sparse correlation vectors, short training time, and flexible kernel function selection. This application uses RVM to construct a water quality grade evaluation model.
[0120] After the water quality evaluation component screening is completed, the corresponding water quality data sequence is Where n is the sequence length, X i =[x1, x2, ..., x i ] represents the target sample set, y represents the category label of the water quality grade of each sample in the target sample set, and the mapping relationship of the water quality grade evaluation model is established based on the conventional RVM. The formula is as follows:
[0121] y=F(X i ), i=1, 2, …, n
[0122] Therefore, when constructing target sample sets of different levels of water quality parameters Then, the mapping capability of the RVM model is used to make the input and output models of the RVM approximate y = F(X i ), i = 1, 2, …, n, thereby establishing an RVM water quality grade evaluation model. Based on this, subsequent water quality grade evaluation of actual water quality data can be performed by selecting water quality parameters corresponding to the target water quality evaluation factors in the target water quality evaluation factor combination in the water quality data and inputting them into the trained RVM water quality grade evaluation model. The RVM water quality grade evaluation model can then be used to complete the grade evaluation of subsequent water quality data.
[0123] The present application provides a water quality grade evaluation method, comprising: obtaining a water quality sample set; wherein the sample set includes the water quality grade to which each sample belongs, and each sample includes water quality parameters corresponding to each water quality evaluation factor; determining the average weight of each water quality evaluation factor based on the sample set, and screening target water quality evaluation factors based on the average weight to determine a target water quality evaluation factor combination; screening target water quality parameters corresponding to the target water quality evaluation factors in each sample based on the target water quality evaluation factor combination to obtain a target sample set; determining a mapping relationship between the target water quality parameters and the water quality grade of each target sample in the target sample set, and configuring a related vector machine based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water according to the water quality grade evaluation model. By screening out water quality evaluation factors that contribute greatly to the water quality grade evaluation to construct a water quality grade evaluation model, the complexity of the water quality evaluation model is reduced and the efficiency of the water quality grade evaluation is improved.
[0124] In the above embodiments, the water quality evaluation method is described in detail. This application also provides corresponding embodiments of a water quality evaluation device. It should be noted that this application describes the embodiments of the device from two perspectives: one is based on the functional module perspective, and the other is based on the hardware perspective.
[0125] Figure 2 This is a structural diagram of a water quality evaluation device provided in an embodiment of the present application, such as Figure 2As shown, the water quality evaluation device includes:
[0126] The acquisition module 10 is used to obtain a water quality sample set; wherein the sample set includes the water quality grade to which each sample belongs, and each sample includes water quality parameters corresponding to each water quality evaluation factor;
[0127] The first screening module 11 is used to determine the average weight of each water quality evaluation factor based on the sample set, and screen the target water quality evaluation factor based on the average weight to determine the target water quality evaluation factor combination;
[0128] The second screening module 12 is used to screen the target water quality parameters corresponding to the target water quality evaluation factors in each sample according to the target water quality evaluation factor combination to obtain a target sample set;
[0129] Construction module 13 is used to determine the mapping relationship between the target water quality parameters of each target sample in the target sample set and the water quality grade, and configure the relevant vector machine based on the mapping relationship to construct a water quality grade evaluation model so as to determine the water quality grade of the water according to the water quality grade evaluation model.
[0130] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, and they will not be repeated here.
[0131] The present application provides a water quality grade evaluation device, which obtains a water quality sample set; determines the average weight of each water quality evaluation factor based on the sample set, and screens out target water quality evaluation factors based on the average weight to determine a target water quality evaluation factor combination; screens the target water quality parameters corresponding to the target water quality evaluation factors in each sample based on the target water quality evaluation factor combination to obtain a target sample set; determines the mapping relationship between the target water quality parameter and the water quality grade of each target sample in the target sample set, and configures a related vector machine based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water according to the water quality grade evaluation model. By screening out water quality evaluation factors that contribute greatly to the water quality grade evaluation and constructing a water quality grade evaluation model, the complexity of the water quality evaluation model is reduced and the efficiency of the water quality grade evaluation is improved.
[0132] Figure 3 This is a structural diagram of another water quality evaluation device provided in an embodiment of the present application, such as Figure 3 As shown, the water quality grade evaluation device includes: a memory 20 for storing a computer program;
[0133] The processor 21 is configured to implement the steps of the water quality evaluation method of the above embodiment when executing a computer program.
[0134] The water quality evaluation device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0135] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0136] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the water quality grade evaluation method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to a sample set, etc.
[0137] In some embodiments, the water quality evaluation device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0138] Those skilled in the art will understand that Figure 3 The structure shown in does not constitute a limitation on the water quality level evaluation device, and may include more or fewer components than shown in the figure.
[0139] The water quality evaluation device provided in an embodiment of the present application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: obtain a water quality sample set; wherein the sample set includes the water quality grade to which each sample belongs, and each sample includes water quality parameters corresponding to each water quality evaluation factor; determine the average weight of each water quality evaluation factor based on the sample set, and screen out the target water quality evaluation factor based on the average weight to determine a target water quality evaluation factor combination; screen the target water quality parameters corresponding to the target water quality evaluation factor in each sample based on the target water quality evaluation factor combination to obtain a target sample set; determine the mapping relationship between the target water quality parameter and the water quality grade of each target sample in the target sample set, and configure a relevant vector machine based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water according to the water quality grade evaluation model.
[0140] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the water quality grade evaluation method of the above method embodiment.
[0141] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0142] The above is a detailed introduction to a water quality grade evaluation method, device and medium provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
[0143] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only 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. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
Claims
1. A water quality evaluation method, characterized in that: include: Obtaining a water quality sample set; wherein the sample set includes the water quality grade to which each sample belongs, and each sample includes water quality parameters corresponding to each water quality evaluation factor; Determining an average weight of each of the water quality evaluation factors according to the sample set, and screening out target water quality evaluation factors according to the average weight to determine a target water quality evaluation factor combination; According to the target water quality evaluation factor combination, the target water quality parameters corresponding to the target water quality evaluation factors in each sample are screened to obtain a target sample set; determining a mapping relationship between the target water quality parameter and the water quality grade of each target sample in the target sample set, configuring a relevance vector machine based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water according to the water quality grade evaluation model; The step of screening out target water quality evaluation factors according to the average weight to determine a target water quality evaluation factor combination includes: Set M thresholds; Select one threshold value from the M threshold values in sequence as the current threshold value, and form a water quality evaluation factor combination with the water quality evaluation factors whose average weight is greater than the current threshold value; After all thresholds are taken, M combinations of water quality evaluation factors are obtained; Calculating the CSI index of each of the M water quality evaluation factor combinations according to the sample set to obtain M CSI indices; The water quality evaluation factor combination corresponding to the smallest CSI index among the M CSI indices is determined as the target water quality evaluation factor combination.
2. The water quality evaluation method according to claim 1, characterized in that: Determining the average weight of each of the water quality evaluation factors according to the sample set includes: Step A: randomly selecting a target sample from the sample set, selecting a preset number of samples from the same type of samples to form a first sample set, and selecting the preset number of samples from the different types of samples to form a second sample set; wherein the same type of samples are samples of the same water quality grade as the target sample, and the different types of samples are samples of a different water quality grade than the target sample; Step B: Calculating the weight of each water quality evaluation factor using the ReliefF algorithm according to the target sample, the first sample set, the second sample set, and the preset number; Repeat step A and step B N times to obtain N weights of each water quality evaluation factor; The average value of the weights is calculated based on the N weights to determine the average weight of each of the water quality evaluation factors.
3. The water quality evaluation method according to claim 2, characterized in that: The calculating the CSI index of each of the M water quality evaluation factor combinations according to the sample set to obtain M CSI indices includes: Selecting a water quality evaluation factor combination from the M water quality evaluation factor combinations as the current water quality evaluation factor combination; Calculate the intra-class dispersion and inter-class dispersion of the water quality evaluation factors in the current water quality evaluation factor combination according to the sample set; The similarity of the two types of water quality grade samples is calculated according to the intra-class dispersion and the inter-class dispersion; Obtaining the CSI index of the current water quality evaluation factor combination according to the similarity calculation; When all the M water quality evaluation factor combinations are taken, the M CSI indices are obtained.
4. The water quality evaluation method according to claim 3, characterized in that: The calculating, based on the sample set, the intra-class dispersion and the inter-class dispersion of the water quality evaluation factors in the current water quality evaluation factor combination includes: The intra-class dispersion is calculated according to a first preset formula, where the first preset formula is: ; The inter-class dispersion is calculated according to a second preset formula, which is: ; Among them, the is the dispersion in the class; described is the inter-class dispersion; described For the Samples of water quality class; The L is Number of samples of water quality class; described is the first factor in the current water quality evaluation factor combination. The mean of the samples of water quality evaluation factors; described is the first factor in the current water quality evaluation factor combination. The mean of the samples of water quality evaluation factors.
5. The water quality evaluation method according to claim 3, characterized in that: The similarity of two types of water quality grade samples is calculated based on the intra-class discreteness and the inter-class discreteness, including: The similarity is calculated according to a third preset formula, which is: ; Among them, the is the similarity; described is the dispersion in the class; described is the inter-class dispersion.
6. The water quality evaluation method according to claim 3, characterized in that: The CSI index of the current water quality evaluation factor combination is obtained by calculating the similarity, including: The similarity is calculated according to a fourth preset formula, which is: ; Among them, the is the class number of the water quality grade; described is the similarity.
7. A water quality evaluation device, characterized in that: include: An acquisition module is used to acquire a water quality sample set; wherein the sample set includes the water quality grade to which each sample belongs, and each sample includes water quality parameters corresponding to each water quality evaluation factor; A first screening module is configured to determine an average weight of each of the water quality evaluation factors according to the sample set, and screen out target water quality evaluation factors according to the average weight to determine a target water quality evaluation factor combination; screening out target water quality evaluation factors according to the average weight to determine a target water quality evaluation factor combination includes: Set M thresholds; Select one threshold value from the M threshold values in sequence as the current threshold value, and form a water quality evaluation factor combination with the water quality evaluation factors whose average weight is greater than the current threshold value; After all thresholds are taken, M combinations of water quality evaluation factors are obtained; Calculating the CSI index of each of the M water quality evaluation factor combinations according to the sample set to obtain M CSI indices; Determine the water quality evaluation factor combination corresponding to the smallest CSI index among the M CSI indices as the target water quality evaluation factor combination; A second screening module is used to screen the target water quality parameters corresponding to the target water quality evaluation factors in each sample according to the target water quality evaluation factor combination to obtain a target sample set; A construction module is used to determine the mapping relationship between the target water quality parameter of each target sample in the target sample set and the water quality grade, and configure a relevant vector machine based on the mapping relationship to construct a water quality grade evaluation model, so as to determine the water quality grade of the water quality according to the water quality grade evaluation model.
8. A water quality evaluation device, characterized in that: including a memory for storing a computer program; A processor, configured to implement the steps of the water quality grade evaluation method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the water quality grade evaluation method according to any one of claims 1 to 6 are implemented.