A method and apparatus for monitoring the concentration of orthophosphorus in effluent water that is resistant to analyzer bias

By using a dynamic Markov random field model and Kalman filtering algorithm, combined with wastewater treatment process parameters, the effluent orthophosphorus concentration was calibrated, solving the problem of measurement distortion of online analyzers at low concentrations and achieving accurate monitoring of effluent orthophosphorus concentration and reliable reagent adjustment.

CN120741366BActive Publication Date: 2026-01-02SHANGHAI ENVIRONMENT PROTECTION GROUP +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511262822.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-05
Publication Date
2026-01-02
Estimated Expiration
2045-09-05

AI Technical Summary

Technical Problem

Existing online analyzers are susceptible to noise and background noise when monitoring orthophosphate concentration in effluent at low concentrations, resulting in measurement distortion and making it impossible to accurately monitor orthophosphate concentration in effluent.

Method used

A dynamic Markov random field model combined with a Kalman filter algorithm is used to construct a state space vector using key operating parameters in the wastewater treatment process, predict the prior probability distribution of orthophosphorus concentration in the effluent, and calibrate the orthophosphorus concentration in the effluent by fusing prior and observed values ​​through Kalman filtering when the analyzer has low accuracy.

Benefits of technology

It improves the accuracy and stability of effluent orthophosphate concentration detection, reduces the impact of analyzer measurement deviation, ensures the reliability of reagent adjustment, and can promptly detect analyzer drift, adapt to process changes, and enhance the long-term stability and applicability of the monitoring system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120741366B_ABST
    Figure CN120741366B_ABST
Patent Text Reader

Abstract

The application discloses a method and a device for monitoring effluent orthophosphate concentration and resisting analyzer deviation, and relates to the technical field of sewage treatment. In the method, the monitoring device firstly constructs a state space vector according to operation parameters in a sewage phosphorus removal process, and then constructs a dynamic Markov random field model by taking a true value of effluent orthophosphate concentration as a hidden state variable and the state space vector as an observation variable. After predicting a prior probability distribution based on the model and a historical sequence, when the measurement value of the analyzer is lower than a precision threshold value, the prior probability distribution and the observation value are fused by using a Kalman filtering algorithm to obtain a calibrated concentration value and output the calibrated concentration value to a control system to guide reagent adjustment. In this way, the accuracy and reliability of detection of the effluent orthophosphate concentration are improved when the orthophosphate concentration in the effluent water sample is extremely low.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of sewage treatment, and in particular to a method and device for monitoring effluent orthophosphorus concentration with resistance to analyzer deviation. BACKGROUND

[0002] Modern sewage treatment plants are accelerating the transformation and upgrading to the intelligent water plant mode. The core of this mode is to use automation technology and information technology to realize accurate perception and intelligent control of the whole process of sewage treatment. Among them, the accurate monitoring of the effluent orthophosphorus concentration is the key link to realize accurate dosing of phosphorus removal reagents, ensure that the effluent meets the standards, and optimize the operation cost.

[0003] In related technologies, an online orthophosphate analyzer is generally installed at the end of the sewage treatment process to monitor the effluent orthophosphorus concentration. This type of online analyzer is usually based on the principle of chemical colorimetry. It automatically extracts the effluent water sample through the built-in micro pump group, and injects a color developing agent (such as ammonium molybdate) and a reducing agent (such as ascorbic acid) into it. The injected reagents react with the orthophosphate in the effluent water sample to form a colored complex (such as molybdenum blue). The online analyzer measures the degree of absorption of a specific wavelength of light by the effluent water sample after the injection of the reagent, i.e. the absorbance, through a light source and a photodetector, and then converts the absorbance to a concentration value according to a pre-set calibration curve. The concentration value is finally output to the central control system in the form of a standard electrical signal as a feedback signal to directly guide and regulate the dosage of the upstream phosphorus removal reagent.

[0004] However, when the orthophosphate concentration in the effluent water sample is extremely low, the amount of colored complex generated by the reaction between the injected reagent and the orthophosphate in the effluent water sample is also extremely small. At this time, the background noise composed of factors such as the inherent electronic noise of the instrument's photoelectric device, the residual small turbidity or bubbles in the water sample, and the blank value of the reagent itself, is strong enough to be the same as or even stronger than the true signal strength, causing the measured effluent orthophosphorus concentration of the online analyzer to be distorted. SUMMARY

[0005] The present application provides a method and device for monitoring effluent orthophosphorus concentration with resistance to analyzer deviation, which can improve the accuracy of effluent orthophosphorus concentration detection when the orthophosphate concentration in the effluent water sample is extremely low.

[0006] In a first aspect, a method for monitoring effluent orthophosphate concentration against analyzer bias is provided. The method is applied to a monitoring device and includes: constructing a state space vector by the monitoring device based on operating parameters in a phosphorus removal process, the operating parameters including at least influent orthophosphate concentration, phosphorus removal agent dosage, influent flow rate, dissolved oxygen concentration in a reaction tank, and pH value; constructing a dynamic Markov random field model by the monitoring device based on a true value of effluent orthophosphate concentration as a hidden state variable and the state space vector as an observation variable; predicting, by the monitoring device, a prior probability distribution of the true value of effluent orthophosphate concentration based on the dynamic Markov random field model and a historical sequence of state space vectors; when an analyzer-measured value of effluent orthophosphate concentration is less than a preset analyzer accuracy threshold, calculating, by the monitoring device, an optimal posterior estimation value of effluent orthophosphate concentration at a current time as a calibrated concentration value of effluent orthophosphate concentration by a Kalman filtering algorithm, the Kalman filtering algorithm taking a mean and a variance of the prior probability distribution as prior estimation parameters of the Kalman filtering algorithm and taking the analyzer-measured value of effluent orthophosphate concentration as an observation input of the Kalman filtering algorithm, the optimal posterior estimation value being a weighted fusion result of the mean of the prior probability distribution and the analyzer-measured value; and outputting, by the monitoring device, the calibrated concentration value to a wastewater treatment control system of a water plant for guiding adjustment of the phosphorus removal agent dosage.

[0007] By adopting the above technical solution, the monitoring device constructs a state space vector based on influent orthophosphate concentration, agent dosage and other key operating parameters, thereby providing multi-dimensional input for the model. Then, a dynamic Markov random field model is constructed based on a true value of effluent orthophosphate as a hidden state variable, thereby capturing dynamic correlations between variables. In combination with a historical sequence, a prior distribution is predicted, and when the analyzer has low accuracy, a calibrated concentration value is obtained by fusing the prior distribution and an observation value by a Kalman filtering algorithm. These technical features cooperate with each other to improve the accuracy of effluent orthophosphate concentration detection when the orthophosphate concentration in the effluent sample is extremely low, thereby providing a reliable basis for agent adjustment and improving the accuracy and stability of effluent orthophosphate concentration monitoring.

