Total nitrogen rapid detection method for early warning

By detecting ammonia nitrogen, nitrate nitrogen, nitrosity nitrogen and pH values ​​in water quality, a linear model is established and inversion compensation is combined with pH values, and a total nitrogen sensor is used for rapid detection and early warning, the problem of long detection time and insufficient real-time performance in the existing technology is solved, and rapid and accurate water quality monitoring and timely early warning are achieved.

CN119804809AActive Publication Date: 2025-04-11SHANGHAI YANXUAN TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510312253.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-04-11
Estimated Expiration
2045-03-17

AI Technical Summary

Technical Problem

In the prior art, the total nitrogen detection method has problems such as long detection time, the need to deal with chemical waste liquids, and insufficient real-time performance, which cannot meet the needs of rapid water quality monitoring.

Method used

By detecting ammonia nitrogen, nitrate nitrogen, nitrosity nitrogen and pH values ​​in water quality, a linear model is established and inversion compensation is combined with pH values, and a total nitrogen sensor is used for rapid detection and early warning.

Benefits of technology

It has achieved rapid and accurate detection of the total nitrogen content in water quality, overcome the problems of long time and insufficient real-time performance of traditional chemical methods, and can promptly warn of abnormal water quality, improving detection efficiency and timeliness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119804809A_ABST
    Figure CN119804809A_ABST
Patent Text Reader

Abstract

The invention discloses a total nitrogen rapid detection method for early warning, and particularly relates to the technical field of water quality monitoring, and the method comprises the following steps: firstly, detecting ammonia nitrogen values, nitrate nitrogen values, nitrite nitrogen values, pH values and total nitrogen values at different positions in water, and recording multiple groups of data; the sum of ammonia nitrogen, nitrate nitrogen and nitrite nitrogen values and the total nitrogen value establish a linear model, the total nitrogen value is subjected to inversion compensation according to the pH value to obtain an accurate algorithm model, the model is input into a total nitrogen sensor internal system connected with an early warning analysis unit, and finally the sensor is installed in a detected water area for rapid detection and early warning. The method has the advantages that the detection is quick, the result is accurate, the sensor is small in size and convenient to install, various defects of a traditional total nitrogen detection method are effectively overcome, and the method can be widely applied to water quality monitoring of various water areas and timely provides early warning for water eutrophication and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water quality monitoring, and more specifically to a method for rapid detection of total nitrogen for early warning. Background Art

[0002] Total nitrogen, abbreviated as TN, is one of the important indicators for measuring water quality and is often used to indicate the degree of nutrient pollution in water. The existing detection method for total nitrogen in water quality is mainly chemical method, which requires sampling and returning to the laboratory for testing, takes a long time to detect and there is a problem of waste liquid recycling and treatment.

[0003] Although the current on-site total nitrogen testing instruments automate the chemical testing steps and shorten the reaction and digestion time, they still take half an hour to test, which cannot meet the needs of continuous on-site water quality monitoring. The instruments need to store chemical reagents and replenish them regularly, usually once a month. In addition, the instruments are large in size and cannot be installed in places where in-situ monitoring and installation size requirements are required. These problems make it impossible for total nitrogen testing instruments to effectively meet the needs of rapid water quality monitoring, making it possible for industrial enterprises with sewage discharge to use the blind spots of the detection interval to secretly discharge or leak.

[0004] Therefore, a rapid detection method for total nitrogen for early warning is proposed. Summary of the invention

[0005] In order to overcome the above-mentioned defects of the prior art, the present invention provides a rapid detection method of total nitrogen for early warning to solve the problems raised in the above-mentioned background technology.

[0006] To achieve the above object, the present invention provides the following technical solution: a rapid detection method for total nitrogen for early warning, comprising the following steps: S1: Ammonia nitrogen values ​​at different locations in water quality , Nitrate nitrogen value , Nitrite nitrogen value , Value and total nitrogen value Conduct tests and record multiple sets of test data; S2: By measuring the ammonia nitrogen value of each group , Nitrate nitrogen value and nitrite nitrogen value The data were summed with the total nitrogen value A linear model is established between , where a is the intercept and b is the slope; S3: Then the total nitrogen value is inverted and compensated according to each group of pH values ​​detected to obtain a more accurate total nitrogen value algorithm model: ,in, is the correlation coefficient; S4: inputting the algorithm model established in S3 into the internal system of the total nitrogen sensor, and connecting an early warning analysis unit to the internal system of the total nitrogen sensor; S5: Install the total nitrogen sensor in S4 in the detected water area, and use the total nitrogen sensor for rapid detection and early warning.

[0007] Preferably, the ammonia nitrogen value, nitrate nitrogen value, nitrite nitrogen value and pH value in the water quality measured in S1 are respectively measured by an ammonia nitrogen sensor, a nitrate nitrogen sensor, a nitrite nitrogen sensor and a pH sensor.

[0008] Preferably, the total nitrogen sensor measures the ammonia nitrogen value, nitrate nitrogen value, nitrite nitrogen value and pH value in water quality through a four-parameter sensor integration method, which includes: Ion-selective electrodes for ammonia nitrogen, pH, nitrate nitrogen and nitrite nitrogen are integrated into a sealed structure; The electrode signals are extracted and solved through the circuits and MCU in the sealed structure to obtain ammonia nitrogen, nitrate nitrogen, nitrite nitrogen and pH values, which are then input into the algorithm model in S3 to quickly detect the total nitrogen value.

[0009] Preferably, the method for detecting the nitrate nitrogen value by the total nitrogen sensor includes measuring the spectral absorbance of water quality in the 220nm and 300nm bands, thereby obtaining the nitrate nitrogen value, which is equivalent to using the spectral absorbance of 80 wavelengths.

