Sewage quality prediction method and system, medium and electronic equipment
By treating the observation data and related characteristics of the sewage treatment plant, using the LSTM model for prediction, and using Kalman filter correction, the problem of the sewage treatment plant being difficult to accurately predict water quality is solved, and the prediction accuracy and treatment efficiency are improved.
Patent Information
- Application Number
- CN202411257149.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-02-14
AI Technical Summary
It is difficult for sewage treatment plants to accurately predict future water quality conditions, and traditional prediction methods are difficult to capture real-time information about water quality changes, resulting in a large deviation from the prediction results and the actual water quality conditions.
By obtaining the observed sewage target component data and correlation characteristic data, processing abnormal data, using the LSTM model to predict, and correcting the prediction data through Kalman filtering to obtain the target sewage time series data.
It improves the accuracy of sewage water quality prediction, helps sewage treatment plants to more accurately control energy consumption and drug delivery, reduce costs and environmental negative impacts, and discover water quality abnormalities in advance, improving the efficiency of responding to emergencies.
Smart Images

Figure CN119441710A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology and relates to a sewage quality prediction method, system, medium and electronic equipment. Background Art
[0002] The sewage treatment process is affected by many factors, such as influent water quality, seasonal changes, weather conditions, etc., making it difficult for sewage treatment plants to accurately predict future water quality conditions. The monitoring data of sewage treatment plants has obvious time series characteristics. The data results at each time point are closely related to the data before that time point, and this point also has an impact on the points after that time point. This makes it difficult for traditional prediction methods to capture real-time information on water quality changes. There may be certain regularities in the data of seasons, months, or mid-week and weekends, but existing prediction methods often find it difficult to accurately capture these regularities, resulting in a large deviation between the prediction results and the actual water quality conditions. Summary of the invention
[0003] The purpose of this application is to provide a sewage water quality prediction method, system, medium and electronic equipment to improve the accuracy of sewage water quality prediction.
[0004] In a first aspect, the present application provides a sewage water quality prediction method, which includes: obtaining observed sewage target component data and correlation characteristic data of the observed sewage target component data; processing abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain observed sewage time series data; based on the observed sewage time series data, using an LSTM model to perform prediction to obtain predicted sewage time series data; and using Kalman filtering to correct the predicted sewage time series data to obtain target sewage time series data.
[0005] In an implementation of the first aspect, the process of processing the abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain the observed sewage time series data includes: performing data cleaning on the observed sewage target component data to remove the abnormal values of the observed sewage target component data; and filling in the missing values of the observed sewage target component data after removing the abnormal values to obtain the observed sewage time series data.
[0006] In an implementation of the first aspect, the process of filling the missing values of the observed sewage target component data after removing outliers to obtain the observed sewage time series data includes: confirming the observed sewage target component data of the review period before the missing values; inputting the observed sewage target component data of the review period and the corresponding correlation feature data into the LSTM model for filling to obtain the observed sewage time series data.
[0007] In an implementation of the first aspect, the process of using the LSTM model to perform prediction based on the observed sewage time series data to obtain predicted sewage time series data includes: step one, based on the observed sewage time series data, using the LSTM model to perform prediction to obtain sewage target component data at a prediction time point; step two, based on the observed sewage time series data and the sewage target component data at the prediction time point, using the LSTM model to perform prediction to obtain sewage target component data at the next prediction time point; repeat step two until the predicted sewage time series data from the prediction start point to the prediction end point is obtained.
[0008] In an implementation of the first aspect, the process of using the LSTM model to perform prediction based on the observed sewage time series data to obtain the sewage target component data at the prediction time point includes: obtaining the correlation characteristic data at the prediction time point; based on the correlation characteristic data at the prediction time point and the observed sewage time series data, using the LSTM model to perform prediction to obtain the sewage target component data at the prediction time point.
[0009] In an implementation of the first aspect, the correlation characteristic data includes water inlet data, process quantity data, and time characteristic data.
[0010] In an implementation of the first aspect, the process of using Kalman filtering to correct the predicted sewage time series data to obtain target sewage time series data includes: generating a data structure of corresponding positions based on the predicted sewage time series data and the observed sewage time series data; based on the data structure, using Kalman filtering to perform point-by-point filtering correction from the prediction start point to the prediction end point to obtain the target sewage time series data.
[0011] In the second aspect, the present application provides a sewage water quality prediction system, which includes: a data acquisition module, used to obtain observed sewage target component data and correlation characteristic data of the observed sewage target component data; an abnormal data processing module, used to process the abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain observed sewage time series data; a prediction module, used to predict based on the observed sewage time series data using an LSTM model to obtain predicted sewage time series data; a correction module, used to correct the predicted sewage time series data using a Kalman filter to obtain target sewage time series data.
[0012] In a third aspect, the present application provides an electronic device, comprising: a memory on which a computer program is stored; and a processor, communicatively connected to the memory, for executing the computer program to implement the above-mentioned sewage quality prediction method.
[0013] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, characterized in that the program implements the above-mentioned sewage quality prediction method when executed by an electronic device.
[0014] As described above, the sewage quality prediction method, system, medium and electronic device described in this application have the following beneficial effects:
[0015] The sewage quality prediction method provided by the present application can process abnormal data in the observed sewage target component data to obtain the observed sewage time series data, predict the observed sewage time series data through the LSTM model to obtain the predicted sewage time series, and can also use Kalman filtering to correct the predicted sewage time series data. The sewage quality prediction method of the present application improves the accuracy of sewage quality prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Shown is a process schematic diagram of the sewage water quality prediction method described in an embodiment of the present application.
[0017] Figure 2 Shown is a schematic diagram of the process of processing abnormal data described in an embodiment of the present application.
[0018] Figure 3 Shown is a schematic diagram of the interpolation effect of A_DO_1 described in an embodiment of the present application.
[0019] Figure 4 Shown is a schematic diagram of the process of filling missing values of observed sewage target component data after removing outliers as described in an embodiment of the present application.
[0020] Figure 5 Shown is a schematic diagram of the filling effect of A_DO_3 described in an embodiment of the present application.
[0021] Figure 6 Shown is a schematic diagram of the process of obtaining predicted sewage time series data as described in an embodiment of the present application.
[0022] Figure 7 Shown is a schematic diagram of the process of obtaining sewage target component data at a predicted time point as described in an embodiment of the present application.
[0023] Figure 8 Shown is a schematic diagram of correcting the predicted sewage time series data using Kalman filtering as described in an embodiment of the present application.
[0024] Fig. 9 Shown is a schematic diagram of the comparison results before and after using Kalman correction as described in the embodiment of the present application.
[0025] Fig.10 Shown is a schematic diagram of the structure of the sewage quality prediction system described in an embodiment of the present application.
[0026] Fig.11 Shown is a schematic diagram of the structure of an electronic device described in an embodiment of the present application.
[0027] Component number description
[0028] 1. Wastewater Quality Prediction System
[0029] 11 Data acquisition module
[0030] 12 Abnormal data processing module
[0031] 13 Prediction Module
[0032] 14 Correction Module
[0033] 2 Electronic devices
[0034] 21 Memory
[0035] 22 Processor
[0036] Steps S11 to S14
[0037] Steps S21 to S22
[0038] Steps S31 to S32
[0039] Steps S41 to S43
[0040] Steps S51 to S52
[0041] Steps S61 to S62 DETAILED DESCRIPTION
[0042] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0043] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0044] The sewage treatment process is affected by many factors, such as influent water quality, seasonal changes, weather conditions, etc., making it difficult for sewage treatment plants to accurately predict future water quality conditions. The monitoring data of sewage treatment plants has obvious time series characteristics. The data results at each time point are closely related to the data before that time point, and this point also has an impact on the points after that time point. This makes it difficult for traditional prediction methods to capture real-time information on water quality changes. There may be certain regularities in the data of seasons, months, or mid-week and weekends, but existing prediction methods often find it difficult to accurately capture these regularities, resulting in a large deviation between the prediction results and the actual water quality conditions.
[0045] Recurrent Neural Network (RNN) is a neural network used to process sequence data. Compared with general neural networks, it can process sequence-changing data. For example, the meaning of a word may have different meanings depending on the content mentioned above. RNN can solve this kind of problem well.
[0046] Long Short-Term Memory (LSTM) is a special RNN that is mainly used to solve the gradient vanishing and gradient exploding problems in the long sequence training process. Compared with ordinary RNN, LSTM can perform better in longer sequences. For sewage treatment plants, the time span from entry to exit of each component is very large, and there are long-distance dependencies. LSTM can handle the above situation and calculate the current point through the time series analysis of the previous point value and the corresponding feature to achieve the effect of filling / prediction.
[0047] At least to address the above-mentioned problems, the following embodiments of the present application provide a method, system, medium and electronic device for predicting sewage quality.
[0048] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application.
[0049] Figure 1 The following is a schematic diagram of the process of the sewage quality prediction method in one embodiment of the present application. Figure 1 As shown, the sewage quality prediction method includes:
[0050] S11, obtain the observed sewage target component data and the correlation characteristic data of the observed sewage target component data. The observed sewage target component data refers to the observed value of the sewage target component data, which is a specific component in the sewage data, and is a chemical or biological parameter that the sewage treatment plant needs to monitor and control during the treatment process. Exemplarily, the sewage target component data includes the flow (influent, reflux, sludge discharge, air volume, dosage), concentration (water quality, DO, MLSS,), frequency, switch quantity and other data monitored by the sewage treatment plant, and also includes organic pollutants (chemical oxygen demand, biochemical oxygen demand), nitrogen compounds (ammonia nitrogen, total nitrogen), phosphorus compounds (total phosphorus), other pollutants (suspended solids, heavy metals, organic pollutants), water quality parameters (PH value, dissolved oxygen, temperature, conductivity). Correlation characteristic data refers to other data sequences associated with sewage target component data.
[0051] In one embodiment of the present application, the correlation characteristic data includes inlet data, process quantity data, and time characteristic data. According to the periodicity of the sewage target component data, such as the daily sewage peak period, different sewage volumes in different quarters, etc., the time is divided into year / month / week / day / hour as different parameters. The outlet part uses inlet and process quantity as correlation characteristics. Since the inlet part of the water inlet needs to undergo multi-process processing in the sewage treatment plant, there is a certain time interval between the outlet part time and the inlet time corresponding to the inlet data at each time. Therefore, the inlet data needs to be shifted as a whole. The overall shift time can be a fixed 18h, but the present application is not limited to this.
[0052] S12, processing the abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain observed sewage time series data. The abnormal data includes abnormal points with a large change range relative to surrounding points, missing values, null values, etc.
[0053] S13, based on the observed sewage time series data, use the LSTM (Long Short-Term Memory) model to perform prediction to obtain the predicted sewage time series data. Since the LSTM model has high requirements for the stability of the time series, if only its own data is used to interpolate the prediction (that is, the LSTM model tends to bring the true value of the previous point into the prediction result as the predicted value of this point), the prediction result will be lagged. Therefore, adding correlation feature data to obtain the observed sewage time series data, and using the observed sewage time series data for prediction can greatly alleviate the lag of the LSTM model.
[0054] S14, using Kalman filtering to correct the predicted sewage time series data to obtain target sewage time series data.
[0055] According to the above description, the sewage quality prediction method provided by the present application can process the abnormal data in the observed sewage target component data to obtain the observed sewage time series data, and predict the observed sewage time series data through the LSTM model to obtain the predicted sewage time series, and can also use Kalman filtering to correct the predicted sewage time series data. The sewage quality prediction method of the present application improves the accuracy of sewage quality prediction.
[0056] Figure 2 The diagram shows a process of processing abnormal data in one embodiment of the present application. Figure 2 As shown, the process of processing the abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain the observed sewage time series data includes:
[0057] S21, performing data cleaning on the observed sewage target component data to remove abnormal values of the observed sewage target component data.
[0058] Figure 3 The interpolation effect is shown for the first predicted value of dissolved oxygen concentration (A_DO_1). Figure 3 As shown, several abnormal points have a large change range relative to the surrounding points, and their values are significantly larger than other points in the nearby five minutes, so they are removed as outliers.
[0059] S22, filling in the missing values of the observed sewage target component data after removing the outliers to obtain the observed sewage time series data.
[0060] Figure 4 The diagram shows a process of filling missing values of the target component data of the observed sewage after removing outliers in one embodiment of the present application. Figure 4 As shown, the process of filling the missing values of the observed sewage target component data after removing the outliers to obtain the observed sewage time series data includes:
[0061] S31, confirm the observed sewage target component data in the review period before the missing value. The review period can be set according to actual needs, for example, 3 or 5. The missing values of the observed sewage target component data after removing outliers include point missing values and continuous missing values. For point missing values within a time span, they are interpolated in chronological order to ensure that the sewage target component data and its correlation characteristic data in the review period are non-empty before the next missing value can be filled. The review period is the number of data selected forward for the missing value, and one data item corresponds to a unit of time interval.
[0062] Preferably, the process of estimating continuous missing values and null values includes: normalizing and slicing the observed sewage target component data after removing outliers, and then using the LSTM model to estimate the last value of each slice in sequence, and add it to the corresponding position, and perform the estimation in sequence until the final missing value and the corresponding position are obtained.
[0063] S32, input the observed sewage target component data and the corresponding correlation feature data of the review period into the LSTM model for filling, and obtain the observed sewage time series data. The LSTM model can be a unidirectional LSTM model or a bidirectional LSTM model. For most null values, there is data at the time point after this point, that is, for each missing point, there is not only forward information but also backward information. Therefore, a bidirectional LSTM (BiLSTM) can be used for filling. BiLSTM can use contextual information to better predict / fill the output of each time step in the sequence.
[0064] Figure 5 The filling effect is shown for the third predicted value of dissolved oxygen concentration (A_DO_3). Figure 5 As shown, A_DO_3 has a large number of abnormal continuous null values from January to April 2022. After the outliers are removed and cleaned, and the data such as year, month and day are used as correlation feature data, the continuous missing null values can be filled after training using the LSTM model.
[0065] Figure 6 The diagram shows a process diagram of obtaining predicted sewage time series data in one embodiment of the present application. Figure 6 As shown, based on the observed sewage time series data, the process of using the LSTM model to perform prediction to obtain predicted sewage time series data includes:
[0066] S41, based on the observed sewage time series data, using the LSTM model to perform prediction to obtain sewage target component data at a predicted time point.
[0067] S42, based on the observed sewage time series data and the sewage target component data at the predicted time point, using the LSTM model to perform prediction to obtain the sewage target component data at the next predicted time point.
[0068] S43, repeat S42 until the predicted sewage time series data from the prediction start point to the prediction end point is obtained.
[0069] Figure 7 The diagram shows a process diagram of obtaining sewage target component data at a predicted time point in one embodiment of the present application. Figure 7As shown, based on the observed sewage time series data, the process of using the LSTM model to perform prediction to obtain sewage target component data at the prediction time point includes:
[0070] S51, obtaining correlation feature data at a prediction time point. Since the correlation feature data at the prediction position is unknown, it is necessary to fill in the correlation feature data at the prediction position (prediction time point).
[0071] For example, the time is divided into parameters such as year, month, and day, and the influent data is shifted by 18 hours. The intermediate process volume is filled with the observed sewage target component data, that is, the data at the same time point within three days is used to fill in the data.
[0072] S52, based on the correlation feature data at the prediction time point and the observed sewage time series data, using the LSTM model to perform prediction to obtain the sewage target component data at the prediction time point.
[0073] Exemplarily, backward prediction is performed in chronological order, and the observed sewage time series data and the corresponding correlation feature data within a certain period of time before the prediction time point are input into the LSTM model for training and prediction, and the sewage target component data at the prediction time point is obtained. After the sewage target component data at the prediction time point is brought into the observed sewage time series data, the sewage target component data at the next prediction time point is predicted, and backward prediction is performed in chronological order until the sewage target component data at the prediction end point is obtained.
[0074] In the process of using the LSTM model for prediction, the input is the sewage target value and correlation features corresponding to the K points before the prediction time point, and the prediction is the sewage target value at the prediction time point. Since the correlation features at the prediction time point are unknown, the prediction results have obvious time periodicity. The actual components entering the sewage treatment plant in real time will also cause data fluctuations, generate interference and noise, and the prediction results at the prediction time point need to be corrected.
[0075] Figure 8 The figure shows a schematic diagram of the process of correcting the predicted sewage time series data using Kalman filtering in one embodiment of the present application. Figure 8 As shown, the process of using Kalman filtering to correct the predicted sewage time series data to obtain the target sewage time series data includes:
[0076] S61, generating a data structure of a corresponding position according to the predicted sewage time series data and the observed sewage time series data.
[0077] S62, based on the data structure, using Kalman filtering to perform point-by-point filtering correction from the prediction start point to the prediction end point to obtain the target sewage time series data. Kalman filtering can suppress useless signals and extract counts of useful signals from received signals containing interference, thereby removing interference in the predicted sewage target component data. Therefore, the predicted sewage target component data is optimally estimated.
[0078] Exemplarily, the prediction equation formula of Kalman filtering is as follows:
[0079] According to the state prediction equation Get the state prediction value
[0080] The forecast covariance matrix is expressed as:
[0081] The update equation of Kalman filtering is as follows:
[0082] Kalman gain matrix K under optimal estimation conditions k for:
[0083] According to the state update equation Get the best estimate of the state
[0084] The estimated error variance matrix is expressed as:
[0085] Among them, K k The Kalman gain represents the ratio of the model prediction error (Predicted error) to the measurement error (Measurement error) in the state optimal estimation process, x k is represented as the true value of the state, It is expressed as the predicted value of the state, also known as the a priori state estimate. It is expressed as the optimal estimate of the state, also called a posteriori state estimate, z k is expressed as the observation quantity of the state matrix, Expressed as the covariance between the true value and the predicted value, P k It is represented as the covariance between the true value and the optimal estimate, H is represented as the state observation matrix, A is represented as the state transfer matrix, B is represented as the control input matrix, and R is represented as the measurement error covariance.
[0086] Fig. 9 The display is a comparison chart before and after Kalman correction. Fig. 9As shown in the figure, Kalman filtering obviously pulls the original predicted data to the normal points before and after the missing data.
[0087] The following will specifically describe the sewage quality prediction method of the present application through an embodiment, and the specific implementation process is as follows:
[0088] The first step is to obtain observed sewage target component data and correlation characteristic data of the observed sewage target component data, wherein the correlation characteristic data includes influent data, process quantity data, and time characteristic data.
[0089] The second step is to process the abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain the observed sewage time series data. First, the abnormal data in the observed sewage target component data is cleaned to remove the abnormal points in the observed sewage target component data. Then, the point missing values in the observed sewage target component data are interpolated, and the continuous missing values and null values in the observed sewage target component data are filled. Based on the observed sewage target component data in the review period (within a certain time interval) and the corresponding correlation characteristic data, the unidirectional / bidirectional LSTM model is used for prediction to obtain the complete observed sewage time series data.
[0090] The third step is to use the LSTM model to predict based on the observed sewage time series data to obtain the predicted sewage time series data. Step A, fill in the correlation feature data at the prediction time point, and then use the LSTM model to predict based on the correlation feature data at the prediction time point and the observed sewage time series data to obtain the sewage target component data at the prediction time point. Step B, based on the sewage target component data at the prediction time point and the observed sewage time series data, use the LSTM model to predict the sewage target component data at the next prediction time point, and repeat step B in chronological order until the prediction time series data from the prediction start point to the prediction end point is obtained.
[0091] The fourth step is to use Kalman filtering to correct the predicted sewage time series data to obtain the target sewage time series data. Generate a data structure of the corresponding position based on the predicted sewage time series data and the observed sewage time series data. Based on the data structure of the corresponding position, use Kalman filtering to perform point-by-point filtering correction from the prediction start point to the prediction end point to remove interference in the predicted sewage target component data to obtain the target sewage time series data. The target sewage time series data is the optimal estimate of the predicted sewage target component data.
[0092] In summary, the sewage quality prediction method provided in the present application can process the abnormal data in the observed sewage target component data to obtain the observed sewage time series data, and predict the observed sewage time series data through the LSTM model to obtain the predicted sewage time series, and the predicted sewage time series data can also be corrected by Kalman filtering. The accuracy of sewage quality prediction is improved by data cleaning of abnormal data, high-precision prediction of LSTM model and correction of data by Kalman filtering. Through accurate prediction, sewage treatment plants can more accurately control energy consumption and reduce unnecessary energy consumption. They can also guide the precise delivery of drugs, reduce excessive use, reduce costs and reduce negative impacts on the environment. By predicting sewage quality, water quality anomalies can be discovered in advance, enabling sewage treatment plants to respond quickly, take measures to avoid or reduce the impact of pollution incidents, and improve the efficiency of responding to emergencies.
[0093] The protection scope of the sewage water quality prediction method described in the embodiment of the present application is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0094] The embodiment of the present application also provides a sewage water quality prediction system, which can implement the sewage water quality prediction method described in the present application, but the implementation device of the sewage water quality prediction method described in the present application includes but is not limited to the structure of the sewage water quality prediction system listed in the present embodiment. All structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0095] Fig.10 The diagram shows a schematic diagram of the structure of a sewage quality prediction system in one embodiment of the present application. Fig.10 As shown, the sewage water quality prediction system 1 includes: a data acquisition module 11, an abnormal data processing module 12, a prediction module 13, and a correction module 14. Among them, the data acquisition module 11 is used to obtain the observed sewage target component data and the correlation characteristic data of the observed sewage target component data. The abnormal data processing module 12 is used to process the abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain the observed sewage time series data. The prediction module 13 is used to predict based on the observed sewage time series data using the LSTM model to obtain the predicted sewage time series data. The correction module 14 is used to correct the predicted sewage time series data using the Kalman filter to obtain the target sewage time series data.
[0096] It should be noted that Fig.10 The modules in the sewage quality prediction system 1 are shown in FIG. Figure 1The steps in the sewage quality prediction method correspond to each other and will not be repeated here.
[0097] In the several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.
[0098] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0099] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0100] The present application embodiment also provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by the processor to implement the sewage water quality prediction method provided by the present application embodiment. It can be understood by ordinary technicians in this field that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid-state hard disk (solidstate disk, SSD)), etc.
[0101] The embodiment of the present application may also provide an electronic device. Fig.11 The diagram shows a schematic diagram of the structure of an electronic device 2 in an embodiment of the present application. Fig.11 As shown, in this embodiment, the electronic device 2 includes a memory 21 and a processor 22 .
[0102] The memory 21 is used to store computer programs. In some possible implementations, the memory 21 may include: ROM, RAM, a disk, a USB flash drive, a memory card, or an optical disk, etc., various media that can store program codes.
[0103] In the embodiment of the present application, the memory 21 may include a computer system readable medium in the form of a volatile memory, such as a RAM and / or a cache memory. The electronic device 2 may further include other removable / non-removable, volatile / non-volatile computer system storage media. The memory 21 may include at least one program product having a set (e.g., at least one) of program modules, which are configured to perform the functions of the various embodiments of the present application.
[0104] The processor 22 is connected to the memory 21 and is used to execute the computer program stored in the memory 21 so that the electronic device 2 executes the sewage quality prediction method.
[0105] Exemplarily, the processor 22 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. In other embodiments, the processor 22 may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0106] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0107] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A method for predicting sewage quality, characterized in that: The sewage quality prediction method comprises: Obtaining observed sewage target component data and correlation characteristic data of the observed sewage target component data; Processing the abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain observed sewage time series data; Based on the observed sewage time series data, using the LSTM model to perform prediction to obtain predicted sewage time series data; The predicted sewage time series data is corrected using Kalman filtering to obtain target sewage time series data.
2. The method for predicting sewage quality according to claim 1, characterized in that: The process of processing the abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain the observed sewage time series data includes: Performing data cleaning on the observed sewage target component data to remove abnormal values of the observed sewage target component data; The missing values of the observed sewage target component data after removing outliers are filled to obtain the observed sewage time series data.
3. The method for predicting sewage quality according to claim 2, characterized in that: The process of filling the missing values of the observed sewage target component data after removing the outliers to obtain the observed sewage time series data includes: Observed sewage target component data for the look-back period before confirming missing values; The observed sewage target component data and the corresponding correlation feature data of the review period are input into the LSTM model for filling to obtain the observed sewage time series data.
4. The method for predicting sewage quality according to claim 1, characterized in that: Based on the observed sewage time series data, the process of using the LSTM model to perform prediction to obtain predicted sewage time series data includes: Step 1: Based on the observed sewage time series data, the LSTM model is used to perform prediction to obtain sewage target component data at a predicted time point; Step 2: Based on the observed sewage time series data and the sewage target component data at the predicted time point, the LSTM model is used to perform prediction to obtain the sewage target component data at the next predicted time point; Repeat step 2 until the predicted sewage time series data from the prediction start point to the prediction end point is obtained.
5. The method for predicting sewage quality according to claim 4, characterized in that: Based on the observed sewage time series data, the process of using the LSTM model to perform prediction to obtain sewage target component data at a prediction time point includes: Obtain correlation feature data at the prediction time point; Based on the correlation characteristic data at the prediction time point and the observed sewage time series data, the LSTM model is used to perform prediction to obtain the sewage target component data at the prediction time point.
6. The method for predicting sewage quality according to claim 1, characterized in that: The correlation characteristic data includes water inlet data, process quantity data, and time characteristic data.
7. The method for predicting sewage quality according to claim 1, characterized in that: The process of using Kalman filtering to correct the predicted sewage time series data to obtain target sewage time series data includes: Generate a data structure of a corresponding position according to the predicted sewage time series data and the observed sewage time series data; Based on the data structure, Kalman filtering is used to perform point-by-point filtering correction from the prediction start point to the prediction end point to obtain the target sewage time series data.
8. A sewage quality prediction system, characterized in that: The sewage quality prediction system comprises: A data acquisition module, used to acquire observed sewage target component data and correlation characteristic data of the observed sewage target component data; An abnormal data processing module, used for processing the abnormal data of the observed sewage target component data based on the correlation characteristic data to obtain observed sewage time series data; A prediction module, used for performing prediction based on the observed sewage time series data using an LSTM model to obtain predicted sewage time series data; The correction module is used to correct the predicted sewage time series data using Kalman filtering to obtain target sewage time series data.
9. An electronic device, characterized in that: The electronic device comprises: a memory having a computer program stored thereon; A processor is communicatively connected to the memory and is used to execute the computer program to implement the sewage water quality prediction method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by an electronic device, the sewage water quality prediction method according to any one of claims 1 to 7 is implemented.