A method for predicting and regulating a winter breeding environment of a poultry house
By combining STL decomposition and Granger causality test with LSTM and XGBoost models for winter environmental prediction and control in poultry houses, the air quality problem caused by single temperature control in existing technologies is solved. This achieves synergistic prediction and dynamic control of temperature and carbon dioxide, ensuring the stability and comfort of the poultry house environment.
Patent Information
- Application Number
- CN202411677737.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Existing technologies for winter environmental control in poultry houses rely solely on temperature as the control standard, resulting in unsuitable air quality inside the house. Furthermore, the sensors and equipment control exhibit lag, failing to guarantee the timeliness and stability of the environment.
We employ STL decomposition and Granger causality test combined with LSTM and XGBoost models for coordinated prediction of temperature and carbon dioxide. By optimizing PID parameters through PID control and genetic algorithm, we formulate a linkage control strategy for winter and summer to achieve dynamic regulation of temperature and carbon dioxide.
It achieves timely response and high-precision control at low cost and within minutes, avoiding excessive operation of ventilation equipment and ensuring the stability and comfort of the indoor environment.
Smart Images

Figure CN119620808B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of poultry breeding, in particular to a poultry house winter breeding environment prediction and regulation method. BACKGROUND
[0002] Modern poultry breeding tends to be large-scale and intensive, and most of them are raised in sheds. When the breeding environment is suitable, the morbidity of poultry is low, the feed intake and feed utilization are significantly improved, and the production performance of poultry is better. However, when the environment changes significantly, it may cause stress reaction of poultry, destroy the body heat balance, and lead to decline of production performance or even death. Therefore, in the process of intensive poultry breeding, it is necessary to monitor important environmental indicators in the poultry house. The environmental precision regulation system is an important part of maintaining a good breeding environment in the shed. It mainly collects environmental information through sensors distributed in the poultry house, and then controls the corresponding environmental control equipment through environmental control strategies, so that the environment in the sensor site area of the shed is maintained at the set threshold. To alleviate the cold and heat stress of poultry, improve the air quality in the shed, and control the light intensity, etc., large-scale farms often use wet curtains, fans, ventilation windows and heating equipment for joint regulation, and support intelligent environmental control systems to create a comfortable indoor environment for poultry.
[0003] At present, many studies mainly focus on the research of shed temperature regulation technology. The main reason is that the temperature in the shed is the main factor affecting the comfort of chickens. However, if only temperature is used as the regulation standard in winter, due to the reduction of ventilation, the air quality in the shed cannot reach the appropriate state, which will also affect the production and health of poultry. In winter, temperature and carbon dioxide are coupled, and how to complete the coordination and trade-off of the two in winter is very important. In addition, due to the time lag of the sensor and equipment control in the environmental regulation system, it is difficult to ensure the timeliness and stability of the environmental regulation in the poultry house. The current prediction is mainly based on hourly prediction, but in actual regulation, shorter prediction time and prediction accuracy are needed to ensure the indoor environment.
[0004] Through retrieval, patent No. CN117032361A discloses a chicken house environment control method, system, device, medium, patent No. CN116740805A discloses a chicken house environment control method and system, and patent No. CN115220501A discloses an environmental control method fusing SSA-Elman network model and pigeon swarm heuristic algorithm. The above-mentioned patents mainly focus on the regulation of the temperature in the shed, and do not consider the carbon dioxide index. However, high concentration of carbon dioxide in winter will affect the health of chickens. In addition, the above-mentioned patents aim to obtain feedback from the temperature sensor before control, but there will be a problem of control lag, which will lead to the fact that the indoor environment cannot always be in a comfortable state. SUMMARY
[0005] The present application aims to provide a poultry house winter breeding environment prediction and regulation method, which studies the poultry house winter environment regulation method from the aspects of environmental prediction ability, prediction time, prediction cost, temperature and carbon dioxide synergy, aims to predict the temperature and carbon dioxide value in advance, thereby performing advance regulation, can ensure that the environment of the chicken house is always in the set state interval, so as to solve the problems of the prior art.
[0006] In order to achieve the above-mentioned purpose, the present application provides the following technical scheme:
[0007] A poultry house winter breeding environment prediction and regulation method, comprising the following steps:
[0008] S1: obtaining the temperature, humidity, carbon dioxide, wind speed, ammonia data, outside temperature data and environmental control equipment running state data in the poultry house, and performing data cleaning and normalization on the obtained various data;
[0009] S2: performing STL decomposition on the temperature and carbon dioxide data to obtain trend component, seasonal component and residual component;
[0010] S3: performing Granger causality test and analysis on the other environmental data and temperature, carbon dioxide through Granger causality test, finding the causal characteristics of temperature and carbon dioxide as the input information of prediction, and obtaining the optimal lag order;
[0011] S4: using the obtained causal characteristics of temperature and carbon dioxide as input, using LSTM to predict the trend component, seasonal component and residual component of temperature and carbon dioxide at the next time step respectively, and using MSE as the loss function;
[0012] S5: using the obtained trend component, seasonal component and residual component at the next time step as input, using XGBoost to perform final prediction on the temperature and carbon dioxide data, obtaining the predicted temperature T pred (t) and the predicted carbon dioxide concentration C pred (t);
[0013] S6: the environmental regulation sets the target temperature T set and the maximum allowed carbon dioxide concentration C max , wherein T set is the ideal temperature of the livestock and poultry house environment, and C max is the upper limit that the carbon dioxide concentration in the livestock and poultry house cannot exceed;
[0014] S7: comparing the predicted temperature T pred (t) with the temperature set value T set to obtain the temperature error: e T (t)=T set -T pred(t), the PID control output is where K PT , K iT and K dT are the proportional, integral and differential coefficients of temperature control respectively;
[0015] S8: The predicted carbon dioxide concentration C pred (t) and the maximum value of carbon dioxide C max Comparison to obtain carbon dioxide error: e CO2 (t) = C max -C pred (t), the PID control output is where K Pco2 , K iCO2 and K dCO2 are the proportional, integral, and differential coefficients of CO2 control, respectively;
[0016] S9: Set linkage control strategies for different temperatures and CO2 concentrations in winter and summer to adapt to the indoor environmental requirements;
[0017] S10: Setting an optimization objective function to minimize the control errors of temperature and carbon dioxide concentration, so as to balance the control of temperature and carbon dioxide so that the actual temperature and carbon dioxide concentration are closer to the set values;
[0018] S11: Use genetic algorithm to solve the S10 objective function and obtain the optimal control parameters.
[0019] Furthermore, the setting method of the linkage control strategy in S9 is as follows:
[0020] If T pred (t) <T set And C pred (t)>C max , turn on the heater in advance and reduce ventilation. When the temperature approaches the target value, gradually increase the ventilation;
[0021] If T pred (t)∈[T set -0.5, T set -0.5] and C pred (t)<C max , then maintain the current control measures;
[0022] If T pred (t)>T set And C pred (t)>C max ax, then increase ventilation first to reduce carbon dioxide concentration;
[0023] If T pred (t)∈[Tset -0.5, T set -0.5] and C pred (t) < C max then maintain the current control measures;
[0024] If T pred (t) ∈ [T set -0.5, T set -0.5] and C pred (t) > C max then gradually increase ventilation until T pred (t+1) < C max , ensuring that temperature and carbon dioxide are in the appropriate state at the next time step.
[0025] Further, the optimization objective function set in S10 is as follows:
[0026] where α and β are weight parameters for balancing the priority of temperature and carbon dioxide control, α controls the influence of temperature error in the total objective, and β controls the influence of carbon dioxide concentration error in the total objective; represents the average relative error of actual temperature and set temperature within time T, represents the average relative error of actual carbon dioxide concentration and set concentration within time T.
[0027] Further, the solving process of the objective function in S11 is as follows:
[0028] S110: First, randomly generate a set of initial PID parameter sets, an initial population containing multiple individuals, each individual representing a set of PID parameters x = [K PT , K iT , K dT , K PCO2 , K iCO2 , K dco2 ];
[0029] S111: Calculate the fitness value of each individual using the objective function:
[0030]
[0031] S112: Randomly select a certain number of individuals, select the individual with the best fitness, then exchange parameters between the selected individual and a randomly selected point, and randomly adjust the PID parameters of the newly generated individual;
[0032] S113: replace the worst individual in the original population with this newly generated individual, if the maximum number of iterations is reached and the change in fitness value is less than a threshold, terminate the genetic algorithm, finally select the individual with the best fitness value in the new population as the optimization result, obtain a new x=[K PT , K iT , K dT , K PCO2 , K iCO2 , K dCO2 ].
[0033] Further, the environment control equipment in S1 includes a wet curtain, a fan, a ventilation window and a heating device.
[0034] Compared with the prior art, the present application has the following beneficial effects:
[0035] 1. The poultry house winter breeding environment prediction and regulation method of the present application studies the chicken house winter environment regulation method from the aspects of environmental prediction ability, prediction time, prediction cost, temperature and synergistic effect of carbon dioxide, formulates a winter and summer combined control strategy, and maximizes the optimal state of the two, thereby effectively avoiding the problem of temperature drop caused by excessive operation of the ventilation equipment.
[0036] 2. The poultry house winter breeding environment prediction and regulation method of the present application minimizes the control error of temperature and carbon dioxide concentration by setting an optimization objective function, and solves it in cooperation with a genetic algorithm to obtain optimal regulation parameters, which can dynamically optimize the PID parameter adjustment, realize double-target optimization, generate a set of more adaptive PID parameters, and finally automatically select the control scheme most suitable for the current environment, so that the prediction function can be completed at a low cost and in minutes, and the purposes of timely response and generalization can be achieved, thereby creating an intelligent in-house environment with timely response and high-precision regulation for poultry. BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 is a component diagram of carbon dioxide after decomposition by STL in the case of the present application;
[0038] Figure 2 is a causal feature diagram obtained by causal inspection in the case of the present application;
[0039] Figure 3 is a comparison diagram of predicted value and actual value of STL-GC-LSTM-XGBoost in the case of the present application;
[0040] Figure 4 is a flowchart of the prediction method of the present application;
[0041] Figure 5 is an environment control flowchart of the present application. DETAILED DESCRIPTION
[0042] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0043] Please refer to Figures 4-5 The embodiment of the present application provides a poultry house winter breeding environment prediction and regulation method, comprising the following steps:
[0044] S1: Obtain the temperature, humidity, carbon dioxide, wind speed, ammonia data, outdoor temperature data and running state data of the environmental control equipment (fan, wet curtain, ventilation window, heater) in the poultry house, and perform data cleaning and normalization on the obtained various data;
[0045] S2: Perform STL decomposition on the temperature and carbon dioxide data to obtain trend component, seasonal component and residual component, which can reduce data noise, extract useful trends and increase prediction ability;
[0046] S3: Perform Granger causality test and analysis on other environmental data and temperature and carbon dioxide through Granger causality test, find the causal characteristics of temperature and carbon dioxide as input information for prediction, and obtain the optimal lag order at the same time; Unlike existing correlation analysis methods, Granger causality test can obtain the causal characteristics of temperature and carbon dioxide, rather than the mutual relationship;
[0047] S4: Use the obtained causal characteristics of temperature and carbon dioxide as input to use LSTM to predict the trend component, seasonal component and residual component of temperature and carbon dioxide at the next time step, respectively, and use MSE as the loss function;
[0048] S5: Use the obtained trend component, seasonal component and residual component at the next time step as input to use XGBoost to finally predict the temperature and carbon dioxide data, and obtain the predicted temperature T pred (t) and the predicted carbon dioxide concentration C pred (t); This step is to reduce the influence of residual in the case of large amount of data, thereby increasing the prediction ability. The prediction process can complete the prediction function within 2 minutes at low cost, and can achieve the purposes of timely response and generalization;
[0049] S6: The environmental regulation sets the target temperature T set and the maximum allowed carbon dioxide concentration C max , wherein T set is the ideal temperature of the livestock and poultry house environment, and Cmax It is the upper limit of carbon dioxide concentration in livestock and poultry houses;
[0050] S7: The predicted temperature T pred (t) and temperature setting value T set Comparison to obtain the temperature error: e T (t) = T set -T pred (t), the PID control output is where K PT , K iT and K dT are the proportional, integral and differential coefficients of temperature control respectively;
[0051] S8: The predicted carbon dioxide concentration C pred (t) and the maximum value of carbon dioxide C max Comparison to obtain carbon dioxide error: e CO2 (t) = C max -C pred (t), the PID control output is where K Pco2 , K iCO2 and K dCO2 are the proportional, integral, and differential coefficients of CO2 control, respectively;
[0052] S9: Set a linkage control strategy for the different temperatures and carbon dioxide concentrations in winter and summer to adapt to the needs of the indoor environment. In this step, due to the differences between winter and summer, the main factor in summer is temperature. In order to reduce the temperature, the ventilation volume is increased, so the carbon dioxide is usually within a safe range. However, in winter, due to the lower temperature outside the house, the ventilation volume is often reduced to achieve a suitable temperature inside the house, resulting in a higher carbon dioxide concentration. Therefore, a joint control strategy is needed to maximize the optimal state of the two. Specifically, the linkage control strategy is:
[0053] If T pred (t)<T set And C pred (t)>C max , turn on the heater in advance and reduce ventilation. When the temperature approaches the target value, gradually increase the ventilation;
[0054] If T pred (t)∈[T set -0.5, T set -0.5] and C pred (t)<C max , then maintain the current control measures;
[0055] If T pred (t)>T setand C pred (t) > C max then increase ventilation first to decrease carbon dioxide concentration;
[0056] if T pred (t) ∈ [T set -0.5, T set -0.5] and C pred (t) < C max then maintain current control measures;
[0057] if T pred (t) ∈ [T set -0.5, T set -0.5] and C pred (t) > C max then increase ventilation gradually until T pred (t+1) < C max , ensuring that temperature and carbon dioxide are in a suitable state at the next time step, which can avoid overrunning of ventilation equipment leading to temperature drop.
[0058] S10: set an optimization objective function to minimize the control error of temperature and carbon dioxide concentration, for balancing the control of temperature and carbon dioxide, so that the actual temperature and carbon dioxide concentration are closer to the set value; specifically, in order to make the actual temperature and carbon dioxide concentration closer to the set value, set an optimization objective function to minimize the control error of temperature and carbon dioxide concentration: wherein α and β are weight parameters, for balancing the priority of temperature and carbon dioxide control, α controls the influence of temperature error in the total target, and β controls the influence of carbon dioxide concentration error in the total target, represents the average relative error of actual temperature and set temperature within time T, represents the average relative error of actual carbon dioxide concentration and set concentration within time T; in this step, through minimization of the objective function, the control of temperature and carbon dioxide can be balanced, and the set value can be approached as much as possible;
[0059] S11: use a genetic algorithm to solve the S10 objective function to obtain optimal regulation and control parameters; specifically:
[0060] first, randomly generate a set of initial PID parameter sets, an initial population containing multiple individuals, each individual representing a set of PID parameters x = [K PT , K iT , K dT , K PCO2 , K iCO2 , K dCO2 ];
[0061] The fitness value of each individual is calculated again using the target function:
[0062]
[0063] A certain number of individuals are randomly selected again, the individual with the best fitness is selected, then the selected individual and a randomly selected point are exchanged parameters, and the newly generated individual is randomly adjusted PID parameters to avoid falling into a local optimal solution; then the newly generated individual replaces the worst individual in the original population, if the maximum number of iterations and the change of fitness value is less than the threshold value, the genetic algorithm is terminated, the individual with the best fitness in the new population is finally selected as the optimization result, and new x = [K PT , K iT , K dT , K PCO2 , K iCO2 , K dCO2 ] is obtained.
[0064] In order to further better explain the above embodiment, the application also provides the following specific cases:
[0065] As shown in Figures 1-3 , the environmental temperature and carbon dioxide prediction and control in a certain scale chicken coop in Shandong are analyzed: the time interval is 10 minutes, and the components of carbon dioxide after STL decomposition are as shown in Figure 1 . The causal characteristics obtained by causal test are as shown in Figure 2 , the predicted value and the actual value of STL-GC-LSTM-XGBoost in the case are as shown in Figure 3 , the MAE is 11.82, the RMSE is 15.9, the MAPE is 0.55%, the prediction ability is good, and the prediction time is 86s, which meets the condition of 10 minutes.
[0066] In summary: the poultry house winter breeding environment prediction and control method provided by the application studies the chicken coop winter environment control method from the aspects of environmental prediction ability, prediction time, prediction cost, temperature and carbon dioxide synergistic effect, formulates a winter and summer joint control strategy, so that the two achieve the optimal state to the greatest extent, and effectively avoid the problem of temperature drop caused by excessive operation of the ventilation equipment. In addition, the application minimizes the control error of temperature and carbon dioxide concentration by setting an optimization target function, and solves it by cooperating with a genetic algorithm, so as to obtain optimal control parameters, dynamically optimize PID parameter adjustment, realize double-target optimization, generate a group of more adaptive PID parameters, and finally automatically select the most suitable control scheme for the current environment, so as to complete the prediction function in minutes at low cost, achieve the purpose of timely response and generalization, and create a timely response, high-precision control intelligent in-house environment for poultry.
[0067] The above description is only the preferred embodiment of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can make equivalent replacements or changes according to the technical solution and the inventive concept of the present application within the technical range disclosed by the present application, which should be covered in the protection scope of the present application.
Claims
1. A method for predicting and regulating a winter breeding environment in a poultry house, characterized in that, The method comprises the following steps: S1: Obtain the temperature, humidity, carbon dioxide, wind speed, ammonia data, outdoor temperature data and environmental control equipment running state data in the poultry house, and perform data cleaning and normalization on the obtained various data; S2: Perform STL decomposition on the temperature and carbon dioxide data to obtain trend component, seasonal component and residual component; S3: Perform Granger causality test and analysis on the other environmental data and the temperature and carbon dioxide, find the causality characteristics of the temperature and carbon dioxide, use the causality characteristics as input information for prediction, and obtain the optimal lag order; S4: Use the obtained causality characteristics of the temperature and carbon dioxide as input to use LSTM to respectively predict the trend component, seasonal component and residual component of the temperature and carbon dioxide at the next time step, and use MSE as the loss function; S5: using XGBoost to make final prediction on temperature and carbon dioxide data with the obtained trend component, seasonal component and residual component of next time step as input, to obtain predicted temperature and carbon dioxide prediction concentration ; S6: The environmental control sets the target temperature according to the needs of the farm and the maximum allowed carbon dioxide concentration wherein is the ideal temperature of the livestock and poultry house environment, is the upper limit that the carbon dioxide concentration in the livestock and poultry house cannot exceed; S7: compare the predicted temperature with the temperature setpoint to obtain a temperature error: , and the PID control output is where , and are the proportional, integral, and derivative coefficients of the temperature control, respectively. S8: The predicted carbon dioxide concentration is compared with the maximum carbon dioxide value to obtain the carbon dioxide error: , and the PID control output is , where , and are the proportional, integral and derivative coefficients of the carbon dioxide control, respectively. S9: Set a linkage control strategy for different temperature and carbon dioxide concentrations in winter and summer to adapt to the environmental requirements in the house; the setting method of the linkage control strategy is as follows: If and , the heater is turned on in advance, and the ventilation is reduced, and when the temperature approaches the target value, the ventilation is gradually increased. If and then maintain current control measures; If and then first increase ventilation to decrease carbon dioxide concentration; If and then increase ventilation stepwise until ensuring that temperature and carbon dioxide are in suitable conditions at the next time step. S10: Set the optimization objective function to minimize the control error of temperature and carbon dioxide concentration, for balancing the control of temperature and carbon dioxide, so that the actual temperature and carbon dioxide concentration are closer to the set value; the optimization objective function set is as follows: wherein and are weight parameters for balancing the priority of temperature and carbon dioxide control, the influence of the control error of temperature in the total target, the influence of the control error of carbon dioxide concentration in the total target; represents the average relative error of the actual temperature and the set temperature within time T, represents the average relative error of the actual carbon dioxide concentration and the set concentration within time T; S11: Use a genetic algorithm to solve the objective function of S10 to obtain the optimal control parameters.
2. A method of predicting and regulating a winter-time aviculture environment in an aviary as claimed in claim 1, characterized in that: The solving process of the objective function in S11 is as follows: S110: First, a set of initial PID parameter sets is randomly generated, an initial population containing multiple individuals, each individual representing a set of PID parameters ; S111: Calculate the fitness value of each individual using the objective function: ; S112: Randomly select a certain number of individuals, select the individual with the best fitness, then exchange parameters between the selected individual and a randomly selected point, and randomly adjust the PID parameters of the newly generated individual; S113: replace the worst individual in the original population with this newly generated individual, if the maximum number of iterations is reached and the change of fitness value is less than a threshold, terminate the genetic algorithm, finally select the individual with the best fitness value in the new population as the optimization result, and obtain a new .
3. A method of predicting and regulating a winter-time aviculture environment in an aviary as claimed in claim 1, characterized in that: The environmental control equipment in S1 comprises a wet curtain, a fan, a ventilation window and a heating device.
Citation Information
Patent Citations
Environment control method fusing SSA-Elman network model and pigeon inspiration algorithm
CN115220501A
Henhouse environment control method and system
CN116740805A
Chicken house environment control method, system, equipment and medium
CN117032361A
Computational fluid dynamics and energy prediction hybrid based greenhouse energy-saving control method
CN103884075A
Greenhouse temperature PID control method of RNA crossover symbiotic biological algorithm
CN111781819A