[0010] Preferably, the total nitrogen sensor measures the ammonia nitrogen value, nitrite nitrogen value and pH value in the water quality by integrating a three-parameter sensor and connecting it to a spectral measurement system to form a detection method, which includes: The ion-selective electrodes for ammonia nitrogen, pH, and nitrite nitrogen are integrated into a sealed structure; The electrode signals are extracted and solved through the circuit and MCU in the sealed structure to obtain ammonia nitrogen, nitrite nitrogen and pH value; At the same time, the spectral system is used to detect the nitrate nitrogen value in the water quality, and multiple groups of samples are tested; The detection system is established by using the detection data composed of the total nitrogen sensor and the spectral system.

[0011] Preferably, the algorithm model formula input into the detection system is: .

[0012] Preferably, in S2, the ammonia nitrogen value detected for each group , Nitrate nitrogen value and nitrite nitrogen value The data were summed with the total nitrogen value A linear model is established between them to improve the accuracy of the self-training model to obtain evaluation data. The steps are as follows: S2.1 Initial model training: Use the labeled data set to train the initial model to obtain the initial model; S2.2 Self-data labeling: using the initial model to predict the unlabeled data set, and generating a pseudo-labeled data set based on the prediction results; S2.3 Self-training iteration: merge the pseudo-annotated dataset with the annotated dataset, retrain the model, and obtain an updated model; repeat steps S2.1 and S2.2 until the model accuracy reaches a preset threshold or the number of iterations reaches a preset upper limit; S2.4 Accuracy evaluation: The accuracy of the final model will be evaluated by evaluating the data.

[0013] Preferably, in step S2.3, the model training uses the following calculation formula to update the weights:

[0014] in, : is the parameter vector of the model, which contains all the parameters that need to be learned in the model. For example, in a neural network, It may contain the connection weights and bias terms between all neurons. Indicated in The parameter value at the iteration; Represents the learning rate.

[0015] : is the learning rate, which is a hyperparameter used to control the step size of each parameter update. The learning rate determines the speed at which the model advances during the optimization process. If the learning rate is too large, the model may miss the optimal solution or even fail to converge; if the learning rate is too small, the training process will become very slow. Represents the loss function About Model Parameters The gradient of Represents the model's response to input data The prediction results, Represents the true annotation of the data.

[0016] It should be noted that the loss function Used to measure model prediction results With the true label The difference between the two, the gradient represents the loss function at the current parameter value The negative sign indicates that the parameters should be updated along the direction in which the loss function decreases fastest.

[0017] : Based on the current parameters Model For input data prediction results. : It is the input data, usually a vector or matrix containing multiple features, representing the input sample of the model. : is the corresponding true label or target value, which is different from the input data Correspondingly, it is used to supervise the training of the model.

[0018] The purpose of using this formula is to continuously update the parameters of the model , so that the loss function The value of gradually decreases, so that the prediction results of the model As close as possible to the true label , that is, to find a set of optimal parameters , so that the model has the best performance on the given training data. In each iteration of this embodiment, the loss function is first calculated with respect to the current parameters Gradient , and then set the current parameter Move one step in the direction of the negative gradient , get the updated parameters This process is repeated until the loss function converges to a smaller value or reaches a preset number of iterations or other stopping conditions.

[0019] Preferably, the precise evaluation in step 2.4 is calculated using the following formula:

[0020] in, represents the true positive examples, that is, the number of samples correctly predicted by the model as positive; represents true negative examples, that is, the number of samples correctly predicted by the model as negative; represents false positive examples, that is, the number of negative samples that the model incorrectly predicts as positive; Represents false negative examples, that is, the number of positive samples that the model incorrectly predicts as negative.

[0021] Preferably, in step S2.4, through self-training iterations, the accuracy of the model on the same test set is significantly improved compared to the initial model, and the improvement is at least X%, where X is a preset accuracy improvement threshold.

[0022] Technical effects and advantages of the present invention: The total nitrogen rapid detection method of the present invention overcomes the shortcomings of the traditional chemical method, such as long detection time, the need to treat chemical waste liquid, and lack of real-time performance. Through direct detection by the sensor, there is no need to return to the laboratory for testing after sampling, and the results can be obtained quickly to meet the needs of continuous water quality monitoring on site. For example, in the embodiment, the sensor can be installed to monitor in real time, and once the total nitrogen value exceeds the set threshold, it can be warned in time, effectively improving the detection efficiency and timeliness.

[0023] A linear model is established by summing the ammonia nitrogen value, nitrate nitrogen value, and nitrite nitrogen value with the total nitrogen value, and inversion compensation is performed in combination with the pH value to obtain a more accurate total nitrogen value algorithm model. For example, in actual scenarios, considering that the ion selective electrode is affected by the pH value and will cause data deviation, the pH electrode measurement value is introduced for compensation, which greatly improves the accuracy of total nitrogen detection and provides reliable data support for water quality monitoring.

[0024] The total nitrogen sensor is small in size and easy to install, which solves the problem that the existing on-site detection instruments are large in size and cannot be installed in places where in-situ monitoring and installation size requirements are required. Whether it is installed at a monitoring station on the lake shore or on a water source water intake pipeline, it can be easily realized and has strong adaptability, and can be widely used in the monitoring of various water environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a structural schematic diagram of the total nitrogen sensor of the present invention;

[0026] Figure 2 This is a schematic diagram of the distribution structure of each electrode of the total nitrogen sensor of the present invention;

[0027] Figure 3 This is a schematic diagram of data distribution in Table 1 of the present invention;

