A water environment ammonia nitrogen prediction system
By designing a prediction system including main ammonia nitrogen acquisition module, auxiliary ammonia nitrogen acquisition module, water quality acquisition module, data processing module, control module and lifting module in the water environment ammonia nitrogen detection system, the problem of detection data inaccuracy after long-term use of ammonia nitrogen sensor is solved, and continuous detection accuracy and prevention of ammonia nitrogen overcharge are achieved.
Patent Information
- Application Number
- CN202510283582.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-03-11
AI Technical Summary
In the existing water environment ammonia nitrogen detection system, the ammonia nitrogen sensor is not cleaned and calibrated in time after long use, resulting in the detection data gradually losing accuracy, which may cause the problem of ammonia nitrogen excessive.
A water environment ammonia nitrogen prediction system is designed, including the main ammonia nitrogen acquisition module, the auxiliary ammonia nitrogen acquisition module, the water quality acquisition module, the data processing module, the control module and the lifting module. The data processing module determines the accuracy of the output results of the main ammonia nitrogen acquisition module. When inaccuracy is detected, the lifting module is used to drive the displacement of the auxiliary ammonia nitrogen acquisition module or the water quality acquisition module, collect multiple data to form a compensation model, correct the data of the main ammonia nitrogen acquisition module, or replace its sensor to ensure detection accuracy.
Through this system, the accuracy of ammonia nitrogen detection in water can be continuously ensured without timely cleaning and calibration of ammonia nitrogen sensors, and the problem of excessive ammonia nitrogen can be avoided.
Smart Images

