Drip irrigation cotton field soil moisture content monitoring method and system based on Internet of Things control
By deploying sensors in cotton fields and utilizing the CNN-LSTM-Attention model and particle swarm optimization algorithm, the optimal irrigation strategy is generated, which solves the shortcomings of existing drip irrigation cotton field soil moisture monitoring and realizes efficient dynamic soil moisture monitoring and water resource management.
Patent Information
- Application Number
- CN202511670957.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-24
AI Technical Summary
Current soil moisture monitoring in drip-irrigated cotton fields relies on manual sampling or fixed-point sensors. The sampling point coverage is low, making it difficult to reflect the spatial heterogeneity of soil moisture in cotton fields. Data transmission is also delayed, making it impossible to capture soil moisture dynamics in real time.
Soil moisture sensors, meteorological sensors, and cotton canopy temperature sensors deployed in cotton fields are used to collect data in real time. The data is processed and predicted using a CNN-LSTM-Attention model, and the optimal irrigation strategy is generated by combining a particle swarm optimization algorithm. The model parameters are monitored and corrected in real time.
It has enabled precise water resource utilization, improved monitoring accuracy, dynamically adapted to cotton growth needs, ensured stable yield, reduced planting costs, and enhanced the level of intelligent management.
Smart Images

Figure 2703E2CC-1524-4AB1-B4A8-D8805550CA15 
Figure 2D2A9A95-D7A0-43EF-B3A4-9A97371A6485 
Figure CAFE1773-082C-4982-AC74-7477849CE969
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet of Things (IoT) technology, specifically to a method and system for monitoring soil moisture in drip-irrigated cotton fields based on IoT control. Background Technology
[0002] Cotton, as an important economic crop, has strict requirements for soil moisture (soil water content) during its growth. Insufficient or excessive moisture can lead to reduced yield. Drip irrigation technology has become the mainstream method for cotton field irrigation due to its water-saving and high efficiency. However, there are shortcomings in the existing monitoring and control of soil moisture in drip-irrigated cotton fields. Traditional moisture monitoring relies on manual sampling or fixed-point sensors, which has low sampling point coverage and makes it difficult to reflect the spatial heterogeneity of cotton field moisture. In addition, data transmission is lagging and cannot capture real-time moisture dynamics. Summary of the Invention
[0003] The purpose of this invention is to solve the above-mentioned problems by designing a method and system for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things (IoT) control.
[0004] The first aspect of this invention provides a method for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things (IoT) control, the method comprising the following steps: Data is collected in real time by deploying soil moisture sensors, meteorological sensors, and cotton canopy temperature sensors in the cotton field; The collected data underwent outlier handling and spatiotemporal interpolation, and the dataset was divided according to the cotton growth stages. The dataset is input into the CNN-LSTM-Attention model. The CNN network is used to extract the spatiotemporal features of soil moisture, meteorological parameters and cotton canopy temperature. The LSTM network is used to predict the trend of soil moisture change. An attention mechanism is introduced to strengthen the weight allocation of features. Based on the prediction results output by the CNN-LSTM-Attention model, the particle swarm optimization algorithm is used to generate the optimal irrigation strategy by comprehensively minimizing water consumption, maximizing cotton yield and minimizing energy consumption. Drip irrigation instructions are executed according to the optimal irrigation strategy, and the deviation between the soil moisture data after irrigation and the prediction results is monitored in real time. The parameters of the CNN-LSTM-Attention model are then adjusted based on the deviation.
[0005] Optionally, in a first implementation of the first aspect of the present invention, the step of performing outlier processing and spatiotemporal interpolation processing on the collected data, and dividing the dataset according to the cotton growth stage, includes: The raw data collected by the sensor is acquired, and outlier identification is performed on the raw data using a sliding window. And correct outliers; A grid coordinate system was established based on the cotton field. Data from all sensors that had undergone outlier processing were mapped to their positions in the coordinate system. Kriging interpolation was then used to generate soil moisture distribution data for the entire cotton field. For the data collection interval, cubic spline interpolation was used to process the soil moisture distribution data across the entire region to generate spatiotemporal grid data of soil moisture, meteorological parameters, and canopy temperature at the 10-minute level across the entire region. Collect cotton planting dates, plant height, leaf number and growth period observation records in cotton fields, and combine them with local accumulated temperature data to divide the cotton growth cycle into four stages: seedling stage, bud stage, flowering and boll-forming stage and boll-opening stage. The spatiotemporal grid data is classified according to its growth stage, and a dataset is generated for each stage.
[0006] Optionally, in a second implementation of the first aspect of the present invention, the step of generating the overall soil moisture distribution data of the entire cotton field using Kriging interpolation includes: Calculate the straight-line distance between all sample points in the entire cotton field, divide the field into multiple intervals according to the distance, calculate the semivariogram of the sample point data for each distance interval, and obtain the variogram curve by plotting the distance on the horizontal axis and the semivariogram on the vertical axis. Fitting based on the variogram curve: For each grid cell to be interpolated, search all sample points within its surrounding range, where the range is 15m. The weights of each sample point corresponding to the interpolation point are obtained by Kriging interpolation, and the interpolation results of the grid cells are obtained based on the weights. After processing all grid cells, the total soil moisture distribution data for the entire cotton field is generated.
[0007] Optionally, in the third implementation of the first aspect of the present invention, the CNN network in the CNN-LSTM-Attention model includes two convolutional layers and one max pooling layer, wherein the first convolutional layer includes 32 3×3 convolutional kernels with a stride of 1, and the second convolutional layer includes 64 2×2 convolutional kernels with a stride of 1. The LSTM network in the CNN-LSTM-Attention model consists of two hidden layers, each containing 64 and 32 neurons respectively, with a forgetting gate threshold of 0.6.
[0008] Optionally, in the fourth implementation of the first aspect of the present invention, the step of inputting the dataset into the CNN-LSTM-Attention model, using the CNN network to extract the spatiotemporal features of soil moisture, meteorological parameters, and cotton canopy temperature, using the LSTM network to predict the trend of soil moisture change, and introducing an attention mechanism to strengthen the weight allocation of features includes: The dataset is input into the CNN-LSTM-Attention model. The first convolutional layer extracts local spatial features and outputs a 7×8×8×32 feature map. The output of the first convolutional layer is fed into the second convolutional layer to fuse the correlation between spatial features and feature dimensions, outputting a 7×7×7×64 feature map. The output of the second layer is downsampled through a max pooling layer to output a 7×4×4×64 spatiotemporal feature tensor. The spatiotemporal feature tensor output by the CNN layer is expanded by time step and input into the first hidden layer. The features of each time step are processed through the forget gate, input gate and output gate to learn the temporal pattern of soil moisture change and output the temporal feature sequence. The output of the first hidden layer is fed into the second hidden layer to capture long-term dependencies and output high-order temporal features. For the high-order temporal features output by the LSTM layer, the importance weight of each time step feature is calculated, and the feature is mapped through a fully connected layer. Attention weights are generated by normalization through the softmax function. The weighted temporal features are obtained based on the attention weights. The weighted temporal features are then mapped to a prediction vector through a fully connected layer, and the prediction result is output, which is the predicted value of the soil moisture change trend.
[0009] Optionally, in the fifth implementation of the first aspect of the present invention, the prediction results based on the CNN-LSTM-Attention model are used to generate an optimal irrigation strategy by employing a particle swarm optimization algorithm, with the objectives of minimizing water resource consumption, maximizing cotton yield, and minimizing energy consumption, including: Identify the irrigation parameters that need to be optimized, including at least irrigation time, flow rate, and duration; Initialize the particle swarm and construct a fitness function based on minimizing water resource consumption, maximizing cotton yield, and minimizing energy consumption; For each particle, update the current velocity vector based on its own historical best position and the global historical best position. Calculate the fitness value of all particles at the new position. If the current fitness of a particle is better than its historical best value, update the historical best position of that particle. Compare the historical best values of all particles, update the global historical best position, and when the maximum number of iterations is reached, output the irrigation parameters corresponding to the global historical best position as the optimal irrigation strategy.
[0010] Optionally, in a sixth implementation of the first aspect of the present invention, the step of executing drip irrigation instructions according to the optimal irrigation strategy, monitoring the deviation between the soil moisture data after irrigation and the prediction results in real time, and correcting the parameters of the CNN-LSTM-Attention model based on the deviation includes: The IoT gateway converts the optimal strategy into PLC control signals to control the zone solenoid valves and water pumps. During irrigation, data is collected every 5 minutes to monitor the deviation between the soil moisture data after irrigation and the prediction results in real time. When the deviation is greater than 8%, the parameters of the CNN-LSTM-Attention model are corrected.
[0011] A second aspect of the present invention provides an IoT-based drip irrigation cotton field soil moisture monitoring system, the system comprising: The data acquisition module is used to collect data in real time through soil moisture sensors, weather sensors and cotton canopy temperature sensors deployed in the cotton field; The processing module is used to perform outlier handling and spatiotemporal interpolation on the collected data, and to divide the dataset according to the cotton growth stage; The input module is used to input the dataset into the CNN-LSTM-Attention model. The CNN network is used to extract the spatiotemporal features of soil moisture, meteorological parameters and cotton canopy temperature. The LSTM network is used to predict the trend of soil moisture change. An attention mechanism is introduced to strengthen the weight allocation of features. The generation module is used to generate the optimal irrigation strategy based on the prediction results output by the CNN-LSTM-Attention model. It adopts the particle swarm optimization algorithm and takes minimizing water consumption, maximizing cotton yield and minimizing energy consumption as the objectives. The correction module is used to execute drip irrigation instructions according to the optimal irrigation strategy, monitor the deviation between the soil moisture data after irrigation and the prediction results in real time, and correct the parameters of the CNN-LSTM-Attention model based on the deviation.
[0012] A third aspect of the present invention provides an IoT-based drip irrigation cotton field moisture monitoring device, the IoT-based drip irrigation cotton field moisture monitoring device comprising a memory and at least one processor, the memory storing instructions; the at least one processor calling the instructions in the memory to cause the IoT-based drip irrigation cotton field moisture monitoring device to perform the various steps of the IoT-based drip irrigation cotton field moisture monitoring method 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 IoT-based method for monitoring soil moisture in drip-irrigated cotton fields as described in any of the preceding claims.
[0014] The technical solution provided by this invention involves real-time data collection using soil moisture sensors, meteorological sensors, and cotton canopy temperature sensors deployed in cotton fields. The collected data undergoes outlier processing and spatiotemporal interpolation, and the dataset is divided according to the cotton growth stage. The dataset is then input into a CNN-LSTM-Attention model. A CNN network extracts the spatiotemporal features of soil moisture, meteorological parameters, and cotton canopy temperature, while an LSTM network predicts soil moisture trends. An attention mechanism is introduced to strengthen the weight allocation of features. Based on the prediction results output by the CNN-LSTM-Attention model, a particle swarm optimization algorithm is used to generate an optimal irrigation strategy, aiming to minimize water consumption, maximize cotton yield, and minimize energy consumption. Drip irrigation instructions are executed according to the optimal irrigation strategy, and the deviation between the post-irrigation soil moisture data and the prediction results is monitored in real time. The parameters of the CNN-LSTM-Attention model are adjusted based on the deviation. This invention precisely improves water resource utilization efficiency, achieves water conservation and efficiency enhancement, improves monitoring accuracy, dynamically adapts to cotton growth needs, ensures stable yield increases, optimizes energy consumption throughout the entire process, reduces planting costs, and enhances the level of intelligent management through IoT closed-loop control. 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 illustrating the method for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things control, as provided in an embodiment of the present invention; Figure 2 A schematic diagram of the structure of the IoT-based drip irrigation cotton field soil moisture monitoring system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an IoT-based drip irrigation cotton field soil moisture monitoring device 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 method for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things control provided in this embodiment of the invention includes the following steps: Step 101: Collect data in real time using soil moisture sensors, weather sensors, and cotton canopy temperature sensors deployed in the cotton field; In this embodiment, the soil moisture sensor is an FDR (Frequency Domain Reflectometry) sensor, deployed in three layers at depths of 0-20cm, 20-40cm, and 40-60cm, corresponding to the root distribution characteristics of cotton seedlings, buds, and boll-forming stages. Cotton seedlings primarily absorb water from 0-20cm depth, buds primarily absorb water from 20-40cm depth, and boll-forming primarily absorb water from 40-60cm depth. The deployment density is 100m² / 500m². 2 Group 1, prioritized for deployment in flat areas of cotton fields, avoiding low-lying and waterlogged areas; Meteorological sensors: Integrated weather stations were selected to monitor parameters such as air temperature, humidity, light intensity, wind speed, and precipitation. The stations were deployed in an unobstructed area within 10m of the edge of the cotton field, at a height of 1.5m to avoid shading by the cotton canopy. The data acquisition frequency was once every 30 minutes. Cotton canopy temperature sensor: Utilizing an infrared temperature sensor, installed on a height-adjustable bracket. The height dynamically adjusts with the cotton plant height, always maintaining a distance of 30cm from the top of the canopy. Per 200m... 2 One sample is deployed, with a sampling frequency of once every 15 minutes. Canopy temperature is more sensitive to water stress, so a higher frequency is required. Step 102: Perform outlier processing and spatiotemporal interpolation on the collected data, and divide the dataset according to the cotton growth stage; In this embodiment, raw data collected by sensors are first gathered, including soil moisture, meteorological parameters, and cotton canopy temperature. The collection time, sensor location, and device number are labeled for each data point. Then, basic thresholds are set based on physical principles; for example, soil moisture should be between 0% and 100%, and air temperature should be between -20℃ and 45℃. Data outside these ranges are directly marked as significantly abnormal. For data within the basic thresholds, a sliding window method is used for further screening: taking a single sensor as a unit, data from 10 consecutive collection cycles is used as a window. The average and standard deviation of the data within the window are calculated. If the difference between a data point and the average exceeds three times the standard deviation, it is marked as a suspected anomaly. For data marked as obviously abnormal, first check the operating status of the corresponding sensor. If the sensor is faulty, such as being offline or having unstable voltage, then retrieve the synchronous data from the three adjacent normal sensors in the same area and replace the abnormal value with its average value. If the sensor is not faulty, it is determined to be transient interference, and the linear interpolation result of the data from the previous three periods and the next three periods is used for replacement. For suspected abnormal data, compare it with the historical synchronous data fluctuation pattern of the sensor. If the fluctuation range is within the historical normal range, such as ±5%, then the data is retained; if it exceeds the historical fluctuation range, the median of the adjacent window is used for replacement. A grid coordinate system was established based on the cotton field. Data from all sensors, after outlier processing, were mapped to their positions within the coordinate system. Kriging interpolation was used to generate comprehensive soil moisture distribution data for the entire cotton field. Cubic spline interpolation was employed to process the comprehensive soil moisture distribution data for the data acquisition intervals, generating spatiotemporal grid data for 10-minute intervals of soil moisture, meteorological parameters, and canopy temperature. Records of cotton planting dates, plant height, leaf number, and growth stages were collected. Combined with local accumulated temperature data, the cotton growth cycle was divided into four stages: seedling stage, budding stage, flowering and boll-forming stage, and boll-opening stage. The spatiotemporal grid data were categorized according to growth stages, and datasets were generated for each stage.
[0019] In this embodiment, valid monitoring data from all soil moisture sensors and canopy temperature sensors within the cotton field are collected. The acquisition time, sensor number, and actual coordinates for each data point are recorded. A Cartesian coordinate system is established with a vertex in the cotton field as the origin, using meters as the unit. Simultaneously, based on the actual area and shape of the cotton field, a 1m × 1m grid is divided, and a unique coordinate is assigned to each grid unit. The blank grid range requiring interpolation is clearly defined. Monitoring data are categorized by data type, such as soil moisture in the 0-20cm layer and canopy temperature, with data of the same type processed separately. For single-type data, obvious outliers are removed, such as data confirmed as valid through previous outlier processing, while normal samples are retained. If a certain area has a large amount of missing sensor data, such as no valid data within three consecutive grid ranges, it is marked as a key area for interpolation. For single-class data, calculate the straight-line distance between all sample points, based on coordinate differences, ignoring height differences, and divide the data into multiple intervals such as 0-5m, 5-10m, 10-15m, etc., with each interval containing no fewer than 30 pairs of sample points. For each distance interval, calculate the semivariogram of the sample point data, reflecting spatial correlation, i.e., the degree of difference in sample values at the same distance. Plot a variogram curve with distance as the horizontal axis and semivariogram as the vertical axis. Based on the plotted variogram curve, select a spherical model for fitting, which is suitable for data such as farmland soil moisture where spatial correlation gradually weakens with increasing distance. Determine the key parameters of the model: nugget value, sill value, and range. The semivariogram when the nugget value distance is 0 reflects the measurement error; the maximum value of the sill value semivariogram after stabilization reflects the total degree of variation; the range semivariogram is the distance when it reaches 80% of the sill value. Sample points beyond this distance have no significant spatial correlation. If the fitting effect is poor, such as excessive curve fluctuation, adjust the distance interval division method, recalculate the semivariogram, and fit the model again. For each grid cell to be interpolated, all sample points within its surrounding range are searched. For example, if the range is 15m, sample points within a 15m radius centered on the grid cell are selected. Based on these sample points and the interpolation point, a semi-variance matrix is constructed, where the matrix elements are the semivariances between sample points and between a sample point and the interpolation point. This matrix is calculated based on a fitted spherical model. By solving the Kriging equations, the weight of each sample point corresponding to the interpolation point is obtained; sample points with stronger spatial correlation have higher weights. Based on the weights of the sample points corresponding to the grid cell to be interpolated, the monitoring data of the sample points are multiplied by the weights and summed to obtain the interpolation result for that grid cell, such as the soil moisture value in the 0-20cm layer of a certain grid cell. All grid cells are processed sequentially to complete the global interpolation of a single type of data. For other types of data, such as soil moisture in the 20-40cm layer and canopy temperature, a global soil moisture distribution grid data containing all types of data is finally generated.
[0020] Step 103: Input the dataset into the CNN-LSTM-Attention model, use the CNN network to extract the spatiotemporal features of soil moisture, meteorological parameters and cotton canopy temperature, use the LSTM network to predict the trend of soil moisture change, and introduce an attention mechanism to strengthen the weight allocation of features. In this embodiment, the CNN-LSTM-Attention model includes two convolutional layers and one max pooling layer. The first convolutional layer includes 32 3×3 convolutional kernels with a stride of 1, and the second convolutional layer includes 64 2×2 convolutional kernels with a stride of 1. The LSTM network in the CNN-LSTM-Attention model includes two hidden layers, each containing 64 neurons and 32 neurons respectively, with a forgetting gate threshold of 0.6.
[0021] In this embodiment, the dataset is input into the CNN-LSTM-Attention model. The first convolutional layer extracts local spatial features and outputs a 7×8×8×32 feature map. The output of the first convolutional layer is fed into the second convolutional layer to fuse the correlation between spatial features and feature dimensions, outputting a 7×7×7×64 feature map. The output of the second layer is downsampled by a max pooling layer, outputting a 7×4×4×64 spatiotemporal feature tensor. The spatiotemporal feature tensor output by the CNN layer is unfolded step by step and input into the first hidden layer. Each time step is processed by a forget gate, an input gate, and an output gate. The system learns the temporal patterns of soil moisture changes by analyzing the characteristics of each time step, outputting a temporal feature sequence. The output of the first hidden layer is fed into the second hidden layer to capture long-term dependencies, outputting high-order temporal features. For the high-order temporal features output by the LSTM layer, the importance weight of each feature at each time step is calculated, and feature mapping is performed through a fully connected layer. The feature weights are then normalized using a softmax function to generate attention weights. Based on the attention weights, the weighted temporal features are obtained and mapped to a prediction vector through a fully connected layer. The prediction result is then output, which is the predicted value of the soil moisture change trend.
[0022] Step 104: Based on the prediction results output by the CNN-LSTM-Attention model, the particle swarm optimization algorithm is used to generate the optimal irrigation strategy by comprehensively minimizing water consumption, maximizing cotton yield, and minimizing energy consumption. In this embodiment, irrigation parameters to be optimized are determined. These parameters include at least irrigation time, flow rate, and duration, with each parameter forming a three-dimensional vector as the particle position. Constraints are set: after irrigation, the soil moisture in each layer does not exceed the field capacity, such as 0-20cm layer ≤30%vol, 20-40cm layer ≤35%vol, and 40-60cm layer ≤40%vol; the single irrigation volume does not exceed the maximum flow rate limit of the water pump, such as 5L / h, to avoid water waste caused by deep seepage. Initialize a particle swarm, randomly generating 50 particles to represent 50 candidate irrigation strategies. The position of each particle is randomly selected within constraints. Initialize a velocity vector for each particle, with velocity components ranging from irrigation time ±2 hours, flow rate ±0.5 L / h, and duration ±0.2 hours. Velocity determines the particle's direction and step size in the search space. Assign individual and global best historical positions to each particle. Based on the predicted soil moisture for the next 3 days output by the CNN-LSTM-Attention model, construct a multi-objective fitness function. Water consumption target: Calculate the total irrigation volume during the forecast period; the lower the irrigation volume, the higher the score. Cotton yield target: Based on the predicted relationship between soil moisture and cotton yield, such as setting the highest yield when the soil moisture in the 0-20cm layer is maintained at 25%-30%vol during the flowering and boll-forming stage, the yield score is calculated. Energy consumption target: Calculate pump energy consumption based on irrigation time and flow rate; the lower the energy consumption, the higher the score. The scores of the three targets are weighted and summed. The weights can be adjusted according to actual needs. For example, in water-scarce areas, the weight for water consumption is set to 0.5, the weight for yield to 0.3, and the weight for energy consumption to 0.2, thus obtaining the overall fitness value for each particle. For each particle, update the current velocity vector based on its own historical best position and the global historical best position: move towards its own historical best direction and towards the global historical best direction, while maintaining the original movement inertia. The inertia weight decreases linearly from 0.9 to 0.4. In the early stage, global search is performed, and in the later stage, local fine search is performed. The particle position is adjusted according to the updated velocity vector. If the new position exceeds the constraint range, it is pulled back to the boundary. For example, if the irrigation time exceeds 0-24 hours, it is forcibly set to the boundary value. Calculate the fitness value of all particles at their new positions. If a particle's current fitness is better than its historical best value, update its historical best position. Compare the historical best values of all particles, update the global historical best position, and retain the position of the particle with the highest fitness. Check if the number of iterations has reached 30, or if the fitness improvement of the global best position is less than a threshold (e.g., 0.5%) for 5 consecutive iterations. If the termination condition is met, output the irrigation parameters corresponding to the global historical best position as the optimal strategy. The cotton field is divided into five zones, such as based on soil type and topography. A particle swarm optimization algorithm is run separately for each zone, taking into account predicted soil moisture and sensor data, to generate a zone-specific irrigation strategy. All zone strategies are then aggregated to form an optimal irrigation plan covering the entire cotton field, including parameters such as start time, flow rate, and duration for each zone.
[0023] Step 105: Execute drip irrigation instructions according to the optimal irrigation strategy, monitor the deviation between the soil moisture data after irrigation and the prediction results in real time, and correct the parameters of the CNN-LSTM-Attention model based on the deviation.
[0024] In this embodiment, the IoT gateway converts the optimal strategy into PLC control signals to control the partition solenoid valves and water pumps. Data is collected every 5 minutes during irrigation to monitor the deviation between the soil moisture data after irrigation and the prediction results in real time. When the deviation is greater than 8%, the parameters of the CNN-LSTM-Attention model are corrected.
[0025] Please see Figure 2 A schematic diagram of the structure of the IoT-based drip irrigation cotton field soil moisture monitoring system provided in this embodiment of the invention. The system includes: The data acquisition module is used to collect data in real time through soil moisture sensors, weather sensors and cotton canopy temperature sensors deployed in the cotton field; The processing module is used to perform outlier handling and spatiotemporal interpolation on the collected data, and to divide the dataset according to the cotton growth stage; The input module is used to input the dataset into the CNN-LSTM-Attention model. The CNN network is used to extract the spatiotemporal features of soil moisture, meteorological parameters and cotton canopy temperature. The LSTM network is used to predict the trend of soil moisture change. An attention mechanism is introduced to strengthen the weight allocation of features. The generation module is used to generate the optimal irrigation strategy based on the prediction results output by the CNN-LSTM-Attention model. It adopts the particle swarm optimization algorithm and takes minimizing water consumption, maximizing cotton yield and minimizing energy consumption as the objectives. The correction module is used to execute drip irrigation instructions according to the optimal irrigation strategy, monitor the deviation between the soil moisture data after irrigation and the prediction results in real time, and correct the parameters of the CNN-LSTM-Attention model based on the deviation.
[0026] Figure 3 This is a schematic diagram of the structure of an IoT-based drip irrigation cotton field moisture monitoring device 300 provided in an embodiment of the present invention. The IoT-based drip irrigation cotton field moisture monitoring device 300 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 temporary or persistent 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 IoT-based drip irrigation cotton field moisture monitoring device 300. 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 IoT-based drip irrigation cotton field moisture monitoring device 300 to implement the method provided in the above embodiment.
[0027] The IoT-based drip irrigation cotton field soil moisture 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 IoT-based drip irrigation cotton field soil moisture monitoring device shown does not constitute a limitation on the computer device provided by this invention. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0028] 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, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the various steps of the drip irrigation cotton field soil moisture monitoring method based on Internet of Things control provided in the above embodiments.
[0029] 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.
[0030] 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.
[0031] 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 soil moisture in drip-irrigated cotton fields based on Internet of Things (IoT) control, characterized in that, The method includes the following steps: Data is collected in real time by deploying soil moisture sensors, meteorological sensors, and cotton canopy temperature sensors in the cotton field; The collected data underwent outlier handling and spatiotemporal interpolation, and the dataset was divided according to the cotton growth stages. The dataset is input into the CNN-LSTM-Attention model. The CNN network is used to extract the spatiotemporal features of soil moisture, meteorological parameters and cotton canopy temperature. The LSTM network is used to predict the trend of soil moisture change. An attention mechanism is introduced to strengthen the weight allocation of features. Based on the prediction results output by the CNN-LSTM-Attention model, the particle swarm optimization algorithm is used to generate the optimal irrigation strategy by comprehensively minimizing water consumption, maximizing cotton yield and minimizing energy consumption. Drip irrigation instructions are executed according to the optimal irrigation strategy, and the deviation between the soil moisture data after irrigation and the prediction results is monitored in real time. The parameters of the CNN-LSTM-Attention model are then adjusted based on the deviation.
2. The method for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things control as described in claim 1, characterized in that, The process of handling outliers and performing spatiotemporal interpolation on the collected data, and dividing the dataset according to the cotton growth stages, includes: The system acquires raw data collected by sensors, uses a sliding window to identify outliers in the raw data, and corrects outliers. A grid coordinate system was established based on the cotton field. Data from all sensors that had undergone outlier processing were mapped to their positions in the coordinate system. Kriging interpolation was then used to generate soil moisture distribution data for the entire cotton field. For the data collection interval, cubic spline interpolation was used to process the soil moisture distribution data across the entire region to generate spatiotemporal grid data of soil moisture, meteorological parameters, and canopy temperature at the 10-minute level across the entire region. Collect cotton planting dates, plant height, leaf number and growth period observation records in cotton fields, and combine them with local accumulated temperature data to divide the cotton growth cycle into four stages: seedling stage, bud stage, flowering and boll-forming stage and boll-opening stage. The spatiotemporal grid data is classified according to its growth stage, and a dataset is generated for each stage.
3. The method for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things control as described in claim 2, characterized in that, The method of generating soil moisture distribution data for the entire cotton field using Kriging interpolation includes: Calculate the straight-line distance between all sample points in the entire cotton field, divide the field into multiple intervals according to the distance, calculate the semivariogram of the sample point data for each distance interval, and obtain the variogram curve by plotting the distance on the horizontal axis and the semivariogram on the vertical axis. Fitting based on the variogram curve: For each grid cell to be interpolated, search all sample points within its surrounding range, where the range is 15m. The weights of each sample point corresponding to the interpolation point are obtained by Kriging interpolation, and the interpolation results of the grid cells are obtained based on the weights. After processing all grid cells, the total soil moisture distribution data for the entire cotton field is generated.
4. The method for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things control as described in claim 1, characterized in that, The CNN-LSTM-Attention model consists of two convolutional layers and one max pooling layer. The first convolutional layer has 32 3×3 convolutional kernels with a stride of 1, and the second convolutional layer has 64 2×2 convolutional kernels with a stride of 1. The LSTM network in the CNN-LSTM-Attention model consists of two hidden layers, each containing 64 and 32 neurons respectively, with a forgetting gate threshold of 0.
6.
5. The method for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things control as described in claim 4, characterized in that, The dataset is input into the CNN-LSTM-Attention model. The CNN network extracts the spatiotemporal features of soil moisture, meteorological parameters, and cotton canopy temperature. The LSTM network is used to predict soil moisture change trends. An attention mechanism is introduced to strengthen the weight allocation of features, including: The dataset is input into the CNN-LSTM-Attention model. The first convolutional layer extracts local spatial features and outputs a 7×8×8×32 feature map. The output of the first convolutional layer is fed into the second convolutional layer to fuse the correlation between spatial features and feature dimensions, outputting a 7×7×7×64 feature map. The output of the second layer is downsampled through a max pooling layer to output a 7×4×4×64 spatiotemporal feature tensor. The spatiotemporal feature tensor output by the CNN layer is expanded by time step and input into the first hidden layer. The features of each time step are processed through the forget gate, input gate and output gate to learn the temporal pattern of soil moisture change and output the temporal feature sequence. The output of the first hidden layer is fed into the second hidden layer to capture long-term dependencies and output high-order temporal features. For the high-order temporal features output by the LSTM layer, the importance weight of each time step feature is calculated, and the feature is mapped through a fully connected layer. Attention weights are generated by normalization through the softmax function. The weighted temporal features are obtained based on the attention weights. The weighted temporal features are then mapped to a prediction vector through a fully connected layer, and the prediction result is output, which is the predicted value of the soil moisture change trend.
6. The method for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things control as described in claim 1, characterized in that, The prediction results based on the CNN-LSTM-Attention model are used to generate an optimal irrigation strategy by employing a particle swarm optimization algorithm, aiming to minimize water consumption, maximize cotton yield, and minimize energy consumption. This strategy includes: Identify the irrigation parameters that need to be optimized, including at least irrigation time, flow rate, and duration; Initialize the particle swarm and construct a fitness function based on minimizing water resource consumption, maximizing cotton yield, and minimizing energy consumption; For each particle, update the current velocity vector based on its own historical best position and the global historical best position. Calculate the fitness value of all particles at the new position. If the current fitness of a particle is better than its historical best value, update the historical best position of that particle. Compare the historical best values of all particles, update the global historical best position, and when the maximum number of iterations is reached, output the irrigation parameters corresponding to the global historical best position as the optimal irrigation strategy.
7. The method for monitoring soil moisture in drip-irrigated cotton fields based on Internet of Things control as described in claim 1, characterized in that, The process of executing drip irrigation commands according to the optimal irrigation strategy, monitoring the deviation between soil moisture data and prediction results after irrigation in real time, and correcting the parameters of the CNN-LSTM-Attention model based on the deviation includes: The IoT gateway converts the optimal strategy into PLC control signals to control the zone solenoid valves and water pumps. During irrigation, data is collected every 5 minutes to monitor the deviation between the soil moisture data after irrigation and the prediction results in real time. When the deviation is greater than 8%, the parameters of the CNN-LSTM-Attention model are corrected.
8. A drip irrigation cotton field soil moisture monitoring system based on Internet of Things control, characterized in that, The system includes: The data acquisition module is used to collect data in real time through soil moisture sensors, weather sensors and cotton canopy temperature sensors deployed in the cotton field; The processing module is used to perform outlier handling and spatiotemporal interpolation on the collected data, and to divide the dataset according to the cotton growth stage; The input module is used to input the dataset into the CNN-LSTM-Attention model. The CNN network is used to extract the spatiotemporal features of soil moisture, meteorological parameters and cotton canopy temperature. The LSTM network is used to predict the trend of soil moisture change. An attention mechanism is introduced to strengthen the weight allocation of features. The generation module is used to generate the optimal irrigation strategy based on the prediction results output by the CNN-LSTM-Attention model. It adopts the particle swarm optimization algorithm and takes minimizing water consumption, maximizing cotton yield and minimizing energy consumption as the objectives. The correction module is used to execute drip irrigation instructions according to the optimal irrigation strategy, monitor the deviation between the soil moisture data after irrigation and the prediction results in real time, and correct the parameters of the CNN-LSTM-Attention model based on the deviation.
9. A drip irrigation cotton field soil moisture monitoring device based on Internet of Things control, characterized in that, The IoT-based drip irrigation cotton field moisture monitoring device 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 IoT-based drip irrigation cotton field moisture monitoring device to perform each step of the IoT-based drip irrigation cotton field moisture 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 IoT-based drip irrigation cotton field soil moisture monitoring method as described in any one of claims 1-7.