A pig house temperature energy-saving control method based on multi-objective optimization algorithm
By combining CFD modeling with neural networks, the pig house temperature control method was optimized, which solved the problems of high energy consumption and insufficient control accuracy in pig house temperature control, achieved efficient and energy-saving control of pig house temperature, and optimized the convergence speed and control effect of the multi-objective optimization algorithm.
Patent Information
- Application Number
- CN202310352933.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-04
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2043-04-04
AI Technical Summary
Traditional pig house temperature control has problems such as high energy consumption, insufficient control accuracy, and difficulty in adapting to environmental changes. In addition, the multi-objective optimization algorithm has problems such as slow convergence speed and easy falling into local optimality.
A pig house temperature control method based on a multi-objective optimization algorithm was adopted. By combining CFD modeling with neural networks, a pig house temperature response model was established. The experimental samples were designed using Latin hypercube sampling, the Elman neural network was trained, the control parameters were optimized, and the improved INFO vector weighted average optimization algorithm was used for optimization. The control sub-periods were reasonably divided, and the control parameters were optimized to achieve the optimal environmental suitability and energy consumption.
It achieves simultaneous optimization of the precision and energy consumption of pig house temperature control, saves more than 34% of energy consumption, improves the algorithm's search speed and real-time performance, adapts to environmental changes, and improves control effects.
Smart Images

