Temperature control method for agricultural production greenhouse

By combining a distributed sensor array and an improved PID controller with adaptive gain, variable speed integral and noise suppression, along with a cattle herd optimization algorithm, the problems of regulation lag and low accuracy in greenhouse temperature control were solved, achieving fast and high-precision temperature regulation.

CN121957193APending Publication Date: 2026-05-01SHANDONG XINFENG SEED IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG XINFENG SEED IND CO LTD
Filing Date
2025-12-31
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing greenhouse temperature control methods, the parameters of PID controllers are fixed, resulting in lag in adjustment and weak anti-interference ability. Traditional algorithms have fixed cluster ratios, making it difficult to quickly search for optimal parameters, resulting in low control accuracy and failing to meet the precise temperature environment requirements for crop growth.

Method used

A distributed temperature sensor array is used to collect temperature data in real time. An improved PID controller is constructed, which combines adaptive nonlinear gain with environmental feedforward compensation, variable speed integral and adaptive noise suppression. An improved cattle herd optimization algorithm is used to optimize parameters to achieve dynamic adaptation and fast response.

Benefits of technology

It achieves rapid response and high-precision adjustment of temperature control, shortens adjustment time, reduces steady-state error, and meets the requirements of agricultural greenhouses for temperature stability and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121957193A_ABST
    Figure CN121957193A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of intelligent control, and particularly relates to a temperature control method for an agricultural production greenhouse. According to the method, the actual temperature of a greenhouse is collected, and a target temperature and a deviation threshold value are preset in the crop growth stage; an improved PID controller is constructed, and adaptive nonlinear proportional gain, a variable-speed integration strategy and a differential noise suppression and trend prediction mechanism are adopted to improve control suitability and anti-interference capability; through improving a cattle herd optimization algorithm, controller parameters are optimized through dynamic grouping, adaptive step length and a variation mechanism, and an optimal combination is quickly locked; and finally, real-time adaptive adjustment of the greenhouse temperature is realized, and a control result is ensured to be stabilized within a preset deviation threshold value. According to the method, the problems of fixed parameters, adjustment lag, large steady-state error and the like of an existing method are solved, and the precision, reliability and refinement level of temperature control in the agricultural production greenhouse are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent control technology, and in particular relates to a temperature control method for agricultural production greenhouses. Background Technology

[0002] Agricultural greenhouses, as core facilities for ensuring off-season crop growth and resisting harsh environments, rely heavily on temperature as a key environmental factor affecting crop photosynthesis, nutrient absorption, and growth cycles. Crops at different growth stages have strict and dynamic temperature requirements; therefore, precise and rapid temperature control directly determines crop yield and quality. With the development of smart agriculture technology, greenhouse temperature control has become an important direction for the intelligent upgrading of agricultural production. However, existing control methods still have significant shortcomings. Current greenhouse temperature control largely relies on conventional PID controllers, whose proportional, integral, and derivative coefficients are mostly fixed values. They cannot adaptively adjust according to the temperature inside the greenhouse. The integral stage is prone to saturation due to error accumulation, and the derivative stage has weak anti-interference capabilities, resulting in significant temperature regulation lag and long adjustment times. At the same time, traditional algorithms used to optimize controller parameters suffer from problems such as fixed cluster ratios and rigid step size settings, making it difficult to quickly find the optimal parameter combination. This leads to large steady-state errors and low control accuracy, failing to meet the refined temperature requirements for crop growth and seriously affecting the reliability and stability of temperature control. Summary of the Invention

[0003] In view of the technical problems existing in the above-mentioned background art, the present invention proposes a temperature control method for agricultural production greenhouses.

[0004] To achieve the above objectives, the technical solution adopted by the present invention includes the following steps:

[0005] S1. The actual temperature values ​​of different areas in the greenhouse are collected in real time through a distributed temperature sensor array, and the target temperature value and temperature deviation threshold are preset based on the crop growth stage.