[0008] In some embodiments of the first aspect, in some embodiments, the monitoring device constructs a state space vector based on the operating parameters in the phosphorus removal process of the wastewater, specifically comprising: the monitoring device acquires operating parameters in the phosphorus removal process of the wastewater, the operating parameters at least including influent orthophosphorus concentration, phosphorus removal agent dosage, influent flow rate, dissolved oxygen concentration in the reaction tank, and pH value; the monitoring device marks operating parameters exceeding the preset normal range as abnormal data, the preset normal range being determined by the mean value plus or minus three times the standard deviation of the historical data of the corresponding operating parameters of the water plant wastewater treatment control system within a preset time; the monitoring device replaces the abnormal data using a weighted moving average method based on five adjacent effective data points, wherein the weight of the adjacent data points decays exponentially with the distance from the abnormal data; the monitoring device maps the operating parameters after abnormal data processing to the [0, 1] interval respectively to obtain standardized operating parameters; and the monitoring device performs weighted combination on the standardized operating parameters according to a preset parameter weight matrix to construct a state space vector, the weight of the influent orthophosphorus concentration and the phosphorus removal agent dosage in the preset parameter weight matrix being higher than the weight of other operating parameters.

[0009] By using the above technical solution, the monitoring device first marks abnormal operating parameters exceeding the 3σ range, and then replaces the abnormal values with a weighted moving average method (the weight decays exponentially with the distance), thereby reducing data noise. The state space vector is constructed by standardization and weighted combination (the weight of the influent orthophosphorus and the phosphorus removal agent dosage is higher). These steps of layer-by-layer processing make the abnormal data reasonably corrected, the parameter dimension unified, the core parameters prominent, and the state space vector can more accurately represent the state of the phosphorus removal process, thereby improving the reliability and effectiveness of the model input data.

[0010] In some embodiments of the first aspect, in some embodiments, the monitoring device constructs a dynamic Markov random field model by taking the true value of the effluent orthophosphorus concentration as the hidden state variable and taking the state space vector as the observation variable, specifically comprising: the monitoring device takes the true value of the effluent orthophosphorus concentration as the hidden state variable; the monitoring device describes the dependency relationship between adjacent time points of the hidden state variable through a transition potential function; the monitoring device establishes an observation potential function between the hidden state variable and the state space vector; when the fluctuation of the influent orthophosphorus concentration in the observation potential function in the state space vector is greater than a preset fluctuation threshold, the observation potential function reduces the dependency weight of the influent orthophosphorus concentration parameter; based on a historical state space vector sequence and corresponding historical measured values of the effluent orthophosphorus concentration within a preset time, the monitoring device estimates the initial parameters of the dynamic Markov random field model using a maximum pseudo-likelihood estimation method; the monitoring device divides the historical data into a training set and a validation set in chronological order by a cross-validation method; and the monitoring device adjusts the model parameters to minimize the prediction error on the validation set to construct the dynamic Markov random field model.

[0011] By adopting the technical solution, the monitoring device takes the real value of the effluent orthophosphorus as a hidden state variable, uses a transition potential function to describe the time sequence dependence, and uses an observation potential function to associate the hidden state and the state space vector, and reduces the weight when the influent orthophosphorus fluctuates greatly. The parameters are estimated by maximum pseudo-likelihood estimation combined with historical data, and are optimized through cross-validation. These designs enable the model to dynamically adapt to influent fluctuations, more accurate parameter estimation, and enhanced adaptability to complex operating conditions, improving the accuracy of hidden state prediction.

[0012] In combination with some embodiments of the first aspect, in some embodiments, the monitoring device predicts the prior probability distribution of the real value of the effluent orthophosphorus concentration based on the dynamic Markov random field model and the historical state space vector sequence, specifically including: the monitoring device extracts the state space vector sequence of the latest preset time window from the historical state space vector sequence; the monitoring device calculates the probability of the hidden state variable at each possible value based on the extracted state space vector sequence and the dynamic Markov random field model; the monitoring device determines the prior probability distribution of the real value of the effluent orthophosphorus concentration according to the calculated probability; and the monitoring device uses a Gaussian kernel function to perform convolution operation on the probability distribution curve constituted by the prior probability distribution, to eliminate the jagged fluctuations in the probability distribution.

[0013] By adopting the technical solution, the monitoring device extracts the historical state space vector sequence of the latest time window, calculates the probability of each value of the hidden state variable based on the dynamic Markov random field model, and smoothes the prior distribution using a Gaussian kernel function. The time window extraction ensures data timeliness, the probability calculation combined with the model characteristics ensures the rationality of the distribution, and the smoothing processing eliminates the jagged fluctuations. These steps cooperate with each other to make the prior probability distribution more consistent with the real state distribution, improving the accuracy of the subsequent optimal posterior estimation.

[0014] In some embodiments of the first aspect, in some embodiments, when the effluent orthophosphorus concentration value measured by the analyzer is less than the preset analyzer accuracy threshold, the monitoring device calculates the optimal posterior estimation value of the effluent orthophosphorus concentration at the current time as the calibration concentration value of the effluent orthophosphorus concentration by using the Kalman filtering algorithm, specifically including: the monitoring device takes the mean and variance of the prior probability distribution predicted by the dynamic Markov random field model as the prior estimation mean and prior estimation covariance of the Kalman filtering algorithm; the monitoring device takes the analyzer measurement value after high-frequency noise removal processing as the observation input value; when the fluctuation degree of the observation input value is greater than the preset fluctuation degree threshold, the monitoring device increases the value of the observation noise variance parameter, which is used to represent the reliability of the observation input value; the monitoring device calculates the Kalman gain at the current time based on the prior estimation covariance and the observation noise variance parameter, and the Kalman gain is the weight of the observation input value; the monitoring device weights and fuses the prior estimation mean and the observation input value according to the Kalman gain to calculate the initial optimal posterior estimation value of the effluent orthophosphorus concentration at the current time, and updates the posterior estimation covariance corresponding to the initial optimal posterior estimation value; when the posterior estimation covariance is greater than the preset covariance threshold, the monitoring device takes the initial optimal posterior estimation value and the posterior estimation covariance as the new prior input, and starts the secondary filtering iteration optimal posterior estimation value with the observation input value at the same time; when the posterior estimation covariance is less than or equal to the preset covariance threshold, the monitoring device takes the optimal posterior estimation value as the calibration concentration value of the effluent orthophosphorus concentration.

[0015] By using the above technical solution, the monitoring device takes the mean and variance of the prior distribution as the Kalman filtering prior parameters, increases the observation noise variance when the observation value fluctuates greatly, calculates the Kalman gain and weights and fuses to obtain the initial posterior estimation, and iterates twice when the posterior covariance exceeds the threshold. These steps dynamically adjust the observation weight, reduce the uncertainty through iterative optimization, make the optimal posterior estimation value at low concentration more robust, weaken the influence of analyzer measurement deviation, and improve the reliability of the calibration concentration value.

[0016] In some embodiments of the first aspect, after the step of the monitoring device taking the optimal posterior estimation value as the calibrated concentration value of the effluent orthophosphorus concentration when the posterior estimation covariance is less than or equal to the preset covariance threshold, the method further comprises: the monitoring device calculating a deviation value between the calibrated concentration value and the effluent orthophosphorus concentration value measured by the analyzer; the monitoring device calculating a deviation mean and a deviation standard deviation of the deviation values within a preset time; the monitoring device determining a deviation warning threshold according to the deviation mean and the deviation standard deviation; when the deviation value exceeds the deviation warning threshold, the monitoring device marking the deviation value as suspicious data; when the suspicious data appears continuously for a preset number of times, the monitoring device calculating a deviation change rate of the suspicious data for the preset number of times; when the deviation change rate is greater than a preset change rate threshold, the monitoring device determining that the analyzer has drift; and when the analyzer has drift, the monitoring device sending an analyzer calibration prompt signal to the water plant sewage treatment control system.