[0028] Figure 4 It is a schematic diagram of the linear relationship between the total nitrogen and the sum of the ammonia nitrogen value, the nitrate nitrogen value and the nitrite nitrogen value of the present invention;

[0029] Figure 5 It is a linear relationship diagram between the total nitrogen value and pH of the present invention;

[0030] Figure 6 It is a data chart showing the influence of pH on the total nitrogen value of the present invention;

[0031] Figure 7 A waveform diagram between the spectral wavelength and the spectral wavelength absorbance of the nitrate nitrogen of the present invention;

[0032] Figure 8 For the present invention Figure 4 Slope-intercept calculation diagram;

[0033] Fig. 9 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] As attached Figure 1-Figure 9 A rapid detection method for total nitrogen for early warning is shown, comprising the following steps: S1: Ammonia nitrogen values ​​at different locations in water quality , Nitrate nitrogen value , Nitrite nitrogen value , Value and total nitrogen value Conduct tests and record multiple sets of test data; The specific data are as follows Table 1: Sample No. Ammonia nitrogen (mg / L) Nitrate nitrogen (mg / L) Nitrite nitrogen (mg / L) Total nitrogen (mg / L) Ammonia nitrogen / total nitrogen (%) Nitrate nitrogen / total nitrogen (%) Nitrite nitrogen / total nitrogen (%) Ammonia nitrogen + nitrate nitrogen + nitrite nitrogen / total nitrogen (%) pH 1 0.02 3.79 0.17 4.39 0.46 86.3 3.84 90.6 7.41 2 0.06 3.54 0.02 4.2 1.44 84.2 0.44 86.08 7.16 3 0.09 5.20 0.23 6.2 1.45 83.9 3.63 88.98 6.95 4 0.73 1.74 0.17 2.69 27.2 64.5 6.48 98.18 7.67 5 0.93 2.26 0.32 3.71 25 61 8.75 94.75 7.39 6 0.10 1.41 0.10 1.77 5.42 79.7 5.5 90.62 7.85 7 3.54 8.23 0.47 12.82 27.6 64.2 3.65 95.45 8.12 8 0.70 1.55 0.23 2.7 26 57.4 8.56 91.96 7.66 9 2.00 7.88 0.28 10.58 18.9 74.5 2.6 96 7.15 10 0.78 2.30 0.23 3.45 22.6 66.6 6.8 96 7.21 11 0.25 6.23 0.27 6.87 3.69 90.7 3.93 98.32 7.39 12 0.93 2.69 0.32 4.1 22.7 65.5 7.74 95.94 7.45 13 0.86 2.15 0.36 3.64 23.7 59 9.93 92.63 8.56 14 0.39 6.65 0.14 7.32 5.32 90.9 1.85 98.07 6.89 15 0.02 3.76 0.06 4.39 0.4 85.7 1.3 87.4 7.94 16 1.78 6.05 0.32 8.58 20.7 70.5 3.71 94.91 7.82 17 0.04 4.61 0.05 5.71 0.62 80.7 0.96 82.28 7.08 18 0.02 3.67 0.02 4.51 0.46 81.4 0.39 82.25 8.16 19 1.00 2.64 0.34 4.1 24.32 64.4 8.32 97.04 8.27 20 1.57 6.62 0.24 8.62 18.2 76.8 2.84 97.84 7.94 21 0.73 5.83 0.24 6.89 10.6 84.6 3.5 98.7 7.47 22 0.02 3.15 0.02 3.68 0.43 85.7 0.47 86.6 7.18 Here, the data collected by S1 is the basis for S2 to establish a linear model. Without the data collection of S1, an accurate linear model cannot be established. The data collection of S1 is mainly based on ammonia nitrogen (mg / L), nitrate nitrogen (mg / L), nitrite nitrogen (mg / L) and total nitrogen (mg / L). Further including, ammonia nitrogen / total nitrogen (%), nitrate nitrogen / total nitrogen (%), nitrite nitrogen / total nitrogen (%), ammonia nitrogen + nitrate nitrogen + nitrite nitrogen / total nitrogen (%), and twenty-two sample cases were tested. The total nitrogen sensor measures the ammonia nitrogen value, nitrite nitrogen value and pH value in the water quality through a three-parameter sensor integrated and connected to a spectral measurement system to form a detection method. The ion-selective electrodes of ammonia nitrogen, pH, and nitrite nitrogen are integrated in a sealed structure. This integration method can reduce the volume of the sensor and improve the convenience and efficiency of detection. The circuit in the hollow rod and the MCU extract and solve the electrode signal to obtain the ammonia nitrogen, nitrite nitrogen and pH value, and use the processing power of modern electronic technology and microcontrollers to achieve rapid and accurate detection of multiple parameters. At the same time, the spectral system is used to detect the nitrate nitrogen value in the water quality, and multiple groups of samples are tested together. This is because in actual use, the nitrate nitrogen electrode will be affected by potassium ions, calcium ions, etc., which will affect the measurement accuracy. The spectral method for detecting nitrate nitrogen has the advantages of no ion interference, lower detection limit, and higher resolution. For example, in the case of extremely low concentrations, the spectrum of nitrate nitrogen is clear and distinct, and the detection resolution can reach μg / L. The resolution of the sensor electrode method is generally 10μg / L. Through the combination of spectral method and ion selective electrode method, the content of various nitrogen elements can be detected more accurately, thereby improving the accuracy and reliability of total nitrogen detection. Fast and accurate: By establishing a linear model and adopting advanced detection technologies such as spectroscopy, the total nitrogen content in water quality can be detected quickly and accurately, overcoming the shortcomings of traditional chemical methods that the detection time is long and the accuracy is affected by many factors. It also has strong anti-interference ability: the use of spectroscopy to detect nitrate nitrogen avoids the influence of ion interference on the detection accuracy and improves the reliability of the test results. It has important application value, especially in some special water quality environments, such as water bodies containing more potassium ions and calcium ions, or mineral water sources with high requirements for detection accuracy, and tap water plant process monitoring.