[0006] S2. Construct an improved PID controller, employing an adaptive nonlinear gain and environmental feedforward compensation mechanism in the proportional element. The formula for calculating the proportional coefficient is as follows: ,in, The basic proportional coefficient, For environmental adaptability coefficient, This is the current temperature error. Forward compensation coefficient, Let be the rate of change of external temperature; a variable-speed integral strategy is adopted in the integral stage, and the formula for calculating the effective integral coefficient is: ,in, The basic integral coefficient, To determine the maximum permissible error, the differential term is enhanced using adaptive noise suppression and trend prediction, resulting in the differential term enhancement coefficient: ,in Here are the adaptive filter coefficients, and T is the sampling time. To predict the rate of change of error, the output of the improved PID controller is: ;

[0007] S3. The parameters of the constructed improved PID controller are optimized using the improved cattle herd optimization algorithm to obtain the optimal controller parameters;

[0008] S4. Adjust and control the greenhouse temperature in real time according to the preset target temperature value, and ensure that the control result is within the preset temperature allowable deviation threshold.

[0009] Preferably, the integral stage in step S2 adopts a variable-speed integral strategy. The variable speed integral function is implemented as follows: ,in, , This is the attenuation coefficient.

[0010] Preferably, the differential term in step S2 is enhanced by adaptive noise suppression and trend prediction. Adaptive filter coefficients The implementation is as follows: ,in, These are the maximum and minimum values ​​of the filter coefficients, respectively. Filter adaptation coefficient; prediction error rate of change The implementation is as follows: Where n is the prediction window length, To predict the weighting coefficients.

[0011] Preferably, the improved bovine herd optimization algorithm is used in step S3 to optimize the parameters of the constructed improved PID controller to obtain the optimal controller parameters. The specific implementation of this method is as follows:

[0012] S31. Using the weighted sum of the temperature control adjustment time and steady-state error as the objective function, and the reciprocal of the objective function as the fitness function, select the set of parameters that maximizes the fitness function.

[0013] S32. Perform pre-iteration initialization, initialize and set the population size, set the maximum number of iterations, initialize the global best individual, and initialize the individual stall counter.

[0014] S33. Calculate the dispersion of the current population fitness, where the dispersion is the ratio of the standard deviation of the population fitness to the mean fitness. Adjust the grouping ratio in the optimization algorithm according to the dispersion to obtain the proportion of leader cattle, follower cattle and wandering cattle in the population.

[0015] S34. Design a multi-strategy adaptive step size, combining the leader's step size with the globally optimal gradient calculation: ,in, Let g be the step size of the leading cow in the g-th iteration. Set the maximum value for the step size. The fitness value corresponding to the lead cow. This represents the fitness value corresponding to the globally optimal individual. These are the maximum and minimum fitness values ​​for all individuals in the current population, used to normalize the fitness difference. The maximum number of iterations; calculation of the fitness difference between the following cow's step size and the leader cow: ,in, The fitness value corresponds to the following cattle; the stride length remains unchanged for wandering cattle.

[0016] S35. Perform iterative optimization, updating the leading stock: Where g is the number of iterations; rand is a random number function; for following the cow update: For the update on Wandering Cow: ;

[0017] S36. For each individual, if the individual's stall counter is greater than or equal to 2, then mutation is triggered: Where j represents the index of the individual, The coefficient of variation;

[0018] S37. After each iteration, the current global best individual is retained and not updated. The next iteration is directly entered. When the number of iterations reaches the set maximum number of iterations or the change in global best fitness over three consecutive generations is less than the set threshold, the iteration stops and the parameter set corresponding to the global best individual is output.

[0019] Preferably, the specific implementation of adjusting the grouping ratio in the optimization algorithm according to the degree of dispersion in step S33 to obtain the ratio of leader cattle, follower cattle, and roaming cattle in the population is as follows: , , Where CV is the coefficient of variation. The proportions of lead cattle, follower cattle, and wandering cattle are respectively.