[0017] By using the above technical solution, the monitoring device calculates the deviation between the calibrated value and the measurement value of the analyzer, calculates the mean and standard deviation to determine the warning threshold, and marks the suspicious data exceeding the threshold. When the suspicious data appears continuously, the deviation change rate is calculated, and when the threshold is exceeded, the analyzer drift is determined and a calibration prompt is sent. These steps form a complete logic of deviation monitoring-suspicious data identification-drift determination, which enables the degradation of the analyzer performance to be found, provides a basis for equipment maintenance, avoids long-term reliance on deviation data leading to monitoring failure, and ensures the long-term stability of the monitoring system.

[0018] In some embodiments of the first aspect, after the step of the monitoring device outputting the calibrated concentration value to the water plant sewage treatment control system for guiding the adjustment of the phosphorus removal agent dosage, the method further comprises: the monitoring device receiving the actual phosphorus removal agent dosage and the effluent orthophosphorus concentration measured by the adjusted analyzer fed back by the water plant sewage treatment control system in real time; the monitoring device taking the difference between the actual dosage and the set dosage and the difference between the effluent orthophosphorus concentration measured by the adjusted analyzer and the calibrated concentration value as evaluation indexes of the dynamic Markov random field model; the monitoring device evaluating a performance evaluation value of the dynamic Markov random field model according to the evaluation indexes; when the performance evaluation value is less than a preset evaluation threshold, the monitoring device updating the parameters of the dynamic Markov random field model based on the newly added monitoring data using an incremental learning algorithm; the monitoring device testing the performance of the updated dynamic Markov random field model; and when the prediction error of the updated dynamic Markov random field model on the same test data set is less than the prediction error of the original dynamic Markov random field model on the same test data set, the monitoring device replacing the original model parameters with the updated model parameters.

[0019] By adopting the technical solution, the monitoring device receives the actual dosing amount and the adjusted concentration fed back by the control system, takes the dosing amount difference and the concentration difference as evaluation indexes, updates the model parameters by using incremental learning when the performance is not up to standard, and replaces the original parameters after the test confirms that the parameters are more optimal. The feedback data provides an actual basis for evaluation, and the incremental learning realizes dynamic optimization of the parameters, and the test verification can enhance the effectiveness of the update. These steps form a closed loop of model performance evaluation-update-verification, so that the model can adapt to process changes, long-term maintain high accuracy, and improve the continuous applicability of the monitoring method.

[0020] In a second aspect, the embodiments of the present application provide a monitoring device, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is configured to store computer program code, the computer program code comprising computer instructions, and the one or more processors invoke the computer instructions to enable the monitoring device to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0021] In a third aspect, the embodiments of the present application provide a computer program product comprising instructions, which, when executed on a monitoring device, cause the monitoring device to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0022] In a fourth aspect, the embodiments of the present application provide a computer-readable storage medium comprising instructions, which, when executed on a monitoring device, cause the monitoring device to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0023] It can be understood that the monitoring device provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the method provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved are referred to the beneficial effects in the corresponding method, which will not be described here.

[0024] The one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0025] 1. Since the monitoring device constructs a state space vector based on key operating parameters, predicts a prior distribution in combination with a dynamic Markov random field model, and fuses the prior and observation values by Kalman filtering when the analyzer has low accuracy, the influence of measurement deviation of the analyzer at low concentration is reduced without additional high-precision detection hardware, the calibrated concentration value is closer to the true value, and the accuracy of monitoring of the effluent orthophosphorus concentration in the wastewater phosphorus removal process is improved.

[0026] 2、Since the monitoring device identifies suspicious data through deviation value analysis, calculates the deviation change rate of continuous suspicious data to determine analyzer drift and sends a calibration prompt, it can timely discover analyzer performance degradation without manual continuous monitoring, avoid monitoring failure caused by long-term reliance on deviation data, and thus improve the long-term stability of the monitoring device in monitoring the effluent orthophosphorus concentration.

[0027] 3、Since the monitoring device assesses model performance based on feedback data, updates dynamic Markov random field model parameters through incremental learning and verifies replacement when performance is not up to standard, it can adaptively adjust the model when the wastewater treatment process working condition changes, thus improving the adaptability to complex working conditions and the sustained effectiveness of the effluent orthophosphorus concentration prediction model. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 is a flowchart of an effluent orthophosphorus concentration monitoring method against analyzer deviation in an embodiment of the present application.

[0029] Figure 2 is another flowchart of an effluent orthophosphorus concentration monitoring method against analyzer deviation in an embodiment of the present application.

[0030] Figure 3 is a schematic diagram of an entity device structure of a monitoring device in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting on the present application. As used in the specification and the appended claims of the present application, the singular forms “a,” “an” and “the” are intended to include plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “and / or” as used herein refer to and include any or all possible combinations of one or more of the listed items.

[0032] Hereinafter, the terms “first” and “second” are only for the purpose of description, and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with “first” and “second” can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, the meaning of “a plurality of” is two or more, unless otherwise specified.

[0033] Since the embodiments of the present application relate to the application of wastewater treatment technology, the related terms and concepts involved in the embodiments of the present application will be introduced first for easy understanding.

[0034] Dynamic Markov random field model

[0035] Dynamic Markov Random Field (DMRF) is a probabilistic graphical model used for modeling and state estimation of multivariate systems with temporal characteristics. This model integrates the time evolution properties of Markov chains and the modeling capability of variable dependencies in Markov random fields. Its core lies in the ability to describe the dynamic transition relationship of internal states over time and the complex dependency between the internal state and a set of related observable variables at any specific time in a unified probability framework.

[0036] The structure of the Dynamic Markov Random Field model mainly consists of two parts:

[0037] Transition Model: This part describes the evolution process of the system's hidden state in the time dimension. It is based on the Markov assumption that the hidden state at the next time is only determined by the current hidden state, and has nothing to do with earlier historical states. This relationship is usually quantified through a transition potential function, which defines the transition probability of the state from time t to t+1.

[0038] Observation Model: This part describes the relationship between the system's hidden state and a set of observable variables at the same time. It is defined through an observation potential function, which characterizes the conditional probability of observing a specific set of observable variables given a specific hidden state. This allows the model to infer the internal unobservable hidden state based on a number of external measurable indicators.

[0039] By combining the transition model and the observation model, DMRF can use a series of time-ordered observation data to probabilistically infer the hidden state sequence and predict its most likely value.

[0040] Kalman Filter Algorithm

[0041] Kalman Filter is a recursive algorithm for optimal state estimation in linear dynamic systems and Gaussian noise assumptions. The algorithm effectively integrates the predictive information of the system's dynamic model and external measurement information through a loop consisting of prediction and update steps to minimize the mean square error between the estimated state and the true state.

[0042] The running mechanism of Kalman filter algorithm can be decomposed into two core steps:

[0043] Step one: prediction, in this step, the algorithm uses the posterior optimal state estimation value at the previous time (t-1) and the dynamic model of the system to predict the state at the current time (t). This prediction result is called a priori state estimate. At the same time, the algorithm also predicts the error covariance of the a priori estimate, which quantifies the uncertainty generated by the model-based prediction only.

[0044] Step two: update: in this step, the algorithm introduces the actual measurement value at the current time (t). First, a key parameter called Kalman gain is calculated. Kalman gain is a weight factor, whose size depends on the relative relationship between the prediction error covariance and the measurement noise covariance. Then, the algorithm uses the Kalman gain to correct the a priori state estimate, and integrates the new information contained in the measurement value, so as to generate a corrected, less uncertain posterior optimal state estimate, which is the optimal output at the current time, and is used as the input of the next round of cycle (t+1 time).