Figure CN119807856B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ammonia nitrogen prediction, and particularly to a water environment ammonia nitrogen prediction system. Background Art
[0002] Ammonia nitrogen is a form of nitrogen element in water bodies, mainly including free ammonia and ammonium ions, and its content is one of the important indicators for measuring the water environment quality. The sources of ammonia nitrogen are extensive, mainly including the discharge of domestic sewage, industrial wastewater, and agricultural non-point source pollution, etc. The level of ammonia nitrogen content in water not only reflects the degree of water body pollution, but also affects the health of the aquatic ecosystem. When the ammonia nitrogen concentration is too high, it will have a toxic effect on aquatic organisms, especially damaging the respiratory systems of organisms such as fish, and at the same time, it may also cause the problem of water body eutrophication.
[0003] Currently, the methods for measuring the ammonia nitrogen content in water environments mainly include spectrophotometry, gas-phase molecular absorption spectrometry, ion-selective electrode method, etc. Among them, spectrophotometry is one of the most commonly used methods, including Nessler's reagent spectrophotometry and salicylic acid spectrophotometry, etc. Nessler's reagent spectrophotometry is to react Nessler's reagent with ammonia nitrogen to form a light red-brown complex, and its absorbance is proportional to the ammonia nitrogen content, so as to realize the quantitative prediction of ammonia nitrogen. This method has the advantages of simple operation and high sensitivity, but it should be noted that there may be interference factors such as suspended solids and metal ions in the water sample, and pretreatment is required. In addition, methods such as gas-phase molecular absorption spectrometry and ion-selective electrode method are also constantly developing and being applied, each having its own advantages and scope of application.
[0004] In actual water environment monitoring, accurately measuring the ammonia nitrogen content is of great significance for evaluating the water body pollution status, formulating pollution prevention and control measures, and protecting the aquatic ecosystem.
[0005] Therefore, currently, an online monitoring system is often used to detect the ammonia nitrogen content in the water environment. Especially in industries such as the fertilizer industry, paper industry, pharmaceutical industry, and even the printing and dyeing industry, during the production and processing process, due to a series of factors such as changes in production volume and types of products produced, the change frequency of ammonia nitrogen content in the discharged wastewater is relatively high. Although it is relatively accurate to use the ammonia nitrogen sensor in the online monitoring system to detect the ammonia nitrogen content in the water body in real time, with the long-term use of the ammonia nitrogen sensor and without timely cleaning and regular calibration, the data finally output by the ammonia nitrogen sensor in the online monitoring system will gradually lose its accuracy, and the ammonia nitrogen sensor will become less and less sensitive to the changes in the ammonia nitrogen content in the water body, resulting in the finally output data becoming stable, and ultimately leading to the problem of excessive ammonia nitrogen in the discharged water body.
[0006] Therefore, a water environment ammonia nitrogen prediction system is proposed to solve or alleviate the above problems. Summary of the Invention
[0007] The object of the present invention is to solve the disadvantages existing in the prior art, and to propose a water environment ammonia nitrogen prediction system.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] A water environment ammonia nitrogen prediction system includes a main ammonia nitrogen collection module, a plurality of auxiliary ammonia nitrogen collection modules, a water quality collection module, a data processing module, a control module, and a plurality of lifting modules. The number of the lifting modules is the same as the sum of the numbers of the main ammonia nitrogen collection module and the auxiliary ammonia nitrogen collection modules. The main ammonia nitrogen collection module, the auxiliary ammonia nitrogen collection modules, and the water quality collection module are all arranged on the movable ends of the respective lifting modules. The control module is coupled to the lifting modules. The main ammonia nitrogen collection module, the auxiliary ammonia nitrogen collection modules, and the water quality collection module are all coupled to the data processing module. The data processing module is coupled to the control module;
[0010] The main ammonia nitrogen collection module collects ammonia nitrogen data and feeds it back. When the variance of the ammonia nitrogen data fed back by the main ammonia nitrogen collection module is less than the first threshold, the data processing module determines that the output result of the main ammonia nitrogen collection module is inaccurate;
[0011] When the output result is inaccurate, the lifting module drives one of the auxiliary ammonia nitrogen collection modules or the water quality collection module to displace and collect multiple water body data, and after the data processing module forms a compensation model based on the multiple water body data, the main ammonia nitrogen collection module is maintained to work;
[0012] When the variance of the ammonia nitrogen data fed back by the main ammonia nitrogen collection module after being corrected by the compensation model is less than the second threshold, the lifting module drives one of the auxiliary ammonia nitrogen collection modules to displace and replace the main ammonia nitrogen collection module to collect ammonia nitrogen data in the water and feed it back.
[0013] Preferably, both the main ammonia nitrogen collection module and the auxiliary ammonia nitrogen collection modules include ammonia nitrogen sensors. The lifting module includes an electric push rod. The push rod of the electric push rod is set as the movable end of the lifting module. The data processing module includes a processor. The control module includes a controller.
[0014] Preferably, when the variance of the ammonia nitrogen data fed back by the main ammonia nitrogen collection module is less than the first threshold, the data processing module determines that the output result of the main ammonia nitrogen collection module is inaccurate, including the following steps:
[0015] The main ammonia nitrogen collection module continuously collects ammonia nitrogen data of the water body at the same time interval and obtains an ammonia nitrogen data set;
[0016] Calculate the variance of ammonia nitrogen data from the ammonia nitrogen data set, and compare the variance of ammonia nitrogen data with the first threshold. If the variance of ammonia nitrogen data is greater than the first threshold, it is determined that the output result of the main ammonia nitrogen collection module is accurate. If the variance of ammonia nitrogen data is less than the first threshold, it is determined that the output result of the main ammonia nitrogen collection module is inaccurate.
[0017] Preferably, when the variance of the ammonia nitrogen data corrected by the compensation model feedback by the main ammonia nitrogen collection module is less than the second threshold, the lifting module drives one of the auxiliary ammonia nitrogen collection modules to displace and replace the main ammonia nitrogen collection module to collect ammonia nitrogen data in the water and feedback, including the following steps:
[0018] The main ammonia nitrogen collection module continuously collects ammonia nitrogen data of the water body at the same time interval and obtains a corrected ammonia nitrogen data set after correction by the compensation model;
[0019] Calculate the variance of the corrected ammonia nitrogen data from the corrected ammonia nitrogen data set, and compare the variance of the corrected ammonia nitrogen data with the second threshold. If the variance of the corrected ammonia nitrogen data is greater than the second threshold, the main ammonia nitrogen collection module still maintains its operation. If the variance of the corrected ammonia nitrogen data is less than the second threshold, the lifting module drives one of the auxiliary ammonia nitrogen collection modules to displace and replace the main ammonia nitrogen collection module to collect ammonia nitrogen data in the water and feedback.
[0020] Preferably, the method for the water quality collection module to collect water body data multiple times includes the following steps:
[0021] Collect the pH value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, conductivity, and ammonia nitrogen content of the historical water body through the water quality collection module to form a historical data set;
[0022] Standardize the historical data set to eliminate outliers;
[0023] Calculate the Pearson correlation coefficient between each parameter and the ammonia nitrogen content, and screen out significantly correlated variables;
[0024] Establish a multiple linear regression model;
[0025] Estimate the regression coefficients using the least squares method, with the goal of minimizing the sum of squared residuals;
[0026] Evaluate the model fitting degree through the coefficient of determination;
[0027] Collect the pH value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, and conductivity of the real-time water body through the water quality collection module and import them into the multiple linear regression model, and output the ammonia nitrogen content as the water body data.
[0028] Preferably, the establishment method of the compensation model when collecting water body data multiple times through the secondary ammonia nitrogen collection module includes the following steps:
[0029] Perform difference processing on the ammonia nitrogen content data output by the main ammonia nitrogen collection module and the secondary ammonia nitrogen collection module to complete time alignment;
[0030] Adopt the z-score method to complete outlier rejection;
[0031] Assume a linear relationship between the ammonia nitrogen content data output by the main ammonia nitrogen collection module and the secondary ammonia nitrogen collection module;
[0032] Recursive least squares parameter estimation, initialize parameters;
[0033] Perform real-time compensation calculation and use a sliding window variance to detect parameter stability;
[0034] Perform residual prediction, calculate dynamic performance indicators, and complete compensation effect evaluation;
[0035] When the secondary ammonia nitrogen collection module is in use, perform parameter update. When the secondary ammonia nitrogen collection module is not in use, correct the ammonia nitrogen data output by the main ammonia nitrogen collection module.
[0036] Preferably, the establishment method of the compensation model when collecting water body data multiple times through the water quality collection module includes the following steps:
[0037] Collect the pH value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, conductivity, and ammonia nitrogen content of historical water bodies through the water quality collection module to form a data set;
[0038] Preprocess the data set, use Tukey's Fences method to reject outliers for outlier processing, perform Z-score standardization on the input features, and generate interaction features between sensor readings and other parameters to complete feature construction;
[0039] Use the mutual information method to screen key features, and retain the feature combinations whose mutual information values with the target variable exceed the preset threshold;
[0040] Construct a gradient boosting decision tree model, and its objective function is defined as the sum of the mean square error between the predicted value and the true value and the regularization term of the decision tree complexity;
[0041] Adopt an online learning strategy to dynamically update model parameters, and achieve incremental model optimization through an adaptive learning rate adjustment algorithm;
[0042] Based on weighted compensation of feature importance, output the final compensation formula;
[0043] Establish an error feedback loop to perform parameter adaptive adjustment.
[0044] The present invention has the following beneficial effects:
[0045] In the actual process of detecting water bodies, the present invention mainly uses the main ammonia nitrogen collection module to detect the ammonia nitrogen content in the water body and output the corresponding water body data to the data processing module. However, if the water body data received by the data processing module from the main ammonia nitrogen collection module continuously maintains a certain steady state, it indicates that there is a problem with the detection accuracy of the main ammonia nitrogen collection module and it needs to be cleaned and positioned and calibrated in a timely manner. At this time, it is not necessary to disassemble the main ammonia nitrogen collection module. Instead, only the control module is needed to control the lifting module to drive the auxiliary ammonia nitrogen collection module and the water quality collection module to perform lifting displacement, so that the auxiliary ammonia nitrogen collection module or the water quality collection module is displaced and multiple water body data are collected. A compensation model is formed by the multiple water body data collected by the auxiliary ammonia nitrogen collection module or the water quality collection module, so that the ammonia nitrogen content in the water body can still be detected by the main ammonia nitrogen collection module later. Only the ammonia nitrogen content feedback by the main ammonia nitrogen collection module later needs to be corrected by the compensation model to ensure that the ammonia nitrogen content finally output from the system is relatively accurate. If the ammonia nitrogen data after being corrected by the compensation model also shows the problem of continuously maintaining a certain steady state, it means that the main ammonia nitrogen collection module can no longer work through the compensation model at this time and needs to be replaced by another module for detection. Therefore, the lifting module drives one of the auxiliary ammonia nitrogen collection modules to displace and replace the main ammonia nitrogen collection module to collect ammonia nitrogen data in the water and feedback, so that the entire water environment ammonia nitrogen prediction system can continuously detect the ammonia nitrogen in the water body. Even if the cleaning and positioning and calibration actions of the ammonia nitrogen sensor are not carried out for a long time, it can still work continuously, avoiding the problem that the data finally output by the ammonia nitrogen sensor in the system will gradually lose its accuracy and avoiding the problem of excessive ammonia nitrogen in the finally discharged wastewater. Description of the Drawings
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0047] Figure 1 It is a structural block diagram of the present invention.
[0048] 1. Main ammonia nitrogen collection module; 2. Auxiliary ammonia nitrogen collection module; 3. Water quality collection module; 4. Data processing module; 5. Control module; 6. Lifting module. Detailed Embodiments
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. The components of the embodiments of the present invention usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0051] It should be noted that: similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0052] In the description of the present invention, it should be understood that the orientation or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the orientation or positional relationships shown in the accompanying drawings, or the orientation or positional relationships when the inventive product is normally placed, or the orientation or positional relationships commonly understood by those skilled in the art. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to the present invention.
[0053] In addition, the terms "first", "second", "third", etc. are only used for descriptive distinction and cannot be understood as indicating or implying relative importance.
[0054] In the description of the present invention, it should also be noted that unless otherwise clearly defined and limited, the terms "set", "installed", "connected", and "coupled" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0055] A water environment ammonia nitrogen prediction system, such as Figure 1As shown in the figure, it includes a main ammonia nitrogen collection module 1, several auxiliary ammonia nitrogen collection modules 2, a water quality collection module 3, a data processing module 4, a control module 5, and several lifting modules 6. Both the main ammonia nitrogen collection module 1 and the auxiliary ammonia nitrogen collection modules 2 include ammonia nitrogen sensors. The lifting module 6 includes an electric push rod, and the push rod of the electric push rod is set as the movable end of the lifting module 6. The data processing module 4 includes a processor, and the control module 5 includes a controller.
[0056] The number of the lifting modules 6 is the same as the sum of the numbers of the main ammonia nitrogen collection module 1 and the auxiliary ammonia nitrogen collection modules 2. The main ammonia nitrogen collection module 1, the auxiliary ammonia nitrogen collection modules 2, and the water quality collection module 3 are all arranged on the movable ends of the respective lifting modules 6. The control module 5 is coupled to the lifting modules 6. The main ammonia nitrogen collection module 1, the auxiliary ammonia nitrogen collection modules 2, and the water quality collection module 3 are all coupled to the data processing module 4. The data processing module 4 is coupled to the control module 5;
[0057] The main ammonia nitrogen collection module 1 collects ammonia nitrogen data and feeds it back. And when the variance of the ammonia nitrogen data fed back by the main ammonia nitrogen collection module 1 is less than the first threshold, the data processing module 4 determines that the output result of the main ammonia nitrogen collection module 1 is inaccurate;
[0058] When the output result is inaccurate, the lifting module 6 drives one of the auxiliary ammonia nitrogen collection modules 2 or the water quality collection module 3 to displace and collect multiple sets of water body data. And after the data processing module 4 forms a compensation model based on the multiple sets of water body data, it maintains the operation of the main ammonia nitrogen collection module 1;
[0059] When the variance of the ammonia nitrogen data corrected by the compensation model fed back by the main ammonia nitrogen collection module 1 is less than the second threshold, the lifting module 6 drives one of the auxiliary ammonia nitrogen collection modules 2 to displace and replace the main ammonia nitrogen collection module 1 to collect ammonia nitrogen data in the water and feed it back.
[0060] The core of the system in the present invention lies in the "detection - judgment - compensation - replacement" closed - loop control logic. After the ammonia nitrogen sensor of the main ammonia nitrogen collection module 1 continuously collects data, the data processing module 4 calculates the variance to reflect the data volatility and evaluate the sensor state. The variance lower than the threshold indicates that the sensor is sluggish in response and the data tends to be stable. At this time, the system mobilizes the ammonia nitrogen sensor of the auxiliary ammonia nitrogen collection module 2 or the water quality module through the lifting module 6 to collect multi - source data, constructs a compensation model using historical data, and dynamically corrects the data of the ammonia nitrogen sensor of the main ammonia nitrogen collection module 1. If the data still does not meet the standard after correction, that is, the variance is lower than the threshold for the second time, the ammonia nitrogen sensor of the main ammonia nitrogen collection module 1 is physically replaced, so that the system can achieve long - term stable detection, avoid data inaccuracy caused by the sensor not being cleaned or calibrated in time, and thus prevent the ammonia nitrogen in the wastewater from exceeding the standard.
[0061] Preferably, when the variance of the ammonia nitrogen data fed back by the main ammonia nitrogen acquisition module 1 is less than the first threshold, the data processing module 4 determines that the output result of the main ammonia nitrogen acquisition module 1 is inaccurate, including the following steps,
[0062] The main ammonia nitrogen acquisition module 1 continuously acquires the ammonia nitrogen data of the water body at the same time interval and obtains an ammonia nitrogen data set;
[0063] Calculate the variance of the ammonia nitrogen data through the ammonia nitrogen data set, and compare the variance of the ammonia nitrogen data with the first threshold. If the variance of the ammonia nitrogen data is greater than the first threshold, it is determined that the output result of the main ammonia nitrogen acquisition module 1 is accurate. If the variance of the ammonia nitrogen data is less than the first threshold, it is determined that the output result of the main ammonia nitrogen acquisition module 1 is inaccurate.
[0064] When the variance of the ammonia nitrogen data fed back by the main ammonia nitrogen acquisition module 1 after being corrected by the compensation model is less than the second threshold, the lifting module 6 drives one of the auxiliary ammonia nitrogen acquisition modules 2 to displace and replace the main ammonia nitrogen acquisition module 1 to acquire the ammonia nitrogen data in the water and feed it back, including the following steps,
[0065] The main ammonia nitrogen acquisition module 1 continuously acquires the ammonia nitrogen data of the water body at the same time interval and obtains a corrected ammonia nitrogen data set after being corrected by the compensation model;
[0066] Calculate the corrected variance of the ammonia nitrogen data through the corrected ammonia nitrogen data set, and compare the corrected variance of the ammonia nitrogen data with the second threshold. If the corrected variance of the ammonia nitrogen data is greater than the second threshold, the main ammonia nitrogen acquisition module 1 still maintains its operation. If the corrected variance of the ammonia nitrogen data is less than the second threshold, the lifting module 6 drives one of the auxiliary ammonia nitrogen acquisition modules 2 to displace and replace the main ammonia nitrogen acquisition module 1 to acquire the ammonia nitrogen data in the water and feed it back.
[0067] Preferably, the method for the water quality acquisition module 3 to acquire water body data multiple times includes the following steps,
[0068] Acquire the pH value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, conductivity, and ammonia nitrogen content of the historical water body through the water quality acquisition module 3 to form a historical data set;
[0069] Standardize the historical data set to eliminate outliers, , where, is the mean value, is the standard value;
[0070] Calculate the Pearson correlation coefficient between each parameter and the ammonia nitrogen content, and screen out significantly correlated variables, , retain of the parameters as input variables;
[0071] Establish a multiple linear regression model, , where is the ammonia nitrogen concentration, is the intercept of the regression model, are the regression coefficients of pH value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, and conductivity respectively, is the random error term, following a normal distribution with a mean of 0;
[0072] The least squares method is used to estimate the regression coefficients, and the goal is to minimize the sum of squared residuals. , specifically, , where X is the design matrix and Y is the ammonia nitrogen content vector;
[0073] The goodness of fit of the model is evaluated through the coefficient of determination ; , where indicates a relatively high model validity;
[0074] The pH value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, and conductivity of the real-time water body are collected by the water quality collection module 3 and imported into the multiple linear regression model to output the ammonia nitrogen content as water body data.
[0075] The regression coefficients β are estimated by the least squares method, and the goal is to minimize the sum of squared residuals between the predicted value and the true value. Before model construction, data standardization is required to make the mean of each parameter 0 and the variance 1, eliminating the dimension difference. The Pearson correlation coefficient is used to screen the parameters significantly correlated with ammonia nitrogen, removing irrelevant variables. The coefficient of determination R² evaluates the goodness of fit of the model to ensure the prediction reliability. During real-time monitoring, the current water quality parameters are substituted into the model to output the estimated ammonia nitrogen value. Through the above method steps, the chemical detection problem is transformed into a statistical prediction problem to provide an emergency data source when the sensor fails.
[0076] Preferably, the establishment method of the compensation model when collecting water body data multiple times by the auxiliary ammonia nitrogen collection module 2 includes the following steps:
[0077] Perform difference processing on the ammonia nitrogen content data output by the main ammonia nitrogen collection module 1 and the auxiliary ammonia nitrogen collection module 2 to complete time alignment, ;
[0078] Use the z-score method to complete outlier removal ;
[0079] Assume a linear relationship between the ammonia nitrogen content data output by the main ammonia nitrogen collection module 1 and the auxiliary ammonia nitrogen collection module 2, , where is the measured value of the main ammonia nitrogen collection module 1 at the kth moment, is the measured value of the ammonia nitrogen collection module 2 at the k-th moment, and is the time-varying compensation parameter;
[0080] Recursive least squares parameter estimation, initialize parameters, , parameter update process, , where, , is the forgetting factor, is the Kalman gain matrix;
[0081] Real-time compensation calculation and use a sliding window variance to detect parameter stability , where, when , freeze parameter update, ;
[0082] Perform residual prediction 、Calculate dynamic performance indicators , complete the compensation effect evaluation;
[0083] When the ammonia nitrogen collection module 2 is used, perform parameter update , when the ammonia nitrogen collection module 2 is not used, correct the ammonia nitrogen data output by the main ammonia nitrogen collection module 1 .
[0084] The compensation model assumes a linear relationship between the outputs of the main and auxiliary sensors, and online estimates k and b through the recursive least squares method. RLS updates parameters iteratively, avoiding the resource consumption of traditional batch calculations. The sliding window variance, such as the window size N = 100, monitors the stability of parameters k and b. If the variance exceeds the threshold, the model is determined to fail and needs to be retrained. Residual prediction, such as white noise test, verifies the rationality of the model assumption. Through the above method steps, the system has a certain real-time performance and self-adaptability, and can dynamically adjust the compensation coefficient following the characteristics change of the ammonia nitrogen sensor.
[0085] Preferably, the establishment method of the compensation model when collecting water body data multiple times through the water quality collection module 3 includes the following steps,
[0086] Collect the ph value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, conductivity, and ammonia nitrogen content of the historical water body through the water quality collection module 3 to form a data set;
[0087] Preprocess the data set, use Tukey's Fences method to remove outliers for outlier processing , perform Z-score standardization on the input features , generate interaction features between sensor readings and other parameters to complete feature construction ;
[0088] Use the mutual information method to screen key features, and retain the feature combinations whose mutual information values with the target variable exceed the preset threshold. ;
[0089] Construct a gradient boosting decision tree model, and its objective function is defined as the sum of the mean square error between the predicted value and the true value and the regularization term of the decision tree complexity. , where , is the decision tree, is the regularization term;
[0090] Adopt an online learning strategy to dynamically update the model parameters , through an adaptive learning rate adjustment algorithm to achieve incremental model optimization;
[0091] Weighted compensation based on feature importance to output the final compensation formula , where is the confidence coefficient of the main ammonia nitrogen acquisition module 1, ;
[0092] Establish an error feedback loop to perform parameter adaptive adjustment .
[0093] In the above method steps, by iteratively training multiple weak learners, the prediction error is gradually reduced. The objective function includes a loss function, such as the mean square error and a regularization term, for example, controlling the tree complexity. A new tree is generated in each iteration to fit the current residual, and the final predicted value is the sum of the outputs of each tree.
[0094] The online learning strategy uses an adaptive learning rate to balance the convergence speed and stability. The feature importance is calculated by statistically splitting the information gain. The error feedback loop, such as the moving average error, dynamically adjusts the model hyperparameters, such as the learning rate and the tree depth, to form a closed-loop optimization of "prediction, evaluation, adjustment", so that this method combines machine learning with modern signal processing technology to achieve high-precision and adaptive ammonia nitrogen concentration compensation.
[0095] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A water environment ammonia nitrogen prediction system, characterized in that: The invention comprises a main ammonia nitrogen collection module (1), a plurality of auxiliary ammonia nitrogen collection modules (2), a water quality collection module (3), a data processing module (4), a control module (5), and a plurality of lifting modules (6); the number of the lifting modules (6) is the same as the number of the main ammonia nitrogen collection modules (1) and the auxiliary ammonia nitrogen collection modules (2); the main ammonia nitrogen collection modules (1), the auxiliary ammonia nitrogen collection modules (2), and the water quality collection modules (3) are all arranged on the active end of each lifting module (6); the control module (5) is coupled to the lifting module (6); the main ammonia nitrogen collection module (1), the auxiliary ammonia nitrogen collection modules (2), and the water quality collection module (3) are all coupled to the data processing module (4); and the data processing module (4) is coupled to the control module (5); The main ammonia nitrogen collection module (1) collects ammonia nitrogen data and feeds back the data, and when the variance of the ammonia nitrogen data fed back by the main ammonia nitrogen collection module (1) is less than a first threshold value, the data processing module (4) determines that the output result of the main ammonia nitrogen collection module (1) is inaccurate; When the output result is inaccurate, the lifting module (6) drives one of the auxiliary ammonia nitrogen collection modules (2) or the water quality collection module (3) to move and collect multiple water body data, and after the data processing module (4) forms a compensation model based on the multiple water body data, the main ammonia nitrogen collection module (1) is maintained in operation; When the variance of the ammonia nitrogen data fed back by the main ammonia nitrogen collection module (1) after correction by the compensation model is less than a second threshold value, the lifting module (6) drives one of the auxiliary ammonia nitrogen collection modules (2) to move and replace the main ammonia nitrogen collection module (1) to collect ammonia nitrogen data in the water and feed it back.
2. A water environment ammonia nitrogen prediction system according to claim 1, characterized in that: The main ammonia nitrogen collection module (1) and the auxiliary ammonia nitrogen collection module (2) both include an ammonia nitrogen sensor, the lifting module (6) includes an electric push rod, the push rod of the electric push rod is arranged as the movable end of the lifting module (6), the data processing module (4) includes a processor, and the control module (5) includes a controller.
3. A water environment ammonia nitrogen prediction system according to claim 1, characterized in that: When the variance of the ammonia nitrogen data fed back by the main ammonia nitrogen collection module (1) is less than a first threshold value, the data processing module (4) determines that the output result of the main ammonia nitrogen collection module (1) is inaccurate, comprising the following steps: The main ammonia nitrogen collection module (1) continuously collects ammonia nitrogen data of the water body at the same time interval and obtains an ammonia nitrogen data set; The ammonia nitrogen data variance is calculated using the ammonia nitrogen data set, and the ammonia nitrogen data variance is compared with a first threshold value. If the ammonia nitrogen data variance is greater than the first threshold value, the output result of the main ammonia nitrogen collection module (1) is judged to be accurate; if the ammonia nitrogen data variance is less than the first threshold value, the output result of the main ammonia nitrogen collection module (1) is judged to be inaccurate.
4. A water environment ammonia nitrogen prediction system according to claim 3, characterized in that: When the variance of the ammonia nitrogen data corrected by the compensation model fed back by the main ammonia nitrogen collection module (1) is less than a second threshold value, the lifting module (6) drives one of the auxiliary ammonia nitrogen collection modules (2) to move and replace the main ammonia nitrogen collection module (1) to collect ammonia nitrogen data in water and feed it back, comprising the following steps: The main ammonia nitrogen collection module (1) continuously collects ammonia nitrogen data of the water body at the same time interval and obtains a corrected ammonia nitrogen data set after correction by the compensation model; The corrected ammonia nitrogen data variance is calculated by correcting the ammonia nitrogen data set, and the corrected ammonia nitrogen data variance is compared with a second threshold value. If the corrected ammonia nitrogen data variance is greater than the second threshold value, the main ammonia nitrogen collection module (1) is still maintained in operation. If the corrected ammonia nitrogen data variance is less than the second threshold value, the lifting module (6) drives one of the auxiliary ammonia nitrogen collection modules (2) to move and replace the main ammonia nitrogen collection module (1) to collect ammonia nitrogen data in water and feedback it.
5. A water environment ammonia nitrogen prediction system according to claim 1, characterized in that: The method for the water quality acquisition module (3) to collect multiple water body data comprises the following steps: The water quality collection module (3) collects historical water body pH value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, conductivity, and ammonia nitrogen content to form a historical data set; Standardize the historical data set to remove outliers; Calculate the Pearson correlation coefficient between each parameter and ammonia nitrogen content, and screen the significantly correlated variables; Establish a multiple linear regression model; The least squares method is used to estimate the regression coefficients, with the goal of minimizing the residual sum of squares; Model fit was assessed by the coefficient of determination; The water quality acquisition module (3) collects the real-time pH value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, and conductivity of the water body and imports them into the multivariate linear regression model to output the ammonia nitrogen content as water body data.
6. A water environment ammonia nitrogen prediction system according to claim 1, characterized in that: The method for establishing the compensation model when collecting multiple water body data through the auxiliary ammonia nitrogen collection module (2) comprises the following steps: Performing difference processing on the ammonia nitrogen content data output by the main ammonia nitrogen collection module (1) and the auxiliary ammonia nitrogen collection module (2) to complete time alignment; The z-score method was used to remove outliers; Assume that the ammonia nitrogen content data output by the main ammonia nitrogen collection module (1) and the auxiliary ammonia nitrogen collection module (2) have a linear relationship; Recursive least squares parameter estimation, initialization parameters; Real-time compensation calculation and sliding window variance detection parameter stability; Carry out residual prediction, calculate dynamic performance indicators, and complete compensation effect evaluation; When the auxiliary ammonia nitrogen collection module (2) is in use, parameter update is performed; when the auxiliary ammonia nitrogen collection module (2) is not in use, the ammonia nitrogen data output by the main ammonia nitrogen collection module (1) is corrected.
7. A water environment ammonia nitrogen prediction system according to claim 5 or 6, characterized in that: The method for establishing the compensation model when collecting multiple water body data through the water quality collection module (3) comprises the following steps: The water quality collection module (3) collects historical water body pH value, temperature, dissolved oxygen, chemical oxygen demand, redox potential, nitrate concentration, nitrite concentration, conductivity, and ammonia nitrogen content to form a data set; The data set is preprocessed, and outliers are removed using Tukey's Fences method for outlier processing. The input features are Z-score standardized, and the interactive features between sensor readings and other parameters are generated to complete the feature construction. Use the mutual information method to screen key features and retain feature combinations whose mutual information values with the target variable exceed the preset threshold; Construct a gradient boosting decision tree model, whose objective function is defined as the sum of the mean square error between the predicted value and the true value and the decision tree complexity regularization term; Adopt online learning strategy to dynamically update model parameters, and realize incremental model optimization through adaptive learning rate adjustment algorithm; Weighted compensation based on feature importance, outputting the final compensation formula; An error feedback loop is established to perform adaptive parameter adjustments.
Citation Information
Patent Citations
Ammonia nitrogen / nitrite content prediction system and method for multi-source information fusion in aquaculture environment
CN108647831A
Detection method for total nitrogen concentration in aquaculture water and application
CN116754503A