[0020] Compared with existing technologies, the advantages and positive effects of this invention lie in its synergistic upgrade of the PID control mechanism and optimization algorithm to address problems such as fixed temperature control parameters, lag in adjustment, weak anti-interference, and inefficient optimization in existing greenhouse temperature control systems. It utilizes distributed sensors to accurately collect temperatures from multiple regions, combined with dynamically preset target parameters based on crop growth stages. The improved PID controller achieves dynamic adaptation and enhanced anti-interference through adaptive proportional gain, variable integral speed, differential noise suppression, and trend prediction. The improved herd optimization algorithm, with dynamic grouping, adaptive step size, and mutation mechanism, quickly locks in the optimal parameters. Ultimately, this significantly shortens the adjustment time, reduces steady-state error, and stabilizes temperature control within the preset threshold, meeting the practical requirements of agricultural greenhouses for temperature stability and accuracy. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart illustrating a temperature control method for agricultural greenhouses. Detailed Implementation

[0023] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0024] Numerous specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways than those described herein, and therefore the invention is not limited to the specific embodiments disclosed in the following specification.

[0025] In this embodiment, considering the problems of fixed control parameters, adjustment lag, large steady-state error, and poor adaptability to crop growth stages in existing greenhouse temperature control methods, a temperature control method for agricultural production greenhouses is proposed. This method achieves adaptive adjustment of temperature control parameters by real-time sensing of the temperature within the greenhouse, dynamically setting target temperatures based on the crop growth stage, and utilizing an improved PID controller and optimization algorithm in synergy. The implementation process is as follows: Figure 1 As shown.

[0026] First, the actual temperature values ​​of different areas inside the greenhouse are collected in real time through a distributed temperature sensor array, and the target temperature value and allowable temperature deviation threshold are preset based on the crop growth stage.

[0027] To achieve rapid response when temperature deviations are large and stable adjustment when deviations are small, and to address the overshoot or slow response issues caused by the fixed gain of the proportional element in traditional PID controllers, an improved PID controller is constructed by combining adaptive nonlinear proportional gain with environmental feedforward compensation. Specifically, the proportional gain is dynamically adjusted based on the deviation between the actual greenhouse temperature and the target temperature, allowing the proportional gain to change with the temperature error. Simultaneously, the rate of change of the external ambient temperature is introduced as a feedforward compensation term to pre-correct the control output when the external temperature changes rapidly, thereby reducing the impact of external disturbances on the greenhouse's internal temperature. The proportional element employs an adaptive nonlinear gain and environmental feedforward compensation mechanism, and its proportional gain calculation formula is as follows: ,in, The basic proportional coefficient, For environmental adaptability coefficient, This is the current temperature error. Forward compensation coefficient, This represents the rate of change of the external temperature.

[0028] To eliminate steady-state error while avoiding integral saturation, and to address the overshoot problem inherent in traditional integral control during large error phases, a variable-speed integral strategy is employed. Specifically, when the temperature error is large, the integral action is reduced or even suspended to prevent excessive integral accumulation; as the temperature error gradually decreases, the integral action is gradually increased to eliminate the steady-state error. This approach enables the system to possess both rapid adjustment capability and high-precision control in the steady-state phase. The effective integral coefficient of the variable-speed integral strategy is calculated using the following formula: ,in, The basic integral coefficient, This represents the maximum permissible error. The variable speed integral function is implemented as follows: ,in, , This is the attenuation coefficient.

[0029] To enhance the system's ability to judge temperature change trends and address the issue of noise amplification in traditional differential terms, a differential enhancement scheme combining adaptive noise suppression and trend prediction is adopted. Specifically, the temperature change signal is adaptively filtered, with the filter coefficients dynamically adjusted based on noise intensity. Simultaneously, trend prediction is performed based on historical temperature change sequences to enhance the differential term, enabling the controller to respond appropriately in the early stages of temperature changes, thereby reducing the risk of system oscillation. The differential term enhancement coefficient is obtained by using adaptive noise suppression and trend prediction to enhance the differential term. ,in Here are the adaptive filter coefficients, and T is the sampling time. The rate of change of prediction error, where the adaptive filter coefficients are... The implementation is as follows: ,in, These are the maximum and minimum values ​​of the filter coefficients, respectively. Filter adaptation coefficient; prediction error rate of change The implementation is as follows: Where n is the prediction window length, To predict the weighting coefficients.

