Dynamic monitoring, regulating and controlling method and system for nitrogen conversion process

By using multi-layer node sensors and data fusion technology, nitrogen consumption can be monitored and controlled in real time, solving the problem of lagging cross-media monitoring in existing technologies. This enables accurate monitoring of nitrogen consumption and risk prediction, improving the precision of nitrogen management and environmental sustainability.

CN121476530APending Publication Date: 2026-02-06NINGXIA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511650034.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve accurate real-time monitoring and data integration of nitrogen consumption across media in complex scenarios involving multiple environmental interactions. This is especially true in the soil-plant-atmosphere continuum, where existing methods are time-consuming and data updates are delayed, failing to reflect real-time changes in nitrogen at different soil depths, in the rhizosphere, or in plant tissues.

Method used

Initial monitoring data is acquired by deploying multi-layer node sensors, feature vectors are determined by using support vector machine algorithm, cross-media datasets are integrated by combining data fusion technology, spatiotemporal distribution maps are generated by cluster analysis method, nitrogen loss risk is predicted by time series prediction model, and control command signals are generated by PID control algorithm to realize real-time monitoring and control of nitrogen consumption.

Benefits of technology

It enables real-time monitoring of nitrogen consumption, ensures the accuracy of data integration, provides risk prediction and dynamic control schemes for future trace nitrogen loss, and improves the precision of nitrogen management and environmental sustainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121476530A_ABST
    Figure CN121476530A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic monitoring, regulation and control method and system for a nitrogen conversion process, and relates to the field of intelligent agriculture, and the method comprises the steps: obtaining initial monitoring data, and obtaining an original data set; according to the original data set, determining a feature vector by adopting a support vector machine algorithm; when the feature vector shows that the nitrogen concentration in the soil medium exceeds a preset threshold value, acquiring root adsorption data and atmospheric volatilization data of nitrogen, performing integration and classification by adopting a data fusion technology and a clustering analysis method, and calculating the conversion rate of the nitrogen in a root adsorption layer based on a classification result to obtain a space-time distribution diagram; extracting nitrogen consumption from the space-time distribution diagram to obtain a real-time consumption distribution result of nitrogen; based on the real-time consumption distribution result of the nitrogen element, predicting a risk level by adopting a time sequence prediction model; and according to the risk level, a PID control algorithm is adopted to generate a regulation and control instruction signal. According to the method, the real-time performance of nitrogen consumption monitoring and the accuracy of data integration can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart agriculture technology, and in particular to a method and system for dynamic monitoring and control of nitrogen conversion processes. Background Technology

[0002] Nitrogen, an indispensable nutrient element in agricultural production, is crucial for crop growth and the balance of the ecological environment. Its transformation process involves complex interactions between soil, plants, and the atmosphere, directly impacting agricultural yields and environmental sustainability. With the increasing global demand for food security and ecological protection, accurately understanding the dynamic changes of nitrogen in different environmental media has become a key area of ​​agricultural research.

[0003] Current technologies for monitoring nitrogen transformation typically rely on discrete sampling and analysis or detection equipment for single environments. These methods are significantly inadequate in capturing the dynamic flow of nitrogen across the soil-plant-atmosphere continuum. Especially in complex scenarios involving multiple environmental interactions, existing technologies struggle to achieve continuous monitoring across media. Sampling and analysis are time-consuming, data updates are delayed, and they cannot reflect real-time changes in nitrogen at different soil depths, in the rhizosphere, or in plant tissues.

[0004] Therefore, ensuring the real-time monitoring of nitrogen consumption and the accuracy of data integration in complex environments with multiple levels and multiple media has become a key issue for dynamic monitoring and control systems for nitrogen conversion.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] In view of this, the present invention provides a method and system for dynamic monitoring and control of nitrogen conversion process, in order to solve the problem that continuous monitoring across media cannot be achieved in complex regions in the prior art, realize real-time monitoring of nitrogen consumption, and ensure the accuracy of data integration.

[0007] This invention provides a method for dynamic monitoring and control of nitrogen conversion processes, comprising: Initial monitoring data was obtained by deploying multi-layer node sensors to obtain the original dataset of nitrogen distribution in the root adsorption layer; Based on the original dataset, the support vector machine algorithm is used to determine the dynamically changing feature vectors in each medium. When the feature vector shows that the nitrogen concentration in the soil medium exceeds a preset concentration threshold, the root adsorption data and atmospheric volatilization data of nitrogen are obtained through a sensor network to obtain a cross-media dataset. Based on the cross-media dataset, data fusion technology is used to integrate them to obtain a synchronized dataset; Based on the synchronous dataset, cluster analysis was used for classification. The conversion rate of nitrogen in the root adsorption layer was calculated based on the classification results. Based on the conversion rate, a spatiotemporal distribution map was generated using data visualization technology. The nitrogen consumption amount is extracted from the spatiotemporal distribution map to obtain the real-time nitrogen consumption distribution results; Based on the real-time consumption distribution results of nitrogen, a time-series prediction model is used to predict the risk level of future trace nitrogen loss. Based on the risk level, a PID control algorithm is used to calculate the nitrogen regulation demand, and a regulation command signal is generated based on the nitrogen regulation demand.

[0008] In some optional embodiments, determining the dynamically changing feature vectors in each medium using a support vector machine algorithm based on the original dataset includes: Preprocessing techniques were used to denoise and standardize the original dataset to obtain a normalized nitrogen concentration dataset. Based on the standardized nitrogen concentration dataset, a classification model is obtained by training using the support vector machine algorithm. Based on the classification model, the dynamically changing feature vectors in each medium are determined.

[0009] In some optional embodiments, the step of classifying the data using cluster analysis based on the synchronized dataset, calculating the conversion rate of nitrogen in the root adsorption layer based on the classification results, and generating a spatiotemporal distribution map based on the conversion rate using data visualization technology includes: Based on the synchronized dataset, the K-means algorithm is used for classification to obtain the dataset classification results; Based on the classification results of the dataset, the conversion rate of trace nitrogen in the root adsorption layer is calculated to generate preliminary spatiotemporal distribution data. Based on the preliminary spatiotemporal distribution data, the silhouette coefficient evaluation method is used to obtain the classification quality evaluation results; Based on the evaluation results, repeat the iterative optimization steps to generate spatiotemporal distribution data; Based on the spatiotemporal distribution data, a spatiotemporal distribution map is generated using data visualization technology.

[0010] In some optional embodiments, extracting nitrogen consumption from the spatiotemporal distribution map to obtain real-time nitrogen consumption distribution results includes: Based on the spatiotemporal distribution map, a graph neural network is used to generate a distance matrix; Based on the distance matrix, a hierarchical clustering method is used to obtain a hierarchical structure; Based on the aforementioned hierarchical structure, a real-time consumption sequence is generated using time series analysis methods. Spatial distribution features are extracted from the real-time consumption sequence to generate a spatial distribution matrix; When the nitrogen consumption in the spatial distribution matrix exceeds a preset consumption threshold, the density peak value is detected by a density clustering algorithm to determine the peak node. Based on the peak nodes, a fusion layer merging process is performed to generate a merged node consumption sequence; Consumption quantification indicators are extracted from the merged node consumption sequence to obtain the real-time nitrogen consumption distribution results.

[0011] In some optional embodiments, the step of predicting the risk level of future trace nitrogen loss using a time-series prediction model based on the real-time nitrogen consumption distribution results includes: Based on the real-time nitrogen consumption distribution results, the nitrogen is standardized and converted into a uniform dimension sequence to obtain a preprocessed sequence. The preprocessed sequence is subjected to outlier detection using the isolated forest algorithm. When an outlier is detected, it is removed and interpolated to fill in the gaps, resulting in a smooth sequence. Principal component analysis was used to reduce the dimensionality of the smoothed sequence to obtain a dimensionality-reduced feature sequence. The time-series model of the dimensionality-reduced feature sequence is performed by a long short-term memory network to capture sequence dependencies and obtain a time-series prediction model. Based on the time series prediction model, the trace nitrogen content at future time steps is predicted to obtain the predicted sequence; Based on the predicted sequence, it is compared with a preset nitrogen content threshold, and the risk level of future trace nitrogen loss is generated based on the comparison result.

[0012] In some optional embodiments, the step of calculating the nitrogen regulation demand using a PID control algorithm based on the risk level, and generating a regulation command signal based on the nitrogen regulation demand, includes: Based on the risk level, a PID control algorithm is used to determine the nitrogen regulation demand. Based on the nitrogen regulation demand, a preliminary regulation command signal is generated; Nitrogen distribution status data is obtained from feedback from the execution device. If the distribution status data does not reach the optimization threshold, the control command parameters are adjusted through the random forest algorithm to generate control command signals.

[0013] In some optional embodiments, after calculating the nitrogen regulation demand using a PID control algorithm based on the risk level and generating a regulation command signal based on the nitrogen regulation demand, the method further includes: By applying a feedback loop mechanism, the dynamically changing feature vectors in each medium are updated through continuous monitoring data, and the adjusted command signal is obtained based on the updated feature vectors. Using the adjusted command signal and a feedback loop mechanism, a dynamic adjustment command is generated, and a dynamic distribution adjustment scheme is obtained based on the dynamic adjustment command.

[0014] This invention provides a dynamic monitoring and control system for nitrogen conversion processes, comprising: The data acquisition module is used to acquire initial monitoring data through deployed multi-layer node sensors to obtain the original dataset of nitrogen distribution in the root adsorption layer; The feature determination module is used to determine the dynamically changing feature vectors in each medium based on the original dataset using a support vector machine algorithm. The monitoring module is used to obtain root adsorption data and atmospheric volatilization data of nitrogen through a sensor network when the feature vector shows that the nitrogen concentration in the soil medium exceeds a preset concentration threshold, so as to obtain a cross-media dataset. The integration module is used to integrate the cross-media dataset using data fusion technology to obtain a synchronized dataset; The classification module is used to classify the synchronous dataset using cluster analysis, calculate the conversion rate of nitrogen in the root adsorption layer based on the classification results, and generate a spatiotemporal distribution map based on the conversion rate using data visualization technology. The consumption analysis module is used to extract nitrogen consumption from the spatiotemporal distribution map to obtain the real-time nitrogen consumption distribution results; The prediction module is used to predict the risk level of future trace nitrogen loss based on the real-time consumption distribution results of the nitrogen and using a time-series prediction model. The control module is used to calculate the nitrogen control demand based on the risk level using a PID control algorithm, and generate a control command signal based on the nitrogen control demand.

[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention.

[0016] The method and system for dynamic monitoring and control of nitrogen conversion process of the present invention have the following beneficial effects: This invention acquires initial monitoring data through the deployment of multi-layer node sensors to obtain a raw dataset of nitrogen distribution in the root adsorption layer. Based on this raw dataset, a support vector machine algorithm is used to determine the dynamically changing feature vectors in each medium. When the feature vectors indicate that the nitrogen concentration in the soil medium exceeds a preset concentration threshold, root adsorption data and atmospheric volatilization data of nitrogen are acquired through a sensor network to obtain a cross-medium dataset. Based on the cross-medium dataset, data fusion technology is used to integrate the data to obtain a synchronous dataset. Based on the synchronous dataset, cluster analysis is used for classification, and the conversion rate of nitrogen in the root adsorption layer is calculated based on the classification results. Based on the conversion rate, a spatiotemporal distribution map is generated using data visualization technology. Nitrogen consumption is extracted from the spatiotemporal distribution map to obtain the real-time nitrogen consumption distribution results. Based on the real-time nitrogen consumption distribution results, a time-series prediction model is used to predict the risk level of future trace nitrogen loss. Based on the risk level, a PID control algorithm is used to calculate the nitrogen regulation demand, and a regulation command signal is generated based on the nitrogen regulation demand. This invention can achieve real-time monitoring of nitrogen consumption and ensure the accuracy of data integration. Attached Figure Description

[0017] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.

[0018] Figure 1 This is a flowchart illustrating the dynamic monitoring and control method for nitrogen conversion process disclosed in the embodiments of the present invention; Figure 2 This is a schematic diagram of the structure of the dynamic monitoring and control system for the nitrogen conversion process disclosed in the embodiments of the present invention. Detailed Implementation

[0019] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the invention will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0020] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0021] The flowchart shown in the attached diagram is merely an illustrative example and does not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined. Therefore, the actual execution order may change depending on the specific circumstances.