[0036] The reason for choosing a linear model that needs to be explained here is that it has low requirements for data volume and data features. Low requirements for data volume: Linear models can also show good fitting effects and generalization capabilities when the amount of data is relatively small, because their simple structure is not prone to overfitting. For example, on some small data sets, linear models can converge quickly and obtain relatively reliable results. Nonlinear models usually require a large amount of data to learn complex patterns and relationships, otherwise they are prone to overfitting, resulting in poor performance on new data. Low requirements for data features: Linear models are relatively weakly dependent on data features and do not require too much preprocessing and feature engineering of the data. It can directly process numerical features, and although its ability to capture interactions and nonlinear relationships between features is limited, in some simple problems, basic features can meet the needs of the model. Nonlinear models may have high requirements for data features, and often require complex operations such as feature selection and feature extraction to mine potential information in the data and improve model performance.

[0037] S2: By measuring the ammonia nitrogen value of each group , Nitrate nitrogen value and nitrite nitrogen value The data were summed with the total nitrogen value A linear model is established between , where a is the intercept and b is the slope; the data of ammonia nitrogen, nitrate nitrogen and nitrite nitrogen values ​​of each group are summed up, and a linear model is established between them and the total nitrogen value, that is, This is based on the principle that in water, total nitrogen is mainly composed of ammonia nitrogen, nitrate nitrogen and nitrite nitrogen. By establishing a linear relationship between them, the total nitrogen value can be quickly estimated when the content of ammonia nitrogen, nitrate nitrogen and nitrite nitrogen is known. By analyzing and fitting a large amount of test data, the coefficients in the linear model are determined. and , so that the model can accurately reflect the actual situation. In this embodiment, by fitting 22 sets of data, the linear model is obtained as follows: ,in , these coefficients are obtained based on specific test data, are targeted and accurate, and can provide an effective calculation basis for subsequent total nitrogen detection. Here is an explanation of 22 sets of data: the 22 sets of data in the table are mainly used to prove the establishment of the total nitrogen early warning method, so they are samples of different rivers, indicating the establishment of the early warning method. In this embodiment, the data is 22 sets of data tables are related fitting diagrams.

[0038] In S2, the ammonia nitrogen value of each group was tested , Nitrate nitrogen value and nitrite nitrogen value The data were summed with the total nitrogen value A linear model is established between them to improve the accuracy of the self-training model to obtain evaluation data. The steps are as follows: S2.1 Initial model training: Use the labeled data set to train the initial model to obtain the initial model; S2.2 Self-data labeling: using the initial model to predict the unlabeled data set, and generating a pseudo-labeled data set based on the prediction results; S2.3 Self-training iteration: merge the pseudo-annotated dataset with the annotated dataset, retrain the model, and obtain an updated model; repeat steps S2.1 and S2.2 until the model accuracy reaches a preset threshold or the number of iterations reaches a preset upper limit; S2.4 Accuracy evaluation: The accuracy of the final model will be evaluated by evaluating the data.

[0039] In step S2.3, the model training uses the following calculation formula to update the weights:

[0040] in, Indicates The parameters of the model at the iteration, represents the learning rate, Represents the loss function About Model Parameters The gradient of Represents the model's response to input data The prediction results, Represents the true annotation of the data.

[0041] Preferably, the precise evaluation in step S2.4 is calculated using the following formula:

[0042] in, represents true positive examples, that is, the number of samples correctly predicted by the model as positive; represents true negative examples, that is, the number of samples correctly predicted by the model as negative; represents false positive examples, that is, the number of negative samples that the model incorrectly predicts as positive; Represents false negative examples, that is, the number of positive samples that the model incorrectly predicts as negative.

[0043] In step S2.4, through self-training iterations, the accuracy of the model on the same test set is significantly improved compared to the initial model, with an improvement of at least ,in Increase the threshold for preset accuracy.

[0044] S3: Then the total nitrogen value is inverted and compensated according to each group of pH values ​​detected to obtain a more accurate total nitrogen value algorithm model: ,in, Correlation coefficient: Since the ion selective electrode will be affected by pH value in actual use, resulting in data deviation, it is necessary to introduce pH electrode to measure pH value for total nitrogen compensation. Figure 6 The pH value of the sample is analyzed to determine the pH correlation coefficient, thereby correcting the total nitrogen value calculated by the linear model and improving the accuracy of total nitrogen detection. In this embodiment, the pH correlation coefficient obtained is -0.08. It should be explained that -0.08 is caused by is the relevant compensation coefficient of the relevant pH to the total nitrogen, according to Figure 6 , pH = 9, total nitrogen = 6.15, the pH compensation model for total nitrogen was used to calculate Substituting it into the algorithm model can effectively compensate for the error caused by the influence of pH value, making the detection of total nitrogen value more accurate and reliable, and closer to the true value.

[0045] In another embodiment, in S3: the total nitrogen value is inversely compensated according to each group of pH values ​​detected, where each group of pH values ​​is evaluation data obtained through steps S2.1-S2.4.

[0046] S4: Input the algorithm model established in S3 into the internal system of the total nitrogen sensor, and connect an early warning analysis unit to the internal system of the total nitrogen sensor; in this step, the inventor considers how to set the early warning threshold in the early warning analysis unit and considers integrating the total nitrogen value algorithm model carefully established in S3 into the total nitrogen sensor. When the sensor detects data such as ammonia nitrogen, nitrate nitrogen, nitrite nitrogen, and pH value, it can quickly and automatically calculate the total nitrogen value based on the built-in algorithm model, without the need for manual complex data processing and model calculations, greatly improving the detection efficiency and convenience.