[0030] The output of the improved PID controller is: .in, To control the output.

[0031] To quickly obtain the optimal PID control parameter combination under complex nonlinear environments and address the issues of traditional parameter tuning methods relying on experience and having slow convergence speeds, an improved bovine herd optimization algorithm is used to optimize the parameters of the constructed improved PID controller, yielding the optimal controller parameters. This is implemented by using the parameters in the PID controller as optimization variables, including the basic proportional coefficient, basic integral coefficient, basic derivative coefficient, environmental fitness coefficient, feedforward compensation coefficient, and filter fitness coefficient. An optimization model is constructed with the weighted sum of temperature settling time and steady-state error as the objective function, and the reciprocal of the objective function is used as the fitness function. By initializing individual bovine individuals, dynamically grouping them, setting adaptive step sizes, and introducing a mutation mechanism, the algorithm balances global exploration and local convergence capabilities during the search process, ultimately outputting the parameter combination with the highest fitness as the optimal control parameters.

[0032] Specifically, the objective function is the weighted sum of the settling time and steady-state error for temperature control, and the fitness function is the reciprocal of the objective function. The set of parameters that maximizes the fitness function is selected. Based on the dynamic response curve of the temperature control process, the settling time required for the system to reach the target temperature and the steady-state error between the system's stable temperature and the target temperature are extracted. To balance control response speed and control accuracy, the settling time and steady-state error are weighted and summed according to pre-set weighting coefficients to obtain the objective function value used to measure control performance. These weighting coefficients are set based on actual production requirements. Subsequently, the reciprocal of the objective function is defined as the fitness function, such that the parameter combination with shorter settling time and smaller steady-state error corresponds to a larger fitness value.

[0033] Before iteration, initialization is performed, including setting the population size, maximum number of iterations, the global best individual, and individual stagnation counters. The initial population size is determined based on the control parameter dimensions and search space size, ensuring the initial population covers the widest possible range of parameter combinations. Subsequently, the maximum number of iterations is set to limit the algorithm's execution and prevent wasted computational resources from ineffective iterations. During initialization, the individual with the highest fitness in the population is recorded as the initial global best individual, and its corresponding parameter combination is stored as a benchmark for subsequent comparisons. Simultaneously, a stagnation counter is assigned to each individual to record the number of times its fitness has not improved during consecutive iterations; initially, all individuals' stagnation counters are reset to zero.

[0034] The dispersion of the current population fitness is calculated, where dispersion is the ratio of the standard deviation of the population fitness to the mean fitness. The grouping ratio in the optimization algorithm is adjusted according to the dispersion to obtain the proportion of leader cattle, follower cattle, and roaming cattle in the population. The specific implementation of adjusting the grouping ratio in the optimization algorithm according to the dispersion to obtain the proportion of leader cattle, follower cattle, and roaming cattle in the population is as follows: , , Where CV is the coefficient of variation. The proportions of lead cows, follower cows, and wandering cows are defined. The initial population size is set based on the control parameter dimensions and search space size to ensure the initial population covers the widest possible range of parameter combinations. Subsequently, a maximum number of iterations is set to limit the upper limit of the algorithm's execution and prevent wasted computational resources due to invalid iterations. During the initialization phase, the individual with the highest fitness in the population is recorded as the initial global optimum, and its corresponding parameter combination is stored as a benchmark for subsequent comparisons. Simultaneously, a stagnation counter is assigned to each individual to record the number of times the individual's fitness has not improved during continuous iterations; initially, all individuals' stagnation counters are reset to zero.