[0022] like Figure 1 As shown, this embodiment of the invention provides a method for dynamic monitoring and control of nitrogen conversion process. This method can realize real-time monitoring of nitrogen consumption and ensure the accuracy of data integration.

[0023] S10. Data Acquisition: A multi-layer sensor network is deployed, targeting the main adsorption layer of crop roots (10-30 cm soil depth). Four nodes are evenly distributed per square meter of soil, with each node corresponding to three depths of 10, 20, and 30 cm, forming a "uniform planar structure + vertical layering" to ensure coverage of key areas for nitrogen uptake by roots. Each node incorporates a high-precision electrochemical sensor capable of accurately detecting trace nitrogen concentrations as low as 0.01 mg / L, laying the hardware foundation for data accuracy. Data is then acquired and transmitted, with a sampling frequency of once per hour to balance timeliness and data redundancy. Acquired data includes soil nitrogen concentration (corresponding depth), sampling timestamp, and sensor coordinates, with each data entry being approximately 2KB. The data from the distributed nodes is aggregated to a central server via the low-power, highly stable ZigBee protocol, ensuring data continuity. Simultaneously, greenhouse atmospheric correlation data were collected, and ammonia concentration (e.g., 0.02 ppm) was measured using an atmospheric gas sensor. Since atmospheric ammonia and soil nitrogen exhibit deposition / volatilization interactions, this additional data enriches the original dataset, reflecting the impact of the "soil-atmosphere" interaction on nitrogen in the root adsorption layer. Finally, preliminary data processing was performed to remove outliers (concentrations >1.0 mg / L or <0.01 mg / L) caused by sensor interference from the saline-alkali environment, thus avoiding noise interference in subsequent analysis. The resulting original dataset contains soil root layer nitrogen concentration (with depth, location, and time) and atmospheric ammonia concentration data, providing a reliable foundation for subsequent spatial distribution analysis.

[0024] S20. Feature Determination: The raw data containing soil (nitrogen concentration at multiple depths / locations), atmosphere (ammonia concentration at corresponding locations), and spatiotemporal positioning are preprocessed to remove outliers caused by saline-alkali environments or hardware. The data is then standardized using the mean-standard deviation formula, reducing the features to [-1,1] to eliminate dimensional differences and adapt for subsequent training. Next, an SVM classification model is constructed, using an RBF kernel to adapt to the nonlinear correlation of the data. With the goal of "maximizing the classification margin," the problem is optimized to balance generalization ability (minimizing the hyperplane normal vector magnitude) and classification error (regularization parameters + relaxation variables to handle noise). Support vectors are selected through quadratic programming, and the hyperplane is calculated. Cross-validation accuracy reaches 91%. Finally, feature vectors are extracted from the model: for soil, "nitrogen-depth-location," and for atmosphere, "ammonia-time-location." Correlation analysis (e.g., soil nitrogen is negatively correlated with depth) clarifies the dynamic patterns of nitrogen fluctuations with the environment, identifying the core variation characteristics of nitrogen in both media.

[0025] S30. Monitoring: When the feature vector shows that the nitrogen concentration in the soil medium exceeds a preset threshold (e.g., 0.05 mg / L, for example, 0.06 mg / L was actually collected), the system triggers a data acquisition process: acquiring key data through specific devices in the sensor network—continuously collecting real-time data on soil nitrogen concentration using electrochemical sensors (e.g., YSI ProDSS), and simultaneously measuring root adsorption data of greenhouse crops (e.g., adsorption rate of 0.02 mg / cm³) using root moisture sensors. 2 And by using gas chromatography to monitor the volatilization data of nitrogen in the atmosphere (e.g., volatilization rate of 0.01 mg / m³), 3 These multi-media data from soil root adsorption and atmospheric volatilization are aggregated to a cloud server via wireless transmission protocols such as LoRa (configured for the 915 MHz band and a 125 kbps transmission rate to ensure low power consumption and high reliability). The data are then integrated to form a cross-media dataset containing information such as nitrogen concentration, root adsorption rate, atmospheric volatilization rate, corresponding timestamps, and geographic coordinates, providing a foundation for subsequent analysis and processing.

[0026] S40. Integration: The cross-media dataset (including soil nitrogen concentration, root adsorption, and atmospheric volatiles data) will be integrated into a synchronous dataset. This will be done in three steps: First, using the "timestamp + geographic coordinates" of the soil nitrogen data as a benchmark, linear interpolation will be used in the temporal dimension (e.g., matching root data collected every 10 minutes to the minute dimension of the soil data). Spatially, the three types of data from the same monitoring area will be bound by coordinates to ensure that each record corresponds to media information at the "same time and the same location," eliminating spatiotemporal misalignment. Second, for the three types of data (units are mg / L, mg / cm³, etc.),... 2 mg / m 3To address the dimensional differences, the data was standardized and narrowed to the [-1,1] interval, with feature labels added to form a structured field with uniform dimensions, thus avoiding model weight imbalance. Finally, the SVM soft-margin concept was introduced to allow slight deviations in a small amount of data (such as ±0.05 standardized residuals) to accommodate sensor errors. At the same time, the correlation between pairs of data (Pearson and Spearman coefficients) was calculated, and data groups with an absolute correlation coefficient >0.6 were selected to strengthen the medium association, ultimately resulting in a synchronized dataset containing "timestamps, geographic coordinates, and three types of standardized data".