[0047] At the same time, the warning analysis unit is connected to the internal system of the total nitrogen sensor, and the role of this module is crucial. It monitors and analyzes the calculated total nitrogen value in real time and compares it with the pre-set warning threshold. Once the total nitrogen value exceeds this threshold, the warning analysis unit will immediately issue an alarm signal. For example, in some waters with strict water quality requirements, such as drinking water sources and aquaculture areas, if the total nitrogen content is too high, it may indicate that the water body is at risk of eutrophication, increased pollution, or other conditions that are not conducive to ecological balance and biological survival. Through this early warning mechanism, relevant personnel, such as environmental monitoring personnel, water management personnel, farmers, etc., can be informed of abnormal total nitrogen in water quality at the first time, so as to take targeted measures in time, such as strengthening water purification, adjusting breeding strategies, and checking pollution sources, so as to ensure the stability and safety of the aquatic ecosystem, and ensure the sustainable use of water resources and the normal progress of related production and life activities.

[0048] Different water uses have different water quality standards. In the implementation of the present invention, for drinking water sources, according to the "Sanitary Standards for Drinking Water" stipulated by the state, the total nitrogen content is generally required to be relatively strict. If it exceeds the value specified in the corresponding standard, it will pose a potential risk to human health. In this case, the warning threshold can be set to a value less than or equal to the standard value to detect the trend of water quality deterioration in advance.

[0049] For general surface water areas, according to the "Surface Water Environmental Quality Standards", different water quality categories have different requirements for total nitrogen content. For example, the total nitrogen standard for Class III water is about 1.0 mg / L. When monitoring such water areas, the warning threshold can be set close to 1.0 mg / L or slightly higher, so that when the total nitrogen content approaches the critical value that may cause the water quality category to decline, a timely warning can be issued.

[0050] On the other hand: In aquaculture waters, excessive total nitrogen content may lead to excessive reproduction of algae, consume dissolved oxygen in the water, and cause aquatic organisms to die of hypoxia. The setting of the warning threshold should take into account the tolerance of the cultured organisms. In an embodiment of the present invention, for fish farming waters with high water quality requirements, the total nitrogen content warning threshold may be set at a lower level, which may be set at around 3 mg / L, to ensure the normal growth and living environment of fish.

[0051] For wetland waters with ecological protection functions, even slight changes in total nitrogen content may affect the balance of the wetland ecosystem. Taking into account the sensitivity of wetland plants and animals to water quality, the warning threshold can be set based on the research results and historical data of the wetland ecosystem, which may be more stringent than the requirements for general waters to prevent eutrophication from damaging the wetland ecology. Furthermore, the setting is combined with historical data, which is formed by recording each collection data. In a specific implementation method, the total nitrogen content of the water area is normally stable between 0.5-1.0 mg / L, but it will increase during the rainy season or when there are agricultural activities in the surrounding area. Then the warning threshold can be set according to the historical increase, such as setting it to 1.5 mg / L, and an early warning will be issued when this value is exceeded.

[0052] High integration and small size: The total nitrogen sensor adopts the design of integrating three parameter sensors and connecting the spectral measurement system. It is small in size, easy to install and deploy, and can be widely used in different water environments, reducing the detection cost and the difficulty of equipment installation. S5: The total nitrogen sensor in S4 is installed in the detected waters, and the total nitrogen sensor is used for rapid detection and early warning. The total nitrogen sensor we use is mounted on the drone inspection, which not only has an advantage in size, but also realizes remote rapid detection.

[0053] Direct rapid detection through the total nitrogen sensor can solve the problems of the traditional chemical method, such as long detection time, the need to treat chemical waste liquid, avoid secondary pollution of the environment, lack of real-time performance, and inability to meet monitoring needs. The total nitrogen sensor is small in size and easy to install. Furthermore. The total nitrogen sensor in S4 is installed in the water area to be tested, and the total nitrogen sensor is used for rapid detection and early warning. Direct rapid detection through the total nitrogen sensor can overcome many shortcomings of traditional chemical detection, such as long detection time, the need to treat chemical waste liquid, and lack of real-time performance. The total nitrogen sensor is small in size and easy to install. It can be flexibly deployed in different water environments to achieve real-time and continuous monitoring of total nitrogen in water quality.

[0054] At the same time, the early warning function can timely remind relevant personnel of abnormal water quality so that corresponding measures can be taken to deal with it and ensure the stability and safety of the ecological environment of the water area. In Example 2, the total nitrogen sensor is installed on the water intake pipeline of the water source to monitor the total nitrogen content in real time. During the monitoring process, it is found that although the total nitrogen content of the mineral water source is generally low, it will fluctuate slightly during certain periods. By detecting nitrate nitrogen by spectroscopy, ion interference is effectively avoided, and changes in nitrate nitrogen content are accurately detected. By analyzing the detection data, the stability of the water quality of the water source can be further understood, providing a basis for water quality assurance for mineral water production enterprises, ensuring that product quality meets standards, and reflecting the effectiveness and importance of the present invention in practical applications.

[0055] like Figure 7As shown, the specific spectral method mentioned above detects nitrate nitrogen: the spectral method for measuring nitrate nitrogen adds an example of tap water detection. Since chlorine is often used for disinfection and sterilization in the disinfection stage during the preparation of tap water, chloride ions will affect the measurement of nitrate nitrogen electrodes and cause interference. Therefore, the spectral method is used to measure nitrate nitrogen, which has the advantages of high accuracy and real-time performance. It can effectively monitor the water quality of each stage of tap water preparation. In order to ensure the quality of water production process, the sensor instrument is connected to the water plant system to provide an effective monitoring basis for modern unmanned water plants to reduce labor costs and provide effective support for ensuring production quality.

