Soil nitrogen content monitoring method and system
By combining data from optical measurement sensors and soil moisture sensors, and using a regression prediction model to predict soil nitrogen content, the problem of low accuracy in existing technologies is solved, achieving low-cost, high-precision real-time monitoring, and reducing groundwater pollution and production costs.
Patent Information
- Application Number
- CN202511207105.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-11-28
AI Technical Summary
Existing technologies are insufficient to achieve low-cost, high-precision real-time monitoring of soil nitrogen content, making it difficult to effectively address groundwater pollution problems in agricultural areas.
By combining data from optical measurement sensors and soil moisture sensors, a regression prediction model is used to predict soil nitrogen content. The model is trained through regular soil chemical analysis to improve monitoring accuracy.
It enables low-cost, high-precision real-time monitoring of soil nitrogen content, reduces the risk of groundwater pollution, optimizes fertilization strategies, and lowers production costs.
Smart Images

Figure CN121026992A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of soil nitrogen leaching monitoring, in particular to a soil nitrogen content monitoring method and system. BACKGROUND
[0002] Nitrogen leaching is one of the main causes of groundwater pollution, especially in agricultural areas. Nitrogen leaching refers to the process by which nitrogen is transported from the soil to groundwater through water flow. This phenomenon is often closely related to agricultural activities, as the excessive use of nitrogen fertilizers can lead to the accumulation of nitrogen in the soil. When rainwater or irrigation water infiltrates the soil, it carries these excess nitrates (NO3-) into the groundwater, polluting the groundwater. The pollution mainly includes: 1) nitrate pollution, nitrate is one of the most common pollutants in groundwater. High concentrations of nitrate can make groundwater unsuitable for drinking and pose a risk to human health, especially for infants and pregnant women. Nitrate also promotes water eutrophication, leading to the degradation of aquatic ecosystems; 2) environmental impact, nitrogen leaching not only pollutes groundwater, but also flows into rivers and lakes through groundwater, leading to water eutrophication. This phenomenon can cause excessive growth of algae, reduce water transparency, and even form "dead zones", affecting the survival of aquatic organisms; 3) groundwater pollution increases water treatment costs and affects agricultural production and economic development. At the same time, contaminated groundwater resources will directly affect the quality of life and health of residents.
[0003] In recent years, low-cost, portable sensor systems have been developed to enable real-time monitoring of nitrogen content in soil on site. Nitrogen content monitoring includes soil chemical analysis, soil chemical sensing, and soil optical testing methods. Soil chemical analysis methods involve taking soil samples back to the laboratory for analysis to obtain accurate soil nitrogen content, but the sampling frequency is low, the sampling cost is high, and it is difficult to promote on a large scale. Soil chemical sensing methods can achieve real-time measurement of soil nitrogen content, but the measurement accuracy is low; soil optical measurement methods have low cost and low equipment maintenance cost, but like soil chemical sensing methods, the measurement accuracy is low. SUMMARY
[0004] The purpose of the present application is to provide a soil nitrogen content monitoring method and system that can effectively improve the accuracy of real-time monitoring of soil nitrogen content.
[0005] To achieve the above purpose, the present application provides the following solutions:
[0006] In a first aspect, the present application provides a soil nitrogen content monitoring method, comprising:
[0007] obtaining measurement data of the target region soil; the measurement data includes first data measured by an optical measurement sensor and humidity data measured by a soil humidity sensor; the first data includes total nitrogen content, organic nitrogen content, and reflectivity of the soil at wavelengths of 1450 nm, 1850 nm, 2250 nm, 2330 nm, and 2430 nm, respectively;
[0008] using the measurement data of the target region soil, the burial depth of the clay head, the burial depth of the soil humidity sensor, and the time of obtaining the measurement data as input data, and using a regression prediction model to obtain a nitrogen content prediction result of the target region soil; the nitrogen content prediction result includes total nitrogen content, organic nitrogen content, and inorganic nitrogen content of the target region soil; the regression prediction model is obtained by training an original regression prediction model using a plurality of sets of the measurement data of the target region soil, the burial depth of the clay head, the burial depth of the soil humidity sensor, and the time of obtaining the measurement data in each two planting cycles; the input data used in the training of the original regression prediction model is a plurality of sets of the measurement data of the target region soil, the burial depth of the clay head, the burial depth of the soil humidity sensor, and the time of obtaining the measurement data in the last two planting cycles; the label data used in the training of the original regression prediction model is total nitrogen content, organic nitrogen content, and inorganic nitrogen content of the target region soil obtained by chemical analysis of the target region soil using a soil chemical analysis device before the training; each set of the input data in the last two planting cycles corresponds to the same label data.
[0009] In a second aspect, the present application provides a soil nitrogen content monitoring system, comprising:
[0010] an optical measurement unit configured to measure first data of the target region soil; the first data includes total nitrogen content, organic nitrogen content, and reflectivity of the soil at wavelengths of 1450 nm, 1850 nm, 2250 nm, 2330 nm, and 2430 nm, respectively;
[0011] a soil humidity sensor configured to measure humidity data of the target region soil;
[0012] The data collector is configured to acquire first data of the optical measurement unit and humidity data measured by the soil humidity sensor, and obtain a nitrogen content prediction result of the target region soil by using a regression prediction model with the first data, the humidity data, a burying depth of the porcelain head in the optical measurement unit, a burying depth of the soil humidity sensor, and a time of acquiring the first data and the humidity data as input data; the regression prediction model is obtained by training an original regression prediction model with a plurality of sets of measurement data of the target region soil, the burying depth of the porcelain head, the burying depth of the soil humidity sensor, and the time of acquiring the measurement data in each two planting cycles; the input data used in the training of the original regression prediction model is a plurality of sets of measurement data of the target region soil, the burying depth of the porcelain head, the burying depth of the soil humidity sensor, and the time of acquiring the measurement data in the last two planting cycles; the label data used in the training of the original regression prediction model is total nitrogen content, organic nitrogen content, and inorganic nitrogen content of the target region soil obtained by chemical analysis of the target region soil by using a soil chemical analysis device before the training; each set of the input data in the last two planting cycles corresponds to the same label data.
[0013] According to the specific embodiments provided in the application, the application has the following technical effects:
[0014] The application provides a soil nitrogen content monitoring method and system. The method comprises the following steps: obtaining measurement data of target area soil; the measurement data comprises first data measured by an optical measurement sensor and humidity data measured by a soil humidity sensor; the first data comprises total nitrogen content, organic nitrogen content, and reflectivity of the soil at wavelengths of 1450nm, 1850nm, 2250nm, 2330nm, and 2430nm; and taking the measurement data, a buried depth of a ceramic soil head, a buried depth of the soil humidity sensor, and a time of obtaining the measurement data as input data, and obtaining a nitrogen content prediction result of the target area soil by using a regression prediction model; the regression prediction model is obtained by training an original regression prediction model by using a plurality of groups of measurement data of the target area soil, the buried depth of the ceramic soil head, the buried depth of the soil humidity sensor, and the time of obtaining the measurement data in each two planting cycles; and label data used in training of the original regression prediction model is obtained by performing chemical analysis on the target area soil by using a soil chemical analysis device before training, and the total nitrogen content, the organic nitrogen content, and the inorganic nitrogen content of the target area soil are obtained. The application can realize real-time monitoring and effectively improve the measurement accuracy of the soil nitrogen content by using the regression prediction model to monitor the nitrogen content of the target area soil on the basis of the measurement data of the optical measurement sensor, in combination with data such as soil humidity, sensor buried depth, and the time of obtaining the measurement data, and periodic (every two planting cycles) soil chemical analysis. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0016] Figure 1 A flowchart of a soil nitrogen content monitoring method provided in Embodiment 1 of the application is shown in the figure.
[0017] Figure 2 A regression prediction model framework provided in Embodiment 1 of the application is shown in the figure.
[0018] Figure 3 An encoding layer architecture of a regression prediction model provided in Embodiment 1 of the application is shown in the figure.
[0019] Figure 4 A Transformer layer architecture of a regression prediction model provided in Embodiment 1 of the application is shown in the figure.
[0020] Figure 5 The schematic diagram of the self-attention module operation architecture in the Transformer layer of the regression prediction model provided for Embodiment 1 of the present application;
[0021] Figure 6 The schematic diagram of a soil nitrogen content monitoring system provided for Embodiment 2 of the present application;
[0022] Figure 7 The deployment connection schematic diagram of the soil nitrogen content monitoring system provided for Embodiment 2 of the present application. DETAILED DESCRIPTION
[0023] The present application belongs to the following related technical fields:
[0024] Agricultural technology and information technology: The present application combines sensor technology, data processing and machine learning (neural networks) and other information technology means for optimizing soil nitrogen management in agricultural production. This makes it also belong to the field of agricultural technology, especially in precision agriculture and intelligent agriculture.
[0025] Monitoring and prediction technology: The present application helps optimize fertilization strategies and reduce environmental pollution by monitoring and predicting soil nitrogen content in real time. This also makes it belong to the field of monitoring and prediction technology, especially in soil and environmental monitoring.
[0026] Currently, soil nitrogen leaching monitoring techniques mainly include traditional methods and modern methods. The following are related prior art:
[0027] 1) Traditional methods:
[0028] Chemical analysis method: such as Kjeldahl method, used to determine the total nitrogen content of soil, but cannot distinguish different forms of nitrogen.
[0029] Soil sampling method: measures NO3-N concentration in soil by direct sampling, but is time-consuming and destructive.
[0030] 2) Modern methods:
[0031] Spectral technology: such as near-infrared spectroscopy (NIR), used for rapid, non-destructive detection of soil nitrogen and phosphorus content.
[0032] Sensor technology: including electrochemical sensors and ion-selective electrodes, capable of real-time monitoring of nitrogen and phosphorus content in soil.
[0033] CropX technology: uses real-time soil moisture, temperature and conductivity data to continuously monitor nitrogen leaching in soil.
[0034] 3) Monitoring equipment:
[0035] Suction Cups: used to collect soil solution samples to measure NO3-N concentration.
[0036] Drainage Lysimeters: directly measure the concentration and flow rate of NO3-N in soil solution.
[0037] Current agricultural needs: precision agriculture requires real-time monitoring of soil nitrogen content to optimize fertilization strategies and reduce environmental pollution. The present application can help precision agriculture in the following aspects: real-time monitoring of soil nitrogen content helps to ensure that crops receive adequate nitrogen nutrition, thereby increasing yield; excessive fertilization can lead to nitrogen leaching, polluting groundwater and water bodies, and by monitoring soil nitrogen content in real time, excessive fertilization can be avoided and environmental pollution can be reduced; through real-time monitoring and data analysis, fertilization strategies can be optimized to ensure that each mu of land receives adequate nitrogen supply and waste is reduced; through precision fertilization, unnecessary fertilizer use can be reduced and production costs can be reduced.
[0038] The present application uses optical measurement method sensors, combined with periodic soil chemical analysis, to realize data correlation, and considering the soil humidity situation, to improve the collection and use of limited data, and further improve the prediction accuracy.
[0039] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.
[0040] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail in combination with the drawings and specific embodiments.
[0041] Embodiment 1
[0042] In an exemplary embodiment, as shown in Figure 1 A soil nitrogen content monitoring method is provided, which comprises the following steps 201 to 202. Among them:
[0043] Step 201, obtaining the measurement data of the soil in the target area; the measurement data includes the first data measured by the optical measurement sensor and the humidity data measured by the soil humidity sensor; the first data includes total nitrogen content, organic nitrogen content and reflectivity of the soil at wavelengths of 1450nm, 1850nm, 2250nm, 2330nm and 2430nm.
[0044] In step 202, the measurement data of the target region soil, the buried depth of the clay head, the buried depth of the soil humidity sensor, and the time of obtaining the measurement data are taken as input data, and a regression prediction model is used to obtain a nitrogen content prediction result of the target region soil; the nitrogen content prediction result includes total nitrogen content, organic nitrogen content, and inorganic nitrogen content of the target region soil; the regression prediction model is obtained by training an original regression prediction model with a plurality of groups of the measurement data of the target region soil, the buried depth of the clay head, the buried depth of the soil humidity sensor, and the time of obtaining the measurement data in each two planting cycles; the input data used in the training of the original regression prediction model is a plurality of groups of the measurement data of the target region soil, the buried depth of the clay head, the buried depth of the soil humidity sensor, and the time of obtaining the measurement data in the last two planting cycles; the label data used in the training of the original regression prediction model is the total nitrogen content, the organic nitrogen content, and the inorganic nitrogen content of the target region soil obtained by chemical analysis of the target region soil by a soil chemical analysis device before the training; each group of the input data in the last two planting cycles corresponds to the same label data.
[0045] As an optional implementation, the determination process of the first data is as follows:
[0046] In step 301, the soil moisture of the target region soil is collected by the clay head.
[0047] In step 302, the soil moisture is extracted into the optical measurement sensor by the micro water pressure pump.
[0048] In step 303, the soil moisture is subjected to spectral analysis by the optical measurement sensor to determine the first data.
[0049] In this application, the regression prediction model (referred to as regression model) uses Transformer as the model basic architecture for realizing the prediction of time sequence state. As shown in Figure 1 The model input is the soil nitrogen content measured by the optical measurement sensor, including total nitrogen content, organic nitrogen content, reflectivity of the soil at 1450nm, 1850nm, 2250nm, 2330nm, and 2430nm wavelengths, and the installation depth of the clay head collection device, soil humidity data, and the installation depth of the soil humidity sensor. The model output is the total nitrogen content, organic nitrogen content, and inorganic nitrogen content in the soil obtained by soil chemical analysis.
[0050] Through two planting seasons, the measurement data of the target land is collected, and the regression prediction model is trained through the collected historical data, so as to be used for subsequent prediction of the total nitrogen content, organic nitrogen content, and inorganic nitrogen content in the soil according to the collection equipment installed in the soil.
[0051] As an optional implementation, the time interval of the humidity data acquisition is set to 1 minute; when the humidity data is greater than or equal to 70%, the time interval of the first data acquisition is set to 30 minutes; when the humidity data is less than 70%, the time interval of the first data acquisition is set to 1 minute.
[0052] This embodiment is to realize low-power and low-cost collection while avoiding the influence of invalid data. The soil humidity collection (acquisition) frequency is set to 1 minute, and the soil nitrogen collection frequency is set to 30 minutes. In addition, the Kalman filtering algorithm can be used to process the collected sensor data, on the one hand to eliminate abnormal data, and on the other hand to realize the average processing of the data. When the collected soil humidity data reaches 70% or more, it can be explained that the land has rainfall or irrigation behavior, and the current collected nitrogen data has strong characteristic characteristics. The nitrogen collection frequency of the collection device is increased to 1 minute once, and when the humidity data returns to below 70%, the nitrogen collection frequency returns to 30 minutes once.
[0053] Every 2 planting cycles (usually 1 year) use soil chemical analysis equipment to take samples and perform accurate soil nitrogen analysis in the laboratory to obtain soil nitrogen analysis data, and use it as label data for regression prediction model training to realize periodic training of the original regression prediction model and avoid cumulative errors.
[0054] As an optional implementation, as shown in Figure 2 The regression prediction model includes a normalization layer, an encoding layer, a Transformer layer and an output layer connected in sequence; wherein the normalization layer is used to normalize the input data except the time of acquiring the measurement data to obtain normalized data, and output the normalized data to the encoding layer; the encoding layer is used to extract features from the input normalized data, and output the extracted feature data to the Transformer layer; the Transformer layer is used to perform regression processing on the input feature data, and output the regression-processed feature data to the output layer; the output layer is used to integrate the input regression-processed feature data to output the nitrogen content prediction result of the target area soil.
[0055] The layers of the regression prediction model will be described below.
[0056] 1) Normalization layer
[0057] The total nitrogen content, organic nitrogen content, and soil reflectivity at wavelengths of 1450 nm, 1850 nm, 2250 nm, 2330 nm, and 2430 nm are normalized according to the maximum and minimum values in the range, and the processed data is a dimensionless number between 0 and 1. The specific normalization formula is as follows:
[0058]
[0059] where y represents one of the state data, is the normalized state data (normalized data), y min and y max represent the minimum and maximum values of the state data range, respectively.
[0060] 2) Encoding layer
[0061] The normalized state data is processed using a fully connected neural network, which is mainly used for feature extraction of the state data. As shown in Figure 3 , the encoding layer includes a first intermediate layer, a second intermediate layer, and a third intermediate layer. The first intermediate layer has 32 neurons, the second intermediate layer has 64 neurons, and the third intermediate layer has 32 neurons. The neurons are used for weighted summation of input data, addition of bias terms, and activation processing. The input of each neuron in the first intermediate layer is the normalized data. The input of each neuron in the second intermediate layer is the feature data output by all neurons in the first intermediate layer. The input of each neuron in the third intermediate layer is the feature data output by all neurons in the second intermediate layer. The feature data output by all neurons in the third intermediate layer is the extracted feature data. Figure 3 Only the schematic is shown, and all neurons in each intermediate layer are not shown.
[0062] Each neuron can be regarded as a calculation unit that receives input from the previous layer of neurons, performs weighted summation operation, adds a bias term, and outputs the final result through an activation function. The activation function uses the Relu function.
[0063] 3) Transformer layer
[0064] As shown in Figure 4 , the Transformer layer is an encoding layer of the Transformer architecture. The encoding layer of the Transformer architecture includes an embedding layer and an encoder. The input of the embedding layer is the extracted feature data. The input of the encoder is the data obtained by superimposing the output data of the embedding layer and the position encoding. The position encoding is the time at which the measurement data is obtained. The output of the encoder is the feature data after regression processing.
[0065] The representation of the time of obtaining the measurement data is the number of seconds from 0 o'clock Beijing time on the same day.
[0066] In some embodiments, the Transformer layer adopts 5 attention kernels, i.e. 5 sets of attention, the parameters are not shared, and the output result of the "2) encoding layer" at each time is taken as the input of the Transformer layer. In addition, the present application also adds position encoding (i.e. the number of seconds from 0 o'clock Beijing time on the same day as input) as the input of the multi-head attention module and is superimposed into the subsequent operation. The multi-head attention module is composed of multiple self-attention modules, each of which is operated with the input. The input part obtains Q, K and V through three sets of linear transformations respectively, and is operated as shown in the formula. Figure 5 Figure 5 In the formula, MatMul represents matrix multiplication, Scale represents data normalization to -1 to 1, Mask represents numerical filtering, here, since it is a regression operation, the Mask identifier is set to -1 to 1, which can pass, and the rest is 0, and softmax represents data processing using the following formula:
[0067]
[0068] In the formula, σ() j is the jth dimension of the output vector of the softmax layer, z is the input vector of the softmax, z j represents the jth dimension of the input, and the input dimension of the softmax layer is the same as the output dimension, which is K dimensions in total.
[0069] 4) Output layer
[0070] The output layer adopts a full-link neural network, which mainly integrates the output of the "3) Transformer layer" into a single value to realize the output.
[0071] In some embodiments, when two groups of optical measurement sensors, clay heads and soil humidity sensors are arranged at different positions of the target area soil, the regression prediction model includes two encoding layers, which are a first encoding layer and a second encoding layer; the first encoding layer and the second encoding layer are in a parallel relationship; the input of the first encoding layer is the normalized data corresponding to a group of optical measurement sensors, clay heads and soil humidity sensors; the input of the second encoding layer is the normalized data corresponding to another group of optical measurement sensors, clay heads and soil humidity sensors; the output of the first encoding layer and the output of the first encoding layer are both connected to the input of the embedding layer in the Transformer layer.
[0072] In this embodiment, the encoding layer of the normalized state data of each group (corresponding to a group of optical measurement sensors and soil moisture sensors) is defined separately, and the parameters are not repeated (shared).
[0073] Embodiment 2
[0074] Based on the same inventive concept, the embodiments of the present application also provide a soil nitrogen content monitoring system. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme described in the above method, so the specific limitations in one or more soil nitrogen content monitoring system embodiments provided below can be referred to the limitations of the soil nitrogen content monitoring method in the above, which will not be repeated here.
[0075] As shown in Figure 6 and Figure 7 The present embodiment provides a soil nitrogen content monitoring system comprising:
[0076] An optical measurement unit for measuring first data of soil in a target area; the first data includes total nitrogen content, organic nitrogen content, and reflectivity of soil at wavelengths of 1450 nm, 1850 nm, 2250 nm, 2330 nm, and 2430 nm.
[0077] A soil moisture sensor for measuring humidity data of soil in the target area.
[0078] A data collector for acquiring the first data of the optical measurement unit and the humidity data measured by the soil moisture sensor, and taking the first data, the humidity data, the burial depth of the porcelain head in the optical measurement unit, the burial depth of the soil moisture sensor, and the time of acquiring the first data and the humidity data as input data, and obtaining a nitrogen content prediction result of soil in the target area by using a regression prediction model; the regression prediction model is obtained by training an original regression prediction model with a plurality of sets of measurement data of soil in the target area, the burial depth of the porcelain head, the burial depth of the soil moisture sensor, and the time of acquiring the measurement data within every two planting cycles; the input data used by the original regression prediction model during training is a plurality of sets of measurement data of soil in the target area, the burial depth of the porcelain head, the burial depth of the soil moisture sensor, and the time of acquiring the measurement data within the last two planting cycles; the label data used by the original regression prediction model during training is the total nitrogen content, the organic nitrogen content, and the inorganic nitrogen content of soil in the target area obtained by chemical analysis of soil in the target area using a soil chemical analysis device before training; each set of input data in the last two planting cycles corresponds to the same label data.
[0079] The optical measurement unit comprises an optical measurement sensor, a clay head and a water pressure pump; the clay head is connected with the optical measurement sensor through a water pipe; the water pressure pump is arranged in the optical measurement sensor; the clay head is used for collecting soil moisture of a target region soil; the water pressure pump is used for extracting the soil moisture collected by the clay head into the optical measurement sensor; and the optical measurement sensor is used for performing spectral analysis on the soil moisture to determine first data.
[0080] With reference to Figure 7 In the present application, sensors and data collectors are installed on target land (i.e. target region soil), and the sensors include two types of optical measurement sensors and soil moisture sensors, and the number of sensors to be installed can be selected according to the soil range. The optical measurement sensor uses a sampling device such as a clay head to extract water in the soil into the optical measurement sensor through a miniature water pressure pump (i.e. water pressure pump), and then uses spectral technology such as near-infrared spectroscopy or ultraviolet-visible spectroscopy to monitor the nitrogen content in the extracted water in real time. The soil moisture sensor is a conventional soil moisture content sensor. The two types of sensors realize data transmission through a common RS485 interface, and the data collector can be driven by a low-power STM32 series chip, and the two types of sensors are connected to collect data of the sensors in real time.
[0081] As an optional implementation, the time interval of the data collector for acquiring the humidity data is 1 minute; when the humidity data is greater than or equal to 70%, the time interval of the data collector for acquiring the first data is 30 minutes; and when the humidity data is less than 70%, the time interval of the data collector for acquiring the first data is 1 minute.
[0082] The present application has the following beneficial effects:
[0083] A low-cost and high-precision soil nitrogen measurement method is provided, and high-precision soil nitrogen content is obtained through real-time measurement data.
[0084] The soil moisture parameter is used to improve the effectiveness of soil nitrogen measurement, realize dynamic measurement, and reduce invalid data.
[0085] The technical features of the above embodiments can be combined arbitrarily, and in order to make the description concise, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0086] The principles and implementation manners of the present application are described herein by using specific examples, and the above examples are only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges will have changes. In conclusion, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A method for monitoring soil nitrogen content, characterized in that, include: Acquire measurement data of soil in the target area; the measurement data includes first data measured by an optical measurement sensor and humidity data measured by a soil moisture sensor; the first data includes total nitrogen content, organic nitrogen content, and soil reflectance at wavelengths of 1450nm, 1850nm, 2250nm, 2330nm, and 2430nm, respectively; Using the soil measurement data, clay head burial depth, soil moisture sensor burial depth, and data acquisition time of the target area as input data, a regression prediction model is used to obtain the predicted nitrogen content of the soil in the target area. The predicted nitrogen content includes the total nitrogen content, organic nitrogen content, and inorganic nitrogen content of the soil in the target area. The regression prediction model is trained on an original regression prediction model using several sets of soil measurement data, clay head burial depth, soil moisture sensor burial depth, and data acquisition time within each two planting cycles. The input data used for training the original regression prediction model are several sets of soil measurement data, clay head burial depth, soil moisture sensor burial depth, and data acquisition time of the target area within the most recent two planting cycles. The label data used for training the original regression prediction model is the total nitrogen content, organic nitrogen content, and inorganic nitrogen content of the soil in the target area obtained by chemical analysis of the soil using soil chemical analysis equipment before training. Each set of input data in the most recent two planting cycles corresponds to the same label data.
2. The method for monitoring soil nitrogen content according to claim 1, characterized in that, The process of determining the first data is as follows: Soil moisture in the target area was collected using a clay head. The soil moisture is extracted into an optical measurement sensor using a miniature water pump; The soil moisture was analyzed by spectral analysis using an optical measurement sensor to determine the first data.
3. The method for monitoring soil nitrogen content according to claim 1, characterized in that, The time interval for acquiring the humidity data is set to 1 minute; when the humidity data is greater than or equal to 70%, the time interval for acquiring the first data is set to 30 minutes; when the humidity data is less than 70%, the time interval for acquiring the first data is set to 1 minute.
4. The method for monitoring soil nitrogen content according to claim 1, characterized in that, The regression prediction model comprises a normalization layer, an encoding layer, a Transformer layer, and an output layer connected in sequence. The normalization layer normalizes the input data (excluding the time of measurement data acquisition) to obtain normalized data, which is then output to the encoding layer. The encoding layer extracts features from the normalized input data and outputs the extracted features to the Transformer layer. The Transformer layer performs regression processing on the input features and outputs the regression-processed features to the output layer. The output layer integrates the regression-processed features and outputs the predicted nitrogen content of the soil in the target area.
5. The method for monitoring soil nitrogen content according to claim 4, characterized in that, The coding layer includes a first intermediate layer, a second intermediate layer, and a third intermediate layer; the first intermediate layer has 32 neurons; the second intermediate layer has 64 neurons; and the third intermediate layer has 32 neurons; the neurons are used to perform weighted summation, add bias terms, and activate the input data. The input to each neuron in the first intermediate layer is the normalized data; the input to each neuron in the second intermediate layer is the feature data output by all neurons in the first intermediate layer; the input to each neuron in the third intermediate layer is the feature data output by all neurons in the second intermediate layer; and the feature data output by all neurons in the third intermediate layer is the extracted feature data.
6. The method for monitoring soil nitrogen content according to claim 5, characterized in that, The Transformer layer is the encoding layer of the Transformer architecture; the encoding layer of the Transformer architecture includes an embedding layer and an encoder; the input of the embedding layer is the extracted feature data; the input of the encoder is the data obtained by superimposing the output data of the embedding layer and the position encoding; the position encoding is the time of acquiring the measurement data; the output of the encoder is the feature data after regression processing.
7. The method for monitoring soil nitrogen content according to claim 4, characterized in that, When two sets of optical measurement sensors, clay heads, and soil moisture sensors are set at different locations in the soil of the target area, the regression prediction model includes two encoding layers, namely the first encoding layer and the second encoding layer; the first encoding layer and the second encoding layer are parallel; the input of the first encoding layer is the normalized data corresponding to one set of optical measurement sensors, clay heads, and soil moisture sensors; the input of the second encoding layer is the normalized data corresponding to another set of optical measurement sensors, clay heads, and soil moisture sensors; the outputs of the first encoding layer and the second encoding layer are both connected to the input of the embedded layer in the Transformer layer.
8. A soil nitrogen content monitoring system, characterized in that, include: An optical measurement unit is used to measure first data of the soil in the target area; the first data includes total nitrogen content, organic nitrogen content, and soil reflectance at wavelengths of 1450nm, 1850nm, 2250nm, 2330nm, and 2430nm, respectively. Soil moisture sensor, used to measure soil moisture data in a target area; A data acquisition unit is used to acquire first data from the optical measurement unit and humidity data measured by the soil moisture sensor. Using the first data, the humidity data, the burial depth of the clay head in the optical measurement unit, the burial depth of the soil moisture sensor, and the time of acquiring the first data and the humidity data as input data, a regression prediction model is used to obtain a predicted result for the nitrogen content of the soil in the target area. The regression prediction model is trained on an original regression prediction model using several sets of the first data, the humidity data, the burial depth of the clay head, the burial depth of the soil moisture sensor, and the time of acquiring the measurement data within every two planting cycles. The input data used during the training of the original regression prediction model consists of several sets of the first data, the humidity data, the burial depth of the clay head, the burial depth of the soil moisture sensor, and the time of acquiring the measurement data within the most recent two planting cycles. The label data used during the training of the original regression prediction model consists of the total nitrogen content, organic nitrogen content, and inorganic nitrogen content of the soil in the target area obtained by chemical analysis of the soil in the target area using soil chemical analysis equipment before training. Each set of input data in the most recent two planting cycles corresponds to the same label data.
9. The soil nitrogen content monitoring system according to claim 8, characterized in that, The optical measurement unit includes an optical measurement sensor, a clay head, and a water pump; the clay head is connected to the optical measurement sensor via a water pipe; the water pump is installed inside the optical measurement sensor; the clay head is used to collect soil moisture from the target area; the water pump is used to extract the soil moisture collected by the clay head into the optical measurement sensor; The optical measurement sensor is used to perform spectral analysis on the soil moisture to determine the first data.
10. The soil nitrogen content monitoring system according to claim 8, characterized in that, The data acquisition device acquires the humidity data at a time interval of 1 minute; when the humidity data is greater than or equal to 70%, the data acquisition device acquires the first data at a time interval of 30 minutes; when the humidity data is less than 70%, the data acquisition device acquires the first data at a time interval of 1 minute.