[0027] S50. Classification: First, classify the synchronous dataset using K-means, with standardized soil nitrogen concentration, root adsorption rate, and atmospheric volatilization rate as core features. Calculate the Euclidean distance between samples and cluster spatiotemporally points with similar nitrogen states (e.g., "high nitrogen-high adsorption-high volatilization") to obtain classification results. Next, calculate the nitrogen conversion rate of the root adsorption layer. Extract samples from each class from the synchronous dataset, group them according to the same / adjacent coordinates, and sort the samples by timestamps to form a time series. Calculate the difference in nitrogen concentration at adjacent time points, divide by the time interval to obtain the concentration change rate, and bind coordinates to time to generate preliminary spatiotemporal distribution data. Then, use the silhouette coefficient for evaluation: calculate the average intra-class distance of a single sample using the three standardized features as dimensions (…). The smaller the class, the more compact the clustering; the average distance between the nearest outliers ( (The larger the value, the clearer the distinction between clusters). After obtaining the individual profile coefficients, the average is taken. If the coefficient is close to 1, the classification closely matches the true pattern; if it is too low, the K-means is adjusted and the number of clusters is re-divided until the target is reached, thus optimizing the spatiotemporal distribution data. Finally, visualization data such as spatiotemporal heat maps are used to present nitrogen conversion hotspots at different times and locations, providing a basis for nitrogen regulation.

[0028] S60. Consumption Analysis: Each (x, y, time) cell in the graph is treated as a node, with features including the conversion rate corresponding to the coordinates, time, and color. GraphSAGE is used to aggregate spatially adjacent (x±1, y±1) and temporally continuous neighbor features, generating embedding vectors. Euclidean distance is calculated to form a matrix; smaller distances indicate closer spatiotemporal proximity and more similar conversion rates on the graph. Hierarchical clustering is used based on the distance matrix, merging similar nodes to form a tree-like hierarchical structure reflecting the spatiotemporal-conversion rate correlation. For example, contiguous dark areas (high conversion) are clustered into "high consumption clusters." The average conversion rate at each time point is extracted from the clusters and sorted by time to generate a real-time consumption sequence, corresponding to the color change of the region on the graph over time. The sequence is bound to coordinates to generate a spatial distribution matrix, with elements corresponding to the time series values ​​at each location on the graph. If the consumption in the matrix exceeds a threshold, DBSCAN is used to detect the center of the dark, contiguous region on the graph as the peak node. The hierarchical structure is merged, retaining the peak clusters and merging the low-consumption clusters to generate a new consumption sequence consistent with the hotspot-background difference on the graph. By extracting indicators such as peak consumption and cluster mean, we can obtain real-time consumption distribution results on the corresponding graph, showing "where, when, and how much is consumed," to support precise regulation.

[0029] S70. Prediction: First, standardize the real-time nitrogen consumption distribution results, and then convert the consumption values ​​at different times and spaces (e.g., 0.001~0.003 mg) into values ​​that are not equal to the nitrogen consumption values ​​at different times and spaces. 2 / (L・h・cm 2 The data is normalized to the [0,1] interval using min-max to eliminate dimensional differences, resulting in a preprocessed sequence. Then, an isolated forest algorithm (with an outlier ratio of 0.1) is used to detect outliers (such as sudden increases or decreases caused by sensor malfunctions), which are removed and imputed by interpolation to generate a smoothed sequence to ensure data quality. PCA is then used to reduce the dimensionality of the smoothed sequence, extracting principal components that explain more than 95% of the variance (e.g., reducing 5 dimensions to 2), retaining core information and simplifying the dimensions to obtain a dimensionality-reduced feature sequence. Next, LSTM is used for modeling: with a time step of 3 and 50 hidden layer units, the temporal dependencies (such as periodic fluctuations) of the dimensionality-reduced sequence are captured, and a time-series prediction model is trained. Using the model's input of recent data, the consumption value at a future time step (e.g., 7 days) is predicted, generating a prediction sequence. Finally, the prediction sequence is compared with a preset threshold (e.g., 0.0015mg). 2 / (L・h・cm 2 In comparison, those below the threshold are considered high-risk. By combining continuous results, three levels of risk—low, medium, and high—are defined to provide a basis for regulation.

[0030] S80. Regulation: Based on the risk level, the regulation requirement is determined using a PID algorithm. The error between the actual nitrogen concentration and the target value is used as input. The basic regulation amount is calculated using a proportional term (Kp), the long-term deviation is eliminated using an integral term (Ki), and the trend is predicted using a derivative term (Kd). These are then combined to arrive at the required regulation amount. For example, under high risk, a 20% reduction in nitrogen application is required. Preliminary instructions are generated based on the regulation requirement, converting the regulation amount into equipment parameters. For instance, if the original fertilization rate is 0.1 kg / h, a 20% reduction would set it to 0.02 kg / h. The execution duration and effective area are clearly defined and transmitted to the intelligent fertilization equipment via LoRa. If the feedback does not meet the target, random forest parameter tuning is used. If the equipment feedback indicates that the nitrogen concentration has not reached the optimization threshold, a random forest model is constructed using historical risk data, regulation parameters, and feedback data as a training set. The current data is input, and adjustment suggestions are output. Instructions are regenerated until the target is met.

[0031] Through the above steps, this embodiment can achieve real-time monitoring of nitrogen consumption and ensure the accuracy of data integration.

[0032] In some embodiments, based on the above embodiments, the process of obtaining the original dataset of nitrogen distribution in the root adsorption layer by acquiring initial monitoring data through deployed multi-layer node sensors includes the following steps: The first step involves the deployment design of a multi-layer sensor network. The core of this step is ensuring that the sensors cover the critical spatial range of the crop root adsorption layer. Since crop roots primarily absorb nitrogen in the soil layer at a depth of 10-30 cm, the system evenly distributes four sensor nodes per square meter of soil, with each node corresponding to depths of 10 cm, 20 cm, and 30 cm, forming a multi-layer network structure of "uniform planar distribution + vertical stratified coverage." This ensures that the differences in nitrogen concentration at different locations and depths within the root adsorption layer can be captured, avoiding the loss of distribution information due to sparse sampling points or single depths. Each node incorporates a high-precision electrochemical sensor. The advantage of this type of sensor lies in its high sensitivity to trace nitrogen (such as ammonium nitrogen and nitrate nitrogen), accurately identifying concentration changes as low as 0.01 mg / L. This aligns with the monitoring needs of trace nitrogen in saline-alkali soils, providing hardware support for the accuracy of the raw data.

[0033] The data acquisition phase then commenced. To balance data timeliness and redundancy, the sampling frequency was set to once per hour. This frequency effectively captures dynamic changes in nitrogen levels in real time (such as hourly absorption by crop roots and fluctuations in soil nitrogen volatilization or deposition) without generating excessive invalid data due to overly frequent sampling. Each set of collected data contains core information: soil nitrogen concentration (corresponding to a specific depth), sampling timestamp, and sensor location coordinates (ensuring subsequent spatial analysis can pinpoint the specific area). Each sample contains approximately 2KB of data, and this collection of information forms the foundational dimensions of the raw soil nitrogen data. Data transmission utilizes the ZigBee protocol. The primary reason for choosing this protocol is its low power consumption, suitable for the long-term operation of sensor networks (avoiding frequent battery replacements), and its high stability over short distances, reliably aggregating data from dispersed nodes to a central server, ensuring the continuity of the data acquisition process.

[0034] Meanwhile, in order to construct a complete original dataset of nitrogen distribution, it is also necessary to collect related data in the greenhouse atmosphere simultaneously. This is because the nitrogen distribution in the root adsorption layer is not isolated. Ammonia (one of the forms of nitrogen) in the atmosphere may supplement soil nitrogen through deposition or may enter the atmosphere due to the volatilization of soil nitrogen. The two have an interactive effect. Therefore, it is necessary to collect ammonia concentration data (e.g., 0.02 ppm) simultaneously through gas sensors in the greenhouse atmosphere as an important supplement to the original dataset, to ensure that the data can reflect the impact of the "soil-atmosphere" interaction on nitrogen in the root adsorption layer.

[0035] Finally, the initial processing of the raw dataset is crucial. This step aims to eliminate invalid noise and ensure data quality. Since sensors may be affected by the high salinity and pH of saline-alkali soils, or by hardware fluctuations causing abnormal data (such as concentrations suddenly exceeding 1.0 mg / L or falling below 0.01 mg / L, far exceeding the normal fluctuation range of trace nitrogen in saline-alkali soils), the collected soil nitrogen concentration data and atmospheric ammonia concentration data need to be preliminarily cleaned to remove these obviously abnormal values ​​and prevent noisy data from affecting subsequent judgments on nitrogen distribution patterns. After these steps, the final raw dataset contains core data on trace nitrogen concentrations at different depths and locations within the soil root adsorption layer, as well as associated atmospheric ammonia concentration data, along with location information such as time and position.

[0036] In some embodiments, based on the above embodiments, the step of determining the dynamically changing feature vectors in each medium using a support vector machine algorithm according to the original dataset includes: Preprocessing techniques were used to denoise and standardize the original dataset to obtain a normalized nitrogen concentration dataset. Based on the standardized nitrogen concentration dataset, a classification model is obtained by training using the support vector machine algorithm. Based on the classification model, the dynamically changing feature vectors in each medium are determined.

[0037] The first stage is preprocessing, the core of which is to eliminate interference and dimensional differences in the raw data to obtain a standardized dataset. The raw data contains multi-dimensional information from two media: for the soil, it includes "trace nitrogen concentrations at different depths (e.g., 10 / 20 / 30 cm) and locations" (the core indicator); for the atmosphere, it includes "ammonia concentrations at corresponding locations," and all data includes timestamps and spatial coordinates. Preprocessing begins with noise reduction—removing invalid data caused by sensor interference from the saline-alkali environment (e.g., instantaneous anomalies due to salinity) or hardware errors (e.g., nitrogen concentrations at a certain location suddenly exceeding the normal range). Then, standardization is performed because the dimensions of soil nitrogen (e.g., mg / L), atmospheric ammonia (e.g., ppm), time (e.g., hour), and location coordinates (e.g., meter) differ greatly, requiring normalization using the following formula:

[0038] in, Here are the normalized values, and x is the original value. The mean of this feature. This represents the standard deviation of the feature.

[0039] It is worth noting the mean and standard deviation It is a statistic for a single feature.

[0040] The formula for the mean μ is:

[0041] in, It is the first of this feature One set of raw data, It is the total number of valid data for this feature (i.e., the sample size). Standard deviation It is the square root of the variance, which reflects the degree to which each data point deviates from the mean. The formula is: in, It is the first of this feature One set of raw data, It is the total number of valid data for this feature. This is the mean of the feature.

[0042] By scaling all feature values ​​to the range of [-1,1], a normalized nitrogen concentration dataset is obtained. This ensures that the positioning information such as "depth, location, and time" and the core indicator of "nitrogen / ammonia concentration" are weighted in a balanced manner during SVM training, thus avoiding the model's judgment being misled by differences in numerical range.

[0043] Next, we enter the SVM model training phase, which requires building a classification model based on normalized data that can accurately distinguish between soil and atmospheric media.

[0044] Firstly, regarding the choice of kernel function, the Radial Basis Function (RBF) was chosen. The core reason is that the characteristic correlation between the two types of media in the original data exhibits a significant non-linearity. For example, at the same location, the soil nitrogen concentration does not increase or decrease non-linearly with depth (possibly due to differences in root adsorption strength, resulting in localized high values ​​at a depth of 20 cm). Similarly, the atmospheric ammonia concentration does not fluctuate linearly with location within the same time period (possibly influenced by greenhouse ventilation direction, forming localized concentration gradients). The core advantage of the RBF kernel function is its ability to map non-linearly separable data in low-dimensional space to linearly separable data in high-dimensional space, as shown in the formula: in, , These are the normalized sample feature vectors, with completely consistent dimensions; It is the global symbol for the kernel function, used to quantize two input samples. and The degree of similarity in a high-dimensional mapping space; It is the distance scaling factor.

[0045] The value is set at 0.15, determined by considering the characteristics of multi-dimensional data: A value that is too small will cause the kernel function to be too flat, making it unable to capture the subtle interactions between dimensions such as depth and position; An excessively large value would make the kernel function too sensitive and susceptible to fluctuations in local data. A value of 0.15 is just right for the nonlinear correlation of the multi-dimensional combination of "nitrogen concentration-depth-location-time", ensuring that the model can identify the essential differences between media without over-focusing on local noise.

[0046] Next is the setting of the SVM training objective, the core objective of which is to "maximize the classification margin". Here, the "classification margin" refers to the distance between the hyperplane that can separate the feature vectors of soil and atmosphere in high-dimensional space and the nearest sample (i.e. support vector) of the two classes of vectors. The larger the margin, the stronger the model's classification ability (generalization ability) for new data, and the less likely it is to overfit.

[0047] To achieve this goal, the corresponding optimization problem is defined as follows:

[0048] in The normal vector representing the classifying hyperplane. It is the magnitude of the vector. For regularization parameters, The slack variable (to handle noise and nonlinearity) is a non-negative variable defined for each training sample i. Its core function is to allow a small number of samples to not satisfy the 'strict classification constraint' of SVM.

[0049] The size of the classification edge and Inversely proportional The smaller the value, the gentler the "tilt" of the hyperplane, and the larger the classification edge, thus minimizing... Essentially, it indirectly maximizes the classification margin, ensuring that the model has stronger generalization ability.

[0050] By minimizing This allows the model to learn a hyperplane with "wide edges" (strong generalization); simultaneously through By allowing a small number of noisy samples (to avoid overfitting), we can ultimately obtain an SVM classification model that can accurately distinguish between soil and atmospheric media and handle subtle differences in dimensions such as "location, depth, and time".

[0051] By solving this optimization problem using quadratic programming, we can identify the "support vectors" that play a decisive role in classification. For example, for soil samples ("10 cm depth - location - nitrogen concentration 0.5 mg / L") and for atmospheric samples ("time - location - ammonia concentration 0.03 ppm"), we can calculate the classification hyperplane equation w·x + b = 0 based on the support vectors, ultimately forming a classification model. Cross-validation showed the model achieved a classification accuracy of 91%, proving its effective ability to distinguish the multi-dimensional differences in characteristics between soil and atmospheric media. Finally, the feature vector determination stage involves extracting core features reflecting the dynamic changes of each medium from the classification model.

[0052] The “feature vector” here is a multi-dimensional vector that integrates “core indicators + location information”: the feature vector of soil medium is “trace nitrogen concentration-depth-location” (e.g., [0.45mg / L, 15cm, (x1,y1)]), and the feature vector of atmospheric medium is “ammonia concentration-time-location” (e.g., [0.025ppm, 14:00, (x1,y1)]). Its “dynamic change” is reflected in the real-time fluctuation of these parameters with the environment (e.g., the nitrogen concentration decreases due to the increase of soil depth at a certain location, and the ammonia concentration increases due to the change of atmospheric humidity at a certain time). When extracting feature vectors from an SVM classification model, support vectors are crucial because they are the vectors closest to the hyperplane and can most accurately reflect the core characteristics of the medium. Simultaneously, combining the dynamic correlations analyzed by the model (e.g., the correlation between soil nitrogen concentration and depth is -0.78, calculated using the Pearson coefficient, indicating lower nitrogen concentration at greater depths; the correlation between atmospheric ammonia concentration and time is 0.65, indicating higher ammonia concentrations in the afternoon) further clarifies the dynamic patterns of feature vectors for each medium: soil feature vectors adjust with changes in depth and location, while atmospheric feature vectors fluctuate with time and location. Ultimately, through these dynamic feature vectors, the core variation characteristics of trace nitrogen in soil and atmosphere can be located.

[0053] In some embodiments, based on the above embodiments, when the feature vector shows that the nitrogen concentration in the soil medium exceeds a preset concentration threshold, root adsorption data and atmospheric volatilization data of nitrogen are acquired through a sensor network to obtain a cross-media dataset, including: After analyzing the feature vectors using the SVM model, when the soil nitrogen concentration in a certain area reaches 0.06 mg / L (exceeding the normal interaction range), the system will selectively activate the sensor network to accurately collect key data to form a cross-media dataset, focusing on the cross-media correlation of "soil nitrogen - root adsorption - atmospheric volatilization".

[0054] To acquire root adsorption and atmospheric volatiles data, the network includes two core types of sensors: a root moisture sensor and a gas chromatograph.

[0055] Root moisture sensors are deployed directly into the root distribution layer of greenhouse crops (typically at the same depth as soil nitrogen sensors, such as 10-30 cm). Their principle is to monitor the dynamic changes in soil moisture around the roots, inferring the root system's nitrogen adsorption efficiency, and ultimately outputting the adsorption rate (mg / cm³). 2 Data in units of ")" (e.g., if the root adsorption rate is 0.02 mg / cm³ during a certain period). 2 ); The nitrogen adsorption efficiency is inferred by analyzing the dynamic changes in soil moisture around the roots. The core of this method is based on the physiological coupling between nitrogen absorption and water absorption by the roots. Nitrogen in the soil mainly exists in water-soluble ionic forms (such as NH4). + NO3 - Since nitrogen cannot be directly absorbed by the root system, dissolved nitrogen must be absorbed along with water during the water absorption process. Furthermore, under normal crop physiological conditions (without extreme drought, nutrient stress, or other abnormal situations), the rate of water consumption by the root system and the rate of nitrogen adsorption maintain a relatively stable positive correlation. This correlation provides a quantitative basis for "backward inference," and the specific backward inference process can be divided into the following key steps: First, a quantitative baseline for the correlation between water and nitrogen adsorption needs to be established. Under experimental conditions (such as a controlled greenhouse environment), for specific crop varieties (such as tomatoes and wheat) at their target growth stages (such as seedling stage and fruiting stage), the soil water consumption and actual nitrogen adsorption around the roots are monitored simultaneously. On the one hand, the changes in soil volumetric water content are recorded in real time using root water sensors, and the water consumption rate of the roots per unit time is calculated (e.g., a decrease in soil water content of 0.5% per hour, converted into the amount of water reduction per unit root area, unit: cm). 3 / (h・cm 2 On the other hand, through destructive sampling (such as obtaining root samples and measuring their nitrogen content) or in-situ monitoring (such as using isotope-labeled nitrogen to track root uptake), the total amount of nitrogen actually adsorbed by the roots within the corresponding time period (unit: mg) can be directly obtained. Through repeated experiments, the "nitrogen adsorption per unit of water consumption" (i.e., correlation coefficient, unit: mg / cm³) of the crop under current growth conditions can be fitted. 3 For example, experiments showed that for every 1 cm consumed by a certain crop 3 Moisture corresponds to the adsorption of 0.002 mg of nitrogen; this coefficient will serve as the core basis for subsequent reverse calculations.

[0056] Secondly, real-time monitoring of soil moisture dynamics around the roots and calculation of water consumption rates are performed. In practical applications, root moisture sensors are deployed in soil areas with dense root distribution (typically within a 10-20cm radius of the crop root system) to collect soil volumetric water content data at high frequencies (e.g., once every 10 minutes), forming a time series of moisture changes. The soil moisture changes are then converted into quantifiable root water absorption rates, as detailed below: The first step is to calculate the difference in moisture content between two adjacent monitoring measurements. Assuming that the soil volumetric water content measured in the first time (t1) is 25% and the second time (t2, 10 minutes apart) is 24.5%, the difference in moisture content is 0.5%. This difference represents the percentage of water lost in the soil in this area due to root absorption within 10 minutes. The second step is to combine the soil volume within the sensor's monitoring range to convert the "difference in moisture content" into the "actual volume reduction in moisture." If the sensor's detection range is cylindrical (a common detection shape), the radius... ,depth The total soil volume in the monitoring area Therefore, the actual volume of water loss within 10 minutes = V × difference in water content = ; The third step is to convert the water consumption rate per unit time and per unit root area. First, convert the time interval to hours (10 minutes = 1 / 6 hour), and then calculate the water loss per hour = Then divide by the effective projected area of ​​the root system within the monitoring area (assuming the projected area of ​​the root system in this area is measured to be 20 cm² by a root scanner). 2 (i.e., the total projected area of ​​the root system on the soil plane), final water consumption rate = .

[0057] The "effective projected area of ​​the root system" is a key standardized parameter. The root distribution density varies for different crops and at different growth stages. If water consumption is calculated using only soil volume, it is impossible to distinguish between "a small number of roots absorbing water rapidly" and "a large number of roots absorbing water slowly". However, by scanning the root system or analyzing in situ images, the projected area of ​​the root system in the monitoring area can be measured, which makes the calculation of water consumption rate more consistent with "the water absorption capacity of a unit root system".

[0058] Finally, the nitrogen adsorption efficiency is inferred from the correlation coefficient and water consumption rate. Multiplying the real-time calculated water consumption rate by the previously established "nitrogen adsorption amount per unit water consumption" yields the nitrogen adsorption rate of the root system per unit time. To output the final adsorption rate, the nitrogen adsorption rate is multiplied by the monitoring duration based on the actual monitoring period (e.g., 24 hours) to obtain the total nitrogen adsorption per unit area of ​​the root system within that period, i.e., the adsorption rate.

[0059] Gas chromatographs are installed in the greenhouse atmosphere (usually evenly distributed across areas to ensure coverage of the space above regions where soil nitrogen levels exceed the threshold). By separating atmospheric gaseous components, the concentration of ammonia (the main form of soil nitrogen volatilization) is accurately detected, and then converted into "atmospheric volatilization rate (mg / m³)" based on the greenhouse volume and ventilation rate. 3 (e.g., the volatilization rate was measured to be 0.01 mg / m³ during a certain period) 3Meanwhile, to ensure the spatiotemporal synchronization of data, the existing electrochemical sensors (such as YSI ProDSS) will be activated simultaneously on the soil side to collect real-time nitrogen concentration data of areas exceeding the threshold once per minute. All data collected by the sensors will be accompanied by a "time stamp (accurate to the second to ensure cross-media data time alignment)" and "geographic coordinates (accurate to the square meter to ensure data corresponds to the same monitoring area)" to avoid data association failure due to spatiotemporal misalignment.

[0060] Considering that greenhouse sensors are typically deployed in a dispersed manner and require long-term battery life, the system selects the LoRa wireless transmission protocol as the data transmission channel: the protocol is configured in the 915 MHz band, which has strong penetration in the enclosed environment of a greenhouse and is less affected by interference from crop leaves; the transmission rate is set to 125 kbps (balancing transmission efficiency and power consumption, transmitting a data packet of about 2KB in only 0.16 seconds, and the sensor consumes very little power per transmission, supporting several months of battery life). All data collected by the sensors, including "root adsorption rate + atmospheric volatilization rate + real-time soil nitrogen concentration", will be encapsulated in JSON format (the format includes "data type, value, timestamp, coordinates" fields for easy cloud parsing), aggregated through the LoRa gateway, and then uploaded to the cloud server (such as AWS IoT Core) to ensure the integrity and real-time performance of the data from collection to transmission.

[0061] Next is the initial integration of the cross-media dataset. After receiving the data in the cloud, it first matches three types of data according to "timestamp + geographic coordinates": matching "soil nitrogen concentration (e.g., 0.06 mg / L)" and "root adsorption rate (e.g., 0.02 mg / cm³)" for the same time and monitoring area. 2 "Atmospheric evaporation rate (e.g., 0.01 mg / m³)" 3 The data units are then linked together as a complete set of "cross-media data units," and then all data units are sorted by time series to form the final cross-media dataset.

[0062] In some embodiments, based on the above embodiments, data fusion technology is used to integrate the cross-media dataset to obtain a synchronized dataset, including: The cross-media dataset obtained in S30 contains three core data types: soil nitrogen concentration data, root adsorption data, and atmospheric volatiles data. During fusion, the "timestamp + geographic coordinates" of the soil nitrogen data is used as the reference anchor point. Through temporal interpolation (e.g., for root data collected every 10 minutes, linear interpolation is used to match the time dimension of soil data every minute) and spatial matching (based on geographic coordinates, root adsorption data, atmospheric volatiles data, and soil nitrogen data in the same monitoring area are bound together), it is ensured that each data record corresponds to the three media information at the "same time and the same location," eliminating data association failures caused by spatiotemporal misalignment.

[0063] Next is the heterogeneous unification of data, addressing the differences in dimensionality and units between data from different media. This includes soil nitrogen concentration (mg / L) and root adsorption rate (mg / cm³). 2 Atmospheric volatile matter (mg / m³) 3 The physical meanings and units of these data differ, and direct integration can lead to an imbalance in the weights of subsequent models. Therefore, the data needs to be standardized during the fusion process: based on the mean and standard deviation of each feature, all data are scaled to the [-1,1] interval, and explicit feature labels (such as "soil_n", "root_absorb", "air_volatilize") are added to each type of data to form a structured data field with uniform dimensions, ensuring that multi-source data can be collaboratively analyzed by the model at the same scale.

[0064] Next is noise compatibility and correlation enhancement. First, a normal correlation baseline for "soil nitrogen-root adsorption-atmospheric volatilization" needs to be defined. Based on historical data (such as stable monitoring cycles without sensor error), statistical analysis is used to determine the typical correlation patterns of the three data types after standardization. For example, for every 0.1 increase in the standardized value of soil nitrogen (soil_n), the root adsorption rate (root_absorb) typically increases by 0.08±0.03, and the atmospheric volatilization rate (air_volatilize) increases by 0.05±0.02. This range is the "normal correlation interval," representing the inherent linkage pattern of the three data types.

[0065] Set a slack variable threshold (e.g., ±0.05 standardized residuals) as a "bias tolerance line." Slack variables are mathematical tools used to balance the deviation between ideal constraints and real-world data. Their core function is to accommodate a small amount of "imperfect data" caused by noise and errors without disrupting the overall rules, avoiding the elimination of effective information or distortion of true patterns due to extremely strict constraints. Here, "residual" refers to the difference between the actual value of a single data point and the "normal correlation baseline prediction value." For example, in a data point, soil_n is 0.3, and according to the baseline prediction, root_absorb should be 0.24, but the actual measured value is 0.18, resulting in a residual of -0.06. In this case, it is necessary to determine whether it is within the ±0.05 threshold: if the residual is ≤0.05, it is considered an acceptable slight deviation, and the original data is retained; if the residual is >0.05, it is marked as "potentially noisy data," but not directly removed.

[0066] The system balances "noise inclusion" and "association reinforcement" through dynamic weight adjustments. Data with residuals within the threshold are assigned higher weights, allowing them to fully participate in the association calculations of the three types of data (such as Pearson coefficient and co-variance trend analysis), ensuring that normal association patterns are accurately captured. For "potentially noisy data" with residuals exceeding the threshold, their weights are reduced (e.g., weight = 0.2) to minimize their interference with the overall association analysis. For example, when calculating the correlation between soil_n and root_absorb, most normal data will dominate the correlation coefficient result, while a small amount of noisy data will have only a minor impact. This avoids sample loss due to data removal and prevents noise from distorting the true association.

[0067] Through the above steps, data groups with significant correlations (such as correlation coefficient absolute value > 0.6) are selected to strengthen the intrinsic link between "soil nitrogen-root adsorption-atmospheric volatilization" and ultimately form a synchronous dataset in which each record contains "timestamp, geographic coordinates, standardized soil nitrogen, standardized adsorption rate, and standardized volatilization rate".

[0068] In some embodiments, based on the above embodiments, cluster analysis is used to classify the data according to the synchronous dataset, the conversion rate of nitrogen in the root adsorption layer is calculated based on the classification results, and a spatiotemporal distribution map is generated based on the conversion rate using data visualization technology, including: Based on the synchronized dataset, the K-means algorithm is used for classification to obtain the dataset classification results; Based on the classification results of the dataset, the conversion rate of trace nitrogen in the root adsorption layer is calculated to generate preliminary spatiotemporal distribution data. Based on the preliminary spatiotemporal distribution data, the silhouette coefficient evaluation method is used to obtain the classification quality evaluation results; Based on the evaluation results, repeat the iterative optimization steps to generate spatiotemporal distribution data; Based on the spatiotemporal distribution data, a spatiotemporal distribution map is generated using data visualization technology.

[0069] The K-means algorithm was used to classify the synchronous dataset. Using "standardized soil nitrogen concentration, root adsorption rate, and atmospheric volatilization rate" as core features, the Euclidean distance between samples was calculated to cluster spatiotemporal points with similar nitrogen states (e.g., "high nitrogen-high adsorption-high volatilization" or "low nitrogen-low adsorption-low volatilization") into one class. For example, in a certain area between 10:00 and 12:00, soil nitrogen > 0.05 mg / L and adsorption rate > 0.02 mg / cm³ were grouped together. 2 Volatilization rate > 0.01 mg / m³ 3 The data is categorized into "active interaction class" and the rest into "stable class", thus obtaining the dataset classification results and realizing the clustering of nitrogen cross-media states.

[0070] Next, based on the classification results of the dataset, the conversion rate of trace nitrogen in the root adsorption layer is calculated to generate preliminary spatiotemporal distribution data.

[0071] For each class of data after K-means classification (e.g., "high nitrogen interaction class"), samples containing timestamps, coordinates, soil nitrogen concentration, and root adsorption rate are extracted from the synchronous dataset. The samples are grouped according to the same / adjacent coordinates (e.g., within 1 square meter), and then sorted by timestamp (once per minute) to form the time series of each location.

[0072] Calculate the change in nitrogen concentration per unit time: For a time series at the same location, take the soil nitrogen concentration at two adjacent time points, calculate the difference, and then divide by the time interval. (Because the synchronized dataset records every minute,) =1 minute = 1 / 60 hour), which gives the rate of concentration change per unit time.

[0073] By binding the conversion rate with coordinates and time, preliminary spatiotemporal distribution data of "coordinate-time-rate" is formed.

[0074] Subsequently, the silhouette coefficient was used to assess the classification quality.

[0075] First, it is necessary to clarify the "sample unit" and "feature dimension" for contour coefficient calculation. Each record in the synchronous dataset is a "sample". The calculation focuses on three core standardized features that reflect the intensity of nitrogen cross-media interaction: standardized soil nitrogen concentration, standardized root adsorption rate, and standardized atmospheric volatilization rate. These three features directly determine the "nitrogen state attribute" of the sample and are the basis for calculating the distance between samples. The timestamp and geographic coordinates are used to help locate the spatiotemporal position of the sample and do not directly participate in the distance calculation.

[0076] Next, the intra-class average distance for each sample is calculated. For a given sample in the synchronized dataset, calculate its Euclidean distance to all other samples in the same class, and then take the average of these distances as the mean. . The smaller the value, the more similar the nitrogen state of the sample is to other samples in the same class, and the more compact the class is.

[0077] Calculate the mean distance between the nearest outliers for a single sample ( Find the closest other class to the sample, calculate the Euclidean distance between the sample and all samples in this outlier class, and take the average as the mean. . The larger the value, the more significant the difference in nitrogen status between the sample and samples of different categories, and the clearer the inter-class separation.

[0078] Calculate the silhouette coefficient of a single sample :

[0079] Then perform a test on all samples in the synchronized dataset. Take the average value to obtain the overall profile coefficient. (Value range [-1, 1]).

[0080] Interpret the assessment results in conjunction with nitrogen analysis scenarios.

[0081] If the overall profile coefficient is close to 1 (e.g., 0.85), it indicates that the classification results in the synchronous dataset closely match the true pattern of nitrogen cross-media interaction.

[0082] If the overall silhouette coefficient is low (e.g., 0.3), it indicates a bias in the classification results. This may be due to an improper setting of the number of clusters in the K-means dataset. The number of clusters in the K-means dataset needs to be adjusted based on the evaluation results (e.g., increasing from 2 to 3 clusters), and the synchronous dataset needs to be reclassified until the silhouette coefficient meets the target. Continue until the silhouette coefficient meets the threshold (e.g., ≥0.7) to generate more accurate spatiotemporal distribution data, ensuring it truly reflects the spatiotemporal dynamics of nitrogen in the root adsorption layer.

[0083] Finally, data visualization techniques (such as spatiotemporal heat maps and dynamic time series curves) are used to transform the optimized spatiotemporal distribution data into intuitive charts: the horizontal axis represents geographical coordinates (x, y), the vertical axis represents time, and the color intensity indicates the conversion rate, clearly presenting nitrogen conversion hotspots at different times and locations, providing a visual basis for subsequent nitrogen regulation decisions.

[0084] In some embodiments, based on the above embodiments, nitrogen consumption is extracted from the spatiotemporal distribution map to obtain real-time nitrogen consumption distribution results, including: Based on the spatiotemporal distribution map, a graph neural network is used to generate a distance matrix; Based on the distance matrix, a hierarchical clustering method is used to obtain a hierarchical structure; Based on the aforementioned hierarchical structure, a real-time consumption sequence is generated using time series analysis methods. Spatial distribution features are extracted from the real-time consumption sequence to generate a spatial distribution matrix; When the nitrogen consumption in the spatial distribution matrix exceeds a preset consumption threshold, the density peak value is detected by a density clustering algorithm to determine the peak node. Based on the peak nodes, a fusion layer merging process is performed to generate a merged node consumption sequence; Consumption quantification indicators are extracted from the merged node consumption sequence to obtain the real-time nitrogen consumption distribution results.

[0085] A graph neural network is used to generate the distance matrix. In the spatiotemporal distribution map, each (x, y, time) cell (corresponding to a spatiotemporal point) serves as a node in the graph. Node features include: x-coordinate (horizontal axis position), y-coordinate (horizontal axis position), timestamp (vertical axis position), and conversion rate (a specific value extracted from color depth, e.g., darker colors correspond to 0.0024 mg). 2 / (L・h・cm 2 Using the GraphSAGE algorithm, 10 neighboring nodes are sampled based on "spatial adjacency (cells of x±1, y±1) + temporal continuity (adjacent time points of the same (x, y)). Mean pooling is used to aggregate the "spatiotemporal coordinates + transformation rate" features of the neighbors, generating an embedding vector (e.g., 128-dimensional) for each node. The Euclidean distance between the embedding vectors of any two nodes is calculated to form a distance matrix. The smaller the distance, the closer the two nodes are in position on the distribution map, the closer their time, and the more similar their color (transformation rate) (like dark nodes in the same region at the same time).

[0086] A hierarchical structure is obtained using hierarchical clustering based on the distance matrix. Using the distance matrix as a basis, hierarchical clustering (such as the Ward method) iteratively merges nodes: prioritizing the merging of nodes that are close in distance (i.e., cells that are spatiotemporally adjacent and have similar conversion rates on the distribution map), forming a tree-like hierarchical structure from fine to coarse. For example, nodes in a contiguous dark area (high conversion rate) on the spatiotemporal distribution map are first clustered into small clusters, and then gradually merged into larger "high-consumption region clusters." The hierarchical structure intuitively reflects the strength of the association between nodes in the "space-time-conversion rate" relationship.

[0087] A real-time consumption sequence is generated based on a hierarchical structure. Final clusters (e.g., 10) are selected from the hierarchical structure, each cluster corresponding to a feature region on the spatiotemporal distribution map (e.g., "Northeast Region - 9:00-11:00-Medium-speed conversion"). The average conversion rate of each cluster on the time axis (vertical axis) is extracted (calculated from the numerical value corresponding to the color), and arranged in chronological order to form a real-time consumption sequence. The sequence fluctuations correspond to the changes in the color intensity of that region on the distribution map over time.

[0088] Spatial features are extracted to generate a spatial distribution matrix. Real-time consumption sequences are linked to the geographic coordinates (x, y) of each cluster: matrix rows / columns correspond to (x, y) coordinates, and matrix elements represent the consumption at each time point for that location (taken from the sequence). For example, in the matrix ( , The element group at the position corresponds to the color intensity values ​​of each time point on the vertical axis of the spatiotemporal distribution map at that coordinate, completely mapping the spatial distribution pattern of consumption.

[0089] Density clustering is used to detect peak nodes. If the consumption at a certain (x, y) position in the spatial distribution matrix exceeds a threshold (e.g., an outlier point with excessively dark color on the corresponding distribution map), the DBSCAN algorithm is used for detection. The analysis focuses on capturing high-consumption areas that are "spatially contiguous" by using only the (x,y) coordinates of nodes whose consumption exceeds the threshold, ignoring other factors such as time.

[0090] On the (x,y) plane, The range is set to "centered on the target node, including its surrounding (x±1,y) and (x,y±1) adjacent cells" (covering a total span of 3 cells), ensuring that "adjacent, contiguous" dark cells on the distribution map are captured. It is a key parameter in DBSCAN used to measure "spatial proximity", which represents the radius of the "neighborhood range" of a sample point.

[0091] Set MinPts=5. MinPts is a parameter in DBSCAN used to define a "high-density region," representing a sample point. Within the neighborhood, at least a certain number of sample points must be included (usually including the sample point itself). Only if a sample point... A point is considered a "core point" only when the number of samples in its neighborhood is greater than or equal to MinPts.

[0092] Step 1: Identify the core points Iterate through all high-cost nodes, and if a certain node (such as ( , Within the ε-neighborhood of (corresponding to the dark cells on the distribution map) , If there are ≥5 high-consumption nodes in a range, the node is marked as a "core point" - representing that it is the basic unit of a contiguous dark area.

[0093] Step 2: Aggregation to form density clusters Spatially adjacent core points (i.e. Core points with overlapping neighborhoods are grouped into a "density cluster": for example, ( , ), ( , ), ( , These are all core points, and the clusters they form are the distribution points on the map. , The surrounding area is "dark and contiguous in color".

[0094] Step 3: Calculate the peak node Each density cluster corresponds to a contiguous dark area. The mean of the (x, y) coordinates of all nodes within the cluster is taken (e.g., the node coordinates within the cluster are (x, y)). , ), ( , ), ( , ), the mean is ( , The mean point is the "peak node", which corresponds to the geometric center of the continuous dark area - that is, the core location where high consumption is most concentrated.

[0095] The fusion hierarchy is merged to generate a merged consumption sequence. The merging logic of the hierarchy is adjusted according to the peak node: while preserving the independence of the cluster where the peak node is located, clusters with low consumption and close correlation are merged to generate a new node consumption sequence. The sequence highlights the high consumption characteristics of the peak node and simplifies the representation of the low consumption region, ensuring consistency with the visual difference between the "hot spot region and background region" on the spatiotemporal distribution map.

[0096] Quantitative indicators are extracted to obtain real-time consumption distribution results. Key indicators are extracted from the merged sequence: consumption of each peak node (e.g., 6.78), average consumption within the cluster (e.g., 3.45), and spatial distribution range (corresponding to the (x,y) coordinate interval). The resulting real-time consumption distribution results can directly correspond to the nitrogen consumption patterns on the spatiotemporal distribution map, showing "where (x,y), when (time), and how much is consumed (color intensity)," providing a quantitative basis for precise regulation.

[0097] In some embodiments, based on the above embodiments, and based on the real-time nitrogen consumption distribution results, a time-series prediction model is used to predict the risk level of future trace nitrogen loss, including: Based on the real-time nitrogen consumption distribution results, the nitrogen is standardized and converted into a uniform dimension sequence to obtain a preprocessed sequence. The preprocessed sequence is subjected to outlier detection using the isolated forest algorithm. When an outlier is detected, it is removed and interpolated to fill in the gaps, resulting in a smooth sequence. Principal component analysis was used to reduce the dimensionality of the smoothed sequence to obtain a dimensionality-reduced feature sequence. The time-series model of the dimensionality-reduced feature sequence is performed by a long short-term memory network to capture sequence dependencies and obtain a time-series prediction model. Based on the time series prediction model, the trace nitrogen content at future time steps is predicted to obtain the predicted sequence; Based on the predicted sequence, it is compared with a preset nitrogen content threshold, and the risk level of future trace nitrogen loss is generated based on the comparison result.

[0098] Standardization generates a preprocessed sequence: Real-time consumption distribution results include nitrogen consumption values ​​at different times and spaces (e.g., different (x,y) coordinates, conversion rates at different times), and their numerical ranges may vary (e.g., 0.001~0.003 mg). 2 / (L・h・cm2 (). This is achieved through min-max normalization. The core of min-max normalization is to map all consumption values ​​to the [0,1] interval using the following formula: Normalized value = (Original value - Minimum value of all data) / (Maximum value of all data - Minimum value of all data) All consumption values ​​are converted to a uniform dimension range (e.g., [0,1]) to eliminate the influence of numerical range differences on subsequent models, resulting in a preprocessed sequence.

[0099] Isolation Forest Detection of Outliers and Generation of Smooth Sequences: The preprocessed sequence may contain outliers (such as sudden increases / decreases in data due to sensor malfunctions, corresponding to abnormally high / low consumption at a certain spatiotemporal point in the real-time distribution). The Isolation Forest algorithm is used to identify these outliers, and the preprocessed sequence is input into the algorithm.

[0100] Setting the outlier ratio to 0.1 is a key parameter: this tells the algorithm in advance that outliers are expected to account for about 10% of the sequence. The algorithm will then use this ratio to determine "how many splits are needed to separate the data" that are considered outliers. For example, if the sequence has 1000 data points, the algorithm will mark about 100 points that are "most likely to be isolated" as outliers.

[0101] Normal data, which reflects the natural fluctuations in nitrogen consumption, requires multiple random partitionings to separate. Because outlier data differs greatly from surrounding data, it can be isolated with just 1-2 splits and is eventually marked as an outlier by the algorithm.

[0102] After identifying outliers, directly removing them will result in "missing values" in the sequence (e.g., if t2 (x1, y1) is removed, the sequence will break at that position). Interpolation methods are needed to complete the sequence and ensure its continuity and stability. Linear interpolation is suitable for "time-continuous sequences" by using the "linear relationship" between two adjacent normal data points.

[0103] For example, for the same spatial point (x1, y1), calculate the missing values ​​for the time series t1=0.1, t2 (outlier removal), and t3=0.3: The missing value t2 = (t1 + t3) / 2 = (0.1+0.3) / 2 = 0.2. After completion, the sequence is 0.1→0.2→0.3.

[0104] The completed data sequence eliminates anomalous fluctuations such as sudden increases / decreases, and can truly reflect the natural trend of nitrogen consumption.

[0105] Principal component analysis (PCA) reduces dimensionality to obtain a dimensionality-reduced feature sequence. A smoothed sequence may contain multi-dimensional features (such as consumption at different spatial locations, temporal features, etc.). PCA extracts the main feature vectors that explain more than 95% of the variance (e.g., reducing consumption data from 5 spatial dimensions to 2 principal components), simplifying data dimensionality while preserving core information, thus obtaining a dimensionality-reduced feature sequence and improving the efficiency of subsequent models.

[0106] LSTM temporal modeling yields a predictive model. The reduced-dimensional feature sequence exhibits time dependence (e.g., nitrogen consumption in a certain region fluctuates periodically over time). A Long Short-Term Memory (LSTM) network is employed, with a time step of 3 time points. The model reviews the feature data from the previous 3 time points to predict the consumption value at the next time point. The number of hidden layer units is set to 50. The hidden layer is the core of the model's learning of temporal patterns; 50 units mean the model can store 50 different temporal patterns.

[0107] The dimensionality-reduced feature sequence is divided into "input-output" sample pairs according to the time step. For example, for the sequence [t1,t2,t3,t4,t5,...], samples are generated as follows: Input: Dimensionally reduced features of [t1,t2,t3] → Output: Consumption value of t4; Input: Dimensionally reduced features of [t2,t3,t4] → Output: Consumption value of t5.

[0108] The sample pairs are input into the LSTM, allowing the model to gradually "memorize" the temporal patterns. For example, if the features of t1-t3 in the training data always predict increased consumption at t4, the model will strengthen its learning of this pattern by adjusting the gating parameters.

[0109] When the model's prediction error on the training data (e.g., mean squared error MSE) stabilizes at a low level (e.g., <0.01), it indicates that the time dependence of nitrogen consumption (e.g., daily / weekly patterns) has been successfully captured.

[0110] Predicting future time steps to obtain a prediction sequence: Using a trained LSTM model and inputting the most recent dimensionality-reduced feature data, predict the nitrogen consumption values ​​for multiple future time steps (such as the next 7 days) to generate a prediction sequence that reflects the future trend of nitrogen consumption.

[0111] Risk levels are generated by comparing the predicted sequence with preset nitrogen content thresholds: if the predicted value is lower than the threshold, the risk of future nitrogen loss is high; if it is higher than the threshold, the risk is low. Combining the prediction results from continuous time steps, a three-tiered risk level of "low, medium, and high" is ultimately generated to provide a basis for control strategies.

[0112] In some embodiments, based on the above embodiments, according to the risk level, a PID control algorithm is used to calculate the nitrogen regulation demand, and a regulation command signal is generated based on the nitrogen regulation demand, including: Based on the risk level, a PID control algorithm is used to determine the nitrogen regulation demand. Based on the nitrogen regulation demand, a preliminary regulation command signal is generated; Nitrogen distribution status data is obtained from feedback from the execution device. If the distribution status data does not reach the optimization threshold, the control command parameters are adjusted through the random forest algorithm to generate control command signals.

[0113] Based on the risk level, a PID control algorithm is used to determine the nitrogen regulation demand. First, the input parameters of the PID algorithm are defined, with the difference between the "actual nitrogen state corresponding to the risk level" and the "preset optimization target" as the core error. For example, if the risk level is high, corresponding to an actual detected nitrogen concentration of 70 mg / kg (exceeding the upper limit of the ideal range of 30-60 mg / kg, with the target optimization value set at 60 mg / kg), then the error... (A negative error indicates an excess of nitrogen, which needs to be reduced).

[0114] PID algorithm uses ratio ( ),integral( ),differential( The three adjustment factors are used to calculate and regulate the demand: Proportional Term : Directly output the adjustment amount according to the error ratio (e.g.) ,contribute The adjustment demand represents a reduction in the basic quantity. Integral term Accumulate historical errors and eliminate long-term biases (such as...) If the errors in the past three tests were all -10 mg / kg, the cumulative integral contribution is... (to avoid insufficient reduction) Differential term Predict the trend of error change (e.g., the error changes from -10 mg / kg to -8 mg / kg, with a change rate of 2 mg / kg). ,contribute (Slow down the reduction to prevent over-adjustment).

[0115] The sum of these three factors yields the total regulatory requirement (e.g., -5-3+0.1≈-7.9mg / kg), which corresponds to a 20% reduction in nitrogen application in actual operation (calculated by combining the equipment's fertilization rate), thus clarifying the total amount of nitrogen that needs to be reduced.

[0116] Based on the nitrogen regulation demand, a preliminary regulation command signal is generated.

[0117] The "nitrogen regulation demand" calculated by PID is converted into parameter commands that the executing equipment can recognize: If the controlled demand is "reducing fertilizer application by 20%", and considering the basic release rate of the intelligent fertilization equipment (e.g., the original rate of 0.1 kg / h), calculate the adjusted target rate: ; At the same time, the execution duration of the instruction is clearly defined (e.g., based on historical data, it is set to last for 2 hours to ensure that the nitrogen concentration gradually decreases to the target value) and the area of ​​effect (corresponding to the (x,y) coordinate area with a high risk level). The command signal ("rate 0.02 kg / h, duration 2 hours, area (x1, y1)") is transmitted to the execution device (intelligent fertilizer applicator) through a wireless communication module (such as LoRa protocol) to complete the generation of the initial control command.

[0118] If the feedback does not meet the target, adjust the command parameters using the random forest algorithm.

[0119] After executing the initial command, nitrogen distribution data is obtained from the executing device via soil sensors. For example, two hours after executing the initial command, the nitrogen concentration in the high-risk area is detected to be 62 mg / kg. Although this is a decrease from the initial 70 mg / kg, it has not reached the target value of 60 mg / kg, and the soil salinity of 0.52% is close to the preset threshold of 0.5%. The overall distribution status has not reached the optimization threshold, and the random forest algorithm needs to be activated to adjust the parameters. When constructing the training dataset for the random forest model, it is necessary to use historical "risk level (e.g., high risk corresponds to concentration > 60 mg / kg, medium risk corresponds to 50-60 mg / kg), initial control parameters (PID Kp / Ki / Kd values, initial fertilization rate of intelligent fertilization equipment), feedback status (nitrogen concentration, soil salinity), and optimization deviation (difference between feedback concentration and target value)" as features, and label them as "optimal adjustment amount" (e.g., in past cases like "feedback concentration 63 mg / kg, target 60 mg / kg, deviation 3 mg / kg", the optimal adjustment scheme is "Kp adjusted to 0.55, fertilization rate reduced by 5%", then this is used as the label) to ensure that the training data is consistent with the logic of the current control scenario.

[0120] When inputting current data, it is necessary to match the actual feedback status: the risk value is set to 0.7 (62mg / kg is close to the threshold of 60mg / kg, which belongs to medium-high risk), and the initial control parameters ( , , The initial fertilization rate was 0.02 kg / h, the nitrogen concentration was 62 mg / kg, the optimization deviation was 62-60=2 mg / kg, and the salinity was 0.52%. After inputting these data into the trained random forest model, the model uses multiple decision trees to vote on the "direction and magnitude of parameter adjustment," ultimately outputting adjustment suggestions that fit the current deviation: for example, "fine-tune Kp to 0.55 (enhancing the proportional adjustment's response to the deviation, narrowing the 2 mg / kg gap more quickly), and further reduce the fertilization rate from 0.02 kg / h by 5% to 0.019 kg / h (further reducing nitrogen input)."

[0121] Based on the adjusted parameters, a new control command signal is generated ("fertilization rate 0.019 kg / h, continuous action for 1.5 hours, action area is the original high-risk (x, y) coordinate range"), and transmitted to the intelligent fertilization execution device via LoRa transmission equipment for re-execution of the control. After the command is executed, feedback data is collected again. If the nitrogen concentration drops to 60 mg / kg and the salinity drops to 0.48% (both reaching the optimization threshold), the adjustment stops; if the target is still not met, the above random forest parameter optimization process is repeated until the nitrogen distribution meets the preset target, forming a complete closed-loop optimization logic.

[0122] In some embodiments, based on the above embodiments, after calculating the nitrogen regulation demand using a PID control algorithm according to the risk level, and generating a regulation command signal based on the nitrogen regulation demand, the method further includes: By applying a feedback loop mechanism, the dynamically changing feature vectors in each medium are updated through continuous monitoring data, and the adjusted command signal is obtained based on the updated feature vectors. Using the adjusted command signal and a feedback loop mechanism, a dynamic adjustment command is generated, and a dynamic distribution adjustment scheme is obtained based on the dynamic adjustment command.

[0123] Four sensors are deployed per square meter of soil to cover different potential areas such as low nitrogen, medium nitrogen, and high nitrogen (e.g., four sensors in the initial low nitrogen area are located at the four corners of the area) to ensure that the collected data can reflect the spatial distribution differences of nitrogen in the area and avoid the randomness of single-point sampling. Nitrogen concentration data is collected every 15 minutes (for example, in a sensor in an initial low-nitrogen area, the first collection value is 1.2 mg / kg, and the second collection value after 15 minutes may be 1.18 mg / kg or 1.22 mg / kg due to slight fluctuations in soil), balancing data timeliness and equipment power consumption; Each sensor outputs raw concentration values ​​in real time. These data contain two types of noise: one is "random fluctuation noise" (such as a small change from 1.18 to 1.22 mg / kg caused by interference from sensor electronic components), and the other is "extreme abnormal noise" (such as an invalid value of 10 mg / kg caused by sensor failure). The noise is processed by Kalman filtering to smooth out the "random fluctuation noise" and output a stable concentration estimate.

[0124] The core of Kalman filtering is to calculate a more stable optimal estimate than the original data by combining the natural variation of nitrogen concentration with sensor measurement error through a "prediction-update" closed loop. Specifically, this is achieved by considering parameters Q=0.01 (process noise covariance) and R=0.05 (measurement noise covariance). Process noise covariance The core meaning of Q is to describe the "uncertainty of the system state (nitrogen concentration) itself changing over time". The smaller the value, the more stable the system state changes and the lower the uncertainty. Q=0.01 indicates that "the natural rate of change of nitrogen concentration is slow and the fluctuation is small". Measuring noise covariance The core meaning of R is to describe the uncertainty of the deviation between the output value of the measuring device (nitrogen sensor) and the true value. The larger the value, the higher the risk of fluctuation in the measurement result and the stronger the uncertainty. This indicates that "the sensor measurement has a certain error, but the error is controllable" (meaning that the sensor measurement has a certain error, but the error is controllable).

[0125] Prediction error covariance =0.01: The prediction error covariance is a key variable describing the uncertainty of the deviation between the predicted value and the actual state of the system (such as the actual nitrogen concentration). The smaller the value, the smaller the deviation between the predicted value and the actual value, and the more reliable the prediction. Based on the prior knowledge of the system, since the nitrogen concentration changes stably, the initial value is set to a small value of 0.01, which matches Q=0.01.

[0126] Two-step calculation: "Prediction-Update" (combining initial low-nitrogen region data): I. Prediction Step: Based on the "system stability" characteristic, estimate the preliminary predicted value of the current concentration. The core of the prediction step is to "use the reliable results of the previous moment to predict the concentration at the current moment".

[0127] Assume that at the previous time (t-1), the optimal estimate of the nitrogen concentration in this region was 1.2 mg / kg after filtering. Because the system changes slowly, the concentration at the current time (t) will not deviate too much from the previous time. Therefore, the calculation logic for the predicted value is as follows: Predicted value = Previous best estimate + Process noise Q=0.01 means that the maximum influence range of process noise is extremely small (only ±0.01mg / kg), so the predicted value at the current moment is about 1.2mg / kg (almost no difference from the best estimate at the previous moment).

[0128] The prediction error covariance is calculated by adding the process noise covariance Q to the "error covariance updated at the previous time step", as shown in the formula:

[0129] in, It is the optimal error covariance obtained after the "update step" in the previous time step (i.e. the final uncertainty of the previous round of filtering).

[0130] For example: If the previous time (t-1) , Then the prediction error covariance at the current time (t) is:

[0131] II. Update Step: Combine the measured value with the predicted value to obtain the optimal estimate for the current moment. The update step is to "fine-tune the predicted value with actual measurement data". The core is to balance the "reliability of the predicted value" and the "reference value of the measured value" through Kalman gain, so as to avoid the influence of the deviation of a single data point on the result. The Kalman gain formula essentially states that "the ratio of prediction error covariance to measurement error covariance determines whether to place more trust in prediction or measurement": Kalman gain = Prediction error covariance / (Prediction error covariance + R) Substituting the prediction error covariance and R=0.05, we get: Kalman gain = 0.02 / (0.02 + 0.05) ≈ 0.29 This figure clearly shows that filtering will trust the predicted value (71% weight) more and only use the measured value (29% weight) for minor correction. This is in line with the characteristic of "fluctuations in sensor measurements (R=0.05)" and avoids the estimated value from deviating significantly from the system pattern due to the deviation of a single measurement.

[0132] With Kalman gain, a final, reliable estimate can be obtained using "predicted value + measured value correction": Optimal estimate = Predicted value + Kalman gain × (Measured value - Predicted value) Substituting the data from this study (predicted value = 1.2 mg / kg, measured value = 1.18 mg / kg, gain = 0.29): The optimal estimate is: 1.2 + 0.29 × (1.18 - 1.2) = 1.2 + 0.29 × (-0.02) ≈ 1.1942 mg / kg This result retains the "system stability" of the predicted value of 1.2 mg / kg while incorporating the "real-time reference" of the measured value of 1.18 mg / kg. The final value is only 0.0058 mg / kg lower than the predicted value, avoiding the 0.02 mg / kg fluctuation directly caused by the measured value.

[0133] III. Iterative Results: Continuous filtering transforms data from "fluctuating" to "stable". When entering the next time step (t+1), the "optimal estimate of 1.1966 mg / kg" from the previous time step (t) will become the new "optimal estimate of the previous time step", and the "prediction-update" process will be repeated. Based on the stationary data after Kalman filtering, the Z-score algorithm is used to process the data. Extreme anomalies and invalid data are removed.

[0134] The Z-score algorithm identifies extreme outliers by judging the degree to which data deviates from the mean. Its core principle is that "99.7% of normal data will fall within the mean." The statistical regularity within the "range" is determined as follows: Step 1: Calculate the statistical characteristics of historical normal data: First, collect the stationary data of the sensors in the area after Kalman filtering for the past 100 times. Assume the calculated results are: mean ( = 1.2 mg / kg, standard deviation ( = 0.1 mg / kg; Step 2: Calculate the Z-score for the new data: For each new data point after Kalman filtering, calculate its standard deviation from the mean.

[0135] in, This is the average of past stable data. The standard deviation of past stationary data.

[0136] If a data point suddenly changes to 10 mg / kg, substituting the values, we get: Z-score = (10 - 1.2) / 0.1 = 87.5; Step 3: Identify and remove anomalies: because the preset threshold is... (An absolute Z score > 3 indicates an anomaly). 87.5 is much greater than 3, indicating that the data is far outside the normal fluctuation range (an invalid value caused by sensor failure). It is directly removed from the dataset to avoid interfering with subsequent feature extraction and control command generation.

[0137] Based on the preprocessed data, the data is first divided into spatial regions (e.g., each 5 square meters is an analysis unit), and the core indicators for each region are calculated: the mean value of nitrogen concentration data from all sensors in the region is taken, the standard deviation is calculated, and the peak concentration is extracted. These three indicators are then combined into a new feature vector.

[0138] The updated feature vectors are input into the Support Vector Machine (SVM) model. To accommodate the nonlinear relationship between nitrogen concentration and the regulation parameters, the model employs the Radial Basis Function (RBF) kernel function. To control the regularization strength, balance classification accuracy and generalization ability, and avoid local fluctuations in overfitting regions, the regularization parameter C is set to 1.0. To adjust the radial range of the kernel function and adapt to the scale of concentration differences between regions, γ is set to 0.1. γ is a parameter unique to the RBF kernel, which determines the radius of influence of a single training sample on the surrounding space, directly affecting the kernel function's measurement of "feature similarity." The larger the γ value, the smaller the influence range of a single sample (the narrower the radial influence range).

[0139] The model compares the feature vectors with the support vectors determined during the training phase to output classification results. For example, in a region with an original low-nitrogen area, the mean of the feature vector is 1.2 mg / kg. After adjustment, the new feature vector shows a mean of 1.9 mg / kg (not exceeding the 2.0 mg / kg threshold but close), a standard deviation of 0.15 mg / kg (uniformly distributed), and no peak values ​​exceeding the standard. The classification result is "concentration meets the standard and is not excessive." Based on this classification, the SVM determines the direction of the instruction adjustment as "reduce the amount of fertilizer to maintain the current state and avoid excessive application." Combining the original instruction "apply liquid fertilizer with 0.2% nitrogen at a rate of 0.5 L / min," the adjusted instruction is generated as: "reduce the application rate to 0.3 L / min, maintaining a nitrogen content of 0.2%." This reduces the input amount to prevent the concentration from exceeding the threshold while maintaining a stable nitrogen ratio to match the crop's absorption needs. The final instruction is encapsulated in JSON format (including area coordinates, adjustment parameters, and execution timestamp) via the MQTT protocol (lightweight, low-bandwidth, adaptable to sensor networks) and transmitted to the control module of the intelligent fertilization execution device to ensure precise implementation of the adjustment actions.

[0140] Based on the adjusted instructions, and leveraging the real-time and adaptability of the feedback loop, dynamic instructions and an overall solution are further generated: The feedback loop mechanism continuously tracks the execution effect of the adjusted instructions. If fluctuations occur, the instruction parameters are fine-tuned in real time to avoid state deviation caused by the rigidity of a single instruction. At the same time, differentiated dynamic instructions are generated for different regions (such as some regions still being low nitrogen and some being medium nitrogen), such as a rate of 0.4 L / min in the low nitrogen region and 0.3 L / min in the medium nitrogen region, to achieve "one policy for each region".

[0141] The system integrates dynamic adjustment commands from all regions, defining three core elements: 1. Spatial Adaptation: Dividing the region into high, medium, and low nitrogen control zones based on the (x, y) coordinates of sensor positioning, and labeling the real-time command parameters (rate, nitrogen content) for each zone; 2. Time Iteration: Setting feedback monitoring intervals (e.g., once every 15 minutes), and clarifying the triggering conditions for each command adjustment (e.g., concentration fluctuation exceeding ±0.2 mg / kg); 3. Goal Orientation: Taking "improving nitrogen distribution uniformity" as the core objective (e.g., ultimately increasing overall uniformity by 15%), the dynamic commands are linked to long-term optimization goals. The resulting dynamic distribution adjustment scheme can be updated in real time with monitoring data, ensuring that nitrogen levels in each region remain stable within the preset optimal range.

[0142] like Figure 2 As shown, this embodiment of the invention provides a dynamic monitoring and control system for nitrogen conversion processes. Through an integrated modular design, the system enables real-time monitoring of nitrogen consumption, ensuring the accuracy of data integration.

[0143] Data Acquisition Module 10: This module provides raw data support for the entire process. Specifically, it deploys 4 nodes per square meter in the main adsorption layer of the crop root system (10-30 cm soil depth). Each node is equipped with a high-precision electrochemical sensor corresponding to a depth of 10, 20, and 30 cm (capable of detecting trace nitrogen concentrations as low as 0.01 mg / L). An atmospheric gas sensor is also configured to detect ammonia concentrations such as 0.02 ppm. The sampling frequency is set to once per hour. The collected data is aggregated to the central server via the low-power ZigBee protocol. At the same time, outliers with concentrations >1.0 mg / L or <0.01 mg / L are removed, forming a raw dataset containing nitrogen in the soil root layer (with depth, location, and time) and atmospheric ammonia concentration. This dataset is directly passed to the next module.

[0144] Feature Determination Module 20: Continuing from the raw data in the previous module, the data is first standardized using mean-standard deviation (reduced to [-1,1]) on the central server to eliminate dimensional differences. Then, an SVM classification model (using the RBF kernel) is run on the server. Support vectors are selected through quadratic programming, and the hyperplane is calculated (cross-validation accuracy reaches 91%). Finally, feature vectors for "soil nitrogen-depth-location" and "atmospheric ammonia-time-location" are extracted from the model. Dynamic patterns are clarified through correlation analysis, and the extracted feature vectors provide a basis for subsequent monitoring triggers.

[0145] Monitoring module 30: When the above feature vector shows that the soil nitrogen concentration exceeds the preset threshold (e.g., 0.05 mg / L, actually collected 0.06 mg / L), the system triggers acquisition: continuously collects real-time soil nitrogen data through electrochemical sensors such as YSI ProDSS, and measures root adsorption rate (e.g., 0.02 mg / cm²) using a root moisture sensor. 2 The atmospheric nitrogen volatilization rate (e.g., 0.01 mg / m³) was measured using a gas chromatograph. 3 These multi-media data are aggregated to the cloud server via a LoRa wireless transmission device with a frequency of 915MHz and a rate of 125kbps, forming a cross-media dataset containing nitrogen concentration, adsorption rate, volatilization rate, and spatiotemporal information. This dataset is then fed into the data integration module.

[0146] Integration Module 40: Receives cross-media datasets from the cloud server. On the cloud server, using the "timestamp + geographic coordinates" of soil nitrogen data as a benchmark, it achieves time matching and coordinate-based spatial data binding through linear interpolation for three types of data (units: mg / L, mg / cm³, etc.). 2 mg / m 3 Standardization is performed (shortened to [-1,1]), and the SVM soft-interval concept is introduced to accommodate sensor errors. Correlation is calculated (data groups with absolute correlation coefficients > 0.6 are selected), ultimately forming a synchronous dataset of "timestamp - geographic coordinates - three types of standardized data", which is synchronously input into the classification module.

[0147] Classification Module 50: After receiving the synchronized dataset, the cloud server runs the K-means algorithm (using standardized soil nitrogen concentration, root adsorption rate, and atmospheric volatilization rate as core features, calculating Euclidean distance for clustering), and then calculates the nitrogen conversion rate of the root adsorption layer to generate preliminary spatiotemporal distribution data; subsequently, the server runs a profile coefficient evaluation (calculating the average distance within each class). Average distance to nearest outlier The number of clusters is adjusted to meet the coefficient requirements to optimize the spatiotemporal distribution data. Finally, a spatiotemporal heat map is generated through a visualization device, and the optimized spatiotemporal distribution data is transmitted to the consumption analysis module.

[0148] Consumption Analysis Module 60: The server receives the optimized spatiotemporal distribution data, treats each (x, y, time) cell as a node (features include coordinates, time, and conversion rate), runs the GraphSAGE algorithm to aggregate spatially adjacent (x±1, y±1) and temporally continuous neighbor features to generate embedding vectors, and calculates the Euclidean distance matrix; then, based on the matrix, it runs hierarchical clustering to form a tree structure (such as clustering contiguous dark high-conversion areas into "high-consumption clusters"), extracts the time series within the clusters to generate real-time consumption sequences, and binds coordinates to generate a spatial distribution matrix; if the consumption exceeds the threshold, it runs DBSCAN to detect peak nodes, merges the hierarchical structure to generate a new consumption sequence, extracts indicators to obtain real-time consumption distribution results, and inputs them into the prediction module.

[0149] Prediction module 70: The server receives the real-time consumption distribution results and first performs min-max normalization (normalizing the values ​​from 0.001 to 0.003 mg). 2 / (L・h・cm 2 The consumption value is reduced to [0,1] to obtain a preprocessed sequence. Then, an isolated forest (outlier ratio 0.1) is run to remove outliers and interpolate to generate a smooth sequence. Dimensionality reduction is achieved through PCA (extracting principal components that explain more than 95% of the variance) to obtain a dimensionality-reduced feature sequence. Next, an LSTM model (time step 3, hidden layer units 50) is run to capture temporal dependencies and predict the consumption value at future time steps (e.g., 7 days). Finally, the predicted sequence is compared with a preset threshold (e.g., 0.0015mg). 2 / (L・h・cm 2 By comparing the risk levels, the risk is classified into three levels: low, medium, and high. The risk level data is then transmitted to the control module.

[0150] Control module 80: After receiving risk level data, the server runs a PID algorithm (Kp, Ki, Kd parameters) to calculate the nitrogen control requirement (e.g., reducing nitrogen application by 20% under high risk), converts the control amount into smart fertilization equipment parameters (e.g., adjusting the original rate from 0.1 kg / h to 0.02 kg / h), and transmits the instructions to the smart fertilization equipment for execution via LoRa transmission equipment; if the sensor feedback indicates that the nitrogen concentration has not reached the optimization threshold, the server runs a random forest model to output adjustment suggestions, regenerates instructions and transmits them to the smart fertilization equipment until the nitrogen concentration reaches the target, forming a complete control closed loop.

[0151] The nitrogen conversion process dynamic monitoring and control system provided in this embodiment realizes real-time monitoring of nitrogen consumption and ensures the accuracy of data integration.

[0152] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A method for dynamic monitoring and control of a nitrogen conversion process, characterized in that, Executed by a computer, including: Initial monitoring data was obtained by deploying multi-layer node sensors to obtain the original dataset of nitrogen distribution in the root adsorption layer; Based on the original dataset, the support vector machine algorithm is used to determine the dynamically changing feature vectors in each medium. When the feature vector shows that the nitrogen concentration in the soil medium exceeds a preset concentration threshold, the root adsorption data and atmospheric volatilization data of nitrogen are obtained through a sensor network to obtain a cross-media dataset. Based on the cross-media dataset, data fusion technology is used to integrate them to obtain a synchronized dataset; Based on the synchronous dataset, cluster analysis was used for classification. The conversion rate of nitrogen in the root adsorption layer was calculated based on the classification results. Based on the conversion rate, a spatiotemporal distribution map was generated using data visualization technology. The nitrogen consumption amount is extracted from the spatiotemporal distribution map to obtain the real-time nitrogen consumption distribution results; Based on the real-time consumption distribution results of nitrogen, a time-series prediction model is used to predict the risk level of future trace nitrogen loss. Based on the risk level, a PID control algorithm is used to calculate the nitrogen regulation demand, and a regulation command signal is generated based on the nitrogen regulation demand.

2. The method for dynamic monitoring and control of nitrogen conversion process according to claim 1, characterized in that, The step of determining the dynamically changing feature vectors in each medium using the support vector machine algorithm based on the original dataset includes: Preprocessing techniques were used to denoise and standardize the original dataset to obtain a normalized nitrogen concentration dataset. Based on the standardized nitrogen concentration dataset, a classification model is obtained by training using the support vector machine algorithm. Based on the classification model, the dynamically changing feature vectors in each medium are determined.

3. The method for dynamic monitoring and control of nitrogen conversion process according to claim 1, characterized in that, The process of classifying data using cluster analysis based on the synchronized dataset, calculating the nitrogen conversion rate in the root adsorption layer based on the classification results, and generating a spatiotemporal distribution map using data visualization technology based on the conversion rate includes: Based on the synchronized dataset, the K-means algorithm is used for classification to obtain the dataset classification results; Based on the classification results of the dataset, the conversion rate of trace nitrogen in the root adsorption layer is calculated to generate preliminary spatiotemporal distribution data. Based on the preliminary spatiotemporal distribution data, the silhouette coefficient evaluation method is used to obtain the classification quality evaluation results; Based on the evaluation results, repeat the iterative optimization steps to generate spatiotemporal distribution data; Based on the spatiotemporal distribution data, a spatiotemporal distribution map is generated using data visualization technology.

4. The method for dynamic monitoring and control of nitrogen conversion process according to claim 1, characterized in that, The step of extracting nitrogen consumption from the spatiotemporal distribution map to obtain the real-time nitrogen consumption distribution results includes: Based on the spatiotemporal distribution map, a graph neural network is used to generate a distance matrix; Based on the distance matrix, a hierarchical clustering method is used to obtain a hierarchical structure; Based on the aforementioned hierarchical structure, a real-time consumption sequence is generated using time series analysis methods. Spatial distribution features are extracted from the real-time consumption sequence to generate a spatial distribution matrix; When the nitrogen consumption in the spatial distribution matrix exceeds a preset consumption threshold, the density peak value is detected by a density clustering algorithm to determine the peak node. Based on the peak nodes, a fusion layer merging process is performed to generate a merged node consumption sequence; Consumption quantification indicators are extracted from the merged node consumption sequence to obtain the real-time nitrogen consumption distribution results.

5. The method for dynamic monitoring and control of nitrogen conversion process according to claim 1, characterized in that, Based on the real-time nitrogen consumption distribution results, a time-series prediction model is used to predict the risk level of future trace nitrogen loss, including: Based on the real-time nitrogen consumption distribution results, the nitrogen is standardized and converted into a uniform dimension sequence to obtain a preprocessed sequence. The preprocessed sequence is subjected to outlier detection using the isolated forest algorithm. When an outlier is detected, it is removed and interpolated to fill in the gaps, resulting in a smooth sequence. Principal component analysis was used to reduce the dimensionality of the smoothed sequence to obtain a dimensionality-reduced feature sequence. The time-series model of the dimensionality-reduced feature sequence is performed by a long short-term memory network to capture sequence dependencies and obtain a time-series prediction model. Based on the time series prediction model, the trace nitrogen content at future time steps is predicted to obtain the predicted sequence; Based on the predicted sequence, it is compared with a preset nitrogen content threshold, and the risk level of future trace nitrogen loss is generated based on the comparison result.

6. The method for dynamic monitoring and control of nitrogen conversion process according to claim 1, characterized in that, The step of calculating the nitrogen regulation demand using a PID control algorithm based on the risk level, and generating a regulation command signal based on the nitrogen regulation demand, includes: Based on the risk level, a PID control algorithm is used to determine the nitrogen regulation demand. Based on the nitrogen regulation demand, a preliminary regulation command signal is generated; Nitrogen distribution status data is obtained from feedback from the execution device. If the distribution status data does not reach the optimization threshold, the control command parameters are adjusted through the random forest algorithm to generate control command signals.

7. The method for dynamic monitoring and control of nitrogen conversion process according to claim 1, characterized in that, After calculating the nitrogen regulation demand using a PID control algorithm based on the risk level, and generating a regulation command signal based on the nitrogen regulation demand, the process further includes: By applying a feedback loop mechanism, the dynamically changing feature vectors in each medium are updated through continuous monitoring data, and the adjusted command signal is obtained based on the updated feature vectors. Using the adjusted command signal and a feedback loop mechanism, a dynamic adjustment command is generated, and a dynamic distribution adjustment scheme is obtained based on the dynamic adjustment command.

8. A dynamic monitoring and control system for a nitrogen conversion process, characterized in that, include: The data acquisition module is used to acquire initial monitoring data through deployed multi-layer node sensors to obtain the original dataset of nitrogen distribution in the root adsorption layer; The feature determination module is used to determine the dynamically changing feature vectors in each medium based on the original dataset using a support vector machine algorithm. The monitoring module is used to obtain root adsorption data and atmospheric volatilization data of nitrogen through a sensor network when the feature vector shows that the nitrogen concentration in the soil medium exceeds a preset concentration threshold, so as to obtain a cross-media dataset. The integration module is used to integrate the cross-media dataset using data fusion technology to obtain a synchronized dataset; The classification module is used to classify the synchronous dataset using cluster analysis, calculate the conversion rate of nitrogen in the root adsorption layer based on the classification results, and generate a spatiotemporal distribution map based on the conversion rate using data visualization technology. The consumption analysis module is used to extract nitrogen consumption from the spatiotemporal distribution map to obtain the real-time nitrogen consumption distribution results; The prediction module is used to predict the risk level of future trace nitrogen loss based on the real-time consumption distribution results of the nitrogen and using a time-series prediction model. The control module is used to calculate the nitrogen control demand based on the risk level using a PID control algorithm, and generate a control command signal based on the nitrogen control demand.