[0056] like Figure 7 The middle node is the spectral detection of water quality at some tap water process nodes. From the raw water, sedimentation tank effluent, sand filter effluent, carbon filter effluent, and disinfection tank effluent, it can be seen that the spectral absorption of nitrate nitrogen at around 220nm by the spectral method has a good gradient distribution, which can effectively monitor the low-concentration nitrate nitrogen content at each stage in the tap water preparation process.

[0057] As attached Figure 1 and 2 As shown, the function of the reference electrode is to provide a stable potential reference for the detection electrode, ensuring that the potential of the working electrode remains at a fixed level, thereby ensuring the accuracy of the measurement.

[0058] The role of the reference electrode in the total nitrogen sensor is to provide a stable potential reference for the detection electrode, ensuring that the potential of the working electrode remains at a fixed level, thereby ensuring the accuracy of the measurement. This helps to understand the working principle and structural design of the total nitrogen sensor.

[0059] like Figure 4 and Figure 8 As shown, equation The equation in the table is , which is the basic equation form of linear regression. Among them, y is the dependent variable, x is the independent variable, a is the intercept, and b is the slope. The weight term is marked as "unweighted", which means that no different weights are given to the data points when performing linear regression analysis. All data points are treated equally in the calculation.

[0060] The value of the intercept is 0.03023 ± 0.01645. The intercept represents the value of the dependent variable y when the independent variable x = 0. The intercept here has a standard error of ± 0.01645. The value of the slope is 1.1317 ± 0.002675. The slope represents the average change in the dependent variable y for each unit increase in the independent variable x. The slope here also has a standard error of ± 0.002675. The value of the residual sum of squares is 0.00234. The residual sum of squares is a measure of the goodness of fit of the model. It represents the sum of the squares of the differences between the actual values ​​and the predicted values. The smaller the residual sum of squares, the better the model fits the data.

[0061] The value of Pearson's correlation coefficient is 0.99861. Pearson's correlation coefficient measures the strength and direction of the linear relationship between two variables. Its value range is between -1 and 1. The closer the absolute value is to 1, the stronger the linear relationship is. The correlation coefficient here is negative, indicating that there is a negative correlation between the independent variable and the dependent variable.

[0062] The R-squared value is 0.99721. R-squared is also called the coefficient of determination, which indicates the proportion of the variation of the dependent variable that can be explained by the independent variable. The R-squared value here is 0.89342, which means that the independent variable can explain about 89.342% of the variation of the dependent variable.

[0063] The value of the adjusted R-squared is 0.99666. The adjusted R-squared takes into account the number of independent variables in the model and adjusts the R-squared to avoid overfitting due to too many independent variables. Its value is slightly smaller than the R-squared, indicating that the fit of the model has been adjusted when considering the number of independent variables. Figure 8 Key statistical indicators of linear regression analysis are provided to show the fit of the model and the relationship between variables. These indicators are very important for evaluating the reliability and validity of the linear regression model.

[0064] As attached Figure 7 As shown, in actual use, the nitrate nitrogen electrode will be affected by the interference of potassium ions and calcium ions, affecting the measurement accuracy. According to the data, nitrate nitrogen accounts for most of the total nitrogen content. At the same time, there is a detection deviation or even failure to detect the mineral water that can reach the first-class index or can be directly drunk. The spectral method for detecting nitrate nitrogen scans the spectrum of the water body, so it is not affected. At the same time, the spectral measurement has the advantages of lower detection limit and higher resolution. As shown in the figure, the horizontal axis is the spectral wavelength of the nitrate nitrogen standard solution, and the axis coordinate is the absorbance of the corresponding spectral wavelength. At the same time, it can be seen from the figure that under extremely low concentrations, the spectrum of nitrate nitrogen is clear and distinct, and the detection resolution can reach μg / L. The resolution of the sensor electrode method is generally 10μg / L.

[0065] The total nitrogen sensor measures the ammonia nitrogen value, nitrite nitrogen value and pH value in the water quality by integrating a three-parameter sensor and connecting a spectral measurement system to form a detection method, which includes: The ion-selective electrodes for ammonia nitrogen, pH, and nitrite nitrogen are integrated into a sealed structure; The electrode signals are extracted and solved through the circuit and MCU in the sealed structure to obtain ammonia nitrogen, nitrite nitrogen and pH value; At the same time, the spectral system is used to detect the nitrate nitrogen value in the water quality, and multiple groups of samples are tested; The detection system is established by using the detection data composed of the total nitrogen sensor and the spectral system.

[0066] The algorithm model formula input in the detection system is: .

[0067] Embodiment 1

[0068] Select a mineral water source with special geological conditions as the test object. Prepare multiple sets of ammonia nitrogen sensors, nitrate nitrogen sensors, nitrite nitrogen sensors, pH sensors and total nitrogen sensors, and ensure that the sensors are calibrated and the accuracy meets the requirements; Sampling and testing were carried out at different locations and depths of the water source, as shown in Table 1; The collected ammonia nitrogen, nitrate nitrogen and nitrite nitrogen values ​​were summed and a linear model was established between them and the total nitrogen value. The 22 sets of data were fitted using data analysis software and the linear model was obtained as follows: ,in ; According to each group of tests The total nitrogen value is inverted and compensated. We analyze the samples under the value and obtain ,in, .

