Method and system for monitoring migration of water, fertilizer and salt in drip irrigation cotton field based on intelligent sensor
By collecting data in real time using intelligent sensors and using Transformer and Random Forest models for feature fusion and monitoring, the problem of data migration error in water, fertilizer and salt monitoring of drip-irrigated cotton fields has been solved, realizing dynamic monitoring and precise irrigation and fertilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-03-13
AI Technical Summary
Existing methods for monitoring water, fertilizer, and salt in drip-irrigated cotton fields do not consider environmental factors such as soil texture and drip irrigation intensity, resulting in data migration that fails to reflect the spatiotemporal migration characteristics of water, fertilizer, and salt. Furthermore, traditional data migration methods ignore the dynamic nature of water, fertilizer, and salt migration, leading to errors.
Data is collected in real time by intelligent sensors, cleaned and outlier removed, feature fusion is performed using the Transformer model, and the data is input into a random forest model for monitoring, generating spatial distribution predictions of soil moisture content and electrical conductivity, as well as red warning markers.
It improved the matching accuracy between the migrated data and the actual soil sampling values, provided a basis for dynamic monitoring and precise irrigation and fertilization, and optimized the prediction of water, fertilizer and salt migration patterns.
Smart Images

Figure 048D3F91-5EBB-4E79-89AB-59F941E83708 
Figure 176743D3-8945-4C52-A289-F300AF688714 
Figure 7101D740-8E3C-4CB2-8722-0DAED071BEF0
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method and system for monitoring the migration of water, fertilizer, and salt in drip-irrigated cotton fields based on intelligent sensors. Background Technology
[0002] As a core means of water conservation and efficiency improvement in cotton fields, drip irrigation technology directly affects cotton growth and resource utilization efficiency due to the migration patterns of water, fertilizer, and salt in the soil. Currently, water, fertilizer, and salt monitoring in drip-irrigated cotton fields mainly relies on single-point sensor data collection. These sensors are distributed across different soil layers and spatial locations, and the collected data needs to be migrated to a central processing terminal. However, existing migration methods only involve simple splicing and do not consider the impact of environmental factors such as soil texture and drip irrigation intensity on data correlation. This results in the migrated data failing to reflect the spatiotemporal migration characteristics of water, fertilizer, and salt. Traditional data migration methods use linear interpolation or static mapping, ignoring the dynamic nature of water, fertilizer, and salt migration, leading to errors in matching the migrated data with the actual migration process. Summary of the Invention
[0003] The purpose of this invention is to solve the above problems by designing a method and system for monitoring the migration of water, fertilizer and salt in drip-irrigated cotton fields based on intelligent sensors.
[0004] The first aspect of this invention provides a method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on intelligent sensors, the method comprising the following steps: The soil moisture content, electrical conductivity, temperature and drip irrigation flow rate data are collected in real time by sensors, and the temperature data is the soil temperature at each soil layer node. The collected raw data is cleaned, outliers are removed, and missing values are filled in. Temporal and spatial features are extracted through spatiotemporal standardization. The Transformer model is used to fuse features in the preprocessed data to generate transfer features, where each element in the transfer features corresponds to the fused feature value of the time point and spatial location. The migration characteristics are input into the random forest model, and the output monitoring results include the spatial distribution prediction values of soil moisture content and electrical conductivity, as well as red warning markers.
[0005] Optionally, in a first implementation of the first aspect of the present invention, the step of cleaning the collected raw data, removing outliers, filling in missing values, and extracting temporal and spatial features through spatiotemporal standardization includes: From the raw data collected, continuously collected data from the same type of sensor within the same monitoring unit were extracted according to soil stratification. Calculate the mean and standard deviation of continuously collected data, identify outliers based on the 3σ criterion algorithm, and remove them; For missing values in the outlier-processed data, a search area is defined with the monitoring unit as the scope. Within the search area, the three closest working nodes with the same soil layer and sensor type as the missing value are selected, and valid data from the three nodes within 10 minutes before and after the time corresponding to the missing value are extracted. Calculate the weighted average of the valid data for the three nodes, and use the weighted average as the padding value to fill in the missing positions; The cleaned data is subjected to time and space standardization, and the time and space features are extracted respectively. The preprocessed data is obtained by combining the cleaned, spatiotemporally standardized and feature-extracted data.
[0006] Optionally, in a second implementation of the first aspect of the present invention, the step of performing time standardization and spatial standardization on the cleaned data, and extracting time features and spatial features respectively, and combining the cleaned, spatiotemporally standardized, and feature-extracted data to obtain preprocessed data, includes: Collect the raw acquisition timestamps of all sensors, take the start time of the drip irrigation system as the reference time point, convert the acquisition time of each sensor into a relative time relative to the reference point, and construct a time axis with 10-minute standard time intervals to form time series data with equal time intervals; A three-dimensional rectangular coordinate system is established with the geometric center of the monitoring unit as the origin. The physical position coordinates of each sensor in the cotton field are measured and converted into relative coordinates with the origin as the reference. For sensors in the same soil layer but with different horizontal positions, the horizontal distance between their relative coordinates is calculated. The difference between soil moisture content and electrical conductivity at two adjacent time points is calculated in the time series data, and the time change rate of moisture content and electrical conductivity are obtained based on the time interval to form time features; Select the moisture content data of adjacent horizontal nodes in the same soil layer at the same time point, calculate the difference in moisture content in the horizontal direction, and obtain the horizontal moisture content gradient based on the horizontal distance between the nodes. Conductivity data of adjacent depth nodes at the same time point and in the same vertical profile are selected, the conductivity difference in the vertical direction is calculated, and the vertical conductivity gradient is obtained based on the depth difference. Spatial features are formed based on the horizontal moisture content gradient and the vertical conductivity gradient. The preprocessed data is obtained by integrating the cleaned, spatiotemporally standardized and feature-extracted data.
[0007] Optionally, in a third implementation of the first aspect of the present invention, the Transformer model includes an input layer, a spatiotemporal attention mechanism, a Transformer encoding layer, and a transfer data output layer, wherein the spatiotemporal attention mechanism strengthens the spatiotemporal information strongly correlated with water, fertilizer, and salt migration through temporal attention weights and spatial attention weights.
[0008] Optionally, in a fourth implementation of the first aspect of the present invention, the step of using a Transformer model to perform feature fusion on the preprocessed data to generate transfer features includes: An initial data migration matrix is constructed based on the preprocessed data. The initial data migration matrix is then decomposed into a sequence of feature vectors, where each vector in the feature vector sequence corresponds to all feature data of a single time point and a single spatial node. For the feature vector sequence, calculate the attention weight at each time point within the 30-minute period before and after drip irrigation, and multiply the feature vector at each time point by the corresponding weight to obtain the time attention-weighted feature vector sequence; Based on the feature vector sequence weighted by time attention, the soil layers are divided vertically and assigned basic weights. The weights are adjusted by combining the horizontal distance from the drip irrigation tape outlet. The feature vector of each spatial node is multiplied by the corresponding weight to obtain the feature vector sequence fused with spatiotemporal attention. The feature vector sequence fused with spatiotemporal attention is input into the first layer of the Transformer encoder to calculate the correlation between vectors and generate correlation features. The correlation features are then fed into the second layer encoder to enhance the vertical water, fertilizer and salt migration features and output the middle layer encoding result. The middle layer encoding result is then fed into the third layer encoder to fuse the horizontal diffusion features and output the fused feature after three layers of encoding. The feature values within the fusion feature are standardized to obtain the transfer feature, where each element in the transfer feature corresponds to the fusion feature value of time and spatial location.
[0009] Optionally, in a fifth implementation of the first aspect of the present invention, the step of dividing the soil layers vertically and assigning basic weights, and adjusting the weights in conjunction with the horizontal distance from the drip irrigation tape outlet, includes: The nodes in the 20-40cm root active layer were assigned a basic weight of 0.6, the nodes in the 0-20cm tillage layer were assigned a basic weight of 0.3, and the nodes in the 40-60cm deep layer were assigned a basic weight of 0.1. The weight of nodes within 1 meter of the outlet increases by 0.2, the weight of nodes between 1 and 3 meters remains at the base value, and the weight of nodes more than 3 meters away decreases by 0.1.
[0010] Optionally, in a sixth implementation of the first aspect of the present invention, the step of inputting the migration features into the random forest model and outputting the monitoring results includes: Migration feature data from the past three cotton growth cycles were extracted, and the data subsets were divided according to different drip irrigation and fertilization amounts. The migration trend for the next two hours was used as the output label. 100 decision trees with a maximum depth of 10 layers were set up, and the decision trees were trained using the divided data subsets to obtain a random forest model. The real-time drip irrigation and fertilization amounts are input into the random forest model, and the monitoring results are output to obtain the suitable threshold range for cotton growth. Based on the monitoring results, areas that exceed the suitable threshold range are marked with a red warning.
[0011] A second aspect of the present invention provides a water, fertilizer, and salt migration monitoring system for drip-irrigated cotton fields based on intelligent sensors, the system comprising: The data acquisition model is used to collect data on soil moisture content, electrical conductivity, temperature and drip irrigation flow rate in real time through sensors, where the temperature data is the soil temperature at each soil layer node; The preprocessing model is used to clean the collected raw data, remove outliers, and fill in missing values, and extract temporal and spatial features through spatiotemporal standardization; The feature fusion model is used to fuse features of preprocessed data using the Transformer model to generate transfer features, where each element in the transfer feature corresponds to the fused feature value of the time point and spatial location. The migration prediction model is used to input migration characteristics into a random forest model and output monitoring results, including spatial distribution predictions of soil moisture content and electrical conductivity, as well as red warning markers.
[0012] A third aspect of the present invention provides a water, fertilizer, and salt migration monitoring device for drip-irrigated cotton fields based on intelligent sensors. The intelligent sensor-based water, fertilizer, and salt migration monitoring device for drip-irrigated cotton fields includes a memory and at least one processor. The memory stores instructions. The at least one processor invokes the instructions in the memory to cause the intelligent sensor-based water, fertilizer, and salt migration monitoring device for drip-irrigated cotton fields to perform the various steps of the water, fertilizer, and salt migration monitoring method for drip-irrigated cotton fields based on intelligent sensors as described in any of the preceding claims.
[0013] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the steps of the method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on smart sensors as described in any of the preceding claims.
[0014] The technical solution provided by this invention collects soil moisture content, electrical conductivity, temperature, and drip irrigation flow rate data in real time using sensors, where the temperature data refers to the soil temperature at each soil layer node. The collected raw data is cleaned, outliers are removed, and missing values are filled in. Temporal and spatial features are extracted through spatiotemporal standardization. A Transformer model is used to fuse the preprocessed data to generate migration features. These migration features are then input into a random forest model to output monitoring results. This invention strengthens the spatiotemporal correlation of data through the Transformer model, improves the matching accuracy between the migrated data and actual soil sampling values, solves the problem of information loss during migration, achieves dynamic monitoring, optimizes migration pattern prediction, and provides a basis for precision irrigation and fertilization. Attached Figure Description
[0015] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.
[0016] Figure 1 A flowchart of a method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on intelligent sensors, provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a drip irrigation cotton field water, fertilizer and salt migration monitoring system based on intelligent sensors provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a water, fertilizer and salt migration monitoring device for drip irrigation cotton fields based on intelligent sensors, provided in an embodiment of the present invention. Detailed Implementation
[0017] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0018] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The flowchart of the water, fertilizer, and salt migration monitoring method for drip-irrigated cotton fields based on intelligent sensors provided in this embodiment of the invention includes the following steps: Step 101: Collect soil moisture content, electrical conductivity, temperature and drip irrigation flow rate data in real time through sensors, where the temperature data is the soil temperature at each soil layer node; In this embodiment, when dividing the monitoring units in the drip-irrigated cotton field, the topography, drip tape density, and soil texture uniformity are comprehensively considered. For cotton fields with flat terrain and drip tapes laid parallel at 3-meter intervals, a 10m×10m square monitoring unit is used to ensure that each unit contains 3-4 drip tapes and a complete cotton planting row. If the cotton field has slight topographical undulations or soil texture differences, the unit boundaries are adjusted to be divided along topographic contour lines or soil texture boundaries to avoid excessive differences in soil characteristics within the unit. Each monitoring unit... The sensors are deployed vertically in layers according to the cotton root growth pattern: the 0-20cm tillage layer, as the rapid water and fertilizer infiltration zone, has the highest sensor density, such as one node every 10cm depth, focusing on collecting data on the rapid increase in water content and nutrient diffusion shortly after drip irrigation; the 20-40cm root active layer, as the core area for cotton water and fertilizer absorption, integrates soil moisture, EC, and temperature monitoring functions, with one node every 15cm depth, synchronously recording the dynamic changes in water, fertilizer, and salt concentrations caused by root activity; 40- A 60cm deep soil layer serves as a water and fertilizer leakage early warning zone, with sensors deployed at 20cm depth intervals to primarily monitor for downward migration of water and fertilizer due to excessive drip irrigation. Horizontally, sensors are arranged radially around the drip irrigation tape outlet: nodes are placed directly below the outlet and at horizontal positions 50cm, 100cm, and 150cm away to capture gradient changes in water and fertilizer diffusion from the drip irrigation point to the surrounding area. Additionally, sensors are added at the center of the cotton plant root system, such as 10-15cm from the plant base, and at the boundary of the monitoring unit. The former is used to acquire water and fertilizer data from the actual absorption area of the cotton, while the latter is used to determine the interaction of water and fertilizer migration between units. All sensors automatically collect data at a frequency of 10 minutes per data point. Soil moisture content is measured using the frequency domain reflectometry method, electrical conductivity is detected using the electrode method, and temperature is collected using a thermocouple sensor. Drip irrigation flow rate is recorded in real-time by an electromagnetic flowmeter installed at the head of the drip irrigation tape. The collected data includes a timestamp accurate to the second and centimeter-level spatial coordinates, forming a three-dimensional monitoring data network covering the drip irrigation point, root zone, and unit boundary.
[0019] Step 102: Clean the collected raw data, remove outliers, fill in missing values, and extract temporal and spatial features through spatiotemporal standardization; In this embodiment, continuous data from the same type of sensor within the same monitoring unit is extracted from the raw data according to soil stratification. The mean and standard deviation of the continuous data are calculated, and outliers are identified and removed based on the 3σ criterion algorithm. For missing values in the data after outlier processing, a search area is defined with the monitoring unit as the scope. Within the search area, the three closest working nodes with the same soil layer and sensor type as the missing value are selected, and valid data from the three nodes within 10 minutes before and after the time corresponding to the missing value are extracted. The weighted average of the valid data from the three nodes is calculated and used as the fill value to fill the missing position. The cleaned data is subjected to time standardization and spatial standardization, and time and spatial features are extracted respectively. The preprocessed data is obtained by combining the cleaned, spatiotemporally standardized, and feature-extracted data.
[0020] In this embodiment, the original acquisition timestamps of all sensors are collected. Using the start-up time of the drip irrigation system as the reference time, the acquisition time of each sensor is converted into a relative time relative to the reference point. A time axis is constructed with 10-minute standard time intervals to form time-series data with equal time intervals. A three-dimensional rectangular coordinate system is established with the geometric center of the monitoring unit as the origin. The physical position coordinates of each sensor in the cotton field are measured and converted into relative coordinates with the origin as the reference. For sensors located in the same soil layer but at different horizontal positions, the horizontal distance between their relative coordinates is calculated. The soil moisture content at two adjacent time points is calculated from the time-series data. The difference between water content and electrical conductivity is used to obtain the time-varying rates of water content and electrical conductivity based on time intervals, forming a temporal feature. Water content data of adjacent horizontal nodes within the same soil layer at the same time point are selected to calculate the horizontal water content difference and obtain the horizontal water content gradient based on the horizontal distance between nodes. Electrical conductivity data of adjacent depth nodes within the same vertical profile at the same time point are selected to calculate the vertical electrical conductivity difference and obtain the vertical electrical conductivity gradient based on the depth difference. Spatial features are formed based on the horizontal water content gradient and the vertical electrical conductivity gradient. The preprocessed data is obtained by integrating the cleaned, spatiotemporally standardized, and feature-extracted data.
[0021] Step 103: Use the Transformer model to perform feature fusion on the preprocessed data to generate transfer features; In this embodiment, continuous data from the same type of sensor within the same monitoring unit is extracted from the raw data according to soil stratification. The mean and standard deviation of the continuous data are calculated, and outliers are identified and removed based on the 3σ criterion algorithm. For missing values in the data after outlier processing, a search area is defined with the monitoring unit as the scope. Within the search area, the three closest working nodes with the same soil layer and sensor type as the missing value are selected, and valid data from the three nodes within 10 minutes before and after the time corresponding to the missing value are extracted. The weighted average of the valid data from the three nodes is calculated and used as the fill value to fill the missing position. The cleaned data is subjected to time standardization and spatial standardization, and time and spatial features are extracted respectively. The preprocessed data is obtained by combining the cleaned, spatiotemporally standardized, and feature-extracted data.
[0022] In this embodiment, the original acquisition timestamps of all sensors are collected. Using the start-up time of the drip irrigation system as the reference time, the acquisition time of each sensor is converted into a relative time relative to the reference point. A time axis is constructed with 10-minute standard time intervals to form time-series data with equal time intervals. A three-dimensional rectangular coordinate system is established with the geometric center of the monitoring unit as the origin. The physical position coordinates of each sensor in the cotton field are measured and converted into relative coordinates with the origin as the reference. For sensors located in the same soil layer but at different horizontal positions, the horizontal distance between their relative coordinates is calculated. The soil moisture content at two adjacent time points is calculated from the time-series data. The difference between water content and electrical conductivity is used to obtain the time-varying rates of water content and electrical conductivity based on time intervals, forming a temporal feature. Water content data of adjacent horizontal nodes within the same soil layer at the same time point are selected to calculate the horizontal water content difference and obtain the horizontal water content gradient based on the horizontal distance between nodes. Electrical conductivity data of adjacent depth nodes within the same vertical profile at the same time point are selected to calculate the vertical electrical conductivity difference and obtain the vertical electrical conductivity gradient based on the depth difference. Spatial features are formed based on the horizontal water content gradient and the vertical electrical conductivity gradient. The preprocessed data is obtained by integrating the cleaned, spatiotemporally standardized, and feature-extracted data.
[0023] Step 104: Input the migration features into the random forest model and output the monitoring results; In this embodiment, the monitoring results include the spatial distribution prediction values of soil moisture content and electrical conductivity, as well as red warning markers.
[0024] In this embodiment, the migration characteristics of the monitoring unit are extracted from the cloud data center, and the core characteristic data of soil moisture content, electrical conductivity, soil temperature and drip irrigation flow rate are screened. The data is split into sub-matrices of a single monitoring period according to the time series. Each sub-matrice contains the feature values of all spatial nodes in that period. Data normalization is performed on each sub-matrice, and the feature values are mapped to the 0-1 interval, such as converting soil moisture content as a percentage of field maximum water holding capacity, to eliminate the differences in the physical dimensions of different features. Historical migration feature data and corresponding soil measurement data for the past 7 days were collected and divided into training and validation sets in an 8:2 ratio. A three-layer LSTM network was constructed, with the input layer dimension matching the migration feature dimension, and the number of hidden layer nodes being 64, 32, and 16, respectively. The output layer was the correction coefficient. The migration features of the training set were used as input, and the deviation rate between the measured values and the original migration values was used as the label for model training. During training, network parameters such as the learning rate and the number of iterations were adjusted in real time using the validation set until the error of the correction coefficient output by the model stabilized within 3%, thus completing the dynamic correction model training. The current migration features are input into the trained LSTM dynamic correction model. The model calculates the correction coefficient for each spatial node based on the spatiotemporal features in the matrix, such as the rate of change of soil moisture content and the spatial gradient of electrical conductivity over the last three periods. The correction coefficients are adjusted according to the time decay principle, with higher weights for historical data closer to the current time. For example, the weight of data from the previous period is 0.4, 0.3 for the previous two periods, and 0.3 for the previous three periods. The original values of soil moisture content and electrical conductivity in the migration features are multiplied by the corresponding correction coefficients to obtain the corrected soil moisture content and electrical conductivity data. The correction time and correction coefficient values are recorded simultaneously. Corrected migration data from the past three cotton growth cycles were extracted and divided into subsets based on different drip irrigation and fertilization rates. Each subset contained migration trajectory data of soil moisture content and electrical conductivity under corresponding conditions. A random forest model was constructed, with drip irrigation rate, fertilization rate, and initial soil moisture content / electrical conductivity as input features and the migration trend of soil moisture content / electrical conductivity in the next two hours as the output label. The model was trained using the divided datasets, with the number of decision trees set to 100 and the maximum depth set to 10. At the same time, a spatiotemporal interpolation model was trained, which learned the diffusion coefficients of soil moisture content and electrical conductivity in the horizontal and vertical directions based on the relative coordinates of spatial nodes. The current corrected soil moisture content and electrical conductivity data, along with real-time drip irrigation and fertilization rates, are input into the trained random forest model to obtain the predicted trend of θ and EC over the next 2 hours. A prediction point is set every 10 minutes. Combined with the spatiotemporal interpolation model, the spatial distribution of soil moisture content and electrical conductivity in the 0-60cm soil layer at each prediction time point is calculated based on the predicted time trend and current spatial distribution characteristics. The consistency of the prediction results is verified. If the difference between θ and EC in adjacent grids exceeds the reasonable range in the field, the interpolation model is called again for correction. The predicted spatiotemporal distribution data of soil moisture content and electrical conductivity are converted into visualization formats such as 3D heat maps and time variation curves, and the suitable threshold ranges for cotton growth are marked. For example, the suitable range for soil moisture content is 60%-80% of field capacity, and the suitable range for electrical conductivity is <2.5dS / m. Areas that exceed the suitable range are marked with a red warning, such as reducing the amount of fertilizer or increasing the amount of drip irrigation. Please see Figure 2 A schematic diagram of the structure of a drip irrigation cotton field water, fertilizer, and salt migration monitoring system based on intelligent sensors provided in this embodiment of the invention. The system includes: The data acquisition model is used to collect data on soil moisture content, electrical conductivity, temperature and drip irrigation flow rate in real time through sensors, where the temperature data is the soil temperature at each soil layer node; The preprocessing model is used to clean the collected raw data, remove outliers, and fill in missing values, and extract temporal and spatial features through spatiotemporal standardization; The feature fusion model is used to fuse features of preprocessed data using the Transformer model to generate transfer features, where each element in the transfer feature corresponds to the fused feature value of the time point and spatial location. The migration prediction model is used to input migration characteristics into a random forest model and output monitoring results, including spatial distribution predictions of soil moisture content and electrical conductivity, as well as red warning markers.
[0025] Figure 3This is a schematic diagram of the structure of a water, fertilizer, and salt migration monitoring device for drip irrigation cotton fields based on intelligent sensors, provided in an embodiment of the present invention. The intelligent sensor-based water, fertilizer, and salt migration monitoring device 300 for drip irrigation cotton fields can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 310 (e.g., one or more processors) and a memory 320, and one or more storage media 330 (e.g., one or more mass storage devices) storing application programs 333 or data 332. The memory 320 and storage media 330 can be for short-term or long-term storage. The program stored in the storage media 330 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the intelligent sensor-based water, fertilizer, and salt migration monitoring device 300 for drip irrigation cotton fields. Furthermore, the processor 310 may be configured to communicate with the storage media 330 and execute the series of instruction operations in the storage media 330 on the intelligent sensor-based water, fertilizer, and salt migration monitoring device 300 for drip irrigation cotton fields to implement the method provided in the above embodiment.
[0026] The smart sensor-based drip irrigation cotton field water, fertilizer, and salt migration monitoring device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input / output interfaces 360, and / or one or more operating systems 331, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 3 The structure of the drip irrigation cotton field water, fertilizer and salt migration monitoring device based on smart sensors shown does not constitute a limitation on the computer device provided by the present invention. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0027] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the various steps of the water, fertilizer and salt migration monitoring method for drip irrigation cotton fields based on smart sensors provided in the above embodiments.
[0028] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described equipment or apparatus / unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0029] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0030] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on intelligent sensors, characterized in that, The method includes the following steps: The soil moisture content, electrical conductivity, temperature and drip irrigation flow rate data are collected in real time by sensors, and the temperature data is the soil temperature at each soil layer node. The collected raw data is cleaned, outliers are removed, and missing values are filled in. Temporal and spatial features are extracted through spatiotemporal standardization. The Transformer model is used to fuse features in the preprocessed data to generate transfer features, where each element in the transfer features corresponds to the fused feature value of the time point and spatial location. The migration characteristics are input into the random forest model, and the output monitoring results include the spatial distribution prediction values of soil moisture content and electrical conductivity, as well as red warning markers.
2. The method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on intelligent sensors as described in claim 1, characterized in that, The process of cleaning the collected raw data, removing outliers, imputing missing values, and extracting temporal and spatial features through spatiotemporal standardization includes: From the raw data collected, continuously collected data from the same type of sensor within the same monitoring unit were extracted according to soil stratification. Calculate the mean and standard deviation of continuously collected data, identify outliers based on the 3σ criterion algorithm, and remove them; For missing values in the outlier-processed data, a search area is defined with the monitoring unit as the scope. Within the search area, the three closest working nodes with the same soil layer and sensor type as the missing value are selected, and valid data from the three nodes within 10 minutes before and after the time corresponding to the missing value are extracted. Calculate the weighted average of the valid data for the three nodes, and use the weighted average as the padding value to fill in the missing positions; The cleaned data is subjected to time and space standardization, and the time and space features are extracted respectively. The preprocessed data is obtained by combining the cleaned, spatiotemporally standardized and feature-extracted data.
3. The method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on intelligent sensors as described in claim 2, characterized in that, The cleaned data undergoes time and spatial standardization, and temporal and spatial features are extracted separately. The preprocessed data, obtained by combining the cleaned, spatiotemporally standardized, and feature-extracted data, includes: Collect the raw acquisition timestamps of all sensors, take the start time of the drip irrigation system as the reference time point, convert the acquisition time of each sensor into a relative time relative to the reference point, and construct a time axis with 10-minute standard time intervals to form time series data with equal time intervals; A three-dimensional rectangular coordinate system is established with the geometric center of the monitoring unit as the origin. The physical position coordinates of each sensor in the cotton field are measured and converted into relative coordinates with the origin as the reference. For sensors in the same soil layer but with different horizontal positions, the horizontal distance between their relative coordinates is calculated. The difference between soil moisture content and electrical conductivity at two adjacent time points is calculated in the time series data, and the time change rate of moisture content and electrical conductivity are obtained based on the time interval to form time features; Select the moisture content data of adjacent horizontal nodes in the same soil layer at the same time point, calculate the difference in moisture content in the horizontal direction, and obtain the horizontal moisture content gradient based on the horizontal distance between the nodes. Conductivity data of adjacent depth nodes at the same time point and in the same vertical profile are selected, the conductivity difference in the vertical direction is calculated, and the vertical conductivity gradient is obtained based on the depth difference. Spatial features are formed based on the horizontal moisture content gradient and the vertical conductivity gradient. The preprocessed data is obtained by integrating the cleaned, spatiotemporally standardized and feature-extracted data.
4. The method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on intelligent sensors as described in claim 1, characterized in that, The Transformer model includes an input layer, a spatiotemporal attention mechanism, a Transformer encoding layer, and a transfer data output layer. The spatiotemporal attention mechanism strengthens the spatiotemporal information that is strongly correlated with the migration of water, fertilizer, and salt through temporal attention weights and spatial attention weights.
5. The method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on intelligent sensors as described in claim 1, characterized in that, The step of using the Transformer model to perform feature fusion on the preprocessed data to generate transfer features includes: An initial data migration matrix is constructed based on the preprocessed data. The initial data migration matrix is then decomposed into a sequence of feature vectors, where each vector in the feature vector sequence corresponds to all feature data of a single time point and a single spatial node. For the feature vector sequence, calculate the attention weight at each time point within the 30-minute period before and after drip irrigation, and multiply the feature vector at each time point by the corresponding weight to obtain the time attention-weighted feature vector sequence; Based on the feature vector sequence weighted by time attention, the soil layers are divided vertically and assigned basic weights. The weights are adjusted by combining the horizontal distance from the drip irrigation tape outlet. The feature vector of each spatial node is multiplied by the corresponding weight to obtain the feature vector sequence fused with spatiotemporal attention. The feature vector sequence fused with spatiotemporal attention is input into the first layer of the Transformer encoder to calculate the correlation between vectors and generate correlation features. The correlation features are then fed into the second layer encoder to enhance the vertical water, fertilizer and salt migration features and output the middle layer encoding result. The middle layer encoding result is then fed into the third layer encoder to fuse the horizontal diffusion features and output the fused feature after three layers of encoding. The feature values within the fusion feature are standardized to obtain the transfer feature, where each element in the transfer feature corresponds to the fusion feature value of time and spatial location.
6. The method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on intelligent sensors as described in claim 5, characterized in that, The process of dividing the soil into vertical layers and assigning basic weights, and adjusting the weights based on the horizontal distance from the drip irrigation tape outlet, includes: The nodes in the 20-40cm root active layer were assigned a basic weight of 0.6, the nodes in the 0-20cm tillage layer were assigned a basic weight of 0.3, and the nodes in the 40-60cm deep layer were assigned a basic weight of 0.
1. The weight of nodes within 1 meter of the outlet increases by 0.2, the weight of nodes between 1 and 3 meters remains at the base value, and the weight of nodes more than 3 meters away decreases by 0.
1.
7. The method for monitoring water, fertilizer, and salt migration in drip-irrigated cotton fields based on intelligent sensors as described in claim 1, characterized in that, The process of inputting migration features into a random forest model and outputting monitoring results includes: Migration feature data from the past three cotton growth cycles were extracted, and the data subsets were divided according to different drip irrigation and fertilization amounts. The migration trend for the next two hours was used as the output label. 100 decision trees with a maximum depth of 10 layers were set up, and the decision trees were trained using the divided data subsets to obtain a random forest model. The real-time drip irrigation and fertilization amounts are input into the random forest model, and the monitoring results are output to obtain the suitable threshold range for cotton growth. Based on the monitoring results, areas that exceed the suitable threshold range are marked with a red warning.
8. A water, fertilizer, and salt migration monitoring system for drip-irrigated cotton fields based on intelligent sensors, characterized in that: The system includes: The data acquisition model is used to collect data on soil moisture content, electrical conductivity, temperature and drip irrigation flow rate in real time through sensors, where the temperature data is the soil temperature at each soil layer node; The preprocessing model is used to clean the collected raw data, remove outliers, and fill in missing values, and extract temporal and spatial features through spatiotemporal standardization; The feature fusion model is used to fuse features of preprocessed data using the Transformer model to generate transfer features, where each element in the transfer feature corresponds to the fused feature value of the time point and spatial location. The migration prediction model is used to input migration characteristics into a random forest model and output monitoring results, including spatial distribution predictions of soil moisture content and electrical conductivity, as well as red warning markers.
9. A water, fertilizer, and salt migration monitoring device for drip-irrigated cotton fields based on intelligent sensors, characterized in that, The smart sensor-based drip irrigation cotton field water, fertilizer, and salt migration monitoring device includes a memory and at least one processor. The memory stores instructions. The at least one processor calls the instructions in the memory to cause the smart sensor-based drip irrigation cotton field water, fertilizer, and salt migration monitoring device to perform each step of the smart sensor-based drip irrigation cotton field water, fertilizer, and salt migration monitoring method as described in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement each step of the water, fertilizer and salt migration monitoring method for drip-irrigated cotton fields based on smart sensors as described in any one of claims 1-7.