[0045] The application provides a water outlet orthophosphate concentration monitoring method and monitoring equipment resistant to analyzer deviation, which is used to improve the accuracy of water outlet orthophosphate concentration detection when the orthophosphate concentration in the water sample is extremely low.

[0046] Please refer to Figure 1 , which is a flowchart of an anti-analyzer deviation water outlet orthophosphate concentration monitoring method in the embodiment of the application.

[0047] S101, the monitoring equipment constructs a state space vector with the operating parameters in the sewage phosphorus removal process.

[0048] Among them, the sewage phosphorus removal process refers to the link of removing orthophosphate in water through chemical precipitation (such as adding iron salt) or biological metabolism in the sewage treatment process. The operating parameters refer to the measurable indexes reflecting the working conditions of the process, including the dosing amount of phosphorus removal agent, the influent orthophosphate concentration, etc. The state space vector refers to a multidimensional array formed by combining a plurality of operating parameters after standardization according to a preset rule, which is used to quantitatively represent the comprehensive state of the phosphorus removal process.

[0049] Specifically, this step provides input basis for the subsequent model by integrating key parameters. The monitoring equipment first acquires parameters such as influent orthophosphate concentration (such as 0.7 mg / L), phosphorus removal agent dosing amount (such as 4.5 mg / L), and influent flow (such as 1000 m³ / h) in real time through sensors, and ensures that the data time stamps are synchronized. Then, the parameters are subjected to outlier processing (such as using 3 criteria mark data beyond the normal range) and standardization (mapping to the [0, 1] interval); finally, a preset weight matrix (influent orthophosphate concentration weight 0.3, reagent dosage 0.3, and the remaining parameters accounting for 0.4) is used for weighted combination to form a state space vector (such as [0.5, 0.6, 0.8, 0.4, 0.7]), which contains the subsequent calculation required dosage change amount of phosphorus removal agent and influent orthophosphate concentration change amount .

[0050] In some embodiments, the state space vector can be constructed in various ways: optionally, the monitoring device adopts a weighted combination method based on parameter sensitivity analysis. First, the influence weight of each operating parameter on the effluent orthophosphate concentration is calculated by a random forest algorithm (such as weight 0.4, weight 0.3), and then the weighted sum of the normalized parameters is calculated to form a one-dimensional state space vector, highlighting the influence of the core parameters. Optionally, the monitoring device can also use a principal component analysis (PCA) dimension reduction method. Specifically, after the collected operating parameters are standardized, the principal components with cumulative variance contribution rate ≥95% (such as the first two principal components) are extracted by PCA, and the principal components are combined to form a state space vector by contribution rate, which reduces the dimension while retaining key information.

[0051] It can be understood that wavelet transform can also be used to extract the time-frequency characteristics of the parameters before combination and construction of the state space vector, which is not limited here.

[0052] S102, the monitoring device constructs a dynamic Markov random field model with the true value of the effluent orthophosphate concentration as the hidden state variable and the state space vector as the observation variable.

[0053] The true value of the effluent orthophosphate concentration refers to the actual orthophosphate concentration in the water sample, which cannot be directly measured and needs to be estimated by the dynamic Markov random field model. The hidden state variable refers to the variable that cannot be directly observed but needs to be estimated in the dynamic Markov random field model, denoted as (hidden state variable, cannot be directly measured). The observation variable refers to the variable that can be directly measured, which is the state space vector here, denoted as . The dynamic Markov random field model is a probability model that combines hidden state time series dependence and observation correlation, and its joint probability distribution is:

[0054]

[0055] Among them, the state transition equation can be rewritten in the form of energy function as a component of transition potential function , and state prediction is achieved by minimizing energy:

[0056]

[0057] The meaning is to measure the deviation of the state transition prediction value and the actual observation value, wherein,

[0058] : State autoregressive coefficient (characterizing the influence of historical concentration on the current);

[0059] : Drug dosage change coefficient (reflecting the influence of phosphorus removal agent dosage on effluent positive phosphorus);

[0060] : Influent positive phosphorus concentration change coefficient (reflecting the dynamic influence of influent load);

[0061] : Process noise (subject to Gaussian distribution);

[0062] : Change amount of phosphorus removal agent dosage;

[0063] : Change amount of influent positive phosphate concentration.

[0064] Then, the associated hidden variables and measurable input features are converted as observation potential functions:

[0065]

[0066] Wherein is the phosphorus removal efficiency estimation function based on input features (such as influent pH, flow), is the observation weight coefficient (balancing the influence of hidden variables and measured features).

[0067] Specifically, the DMRF model is constructed by defining the potential function: first, based on historical data (such as the reference value of the past 3 months, , , , etc.), the maximum likelihood estimation method is used to determine the parameters =0.7, =0.2, =0.1, etc. Then, the deviation of and is quantified (the smaller the deviation, the higher the value, the greater the probability of the state), and the difference between and is quantified (the smaller the difference, the higher the value), and finally a complete model is formed.