[0069] The algorithm model established above is input into the internal system of the total nitrogen sensor and connected to the early warning analysis unit. The total nitrogen sensor is installed at the monitoring station on the shore of the lake. The sensor is connected to the data acquisition and processing equipment on the shore through a cable to ensure real-time data transmission.

[0070] Start the sensor for continuous monitoring. When the total nitrogen value is detected to exceed the set warning threshold (for example, 5 mg / L), the warning analysis unit will issue an alarm to indicate that the lake may be at risk of eutrophication, and relevant personnel can take timely measures to manage and control it.

[0071] Embodiment 2 Select a mineral water source with special geological conditions as the test object, prepare high-precision ammonia nitrogen sensors, nitrate nitrogen sensors, nitrite nitrogen sensors, pH sensors and spectral measurement systems, as well as supporting data acquisition and analysis equipment; Sampling and testing were carried out at different locations and depths of the water source, as shown in Table 1; The linear model was established using the collected data, and the ,in ; The method of integrating three-parameter sensors and connecting them to the spectral measurement system is adopted. The ion-selective electrodes of ammonia nitrogen, pH, and nitrite nitrogen are integrated on the sealed structure, and the electrode signals are extracted and solved by the circuit and MCU to obtain the ammonia nitrogen, nitrite nitrogen and pH values; at the same time, the spectral system is used to detect the nitrate nitrogen value, and multiple groups of samples are tested. The established detection system algorithm model Input system. Install the total nitrogen sensor on the water intake pipe at the water source to monitor the total nitrogen content in real time.

[0072] During the monitoring process, it was found that although the total nitrogen content of the mineral water source was generally low, there were slight fluctuations during certain periods. The nitrate nitrogen was detected by spectroscopy, which effectively avoided ion interference and accurately detected the changes in nitrate nitrogen content. By analyzing the test data, we can further understand the stability of the water quality of the water source, provide a basis for water quality assurance for mineral water production companies, and ensure that product quality meets the standards.

[0073] The above-mentioned sealing structure is collectively referred to as a sealing structure, which can be a rod or a square. The sealing performance of the sealing structure selected here is to reach the IP68 sealing structure standard, which can achieve complete dustproof. And long-term continuous immersion in water of a certain depth (test under specific conditions, such as 1 meter water depth).

[0074] Through the above examples, the ammonia nitrogen value of each group detected , Nitrate nitrogen value and nitrite nitrogen value The data were summed with the total nitrogen value A linear model is established between them to improve the accuracy of the self-training model to obtain evaluation data. The steps are as follows: S2.1 Initial model training: Use the labeled data set to train the initial model to obtain the initial model; S2.2 Self-data labeling: using the initial model to predict the unlabeled data set, and generating a pseudo-labeled data set based on the prediction results; S2.3 Self-training iteration: merge the pseudo-annotated dataset with the annotated dataset, retrain the model, and obtain an updated model; repeat steps S2.1 and S2.2 until the model accuracy reaches a preset threshold or the number of iterations reaches a preset upper limit; S2.4 Accuracy evaluation: The accuracy of the final model will be evaluated by evaluating the data.

[0075] Preferably, in step S2.3, the model training uses the following calculation formula to update the weights:

[0076] in, : is the parameter vector of the model, which contains all the parameters that need to be learned in the model. For example, in a neural network, It may contain the connection weights and bias terms between all neurons. Indicated in The parameter value at the iteration; Represents the learning rate.

[0077] : is the learning rate, which is a hyperparameter used to control the step size of each parameter update. The learning rate determines the speed at which the model advances during the optimization process. If the learning rate is too large, the model may miss the optimal solution or even fail to converge; if the learning rate is too small, the training process will become very slow.

[0078] Represents the loss function About Model Parameters The gradient of Represents the model's response to input data The prediction results, Represents the true annotation of the data.

[0079] It should be noted that the loss function Used to measure model prediction results With the true label The difference between the two, the gradient represents the loss function at the current parameter value The negative sign indicates that the parameters should be updated along the direction in which the loss function decreases fastest.

[0080] : Based on the current parameters Model For input data prediction results. : It is the input data, usually a vector or matrix containing multiple features, representing the input sample of the model. : is the corresponding true label or target value, which is different from the input data Correspondingly, it is used to supervise the training of the model.

[0081] The purpose of using this formula is to continuously update the parameters of the model , so that the loss function The value of gradually decreases, so that the prediction results of the model As close as possible to the true label , that is, to find a set of optimal parameters , so that the model has the best performance on the given training data. In each iteration of this embodiment, the loss function is first calculated with respect to the current parameters Gradient , and then set the current parameter Move one step in the direction of the negative gradient , get the updated parameters This process is repeated until the loss function converges to a smaller value or reaches a preset number of iterations or other stopping conditions.

[0082] Preferably, the precise evaluation in step S2.4 is calculated using the following formula:

[0083] in, represents the true positive examples, that is, the number of samples correctly predicted by the model as positive; represents true negative examples, that is, the number of samples correctly predicted by the model as negative; represents false positive examples, that is, the number of negative samples that the model incorrectly predicts as positive; Represents false negative examples, that is, the number of positive samples that the model incorrectly predicts as negative.

[0084] Preferably, in step S2.4, through self-training iterations, the accuracy of the model on the same test set is significantly improved compared to the initial model, and the improvement is at least X%, where X is a preset accuracy improvement threshold.

