Sewage layered prediction monitoring system and method
By installing multi-parameter sensors in the sewage treatment pool and building a GRU model, the sewage stratification situation is predicted in real time, which solves the problem that traditional sewage treatment methods cannot be dynamically adjusted, and improves the treatment efficiency and effect.
Patent Information
- Application Number
- CN202510305613.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-27
AI Technical Summary
Traditional sewage treatment methods cannot be dynamically adjusted based on real-time water quality data, resulting in inefficient treatment and may affect the normal use of subsequent sewage.
Build a sewage layered prediction and monitoring system, and use multi-parameter sensors to collect data in real time by installing multi-parameter sensors in the sewage treatment pool, dimensionality reduction using PCA algorithm, and constructing a GRU model to predict pollutant concentrations to achieve real-time prediction and dynamic adjustment.
Effectively predict the sewage stratification, improve the efficiency and effectiveness of sewage treatment, meet the targeted treatment needs of sewage, and ensure that the treated sewage can meet the requirements of reasonable discharge and subsequent use.
Smart Images

Figure CN120220890A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sewage treatment systems, and specifically to a sewage stratification prediction and monitoring system and method. Background Art
[0002] Because a large amount of sewage is generated in daily life operations, and in the urban environment, in order to better maintain production and life, it is necessary to treat sewage in a timely manner so as to ensure that the sewage will not affect people's production and life. When treating sewage, it is also necessary to consider the subsequent use requirements of the sewage, that is, the treated sewage can meet reasonable discharge and can be used in some specific fields, so sewage treatment needs to be more scientific. At present, most sewage treatment methods require multiple sedimentation tanks, that is, after static sedimentation, the sewage is decomposed by aerobic bacteria and anaerobic bacteria, and then the sewage is sedimented and filtered for discharge, so that the harmful substances in the purified sewage will be greatly reduced. Therefore, during the sewage treatment process, the stratification phenomenon is a very important issue, because under normal circumstances, the concentration content of a certain unit at a certain depth position within a specified time is consistent, that is, there are significant differences in parameters such as pollutant concentration, temperature, pH value, etc. in different water layers, and these differences directly affect the sewage treatment effect. Traditional sewage treatment methods usually rely on fixed treatment processes and cannot be dynamically adjusted according to real-time water quality data, resulting in low treatment efficiency and may also affect the normal use of subsequent sewage, thus not meeting the sewage treatment operation requirements.
[0003] Therefore, it is necessary to build a sewage stratification prediction and monitoring system and method that can predict the sewage stratification situation in real time and perform model training, so that it can effectively predict the sewage stratification situation to meet the targeted sewage treatment method. Summary of the Invention
[0004] The purpose of the present invention is to provide a sewage stratification prediction and monitoring system and method that can predict the sewage stratification situation in real time and perform model training, so that it can effectively predict the sewage stratification situation to meet the targeted sewage treatment method.
[0005] To achieve the above object, the present invention is realized through the following technical solutions:
[0006] A sewage stratification prediction and monitoring system and method includes the following steps:
[0007] S1, install multi-parameter sensors in the sewage treatment tank, collect water quality data in real time, and use the Pandas library of Python to clean and normalize the data;
[0008] S2. After processing the obtained data, the data features are dimensionally reduced by the PCA algorithm, and the main features of the sewage stratification are retained, that is, m samples are input, and the data set with the number of features being n, where m samples represent the sample types and n is the specific data information of the sample types:
[0009] X = {x1, x2... x m}
[0010] And the data set is dimensionally reduced; the sample set is denoted as matrix X:
[0011]
[0012] where each row represents each sample and each column represents a feature, with a total of n dimensions,
[0013] Output the dimensionally reduced sample set: Y = {y1, y2... y m};
[0014] S3. Construct a GRU model with the main data features. The input is time series data, and the output is the predicted values of the pollutant concentrations in different water layers, that is:
[0015]
[0016] Here, Y is the dimensionally reduced sample set, μ is the mean of each feature, and σ is the standard deviation of each feature;
[0017] S4. Deploy the trained model to the edge computer device to achieve real-time prediction.
[0018] The steps of using the PCA algorithm to reduce the temperature of the data features in S2 include the following:
[0019] S21. For the new matrix X obtained by decentralizing the matrix, that is, zero-mean each column, that is, subtract the mean of this column
[0020]
[0021] The required matrix X is still an m- and n-order matrix:
[0022]
[0023] S22. Calculate the covariance matrix C of the decentralized matrix X:
[0024]
[0025] This matrix is an n×n-order matrix;
[0026] S23. Perform eigen decomposition on the covariance matrix C to find the eigenvalues of the covariance matrix and the corresponding eigenvector θ k :
[0027]
[0028] S24. Arrange the eigenvectors in descending order by columns from left to right according to the corresponding eigenvalues to form a matrix, and take the first k columns to form a matrix W, that is, an n×k order matrix;
[0029] S25. Calculate the sample features after dimensionality reduction to k dimensions through Y = XW, that is, an m×k order matrix, so as to obtain the sample features of the sample set Y after dimensionality reduction.
[0030] The GRU model includes an update gate, a reset gate, a candidate hidden state, and a current hidden state;
[0031] Update gate z t :
[0032] z t = σ(E Z [h t-1 , x t +b z )
[0033] where h t-1 is the hidden state of the previous time step; x t is the input of the current time step; E Z , b z are the weights and biases of the update gate; σ is the sigmoid activation function;
[0034] Reset gate r t :
[0035]
[0036] where E r , b r are the weights and biases of the reset gate;
[0037] Candidate hidden state
[0038]
[0039] where E h , b j are the weights and biases of the candidate hidden state;
[0040] Current hidden state h t :
[0041]
[0042] The hidden state h at the last time step of GRUt As the feature representation of the entire time series.
[0043] Compared with the prior art, the beneficial effects of the present invention are:
[0044] In this system method, multi-parameter sensors are installed in the sewage treatment pool to collect data. After the data is cleaned and normalized, the PCA algorithm is used to reduce the dimension of the data, and a sample set that can be used for subsequent model construction is screened. After the sample set is constructed, the sample set of the main data is used to construct a GRU model. The input is time series data, and the output is the predicted value of pollutant concentration in different water layers. The algorithm formed can be used to predict the change of pollution values in the sewage pool, so that the staff can treat the sewage in a targeted manner according to the predicted direction to maximize the sewage treatment effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Attached Figure 1 It is a schematic diagram of the flow chart of the system method of the present invention. DETAILED DESCRIPTION
[0046] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the application equally.
[0047] In the process of sewage treatment, stratification is a very important issue, because under normal circumstances, the concentration of a certain unit at a certain depth is consistent within a specified time, that is, there are significant differences in parameters such as pollutant concentration, temperature, pH value, etc. in different water layers, and these differences directly affect the effect of sewage treatment. Traditional sewage treatment methods usually rely on fixed treatment processes and cannot be dynamically adjusted according to real-time water quality data, resulting in low treatment efficiency and may also affect the normal use of subsequent sewage, thereby failing to meet the sewage treatment operation requirements.
[0048] Therefore, according to the above technical problems, a sewage stratification prediction monitoring system and method are set up, including the following steps:
[0049] S1. Install multi-parameter sensors in the sewage treatment pool to collect water quality data in real time, and use the Pandas library in Python to clean and normalize the data. When collecting data here, since a large amount of data needs to be collected, the multi-parameter sensors installed here need to collect samples of various data. The most important factors, such as temperature, pH value, and the chemical composition of specific sewage, all need to be collected using multi-parameter sensors to facilitate subsequent data processing.
[0050] S2. After processing the obtained data, use the PCA algorithm to reduce the dimensionality of the data features, retaining the main features of sewage stratification. That is, input a dataset with m samples and n features, where m samples represent sample types and n is the specific data information of the sample type: Here, m represents sample types, such as temperature, pH, pollutants, etc., and n represents the specific data information of the sample type, such as specific temperature values, specific pH data, pollutant concentrations, etc. Since there are many types represented by m and the features included in m in different scenarios are different, only examples are given here and cannot fully represent their specific sample features.
[0051] X = {x1, x2……x m}
[0052] And reduce the dimensionality of this dataset. Denote the sample set as matrix X:
[0053]
[0054] Where each row represents each sample, each column represents a feature, with a total of n dimensions.
[0055] Output the sample set after dimensionality reduction: Y = {y1, y2……y m}. After the obtained sample set is dimensionally reduced here, the data is processed through linear transformation, so that while reducing the dimensionality while retaining the sample information in the sewage, the amount of information lost is reduced to as little as possible, so that the data between dimensionality reduction and model building is more accurate to ensure the accuracy of subsequent sewage stratification sample data.
[0056] S3. Construct a GRU model with the main data features, with the input being time series data and the output being the predicted values of pollutant concentrations in different water layers, that is:
[0057]
[0058] Here, Y is the sample set after dimensionality reduction, μ is the mean of each feature, and σ is the standard deviation of each feature; for the above formula, gastritis is the GRU standard formula, where Y is the sample set after dimensionality reduction. There are multiple samples in the sample set. At the same time, each sample contains t time steps, and each time step has p features. For example, pollutants such as U shields and no difficulty, etc. Therefore, the standard formula here is a representative formula, and the specific corresponding model construction is as follows.
[0059] S4. Deploy the trained model to the edge computer device to achieve real-time prediction.
[0060] The following explanations are made for the PCA algorithm:
[0061] The steps of using the PCA algorithm to reduce the temperature of data features in S2 include the following:
[0062] S21. For the new matrix X obtained by decentralizing the matrix, that is, zero-mean each column, that is, subtract the mean of this column.
[0063]
[0064] The required matrix X is still an m and n-order matrix:
[0065]
[0066] S22. Calculate the covariance matrix C of the decentralized matrix X:
[0067]
[0068] This matrix is an n×n-order matrix;
[0069] S23. Perform eigen-decomposition on the covariance matrix C to find the eigenvalues of the covariance matrix and the corresponding eigenvectors θ k :
[0070]
[0071] S24. Arrange the eigenvectors in descending order of the corresponding eigenvalues from left to right by column to form a matrix, and take the first k columns to form a matrix W, that is, an n×k-order matrix;
[0072] S25. Calculate the sample features after dimensionality reduction to k dimensions through Y = XW, that is, an m×k matrix, so as to obtain the sample features of the sample set Y after dimensionality reduction. For the above PCA algorithm, its purpose is to reduce the dimensionality of the obtained sample data, so that the specific information of the sample data at different times is represented in the form of the same coordinate axis, making it more intuitive and convenient for subsequent model construction. For the above steps, matrix construction is carried out in terms of dimensions, and matrix construction is carried out successively with different coordinate axes, so as to achieve the purpose of reducing the dimensionality of the data.
[0073] The following explanations are made for the specific composition and model construction of the GRU model:
[0074] The GRU model includes an update gate, a reset gate, a candidate hidden state, and a current hidden state;
[0075] Update gate z t :
[0076] z t = σ(E z [h t-1 , x t +b z )
[0077] Among them, h t-1 is the hidden state of the previous time step; x t is the input of the current time step; E Z , b z are the weights and biases of the update gate; σ is the sigmoid activation function; the role of the update gate is to determine how much information of the hidden state of the previous time step needs to be retained at the time step. For example, when obtaining the information of a certain temperature of sewage, other data need to be excluded because other data have no influence on the temperature;
[0078] Reset gate r t :
[0079] r t = σ(E r [h t-1 , x t +b r )
[0080] Among them, E r , b ris to reset the weights and biases of the gate; the reset gate determines to what extent the hidden state at the previous time step is ignored. For example, a microorganism itself does not affect the temperature, but the heat generated during aerobic or anaerobic respiration by a large number of microorganisms will affect the local temperature. So when the output of the reset gate is close to 0, the model tends to "forget" the information at the previous time step and rely only on the current output; while when the output is close to 1, more information from the previous time step will be retained;
[0081] Candidate hidden state
[0082]
[0083] Among them, E h , b h are the weights and biases of the candidate hidden state; r t *h t-1 represents combining the hidden state h t-1 at the previous time step with the reset gate r t to control the degree of its influence. GRU uses the reset gate to control the degree of dependence on the previous hidden state and calculates the candidate hidden state, which is an intermediate state;
[0084] The current hidden state h t :
[0085]
[0086] At the last time step of GRU, the hidden state h t serves as the feature representation of the entire time series. (1 - z t ) * h t-1 represents the retained historical information, new information. In sewage treatment, it represents the historical information that needs to be calculated and retained in the previous stage, which is accumulated with the new information, so as to represent the data that needs to be calculated and accumulated in the sewage at the previous time plus the subsequent information data, in order to realize the real-time change of this data in the subsequent sewage.
[0087] Therefore, the construction of a sewage stratification prediction and monitoring system and method can predict the sewage stratification situation in real time and conduct model training, enabling it to effectively predict the sewage stratification situation to meet the targeted sewage treatment methods.
Claims
1. A system and method for predicting and monitoring sewage stratification, characterized in that: The steps include: S1, install multi-parameter sensors in the sewage treatment pool to collect water quality data in real time, and use Python's Pandas library to clean and normalize the data; S2, after processing the obtained data, the PCA algorithm is used to reduce the dimension of the data features and retain the main features of the sewage stratification, that is, input m samples and a data set with n features, where m samples represent sample types and n is the specific data information of the sample type: X={x1,x2……x m } And reduce the dimension of the data set; the sample set is recorded as matrix X: Each row represents a sample, and each column represents a feature, with a total of n dimensions. Output the sample set after dimensionality reduction: Y = {y1, y2...y m }; S3, constructs a GRU model with the main data features, with the input as time series data and the output as the predicted values of pollutant concentrations in different water layers, namely: Here, Y is the sample set after dimensionality reduction, μ is the mean of each feature, and σ is the standard deviation of each feature; S4 deploys the trained model to edge computer devices to achieve real-time prediction.
2. A sewage stratification prediction monitoring system and method according to claim 1, characterized in that: The step of using the PCA algorithm to cool down the data features in S2 includes the following: S21, the new matrix X obtained by decentralizing the matrix, that is, zero-meaning each column, that is, subtracting the mean of this column The required matrix X is still an m- and n-order matrix: S22, calculate the covariance matrix C of the decentralized matrix X: The matrix is an n×n matrix; S23, perform eigendecomposition on the covariance matrix C and find the eigenvalues of the covariance matrix and the corresponding eigenvector S24, arranging the eigenvectors in descending order from left to right according to the corresponding eigenvalues into a matrix, taking the first k columns to form a matrix W, that is, an n×k-order matrix; S25, calculating the sample features after dimension reduction to k dimensions, that is, an m×k-order matrix, through Y=XW, thereby obtaining the sample features of the sample set Y after dimension reduction.
3. A sewage stratification prediction monitoring system and method according to claim 1, characterized in that: The GRU model includes an update gate, a reset gate, a candidate hidden state, and a current hidden state; Update gate z t : z t =σ(E z [h t-1 ,x t ]+b z ) Among them, h t-1 is the hidden state of the previous time section; x t is the input of the current time section; E Z 、b z are the weights and biases of the update gate; σ is the sigmoid activation function; Reset Gate t : r t =σ(E r [h t-1 ,x t ]+b r ) Where E r 、b r is to reset the weights and biases of the gate; Candidate hidden states Among them, E h 、b h are the weights and biases of the candidate hidden states; Current hidden state h t : The hidden state h in the last time step of GRU t As the feature representation of the entire time series.