[0068] In some embodiments, the dynamic Markov random field model can be constructed in various ways: optionally, the monitoring device can determine the model parameters using Bayesian estimation method. To 、 、 a normal prior distribution (e.g. ~N(0.7, 0.1²) is set, the parameter posterior distribution is estimated by Markov chain Monte Carlo sampling, the parameters of the transition potential function and the observation potential function are determined based on the posterior mean, and the robustness of the model is enhanced. Optionally, the monitoring device can also construct the model using piecewise potential functions. In <0.05 mg / L (low concentration region), the of the transition potential function is adjusted to 0.5 (to weaken the influence of the historical state), and the is adjusted to 0.3 (to enhance the influence of the drug), and in ≥ 0.05 mg / L, the = 0.7, = 0.2, so that the model adapts to the particularity of the low concentration scenario.

[0069] It can be understood that the weights of the parameters in the potential function can also be dynamically adjusted by introducing an attention mechanism, which is not limited here.

[0070] S103, the monitoring device predicts the prior probability distribution of the true value of the water phosphorus concentration based on the dynamic Markov random field model and the historical state space vector sequence.

[0071] The historical state space vector sequence refers to a set of state space vectors in the past preset time window (e.g. 1 hour) sorted by time. The prior probability distribution refers to the probability distribution of the hidden state variable without introducing the measurement value of the current analyzer, used to represent the possible values and uncertainties of .

[0072] Specifically, the prior distribution is predicted based on the transition potential function of the DMRF model and the historical sequence: first, the , and other parameters are extracted from the historical sequence. Then, the predicted mean and the predicted variance of are calculated according to the state evolution equation combined with the estimated value of at time t-1. Finally, the prior probability distribution is determined as a normal distribution N( , ), for example = 0.06 mg / L, = 0.002, reflecting the most likely value and fluctuation range of .

[0073] In some embodiments, the prior probability distribution can be predicted in various ways: optionally, the monitoring device can employ a particle filter prediction method. Generate 1000 probability distributions following N( , ) particles (representing (Possible values), calculated based on the state evolution equation for each particle. The predicted value, with its probability distribution serving as the prior probability distribution, is suitable for non-Gaussian scenarios. Optionally, the monitoring device can also employ a sliding window weighted prediction method, dividing the historical state space vector sequence into multiple windows (e.g., 3 windows) over time, assigning each window a weight that decreases over time (e.g., 0.5, 0.3, 0.2), and predicting based on the sequence of each window and the DMRF model. The distribution of recent data is then weighted and fused to obtain the final prior probability distribution, thereby enhancing the influence of recent data.

[0074] It is understandable that predictions can also be made using a Long Short-Term Memory (LSTM) network combined with a DMRF model, but this is not a limitation here.

[0075] S104. When the effluent orthophosphorus concentration value measured by the analyzer is less than the preset analyzer accuracy threshold, the monitoring equipment calculates the optimal posterior estimate of the effluent orthophosphorus concentration at the current moment using the Kalman filter algorithm as the calibration concentration value of the effluent orthophosphorus concentration.

[0076] Here, "analyte" refers to an instrument used for online monitoring of orthophosphate concentration in water, such as a molybdate spectrophotometer. The preset analyzer accuracy threshold refers to the critical concentration at which the analyzer's measurement error begins to increase significantly (e.g., 0.05 mg / L). The Kalman filter algorithm is a recursive estimation method that obtains the posterior distribution by fusing prior and observed values. The optimal posterior estimate is the mean (or mode) of the posterior distribution, i.e., the most likely hidden state value. The calibration concentration value is the estimated result, corrected by the algorithm, used to replace the analyzer's measurement value.

[0077] Specifically, the Kalman filter algorithm is a recursive estimation algorithm that integrates prior distributions and observed values. The calculation process of its optimal posterior estimate is as follows:

[0078] 1. Prediction Step: Calculate the mean of the prior probability distribution. and variance as the prior estimate mean and prior estimate of covariance ;

[0079] 2. Update step: When the analyzer measures the value When the concentration is <0.05 mg / L, a larger observation noise variance is used. (e.g., 0.1), the formula for calculating the Kalman gain is: ;

[0080] 3. Optimal posterior estimate: This refers to the calibration concentration value.

[0081] For example, if the prior estimate of the mean is 0.06 mg / L, =0.002, the analyzer measured a value of 0.04 mg / L, then =0.002 / (0.002 + 0.1) = 0.0196, the optimal posterior estimate = 0.06 + 0.0196×(0.04-0.06) = 0.0596 mg / L. This value relies more on prior prediction and reduces the impact of low-precision measurement values.

[0082] In some embodiments, the optimal posterior estimate can be calculated in several ways: optionally, the monitoring device can employ an adaptive noise-adjusted Kalman filter. When When <0.05mg / L, 0.1 + 0.5 / Dynamically increasing (e.g.) When the concentration is 0.02 mg / L, =0.1+25=25.1), further reducing the weight of the observed values ​​and increasing the dependence on the prior. Optionally, the monitoring equipment can also use an iterative Kalman filter. After the initial calculation of the posterior estimate, if the posterior covariance... If the value is greater than 0.01, use this estimate as the new prior input and recalculate K. t 'and posterior estimate, until ≤0.01, improving estimation accuracy in low-concentration scenarios.

[0083] Understandably, a weighted average of historical posterior estimates can also be introduced to correct the current estimate, but this is not limited here.

[0084] S105. The monitoring equipment outputs a calibration concentration value to the wastewater treatment control system of the water plant to guide the adjustment of the dosage of phosphorus removal agents.

[0085] The calibration concentration value refers to the optimal posterior estimate obtained through Kalman filtering. (e.g., 0.0596 mg / L). The wastewater treatment control system in a water plant refers to the automatic control system used to control equipment such as phosphorus removal agent dosing pumps and agitators. The adjustment of phosphorus removal agent dosage refers to the control system dynamically adjusting the agent dosage based on the deviation between the calibrated concentration value and the preset target value (e.g., 0.5 mg / L). .

[0086] Specifically, the monitoring equipment will calibrate the concentration values ​​and the corresponding posterior covariance. (e.g., 0.00196) Output to the control system: The control system calculates the deviation value = target value - calibration concentration value (e.g., 0.5 - 0.0596 = 0.4404 mg / L). If the deviation value > 0 (calibration value is lower than the target), then proceed as follows: =k × deviation value (k is the proportionality coefficient, such as 0.1) to reduce the dosage of the reagent (e.g., 0.4404 × 0.1 = 0.044 mg / L). If the deviation value < 0 (the calibration value is higher than the target), the dosage is increased to achieve closed-loop control of measurement-estimation-adjustment.

[0087] In some embodiments, output and adjustment guidance can be implemented in several ways: Optionally, the monitoring device outputs a calibration concentration value and a confidence interval (e.g., [0.056, 0.063] mg / L). The control system determines the reliability of the estimate based on the width of the confidence interval: if the width is <0.01 mg / L (high reliability), it adjusts according to the normal proportionality coefficient k. If the width is ≥0.01 mg / L (low reliability), k is halved to avoid over-adjustment. Optionally, the monitoring device can also output a calibration concentration value and a trend prediction (e.g., expected to drop to 0.055 mg / L in the next 5 minutes). The control system combines the trend prediction to adjust the dosage of the reagent in advance (e.g., pre-reducing by 0.005 mg / L) to reduce the hysteresis effect and improve control accuracy.

[0088] It is understandable that the adjustment of phosphorus removal agent dosage can also be guided by establishing a nonlinear mapping model between calibration concentration value and agent dosage (such as a BP neural network), which is not limited here.

[0089] In the above embodiments, the monitoring equipment constructs a state-space vector based on key operating parameters, predicts the prior distribution using a dynamic Markov random field model, and fuses the prior and observed values ​​through Kalman filtering when the analyzer has low accuracy. This reduces the impact of analyzer measurement bias at low concentrations without requiring additional high-precision detection hardware, making the calibrated concentration value closer to the true value and thus improving the accuracy of monitoring orthophosphorus concentration in the effluent during wastewater phosphorus removal. However, the above embodiments do not quantify the deviation of the measurement system, making it difficult to identify analyzer drift. Furthermore, the fixed model parameters make it difficult to adapt to long-term process changes, and the long-term stability and applicability under complex operating conditions need improvement.

[0090] Please refer to the following: Figure 2 This is another flowchart illustrating a method for monitoring orthophosphorus concentration in effluent to resist analyzer bias, as described in this application.

[0091] S201. The monitoring equipment constructs a state space vector based on the operating parameters during the phosphorus removal process in wastewater.

[0092] S202, the monitoring device constructs a dynamic Markov random field model with the true value of the effluent orthophosphorus concentration as a hidden state variable and a state space vector as an observation variable.

[0093] S203, the monitoring device predicts the prior probability distribution of the true value of the effluent orthophosphorus concentration based on the dynamic Markov random field model and the historical state space vector sequence.

[0094] S204, when the effluent orthophosphorus concentration value measured by the analyzer is less than the preset analyzer accuracy threshold, the monitoring device calculates the optimal posterior estimation value of the effluent orthophosphorus concentration at the current time as the calibrated concentration value of the effluent orthophosphorus concentration by the Kalman filtering algorithm.

[0095] Step S201 is similar to step S101, step S202 is similar to step S102, step S203 is similar to step S103, and step S204 is similar to step S104, which will not be repeated here.

[0096] S205, the monitoring device calculates the deviation value between the calibrated concentration value and the effluent orthophosphorus concentration value measured by the analyzer.

[0097] Wherein, the deviation value refers to the difference between the calibrated concentration value (Sfiltered) and the analyzer measurement value (Semeasured), which is used to quantify the deviation degree of the measurement system (positive deviation indicates that the measurement value is low, and negative deviation indicates that the measurement value is high).

[0098] Specifically, on the basis of embodiment 1, the real-time monitoring of the stability of the measurement system is realized by calculating the deviation value. For example, embodiment 1 only gets the calibrated value by Kalman filtering, while this step further calculates =0.0596−0.04=0.0196mg / L, which not only reflects the size of the current measurement deviation, but also provides data basis for subsequent anomaly detection.

[0099] In some embodiments, the deviation value calculation can be realized in various ways: optionally, the monitoring device calculates the combined index of absolute deviation and relative deviation. The absolute deviation =∣ −Semeasured∣ is used for low concentration scene (to avoid too small denominator), and the relative deviation ′= / ×100% is used for medium and high concentration scene (reflects the proportion of deviation), which takes into account the deviation characteristics at different concentrations. Optionally, the monitoring device can also use a sliding window to smooth the deviation value. For the last 10 ​The weighted average is calculated according to the weight [0.05, 0.08, 0.1, 0.12, 0.15, 0.15, 0.12, 0.1, 0.08, 0.05] (intermediate data weight is higher) to eliminate transient noise interference and highlight the system deviation trend.

[0100] It can be understood that the trend component and the noise component in the deviation value can also be separated by wavelet transform, which is not limited here.

[0101] S206, the monitoring device determines whether the deviation value is suspicious data.

[0102] The suspicious data refers to the deviation value that is outside the normal fluctuation range, indicating that the measurement system may have temporary interference (such as sensor contamination) or potential failure, which needs to be further analyzed.

[0103] Specifically, the monitoring device calculates the normal range (mean d ± 3 σ d, σ d is the standard deviation) based on the historical deviation value sequence (such as the past 7 days). =0.0196mg / L is outside the range (such as the normal range is [-0.01, 0.015]mg / L), it is marked as suspicious data.

[0104] In some embodiments, suspicious data determination can be achieved in various ways: optionally, the monitoring device can use a dynamic threshold method, first the monitoring device updates the mean d and σ d in a time window (such as 1 hour) to make the normal range adapt to the working condition changes (such as relaxing the threshold when the water fluctuates in rainy days), reducing false positives. Optionally, the monitoring device can also determine in combination with water quality auxiliary parameters. If the deviation value is abnormal but the pH, turbidity and other parameters of the water sample do not have significant fluctuations (excluding water sample interference), it is determined as suspicious data. If the water quality parameters fluctuate sharply, it is not marked temporarily (may be normal process fluctuation), to improve the accuracy of determination.

[0105] It can be understood that machine learning algorithms such as Isolation Forest can also be used for anomaly detection, which is not limited here.

[0106] After the monitoring device determines in step S206 that the deviation value is suspicious data, steps S207-S209 are performed, and after the monitoring device determines in step S206 that the deviation value is not suspicious data, steps S210-S213 are performed.

[0107] S207, when suspicious data appears continuously for a preset number of times, the monitoring device calculates the deviation change rate of the suspicious data for the preset number of continuous times.

[0108] The continuous preset number of times refers to the critical number of times (such as 3 times) to trigger the drift analysis. The deviation change rate refers to the change trend of the continuous suspicious data (r=( - () / 2, reflecting the rate of increase or decrease of deviation over time, is used to distinguish between random fluctuations and systematic drift.

[0109] Specifically, this step targets continuously occurring suspicious data (such as...). =0.016、 =0.018、 =0.0196mg / L) The change rate r = (0.0196−0.016) / 2 = 0.0018mg / L / time, indicating a continuous worsening trend of quantification deviation.

[0110] In some embodiments, the deviation change rate can be calculated in several ways: Optionally, the monitoring device uses linear fitting to calculate the change rate. Linear regression is performed on n consecutive suspicious data points, and the regression coefficient is used as the change rate (e.g., slope = 0.002, indicating that the deviation increases by 0.002 mg / L per step), enhancing the robustness of the trend characterization. Optionally, the monitoring device can also calculate the relative change rate. r′=( - ) / -2×100% (to avoid the absolute rate of change being too small when the deviation value is low), such as r′=(0.0196−0.016) / 0.016×100%=22.5%, which can more intuitively reflect the degree of deterioration.

[0111] It is understandable that the rate of change can also be accelerated by calculating the deviation through exponential fitting, but this is not limited here.

[0112] S208. When the rate of change of deviation is greater than the preset rate of change threshold, the monitoring equipment determines that the analyzer is drifting.

[0113] Analyzer drift means that the measured value deviates systematically from the true value over time (not random fluctuation), and calibration and maintenance are required.

[0114] S209. When the analyzer drifts, the monitoring equipment sends an analyzer calibration prompt signal to the wastewater treatment control system of the water plant.

[0115] S210 The monitoring equipment outputs a calibration concentration value to the wastewater treatment control system of the water plant to guide the adjustment of phosphorus removal agent dosage.

[0116] Step S210 is similar to step S105, and will not be described again here.

[0117] S211. The monitoring equipment receives in real time feedback from the wastewater treatment control system of the water plant regarding the actual dosage of phosphorus removal agent and the concentration of orthophosphorus in the effluent measured by the analyzer after adjustment.

[0118] The actual dosage of the phosphorus removal agent refers to the agent flow (e.g., 5.2 mg / L) actually output by the dosing pump after the control system adjusts according to the calibration concentration value. The outflow orthophosphorus concentration measured by the analyzer after adjustment refers to the outflow orthophosphorus concentration value (e.g., 0.06 mg / L) measured by the analyzer in real time after the new dosage of the agent is added.

[0119] Specifically, the monitoring device receives the actual dosage data sent by the control system through an industrial bus (e.g., Modbus / TCP) and synchronously collects the latest measurement value of the analyzer. For example, the calibration value is output only to guide adjustment in Embodiment 1, and the actual effect data after adjustment is further obtained in this step to provide a true value reference for model evaluation. If the calibration value is 0.0596 mg / L, the control system adjusts the set dosage from 5 mg / L to 5.1 mg / L, the actual dosage is 5.2 mg / L, and the analyzer measures 0.06 mg / L after adjustment, the feedback data collected in this step is (5.2 mg / L, 0.06 mg / L).

[0120] In some embodiments, the feedback data reception can be achieved in various ways. Optionally, the monitoring device uses a time stamp alignment mechanism. To ensure that the dosage and concentration data match, precise time stamps (e.g., millisecond level) are added to the received two sets of data, and data pairs with a time difference exceeding a preset threshold (e.g., 30 seconds) are removed to avoid evaluation errors caused by asynchronous sampling. Optionally, the monitoring device can also filter the quality of the feedback data. When the measurement value of the analyzer is lower than 0.05 mg / L (triggering a low-precision scenario of Kalman filtering), the data is automatically marked as to be confirmed and does not participate in model evaluation until the measurement value returns to a reliable range, thereby improving the quality of the evaluation data.

[0121] It can be understood that the feedback data reception can also be achieved in other ways, which are not limited here.

[0122] S212, the monitoring device performs performance evaluation on the dynamic Markov random field model based on the difference between the actual dosage and the set dosage and the difference between the outflow orthophosphorus concentration measured by the analyzer after adjustment and the calibration concentration value.

[0123] The difference between the actual dosage and the set dosage (denoted as Δu − ) reflects the execution deviation of the control system. The difference between the outflow orthophosphorus concentration measured by the analyzer after adjustment and the calibration concentration value (denoted as Δ = − ) reflects the prediction deviation of the model. The performance evaluation value refers to a quantitative index that comprehensively considers the two differences and is used to measure the effectiveness of the model in guiding adjustment.

[0124] Specifically, this step evaluates the performance of the dynamic Markov random field model through the following steps:

[0125] 1. Calculate the dosage deviation: If the dosage is set... =5.1 mg / L, actual dosage =5.2mg / L, then Δu=5.2−5.1=0.1mg / L;

[0126] 2. Calculate the concentration prediction deviation: If the calibrated concentration value =0.0596 mg / L, measured value after adjustment =0.06mg / L, then Δ =0.06−0.0596=0.0004mg / L;

[0127] 3. Comprehensive evaluation value: Using the weighted combination Score=w1×|Δu|+w2×|ΔSe| (e.g. w1=0.6, w2=0.4), we get Score=0.6×0.1+0.4×0.0004=0.06016.

[0128] In some embodiments, performance evaluation can be implemented in multiple ways: optionally, the monitoring device employs a dynamic weighting evaluation method. When |Δ When |>0.01mg / L (high concentration deviation scenario), w2 is automatically increased to 0.8 (to highlight the accuracy of concentration prediction). When |ΔSe|≤0.01mg / L, the default weight is restored to make the assessment more in line with actual needs. Optionally, the monitoring device can also calculate a cumulative assessment value. The cumulative assessment value is obtained by performing an exponentially weighted average of the scores of the most recent 100 sets of feedback data (with higher weight for recent data), smoothing short-term fluctuations and reflecting the long-term performance trend of the model.

[0129] Understandably, the similarity between the model prediction and the ideal response curve can also be used for evaluation, and this is not limited here.

[0130] S213. When the performance evaluation value is less than the preset evaluation threshold, the monitoring equipment updates the parameters of the dynamic Markov random field model based on the newly added monitoring data using an incremental learning algorithm.

[0131] The preset evaluation threshold refers to the critical value (e.g., 0.05) used to determine whether the model performance meets the target. Incremental learning algorithms refer to updating model parameters only using newly added data (e.g., ...). , , This online learning method avoids retraining the entire model.

[0132] Specifically, the step is triggered by the following steps when the evaluation value is lower than the threshold value (e.g., Score = 0.06016 > 0.05):

[0133] 1. Collect new monitoring data: including the latest state space vector (containing , ), calibration concentration value , feedback actual dosage and adjusted concentration;

[0134] 2. Update the parameters using the incremental EM algorithm:

[0135] 2.1. E step: calculate the posterior distribution of hidden variables (Q) based on new data;

[0136] 2.2. M step: update , , (e.g. α from 0.7 to 0.72) by maximizing the likelihood function;

[0137] 3. Save the updated parameters for subsequent prediction.

[0138] In some embodiments, parameter updating can be achieved in various ways: optionally, the monitoring device uses a forgetting factor incremental learning. Assign an exponentially decaying weight to historical data (e.g., λ = 0.99), so that the model gradually forgets outdated information and focuses more on recent changes, for example: where θ is the model parameter, η is the learning rate, and Lnew is the log-likelihood of new data. Optionally, the monitoring device can also set constraints for parameter updating. When the update amplitude exceeds 20%, it is automatically limited to 15% to prevent parameter mutation due to data fluctuations and ensure model stability.

[0139] It can be understood that the posterior distribution of the parameters can also be estimated by Bayesian incremental learning, which is not limited here.

[0140] The monitoring device of the embodiments of the present application calculates based on the bias value, determines suspicious data, diagnoses analyzer drift, and performs model performance evaluation and parameter updating. Through dynamic monitoring of the bias and timely diagnosis of the analyzer state, the long-term stability of the monitoring system is improved. And with the help of the closed-loop optimization mechanism of the dynamic Markov random field model, it can adapt to process changes and maintain high precision for a long time, thereby further improving the reliability and continuous applicability of the effluent orthophosphorus concentration monitoring method in complex sewage treatment scenarios.

[0141] The above describes an effluent orthophosphorus concentration monitoring method that resists analyzer bias in the embodiments of the present application. The following introduces an exemplary monitoring device 300 provided by the embodiments of the present application.​

[0142] Figure 3 FIG. 1 is a schematic diagram of an exemplary hardware structure of a monitoring device 300 provided by an embodiment of the present application. In some embodiments, the monitoring device 300 is a computer device including a processor, a memory and a network interface connected through a monitoring device bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating monitoring device, a computer program and a database. The internal memory provides an environment for running the operating monitoring device and the computer program in the non-volatile storage medium. The database of the computer device is configured to store data. The network interface of the computer device is configured to communicate with other terminals or servers outside through a network connection. In some embodiments, the network interface can be a wired network interface, and in some embodiments, the network interface can also be a wireless network interface. The computer program is executed by the processor to implement an anti-analyzer deviation effluent orthophosphorus concentration monitoring method according to an embodiment of the present application.

[0143] Those skilled in the art can understand that, Figure 3 The structure shown in FIG. 1 is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0144] In some embodiments of the present application, a computer readable storage medium is also provided, including instructions which, when executed on the monitoring device 300, can cause the monitoring device 300 to perform an anti-analyzer deviation effluent orthophosphorus concentration monitoring method according to an embodiment of the present application.

[0145] The above-described embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; even though the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

[0146] In the above embodiments, the term "when" can be interpreted as meaning "if" or "after" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "upon determining" or "if detecting (the stated condition or event)" can be interpreted as meaning "if determining" or "in response to determining" or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)" depending on the context.