[0085] Finally, a few points should be explained: First, in the description of the present invention, it should be noted that, unless otherwise specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, which may refer to mechanical connection or electrical connection, or internal communication between two components, or direct connection. "upper", "lower", "left", "right", etc. are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may change; Secondly: In the drawings of the embodiments disclosed in the present invention, only the structures related to the embodiments disclosed in the present invention are involved, and other structures can refer to the general design. In the absence of conflict, the same embodiment and different embodiments of the present invention can be combined with each other; Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A rapid detection method for total nitrogen for early warning, characterized in that: The following steps are involved: S1: Ammonia nitrogen values ​​at different locations in water quality , Nitrate nitrogen value , Nitrite nitrogen value , Value and total nitrogen value Conduct tests and record multiple sets of test data; S2: By measuring the ammonia nitrogen value of each group , Nitrate nitrogen value and nitrite nitrogen value The data were summed with the total nitrogen value A linear model is established between , where a is the intercept and b is the slope; S3: Then the total nitrogen value is inverted and compensated according to each group of pH values ​​detected to obtain a more accurate total nitrogen value algorithm model: ,in, is the correlation coefficient; S4: inputting the algorithm model established in S3 into the internal system of the total nitrogen sensor, and connecting an early warning analysis unit to the internal system of the total nitrogen sensor; S5: Install the total nitrogen sensor in S4 in the detected water area, and use the total nitrogen sensor for rapid detection and early warning.

2. A rapid detection method for total nitrogen for early warning according to claim 1, characterized in that: The ammonia nitrogen value, nitrate nitrogen value, nitrite nitrogen value and pH value in the water quality measured in S1 are respectively measured by an ammonia nitrogen sensor, a nitrate nitrogen sensor, a nitrite nitrogen sensor and a pH sensor.

3. A rapid detection method for total nitrogen for early warning according to claim 2, characterized in that: The total nitrogen sensor measures the ammonia nitrogen value, nitrate nitrogen value, nitrite nitrogen value and pH value in water quality through a four-parameter sensor integration method, which includes: Ion-selective electrodes for ammonia nitrogen, pH, nitrate nitrogen and nitrite nitrogen are integrated into a sealed structure; The electrode signals are extracted and solved through the sealed circuit and MCU to obtain the ammonia nitrogen, nitrate nitrogen, nitrite nitrogen and pH value, which are then input into the algorithm model in S3 to quickly detect the total nitrogen value.

4. A rapid detection method for total nitrogen for early warning according to claim 3, characterized in that: The method for detecting the nitrate nitrogen value by the total nitrogen sensor comprises measuring the spectral absorbance of water quality in the 220nm and 300nm bands, thereby obtaining the nitrate nitrogen value.

5. A rapid detection method for total nitrogen for early warning according to claim 1, characterized in that: The total nitrogen sensor measures the ammonia nitrogen value, nitrite nitrogen value and pH value in the water quality by integrating a three-parameter sensor and connecting a spectral measurement system to form a detection method, which includes: The ion-selective electrodes for ammonia nitrogen, pH, and nitrite nitrogen are integrated into a sealed structure; The electrode signals are extracted and solved through the circuit in the hollow rod and the MCU to obtain the ammonia nitrogen, nitrite nitrogen and pH value; At the same time, the spectral system is used to detect the nitrate nitrogen value in the water quality, and multiple groups of samples are tested; The detection system is established by using the detection data composed of the total nitrogen sensor and the spectral system.

6. A rapid detection method for total nitrogen for early warning according to claim 5, characterized in that: The algorithm model formula input in the detection system is: .

7. A rapid detection method for total nitrogen for early warning according to claim 6, characterized in that: In S2, the ammonia nitrogen value of each group was tested , Nitrate nitrogen value and nitrite nitrogen value The data were summed with the total nitrogen value A linear model is established between them to improve the accuracy of the self-training model. The steps are as follows: S2.1 Initial model training: Use the labeled data set to train the initial model to obtain the initial model; S2.2 Self-data labeling: using the initial model to predict the unlabeled data set, and generating a pseudo-labeled data set based on the prediction results; S2.3 self-training iteration: merging the pseudo-annotated dataset with the annotated dataset, retraining the model, and obtaining an updated model; Repeat steps S2.1 and S2.2 until the model accuracy reaches a preset threshold or the number of iterations reaches a preset upper limit; S2.4 Accuracy evaluation: The accuracy of the final model will be evaluated by evaluating the data.

8. A rapid detection method for total nitrogen for early warning according to claim 7, characterized in that: In step S2.3, the model training uses the following calculation formula to update the weights: ,in, Indicates The parameters of the model at the iteration, represents the learning rate, Represents the loss function About Model Parameters The gradient of Represents the model's response to input data The prediction results, Indicates the true label of the data.

9. A rapid detection method for total nitrogen for early warning according to claim 8, characterized in that: The precise evaluation in step S2.4 is calculated using the following formula: ,in, represents the true positive examples, that is, the number of samples correctly predicted by the model as positive; represents true negative examples, that is, the number of samples correctly predicted by the model as negative; represents false positive examples, that is, the number of negative samples that the model incorrectly predicts as positive; Represents false negative examples, that is, the number of positive samples that the model incorrectly predicts as negative.

10. A rapid detection method for total nitrogen for early warning according to any one of claims 7 to 9, characterized in that: In step S2.4, through self-training iterations, the accuracy of the model on the same test set is significantly improved compared to the initial model, with an improvement of at least ,in Increase the threshold for preset accuracy.

Citation Information

Patent Citations

  • N+ water quality parameter monitoring system

    CN108802319A

  • Intelligent portable ammonia nitrogen detector

    CN109142224A

  • Ecological environment monitoring pre-warning system and monitoring pre-warning method

    CN109507382A

  • Riverway water quality monitoring and early warning system

    CN111855935A

  • Aquaculture water environment early warning regulation and control method, device and system

    CN112986157A