[0035] Design a multi-strategy adaptive step size, combining the leader cow step size with the globally optimal gradient calculation: ,in, Let g be the step size of the leading cow in the g-th iteration. Set the maximum value for the step size. The fitness value corresponding to the lead cow. This represents the fitness value corresponding to the globally optimal individual. These are the maximum and minimum fitness values ​​for all individuals in the current population, used to normalize the fitness difference. The maximum number of iterations; calculation of the fitness difference between the following cow's step size and the leader cow: ,in, The fitness value corresponds to the following cow; the step size remains unchanged for wandering cows. For the leader cow, its step size is dynamically adjusted considering the difference between its current fitness and the global optimal fitness, combined with the current iteration progress. This allows it to have a larger search step size in the early stages of iteration and gradually decrease the step size in the later stages to finely approach the optimal solution. For the following cows, their step size is mainly adjusted based on the difference between their own fitness and the leader cow's fitness. When the difference is large, the step size is increased to quickly approach the dominant area; when the difference is small, the step size is decreased to avoid oscillations. For wandering cows, a relatively fixed step size is maintained, allowing them to explore randomly within the parameter space to escape local optima. Through multi-strategy adaptive step size design, different roles of individuals undertake differentiated search tasks in the same iteration.

[0036] Iterative optimization is performed, with updates made to the leading stock: Where g is the number of iterations; rand is a random number function; for following the cow update: For the update on Wandering Cow: ;in, These are the leader cow, follower cow, and wandering cow individuals in generation g. After determining the step size for each type of individual, the specific iterative update phase begins. For the leader cow, parameters are updated based on its current parameter position, incorporating an adaptive step size and a random perturbation factor, guiding it to move in directions that could improve fitness, thus guiding the entire population towards a better solution region. For follower cows, parameter updates are referenced to the leader cow's current position, moving towards the leader cow while maintaining a certain degree of randomness, achieving the inheritance and diffusion of advantageous parameters. For wandering cows, random walk updates are performed near their current parameters, unconstrained by the leader cow, to maintain overall population diversity. By employing differentiated update methods for the three types of individuals, the optimization process simultaneously possesses guiding, following, and exploratory characteristics, improving overall optimization efficiency.

[0037] For each individual, if the individual's stall counter is greater than or equal to 2, then mutation is triggered: Where j represents the index of the individual, The coefficient of variation is used. After each iteration, the fitness change of each individual in the population is checked. If the fitness of an individual does not improve during continuous iterations, its stagnation counter is incremented. When the stagnation counter reaches a preset threshold (e.g., greater than or equal to 2), the individual is considered to be trapped in a local optimum, thus triggering a mutation operation. The mutation operation involves introducing a random perturbation of a certain magnitude into the individual's parameter vector. The perturbation magnitude is controlled by the coefficient of variation to ensure that the mutation can escape the local optimum without compromising the overall search stability. After mutation, the individual's stagnation counter is reset. By introducing an adaptive mutation mechanism based on stagnation detection, premature convergence of the population can be effectively avoided.

[0038] After each iteration, the current global best individual is retained and not updated, and the process proceeds directly to the next iteration. The iteration stops when the maximum number of iterations is reached or the change in global best fitness over three consecutive generations is less than a set threshold, and the parameter set corresponding to the global best individual is output.

[0039] Finally, the greenhouse temperature is adjusted and controlled in real time according to the preset target temperature value, ensuring that the control result remains within the preset temperature deviation threshold. After optimizing the control parameters and obtaining the optimal PID control parameter combination, these parameters are loaded into the greenhouse temperature controller to guide real-time adjustments during actual operation. The control system uses the preset target temperature value as the control benchmark to control the temperature, meeting the actual requirements of agricultural greenhouses for temperature stability and accuracy.