[0147] In the above embodiments, all or part of the methods can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the methods can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media (such as solid state disk), etc.

[0148] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be instructed by a computer program to relevant hardware, and the program can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium includes ROM or random access memory (RAM), magnetic disk or optical disk, and various media that can store program codes.

Claims

1. A method of monitoring orthophosphate concentration in effluent against analyzer bias, characterized by, The method is applied to a monitoring device, and comprises the following steps: The monitoring device constructs a state space vector based on operating parameters in a wastewater phosphorus removal process, wherein the operating parameters at least include influent orthophosphorus concentration, phosphorus removal agent dosage, influent flow rate, reaction tank dissolved oxygen concentration, and pH value; The monitoring device constructs a dynamic Markov random field model by taking a true value of effluent orthophosphorus concentration as a hidden state variable and taking the state space vector as an observation variable; The monitoring device predicts a prior probability distribution of the true value of the effluent orthophosphorus concentration based on the dynamic Markov random field model and a historical state space vector sequence; When an effluent orthophosphorus concentration value measured by an analyzer is less than a preset analyzer accuracy threshold, the monitoring device calculates an optimal posterior estimation value of the effluent orthophosphorus concentration at the current time as a calibrated concentration value of the effluent orthophosphorus concentration by using a Kalman filtering algorithm, wherein the Kalman filtering algorithm takes a mean value and a variance of the prior probability distribution as prior estimation parameters of the Kalman filtering algorithm, takes the effluent orthophosphorus concentration value measured by the analyzer as an observation input of the Kalman filtering algorithm, and the optimal posterior estimation value is a weighted fusion result of the mean value of the prior probability distribution and the analyzer measurement value; The monitoring device outputs the calibrated concentration value to a wastewater treatment control system of a water plant for guiding adjustment of the phosphorus removal agent dosage.

