A raw water quality data fault diagnosis method and system for a water plant
By aligning the time data of the water source and the incoming water, preprocessing and constructing the covariance matrix, and using the Gaussian Copula function to assess water quality anomalies, the problem of ambiguous time correspondence in traditional water quality monitoring is solved, enabling accurate diagnosis and safe control of water quality anomalies.
Patent Information
- Application Number
- CN202511672657.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-11-14
AI Technical Summary
Traditional water quality monitoring methods cannot accurately match the time correlation data between water sources and incoming water, resulting in ambiguous data time correspondence, making it difficult to distinguish between normal fluctuations and pollution risks. The lack of scientific data preprocessing and curve comparison methods leads to misjudgment of outliers or difficulty in quickly locating pollution sources.
By acquiring raw data from the water source and the incoming water, calculating the time difference and aligning it, performing preprocessing and noise reduction, constructing a covariance matrix, and using the Gaussian Copula function to calculate the joint probability of water quality indicators, water quality anomalies are assessed.
It enables real-time diagnosis of water quality anomalies, accurately captures abnormal pollution during transmission, and improves the accuracy and reliability of water quality safety control.
Smart Images

Figure CN121144761B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for diagnosing faults in raw water quality data of water plants, belonging to the technical field of water quality control systems for water plants. Background Technology
[0002] As a core component of drinking water safety, the effectiveness of water quality monitoring and early warning mechanisms at water treatment plants directly determines whether end-users can obtain safe and reliable drinking water. The transportation of raw water from reservoirs, rivers, and other water sources to water treatment plants via pipelines is not a simple physical process—water quality undergoes complex changes due to multiple factors: the transmission time in pipelines can last from several hours to tens of hours, during which time microorganisms in the raw water may multiply or decline due to changes in water temperature; corrosion and sediment shedding from the inner walls of the pipes may introduce heavy metals or suspended particles; and even minor leaks in the pipes may introduce external contaminants. These changes mean that meeting the standards for water quality at the source is not entirely equivalent to meeting the standards for water entering the treatment plant. Correlation analysis of the raw water and the water entering the plant is necessary to accurately detect abnormal pollution during the transmission process.
[0003] However, traditional water quality monitoring methods have several problems: First, the monitoring data for raw water and incoming water lack precise temporal correspondence. Traditional sampling is mostly done at fixed times and locations, which cannot match the dynamic transmission rhythm of water flow within the pipeline, leading to ambiguity in the traceability logic of a set batch of raw water corresponding to a set time period of incoming water. Second, there is a lack of scientific methods for data preprocessing and curve comparison. The monitoring data for raw water and incoming water may contain outliers, and the baseline values of the two may deviate due to differences in sampling time periods. Traditional methods, which directly compare the original curves, cannot distinguish between normal fluctuations and pollution risks. For example, if the turbidity of raw water rises briefly due to rainfall and then returns to normal, the turbidity of the incoming water should show a similar trend within a specific time window. However, if traditional monitoring does not align with the time dimension, it may be misjudged as pollution solely in the incoming water. Conversely, if the raw water shows no abnormalities but the turbidity of the incoming water suddenly increases, due to the lack of traceability methods, it is difficult to quickly determine whether it is pipeline pollution or sampling error. Summary of the Invention
[0004] The technical problem to be solved by this invention is: how to achieve real-time diagnosis of water quality anomalies by accurately matching the time correlation data of water source and incoming water, combined with multi-parameter joint probability analysis, so as to solve the problems of fuzzy data time correspondence and low accuracy of comparison methods in traditional monitoring, so as to accurately capture abnormal pollution in the transmission process and achieve water quality safety control of water plants.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0006] A method for diagnosing faults in raw water quality data of a water treatment plant includes:
[0007] Step 1: Obtain raw water quality data from the water source and the incoming water to the plant;
[0008] Step 2: Based on the data from the incoming water pipeline, calculate the time difference between the raw water from the water source and the corresponding incoming raw water; use the time backtracking method to align the time of each incoming raw water quality data with the corresponding raw water quality data from the water source.
[0009] Step 3: Preprocess the water quality data of the incoming raw water and the corresponding water quality data of the source water after time alignment;
[0010] Step 4: Based on the water quality data from the past month after preprocessing, determine the marginal distribution of the water quality data, conduct correlation analysis on different water quality data indicators, construct a covariance matrix, and determine the correlation between different water quality data indicators.
[0011] Step 5: Calculate the difference between the pre-treated and time-aligned raw water from the source and the corresponding raw water entering the plant for each set water quality index, solve the confidence interval of the difference between the water quality index of the source and the water quality index of the incoming water, calculate the envelope value of each water quality index of the source, and determine the abnormal interval of each water quality index.
[0012] Step 6: Based on the constructed covariance matrix and the calculated envelope values, determine the correlation and abnormal intervals of each water quality indicator, use the Gaussian Copula function to calculate the joint probability of the five water quality indicators exceeding the envelope, and assess the overall water quality situation.
[0013] The aforementioned method for diagnosing faults in raw water quality data of a water plant, in step one, includes five water quality indicators of the raw water from the source and the incoming raw water: turbidity, pH value, dissolved oxygen, ammonia nitrogen, and chemical oxygen demand.
[0014] The aforementioned method for diagnosing faults in raw water quality data at a water plant includes, in step two:
[0015] The time difference between the raw water quality data of the water source and the corresponding raw water quality data entering the treatment plant is calculated using the following formula:
[0016] ;
[0017] in, For the time difference, The total flow rate of the pipeline. The average flow rate per unit time;
[0018] Let the instantaneous flow rate per unit time be ,
[0019] ;
[0020] in, This represents the current water flow rate in the pipeline. This is the cumulative time.
[0021] when At that time, the water quality data of the unit flow rate at the inlet of the pipeline is the first water quality data of the water source. The water quality data at this point is the initial data of the raw water from the water source; the current water flow rate in the pipeline is used. Subtract the flow rate per unit time of the water outlet section of the pipeline At this point, the water quality data recorded at the inlet of the pipeline per unit time is the second water quality data point for the raw water from the water source. Repeat this step until... , ;
[0022] Multiple water quality sensors are installed at equal intervals at the inlet of the water source, the inlet of the water plant, and in between, to collect water quality data. The sensors at the inlet and in between record the raw water data from the source. Each sensor is connected to a PLC, which receives the water quality data collected by each sensor. Water quality data was recorded and collected within the specified time period. This refers to the moment immediately after the pipe is filled. for At that moment, At any given time, the water quality data of the raw water entering the water plant is collected every minute using water quality sensors at the plant's inlet; this data constitutes the corresponding... Real-time water quality data of raw water at the water source.
[0023] The aforementioned method for diagnosing faults in raw water quality data at a water plant includes, in step three:
[0024] Data on five water quality indicators were selected from the raw water from the water source and the incoming water from the plant over the past three months. Each water quality indicator has... One sample:
[0025] =3×30×24×60=129600;
[0026] For obtaining water quality data of raw water from water sources through The principle is to remove outliers from all water quality data:
[0027] The original data for setting water quality indicators for the source water and the incoming water were arranged according to their numerical values and then divided into three equal parts, denoted as follows:
[0028] lower quartiles 25% of the samples in the data are less than this value;
[0029] median 50% of the samples in the data are less than this value;
[0030] Upper quartiles 75% of the samples in the data are less than this value;
[0031] Calculate the difference between the upper quartile and the lower quartile, i.e.:
[0032] ;
[0033] Calculate the lower and upper bounds of outliers:
[0034] The lower realm: ;
[0035] Upper Realm: ;
[0036] in, , They are constant one and constant two, respectively;
[0037] Then, the average value before and after the removal of outliers is used to supplement the removed outlier data.
[0038] The aforementioned method for diagnosing faults in raw water quality data at water plants involves noise-reduced raw water quality data from the water source at a set time. and corresponding raw water quality data set for the incoming water The output data after median filtering are as follows: , ;
[0039] ;
[0040] The window size is , It is an integer. This indicates taking the median of the set, where m represents the value at the current moment;
[0041] The water quality dataset of the pretreated raw water entering the plant is as follows The raw water quality dataset of the water source is as follows: Water quality dataset of raw water entering the plant Water quality dataset of raw water source The average water quality values were respectively and ;
[0042] Data set of water quality of raw water entering the plant Subtract the mean difference from each element After aligning the mean water quality data of the incoming raw water, a dataset was obtained. ,in, , ;
[0043] Water quality dataset of raw water from water source Normalization is performed:
[0044] ;
[0045] in, Set a minimum value for the water quality dataset of the raw water source. This represents the maximum value of the water quality dataset. ;
[0046] Meanwhile, the corresponding datasets with aligned mean water quality values of the incoming raw water were also processed. Normalization is performed.
[0047] The aforementioned method for diagnosing faults in raw water quality data at a water plant includes, in step four:
[0048] Select the sample data of the most recent month for the pretreated water quality target, the quantity of which is: The dataset after ascending order is Suppose the theoretical distribution function to be tested is:
[0049] ;
[0050] in, These are the distribution parameters; different distribution parameters can determine different theoretical distribution functions.
[0051] Calculate the empirical cumulative distribution function :
[0052] ;
[0053] in, The number of samples in the dataset. For counting functions, For any constant, For dataset Medium parameters;
[0054] Calculate the Kolmogorov-Smirnov statistic :
[0055] ;
[0056] in, For theoretical distribution in The cumulative probability at the location;
[0057] Calculate the root mean square error :
[0058] deviation ,but ;
[0059] in, To estimate the distribution parameters;
[0060] Select the Kolmogorov-Smirnov statistic. ,and The distribution with the minimum water quality data is taken as the optimal marginal distribution;
[0061] Set water quality sample data for incoming water Convert to probability value :
[0062] ;
[0063] in For the i-th water quality observation, the k-th value is... To define the marginal distribution function of water quality indicators;
[0064] probability value Convert to standard normal variable :
[0065] ;
[0066] in, It is the inverse function of the standard normal distribution;
[0067] Calculate the correlation coefficient :
[0068] ;
[0069] in, Let be the standard normal variables of the i-th and j-th water quality indicators, respectively. They are respectively The sample mean;
[0070] Construct a 5×5 covariance matrix for five water quality data indicators. :
[0071] ;
[0072] Among them, the diagonal elements are all 1, and the off-diagonal elements are all 1. ,and .
[0073] In the aforementioned method for diagnosing water quality data faults in water plants, step five involves calculating the differences in set water quality indicators between the pretreated and time-aligned source water and the incoming water for each quality parameter.
[0074] The pretreated and time-aligned raw water intake water setup dataset is as follows: The raw water quality dataset for the water source is set as follows: The difference is ;
[0075] Sort the difference dataset in ascending order:
[0076] ;
[0077] Use the Bootstrap method to determine the confidence intervals for the difference data, including:
[0078] 1) Calculate the difference dataset mean :
[0079] ;
[0080] in, For difference dataset Parameters in;
[0081] 2) Generate Bootstrap samples:
[0082] From the difference dataset B = 10,000 samples are drawn with replacement from the original sample, and the number of samples in each sample is the same as the number of original samples.
[0083] The b-th Bootstrap sample is denoted as: B represents the total number of Bootstrap samples;
[0084] 3) Calculate the Bootstrap statistic:
[0085] For each Bootstrap sample Calculate the mean of the Bootstrap statistic corresponding to the original statistic. :
[0086] ;
[0087] The final result is the average of 10,000 Bootstrap scores: And average the values of each Bootstrap Sort in ascending order;
[0088] 4) Calculating confidence intervals using the percentile method:
[0089] For confidence level :
[0090] Upper quantile position: The upper limit of the corresponding interval is ;
[0091] Lower quantile position: The corresponding lower limit of the interval is ;
[0092] in, A constant between [0 and 1];
[0093] but The confidence interval is:
[0094] ;
[0095] The upper limit of water quality indicators for water sources is expressed as follows: ;
[0096] The lower limit of water quality indicators for water sources is expressed as follows: ;
[0097] Set water quality index data for the corresponding water source at each time point;
[0098] By selecting constant three The values of 3 are used to construct the upper envelope of the water quality of the water source, where the constant is 3. The size satisfies:
[0099] ;
[0100] To set the upper envelope value for water quality index data;
[0101] Similarly, by selecting constant four The values are used to construct the lower envelope of the water quality of the water source, where the constant is four. The size satisfies:
[0102] ;
[0103] To set the lower envelope value for water quality index data.
[0104] The aforementioned method for diagnosing faults in raw water quality data at a water plant includes, in step six:
[0105] Calculate the probability that a given water quality index exceeds the envelope, and the probability that it exceeds the upper envelope. :
[0106] ;
[0107] in, To define the marginal distribution function of water quality indicators;
[0108] Probability of exceeding the lower envelope :
[0109] ;
[0110] Total probability of exceeding:
[0111] ;
[0112] Transform marginal probabilities into standard normal variables. :
[0113] ;
[0114] in, It is the inverse function of the standard normal distribution;
[0115] Calculating joint probability based on Gaussian Copula function :
[0116] ;
[0117] in, Let be the cumulative distribution function of the multivariate normal distribution. The covariance matrix is 5×5. A computer system includes a memory, a processor, and a computer program stored in the memory, the processor executing the computer program to implement the steps of the method described above.
[0118] A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described above.
[0119] The beneficial effects achieved by this invention are as follows: The method of this invention determines the marginal distribution of each water quality, solves the correlation coefficient of each water quality and constructs the covariance matrix, uses the Gaussian Copula function to calculate the probability of multiple water quality joint exceeding the envelope anomaly, and solves the problems of fuzzy data time correspondence and coarse comparison methods in traditional monitoring by using the micro-element backtracking method, accurately captures abnormal pollution in the transmission process, and provides reliable technical support for water quality safety control in water plants. Attached Figure Description
[0120] Figure 1 This is a flowchart of the water plant raw water quality data fault diagnosis method in Embodiment 1 of the present invention;
[0121] Figure 2 This is a flowchart of the time backtracking algorithm in Embodiment 1 of the invention;
[0122] Figure 3 This is a schematic diagram of the time backtracking algorithm in Embodiment 1 of the invention;
[0123] Figure 4 This is a comparison chart of the water plant's turbidity before and after retrospective analysis in Example 1;
[0124] Figure 5 This is a comparison chart of the pH value of the water plant before and after retrospective analysis in Example 1;
[0125] Figure 6 This is a comparison chart of the dissolved oxygen levels in the water plant before and after retrospective analysis in Example 1;
[0126] Figure 7 This is a comparison chart of ammonia nitrogen levels in the water plant before and after retrospective analysis in Example 1;
[0127] Figure 8 This is a comparison chart of the chemical oxygen demand (COD) of the water plant before and after retrospective analysis in Example 1;
[0128] Figure 9 This is the envelope diagram of turbidity among the five water quality indicators of the water plant in Example 1;
[0129] Figure 10 This is the envelope diagram of pH value among the five water quality indicators of the water plant in Example 1;
[0130] Figure 11 This is the envelope diagram of dissolved oxygen among the five water quality indicators of the water plant in Example 1;
[0131] Figure 12 This is the envelope diagram of ammonia nitrogen levels among the five water quality indicators in the water plant in Example 1;
[0132] Figure 13 This is the envelope diagram of chemical oxygen demand (COD) among the five water quality indicators of the water plant in Example 1;
[0133] Figure 14 This is the probability diagram of the five water quality indicators of the water plant in Example 1 exceeding the real-time envelope. Detailed Implementation
[0134] The technical solution of the present invention will be described in detail below with reference to the actual online test of the water plant.
[0135] Example 1
[0136] In the water plant, the collection of influent and effluent water quality data, as well as the water quality within the plant, is achieved through communication between a host computer and a PLC. This communication is accomplished using Siemens' proprietary S7 protocol and Java's Snap7 library. The data collected by the PLC in real time is then written to the database.
[0137] like Figures 1-14 As shown in the figure, this embodiment provides a method for diagnosing faults in raw water quality data of a water plant, including:
[0138] Step 1: Obtain raw water quality data from the water source and the incoming water to the plant;
[0139] The raw water quality data includes five water quality indicators for both the source water and the incoming water: turbidity, pH value, dissolved oxygen, ammonia nitrogen, and chemical oxygen demand (COD).
[0140] Step two: Based on the incoming water pipeline data, calculate the time difference between the source water and the corresponding incoming raw water; using a time backtracking method, align the time of each incoming raw water quality data point with the corresponding source water quality data. The steps include:
[0141] The time difference between the raw water quality data of the water source and the corresponding raw water quality data entering the treatment plant is calculated using the following formula:
[0142] ;
[0143] in, For the time difference, The total flow rate of the pipeline. This represents the average flow rate per unit time.
[0144] like Figure 2 As shown, let the instantaneous flow rate per unit time be... ,
[0145] ;
[0146] in, This represents the current water flow rate in the pipeline. To accumulate time, the unit of time can be set to per minute.
[0147] when At that time, the water quality data of the unit flow rate at the inlet of the pipeline is the first water quality data of the water source. The water quality data at this point is the initial data of the raw water from the water source; the current water flow rate in the pipeline is used. Subtract the flow rate per unit time of the water outlet section of the pipeline At this point, the water quality data recorded at the inlet of the pipeline per unit time is the second water quality data point for the raw water from the water source. Repeat this step until... , .
[0148] Multiple water quality sensors are installed at equal intervals at the inlet of the water source, the inlet of the water plant, and in between, to collect water quality data. The sensors at the inlet and in between record the raw water data from the source. Each sensor is connected to a PLC, which receives the water quality data collected by each sensor. Water quality data was recorded and collected within the specified time period. This refers to the moment immediately after the pipe is filled. for At that moment, At any given time, the water quality data of the raw water entering the water plant is collected every minute using water quality sensors at the plant's inlet; this data constitutes the corresponding... Real-time water quality data of raw water at the water source.
[0149] This step aligns the data of raw water from the water source with the data of raw water entering the plant in time, which facilitates subsequent testing and analysis by the water plant.
[0150] like Figures 4 to 8 The figures shown are schematic diagrams comparing the five water quality indicators before and after retrospective analysis.
[0151] Step 3: Due to potential aging of pipelines, tortuous pipeline loops, and unstable water flow, the quality of the incoming raw water and the raw water quality may experience abnormal changes at set times, leading to abnormal alarms. To reduce the frequency of abnormal alarms, the incoming raw water quality data and the corresponding time-aligned source water quality data need to be preprocessed, including noise reduction and filtering.
[0152] Data on five water quality indicators were selected from the raw water from the water source and the incoming water from the plant over the past three months. Each water quality indicator has... One sample:
[0153] =3×30×24×60=129600;
[0154] For obtaining water quality data of raw water from water sources through The principle is to remove outliers from all water quality data:
[0155] The original data for setting water quality indicators for the source water and the incoming water were arranged according to their numerical values and then divided into three equal parts, denoted as follows:
[0156] lower quartiles 25% of the samples in the data are less than this value;
[0157] median 50% of the samples in the data are less than this value;
[0158] Upper quartiles 75% of the samples in the data are less than this value;
[0159] Calculate the difference between the upper quartile and the lower quartile, i.e.:
[0160] .
[0161] Calculate the lower and upper bounds of outliers:
[0162] The lower realm: ;
[0163] Upper Realm: ;
[0164] in, , They are constant one and constant two, respectively;
[0165] Then, the average value before and after the removal of outliers is used to supplement the removed outlier data.
[0166] Raw water quality data of the water source at the set time after noise reduction processing and corresponding raw water quality data set for the incoming water The output data after median filtering are as follows: , ;
[0167] ;
[0168] The window size is , It is an integer. This indicates taking the median of the set, where m represents the value at the current moment.
[0169] The water quality dataset of the pretreated raw water entering the plant is as follows The raw water quality dataset of the water source is as follows: Water quality dataset of raw water entering the plant Water quality dataset of raw water source The average water quality values were respectively and .
[0170] Data set of water quality of raw water entering the plant Subtract the mean difference from each element After aligning the mean water quality data of the incoming raw water, a dataset was obtained. ,in, , .
[0171] Water quality dataset of raw water from water source Normalization is performed:
[0172] ;
[0173] in, Set a minimum value for the water quality dataset of the raw water source. This represents the maximum value of the water quality dataset. .
[0174] Computing raw water quality datasets from water sources The formula is similar, and the dataset is aligned with the mean water quality of the corresponding raw water entering the plant. Normalization is performed.
[0175] Step four: Based on the pretreated water quality data, determine the marginal distribution of the water quality data, and perform correlation analysis on different water quality data indicators to construct a covariance matrix and determine the correlation between different water quality data indicators. The water quality data indicators include turbidity, pH value, dissolved oxygen, ammonia nitrogen, and chemical oxygen demand. The steps are as follows:
[0176] Select the sample data of the most recent month for the pretreated water quality target, the quantity of which is: The dataset after ascending order is Assume the theoretical distribution function to be tested is:
[0177] ;
[0178] in, The distribution parameters are different, and different distribution parameters can determine different theoretical distribution functions. Common distribution functions include the normal distribution, log-normal distribution, Weibull distribution, and Gamma distribution.
[0179] Calculate the empirical cumulative distribution function :
[0180] ;
[0181] in, The number of samples in the dataset. For counting functions, For any constant, For dataset Medium parameters.
[0182] Calculate the Kolmogorov-Smirnov statistic :
[0183] ;
[0184] in, For theoretical distribution in The cumulative probability at a given location. The smaller the value, the smaller the difference between the theoretical distribution and the cumulative distribution of the sample, and the better the fit.
[0185] Calculate the root mean square error :
[0186] deviation ,but ;
[0187] in, To estimate the distribution parameters.
[0188] The smaller the value, the smaller the average deviation between the theoretical distribution and the sample, and the better the overall fit.
[0189] Select the Kolmogorov-Smirnov statistic. and The distribution with the smallest water quality data is taken as the optimal marginal distribution, where n is the number of samples in the dataset.
[0190] The optimal distribution types for the five water quality indicators are selected as shown in Table 1.
[0191] Table 1: Optimal Distribution Types of Various Water Quality Parameters
[0192]
[0193] Set water quality sample data for incoming water Convert to probability value :
[0194] ;
[0195] in For the i-th water quality observation, the k-th value is... To define the marginal distribution function of water quality indicators;
[0196] probability value Convert to standard normal variable :
[0197] ;
[0198] in, It is the inverse function of the standard normal distribution.
[0199] Calculate the correlation coefficient :
[0200] ;
[0201] in, Let be the standard normal variables of the i-th and j-th water quality indicators, respectively. They are respectively The sample mean.
[0202] Construct a 5×5 covariance matrix for five water quality data indicators. :
[0203] ;
[0204] Among them, the diagonal elements are all 1, and the off-diagonal elements are all 1. ,and .
[0205] The calculated correlation coefficients are shown in Table 2.
[0206] Table 2: Correlation coefficients of various water quality parameters
[0207]
[0208] Step 5: Calculate the difference between the pre-treated and time-aligned raw water from the source and the corresponding raw water entering the plant for each set water quality index, solve the confidence interval of the difference between the water quality index of the source and the water quality index of the incoming water, calculate the envelope value of each water quality index of the source, and determine the abnormal interval of each water quality index.
[0209] Calculate the differences in set water quality indicators between the pretreated and time-aligned source water and the incoming water:
[0210] The pretreated and time-aligned raw water intake water setup dataset is as follows: The raw water quality dataset for the water source is set as follows: The difference is ;
[0211] Sort the difference dataset in ascending order:
[0212] ;
[0213] Use the Bootstrap method to determine the confidence intervals for the difference data, including:
[0214] 1) Calculate the difference dataset mean :
[0215] ;
[0216] in, For difference dataset The parameters in.
[0217] 2) Generate Bootstrap samples:
[0218] From the difference dataset B = 10,000 samples were drawn with replacement from the original sample, and the number of samples in each sample was the same as the number of samples in the original sample.
[0219] The b-th Bootstrap sample is denoted as: B represents the total number of Bootstrap samples.
[0220] 3) Calculate the Bootstrap statistic:
[0221] For each Bootstrap sample Calculate the mean of the Bootstrap statistic corresponding to the original statistic. :
[0222] ;
[0223] The final result is the average of 10,000 Bootstrap scores: And average the values of each Bootstrap Sort in ascending order.
[0224] 4) Calculating confidence intervals using the percentile method:
[0225] For confidence level :
[0226] Upper quantile position: The upper limit of the corresponding interval is ;
[0227] Lower quantile position: The corresponding lower limit of the interval is ;
[0228] in, It is a constant between [0 and 1].
[0229] but The confidence interval is:
[0230] ;
[0231] The upper limit of water quality indicators for water sources is expressed as follows: ;
[0232] The lower limit of water quality indicators for water sources is expressed as follows: ;
[0233] Set water quality index data for the corresponding water source at each time.
[0234] By selecting constant three The values of 3 are used to construct the upper envelope of the water quality of the water source, where the constant is 3. The size satisfies:
[0235] ;
[0236] To set the upper envelope value for water quality index data;
[0237] Similarly, by selecting constant four The values are used to construct the lower envelope of the water quality of the water source, where the constant is four. The size satisfies:
[0238] ;
[0239] To set the lower envelope value for water quality index data.
[0240] like Figures 9-13 The figure shows the curves and upper and lower envelope diagrams for five water quality indicators.
[0241] Step 6: Based on the constructed covariance matrix and the calculated envelope values, determine the correlation and abnormal intervals of each water quality indicator. Use the Gaussian Copula function to calculate the joint probability of the five water quality indicators exceeding the envelope, thus more accurately assessing the overall water quality situation. The steps are as follows:
[0242] Calculate the probability that a given water quality index exceeds the envelope, and the probability that it exceeds the upper envelope. :
[0243] ;
[0244] in, To define the marginal distribution function of water quality indicators.
[0245] Probability of exceeding the lower envelope :
[0246] ;
[0247] Total probability of exceeding:
[0248] ;
[0249] Transform marginal probabilities into standard normal variables. :
[0250] ;
[0251] in, It is the inverse function of the standard normal distribution.
[0252] Calculating joint probability based on Gaussian Copula function :
[0253] ;
[0254] in, Let be the cumulative distribution function of the multivariate normal distribution. It is a 5×5 covariance matrix.
[0255] like Figure 14 As shown, water quality data from the incoming water and the water source for one month are selected. Based on the Gaussian Copula function, the probability of the five water quality indicators of the incoming water exceeding the real-time envelope is plotted. The water quality data fault can be judged based on the probability value.
[0256] Example 2
[0257] A computer system includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described above.
[0258] Example 3
[0259] A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described above.
[0260] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0261] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0262] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0263] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0264] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for diagnosing faults in raw water quality data of a water plant, characterized in that, include: Step 1: Obtain raw water quality data of the source water and the incoming water. The raw water quality data includes five water quality indicators of the source water and the incoming water: turbidity, pH value, dissolved oxygen, ammonia nitrogen, and chemical oxygen demand (COD). Step 2: Based on the data from the incoming water pipeline, calculate the time difference between the raw water from the water source and the corresponding incoming raw water; use the time backtracking method to align the time of each incoming raw water quality data with the corresponding raw water quality data from the water source. Step 3 involves preprocessing the water quality data of the incoming raw water and the corresponding source water quality data after time alignment, including: Data on five water quality indicators were selected from the raw water from the water source and the incoming water from the plant over the past three months. Each water quality indicator has... One sample: ; For obtaining water quality data of raw water from water sources through The principle is to remove outliers from all water quality data: The original data for setting water quality indicators for the source water and the incoming water were arranged according to their numerical values and then divided into three equal parts, denoted as follows: lower quartiles 25% of the samples in the data are less than this value; median 50% of the samples in the data are less than this value; Upper quartiles 75% of the samples in the data are less than this value; Calculate the difference between the upper quartile and the lower quartile, i.e.: ; Calculate the lower and upper bounds of outliers: The lower realm: ; Upper Realm: ; in, Let constant one and constant two be constants; Then, the average value before and after the removal of outlier data is used to supplement the data. Step 4: Based on the preprocessed water quality data, determine the marginal distribution of the water quality data, conduct correlation analysis on different water quality data indicators, construct a covariance matrix, and determine the correlation between different water quality data indicators. Step 5: Calculate the difference between the pre-treated and time-aligned raw water from the source and the corresponding raw water entering the plant for each set water quality index, solve the confidence interval of the difference between the water quality index of the source and the water quality index of the incoming water, calculate the envelope value of each water quality index of the source, and determine the abnormal interval of each water quality index. Step 6: Based on the constructed covariance matrix and the calculated envelope values, determine the correlation and abnormal intervals of each water quality indicator, use the Gaussian Copula function to calculate the joint probability of the five water quality indicators exceeding the envelope, and assess the overall water quality situation.
2. The method for fault diagnosis of raw water quality data in a water plant according to claim 1, characterized in that, Step two includes: The time difference between the raw water quality data of the water source and the corresponding raw water quality data entering the treatment plant is calculated using the following formula: ; in For the time difference, The total flow rate of the pipeline. The average flow rate per unit time; Let the instantaneous flow rate per unit time be , ; in, This represents the current water flow rate in the pipeline. This is the cumulative time. when At that time, the water quality data of the unit flow rate at the inlet of the pipeline is the first water quality data of the water source. The water quality data at this point is the initial data of the raw water from the water source; the current water flow rate in the pipeline is used. Subtract the flow rate per unit time of the water outlet section of the pipeline At this point, the water quality data recorded at the inlet of the pipeline per unit time is the second water quality data point for the raw water from the water source. Repeat this step until... , ; Multiple water quality sensors are installed at equal intervals at the inlet of the water source, the inlet of the water plant, and in between, to collect water quality data. The sensors at the inlet and in between record the raw water data from the source. Each sensor is connected to a PLC, which receives the water quality data collected by each sensor. Water quality data was recorded and collected within the specified time period. This refers to the moment immediately after the pipe is filled. for At that moment, At any given time, the water quality data of the raw water entering the water plant is collected every minute using water quality sensors at the plant's inlet; this data constitutes the corresponding... Real-time water quality data of raw water at the water source.
3. The method for fault diagnosis of raw water quality data in a water plant according to claim 1, characterized in that, Raw water quality data of the water source at the set time after noise reduction processing and corresponding raw water quality data set for the incoming water The output data after median filtering are as follows: ; ; The window size is 2. +1, It is an integer. This indicates taking the median of the set. This represents the value at the current moment; The water quality dataset of the pretreated raw water entering the plant is as follows The raw water quality dataset of the water source is as follows: Water quality dataset of raw water entering the plant Water quality dataset of raw water source The average water quality values were respectively and ; Data set of water quality of raw water entering the plant Subtract the mean difference from each element After aligning the mean water quality data of the incoming raw water, a dataset was obtained. ,in, , ; Water quality dataset of raw water from water source Normalization is performed: ; in, Set a minimum value for the water quality dataset of the raw water source. This represents the maximum value of the water quality dataset. ; Meanwhile, the corresponding datasets with aligned mean water quality values of the incoming raw water were also processed. Normalization is performed.
4. The method for fault diagnosis of raw water quality data in a water plant according to claim 1, characterized in that, Step four includes: Select the sample data of the most recent month for the pretreated water quality target, the quantity of which is: The dataset after ascending order is Suppose the theoretical distribution function to be tested is: ; in, These are the distribution parameters; different distribution parameters can determine different theoretical distribution functions. Calculate the empirical cumulative distribution function : ; in, The number of samples in the dataset. ( ) is a counting function. For any constant, For dataset Medium parameters; Calculate the Kolmogorov-Smirnov statistic : ; in, For theoretical distribution in The cumulative probability at the location; Calculate the root mean square error : deviation ,but ; in, To estimate the distribution parameters; Select the Kolmogorov-Smirnov statistic. and The distribution with the minimum water quality data is taken as the optimal marginal distribution; Set water quality sample data for incoming water Convert to probability value : ; in For the first The first water quality One observation value, To define the marginal distribution function of water quality indicators; probability value Convert to standard normal variable : ; in, It is the inverse function of the standard normal distribution; Calculate the correlation coefficient : ; in, The first Water quality indicators, No. A standard normal variable for each water quality indicator They are respectively The sample mean, The number of samples in the dataset; Construct a 5×5 covariance matrix for five water quality data indicators. : ; Among them, the diagonal elements are all 1, and the off-diagonal elements are all 1. ,and .
5. The method for fault diagnosis of raw water quality data in a water plant according to claim 4, characterized in that, In step five, the differences in set water quality indicators between the pretreated and time-aligned source water and the incoming water are calculated: The pretreated and time-aligned raw water intake water setup dataset is as follows: The raw water quality dataset for the water source is set as follows: The difference is ; Sort the difference dataset in ascending order: ; Use the Bootstrap method to determine the confidence intervals for the difference data, including: 1) Calculate the difference dataset mean : ; in, For difference dataset Parameters in; 2) Generate Bootstrap samples: From the difference dataset B = 10,000 samples are drawn with replacement from the original sample, and the number of samples in each sample is the same as the number of original samples. No. The Bootstrap samples are denoted as: , This represents the total number of Bootstrap samples. 3) Calculate the Bootstrap statistic: For each Bootstrap sample Calculate the mean of the Bootstrap statistic corresponding to the original statistic. : ; The final result is the average of 10,000 Bootstrap scores: And average the values of each Bootstrap Sort in ascending order; 4) Calculating confidence intervals using the percentile method: For confidence level : Upper quantile position: The upper limit of the corresponding interval is ; Lower quantile position: The corresponding lower limit of the interval is ; in, A constant between [0 and 1]; but The confidence interval is: ; The upper limit of water quality indicators for water sources is expressed as follows: ; The lower limit of water quality indicators for water sources is expressed as follows: ; Set water quality index data for the corresponding water source at each time point; By selecting constant three The values of 3 are used to construct the upper envelope of the water quality of the water source, where the constant is 3. The size satisfies: ; To set the upper envelope value for water quality index data; Similarly, by selecting constant four The values are used to construct the lower envelope of the water quality of the water source, where the constant is four. The size satisfies: ; To set the lower envelope value for water quality index data.
6. The method for fault diagnosis of raw water quality data in a water plant according to claim 5, characterized in that, Step six includes: Calculate the probability that a given water quality index exceeds the envelope, and the probability that it exceeds the upper envelope. : ; in, To define the marginal distribution function of water quality indicators; Probability of exceeding the lower envelope : ; Total probability of exceeding: ; Transform marginal probabilities into standard normal variables. : ; in, It is the inverse function of the standard normal distribution; Calculating joint probability based on Gaussian Copula function : ; in, Let be the cumulative distribution function of the multivariate normal distribution. It is a 5×5 covariance matrix.
7. A computer system comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method as described in claims 1-6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in claims 1-6.
Citation Information
Patent Citations
River water quality predicting method
CN108053054A
Water resource system multi-risk evaluation method based on multivariate joint distribution
CN111079086A