Agricultural intelligent irrigation method and system
By building crop databases and using machine learning models to predict irrigation demand, the problems of inefficiency and inaccurate irrigation of existing intelligent irrigation systems are solved, automated, precise and intelligent irrigation are achieved, and adaptability and irrigation efficiency of crop growth environment are improved.
Patent Information
- Application Number
- CN202510184554.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-06
AI Technical Summary
The existing intelligent irrigation system relies on users to manually set irrigation time and monitor irrigation volume, which leads to inefficiency, which can easily lead to over-irrigation or insufficient irrigation, affecting crop growth.
By building crop databases and introducing machine learning models, irrigation demand forecasts are carried out according to the specific needs of different crops at different growth stages, and irrigation actuators are automatically called for irrigation, and the irrigation process is monitored and adjusted in real time.
The automation, precision and intelligence of irrigation are achieved, the problems of insufficient or excessive irrigation are avoided, the irrigation efficiency is improved, and the crops are grown under the optimal soil moisture conditions. The machine learning model has the ability to learn and optimize itself, and gradually adapts to the needs of different crops and soil conditions.
Smart Images

Figure CN120106292A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of agricultural irrigation technology, and more specifically, to an agricultural intelligent irrigation method and system. Background Art
[0002] In agricultural production, irrigation is a key link to ensure the healthy growth of crops. However, traditional agricultural irrigation methods mostly rely on manual monitoring and timing irrigation strategies, which are not only inefficient but also difficult to meet the precise needs of crop growth. With the advancement of science and technology, the concept of smart agriculture has gradually gained popularity, and smart irrigation systems have emerged, aiming to achieve automation, precision and intelligence of irrigation through scientific and technological means.
[0003] Smart irrigation refers to a new agricultural irrigation method that uses modern technologies such as sensors, controllers, and actuators to automatically perform irrigation operations based on the actual growth needs of crops and soil moisture conditions. It aims to improve irrigation efficiency, reduce water waste, and ensure that crops grow under optimal soil moisture conditions.
[0004] At present, although there are some smart irrigation systems on the market, most of them are still based on the traditional manual monitoring and timing irrigation strategy. That is, the existing system mainly relies on users to set the irrigation time according to the soil moisture detection value, and manually monitor and adjust the irrigation amount. This method is not only inefficient, but also easily leads to over-irrigation or under-irrigation, affecting crop growth. Summary of the invention
[0005] The purpose of this application is to provide an agricultural intelligent irrigation method and system, which can perform automated irrigation more accurately.
[0006] This application is implemented as follows:
[0007] In the first aspect, the present application provides an agricultural intelligent irrigation method, comprising the following steps: a database construction step: constructing a crop database, wherein the crop database stores data on soil moisture value ranges and irrigation duration requirements for different crops at different growth stages; an irrigation prediction step: sending the crop selection information input by the user and the current soil moisture value detected by the sensor to a machine learning model to obtain irrigation demand prediction information; the crop selection information includes selection information on crop types and growth stages, and the irrigation demand prediction information includes demand prediction information on an optimal soil moisture value range and an optimal irrigation duration; an irrigation execution step: calling an irrigation execution agency for irrigation according to the irrigation demand prediction information, and monitoring and adjusting the irrigation process in real time according to a preset threshold and rule judgment mechanism.
[0008] In some implementations, the database construction step specifically includes: collecting data on different types of crops and their growth stages from agricultural literature, expert consultations, and local agricultural research institutes to obtain multi-source data; extracting data on soil moisture value ranges and irrigation duration requirements for different crops at different growth stages from the multi-source data, wherein for data on multiple soil moisture value ranges and irrigation duration requirements for the same crop at the same growth stage, a statistical method is used to calculate the mean as a representative value.
[0009] In some implementations, the preset threshold and rule judgment mechanism includes: during irrigation, if the optimal irrigation time in the irrigation demand prediction information is not reached, but the current soil moisture value detected by the sensor in real time has reached the upper limit of the optimal soil moisture value range in the irrigation demand prediction information, then the irrigation is stopped; if the optimal irrigation time in the irrigation demand prediction information has been reached, but the current soil moisture value detected by the sensor in real time has not reached the lower limit of the optimal soil moisture value range in the irrigation demand prediction information, then the irrigation prediction step is re-executed to perform a prediction, and the irrigation execution step is executed according to the prediction result; the irrigation prediction step is repeated to perform a prediction every preset time period, and the irrigation execution step is executed according to the prediction result.
[0010] In some implementations, when the irrigation prediction step is repeatedly executed to make a prediction and the irrigation execution step is executed according to the prediction result, if the user does not update the crop selection information, the crop selection information of the previous round is used.
[0011] In some implementations, the machine learning model is trained through the following steps: a data preparation step: obtaining a data source for the machine learning model, the data source including a crop database, crop selection information input by a user, and a current soil moisture value detected by a sensor; a data preprocessing step: filling missing values in the data source with a mean value, deleting outliers, and encoding text-type categorical data into numerical form; a feature integration and normalization step: integrating and normalizing the encoded crop type and growth stage feature vectors with the current soil moisture value, and the data on the soil moisture value range and irrigation duration requirements of different crops in the crop database at different growth stages to obtain a complete input feature vector; Data set division step: divide the input feature vector into training set, validation set and test set according to the preset ratio; model construction step: use the multilayer perceptron as the model, determine the number of neurons and activation function of the input layer, hidden layer and output layer, and then build the corresponding machine learning model; model compilation and training step: select mean square error as the loss function, Adam optimizer as the parameter update method, and set the evaluation index; set the training parameters, use the training set to train the machine learning model, and use the validation set to evaluate the performance of the machine learning model to adjust the structure and hyperparameters of the machine learning model; model evaluation and optimization step: use the test set to evaluate the generalization ability of the machine learning model, adjust the model structure and optimize the hyperparameters according to the evaluation results.
[0012] In some implementations, the machine learning model includes two hidden layers, each hidden layer has 64 neurons, and uses a ReLU activation function.
[0013] In some implementations, one-hot encoding is used when encoding text-type categorical data into numerical form.
[0014] In the second aspect, the present application provides an agricultural intelligent irrigation system, which includes: a soil moisture sensor for detecting soil moisture in real time; a water spraying mechanism, including a water flow control valve arranged at a water inlet of a water pipe, and a drip irrigation port and a sprinkler irrigation port at a water outlet of the water pipe; an irrigation control execution mechanism, which is used to predict irrigation demand prediction information based on a crop database and crop selection information input by a user, and a current soil moisture value detected by a soil moisture sensor, and call and control the water spraying mechanism to execute irrigation actions based on the irrigation demand prediction information, and monitor and adjust the irrigation process in real time according to preset thresholds and rule judgment mechanisms.
[0015] In some implementations, the agricultural intelligent irrigation system also includes a remote monitoring unit for allowing a user to remotely input crop selection information and monitor and control the irrigation process.
[0016] In some implementations, the drip irrigation ports and the sprinkler irrigation ports at the water outlet of the water pipe are distributed up and down, with the upper layer being the drip irrigation ports and the lower layer being the sprinkler irrigation ports.
[0017] Compared with the prior art, the present invention has at least the following advantages or beneficial effects:
[0018] This application proposes an agricultural intelligent irrigation method, which can accurately irrigate according to the specific needs of different crops at different growth stages by constructing a crop database and introducing a machine learning model for prediction, avoiding the problem of insufficient or excessive irrigation, and is conducive to the healthy growth of crops. Its automated and intelligent irrigation decision-making and execution process significantly reduces human intervention and improves the efficiency of irrigation operations. At the same time, the real-time monitoring and adjustment mechanism ensures the smooth progress of the irrigation process and further improves the overall efficiency. In addition, the machine learning model has the ability of self-learning and optimization, and can continuously improve the prediction accuracy as data accumulates. This means that it will be able to gradually adapt to the irrigation needs of different crops, different growth stages, and different soil conditions, enhancing the adaptability and flexibility of watering crops. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 This is a flow chart of an embodiment of an agricultural intelligent irrigation method of the present application;
[0021] Figure 2 This is a structural diagram of an agricultural intelligent irrigation system according to an embodiment of the present application;
[0022] Figure 3 This is a schematic diagram of the interface displayed by the APP in one embodiment of the present application;
[0023] Figure 4 This is a schematic diagram of an interface displayed by an APP in another embodiment of the present application;
[0024] Figure 5 This is a schematic diagram of the interface displayed by the APP in another embodiment of the present application;
[0025] Figure 6 This is a schematic diagram of the interface displayed by the APP in another embodiment of the present application.
[0026] Icons: 1. Solar power supply unit; 2. Data acquisition and processing unit; 3. Lithium battery control board; 4. Remote monitoring unit; 5. Irrigation control actuator; 6. Soil moisture sensor; 7. Water spraying mechanism; 8. Drip irrigation port; 9. Sprinkler irrigation port; 10. Water flow control valve; 11. DC circuit breaker; 12. AC circuit breaker. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0028] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0029] Example 1
[0030] Although existing smart irrigation systems have introduced some automation elements, most of them still rely on users to manually set irrigation time and monitor irrigation amount. This method is not only cumbersome and inefficient, but also lacks accurate data support and intelligent decision-making, which can easily lead to insufficient or excessive irrigation, thus affecting the normal growth of crops. In particular, the demand for soil moisture varies significantly at different growth stages of different crops, and existing systems often cannot accurately capture these differences, resulting in unsatisfactory irrigation results.
[0031] In this regard, an embodiment of the present application provides an agricultural intelligent irrigation method, which realizes automation, precision and intelligence of irrigation by building a crop database, using a machine learning model to predict irrigation demand, and automatically executing and adjusting the irrigation process, thereby effectively solving the problems existing in the existing intelligent irrigation system.
[0032] See also Figure 1 The agricultural intelligent irrigation method comprises the following steps:
[0033] Database construction step: constructing a crop database, wherein the crop database stores data on soil moisture ranges and irrigation duration requirements of different crops at different growth stages;
[0034] Irrigation prediction step: the crop selection information input by the user and the current soil moisture value detected by the sensor are sent to the machine learning model to obtain irrigation demand prediction information; the crop selection information includes selection information on crop types and growth stages, and the irrigation demand prediction information includes demand prediction information on the optimal soil moisture value range and the optimal irrigation duration;
[0035] Irrigation execution step: calling the irrigation execution mechanism to perform irrigation according to the irrigation demand prediction information, and monitoring and adjusting the irrigation process in real time according to the preset threshold value and rule judgment mechanism.
[0036] It should be noted that in the above embodiment, the database construction step is the basis of the intelligent irrigation method. In this step, professional agricultural data or practical experience is integrated into a special crop database. The database records in detail the specific requirements of different crops (such as wheat, corn, vegetables, etc.) for soil moisture at different growth stages (such as germination, growth, maturity, etc.), including the appropriate soil moisture value range and the corresponding irrigation duration. These data are obtained through long-term scientific research, field trials or the accumulation of experience of agricultural experts, which can provide a scientific basis for subsequent irrigation forecasts and ensure that irrigation decisions meet the actual needs of crop growth.
[0037] Next, in the irrigation prediction step, the user's selection information including crop type and growth stage input through the interface is first obtained, and the current soil moisture value is detected in real time using sensors placed in the farmland. These data and information are sent to the pre-trained machine learning model. The machine learning model uses a complex algorithm to calculate the optimal soil moisture range and the optimal irrigation duration demand forecast information based on the data in the crop database and the current soil moisture value. This step not only improves the intelligence level of irrigation decision-making, but also significantly reduces manual intervention and improves efficiency. More importantly, through the continuous learning and optimization of the machine learning model, the accuracy of irrigation prediction will continue to improve.
[0038] Finally, based on the irrigation demand forecast information, the irrigation actuator (such as sprinkler irrigation, drip irrigation, etc.) is automatically called for irrigation, and the irrigation process is monitored and adjusted in real time through the preset threshold and rule judgment mechanism. These thresholds and rules can include upper and lower limits of soil moisture, restrictions on irrigation duration, etc. Once the data in the irrigation process exceeds the preset range, the irrigation strategy will be automatically adjusted to ensure the accuracy and efficiency of irrigation. This step ensures the accurate execution of irrigation operations, and can be flexibly adjusted according to actual conditions, avoiding the problem of insufficient or excessive irrigation.
[0039] In short, the database construction step provides the necessary data support for the irrigation prediction step and is the basis of the intelligent irrigation method. The irrigation prediction step makes intelligent predictions of irrigation needs based on the crop information input by the user and the soil moisture value detected by the sensor, combined with the data in the database. The irrigation execution step automatically calls the irrigation actuator for irrigation based on the irrigation demand prediction information, and ensures the accuracy and efficiency of the irrigation process through real-time monitoring and adjustment mechanisms. These three steps are interdependent and mutually reinforcing, and together constitute the complete process of the agricultural intelligent irrigation method. Through this process, the intelligent irrigation system can accurately irrigate according to the actual needs of crops, improving the accuracy, efficiency and sustainability of irrigation.
[0040] That is, the above-mentioned embodiment, by constructing a crop database and introducing machine learning prediction technology, can accurately irrigate according to the specific needs of different crops at different growth stages, avoiding the problem of insufficient or excessive irrigation, and is conducive to the healthy growth of crops. Its automated and intelligent irrigation decision-making and execution process significantly reduces manual intervention and improves the efficiency of irrigation operations. At the same time, the real-time monitoring and adjustment mechanism ensures the smooth progress of the irrigation process and further improves the overall efficiency. In addition, the machine learning model has the ability of self-learning and optimization, and can continuously improve the prediction accuracy as data accumulates. This means that it will be able to gradually adapt to the irrigation needs of different crops, different growth stages and different soil conditions, and enhance the adaptability and flexibility of watering crops.
[0041] Based on the aforementioned scheme, in some implementation methods of the present application, the database construction step specifically includes: collecting data on different types of crops and their growth stages from agricultural literature, expert consultations and local agricultural research institutes to obtain multi-source data; extracting data on soil moisture value ranges and irrigation duration requirements for different crops at different growth stages from the multi-source data, wherein for data on multiple soil moisture value ranges and irrigation duration requirements for the same crop at the same growth stage, a statistical method is used to calculate the mean as a representative value.
[0042] In the above implementation, by integrating multi-source data from agricultural literature, expert consultation and local agricultural research institutes, it is ensured that the data stored in the crop database is both comprehensive and accurate. This helps to improve the accuracy of irrigation forecasts and make irrigation decisions more in line with the actual needs of crops. For multiple data points that appear in the same crop at the same growth stage, the statistical method is used to calculate the mean as the representative value, which effectively eliminates the redundancy and uncertainty in the data. This processing process improves the consistency and reliability of the data and provides a solid foundation for subsequent irrigation forecasting and execution. In this way, based on a comprehensive, accurate and consistent crop database, the irrigation needs of crops will be more accurately predicted in the irrigation forecasting step. This helps to reduce the problem of insufficient or excessive irrigation and improve the scientificity and rationality of irrigation decisions.
[0043] For example, when constructing a crop database, you can first collect and integrate data on different types of crops and their growth stages from agricultural literature, expert consultations, and local agricultural research institutes. Then, extract and integrate data from these multiple sources to extract data on soil moisture value ranges and irrigation duration requirements for different crops at different growth stages. Next, determine the database table structure, which can exemplarily include: fields for crop type, growth stage, soil moisture value range, and irrigation duration requirements collected from agricultural literature; fields for crop type, growth stage, soil moisture value range, and irrigation duration requirements collected from expert consultations; and fields for crop type, growth stage, soil moisture value range, and irrigation duration requirements collected from local agricultural research institutes.
[0044] For example, the table structure is shown in the following table:
[0045] Crop Type Growth stage Soil moisture value range Irrigation duration requirements Rice Germination period 70%-80% 1-2h Rice Seedling stage 80%-90% 1-1.5h ... ... ... ...
[0046] Among them, for multiple soil moisture value ranges and irrigation duration requirements that appear in the same growth stage of the same crop, statistical methods are used for processing. For example, the mean of multiple soil moisture value ranges can be calculated as the representative value of the optimal soil moisture value range for the crop in this growth stage. The same method is used to process multiple irrigation duration requirements to determine the representative value of the optimal irrigation duration requirement. In this way, the database table structure is organized and updated into fields for humidity ranges and irrigation requirements corresponding to different crop types and different growth stages.
[0047] Based on the aforementioned scheme, in some implementations of the present application, the preset threshold and rule judgment mechanism includes: during irrigation, if the optimal irrigation time in the irrigation demand prediction information is not reached, but the current soil moisture value detected by the sensor in real time has reached the upper limit of the optimal soil moisture value range in the irrigation demand prediction information, then the irrigation is stopped; if the optimal irrigation time in the irrigation demand prediction information has been reached, but the current soil moisture value detected by the sensor in real time has not reached the lower limit of the optimal soil moisture value range in the irrigation demand prediction information, then the irrigation prediction step is re-executed to perform a prediction, and the irrigation execution step is executed according to the prediction result; the irrigation prediction step is repeated to perform a prediction at every preset time period, and the irrigation execution step is executed according to the prediction result.
[0048] The irrigation process is monitored and adjusted in real time according to the preset threshold and rule judgment mechanism, aiming to optimize the irrigation process and ensure that the crops get just the right amount of water. This mechanism takes into account two key factors, irrigation duration and soil moisture, to achieve precise irrigation. During the irrigation process, the optimal irrigation duration and the optimal soil moisture value range are first determined based on the irrigation demand forecast information (information predicted by the machine learning model). If the irrigation has not yet reached the predicted optimal duration, but the soil moisture detected by the sensor in real time has reached the preset upper limit of the optimal range, the irrigation needs to be stopped immediately to avoid excessive soil moisture caused by over-irrigation, which affects crop growth. If the predicted optimal irrigation duration has been reached, but the soil moisture is still below the lower limit of the optimal range, the irrigation prediction step needs to be re-executed, which may involve a new assessment of weather changes and crop water requirements, and then adjust and execute irrigation based on the new forecast results. In addition, the preset threshold and rule judgment mechanism also includes the step of automatically repeating the irrigation prediction at certain preset time periods (such as daily, every few hours, etc.). This mechanism ensures that irrigation strategies can be dynamically adjusted according to real-time changes in environmental conditions (such as rainfall, temperature, light, etc.), always maintaining the accuracy and effectiveness of irrigation.
[0049] In short, by monitoring soil moisture in real time and automatically adjusting irrigation strategies according to preset rules, water waste can be significantly reduced while ensuring that crops get the right amount of water, thereby improving irrigation efficiency. In addition, the mechanism of regularly re-executing the irrigation prediction step enables the system to flexibly respond to changes in weather and other environmental conditions, enhancing the adaptability and flexibility of irrigation strategies.
[0050] For example, the optimum soil moisture value range obtained according to the irrigation prediction step is 80%-90% and the optimum irrigation time is 2 hours and 30 minutes. The optimum soil moisture value range of 80%-90% is set as the optimum soil moisture upper and lower limit thresholds for the current crop growth stage. When the detected soil moisture value exceeds the set upper threshold value and satisfies the rule that "the irrigation system is being executed", the system immediately stops irrigation and sends a signal to the control system, thereby controlling the water pump to stop irrigation, thereby avoiding crop damage and wasting water resources. When the detected soil moisture value is lower than the set lower threshold value and satisfies the rule that "the irrigation system has just completed the previous round of irrigation", the system re-predicts the humidity value after real-time detection by the sensor, and executes a new round of irrigation based on the re-prediction result to achieve the desired soil moisture value. When the sensor detects that the soil moisture value is lower than the lower threshold value of 80% and meets the rule of "the interval between the current time and the last irrigation is more than 6 hours", if the user has not re-entered other crop types and growth stages, the machine learning model will keep this input value and only re-predict the soil moisture value detected by the sensor in real time, and then execute a new round of irrigation again. This realizes intelligent and automated preliminary precise irrigation control without occupying too many system resources.
[0051] Based on the foregoing scheme, in some implementations of the present application, when the irrigation prediction step is repeatedly executed to make a prediction, and the irrigation execution step is executed according to the prediction result, if the user has not updated the crop selection information, the crop selection information of the previous round is used. This means that if the type of crop planted by the user has not changed, accurate irrigation services can be continuously provided without the user frequently inputting information. For example, if the crop selection information input by the user is rice and seedling stage, if the current humidity value detected by the sensor is 20%, the irrigation demand prediction information indicates that the soil moisture needs to be maintained at 80%-90%, and the irrigation time requires 2 hours and 30 minutes, the system will execute the irrigation decision based on the result calculated by the machine learning model. As long as the user has not re-entered other crop types and growth stages, the machine learning model will always retain this input value and only re-predict based on the real-time humidity value that changes after real-time detection by the soil moisture sensor 6.
[0052] Based on the aforementioned scheme, in some implementations of the present application, the machine learning model is trained through the following steps: data preparation step: obtaining the data source of the machine learning model, which data source includes a crop database, crop selection information input by the user, and the current soil moisture value detected by the sensor; data preprocessing step: filling the missing values in the data source with the mean, deleting the outliers, and encoding the text type classification data into a numerical form; feature integration and normalization processing step: integrating and normalizing the encoded crop type and growth stage feature vectors with the current soil moisture value, and the data on the soil moisture value range and irrigation time requirements of different crops in the crop database at different growth stages to obtain a complete input feature vector; data set division step: divide the input feature vector into training set, validation set and test set according to the preset ratio; model construction step: take the multi-layer perceptron as the model, determine the number of neurons and activation function of the input layer, hidden layer and output layer, so as to construct the corresponding machine learning model; model compilation and training step: select mean square error as the loss function, Adam optimizer as the parameter update method, and set the evaluation index; set the training parameters, use the training set to train the machine learning model, use the validation set to evaluate the performance of the machine learning model, so as to adjust the structure and hyperparameters of the machine learning model; model evaluation and optimization step: use the test set to evaluate the generalization ability of the machine learning model, adjust the model structure and optimize the hyperparameters according to the evaluation results.
[0053] Here is a detailed explanation of the steps involved in training a machine learning model in the above implementation:
[0054] (1) Data preparation steps: Data source acquisition: Collect crop databases (including soil moisture and irrigation duration requirements of different crops at different growth stages), crop selection information input by users (such as crop type and current growth stage), and current soil moisture values detected by sensors in real time. These data sources together form the input basis of the machine learning model.
[0055] (2) Data preprocessing steps: Missing value filling: For missing values in the data source, the mean filling method is used to ensure data integrity. Outlier removal: Delete outliers in the data to avoid their adverse effects on model training. Text data encoding: Encode text-type categorical data (such as crop types and growth stages) into numerical form so that machine learning models can process them.
[0056] (3) Feature integration and normalization steps: The encoded crop type and growth stage feature vectors are integrated with the current soil moisture value and related data in the crop database to form a complete input feature vector. These feature vectors are normalized to ensure that different features are at the same numerical level, thereby improving the training efficiency and performance of the model.
[0057] (4) Dataset division step: The input feature vector is divided into training set, validation set and test set according to the preset ratio. The training set is used for model training, the validation set is used for model performance evaluation and structural adjustment, and the test set is used for the final evaluation of the generalization ability of the model.
[0058] (5) Model construction steps: Using multi-layer perceptron (MLP) as the model architecture, determine the number of neurons and activation functions in the input layer, hidden layer, and output layer. The input layer receives the feature vector, the hidden layer performs feature extraction and nonlinear transformation, and the output layer outputs the irrigation strategy. For example, assuming that the feature length of the crop type after one-hot encoding is 300 and the feature length of the growth stage is 5, the number of neurons in the input layer is 300+5+3 (3 represents the current soil moisture value detected by the sensor, as well as the normalized soil moisture value and irrigation time).
[0059] (6) Model compilation and training steps: The mean square error (MSE) is selected as the loss function to measure the difference between the model prediction value and the actual value. The Adam optimizer is used as the parameter update method, which combines the advantages of the momentum method and the RMSprop optimization algorithm and has an adaptive learning rate adjustment function. Set evaluation indicators (such as accuracy, recall, etc.), use the training set to train the model, and use the validation set to evaluate the model performance to adjust the model structure and hyperparameters. For example, during training, the number of rounds can be set to 40 and the batch size can be set to 23. During training, the training set data is input into the machine learning model. The machine learning model continuously adjusts the parameters to minimize the loss function through multiple iterative training based on the set parameters, thereby learning the patterns and rules in the data. During the training process, the validation set data is used to evaluate the model performance, monitor the loss function value and the evaluation indicator value, and adjust the training parameters and hyperparameters according to the performance, such as the number of training rounds, batch size, learning rate, etc., to prevent the model from overfitting or underfitting and improve the generalization ability and prediction performance of the model. In addition, you can select mean square error (MSE), mean absolute error (MAE), and coefficient of determination (R 2 ) as evaluation metrics to monitor the performance of the model during training. Afterwards, the compile method is used to combine these components together to form a trainable model.
[0060] (7) Model evaluation and optimization step: Use the test set to evaluate the generalization ability of the model, that is, the performance of the model on unseen data. According to the evaluation results, adjust the model structure (such as adding or reducing hidden layers, changing the number of neurons, etc.) and optimize hyperparameters (such as learning rate, batch size, etc.) to improve the performance and accuracy of the model.
[0061] Based on the aforementioned scheme, in some implementations of the present application, the machine learning model includes two hidden layers, each hidden layer has 64 neurons, and adopts a ReLU activation function.
[0062] In the above implementation, by adopting the configuration of two hidden layers and 64 neurons, the machine learning model can learn more complex feature representations, thereby improving the accuracy and generalization ability of irrigation decisions. This deep network structure helps to capture the nonlinear relationship between input features, so that the machine learning model can make more reasonable irrigation decisions when facing a complex and changeable agricultural environment. At the same time, the use of the ReLU activation function enables the machine learning model to have a faster convergence speed during the training process. Compared with traditional activation functions, ReLU can avoid the problem of gradient disappearance or explosion, thereby speeding up the training process of the machine learning model and reducing the consumption of computing resources. In addition, the ReLU activation function is sparse, that is, the output of many neurons is zero. This sparsity helps the machine learning model to enhance the robustness of the input features, so that the machine learning model can work more stably when facing noise or abnormal data. That is, by adopting the configuration of two hidden layers and the ReLU activation function, the performance and efficiency of the machine learning model in agricultural irrigation decision-making are significantly improved.
[0063] Based on the aforementioned scheme, in some implementations of the present application, one-hot encoding is used when encoding text-type categorical data into numerical form.
[0064] In the above implementation, by using one-hot encoding as a method for converting text type classification data into numerical form, not only the potential order relationship is eliminated, but also the interpretability of the machine learning model is improved. Among them, the following operations can be used when performing one-hot encoding: (1) Determine the number of categories of the classification variable: First, it is necessary to determine all possible categories of the text type classification data, such as crop types may include wheat, corn, rice, etc. (2) Create a binary vector: Then, create a binary vector containing only 0 and 1 for each category. The length of the vector is equal to the number of categories, and only one position in each vector is 1, and the rest are 0. This 1 position represents the category corresponding to the vector. (3) Map text to binary vector: Finally, map the text type classification data to the corresponding binary vector. For example, if "wheat" is the first category, it is mapped to [1,0,0,...] (assuming there are three categories in total).
[0065] For example, suppose there are 300 crops in the crop database. When the user enters a crop type, a binary vector with a length of 300 will be generated after one-hot encoding, in which only the position element corresponding to the crop type is 1, and the other position elements are 0. Similarly, for the growth stage entered by the user, each crop in the crop database has 5 growth stages. After one-hot encoding, a binary vector with a length of 5 will be obtained, in which only the position element corresponding to the growth stage is 1, and the other position elements are 0.
[0066] Example 2
[0067] The embodiment of the present application provides an agricultural intelligent irrigation system, which includes: a soil moisture sensor 6, which is used to detect soil moisture in real time; a water spraying mechanism 7, including a water flow control valve 10 arranged at a water inlet of a water pipe, and a drip irrigation port 8 and a sprinkler irrigation port 9 at a water outlet of the water pipe; an irrigation control actuator 5, which is used to predict irrigation demand prediction information based on a crop database and crop selection information input by a user, and a current soil moisture value detected by the soil moisture sensor 6, and call and control the water spraying mechanism 7 to perform irrigation actions according to the irrigation demand prediction information, and monitor and adjust the irrigation process in real time according to a preset threshold value and rule judgment mechanism.
[0068] Among them, the soil moisture sensor 6 is the "eye" of the system, responsible for real-time and accurate monitoring of the moisture level in the soil. By being buried at different depths in the farmland, the sensor can capture subtle changes in soil moisture and provide key data support for subsequent irrigation decisions. The water spraying mechanism 7 consists of a water flow control valve 10, a drip irrigation port 8 and a sprinkler irrigation port 9, and is installed on the water pipe of the irrigation system. The water flow control valve 10 can adjust the water flow size according to the received instructions to ensure accurate control of the irrigation amount. The drip irrigation port 8 is suitable for precise irrigation with a long-term flow of water, suitable for crops with shallow roots; while the sprinkler irrigation port 9 is suitable for uniform irrigation over a large range, suitable for crops with large water requirements or rapid water replenishment scenarios. This design not only meets the irrigation needs of different crops, but also effectively saves water resources. The irrigation control actuator 5 is the "brain" of the system, integrating the crop database and user interface. By inputting crop type information and combining the real-time data of the soil moisture sensor 6, the system can predict the irrigation needs of crops (such as irrigation amount, irrigation frequency, etc.) based on the preset algorithm model. Subsequently, the irrigation control actuator 5 will automatically adjust the working state of the water spraying mechanism 7 according to the prediction information to perform the irrigation task. In addition, the mechanism also has real-time monitoring and adjustment functions, and ensures that the irrigation process is both efficient and safe through the preset threshold and rule judgment mechanism.
[0069] For the specific implementation process of the above system, please refer to the agricultural intelligent irrigation method provided in Example 1, which will not be repeated here.
[0070] Based on the above scheme, in some implementations of the present application, the agricultural intelligent irrigation system also includes a remote monitoring unit 4 for allowing users to remotely input crop selection information and monitor and control the irrigation process.
[0071] In the above implementation, by setting up a remote monitoring unit 4, the irrigation process can be monitored in real time. The remote monitoring unit 4 can display soil moisture data, the operating status of the irrigation equipment (such as the opening and closing status of the water flow control valve 10, the working mode of the drip irrigation port 8 and the sprinkler irrigation port 9, etc.), and the execution progress of the irrigation task in real time. Thus, the user can intuitively understand the irrigation situation through the graphical interface, which is convenient for timely discovery of problems and taking countermeasures. At the same time, the user can also directly control the irrigation equipment through the remote monitoring unit 4, such as manually starting or stopping the irrigation task, adjusting the irrigation amount or irrigation mode, etc. This real-time control capability enables the user to quickly adjust the irrigation strategy according to actual weather changes, crop growth conditions or emergencies to ensure that the crops receive the most suitable irrigation conditions.
[0072] That is, by setting up the remote monitoring unit 4, the user can more accurately grasp the irrigation conditions and quickly respond to changes, thereby ensuring the accuracy and timeliness of irrigation control. This helps to reduce crop losses caused by improper irrigation and improve crop yield and quality.
[0073] Based on the above scheme, in some implementations of the present application, the drip irrigation ports 8 and the sprinkler irrigation ports 9 at the water outlet of the water pipe are distributed up and down, with the upper layer being the drip irrigation ports 8 and the lower layer being the sprinkler irrigation ports 9.
[0074] It should be noted that the drip irrigation port 8 slowly drips water into the soil through a small pipe, which is suitable for precise and local irrigation of the soil. This irrigation method can reduce water evaporation, improve water utilization efficiency, and avoid soil compaction and obstruction of root respiration. Setting the drip irrigation port 8 in the upper layer can ensure that the irrigation water can directly act near the root system of the crop, meeting the precise demand of the crop for water. The sprinkler port 9 sprays water over a larger range through a nozzle to form a uniform mist or droplets, which is suitable for rapid and comprehensive irrigation of the soil. Setting the sprinkler port 9 in the lower layer can ensure that when rapid water replenishment or adjustment of soil moisture is required, water can quickly penetrate into the deep soil layer to meet the overall demand of crops for water.
[0075] That is, the up-and-down distribution design of the drip irrigation port 8 and the sprinkler irrigation port 9 enables the system to flexibly select the irrigation method according to the actual needs of the crops and soil conditions. In the early stage of crop growth or when precise irrigation is required, irrigation can be mainly carried out through the drip irrigation port 8; in the vigorous growth period of crops or when rapid water replenishment is required, the sprinkler irrigation port 9 can be started for irrigation. This flexible irrigation method helps to improve irrigation efficiency and effectiveness and ensure that crops receive the most suitable irrigation conditions. In addition, the up-and-down distribution design of the drip irrigation port 8 and the sprinkler irrigation port 9 enables the system to adapt to the irrigation needs of different crops, different growth stages and different soil conditions. This design enhances the flexibility and adaptability of the irrigation system and helps to meet the diverse needs of agricultural production.
[0076] In order to enable those skilled in the art to understand the present application more intuitively, a specific example will be used here to illustrate.
[0077] For example, Figure 2 As shown, in this example, the agricultural intelligent irrigation system is specifically configured to include: a solar power supply unit 1, a data acquisition and processing unit 2, a lithium battery control board 3, a remote monitoring unit 4, an irrigation control actuator 5, a soil moisture sensor 6, a water spraying mechanism 7 (including a drip irrigation port 8, a sprinkler port 9 and a water flow control valve 10), a DC circuit breaker 11 and an AC circuit breaker 12.
[0078] During installation and connection, the soil moisture sensor 6 and the irrigation control actuator 5 can be connected to the water spray mechanism 7 first, and then the soil moisture sensor 6 can be inserted into the soil. Next, connect the water pipe to the data acquisition and processing unit 2. Next, install the solar power supply unit 1 to a suitable position, and then connect the solar power supply unit 1 to the data acquisition and processing unit 2. Next, connect the nozzle water inlet pipe to the outlet pipe of the water flow control valve 10. Next, install the water flow control valve 10 to the faucet, set the irrigation time on the setting panel, and then press the start button. The system starts irrigation. Step six, download the dedicated APP for Bluetooth connection, realize remote monitoring, and view the humidity value and irrigation time in real time. Next, select the detection "temperature button" to display the current temperature. Next, select the "automatic operation" button, and the five display boxes will display the current humidity value and theoretical irrigation time detected by the corresponding humidity sensor (obtained by the irrigation demand prediction information output by the machine learning model). Next, after selecting the "Automatic Operation" button, select the pump head you want to operate, and use the "+" button to set the humidity value you want to achieve and the irrigation time that automatically displays the most suitable humidity value for the crop, and then click the "Confirm" button. If the user sets it incorrectly, you can use the "-" button to adjust or the delete button to adjust. The current operation mode will be displayed in the blank display box at the top.
[0079] Among them, the APP interface is as follows Figure 3As shown, the soil moisture sensor 6 under each sprinkler head can perform complete prediction and feedback control. Users can select the type of crops and growth stage according to their needs, which provides an operating basis for the subsequent machine learning model operation. After the user sets the corresponding crop type, the system will automatically detect the current soil moisture value, display the current soil moisture value of the crop in the corresponding humidity detection box of the APP, and calculate the optimal soil moisture value range and the optimal irrigation time required through the machine learning model.
[0080] After inputting the crop type and selecting the crop growth stage, the system detects the current soil moisture value through the soil moisture sensor 6 and transmits it to the APP, and finally displays the current soil moisture value. Figure 4 shown.
[0081] Click the OK button to complete the selection of crop type and growth stage, and detect the soil moisture values at various locations. The user has completed a simple setting, that is, the direction of the entire irrigation system should be set according to which crop machine learning model should be operated. Figure 5 shown.
[0082] After the user completes the settings, the machine obtains the optimal humidity value of the crop based on the algorithm library obtained by the above algorithm, and establishes a machine learning algorithm model, using the crop database, the crop selection information input by the user and the soil moisture sensor 6 data. After data cleaning, encoding, normalization and other processing, the data set is divided and a multi-layer perceptron model is constructed for training to obtain the predictable optimal soil moisture value range ( Figure 6 The data shown in the column of the optimum humidity value in the APP) and the model of the optimum irrigation duration; the predicted duration is shown in the APP as follows Figure 6 As shown ( Figure 6 The data shown in the irrigation time column in the table above.
[0083] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. An agricultural intelligent irrigation method, characterized in that: The following steps are involved: Database construction step: constructing a crop database, wherein the crop database stores data on soil moisture ranges and irrigation duration requirements of different crops at different growth stages; Irrigation prediction step: the crop selection information input by the user and the current soil moisture value detected by the sensor are sent to the machine learning model to obtain irrigation demand prediction information; the crop selection information includes selection information on crop types and growth stages, and the irrigation demand prediction information includes demand prediction information on the optimal soil moisture value range and the optimal irrigation duration; Irrigation execution step: calling the irrigation execution mechanism to perform irrigation according to the irrigation demand prediction information, and monitoring and adjusting the irrigation process in real time according to the preset threshold value and rule judgment mechanism.
2. The method according to claim 1, characterized in that The database construction steps specifically include: Collect data from agricultural literature, expert consultations and local agricultural research institutes on different types of crops and their growth stages to obtain multi-source data; Data on soil moisture ranges and irrigation duration requirements for different crops at different growth stages were extracted from multi-source data. For data on multiple soil moisture ranges and irrigation duration requirements for the same crop at the same growth stage, the statistical method was used to calculate the mean as the representative value.
3. The method according to claim 1, characterized in that The preset threshold and rule judgment mechanism includes: During irrigation, if the optimum irrigation duration in the irrigation demand forecast information is not reached, but the current soil moisture value detected by the sensor in real time has reached the upper limit of the optimum soil moisture value range in the irrigation demand forecast information, then the irrigation is stopped; If the optimum irrigation duration in the irrigation demand forecast information has been reached, but the current soil moisture value detected by the sensor in real time has not reached the lower limit of the optimum soil moisture value range in the irrigation demand forecast information, the irrigation forecasting step is re-executed to make a forecast, and the irrigation execution step is executed according to the forecast result; The irrigation prediction step is repeatedly executed at every preset time period to make a prediction, and the irrigation execution step is executed according to the prediction result.
4. The method according to claim 3, characterized in that: When the irrigation prediction step is repeatedly executed to make predictions and the irrigation execution step is executed according to the prediction results, if the user does not update the crop selection information, the crop selection information of the previous round is used.
5. The method according to claim 1, characterized in that The machine learning model is trained by the following steps: Data preparation step: Obtain the data source for the machine learning model, which includes the crop database, crop selection information entered by the user, and the current soil moisture value detected by the sensor; Data preprocessing steps: fill missing values in the data source with the mean, delete outliers, and encode text-type categorical data into numerical form; Feature integration and normalization processing steps: Integrate and normalize the encoded crop type and growth stage feature vector with the current soil moisture value and the data of soil moisture value range and irrigation time requirements of different crops at different growth stages in the crop database to obtain a complete input feature vector; Dataset division step: divide the input feature vector into training set, validation set and test set according to the preset ratio; Model construction steps: Using the multi-layer perceptron as the model, determine the number of neurons and activation functions in the input layer, hidden layer, and output layer, and thus construct the corresponding machine learning model; Model compilation and training steps: select mean square error as the loss function, Adam optimizer as the parameter update method, and set the evaluation index; Set training parameters, use the training set to train the machine learning model, use the validation set to evaluate the performance of the machine learning model, and adjust the structure and hyperparameters of the machine learning model; Model evaluation and optimization steps: Use the test set to evaluate the generalization ability of the machine learning model, adjust the model structure and optimize the hyperparameters based on the evaluation results.
6. The method according to claim 5, characterized in that The machine learning model includes two hidden layers, each hidden layer has 64 neurons and uses a ReLU activation function.
7. The method according to claim 5, characterized in that One-hot encoding is used when encoding text-type categorical data into numerical form.
8. An agricultural intelligent irrigation system applied to the method described in any one of claims 1 to 7, characterized in that: include: Soil moisture sensor, used to detect soil moisture in real time; The water spraying mechanism includes a water flow control valve arranged at the water inlet of the water pipe, and a drip irrigation port and a sprinkler irrigation port at the water outlet of the water pipe; The irrigation control execution mechanism is used to predict the irrigation demand prediction information based on the crop database and the crop selection information input by the user, as well as the current soil moisture value detected by the soil moisture sensor, and call the control water spray mechanism to execute the irrigation action according to the irrigation demand prediction information, and monitor and adjust the irrigation process in real time according to the preset threshold value and rule judgment mechanism.
9. The system according to claim 8, characterized in that It also includes a remote monitoring unit for allowing users to remotely input crop selection information and monitor and control the irrigation process.
10. The system according to claim 8, characterized in that The drip irrigation outlets and sprinkler irrigation outlets at the water pipe outlet are distributed up and down, with the upper layer being the drip irrigation outlets and the lower layer being the sprinkler irrigation outlets.