2. The method of claim 1, wherein, The monitoring device constructs a state space vector based on operating parameters in a wastewater phosphorus removal process, and specifically comprises the following steps: The monitoring device acquires operating parameters in a wastewater phosphorus removal process, wherein the operating parameters at least include influent orthophosphorus concentration, phosphorus removal agent dosage, influent flow rate, reaction tank dissolved oxygen concentration, and pH value; The monitoring device marks the operating parameters that exceed a preset normal range as abnormal data, wherein the preset normal range is determined by adding or subtracting three times of a standard deviation to or from a mean value of historical data of corresponding operating parameters in a preset time of the wastewater treatment control system of the water plant; The monitoring device replaces the abnormal data by using a weighted sliding average method based on five adjacent effective data points, wherein the weight of an adjacent data point exponentially decays with the distance to the abnormal data; The monitoring device maps the operating parameters after the abnormal data processing to [0, 1] interval respectively to obtain standardized operating parameters; The monitoring device performs weighted combination on the standardized operating parameters according to a preset parameter weight matrix to construct a state space vector, wherein the weight of the influent orthophosphorus concentration and the phosphorus removal agent dosage in the preset parameter weight matrix is higher than the weight of other operating parameters.

3. The method of claim 1, wherein, The monitoring device constructs a dynamic Markov random field model by taking a true value of effluent orthophosphorus concentration as a hidden state variable and taking the state space vector as an observation variable, and specifically comprises the following steps: The monitoring device takes the true value of the effluent orthophosphorus concentration as the hidden state variable; The monitoring device describes a dependency relationship between the hidden state variables at adjacent time points by using a transition potential function; The monitoring device establishes an observation potential function between the hidden state variable and the state space vector; when the fluctuation of the observation potential function in the influent orthophosphorus concentration of the state space vector is greater than a preset fluctuation threshold, the observation potential function reduces the dependent weight of the influent orthophosphorus concentration parameter; based on the historical state space vector sequence and the corresponding historical measured value of the effluent orthophosphorus concentration of the preset time, the monitoring device estimates the initial parameters of the dynamic Markov random field model by using the maximum pseudo-likelihood estimation method; the monitoring device divides the historical data into a training set and a validation set in time sequence by using the cross-validation method; the monitoring device adjusts the model parameters to minimize the prediction error on the validation set, and constructs the dynamic Markov random field model.