Figure CN116360266B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of agricultural breeding, relates to numerical simulation technology and Internet of Things technology, and specifically relates to a pig house temperature energy-saving control method based on a multi-objective optimization algorithm. Background Art
[0002] The piggery environment is a crucial factor influencing pig growth and economic profitability, with temperature being the most significant. During hot weather, when the temperature inside a piggery exceeds its comfort zone, pigs experience heat stress symptoms such as dilated skin blood vessels, elevated body temperature, and increased heart rate. This heat stress directly leads to decreased feed intake, which in turn affects pig growth quality. The thermal environment inside a piggery is primarily influenced by the external climate and the heat production of the pigs inside. High temperatures in my country are primarily concentrated from May to October, and during these months, piggeries require ventilation and cooling based on weather conditions to prevent heat stress and the resulting disease. Therefore, temperature control in piggeries is not only crucial for pig growth but also a significant expense in piggery production management. Traditional constant temperature settings present numerous inconveniences. Setting a set value too high results in a large temperature difference between the front and back of the piggery, resulting in poor uniformity and excessive energy consumption. Setting a set value too low results in persistently high internal temperatures when the outdoor temperature is too high, leading to significant control errors. Therefore, energy-saving and optimized temperature control is of great significance to the healthy growth of pigs and the improvement of industrial efficiency.
[0003] Piggery environments are poor, making sensor testing difficult to install and maintain. Furthermore, sensor measurement methods are limited by the number of measurement points and the measurement range, making it difficult to characterize overall environmental trends. Modeling methods based on computational fluid dynamics (CFD) can simulate the piggery environment under various working conditions by rapidly changing boundary conditions, making it easier to obtain valuable information and significantly improving efficiency. However, traditional CFD models have slow computational convergence and are time-consuming, making them difficult to apply in actual control engineering. Therefore, the present invention proposes a CFD-neural network model that significantly accelerates the solution speed. Furthermore, in current agricultural production, environmental control focuses more on control accuracy, while ignoring the energy consumption of control actuators, which is detrimental to the development of facility agriculture towards energy conservation and emission reduction. Therefore, it is very meaningful to design a control scheme that comprehensively considers multiple objectives, such as control accuracy and control energy consumption. Furthermore, the disadvantages of multi-objective optimization algorithms include slow convergence and a tendency to fall into local optimality. To address these shortcomings, the present invention improves the algorithm used to reduce the algorithm's runtime and local optimality. Summary of the Invention
[0004] To solve the above problems, the present invention discloses a pig house temperature energy-saving control method based on a multi-objective optimization algorithm. Through this invention, each sub-period within the control cycle can be controlled and optimized, and the control parameters of the control actuator can be calculated according to the environmental conditions before the start of the sub-period to make the pig house environmental suitability and actuator energy consumption under the control conditions reach the optimal value at the same time.
[0005] To achieve the above object, the technical solution of the present invention is as follows:
[0006] A pig house temperature energy-saving control method based on a multi-objective optimization algorithm comprises the following steps:
[0007] Step 1: Use CFD to establish a temperature response model for the piggery under the wet curtain and fan ventilation mode. Design experimental samples using the Latin hypercube sampling method and complete multiple CFD simulations to form a sample database between control conditions and temperature responses.
[0008] Step 2: Use the Elman neural network to train the above database to obtain an approximate model of control conditions and temperature response;
[0009] Step 3: Taking the pig house ambient temperature control accuracy index model and the pig house actuator control energy consumption model for ventilation and cooling as the minimum optimization goal, the objective function result is calculated through the neural network model as the fitness function of the multi-objective optimization algorithm;
[0010] Step 4: Divide the time when the pig house needs mechanical regulation into multiple regulation sub-periods, obtain the average value of the environmental factors in the first 5 minutes of the current regulation sub-period as the initial state input, and then use the actuator control variables as constraints and the improved INFO vector weighted average optimization algorithm to find the optimal solution based on the fitness function described in step 3.
[0011] Step 5: Select an optimal solution from a set of non-inferior solutions using the energy consumption priority preference, use it as the optimal control parameter for actual regulation, and input it into the control program of the actuator;
[0012] Step 6: Determine whether the next optimization cycle has been reached. If so, re-execute step 4 to perform cycle optimization to achieve the purpose of energy-saving control.
[0013] Furthermore, the sample database of step 1 is at the outdoor air temperature T out , wet curtain temperature at the air inlet T w , curtain temperature T in , the temperature values of multiple monitoring points inside the pig house under the control of variables such as the initial ambient temperature T0 of the pig house, the average weight of the pigs M, and the outlet wind speed V of the variable frequency fan.
[0014] Furthermore, the neural network model in step 2 is based on the T in the sample obtained in step 1. in , T0, M, V are input, the temperature response value of the specified point in the temperature field is t i For output, the Elman neural network is used for training to obtain a fast response model of the temperature at each point under different control conditions.
[0015] Furthermore, the control objective function of step 4 is composed of the control effect J1 and the energy consumption J2. The control effect is divided into control accuracy and control uniformity. The control accuracy is the difference between each observation point and the target value, and the control uniformity is the temperature difference between each observation point. Therefore, the objective function is:
[0016] Where m is the number of temperature observation points, t i is the temperature model output value of observation point i, t target Is the temperature control target of observation point i. k is the execution amplitude of the kth actuator, p k is the standard unit energy consumption of the k-th actuator.
[0017] Furthermore, the step 4 uses the improved INFO algorithm to perform an optimization operation, including the following steps:
[0018] Step 41: Based on the objective function, design a multi-objective optimization model:
[0019]
[0020] Where f(J) is the optimization target, the mode is to find the minimum fitness, T max ,T min are the upper and lower limits of the spray water temperature, v max ,v min The upper and lower limits of the variable frequency fan speed are respectively set;
[0021] Step 42: Determine the dimension of the optimization variable and use circle chaotic mapping instead of random initialization to generate Np individuals according to the constraint range, where Np is the population size.
[0022] Step 43: For Np individuals in the population, use the objective function constructed by the neural network model in step 2 to calculate the objective function values f(J1) and f(J2) corresponding to each individual in the initial population;
[0023] Step 44: Perform non-dominated sorting and crowding calculation based on the objective function value of each individual, and select the best and worst performing individuals based on the sorting results;
[0024] Step 45: Update the position of the vector through three steps: update rule, vector combination, and local search according to the INFO algorithm process to complete the search in the solution space. At the same time, introduce an adaptive t-distribution and a dynamic selection strategy to increase perturbation and expand the local search ability. The method is as follows: It is achieved by defining a dynamic selection probability p, where p is:
[0025]
[0026] it is the current iteration number, and MaxIt is the maximum iteration number. When p < rand, a t-distribution mutation based on the iteration number is generated, and the position of the new vector is:
[0027] Temp = New_X + New_X * trnd(j)
[0028] Step 46: Complete the current iteration to obtain a new offspring population. After merging it with the parent population, perform non-dominated sorting again, and select the first Np individuals as the new generation population. Determine whether the maximum number of iterations has been reached. If not, let the iteration number +1, and loop through the above Step 3 until the iteration ends. If it has reached, stop the loop;
[0029] Step 47: For the population obtained after the end of the above loop, select a group with the smallest non-dominated sorting value as the optimal non-dominated solution set. According to the preference principle, select the solution that makes J2 the smallest within the range of J1 ≤ 1 as the global optimal solution. At this time, obtain the optimal wet curtain spraying water temperature T and the optimal fan wind speed v that make the control effect index not greater than 1 and the control energy consumption the smallest during this optimization period. wbest and the best optimal fan wind speed v during this period. Substitute these parameters into the actual control program to perform the control during this period.
[0030] Furthermore, the regulation method in Step 6 is to first divide the entire regulation period into multiple sub-period optimization cycles with equal time lengths. First, calculate the initial environmental values in the first 5 minutes of the sub-period optimization cycle, substitute them into the multi-objective optimization algorithm for optimization, and finally perform the control within this optimization cycle according to the optimization decision, and continuously loop until the regulation of the entire cycle is completed.
[0031] Advantages of the present invention:
[0032] 1. Using the INFO algorithm for multi-objective optimization of the pig house environment control parameters can overcome the deficiency of the traditional PID control that overly pursues precision, so that the control parameters obtained by the present invention can minimize the control energy consumption of the actuator while ensuring the environmental control effect, achieving the effect of energy conservation and emission reduction. The simulation experiment shows that the control strategy optimized by the multi-objective optimization algorithm can save at least 34% of the energy consumption compared with the original control strategy.
[0033] 2. Intelligent optimization algorithms are prone to problems such as long search times and being stuck in local optimality. To speed up the algorithm, two improvements were made to the INFO algorithm. The improved algorithm can better conduct global searches in the early stages and better escape local optimality in the later stages, which speeds up the search and enhances the efficiency and real-time performance of the algorithm. At the same time, the idea of non-dominated sorting was introduced to obtain the Pareto solution set, overcoming the defect of overly subjective weight allocation in single-objective optimization.
[0034] 3. By reasonably dividing the time of the control sub-periods, the environmental control can adapt to the changes in external conditions, solving the shortcomings of unpredictable changes in environmental factors due to long control time and the shortcomings of delayed regulation effect due to short control time. At the same time, compared with constant value control, the control method through sub-period rolling optimization can better adapt to changes in the internal and external environment of the house, with better control effect and more energy saving. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a simplified diagram of the overall design process of the pig house environment energy-saving control method of the present invention.
[0036] Figure 2 This is a flow chart for constructing a CFD numerical simulation model of a piggery environment according to the present invention.
[0037] Figure 3 It is a detailed flow chart of each module of the pig house environment energy-saving control method of the present invention.
[0038] Figure 4 It is a flow chart of pig house temperature control of the present invention. DETAILED DESCRIPTION
[0039] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0040] The content of the present invention is to provide a pig house temperature energy-saving control method based on a multi-objective optimization algorithm. Through this invention, the control parameters of the control actuator can be designed according to the current environmental conditions of the pig house so that the pig house temperature control effect and the actuator energy consumption under the control conditions can be optimized at the same time.
[0041] In order to achieve the above object, the present invention provides the following technical solutions:
[0042] A pig house temperature energy-saving control method based on a multi-objective optimization algorithm comprises the following steps:
[0043] Step 1: Construct a 3D model of the pig house based on its physical structure. First, take actual measurements of the structure, including its dimensions (length, width, height), pen size, window openings, and the locations of actuators like wet curtains and fans. Using Comsol fluid simulation software, a 1:1 physical model is constructed and meshed using a Cartesian coordinate system. Next, inlet and outlet boundary conditions are determined, as well as pig heat production, which is calculated based on pig weight and number. The CFD model uses a standard k-ε model for gas flow in the numerical simulation. The turbulence module and the fluid heat transfer module are coupled using velocity, absolute pressure, and temperature. The Reynolds average method is used for numerical simulation. After the simulation, the 3D temperature field inside the pig house is obtained, and the accuracy of the model is continuously improved based on the measurement results.
[0044] Step 2: Determine the boundary conditions in the CFD model, including the outdoor air temperature T out , wet curtain temperature at the air inlet T w , curtain temperature T in , initial ambient temperature of the pig house T0, average weight of pigs M, number of pigs in the pen S, outlet wind speed of the variable frequency fan V, where,
[0045] T in =T out -η(T out -T w ) (1)
[0046] And for which T in , T0, M, V four variables, based on Latin hypercube sampling, designed 50 groups of CFD experiments, and completed multiple CFD experiments accordingly to obtain the database samples of temperature values responding under different control conditions.
[0047] Step 3: For the experimental samples obtained in the previous step, in , T0, M, V four variables are input, multiple monitoring point temperature values are output, the training set and test set are divided into 8:2, and the Elman neural network model is used for training. Since the number of hidden layer nodes of the neural network directly affects the results of the model, the shortcomings of the hidden layer nodes are determined based on the training effect of the training set. First, based on the empirical formula:
[0048] hiddennum=sqrt(m+n)+a (2)
[0049] Among them, m is the number of input layer nodes, n is the number of output layer nodes, a is an integer between 1 and 10, and the number of hidden layer nodes is roughly determined to be between 3 and 12. Then, the target error of the training set is used as the evaluation indicator, and experiments are carried out one by one. The number of hidden layer nodes with the smallest target error of the training set is selected as the optimal hidden layer node and the training is completed. Other parameters include 1000 training times and a learning rate of 0.01. The model effect is judged by the root mean square error RMSE. After the training is completed, an approximate optimization model of the CFD model is obtained. This model will greatly reduce the calculation time and the accuracy can approximately replace the CFD model.
[0050] Step 4: Determine the objective function J of the control process. Calculate the temperature control target value in the pig living area based on the national management standards for pig house breeding environments and the density of penned pigs. Use the control accuracy index and control uniformity index to characterize the control index model for the pig house environment. Select multiple observation points on the pig living area plane for calculation, so J1 is:
[0051]
[0052] Where m is the number of temperature observation points, t i is the temperature model output value of observation point i, t target is the temperature control target of observation point i. Determine the actuator control energy consumption model J2 for ventilation and cooling in the pig house:
[0053] J2=∑γ k ×p k (4)
[0054] where γ k is the execution amplitude of the kth actuator, p k is the standard unit energy consumption of the kth actuator, so the optimization objective is:
[0055] f(J)=f(J1,J2) (5)
[0056] Step 5: Run the INFO multi-objective optimization algorithm and determine the variable dimension is 2, that is, the wet curtain spray water temperature T w And the variable frequency fan wind speed v, the range of change is T w ∈[22,27], v∈[0,5], the number of optimization objective functions is 2, namely J1 and J2, and the multi-objective optimization model is:
[0057]
[0058] In order to improve the algorithm's running speed and enhance real-time performance, the INFO algorithm is improved as follows:
[0059] Step 1: Determine the dimension of the optimization variable. According to the constraint range, use the circle chaos mapping to generate Np individuals instead of random initialization, where Np is the population size;
[0060] Step 2: For the Np population individuals, use the objective function composed of the neural network model in Step 2 to calculate the objective function values f(J1) and f(J2) corresponding to each individual in the initial population;
[0061] Step 3: Perform non-dominated sorting and crowding degree calculation based on the results of each objective function value of the individuals, and select the best and worst individuals according to the sorting results;
[0062] Step 4: According to the process of the INFO algorithm, update the position of the vector through three steps: update rule, vector combination and local search, complete the search in the solution space, and at the same time introduce an adaptive t-distribution and a dynamic selection strategy to increase the perturbation and expand the local search ability. The introduced method is: achieved by defining a dynamic selection probability p, where p is:
[0063]
[0064] it is the current iteration number, MaxIt is the maximum iteration number. When p < rand, generate a t-distribution mutation based on the iteration number. The position mutation formula is:
[0065] Temp = New_X + New_X * trnd(j) (8)
[0066] Step 5: Complete the current iteration, obtain a new offspring population, merge it with the parent population, and re-perform non-dominated sorting. Take the first Np individuals as the new generation population, and judge whether the maximum iteration number is reached. If not, let the iteration number +1, and loop the above Step 3 until the iteration ends. If it reaches, stop the loop;
[0067] Step 6: For the population obtained after the above loop ends, select a group with the smallest non-dominated sorting value as the optimal non-dominated solution set. According to the preference principle, select the solution that makes J2 the smallest within the range of J1 ≤ 1 as the global optimal solution. At this time, obtain the optimal wet curtain spray water temperature T and the optimal fan wind speed v that make the control effect index not greater than 1 and the control energy consumption the smallest during this optimization period wbest and the best fan wind speed v best , substitute these parameters into the actual control program to perform the control during this period.
[0068] Step 7: Within the entire control cycle, the entire control period is first divided into multiple sub-period optimization periods of equal length. The length is determined according to the control effect. The present invention takes 25 minutes as a control sub-period between 8 am and 8 pm. First, read the initial environmental value 5 minutes before the sub-period optimization cycle, substitute it into the multi-objective optimization algorithm for optimization, and finally perform control within the optimization cycle according to the optimization decision, and continue to cycle until the control within the entire cycle is completed.
[0069] The technical means disclosed in the solutions of the present invention are not limited to those disclosed in the above-mentioned embodiments, but also include technical solutions composed of any combination of the above-mentioned technical features. It should be noted that those skilled in the art may make various improvements and modifications without departing from the principles of the present invention, and such improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A pig house temperature energy-saving control method based on a multi-objective optimization algorithm, characterized by: The steps include: Step 1: Use CFD to establish a temperature response model for the piggery under the wet curtain and fan ventilation mode. Design experimental samples using the Latin hypercube sampling method and complete multiple CFD simulations to form a sample database of the relationship between different control conditions and temperature responses. Step 2: Use the Elman neural network to train the above database to obtain an approximate model between the control conditions and the temperature response. This approximate model solves the problem of slow convergence of the CFD model and can be used to construct the fitness function in the subsequent multi-objective optimization algorithm; Step 3: Taking the pig house ambient temperature control effect and the actuator control energy consumption for mechanical ventilation cooling as the minimum optimization objective function, and using the above neural network model to calculate the fitness value of each objective function; Step 4: Obtain the average value of the environmental factors in the first 5 minutes of the current control sub-period as the initial state input, and then use the actuator control variables as constraints and the improved INFO algorithm to optimize the fitness function described in step 3; Adaptive t-distribution and dynamic selection strategy are introduced to increase disturbance and expand local search capability. The introduction method is to achieve this by defining the dynamic selection probability p, where p is: it is the current number of iterations, MaxIt is the maximum number of iterations. When p < rand, a t-distributed mutation based on the number of iterations is generated, and the position of the new vector is: Temp = New_X + New_X * trnd(j); Step 5: Select an optimal solution from a set of non-inferior solutions using the energy consumption priority preference, use it as the optimal control parameter for actual regulation, and input it into the control program of the actuator; Step 6: Determine whether the next optimization cycle has been reached. If so, re-execute step 5 for dynamic optimization to achieve the purpose of energy-saving control.
2. The pig house temperature energy-saving control method based on a multi-objective optimization algorithm according to claim 1 is characterized in that: The key parameters in the boundary conditions of the CFD model in step 1 include the outdoor air temperature T out , wet curtain temperature at the air inlet T w , curtain temperature T in , initial ambient temperature of the pig house T0, average weight of pigs M, number of pigs in pen S, and outlet wind speed of variable frequency fan V.
3. The pig house temperature energy-saving control method based on a multi-objective optimization algorithm according to claim 2 is characterized in that: The input of the Elman neural network in step 3 is T in the sample of step 1 in , T0, M, V, the output is the temperature response of the specified point in the temperature field t i .
4. The pig house temperature energy-saving control method based on a multi-objective optimization algorithm according to claim 1 is characterized in that: The objective function of the INFO algorithm in step 3 is composed of the control effect J1 and the energy consumption effect J2. The control effect is divided into control accuracy and control uniformity. The control accuracy is the difference between each observation point and the target value, and the control uniformity is the temperature difference between each observation point. Therefore, the two objective function expressions J1 and J2 are: Where m is the number of temperature observation points, t i is the temperature model output value of observation point i, t target is the temperature control target of observation point i; where γ k is the execution amplitude of the kth actuator, p k is the standard unit energy consumption of the k-th actuator.
5. The pig house temperature energy-saving control method based on a multi-objective optimization algorithm according to claim 4 is characterized in that: The INFO algorithm optimization model of step 4 is: Where f(J) is the optimization target, the mode is to find the minimum fitness, T max ,T min are the upper and lower limits of the spray water temperature, v max ,v min The upper and lower limits of the variable frequency fan wind speed are respectively set.
6. The pig house temperature energy-saving control method based on a multi-objective optimization algorithm according to claim 4 is characterized in that: The improved INFO algorithm of step 4 comprises the following steps: Step 41: Determine the dimension of the optimization variable and use circle chaotic mapping instead of random initialization to generate Np individuals according to the constraint range, where Np is the population size. Step 42: For Np individuals in the population, calculate the objective function value of the initial population using the objective function constructed by the neural network model in step 2; Step 43: Perform non-dominated sorting and crowding calculation based on the objective function value of each individual, and select the best and worst performing individuals based on the sorting results; Step 44: Update the position of the vector according to the INFO algorithm process through the three steps of updating rules, vector combination, and local search to complete the search in the solution space; Step 45: After the current iteration is completed, a new offspring population is obtained. The offspring population is merged with the parent population and the non-dominated sort is performed again. The first Np individuals are taken as the new generation population. It is determined whether the maximum number of iterations has been reached. If not, the number of iterations is increased by 1, and the above step 3 is repeated until the iteration ends. If it has been reached, the loop is stopped. Step 46: For the population obtained after the above cycle, select the group with the smallest non-dominated sort value as the optimal non-dominated solution set, and according to the preference principle, take the solution that minimizes J2 within the range of J1≤1 as the global optimal solution. At this time, the optimal spray water temperature T of the wet curtain that makes the control effect index no more than 1 and minimizes the energy consumption in this optimization period is obtained. wbest and optimal fan speed v best , substitute the parameter into the actual control program and perform control within this cycle.
7. The pig house temperature energy-saving control method based on a multi-objective optimization algorithm according to claim 1 is characterized in that: The control method of step 6 is to divide the entire control period into multiple sub-period optimization cycles of equal length, first calculate the initial environmental value 5 minutes before the sub-period optimization cycle, substitute it into the multi-objective optimization algorithm for optimization, and finally control the optimization cycle according to the optimization decision, and continue to cycle until the control of the entire cycle is completed.