[0040] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments for application in other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A temperature control method for agricultural greenhouses, characterized in that, Includes the following steps: S1. The actual temperature values ​​of different areas in the greenhouse are collected in real time through a distributed temperature sensor array, and the target temperature value and temperature deviation threshold are preset based on the crop growth stage. S2. Construct an improved PID controller, employing an adaptive nonlinear gain and environmental feedforward compensation mechanism in the proportional element. The formula for calculating the proportional coefficient is as follows: ,in, The basic proportional coefficient, For environmental adaptability coefficient, This is the current temperature error. Forward compensation coefficient, Let be the rate of change of external temperature; a variable-speed integral strategy is adopted in the integral stage, and the formula for calculating the effective integral coefficient is: ,in, The basic integral coefficient, To determine the maximum permissible error, the differential term is enhanced using adaptive noise suppression and trend prediction, resulting in the differential term enhancement coefficient: ,in Here are the adaptive filter coefficients, and T is the sampling time. To predict the rate of change of error, the output of the improved PID controller is: ; S3. The parameters of the constructed improved PID controller are optimized using the improved cattle herd optimization algorithm to obtain the optimal controller parameters; S4. Adjust and control the greenhouse temperature in real time according to the preset target temperature value, and ensure that the control result is within the preset temperature allowable deviation threshold.

2. The temperature control method for agricultural greenhouses according to claim 1, characterized in that, In step S2, the integral stage employs a variable-speed integral strategy. The variable speed integral function is implemented as follows: ,in, , This is the attenuation coefficient.

3. The temperature control method for agricultural greenhouses according to claim 1, characterized in that, In step S2, the differential term is enhanced using adaptive noise suppression and trend prediction. Adaptive filter coefficients The implementation is as follows: ,in, These are the maximum and minimum values ​​of the filter coefficients, respectively. Filter adaptation coefficient; prediction error rate of change The implementation is as follows: Where n is the prediction window length, To predict the weighting coefficients.

4. The temperature control method for agricultural production greenhouses according to claim 1, characterized in that, In step S3, the improved bovine herd optimization algorithm is used to optimize the parameters of the constructed improved PID controller to obtain the optimal controller parameters. The specific implementation is as follows: S31. Using the weighted sum of the temperature control adjustment time and steady-state error as the objective function, and the reciprocal of the objective function as the fitness function, select the set of parameters that maximizes the fitness function. S32. Perform pre-iteration initialization, initialize and set the population size, set the maximum number of iterations, initialize the global best individual, and initialize the individual stall counter. S33. Calculate the dispersion of the current population fitness, where the dispersion is the ratio of the standard deviation of the population fitness to the mean fitness. Adjust the grouping ratio in the optimization algorithm according to the dispersion to obtain the proportion of leader cattle, follower cattle and wandering cattle in the population. S34. Design a multi-strategy adaptive step size, combining the leader's step size with the globally optimal gradient calculation: ,in, Let g be the step size of the leading cow in the g-th iteration. Set the maximum value for the step size. The fitness value corresponding to the lead cow. This represents the fitness value corresponding to the globally optimal individual. These are the maximum and minimum fitness values ​​for all individuals in the current population, used to normalize the fitness difference. The maximum number of iterations; calculation of the fitness difference between the following cow's step size and the leader cow: ,in, The fitness value corresponds to the following cattle; the stride length remains unchanged for wandering cattle. S35. Perform iterative optimization, updating the leading stock: Where g is the number of iterations; rand is a random number function; for following the cow update: For the update on Wandering Cow: ;in, These are the lead cow, follower cow, and wandering cow individuals of the g-th generation; S36. For each individual, if the individual's stall counter is greater than or equal to 2, then mutation is triggered: Where j represents the index of the individual, The coefficient of variation; S37. After each iteration, the current global best individual is retained and not updated. The next iteration is directly entered. When the number of iterations reaches the set maximum number of iterations or the change in global best fitness over three consecutive generations is less than the set threshold, the iteration stops and the parameter set corresponding to the global best individual is output.

5. The temperature control method for agricultural greenhouses according to claim 1, characterized in that, In step S33, adjusting the grouping ratio in the optimization algorithm according to the degree of dispersion to obtain the specific implementation of the ratio of leader cattle, follower cattle, and roaming cattle in the population is as follows: , , Where CV is the coefficient of variation. The proportions of lead cattle, follower cattle, and wandering cattle are respectively.