4. The method of claim 1, wherein, the monitoring device predicts the prior probability distribution of the real value of the effluent orthophosphorus concentration based on the dynamic Markov random field model and the historical state space vector sequence, specifically including: the monitoring device extracts the state space vector sequence of the latest preset time window from the historical state space vector sequence; the monitoring device calculates the probability of the hidden state variable under each possible value based on the extracted state space vector sequence and the dynamic Markov random field model; the monitoring device determines the prior probability distribution of the real value of the effluent orthophosphorus concentration according to the calculated probability; the monitoring device uses a Gaussian kernel function to perform convolution operation on the probability distribution curve formed by the prior probability distribution, and eliminates the jagged fluctuations in the probability distribution.

5. The method of claim 1, wherein, when the effluent orthophosphorus concentration value measured by the analyzer is less than a preset analyzer accuracy threshold, the monitoring device calculates the optimal posterior estimation value of the effluent orthophosphorus concentration at the current time as the calibrated concentration value of the effluent orthophosphorus concentration by using the Kalman filtering algorithm, specifically including: the monitoring device takes the mean and variance of the prior probability distribution predicted by the dynamic Markov random field model as the prior estimation mean and prior estimation covariance of the Kalman filtering algorithm; the monitoring device takes the analyzer measurement value after the high-frequency noise removal processing as the observation input value; when the fluctuation degree of the observation input value is greater than a preset fluctuation degree threshold, the monitoring device increases the value of the observation noise variance parameter, which is used to represent the credibility of the observation input value; the monitoring device calculates the Kalman gain at the current time based on the prior estimation covariance and the observation noise variance parameter, and the Kalman gain is the weight of the observation input value; the monitoring device performs weighted fusion on the prior estimation mean and the observation input value according to the Kalman gain, calculates the initial optimal posterior estimation value of the effluent orthophosphorus concentration at the current time, and updates the posterior estimation covariance corresponding to the initial optimal posterior estimation value; when the posterior estimation covariance is greater than a preset covariance threshold, the monitoring device takes the initial optimal posterior estimation value and the posterior estimation covariance as new prior input, and starts a secondary filtering iteration optimal posterior estimation value with the observation input value at the same time; when the posterior estimation covariance is less than or equal to the preset covariance threshold, the monitoring device takes the optimal posterior estimation value as the calibrated concentration value of the effluent orthophosphorus concentration.

6. The method of claim 5, wherein, The method further comprises, after the step of the monitoring device taking the optimal posterior estimation value as the calibrated concentration value of the effluent orthophosphorus concentration when the posterior estimation covariance is less than or equal to the preset covariance threshold: The monitoring device calculates a deviation value between the calibrated concentration value and the effluent orthophosphorus concentration value measured by the analyzer; The monitoring device calculates a deviation mean and a deviation standard deviation of the deviation values within a preset time; The monitoring device determines a deviation warning threshold according to the deviation mean and the deviation standard deviation; When the deviation value exceeds the deviation warning threshold, the monitoring device marks the deviation value as suspicious data; When the suspicious data occurs continuously for a preset number of times, the monitoring device calculates a deviation change rate of the suspicious data for the preset number of times; When the deviation change rate is greater than a preset change rate threshold, the monitoring device determines that the analyzer has drift; When the analyzer has drift, the monitoring device sends an analyzer calibration prompt signal to the water plant sewage treatment control system.

7. The method of claim 1, wherein, The method further comprises, after the step of the monitoring device outputting the calibrated concentration value to the water plant sewage treatment control system for guiding the adjustment of the phosphorus removal agent dosage: The monitoring device receives the actual dosage of the phosphorus removal agent and the effluent orthophosphorus concentration measured by the adjusted analyzer from the water plant sewage treatment control system in real time; The monitoring device takes the difference between the actual dosage and the set dosage and the difference between the effluent orthophosphorus concentration measured by the adjusted analyzer and the calibrated concentration value as the evaluation index of the dynamic Markov random field model; The monitoring device evaluates the performance evaluation value of the dynamic Markov random field model according to the evaluation index; When the performance evaluation value is less than a preset evaluation threshold, the monitoring device updates the parameters of the dynamic Markov random field model based on the newly added monitoring data using an incremental learning algorithm; The monitoring device tests the performance of the updated dynamic Markov random field model; When the prediction error of the dynamic Markov random field model with updated parameters on the same test data set is less than the prediction error of the original dynamic Markov random field model on the same test data set, the monitoring device replaces the original model parameters with the updated model parameters.

8. A monitoring device, characterized by The monitoring device comprises one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors invoke the computer instructions to make the monitoring device execute the method of any one of claims 1-7.

9. A computer program product comprising instructions, characterized in that, When the computer program product runs on the monitoring device, the monitoring device executes the method of any one of claims 1-7.

10. A computer-readable storage medium comprising instructions, characterized in that, When the instructions run on the monitoring device, the monitoring device executes the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Chemical phosphorus-removal accurate dosing system and chemical phosphorus-removal accurate dosing control method

    CN110862188A

  • Short-distance intelligent phosphorus removal and dosing control method, equipment and system for sewage treatment

    CN114230110A