An intelligent greenhouse control method and system based on the Internet of Things
The intelligent greenhouse control method combining the Internet of Things and deep learning has solved the problem of dynamic adjustment of environmental parameters during strawberry growth, realizing precise adjustment and adaptive control of the strawberry growth environment, and improving crop yield and quality.
Patent Information
- Application Number
- CN202510542329.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-04-28
AI Technical Summary
In existing technologies, the methods for controlling environmental parameters during strawberry growth rely on fixed thresholds or static rules, making it difficult to dynamically adjust according to the rapid changes in the strawberry crop growth stages. This results in insufficient adaptive capacity of greenhouse environmental control, affecting crop growth quality and yield.
An IoT-based intelligent greenhouse control method is adopted. This method collects environmental data by constructing a multi-sensor network, combines strawberry plant image recognition and deep learning models to predict the growth stage of strawberries, uses long short-term memory networks and fuzzy control algorithms to predict and adjust environmental parameters, and introduces Q-learning networks for adaptive optimization control.
It enables precise and dynamic adjustment of the strawberry growing environment, improves the adaptability of greenhouse control and crop yield, enhances the response speed and control accuracy of environmental parameters, and reduces the probability of disease occurrence and energy consumption.
Smart Images

Figure CN120406611B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart agriculture and Internet of Things (IoT) control technology, and particularly relates to a smart greenhouse control method and system based on the Internet of Things. Background Technology
[0002] Currently, strawberries are an important economic crop with high market demand and planting value. However, the growth process of strawberries is significantly affected by multiple environmental factors such as temperature, humidity, light intensity, and carbon dioxide concentration. While intelligent greenhouse control systems are widely used in agriculture, traditional greenhouse environmental control methods mostly rely on static control schemes based on fixed threshold settings or simple PID control methods. These methods often exhibit significant limitations when facing complex environmental changes within the greenhouse. For example, existing technologies for environmental parameters such as temperature, humidity, and light typically rely on manually set thresholds or basic automated control, but these methods cannot dynamically adjust according to the strawberry crop's growth cycle and real-time needs. Especially at different stages of crop growth, such as the seedling, flowering, and fruiting stages, strawberries have significantly different requirements for environmental factors, and existing technologies struggle to provide precise dynamic adjustments based on the crop's growth status. Therefore, there is an urgent need for a greenhouse control method capable of intelligent sensing and real-time adjustment. This method should be able to monitor and control the greenhouse in real time based on the strawberry crop's growth stages, dynamically adjust environmental factors within the greenhouse, and effectively improve the adaptability and long-term stability of greenhouse regulation by introducing technologies such as multi-sensor networks, deep learning prediction, and reinforcement learning optimization, thereby increasing the yield and quality of strawberry crop growth. Summary of the Invention
[0003] To address the aforementioned technical shortcomings, the present invention aims to propose an intelligent greenhouse control method based on the Internet of Things (IoT). This method addresses the technical problem that existing greenhouse control methods, which often rely on fixed thresholds or static rules, struggle to achieve dynamic target setting and adaptive adjustment of environmental parameters, especially under conditions where the needs of strawberry crops change rapidly at different growth stages.
[0004] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention provides an intelligent greenhouse control method based on the Internet of Things.
[0005] The IoT-based intelligent greenhouse control method includes:
[0006] Step S10: Construct a multi-sensor network in a greenhouse environment, collect environmental factor data based on the multi-sensor network, and construct a multi-factor environmental state vector;
[0007] Step S20: Obtain strawberry plant time series and strawberry plant images, process strawberry plant images using the YOLOv5 library in Python to obtain strawberry plant features; input strawberry plant time series and strawberry plant features into a pre-built and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and determine the target environmental parameter vector based on the current strawberry growth stage label.
[0008] Step S30: Input the target environment parameter vector in the past period T1 into the pre-trained long short-term memory network to obtain the predicted environment parameter vector in the future period T2.
[0009] Step S40: Obtain the multi-factor environmental state vector at the current moment; calculate the deviation between the target environmental parameter vector and the predicted environmental parameter vector and the actual environmental parameter vector, respectively, to obtain the first environmental error term and the second environmental error term; calculate the preliminary control command based on the first environmental error term and the second environmental error term using a fuzzy control algorithm.
[0010] Step S50: Introduce a Q-learning network to adaptively adjust the initial control command to obtain an optimized control command.
[0011] Preferably, in step S10, the environmental factor data includes air temperature data, air humidity data, carbon dioxide concentration data, light intensity data, and soil moisture content data; the multi-sensor network includes a temperature and humidity sensor DHT22, a digital humidity sensor SHT35, a carbon dioxide concentration sensor MH-Z19B, a light intensity sensor BH1750, and a soil moisture sensor.
[0012] Preferably, in step S20, the current strawberry growth stage label includes seedling stage, flowering stage, fruiting stage, and harvesting stage.
[0013] Preferably, in step S40, the step of calculating the preliminary control command based on the first environmental error term and the second environmental error term using a fuzzy control algorithm specifically includes: constructing a Gaussian membership function to map the first error term and the second error term to obtain the fuzzy set membership degree; and obtaining the preliminary control command based on the fuzzy set membership degree combined with the fuzzy control algorithm.
[0014] Preferably, step S20, the step of constructing a strawberry growth stage prediction model, specifically includes:
[0015] A dual-modal input layer is constructed to receive strawberry plant time series and strawberry plant features, and the received strawberry plant time series and strawberry plant features are used to construct a fused environment vector;
[0016] A time series coding layer is constructed to receive the fusion environment vector, and two layers of gated recurrent units are used to process the fusion environment vector to output the time series latent vector.
[0017] An image feature extraction layer is constructed to receive the fusion environment vector. The fusion environment vector is processed using a ResNet-18 structure to output the convolutional features of the strawberry plant.
[0018] A fully connected alignment layer is constructed to map the convolutional features of the time series latent vector and strawberry plant features to a unified dimension, and output a unified dimension environment vector.
[0019] A dual-channel attention fusion layer is constructed to introduce attention factors. The growth stage probability distribution vector is calculated based on the attention factors and the dimension unified environment vector. The current strawberry growth stage label is output based on the growth stage probability distribution vector.
[0020] Preferably, step S20, the step of training the strawberry growth stage prediction model, specifically includes:
[0021] After constructing the strawberry growth stage prediction model, historical strawberry plant time series, historical strawberry plant characteristics, and historical standard strawberry growth stage labels are obtained. The historical strawberry plant time series and historical strawberry plant characteristics are used as inputs to the strawberry growth stage prediction model, and the historical standard strawberry growth stage labels are used as outputs to the strawberry growth stage prediction model.
[0022] A modal difference constraint loss term is introduced, and the strawberry growth stage prediction model is pre-trained based on the modal difference constraint loss term and the cross-entropy loss function.
[0023] Preferably, step S50, which involves introducing a Q-learning network to adaptively adjust the initial control command to obtain an optimized control command, specifically includes:
[0024] Step S501: First, introduce the Q-learning network and construct the greenhouse environment state space and greenhouse environment action space, using the environment state space and greenhouse environment action space as inputs to the Q-learning network; wherein, the environment state space consists of the current multi-factor environment state vector, the first environment error term and the second environment error term, and the target environment parameter vector; the greenhouse environment action space includes the adjustment step size of the multi-factor environment state vector, including the control adjustment step size of the heater execution device, the heating execution device, the humidity control device and the carbon dioxide release control device;
[0025] Step S502: Set the greenhouse environment reward function Q based on the first environmental error term and the second environmental error term;
[0026] Step S503: Based on the adjustment step size of the multi-factor environmental state vector, perform the learning and update operation of the Q-learning network on the greenhouse environment reward function Q to obtain the optimized control command.
[0027] The present invention also provides an Internet of Things-based intelligent greenhouse control system comprising:
[0028] The environmental data acquisition module is used to build a multi-sensor network in a greenhouse environment, collect environmental factor data based on the multi-sensor network, and construct a multi-factor environmental state vector.
[0029] The growth stage identification module is used to acquire strawberry plant time series and strawberry plant images. The strawberry plant images are processed using the YOLOv5 library in Python to obtain strawberry plant features. The strawberry plant time series and strawberry plant features are input into a pre-built and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and the target environmental parameter vector is determined based on the current strawberry growth stage label.
[0030] The environmental parameter prediction module is used to input the target environmental parameter vector within the past period T1 into a pre-trained long short-term memory network to obtain the predicted environmental parameter vector within the future period T2.
[0031] The fuzzy control calculation module is used to obtain the multi-factor environmental state vector at the current moment, calculate the deviation between the target environmental parameter vector and the predicted environmental parameter vector and the actual environmental parameter vector, respectively, to obtain the first environmental error term and the second environmental error term; and calculate the preliminary control command based on the first environmental error term and the second environmental error term using the fuzzy control algorithm.
[0032] The reinforcement learning optimization module is used to introduce a Q-learning network to adaptively adjust the initial control commands and obtain optimized control commands.
[0033] The present invention also provides a computer program product, including an Internet of Things (IoT)-based intelligent greenhouse control program, which, when executed by a processor, implements the IoT-based intelligent greenhouse control method.
[0034] The beneficial effects of this invention are as follows: By combining monitoring and control with data acquisition technology, this invention achieves intelligent regulation of the strawberry crop growth environment, significantly improving the accuracy and adaptability of greenhouse environmental control. By collecting real-time environmental factor data within the greenhouse, such as temperature, humidity, and CO concentration, and combining this with the identification and prediction of strawberry growth stages, the environmental parameters within the greenhouse are dynamically adjusted to achieve a precise response to the growth needs of the strawberry crop.
[0035] This invention introduces an adaptive adjustment mechanism that combines reinforcement learning and fuzzy control, enabling timely adjustments when the greenhouse environment changes. This avoids the inaccuracies caused by traditional manual threshold setting, further improving control precision and crop yield. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a flowchart illustrating the first embodiment of an IoT-based intelligent greenhouse control method of the present invention.
[0038] Figure 2 This is a schematic diagram of an IoT-based intelligent greenhouse control method according to the present invention. Detailed Implementation
[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] Example 1: As Figure 1 The diagram shown is a flowchart of the first embodiment of the IoT-based intelligent greenhouse control method of the present invention, which presents the first embodiment of the IoT-based intelligent greenhouse control method of the present invention.
[0041] In the first embodiment, the IoT-based smart greenhouse control method includes:
[0042] Step S10: Construct a multi-sensor network in a greenhouse environment, collect environmental factor data based on the multi-sensor network, and construct a multi-factor environmental state vector;
[0043] It should be noted that in step S10, the environmental factor data includes air temperature data, air humidity data, carbon dioxide concentration data, light intensity data, and soil moisture content data; the multi-sensor network includes a temperature and humidity sensor DHT22, a digital humidity sensor SHT35, a carbon dioxide concentration sensor MH-Z19B, a light intensity sensor BH1750, and a soil moisture sensor.
[0044] Understandably, by constructing the aforementioned multi-sensor network, not only is high-frequency, refined, and continuous monitoring of key environmental factors in strawberry greenhouses achieved, but each sensor node can also dynamically sample at set time intervals (e.g., 1 to 10 minutes), forming a "time-series snapshot" of the strawberry growth microenvironment. This environmental state vector can not only serve as a direct input to subsequent prediction and control models, but also be used to establish regression or correlation analysis models between crop physiological states and environmental factors.
[0045] For example, in a practical experiment, three sets of multi-factor sensor nodes were evenly deployed along the length of a strawberry greenhouse with a span of 30 meters and a width of 6 meters, with a sampling period of 5 minutes. Seven days of continuous data collection showed that the air temperature ranged from 16.5 to 26.7℃, and the daily peak-to-valley difference in CO concentration exceeded 420 ppm. Using daily average control methods would have resulted in significant lag. However, the state vector constructed using the method of this invention is updated 12 times per hour, which not only improves the response speed to sudden weather changes (such as cold waves and high temperature fluctuations) but also reduces the probability of disease occurrence caused by humidity accumulation by nearly 28% in actual control. These experimental results demonstrate that the data acquisition and environmental state modeling mechanism based on multi-sensor networks can significantly enhance the monitoring capability and control response efficiency of strawberry greenhouses to environmental changes.
[0046] Step S20: Obtain strawberry plant time series and strawberry plant images, process strawberry plant images using the YOLOv5 library in Python to obtain strawberry plant features; input strawberry plant time series and strawberry plant features into a pre-built and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and determine the target environmental parameter vector based on the current strawberry growth stage label.
[0047] It should be noted that step S20, the step of constructing the strawberry growth stage prediction model, specifically includes: constructing a dual-modal input layer to receive strawberry plant time series and strawberry plant features, and constructing a fusion environment vector from the received strawberry plant time series and strawberry plant features; constructing a time series encoding layer to receive the fusion environment vector, processing the fusion environment vector using two layers of gated recurrent units, and outputting a time series latent vector; constructing an image feature extraction layer to receive the fusion environment vector, processing the fusion environment vector using a ResNet-18 structure, and outputting the convolutional features of strawberry plant features; constructing a fully connected alignment layer to map the time series latent vector and the convolutional features of strawberry plant features to a unified dimension, and outputting a dimension-unified environment vector; and constructing a dual-channel attention fusion layer to introduce an attention factor, calculate the growth stage probability distribution vector based on the attention factor and the dimension-unified environment vector, and output the current strawberry growth stage label based on the growth stage probability distribution vector.
[0048] The steps for training a strawberry growth stage prediction model include: after constructing the strawberry growth stage prediction model, obtaining historical strawberry plant time series, historical strawberry plant features, and historical standard strawberry growth stage labels; using the historical strawberry plant time series and historical strawberry plant features as inputs to the strawberry growth stage prediction model, and using the historical standard strawberry growth stage labels as outputs; introducing a modal difference constraint loss term, and pre-training the strawberry growth stage prediction model based on the modal difference constraint loss term combined with the cross-entropy loss function.
[0049] Understandably, by adopting the aforementioned multimodal structure, the strawberry growth stage prediction model can simultaneously utilize static image information and dynamic temporal information to identify growth stages. Compared to traditional methods that rely solely on the number of days or a single image for judgment, this model significantly improves the accuracy and generalization ability of growth stage identification. Due to the introduction of an attention mechanism, the model can adaptively adjust the importance of image and temporal modalities based on the actual conditions of different samples, thereby improving the model's stability under different cultivation environments and individual differences, making it particularly suitable for application in greenhouse multi-batch planting and dynamic environmental changes. Furthermore, the modality difference constraint mechanism reduces modality shift issues during feature fusion, improves fusion quality, and provides a more stable and reliable basis for stage classification in subsequent control logic.
[0050] It should be understood that, compared to traditional strawberry greenhouse management methods that rely on manual experience, fixed numbers of days, or static images for stage determination, the strawberry growth stage prediction model constructed in this invention achieves substantial improvements in several aspects. Firstly, the introduction of YOLOv5 for image detection and feature cropping automatically focuses on key plant areas, eliminating background interference and improving image quality representation. Secondly, joint modeling of time series and image features reflects the stage-specific variations of plants during their evolution over time, avoiding the judgment bias of "different growth stages on the same day." Thirdly, the introduction of an attention mechanism allows the model to dynamically allocate weights based on the performance of different modalities in the judgment task, effectively mitigating model inaccuracies caused by individual differences or changes in light intensity. Fourthly, the introduction of modality consistency loss enhances the structural stability of the fused representation, providing higher-quality input information for subsequent environmental parameter settings and comprehensively improving the level of intelligent control.
[0051] For example, strawberry images and environmental time-series data collected over a 92-day period in a strawberry greenhouse were used as training samples. The strawberry growth stage prediction model of this invention was used for training and validation, with training samples accounting for 80% and validation samples accounting for 20%. The results showed that the model achieved an overall stage recognition accuracy of 92.3% on the validation set, with accuracy rates of 90.1% and 93.7% for distinguishing between the seedling stage and the flowering stage, respectively, significantly outperforming the average accuracy of 77.6% for traditional image SVM classifiers on the same dataset. Furthermore, the model maintained a stable recognition accuracy of over 88% in transfer tests across different greenhouse batches, and its ability to identify the fruiting stage in advance was significantly enhanced. It can trigger the light and CO2 concentration adjustment logic more than 12 hours in advance during actual control, significantly improving the foresight and resource allocation efficiency of greenhouse regulation, ultimately achieving a comprehensive benefit of an 8.4% increase in average single fruit weight and a 12.1% increase in the proportion of marketable fruit.
[0052] Step S30: Input the target environment parameter vector in the past period T1 into the pre-trained long short-term memory network to obtain the predicted environment parameter vector in the future period T2.
[0053] It should be noted that the Long Short-Term Memory (LSTM) network described in step S30 is a time-series-based deep recurrent neural network structure, capable of capturing modeling of long-term dependencies and short-term fluctuations. Its input is a time series of target environmental parameters over a past period. These target environmental parameters include key factors such as temperature, humidity, carbon dioxide concentration, and light intensity, set according to the strawberry growth stage, forming a multidimensional time series tensor. During the training process of the LSM network, the target environmental parameters within a consecutive number of days from historical planting samples are used as input, and the environmental target trend value for the next time period is used as the supervision signal. Optimization is performed using the mean squared error loss function, and long-term time series features are learned through time step expansion and parameter sharing. The pre-trained model can automatically predict the target evolution trend of various environmental factors within several future time windows based on the input target environmental sequence, providing advance reference for the subsequent fuzzy controller, thereby transforming traditional passive response control into a prediction-based active adjustment mechanism.
[0054] Understandably, the introduction of this predictive model can effectively address the problem of untimely target environment switching caused by the phased fluctuations in strawberry growth rhythm and frequent external climate disturbances. Through the coordinated regulation of the forget gate, input gate, and output gate in the LSTM structure, potential periodic, abrupt, and trend-based changes can be identified in the historical target parameter sequence over multiple days, thereby achieving highly reliable predictions of the next stage of regulation. This feedforward predictive mechanism allows control to no longer rely on fixed thresholds or posterior experience judgments, but can identify regulatory deviation trends in advance and update the strategy before deviating from the preset environmental state. This significantly improves the response speed, smoothness, and crop environmental adaptability of intelligent greenhouse control. Especially during high-temperature seasons, cold waves, or the early stages of phase transitions, the predictive mechanism can better avoid regulatory oscillations caused by blind delays or frequent corrections.
[0055] It should be understood that compared with traditional moving average, weighted regression, or linear autoregressive prediction models, Long Short-Term Memory (LSTM) networks possess stronger nonlinear modeling capabilities and multidimensional variable coupling learning capabilities. They can automatically learn the co-evolutionary patterns among multiple factors, adapting to the need for fine-tuning target parameters in strawberry cultivation due to differences in varieties, cultivation methods, and management strategies. Furthermore, traditional models lack sufficient perception and response capabilities to sudden stage transitions and environmental disturbances during the prediction process. LSTM, through its hidden state and memory unit mechanisms, can retain stage-specific control strategies with longer time spans, achieving continuous modeling and dynamic mapping of "past-present-future," thereby enhancing the model's generalization ability and stability. This represents an innovative application of introducing neural network-style prediction mechanisms into crop growth regulation.
[0056] For example, at a strawberry cultivation base, an LSTM prediction model was constructed based on 90 consecutive days of target environmental data from strawberry cultivation in a greenhouse. Using the target temperature, humidity, CO concentration, and light intensity sequences from the past 7 days as input, the model predicted the target value trends for the next 3 days. After 10 rounds of cross-training, the model achieved an average temperature error of ±0.7℃, humidity error of ±3.0%RH, CO error of ±45ppm, and light error of ±230lux on the validation set. Compared to the traditional ARIMA model, the prediction error decreased by nearly 28%. Furthermore, it successfully predicted the linked changes in target temperature, humidity, light, and CO during the transition from flowering to fruiting stages of strawberries one day in advance. This enabled pre-ventilation and supplemental lighting decisions approximately 12 hours earlier at the control layer, significantly improving the foresight and flexibility of the control. This increased the environmental stability during the fruit enlargement stage of strawberries, resulting in a yield increase of approximately 7.8%, laying a precise parameter prediction foundation for subsequent fuzzy control and Q-learning reinforcement regulation.
[0057] Step S40: Obtain the multi-factor environmental state vector at the current moment; calculate the deviation between the target environmental parameter vector and the predicted environmental parameter vector and the actual environmental parameter vector, respectively, to obtain the first environmental error term and the second environmental error term; calculate the preliminary control command based on the first environmental error term and the second environmental error term using a fuzzy control algorithm.
[0058] It should be noted that in step S40, the step of calculating the preliminary control command based on the first environmental error term and the second environmental error term using the fuzzy control algorithm specifically includes: constructing a Gaussian membership function to map the first error term and the second error term to obtain the fuzzy set membership degree; and obtaining the preliminary control command based on the fuzzy set membership degree combined with the fuzzy control algorithm.
[0059] It should be noted that in step S40, the fuzzy control algorithm is used to handle the dynamic error between the multi-factor environmental state and the target state, mapping continuous environmental deviation data into semantic fuzzy rule inputs to achieve a flexible adjustment control strategy. Specifically, the first environmental error term is the difference between the target environmental parameter vector and the current actual environmental state vector, and the second environmental error term is the difference between the predicted environmental parameter vector and the current actual environmental state vector, reflecting the adjustment gaps at two different levels: "control target deviation" and "trend deviation," respectively. To achieve fuzzification, a Gaussian membership function is used to map the two types of errors. The membership function is in the form μ(x) = exp(-(x / σ)2), where μ(x) is the membership function, x is the error value, and σ is the control sensitivity coefficient. The membership function has the characteristics of continuous, smooth, and non-linear transition, and can output a flexible fuzziness response under small fluctuations in error. This converts each error value into a membership degree belonging to a fuzzy set such as "low", "moderate", or "high". Then, fuzzy inference is performed through a set fuzzy rule base. The rule base organizes the control output according to the "if...then..." logic. After inference, defuzzification is performed using the centroid method, and finally, a multi-factor preliminary control command vector is generated as the input basis for subsequent reinforcement learning strategy adjustment.
[0060] It should be understood that, compared to the fixed proportional-integral-derivative structure of traditional PID controllers, which is only suitable for single-factor stationary error regulation, the fuzzy logic-based control mechanism in this invention overcomes the response limitations of linear feedback structures in multivariable environments. Especially under dynamic conditions such as short-term abrupt changes (e.g., a sharp drop in CO) or stage transitions (e.g., from seedling stage to flowering stage), fuzzy control can directly make approximate judgments and generate regulatory behavior based on empirical rules, reducing parameter tuning dependence and modeling complexity. The introduction of Gaussian membership functions, compared to traditional triangular or trapezoidal membership functions, offers better continuity and differentiability. When implemented in the greenhouse edge calculation module, it is more conducive to optimizing computational stability and control accuracy, forming the basis for flexible control strategies in precise greenhouse environmental regulation.
[0061] For example, in a smart greenhouse strawberry cultivation experiment, data on four environmental factors—temperature, humidity, light intensity, and CO concentration—were collected and compared for control. Using the fuzzy control algorithm described in this invention, a first error term was constructed based on the target value and the current value, and a second error term was constructed based on the predicted value and the current value. A Gaussian membership function was introduced to generate fuzzy input, forming a fuzzy controller containing 243 rules. Results showed that in two disturbance tests—one involving a sudden onset of high temperatures and the other involving drastic humidity fluctuations—the fuzzy control output's response time to temperature adjustment was shortened to within 3 minutes. The time required for humidity error to recover to the target range was reduced by approximately 34% compared to traditional threshold control. This effectively avoided physiological abnormalities such as leaf edge curling and uneven fruit coloring caused by delayed response, providing a precise and stable pre-instruction foundation for further adjustments to the control amplitude through reinforcement learning.
[0062] Step S50: Introduce a Q-learning network to adaptively adjust the initial control command to obtain an optimized control command.
[0063] It should be noted that step S50, which involves introducing a Q-learning network to adaptively adjust the initial control command and obtain the optimized control command, specifically includes: Step S501: First, a Q-learning network is introduced, and a greenhouse environment state space and a greenhouse environment action space are constructed, using the environment state space and the greenhouse environment action space as inputs to the Q-learning network; wherein, the environment state space consists of the current multi-factor environment state vector, the first environment error term, the second environment error term, and the target environment parameter vector; the greenhouse environment action space includes the adjustment step size of the multi-factor environment state vector, including the control adjustment step size of the heater execution device, the heating execution device, the humidity control device, and the carbon dioxide release control device; Step S502: The greenhouse environment reward function Q is set according to the first environment error term and the second environment error term; Step S503: Based on the adjustment step size of the multi-factor environment state vector, the Q-learning network is used to learn and update the greenhouse environment reward function Q to obtain the optimized control command.
[0064] Understandably, this step introduces the Q-learning mechanism, providing the entire greenhouse environment with "autonomous learning" capabilities within a closed loop of "perception-response-learning-optimization." Through repeated interactions with the environment, it continuously refines its control strategy, thereby enhancing its adaptability to complex, changing, and uncertain environments. Q-learning does not rely on dynamic environmental models and can learn directly based on state-action-reward triplets. It is suitable for nonlinear environmental control problems that cannot be fully modeled, especially in scenarios involving rapid stage transitions and sudden climate changes during the strawberry growth cycle. Q-learning can gradually approach the optimal control strategy at a relatively low cost, effectively avoiding the repeated adjustments and instability caused by insufficient experience and rigid rules in traditional control logic, thus improving control efficiency, smoothness, and energy consumption performance.
[0065] It should be understood that, unlike traditional rule-based control methods such as PID control and fuzzy control, the Q-learning controller in this invention does not require pre-setting a complete control model or adjustment rules. Instead, it gradually optimizes its behavior strategy through a "trial and error + memory + evaluation" mechanism, possessing the ability for continuous iteration and self-evolution. When facing multi-factor environments with strong nonlinearity, numerous constraints, and severe coupling, Q-learning provides a reinforcement learning-based solution framework. It can continuously update the state-action Q-value function based on historical data in each control cycle, realizing the transformation from experience-driven control to data-driven control.
[0066] Furthermore, in this invention, the first error term and the second error term are simultaneously incorporated into the state space to construct a composite state expression, enabling the controller to not only make adjustment decisions based on the current environmental state, but also to incorporate forward-looking information on short-term prediction errors, thereby achieving preventative adjustment against impending deviations.
[0067] For example, the Q-learning control module described in this invention was deployed in a strawberry intelligent greenhouse experimental base and compared with a traditional fuzzy controller. The target temperature and humidity ranges were set at 22–24℃ and 65%–75%, respectively. The module operated under simulated disturbance scenarios (such as high daytime temperatures and sudden drops in humidity at night) for 10 consecutive days. The results showed that after the 4th day, the Q-learning network's output control strategy stabilized. The average temperature deviation converged from ±2.6℃ to ±0.8℃, and the humidity deviation decreased from ±7.9%RH to ±2.4%RH. The average control energy consumption decreased by approximately 12.5% compared to the fuzzy controller. By automatically adjusting the strategy weights based on historical feedback of different control actions, the module successfully learned to adjust the CO concentration in advance before a significant increase in prediction error occurred on the 7th day, avoiding a decrease in fruit sugar content. Ultimately, this resulted in an increase of 0.42 in the average sugar-acid ratio of strawberries during the harvest period and a 9.7% increase in fruit shape qualification rate. This fully verified the effectiveness and practical value of the Q-learning network in achieving adaptive optimization of control strategies in complex greenhouse environments.
[0068] Example 2: Furthermore, the present invention provides an IoT-based intelligent greenhouse control system, employing an IoT-based intelligent greenhouse control method as described in the above embodiments, which can solve the technical problem of IoT-based intelligent greenhouse control. Compared with the prior art, the beneficial effects of the IoT-based intelligent greenhouse control system provided by the present invention are the same as those of the IoT-based intelligent greenhouse control method provided in the above embodiments, and other technical features in the IoT-based intelligent greenhouse control system are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0069] Example 3: This invention provides an intelligent greenhouse control device based on the Internet of Things (IoT). Please refer to... Figure 2An IoT-based smart greenhouse control device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform an IoT-based smart greenhouse control method as described in Embodiment 1 above. An IoT-based smart greenhouse control device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. This IoT-based smart greenhouse control device is merely an example and should not limit the functionality or scope of the embodiments of this invention. An IoT-based smart greenhouse control device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the IoT-based smart greenhouse control device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows an IoT-based smart greenhouse control device to exchange data with other devices wirelessly or via wired communication. Although an IoT-based smart greenhouse control device with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.
[0070] Example 4: This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the IoT-based intelligent greenhouse control method described above. The computer program product provided by this invention can solve the technical problem of IoT-based intelligent greenhouse control. Compared with the prior art, the beneficial effects of the computer program product provided by this invention are the same as those of the IoT-based intelligent greenhouse control method provided in the above embodiments, and will not be repeated here.
[0071] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this invention.
[0072] It should be understood that the various parts disclosed in this invention can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0073] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A smart greenhouse control method based on the Internet of Things, characterized in that, The methods include: Step S10: Construct a multi-sensor network in a greenhouse environment, collect environmental factor data based on the multi-sensor network, and construct a multi-factor environmental state vector; Step S20: Obtain strawberry plant time series and strawberry plant images; process the strawberry plant images using the YOLOv5 library in Python to obtain strawberry plant features; input the strawberry plant time series and strawberry plant features into a pre-built and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and determine the target environmental parameter vector based on the current strawberry growth stage label; the steps of building the strawberry growth stage prediction model specifically include: A dual-modal input layer is constructed to receive strawberry plant time series and strawberry plant features, and the received strawberry plant time series and strawberry plant features are used to construct a fused environment vector; A time series coding layer is constructed to receive the fusion environment vector, and two layers of gated recurrent units are used to process the fusion environment vector to output the time series latent vector. An image feature extraction layer is constructed to receive the fusion environment vector. The fusion environment vector is processed using a ResNet-18 structure to output the convolutional features of the strawberry plant. A fully connected alignment layer is constructed to map the convolutional features of the time series latent vector and strawberry plant features to a unified dimension, and output a unified dimension environment vector. A dual-channel attention fusion layer is constructed to introduce attention factors. The growth stage probability distribution vector is calculated based on the attention factors and the dimension unified environment vector. The current strawberry growth stage label is output based on the growth stage probability distribution vector. Step S30: Past periods The target environment parameter vector is input into a pre-trained long short-term memory network to obtain the future period. The predicted environmental parameter vector within; Step S40: Obtain the multi-factor environmental state vector at the current moment; calculate the deviation between the target environmental parameter vector and the predicted environmental parameter vector and the actual environmental parameter vector, respectively, to obtain the first environmental error term and the second environmental error term; calculate the preliminary control command based on the first environmental error term and the second environmental error term using a fuzzy control algorithm. Step S50: Introduce a Q-learning network to adaptively adjust the initial control command to obtain an optimized control command.
2. The intelligent greenhouse control method based on the Internet of Things as described in claim 1, characterized in that, In step S10, the environmental factor data includes air temperature data, air humidity data, carbon dioxide concentration data, light intensity data, and soil moisture content data; the multi-sensor network includes a temperature and humidity sensor DHT22, a digital humidity sensor SHT35, a carbon dioxide concentration sensor MH-Z19B, a light intensity sensor BH1750, and a soil moisture sensor.
3. The intelligent greenhouse control method based on the Internet of Things as described in claim 1, characterized in that, In step S20, the current strawberry growth stage labels include seedling stage, flowering stage, fruiting stage, and harvesting stage.
4. The intelligent greenhouse control method based on the Internet of Things as described in claim 1, characterized in that, Step S40, which involves calculating the preliminary control command based on the first and second environmental error terms using a fuzzy control algorithm, specifically includes: constructing a Gaussian membership function to map the first and second error terms to obtain fuzzy set membership; and obtaining the preliminary control command based on the fuzzy set membership and the fuzzy control algorithm.
5. The intelligent greenhouse control method based on the Internet of Things as described in claim 1, characterized in that, Step S20, the step of training the strawberry growth stage prediction model, specifically includes: After constructing the strawberry growth stage prediction model, historical strawberry plant time series, historical strawberry plant characteristics, and historical standard strawberry growth stage labels are obtained. The historical strawberry plant time series and historical strawberry plant characteristics are used as inputs to the strawberry growth stage prediction model, and the historical standard strawberry growth stage labels are used as outputs to the strawberry growth stage prediction model. A modal difference constraint loss term is introduced, and the strawberry growth stage prediction model is pre-trained based on the modal difference constraint loss term and the cross-entropy loss function.
6. The intelligent greenhouse control method based on the Internet of Things as described in claim 1, characterized in that, Step S50, which involves introducing a Q-learning network to adaptively adjust the initial control command to obtain the optimized control command, specifically includes: Step S501: First, introduce the Q-learning network and construct the greenhouse environment state space and greenhouse environment action space, using the environment state space and greenhouse environment action space as inputs to the Q-learning network; wherein, the environment state space consists of the current multi-factor environment state vector, the first environment error term and the second environment error term, and the target environment parameter vector; the greenhouse environment action space includes the adjustment step size of the multi-factor environment state vector, including the control adjustment step size of the heater execution device, the heating execution device, the humidity control device and the carbon dioxide release control device; Step S502: Set the greenhouse environment reward function Q based on the first environmental error term and the second environmental error term; Step S503: Based on the adjustment step size of the multi-factor environmental state vector, perform the learning and update operation of the Q-learning network on the greenhouse environment reward function Q to obtain the optimized control command.
7. An IoT-based intelligent greenhouse control system, applied to the IoT-based intelligent greenhouse control method according to any one of claims 1-6, characterized in that, The IoT-based intelligent greenhouse control system includes: The environmental data acquisition module is used to build a multi-sensor network in a greenhouse environment, collect environmental factor data based on the multi-sensor network, and construct a multi-factor environmental state vector. A growth stage identification module is used to acquire strawberry plant time series and strawberry plant images. The strawberry plant images are processed using the YOLOv5 library in Python to obtain strawberry plant features. The strawberry plant time series and strawberry plant features are input into a pre-built and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and the target environmental parameter vector is determined based on the current strawberry growth stage label. The steps for constructing the strawberry growth stage prediction model specifically include: A dual-modal input layer is constructed to receive strawberry plant time series and strawberry plant features, and the received strawberry plant time series and strawberry plant features are used to construct a fused environment vector; A time series coding layer is constructed to receive the fusion environment vector, and two layers of gated recurrent units are used to process the fusion environment vector to output the time series latent vector. An image feature extraction layer is constructed to receive the fusion environment vector. The fusion environment vector is processed using a ResNet-18 structure to output the convolutional features of the strawberry plant. A fully connected alignment layer is constructed to map the convolutional features of the time series latent vector and strawberry plant features to a unified dimension, and output a unified dimension environment vector. A dual-channel attention fusion layer is constructed to introduce attention factors. The growth stage probability distribution vector is calculated based on the attention factors and the dimension unified environment vector. The current strawberry growth stage label is output based on the growth stage probability distribution vector. The environmental parameter prediction module is used to predict past cycles. The target environment parameter vector is input into a pre-trained long short-term memory network to obtain the future period. The predicted environmental parameter vector within; The fuzzy control calculation module is used to obtain the multi-factor environmental state vector at the current moment, calculate the deviation between the target environmental parameter vector and the predicted environmental parameter vector and the actual environmental parameter vector, respectively, to obtain the first environmental error term and the second environmental error term; and calculate the preliminary control command based on the first environmental error term and the second environmental error term using the fuzzy control algorithm. The reinforcement learning optimization module is used to introduce a Q-learning network to adaptively adjust the initial control commands and obtain optimized control commands.
8. An intelligent greenhouse control device based on the Internet of Things, characterized in that, The IoT-based smart greenhouse control device includes: a memory, a processor, and an IoT-based smart greenhouse control program stored in the memory and executable on the processor. When the IoT-based smart greenhouse control program is executed by the processor, it implements an IoT-based smart greenhouse control method according to any one of claims 1 to 6.
9. A computer program product, characterized in that, The computer program product includes an Internet of Things (IoT)-based intelligent greenhouse control program, which, when executed by a processor, implements an IoT-based intelligent greenhouse control method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Intelligent strawberry planting method
CN107969297A
Strawberry greenhouse intelligent control system and greenhouse strawberry growth model construction method
CN111650976A