Intelligent greenhouse control method and system based on Internet of Things
By building a multi-sensor network and deep learning model, combined with reinforcement learning optimization control instructions, real-time dynamic adjustment of the strawberry growth environment is achieved, solving the problem of inaccurate setting of environmental parameters in traditional greenhouse control systems at different growth stages, and improving the growth quality and yield of strawberry crops.
Patent Information
- Application Number
- CN202510542329.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-04-28
AI Technical Summary
The existing greenhouse control system cannot be dynamically adjusted according to the needs of different growth stages during strawberry growth, resulting in inaccurate setting of environmental parameters, affecting crop growth quality and yield.
Build a multi-sensor network to collect environmental data, combine strawberry plant image recognition and deep learning models, and introduce reinforcement learning optimization control instructions through long-term and short-term memory networks and fuzzy control algorithms to achieve real-time dynamic adjustment of environmental parameters.
It significantly improves the accuracy and adaptability of greenhouse environmental control, improves the growth quality and yield of strawberry crops, and reduces the impact of environmental changes on the control system.
Smart Images

Figure CN120406611A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of smart agriculture and Internet of Things control technology, and particularly relates to an intelligent greenhouse control method and system based on the Internet of Things. Background Art
[0002] Currently, strawberries, as important cash crops, have 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. Although intelligent greenhouse control systems are widely used in the agricultural field, most traditional greenhouse environment control methods rely on static control schemes based on fixed threshold settings or simple PID control methods. These methods often show obvious limitations when facing complex environmental changes in the greenhouse. For example, the environmental parameters such as temperature, humidity, and light in the prior art usually rely on manual threshold setting or basic automation control, but these methods cannot be dynamically adjusted according to the growth cycle and real-time needs of strawberry crops. Especially in different growth stages of the crop, such as the seedling stage, flowering stage, and fruiting stage, the demands of strawberries for environmental factors are significantly different, and it is difficult for the prior art to achieve precise dynamic regulation based on the growth state of the crop. Therefore, there is an urgent need for a greenhouse control method that can achieve intelligent perception and real-time adjustment, which can supervise and control in real time and collect data according to the growth stage of strawberry crops, dynamically adjust the environmental factors in the greenhouse, and effectively improve the adaptive ability and long-term stability of greenhouse regulation by introducing technologies such as multi-sensor networks, deep learning prediction, and reinforcement learning optimization, so as to increase the yield and quality of strawberry crop growth. Summary of the Invention
[0003] Aiming at the above-mentioned technical deficiencies, the purpose of the present invention is to propose an intelligent greenhouse control method based on the Internet of Things, aiming to solve the technical problem that the existing greenhouse control methods mostly rely on fixed thresholds or static rules, and it is difficult to achieve dynamic target setting and adaptive adjustment of environmental parameters, especially under the condition that the demands of strawberry crops change rapidly in different growth stages.
[0004] To solve the above technical problems, the present invention adopts the following technical solutions: The present invention provides an intelligent greenhouse control method based on the Internet of Things,
[0005] The intelligent greenhouse control method based on the Internet of Things includes:
[0006] Step S10: Construct a multi-sensor network in the greenhouse environment, collect environmental factor data based on the multi-sensor network, and construct a multi-factor environmental state vector;
[0007] Step S20: Obtain the strawberry plant time series and strawberry plant images, and use the YOLOv5 library in Python to process the strawberry plant images to obtain strawberry plant features; input the strawberry plant time series and strawberry plant features into a pre-constructed and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and determine the target environmental parameter vector according to the current strawberry growth stage label;
[0008] Step S30: 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;
[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 instruction through a fuzzy control algorithm based on the first environmental error term and the second environmental error term;
[0010] Step S50: Introduce a Q-learning network to adaptively adjust the preliminary control instruction to obtain the optimized control instruction.
[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 water 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 humidity sensor.
[0012] Preferably, in step S20, the current strawberry growth stage label includes the seedling stage, the flowering stage, the fruiting stage, and the picking stage.
[0013] Preferably, in step S40, the step of calculating the preliminary control instruction through a fuzzy control algorithm based on the first environmental error term and the second environmental error term 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; obtaining the preliminary control instruction according to the fuzzy set membership degree in combination with the fuzzy control algorithm.
[0014] Preferably, in step S20, the step of constructing the strawberry growth stage prediction model specifically includes:
[0015] Construct a bimodal structure input layer for receiving the strawberry plant time series and strawberry plant features, and construct the received strawberry plant time series and strawberry plant features into a fused environmental vector;
[0016] Construct a time series encoding layer for receiving the fused environmental vector, and use 2-layer gated recurrent units to process the fused environmental vector and output the time series hidden vector;
[0017] Construct an image feature extraction layer for receiving the fused environmental vector, processing the fused environmental vector using the ResNet-18 structure, and outputting the convolutional features of the strawberry plant features.
[0018] Construct a fully connected alignment layer for mapping the time series hidden vector and the convolutional features of the strawberry plant features to a unified dimension and outputting a dimension-unified environmental vector.
[0019] Construct a two-channel attention fusion layer for introducing an attention factor, calculating the growth stage probability distribution vector based on the attention factor and the dimension-unified environmental vector, and outputting the current strawberry growth stage label according to the growth stage probability distribution vector.
[0020] Preferably, in step S20, the steps of training the strawberry growth stage prediction model specifically include:
[0021] After constructing the strawberry growth stage prediction model, obtain the historical strawberry plant time series, historical strawberry plant features, and historical standard strawberry growth stage labels. Use the historical strawberry plant time series and historical strawberry plant features as the input of the strawberry growth stage prediction model, and use the historical standard strawberry growth stage labels as the output of the strawberry growth stage prediction model.
[0022] Introduce a modal difference constraint loss term, and pre-train the strawberry growth stage prediction model according to the modal difference constraint loss term combined with the cross-entropy loss function.
[0023] Preferably, in step S50, the steps of introducing a Q-learning network to adaptively adjust the preliminary control instruction to obtain an optimized control instruction specifically include:
[0024] Step S501: First, introduce a Q-learning network, and construct a greenhouse environmental state space and a greenhouse environmental action space, and use the environmental state space and the greenhouse environmental action space as the input of the Q-learning network; among them, the environmental state space is composed of the multi-factor environmental state vector at the current moment, the first environmental error term, the second environmental error term, and the target environmental parameter vector; the greenhouse environmental action space includes the adjustment step sizes of the multi-factor environmental state vector, including the control adjustment step sizes 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 environmental reward function Q according to the first environmental error term and the second environmental error term.
[0026] Step S503: Perform the learning update operation of the Q-learning network on the greenhouse environmental reward function Q based on the adjustment step sizes of the multi-factor environmental state vector to obtain an optimized control instruction.
[0027] The present invention also provides an intelligent greenhouse control system based on the Internet of Things, including:
[0028] An environmental data acquisition module, configured to construct a multi-sensor network in the greenhouse environment, collect environmental factor data based on the multi-sensor network, and construct a multi-factor environmental state vector;
[0029] A growth stage identification module, configured to obtain the time series of strawberry plants and the images of strawberry plants, process the images of strawberry plants using the YOLOv5 library in Python to obtain the characteristics of strawberry plants; input the time series of strawberry plants and the characteristics of strawberry plants into a pre-constructed and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and determine the target environmental parameter vector according to the current strawberry growth stage label;
[0030] An environmental parameter prediction module, configured 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] A fuzzy control calculation module, configured 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; calculate a preliminary control instruction through a fuzzy control algorithm based on the first environmental error term and the second environmental error term;
[0032] A reinforcement learning optimization module, configured to introduce a Q-learning network to adaptively adjust the preliminary control instruction to obtain an optimized control instruction.
[0033] The present invention also provides a computer program product, including an intelligent greenhouse control program based on the Internet of Things. When the intelligent greenhouse control program based on the Internet of Things is executed by a processor, the intelligent greenhouse control method described above is implemented.
[0034] The beneficial effects of the present invention are as follows: By combining supervisory control and data acquisition technologies, the present invention realizes the intelligent adjustment of the growth environment of strawberry crops, significantly improving the accuracy and adaptability of greenhouse environment control. By collecting environmental factor data in the greenhouse in real time, such as temperature, humidity, CO concentration, etc., combining the identification and prediction of the strawberry growth stage, and dynamically adjusting the environmental parameters in the greenhouse, the precise response to the growth requirements of strawberry crops is realized.
[0035] By introducing an adaptive adjustment mechanism that combines reinforcement learning and fuzzy control, the present invention can make timely adjustments when the greenhouse environment changes, avoiding the inaccuracy caused by traditional manual threshold setting, and further improving the control accuracy and crop yield. Description of the Drawings
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0037] Figure 1 It is a schematic flowchart of the first embodiment of an intelligent greenhouse control method based on the Internet of Things according to the present invention.
[0038] Figure 2 It is a schematic diagram of the device of an intelligent greenhouse control method based on the Internet of Things according to the present invention. Detailed implementation manners
[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0040] Embodiment 1: As Figure 1 shown, it is a schematic flowchart of the first embodiment of the intelligent greenhouse control method based on the Internet of Things according to the present invention, and the first embodiment of the intelligent greenhouse control method based on the Internet of Things according to the present invention is proposed.
[0041] In the first embodiment, the intelligent greenhouse control method based on the Internet of Things includes:
[0042] Step S10: Construct a multi-sensor network in the 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 humidity sensor.
[0044] It is understandable that by constructing the above multi-sensor network, not only the high-frequency and refined continuous monitoring of key environmental factors in the strawberry cultivation greenhouse is achieved, but also each sensor node can perform dynamic sampling according to the set time interval (such as 1 minute to 10 minutes) to form a "time series state snapshot" of the microenvironment of strawberry growth. This environmental state vector can not only be used as the direct input of the prediction model and control model in the subsequent stage, but also be used to establish a regression or correlation analysis model between the physiological state of the crop and environmental factors.
[0045] For example, in an actual experiment, three groups of multi-factor sensor nodes were evenly arranged along the length direction of a strawberry greenhouse with a span of 30 meters and a width of 6 meters, and the sampling period was set to 5 minutes. The results of continuous collection for 7 days showed that the air temperature change range was 16.5 - 26.7 °C, and the peak-to-valley difference of the daily change of CO concentration exceeded 420 ppm. If the daily average value regulation method was used, there would be an obvious lag. However, the state vector constructed by the method of the present invention is updated 12 times per hour, which not only improves the response speed to sudden weather (such as cold snaps and high-temperature fluctuations), but also reduces the occurrence probability of diseases caused by humidity accumulation by nearly 28% in actual regulation. The experimental results prove that the data acquisition and environmental state modeling mechanism based on the multi-sensor network can significantly enhance the monitoring ability and regulation response efficiency of the strawberry greenhouse to environmental changes.
[0046] Step S20: Obtain the time series of strawberry plants and the images of strawberry plants, and use the YOLOv5 library in Python to process the images of strawberry plants to obtain the characteristics of strawberry plants; input the time series of strawberry plants and the characteristics of strawberry plants into the pre-constructed and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and determine the target environmental parameter vector according to the current strawberry growth stage label;
[0047] It should be noted that in step S20, the steps of constructing the strawberry growth stage prediction model specifically include: constructing a dual-modal structure input layer for receiving the time series of strawberry plants and the characteristics of strawberry plants, and constructing the received time series of strawberry plants and the characteristics of strawberry plants into a fused environmental vector; constructing a time series encoding layer for receiving the fused environmental vector, and using a 2-layer gated recurrent unit to process the fused environmental vector to output a time series hidden vector; constructing an image feature extraction layer for receiving the fused environmental vector, and using a ResNet-18 structure to process the fused environmental vector to output the convolutional features of the characteristics of strawberry plants; constructing a fully connected alignment layer for mapping the time series hidden vector and the convolutional features of the characteristics of strawberry plants to a unified dimension to output a dimension-unified environmental vector; constructing a dual-channel attention fusion layer for introducing an attention factor, calculating the growth stage probability distribution vector according to the attention factor and the dimension-unified environmental vector, and outputting the current strawberry growth stage label according to the growth stage probability distribution vector.
[0048] The steps of training the strawberry growth stage prediction model specifically include: after constructing the strawberry growth stage prediction model, obtaining the historical strawberry plant time series, historical strawberry plant characteristics, and historical standard strawberry growth stage labels, using the historical strawberry plant time series and historical strawberry plant characteristics as the input of the strawberry growth stage prediction model, and using the historical standard strawberry growth stage labels as the output of the strawberry growth stage prediction model; introducing a modal difference constraint loss term, and pre-training the strawberry growth stage prediction model according to the modal difference constraint loss term combined with the cross-entropy loss function.
[0049] It can be understood that by adopting the above multi-modal structure, the strawberry growth stage prediction model can simultaneously utilize static image information and dynamic time information for growth stage recognition. Compared with the traditional method that only relies on the number of days or a single image for judgment, this model significantly improves the accuracy and generalization ability of growth stage judgment. Due to the introduction of the attention mechanism, the model can adaptively adjust the importance of the image modality and time modality according to the actual situation of different samples, thereby enhancing the stability of the model under different cultivation environments and different individual differences, and is especially suitable for application in the context of multi-batch planting in greenhouses and dynamic environmental changes. In addition, through the modal difference constraint mechanism, the modal shift problem in the feature fusion process can be reduced, the fusion quality can be improved, and a more stable and reliable stage classification basis can be provided for the subsequent control logic.
[0050] It should be understood that compared with the traditional strawberry greenhouse management method that relies on manual experience, fixed days, or static images for stage determination, the strawberry growth stage prediction model constructed in the present invention has achieved substantial improvements in many aspects. First, introducing YOLOv5 for image detection and feature cropping can automatically focus on the key plant areas, eliminate background interference, and improve the expressive ability of image quality; second, the joint modeling of time series and image features can reflect the stage variation of the plant during the time evolution process, avoiding the judgment deviation of "different growth on the same day"; third, the introduction of the attention mechanism enables the model to dynamically allocate weights according to the performance of different modalities in the judgment task, effectively alleviating the problem of model misalignment caused by individual differences or light changes; fourth, the introduction of the modal consistency loss enhances the structural stability of the fusion representation, provides higher-quality input information for the subsequent environmental parameter setting, and comprehensively improves the level of control intelligence.
[0051] For example, strawberry images and environmental time series data for a full 92-day cycle were collected in a certain strawberry greenhouse as training samples, and the strawberry growth stage prediction model in the present invention was used for training and verification, where the training samples accounted for 80% and the verification samples accounted for 20%. The results showed that the overall stage recognition accuracy of the model on the validation set reached 92.3%, and the discrimination accuracies for the seedling stage and the flowering stage were 90.1% and 93.7% respectively, significantly better than the average accuracy of 77.6% of the traditional image SVM classifier on the same data set. In addition, the model still maintained a stable recognition accuracy of over 88% in the transfer tests of different greenhouse batches, and the ability to identify the fruiting stage in advance was significantly enhanced, and it could trigger the illumination and CO concentration adjustment logic more than 12 hours in advance during the actual control process, significantly improving the foresight of greenhouse control and the efficiency of resource allocation, and finally achieving a comprehensive benefit of an 8.4% increase in the average weight of single fruits and a 12.1% increase in the proportion of commercial fruits.
[0052] Step S30: Input the target environmental parameter vector within the past period T1 into the pre-trained long short-term memory network to obtain the predicted environmental parameter vector within the future period T2;
[0053] It should be noted that the long short-term memory network described in step S30 is a deep recurrent neural network structure based on time series, with the ability to capture long-term dependencies and short-term fluctuations. Its input is the time series of target environmental parameters within the past period, and the 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 multi-dimensional time series tensor. During the training process of the long short-term memory network, the target environmental parameters within consecutive days in the historical planting samples are used as inputs, and the environmental target trend value of the next time period is used as the supervision signal. The mean squared error loss function is used for optimization, and the long-term time series features are learned through time step expansion and parameter sharing. After pre-training, the model can automatically predict the target evolution trends of various environmental factors within the next few time windows based on the input target environmental sequence, providing an early reference basis for the subsequent fuzzy controller, thus transforming the traditional passive response control into a prediction-based active adjustment mechanism.
[0054] It is understandable that the introduction of this prediction model can effectively solve the problem of untimely switching of the target environment caused by the phased fluctuations of the 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, mutational, and trend-changing characteristics can be identified in the historical target parameter sequences over multiple days, thereby achieving highly reliable prediction of the next-stage regulation target. This feedforward prediction mechanism enables control to no longer rely on fixed thresholds or posterior experience judgments, but rather can identify the trend of regulation deviation in advance and update the strategy before deviating from the preset environmental state, significantly improving the response speed, smoothness, and crop environmental adaptability of intelligent greenhouse control. Especially during the high-temperature season, the approach of cold snaps, or the initial stage of phase transitions, the prediction mechanism can more effectively avoid the regulation oscillations caused by blind lag 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 networks have stronger non-linear modeling capabilities and multi-dimensional variable coupling learning capabilities, and can automatically learn the co-evolution laws among multiple factors to adapt to the fine-tuning requirements of target parameters in strawberry cultivation due to different varieties, cultivation modes, and management strategies. In addition, traditional models lack sufficient perception and response capabilities for sudden stage transitions and environmental disturbances during the prediction process, while LSTM can retain stage control strategies with a relatively long time span through the hidden state and memory cell mechanisms, achieving continuous modeling and dynamic mapping of "past-current-future", thereby enhancing the generalization ability and stability of the model. This is an innovative application of introducing a neural network-based prediction mechanism in crop growth regulation.
[0056] For example, at a strawberry cultivation base, an LSTM prediction model is constructed based on the target environment data of strawberry cultivation in a certain greenhouse for 90 consecutive days. The sequences of target temperature, humidity, CO concentration, and light intensity for the past 7 days are selected as inputs to predict the change trend of target values for the next 3 days. After 10 rounds of cross-training, the model reaches a performance level with an average temperature error of ±0.7°C, humidity error of ±3.0%RH, CO error of ±45ppm, and light error of ±230lux on the validation set. Compared with the traditional ARIMA model, the prediction error decreases by nearly 28%. It also successfully predicts 1 day in advance the coordinated changes of target temperature, humidity, light, and CO during the transition of strawberries from the flowering stage to the fruiting stage, thereby enabling pre-ventilation and supplementary lighting decisions about 12 hours in advance at the control layer, significantly improving the forward-looking nature of control and the flexibility of regulation, enhancing the environmental stability during the fruit swelling stage of strawberries, and increasing the unit yield by approximately 7.8%. This lays a precise parameter prediction foundation for subsequent fuzzy control and Q-learning enhanced 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 instruction through the fuzzy control algorithm based on the first environmental error term and the second environmental error term;
[0058] It should be noted that in step S40, the step of calculating the preliminary control instruction through the fuzzy control algorithm based on the first environmental error term and the second environmental error term specifically includes: constructing a Gaussian membership function to map the first error term and the second error term to obtain the membership degree of the fuzzy set; obtaining the preliminary control instruction according to the membership degree of the fuzzy set in combination with the fuzzy control algorithm.
[0059] It should be noted that in step S40, the fuzzy control algorithm is used to process the dynamic error between the multi-factor environmental state and the target state, map the continuous environmental deviation data into the semantic fuzzy rule input 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, which respectively reflect two different levels of adjustment gaps of "control target deviation" and "trend deviation". To achieve fuzzy processing, the two types of errors are mapped based on the Gaussian membership function, and the form of the membership function is μ(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 continuity, smoothness and non-linear transition, and can output a flexible fuzzy degree response under small fluctuations of the error, and then convert each error value into the membership degree belonging to fuzzy sets such as "low", "moderate" or "high". Subsequently, fuzzy reasoning is carried out through the set fuzzy rule base. The rule base organizes the control output according to the "if... then..." logic, and performs defuzzification processing through the centroid method after reasoning, and finally generates a multi-factor preliminary control instruction vector as the input basis for subsequent reinforcement learning strategy adjustment.
[0060] It should be understood that, compared with the fixed proportional-integral-differential structure in the traditional PID controller which is only applicable to the regulation of the stationary error of a single factor, the control mechanism based on fuzzy logic in the present invention breaks through the response limitation of the linear feedback structure in a multi-variable environment. Especially in the face of dynamic conditions such as short-term mutations (such as a sudden drop in CO) or stage transitions (such as entering the flowering stage from the seedling stage), fuzzy control can directly make approximate judgments and generate adjustment behaviors based on empirical rules, reducing the dependence on parameter tuning and the complexity of modeling. The introduction of the Gaussian membership function has better continuity and differentiability compared with the traditional triangular or trapezoidal membership functions, which is more conducive to optimizing the calculation stability and control accuracy when implemented in the greenhouse edge computing module, and is the basis of the flexible control strategy for the precise regulation of the greenhouse environment.
[0061] For example, in a strawberry planting experiment in a smart greenhouse, data of four environmental factors, namely temperature, humidity, light intensity, and CO concentration, were collected for control comparison. The fuzzy control algorithm described in the present invention was adopted. Based on the target value and the current value, a first error term was constructed, and based on the predicted value and the current value, a second error term was constructed. The Gaussian membership function was introduced to generate fuzzy inputs, forming a fuzzy controller with 243 rules. The results showed that in two perturbation tests of the sudden arrival of high-temperature weather and severe humidity fluctuations, the response time of the fuzzy control output for temperature regulation was shortened to within 3 minutes, and the time required for the humidity error to recover to the target range was reduced by about 34% compared with the traditional threshold-type control, effectively avoiding physiological abnormalities such as dry curling of leaf edges and uneven fruit coloring caused by reaction delay, providing a precise and stable pre-instruction basis for further adjusting the control amplitude through reinforcement learning later.
[0062] Step S50: Introduce a Q-learning network to adaptively adjust the preliminary control instruction to obtain an optimized control instruction.
[0063] It should be noted that in step S50, the step of introducing a Q-learning network to adaptively adjust the preliminary control instruction to obtain an optimized control instruction specifically includes: Step S501: First, introduce a Q-learning network, and construct a greenhouse environment state space and a greenhouse environment action space, and use the environment state space and the greenhouse environment action space as the inputs of the Q-learning network; wherein, the environment state space is composed of the multi-factor environment state vector at the current moment, 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 sizes of the multi-factor environment state vector, including the control adjustment step sizes 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 according to the first environment error term and the second environment error term; Step S503: Perform the learning update operation of the Q-learning network on the greenhouse environment reward function Q based on the adjustment step sizes of the multi-factor environment state vector to obtain an optimized control instruction.
[0064] It can be understood that this step introduces the Q - learning mechanism, providing the "autonomous learning" ability in the "perception - response - learning - optimization" closed - loop for the entire greenhouse environment. Through continuous interaction with the environment for multiple times, it continuously corrects the control strategy, thereby enhancing the adaptability to complex, changeable, and uncertain environments. Q - learning does not rely on the environmental dynamic model and can directly learn based on the state - action - reward triple. It is applicable to the non - linear environmental regulation problems that cannot be fully modeled. Especially in the scenario where there are unforeseen factors such as rapid stage conversion and climate mutation during the strawberry growth cycle, Q - learning can gradually approach the optimal regulation strategy at a relatively small cost, effectively avoiding the problems of repeated adjustment and unstable regulation caused by insufficient experience and rigid rules in the traditional regulation logic, thereby improving control efficiency, smoothness, and energy consumption performance.
[0065] It should be understood that different from traditional rule - based control methods such as traditional PID control and fuzzy control, the Q - learning controller in the present invention does not need to pre - set a complete control model or adjustment rules in advance. Instead, it gradually optimizes its behavior strategy through the "trial - and - error + memory + evaluation" mechanism and has the ability of continuous iteration and self - evolution. When facing the multi - factor environmental control with strong non - linearity, many constraints, and severe coupling, Q - learning provides a solution framework based on reinforcement learning, which can continuously update the state - action Q - value function according to historical data in each control cycle, realizing the transformation from experience - driven control to data - driven control.
[0066] In addition, in the present 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 combine the forward - looking information of the short - term prediction error to achieve preventive adjustment of the upcoming deviation.
[0067] For example, deploy the Q - learning control module described in the present invention in a certain strawberry intelligent greenhouse experimental base, conduct a comparative test with a traditional fuzzy controller, set the target temperature and humidity range as 22 - 24°C and 65% - 75%, and run it under a continuous 10 - day simulated interference scenario (such as high temperature during the day + sudden drop in humidity at night). The results show that: after the 4th day, the control strategy output by the Q - learning network tends to be stable, the average temperature deviation converges from the initial ±2.6°C to ±0.8°C, the humidity deviation drops from ±7.9%RH to ±2.4%RH, and the average control energy consumption decreases by about 12.5% compared with the fuzzy controller. By automatically adjusting the strategy weights based on the historical feedback of different control actions, it successfully learns to adjust the CO concentration in advance before the significant increase in the prediction error on the 7th day, avoiding the problem of the decrease in fruit sugar content. Finally, the average sugar - acid ratio of strawberries during the picking period is increased by 0.42, and the fruit shape qualification rate is increased by 9.7%, fully verifying the effectiveness and practical value of the Q - learning network in realizing the adaptive optimization of control strategies in complex greenhouse environments.
[0068] Embodiment 2: In addition, an intelligent greenhouse control system based on the Internet of Things provided by the present invention adopts an intelligent greenhouse control method based on the Internet of Things in the above embodiment, and can solve the technical problem of intelligent greenhouse control based on the Internet of Things. Compared with the prior art, the beneficial effects of the intelligent greenhouse control system based on the Internet of Things provided by the present invention are the same as those of the intelligent greenhouse control method based on the Internet of Things provided in the above embodiment, and other technical features in the intelligent greenhouse control system based on the Internet of Things are the same as the features disclosed in the above embodiment method, and will not be elaborated here.
[0069] Embodiment 3: The present invention provides an intelligent greenhouse control device based on the Internet of Things. Please refer to Figure 2, An Internet of Things-based intelligent 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, and the instructions are executed by the at least one processor to enable the at least one processor to execute an Internet of Things-based intelligent greenhouse control method in Embodiment 1 above. An Internet of Things-based intelligent greenhouse control device in an embodiment of the present invention may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description: tablet computers), PMPs (Portable Media Player: portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. An Internet of Things-based intelligent greenhouse control device is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention. An Internet of Things-based intelligent greenhouse control device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can execute various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read-Only Memory) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of an Internet of Things-based intelligent greenhouse control device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow an Internet of Things-based intelligent greenhouse control device to communicate with other devices wirelessly or wireline to exchange data. Although an Internet of Things-based intelligent greenhouse control device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the shown systems. Instead, more or fewer systems may be implemented or had.
[0070] Embodiment 4: The present invention further provides a computer program product, including a computer program, which when executed by a processor implements the steps of a smart greenhouse control method based on the Internet of Things as described above. The computer program product provided by the present invention can solve the technical problem of smart greenhouse control based on the Internet of Things. Compared with the prior art, the beneficial effects of the computer program product provided by the present invention are the same as those of the smart greenhouse control method based on the Internet of Things provided in the above embodiment, and will not be elaborated here.
[0071] In particular, according to the embodiments disclosed by the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed by the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by a processing device 1001, it executes the above functions defined in the methods of the embodiments disclosed by the present invention.
[0072] It should be understood that the various parts disclosed by the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0073] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these changes and modifications.
Claims
1. An intelligent greenhouse control method based on the Internet of Things, characterized in that The method includes: 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 the strawberry plant time series and strawberry plant images, use the YOLOv5 library in Python to process the strawberry plant images to obtain strawberry plant features; input the strawberry plant time series and strawberry plant features into a pre-constructed and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and determine the target environmental parameter vector according to the current strawberry growth stage label; Step S30: 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; 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 instruction through a fuzzy control algorithm based on the first environmental error term and the second environmental error term; Step S50: Introduce a Q-learning network to adaptively adjust the preliminary control instruction to obtain the optimized control instruction.
2. The intelligent greenhouse control method based on the Internet of Things according to 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 water 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 humidity sensor.
3. The intelligent greenhouse control method based on the Internet of Things according to claim 1, characterized in that, In step S20, the current strawberry growth stage label includes the seedling stage, the flowering stage, the fruiting stage, and the picking stage.
4. The intelligent greenhouse control method based on the Internet of Things according to claim 1, characterized in that, In step S40, the step of calculating the preliminary control instruction through a fuzzy control algorithm based on the first environmental error term and the second environmental error term 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; obtaining the preliminary control instruction according to the fuzzy set membership degree in combination with the fuzzy control algorithm.
5. The intelligent greenhouse control method based on the Internet of Things according to claim 1, wherein In step S20, the steps of constructing the strawberry growth stage prediction model specifically include: Construct a dual-modal structure input layer for receiving the strawberry plant time series and strawberry plant features, and construct the received strawberry plant time series and strawberry plant features into a fused environmental vector; Construct a time series encoding layer for receiving the fused environmental vector, and use a 2-layer gated recurrent unit to process the fused environmental vector to output a time series hidden vector; Construct an image feature extraction layer for receiving the fused environmental vector, and use a ResNet-18 structure to process the fused environmental vector to output the convolutional features of the strawberry plant features; Construct a fully connected alignment layer for mapping the time series hidden vector and the convolutional features of the strawberry plant features to a unified dimension and outputting a dimension-unified environmental vector; Construct a dual-channel attention fusion layer for introducing an attention factor, calculating the growth stage probability distribution vector according to the attention factor and the dimension-unified environmental vector, and outputting the current strawberry growth stage label according to the growth stage probability distribution vector.
6. The intelligent greenhouse control method based on the Internet of Things according to claim 5, wherein, In step S20, the steps of training the strawberry growth stage prediction model specifically include: After constructing the strawberry growth stage prediction model, obtain the historical strawberry plant time series, historical strawberry plant characteristics, and historical standard strawberry growth stage labels. Use the historical strawberry plant time series and historical strawberry plant characteristics as the input of the strawberry growth stage prediction model, and use the historical standard strawberry growth stage labels as the output of the strawberry growth stage prediction model. Introduce the modal difference constraint loss term, and pre-train the strawberry growth stage prediction model according to the modal difference constraint loss term combined with the cross-entropy loss function.
7. The intelligent greenhouse control method based on the Internet of Things according to claim 1, characterized in that In step S50, the steps of introducing the Q-learning network to adaptively adjust the preliminary control instruction to obtain the optimized control instruction specifically include: Step S501: First, introduce the Q-learning network, and construct the greenhouse environment state space and the greenhouse environment action space, and use the environment state space and the greenhouse environment action space as the input of the Q-learning network; among them, the environment state space is composed of the multi-factor environment state vector, the first environment error term, the second environment error term, and the target environment parameter vector at the current moment; the greenhouse environment action space includes the adjustment step size of the multi-factor environment state vector, including the control adjustment step sizes 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 according to the first environment error term and the second environment error term. Step S503: Perform the learning and update operation of the Q-learning network on the greenhouse environment reward function Q based on the adjustment step size of the multi-factor environment state vector to obtain the optimized control instruction.
8. An intelligent greenhouse control system based on the Internet of Things, which is applied to an intelligent greenhouse control method based on the Internet of Things according to any one of claims 1-7, and is characterized in that, The IoT-based intelligent greenhouse control system includes: An environmental data acquisition module, which is used to construct a multi-sensor network in the greenhouse environment, collect environmental factor data based on the multi-sensor network, and construct a multi-factor environment state vector. A growth stage recognition module, which is used to obtain the strawberry plant time series and the strawberry plant image, and use the YOLOv5 library in Python to process the strawberry plant image to obtain the strawberry plant characteristics; input the strawberry plant time series and the strawberry plant characteristics into the pre-constructed and trained strawberry growth stage prediction model to obtain the current strawberry growth stage label, and determine the target environment parameter vector according to the current strawberry growth stage label. An environmental parameter prediction module, which is used to input the target environment parameter vector within the past period T1 into the pre-trained long short-term memory network to obtain the predicted environment parameter vector within the future period T2. A fuzzy control calculation module, which is used to obtain the multi-factor environment state vector at the current moment, calculate the deviation between the target environment parameter vector and the predicted environment parameter vector and the actual environment parameter vector respectively to obtain the first environment error term and the second environment error term; calculate the preliminary control instruction through the fuzzy control algorithm based on the first environment error term and the second environment error term. A reinforcement learning optimization module, which is used to introduce the Q-learning network to adaptively adjust the preliminary control instruction to obtain the optimized control instruction.
9. An intelligent greenhouse control device based on the Internet of Things, characterized in that, The intelligent greenhouse control device based on the Internet of Things includes: a memory, a processor, and an Internet-of-Things-based intelligent greenhouse control program stored on the memory and executable on the processor. When the Internet-of-Things-based intelligent greenhouse control program is executed by the processor, it implements an Internet-of-Things-based intelligent greenhouse control method according to any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes an Internet-of-Things-based intelligent greenhouse control program. When the Internet-of-Things-based intelligent greenhouse control program is executed by a processor, it implements an Internet-of-Things-based intelligent greenhouse control method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Intelligent strawberry planting method
CN107969297A
Strawberry greenhouse intelligent control system and greenhouse strawberry growth model construction method
CN111650976A
Internet of Things system
CN116368355A
Dual-mode communication signal identification method based on deep learning
CN119441987A
Strawberry yield prediction method, yield prediction program, and yield prediction device
JP2023034557A
Cited By
Meat pigeon growth environment intelligent regulation and control method and system based on Internet of Things
CN121613990A
Chenopodium quinoa cultivation method capable of regulating and controlling greenhouse environment
CN121616817A
Intelligent strawberry greenhouse multi-energy complementary energy supply system and energy management method
CN121749421A
Greenhouse environment intelligent regulation and control system based on Internet of Things
CN122151483A