A pig house environment dynamic regulation and disease early warning method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-23
- Publication Date
- 2026-08-07
AI Technical Summary
首先,传统养殖场分区布局仅基于功能划分,未能量化病原气溶胶扩散路径,导致隔离区失效风险高达40%以上
[0014]本发明一种猪舍环境动态调控与疾病预警方法及系统的技术效果和优点:1、通过采集猪舍内环境参数与猪群健康数据,并构建初始数据集,利用统计分析技术建立了动态效应模型,量化环境参数波动对猪群健康状态的影响程度;识别出哪些批次数据因环境波动的影响超过预设阈值,并自动标记这些数据进行优化调控,确保最终形成的环境参数配置方案更加科学合理。此外,本发明通过自适应调控算法对标记数据进行调整,并通过模拟不同环境参数组合,进一步评估优化后的数据,确保环境波动影响已被有效消除。2、通过引入了隐马尔可夫模型识别环境参数中未被直接观测到的潜在因子,并通过变分推断算法评估潜在因子引起的健康风险程度,使得环境参数中的隐性风险得以量化和优化,保证了调控结果的高度精准性和可靠性。最终,通过双重评估机制差异指标与潜在健康风险指数,能够可靠地判定优化后的环境参数配置方案是否准确,显著提升了猪舍环境动态调控与疾病预警的可信度,为生猪养殖提供了更加智能、高效的保障。
Smart Images

Figure CN122529919A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of agricultural intelligent technology, specifically a method and system for dynamic control of pigsty environment and disease early warning. Background Technology
[0002] As a crucial component of agricultural production, pig farming's biosecurity directly impacts efficiency and economic benefits. African swine fever, with its high mortality rate and lack of effective vaccines, is a major cause of large-scale pig deaths. Porcine parvovirus, due to its high transmissibility and difficulty in control, further exacerbates the risk of disease transmission. In addition, diseases caused by bacteria such as E. coli and Salmonella, as well as parasitic infections (such as roundworms and mange mites), while having lower mortality rates, significantly affect pig growth performance and increase farming costs. Meanwhile, the biosecurity risks posed by the movement of personnel and materials on farms cannot be ignored. Failure to strictly adhere to disinfection procedures by employees, unquarantined entry of outsiders into the farm, and contamination of feed, veterinary drugs, and other supplies during transportation and storage can all introduce pathogens, leading to disease outbreaks. Improper temperature and humidity, ventilation conditions, and waste disposal in the farming environment can also weaken pigs' immunity and increase the likelihood of disease transmission. For example, damp, poorly ventilated pigsties easily trigger stress responses in pigs, while improperly treated manure and sewage can breed large numbers of bacteria, creating potential sources of infection. In addition, other farms, slaughterhouses, farmers' markets, and wild animals in the surrounding environment may also spread pathogens through air, water, or insects, further expanding the spread of the disease.
[0003] However, existing technologies have many shortcomings in addressing these issues. First, traditional farm zoning layouts are based solely on functional divisions and fail to quantify the aerosol diffusion pathways of pathogens, resulting in a risk of isolation zones failing by over 40%. Second, piggery environmental control relies heavily on experience-based parameter settings, lacking scientific basis, leading to a cold stress rate in piglets exceeding 35%, severely impacting pig health and growth efficiency. Third, traditional paper-based record-keeping methods cannot accurately trace material contamination sources, and the rate of veterinary drug abuse exceeds 20%, increasing the risk of drug residues and drug resistance. Furthermore, the false negative rate of manual registration and disinfection operations is higher than 25%, posing a high risk of cross-infection. In addition, traditional burial methods for dead pigs cannot completely inactivate the African swine fever virus, which can survive for up to 15 days, further threatening farm safety.
[0004] To address the aforementioned issues, there is an urgent need to develop a system and method capable of dynamically regulating the pigsty environment and providing disease early warning, thereby improving biosecurity levels in pig farms, reducing the risk of disease transmission, and ensuring the healthy growth of pigs. This invention aims to comprehensively overcome the shortcomings of existing technologies and provide a more scientific and efficient solution for pig farming by optimizing the zoning layout of pig farms through aerodynamic models, establishing a mapping model between pig growth stages and environmental parameters, utilizing blockchain technology for tracing material contamination, enforcing mandatory disinfection and control mechanisms for personnel, and employing high-temperature and high-pressure processes for the harmless disposal of diseased and dead pigs. Summary of the Invention
[0005] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a method and system for dynamic control of pig house environment and disease early warning to solve the problems mentioned in the background art. To achieve the above objective, the present invention provides the following technical solution: a method for dynamic control of pig house environment and disease early warning, comprising the following steps: S1: collecting environmental parameters and pig health data within the pig house, recording temperature, humidity, aerosol concentration, pig weight change rate, and behavioral abnormality index, and constructing an initial environment-health correlation dataset; S2: processing the initial dataset through multiple regression analysis, establishing a dynamic effect model of the influence of environmental parameters on the health status of the pig herd, and quantifying the degree of influence of environmental parameter fluctuations on the probability of disease occurrence in the pig herd; S3: based on the established dynamic effect model, evaluating whether the health data of each batch of pigs is significantly affected by environmental parameter fluctuations; if the fluctuation impact value exceeds a preset threshold, then marking the batch of data for optimization. S4: Adjust environmental parameters using an adaptive control algorithm on the marked batch data to generate an optimized environmental parameter configuration scheme; S5: Evaluate the optimized environmental parameter configuration scheme, including: simulating the changing trends of different combinations of environmental parameters, analyzing the changing patterns of pig herd health status under each combination, comparing the simulation results with the actual data after control, and determining whether there are any unresolved environmental fluctuations; identifying potential factors in environmental parameters that are not directly observed using a hidden Markov model, and assessing the degree of health risk caused by potential factors; S6: Based on the evaluation results of step S5, determine whether the optimized environmental parameter configuration scheme is accurate. If accurate, a comprehensive scheme for dynamic control of the pig house environment and disease early warning is formed.
[0006] S1 specifically includes: S101: Installing multiple types of sensors, including temperature and humidity sensors, aerosol concentration detectors, and behavior monitoring cameras; S102: Setting the data acquisition frequency to ensure that environmental parameters are recorded once per minute and pig health data is recorded once every ten minutes; S103: Simultaneously recording the growth stage information of the pig herd during the data acquisition process; S104: Collecting real-time meteorological data of the internal and external environment of the pig house; S105: Constructing an initial environment-health correlation dataset containing environmental parameters, health data, and external meteorological data; the initial dataset should include the rate of change of health indicators, fluctuation values of environmental parameters, and related external meteorological conditions for each batch of pig herds.
[0007] S2 specifically includes: S201: Normalizing environmental parameters and health data in the initial dataset; S202: Analyzing the correlation between environmental parameter fluctuations and pig herd health status using ridge regression analysis to preliminarily identify the existence of dynamic effects; S203: Training the normalized data using a support vector machine (SVM) model to establish a dynamic effect model of the impact of environmental parameter fluctuations on health status: A nonlinear kernel SVM model is used to train the data in the normalized initial dataset; the SVM input layer includes environmental parameter fluctuation values, health data change rates, and external meteorological conditions, and the output layer is the model's predicted probability of health status changes; the SVM loss function uses hinged loss; S204: Based on the dynamic effect model, calculating the environmental fluctuation impact value for each batch of data, quantifying the degree of influence of environmental parameter fluctuations on health status through the environmental fluctuation impact value: The specific calculation formula for the environmental fluctuation impact value of each batch of data is as follows: in, Indicates the first The impact of environmental fluctuations on the batch. For the first Batch temperature fluctuation value, For the first Batch humidity fluctuation value For the first The aerosol concentration fluctuation value of the batch. , , These represent the average temperature, humidity, and aerosol concentration for all batches. , , These are the corresponding model coefficients.
[0008] S3 specifically includes: S301: For the health data of each batch of pigs, use a dynamic effects model to obtain the environmental fluctuation impact value; S302: Compare the environmental fluctuation impact value of each batch of data with a preset threshold to determine whether the environmental fluctuation impact is significant: when the environmental fluctuation impact value of the batch data is greater than the preset threshold, the environmental fluctuation impact is determined to be significant; S303: If the environmental fluctuation impact of the batch data is significant, mark the batch data as needing optimization and control; S304: Summarize all batch data marked as needing optimization and control to form a dataset to be optimized.
[0009] S4 specifically includes: S401: Adjusting the batch data of the labels based on the impact of environmental fluctuations: The initially optimized environmental parameters are the difference between the target value and the impact of environmental fluctuations; S402: Selecting the particle swarm optimization algorithm to calculate the adjustment weight for each labeled data point, and using the adjustment weight to optimize the deviation of environmental parameter fluctuations from the health status: Specifically, the following particle swarm optimization formula is used to calculate the adjustment weight for the labeled data: ;in, For the first The particle in the first The speed update value in the dimension, For inertial weights, and As a learning factor, and It is a random number. For the optimal position of an individual, To be the globally optimal position S403: Apply particle swarm optimization algorithm to adjust all labeled data and generate the final optimized environmental parameter configuration scheme.
[0010] By simulating the changing trends of different combinations of environmental parameters, the study analyzes the changing patterns of pig herd health status under each combination, compares the simulation results with actual data after regulation, and determines whether there are any unaddressed environmental fluctuations. Specifically, this includes: generating different combinations of environmental parameters through computer simulation and constructing multiple simulated environment datasets; for each simulated environment dataset, the rate of change in pig herd health status is: ;in, Indicates the first Rate of change in health status under simulated conditions For the first The weights of each environmental parameter, For the first The environmental parameter at the first Values under simulated environments; calculate the mean and standard deviation for each environmental combination; compare the simulated rate of change of health status with the optimized environmental parameter configuration scheme, and calculate the difference index: the root mean square error is used to calculate the difference index. ;in, As a difference indicator, This represents the total number of simulation environment combinations. This indicates the first element in the optimized environment parameter configuration scheme. Rate of change in health status under different environments For the first The average rate of change of health status under each simulated environment; when the difference index is greater than its corresponding preset threshold, it is determined that there is an unresolved environmental fluctuation impact in the optimized environmental parameter configuration scheme; when the difference index is less than or equal to its corresponding preset threshold, it is determined that there is no unresolved environmental fluctuation impact in the optimized environmental parameter configuration scheme.
[0011] Hidden Markov Models (HMMs) are used to identify unobserved latent factors in environmental parameters and assess the health risks posed by these latent factors. Specifically, this involves: analyzing optimized environmental parameter configurations using HMMs to extract unobserved latent factors; and constructing a Bayesian network-based model to model the relationship between latent factors and health status. The Bayesian network model is represented as follows: ;in, The probability distribution representing health status. Indicates latent factors, This represents the set of parent nodes of the health status nodes. The number of healthy nodes is represented; a variational inference algorithm is defined to approximate the true posterior distribution, where... This is an optimized environmental parameter configuration scheme. It is a latent factor. These are the model parameters; the variational distribution is optimized by maximizing the lower bound of evidence; the parameters of the posterior distribution are alternately updated using the variational EM algorithm until convergence; for and Estimate; calculate the potential health risk index, its expression is: ;in, As a potential health risk index, This indicates the batch number; the potential health risk index is compared with its corresponding preset threshold: when the potential health risk index is greater than its corresponding preset threshold, the potential factor has a significant impact on health status; when the potential health risk index is less than or equal to its corresponding preset threshold, the potential factor has no significant impact on health status.
[0012] S6 specifically means: when the difference index is less than or equal to its corresponding preset threshold and the potential health risk index is less than or equal to its corresponding preset threshold, the optimized environmental parameter configuration scheme is determined to be accurate; otherwise, the optimized environmental parameter configuration scheme is determined to be inaccurate; when the optimized environmental parameter configuration scheme is determined to be accurate, a comprehensive scheme for dynamic control of pig house environment and disease early warning is formed.
[0013] On the other hand, this invention provides a dynamic control and disease early warning system for pig house environment, including a data acquisition module, a dynamic effect modeling module, a data evaluation and labeling module, an optimization control module, an optimization data evaluation module, and an evaluation result judgment module. The data acquisition module collects environmental parameters and pig health data within the pig house, recording temperature, humidity, aerosol concentration, pig weight change rate, and behavioral abnormality index, constructing an initial environment-health correlation dataset. The dynamic effect modeling module processes the initial dataset through multiple regression analysis, establishing a dynamic effect model of the influence of environmental parameters on the health status of the pig herd, quantifying the impact of environmental parameter fluctuations on the probability of disease occurrence in the pig herd. The data evaluation and labeling module, based on the established dynamic effect model, evaluates whether the health data of each batch of pigs is significantly affected by environmental parameter fluctuations; if the fluctuation impact value exceeds the predicted value, the system will determine the impact. A threshold is set, and the batch of data is marked for optimization and control. The optimization and control module uses an adaptive control algorithm to adjust environmental parameters for the marked batch of data, generating an optimized environmental parameter configuration scheme. The optimization data evaluation module evaluates the optimized environmental parameter configuration scheme, including: simulating the changing trends of different combinations of environmental parameters, analyzing the changing patterns of pig herd health under each combination, comparing the simulation results with the actual data after control, and determining whether there are any unresolved environmental fluctuations; identifying potential factors in environmental parameters that are not directly observed using a hidden Markov model, and assessing the degree of health risk caused by these potential factors. The evaluation result judgment module, based on the evaluation results of the optimization data evaluation module, judges whether the optimized environmental parameter configuration scheme is accurate. If accurate, a comprehensive scheme for dynamic control of the pig house environment and disease early warning is formed.
[0014] The technical effects and advantages of this invention, a method and system for dynamic control of pig house environment and disease early warning, are as follows: 1. By collecting environmental parameters and pig health data within the pig house and constructing an initial dataset, a dynamic effect model is established using statistical analysis techniques to quantify the impact of environmental parameter fluctuations on the health status of the pig herd. It identifies which batches of data exceed preset thresholds due to environmental fluctuations and automatically marks these data for optimization and control, ensuring that the final environmental parameter configuration scheme is more scientific and reasonable. Furthermore, this invention adjusts the marked data using an adaptive control algorithm and further evaluates the optimized data by simulating different combinations of environmental parameters, ensuring that the impact of environmental fluctuations has been effectively eliminated. 2. By introducing a Hidden Markov Model to identify potential factors in environmental parameters that are not directly observed, and using a variational inference algorithm to assess the degree of health risk caused by these potential factors, the implicit risks in environmental parameters are quantified and optimized, ensuring the high accuracy and reliability of the control results. Finally, through a dual evaluation mechanism of difference indicators and a potential health risk index, the accuracy of the optimized environmental parameter configuration scheme can be reliably determined, significantly improving the credibility of dynamic control of pig house environment and disease early warning, providing a more intelligent and efficient guarantee for pig farming. Attached Figure Description
[0015] Figure 1 The schematic diagram of the module structure of the dynamic control and disease early warning system for pig house environment in this embodiment of the invention shows the connection relationship between the data acquisition module, the dynamic effect modeling module, the data evaluation and labeling module, the optimization control module, the optimization data evaluation module, and the evaluation result judgment module. Figure 2 The flowchart of the dynamic effect model construction of the influence of environmental parameter fluctuations on the health status of pig herds in the method of this invention describes in detail the steps from data collection to normalization processing, ridge regression analysis, support vector machine training and calculation of the influence value of environmental fluctuations. Figure 3 The optimized environmental parameter configuration scheme evaluation flowchart in the method of this invention includes the process of simulating and generating different combinations of environmental parameters, analyzing potential factors using a hidden Markov model, and conducting a dual evaluation through difference indicators and potential health risk indices. Detailed Implementation
[0016] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0017] This invention provides a method and system for dynamic control of pigsty environment and disease early warning, the specific implementation of which is described in conjunction with the appendix. Figure 1 Appendix Figure 2 and attached Figure 3 A detailed explanation will follow. First, the overall structure of the system is shown in the attached figure. Figure 1 As shown, the system includes a data acquisition module, a dynamic effect modeling module, a data evaluation and labeling module, an optimization and control module, an optimization data evaluation module, and an evaluation result judgment module. These modules work together to complete the entire process from data acquisition to environmental parameter optimization and control. The specific implementation steps and technical details will be elaborated below.
[0018] In practical applications, the data acquisition module is the foundation of the entire system. Its main function is to collect environmental parameters and pig health data within the pigsty using various sensor devices. Specifically, temperature and humidity sensors, aerosol concentration detectors, and behavior monitoring cameras installed in the pigsty are used to record temperature, humidity, aerosol concentration, pig weight change rate, and behavioral abnormality index, respectively. To ensure real-time data accuracy, environmental parameters are recorded every minute, pig health data every ten minutes, and the pigs' growth stage information is recorded simultaneously. In addition, external meteorological data is collected through weather stations and other equipment to supplement the comprehensiveness of environmental parameters. This data is ultimately integrated into an initial environment-health correlation dataset, which includes not only environmental parameter fluctuations and health indicator change rates but also external meteorological conditions and their corresponding relationships. This process constitutes the specific implementation of S1 and lays a solid data foundation for subsequent analysis.
[0019] Next, in the dynamic effects modeling module, the initial environment-health association dataset is processed to establish a dynamic effects model of the influence of environmental parameters on the health status of the pig herd. (See attached image) Figure 2 As shown, the environmental parameters and health data in the initial dataset are first normalized to eliminate interference from differences in units. Then, ridge regression analysis is used to analyze the correlation between environmental parameter fluctuations and the health status of the pig herd, initially identifying the existence of dynamic effects. Based on this, a support vector machine (SVM) model is further applied to train the normalized data, constructing a dynamic effect model of the impact of environmental parameter fluctuations on health status. This model is implemented using a nonlinear kernel SVM. The input layer includes environmental parameter fluctuation values, the rate of change of health data, and external meteorological conditions; the output layer is the probability of health status changes predicted by the model. A hinged loss function is used for the SVM to improve the robustness of the model. Based on the established dynamic effect model, the environmental fluctuation impact value for each batch of data is calculated using the following formula: in, Indicates the first The impact of environmental fluctuations on the batch. For the first Batch temperature fluctuation value, For the first Batch humidity fluctuation value For the first The aerosol concentration fluctuation value of the batch. , , These represent the average temperature, humidity, and aerosol concentration for all batches. , , These are the corresponding model coefficients. This process quantifies the impact of environmental parameter fluctuations on health status, providing a scientific basis for subsequent optimization.
[0020] In the data evaluation and labeling module, the health data of each batch of pigs is evaluated based on a dynamic effects model to determine whether it is significantly affected by fluctuations in environmental parameters. Specifically, for each batch of data, the dynamic effects model is used to obtain its environmental fluctuation impact value, which is then compared with a preset threshold. When the environmental fluctuation impact value of a batch of data exceeds the preset threshold, the environmental fluctuation impact is determined to be significant, and the batch of data is marked as requiring optimization and control. All batches of data marked as requiring optimization and control are aggregated to form a dataset to be optimized. For example, if the environmental fluctuation impact value of a batch of pigs is 0.85, while the preset threshold is 0.7, then this batch of data will be marked and included in the dataset to be optimized. This step ensures the targetedness and effectiveness of subsequent optimization and control.
[0021] The core of the optimization and control module lies in using an adaptive control algorithm to adjust environmental parameters based on the labeled batch data, generating an optimized environmental parameter configuration scheme. Specifically, the labeled batch data is adjusted according to the impact of environmental fluctuations; the initial optimized environmental parameters are the difference between the target value and the impact of environmental fluctuations. Then, the particle swarm optimization algorithm is selected to calculate the adjustment weight for each labeled data point, using these weights to optimize the deviation of environmental parameter fluctuations from the health status. The specific formula for particle swarm optimization is: ;in, For the first The particle in the first The speed update value in the dimension, For inertial weights, and As a learning factor, and It is a random number. For the optimal position of an individual, To be the globally optimal position This represents the current position. Using the particle swarm optimization algorithm, all labeled data in the dataset to be optimized are adjusted, ultimately generating an optimized environmental parameter configuration scheme. This process fully demonstrates the flexibility and efficiency of adaptive control algorithms.
[0022] The task of the optimized data evaluation module is to conduct a comprehensive evaluation of the optimized environmental parameter configuration scheme to ensure that the impact of environmental fluctuations has been effectively eliminated. (See attached...) Figure 3 As shown, firstly, different combinations of environmental parameters are generated through computer simulation to construct multiple simulated environment datasets. For each simulated environment dataset, the rate of change in the health status of the pig herd is calculated using the following formula: ;in, Indicates the first Rate of change in health status under simulated conditions For the first The weights of each environmental parameter, For the first The environmental parameter at the first Values under simulated environments; calculate the mean and standard deviation for each environmental combination; compare the simulated rate of change of health status with the optimized environmental parameter configuration scheme, and calculate the difference index: the root mean square error is used to calculate the difference index. ;in, As a difference indicator, This represents the total number of simulation environment combinations. This indicates the first element in the optimized environment parameter configuration scheme. Rate of change in health status under different environments For the first The average rate of change of health status under simulated environments. When the difference index exceeds its corresponding preset threshold, it is determined that there is an unresolved environmental fluctuation impact in the optimized environmental parameter configuration scheme; otherwise, it is not. Furthermore, latent factors not directly observed in environmental parameters are identified using a Hidden Markov Model, and a Bayesian network-based model is used to construct a relationship model between latent factors and health status. The Bayesian network model is represented as follows: ;in, The probability distribution representing health status. Indicates latent factors, This represents the set of parent nodes of the health status nodes. The number of healthy nodes is represented; a variational inference algorithm is defined to approximate the true posterior distribution, where... This is an optimized environmental parameter configuration scheme. It is a latent factor. These are the model parameters; the variational distribution is optimized by maximizing the lower bound of evidence; the parameters of the posterior distribution are alternately updated using the variational EM algorithm until convergence; for and Estimate; calculate the potential health risk index, its expression is: ;in, As a potential health risk index, This indicates the batch number. The potential health risk index is compared with its corresponding preset threshold to determine whether the impact of potential factors on health status is significant.
[0023] The evaluation result judgment module, based on the results of the optimization data evaluation module, determines whether the optimized environmental parameter configuration scheme is accurate. If the difference index is less than or equal to its corresponding preset threshold, and the potential health risk index is less than or equal to its corresponding preset threshold, the optimized environmental parameter configuration scheme is deemed accurate; otherwise, it is deemed inaccurate. If the determination is accurate, a comprehensive scheme for dynamic control of the pig house environment and disease early warning is formed. This comprehensive scheme can not only dynamically control pig house environmental parameters but also provide timely early warning of potential disease risks, thus providing a more intelligent and efficient guarantee for pig farming.
[0024] In summary, this invention achieves dynamic control and disease early warning of piggery environmental parameters through the collaborative work of a data acquisition module, a dynamic effect modeling module, a data evaluation and labeling module, an optimization and control module, an optimized data evaluation module, and an evaluation result judgment module. In the specific implementation process, from data acquisition to model construction, and then to optimization and control and evaluation, each step has been carefully designed and rigorously verified to ensure the scientific validity and reliability of the system. Furthermore, by introducing advanced statistical analysis techniques and machine learning algorithms, this invention significantly improves the accuracy of environmental parameter control and the reliability of disease early warning, providing strong technical support for the intelligent development of the pig farming industry.
Claims
1. A method for dynamic control of pigsty environment and disease early warning, characterized in that, The process includes the following steps: S1: Collect environmental parameters and pig health data in the pigsty, record temperature, humidity, aerosol concentration, pig weight change rate and behavioral abnormality index, and construct an initial environment-health correlation dataset; S2: Process the initial dataset through multiple regression analysis, establish a dynamic effect model of the influence of environmental parameters on the health status of the pig herd, and quantify the degree of influence of environmental parameter fluctuations on the probability of disease occurrence in the pig herd. S3: Based on the established dynamic effect model, assess whether the health data of each batch of pigs is significantly affected by environmental parameter fluctuations. If the fluctuation impact value exceeds the preset threshold, mark the batch data for optimization and control. S4: Use an adaptive control algorithm to adjust environmental parameters for the marked batch data and generate an optimized environmental parameter configuration scheme; S5: Evaluate the optimized environmental parameter configuration scheme, including generating the changing trends of different combinations of environmental parameters through simulation, analyzing the changing patterns of pig health status under each combination, comparing the simulation results with the actual data after regulation, and determining whether there are any unresolved environmental fluctuations; identify potential factors in environmental parameters that are not directly observed through hidden Markov models, and assess the degree of health risk caused by potential factors. S6: Based on the evaluation results of step S5, determine whether the optimized environmental parameter configuration scheme is accurate. If accurate, a comprehensive scheme for dynamic control of the pig house environment and disease early warning is formed. S1 specifically includes: S101: Install multiple types of sensors, including temperature and humidity sensors (1), aerosol concentration detectors (2), and behavior monitoring cameras (3); S102: Set the data collection frequency to ensure that environmental parameters are recorded once per minute and pig health data is recorded once every ten minutes; S103: During the data collection process, record the growth stage information of the pig herd simultaneously; S104: Collect real-time meteorological data of the internal and external environment of the pig house; S105: Construct an initial environment-health correlation dataset containing environmental parameters, health data, and external meteorological data; The initial dataset should contain data for each batch of pig herds. The initial dataset includes the following components: S2: S201: Normalizing the environmental parameters and health data in the initial dataset; S202: Analyzing the correlation between environmental parameter fluctuations and the health status of the pig herd using ridge regression analysis to preliminarily identify the existence of dynamic effects; S203: Training the normalized data using a support vector machine (SVM) model to establish a dynamic effect model of the impact of environmental parameter fluctuations on health status; the SVM input layer includes environmental parameter fluctuations, the rate of change of health data, and external meteorological conditions, while the output layer is the probability of health status changes predicted by the model; the SVM loss function uses hinged loss; S204: Calculating the environmental fluctuation impact value for each batch of data based on the dynamic effect model, using the formula... in, Indicates the first The impact of environmental fluctuations on the batch. For the first Batch temperature fluctuation value, For the first Batch humidity fluctuation value For the first The aerosol concentration fluctuation value of the batch. , , These represent the average temperature, humidity, and aerosol concentration for all batches. , , For the corresponding model coefficients; S3 specifically includes: S301: For the health data of each batch of pigs, use the dynamic effects model to obtain the environmental fluctuation impact value; S302: Compare the environmental fluctuation impact value of each batch of data with a preset threshold to determine whether the environmental fluctuation impact is significant; when the environmental fluctuation impact value of the batch data is greater than the preset threshold, the environmental fluctuation impact is determined to be significant; S303: If the environmental fluctuation impact of the batch data is significant, mark the batch data as needing optimization and control; S304: Summarize all batch data marked as needing optimization and control to form a dataset to be optimized; S4 specifically includes: S401: Adjust the marked batch data according to the environmental fluctuation impact value, the initial optimized environmental parameter is the difference between the target value and the environmental fluctuation impact value; S402: Select the particle swarm optimization algorithm to calculate the adjustment weight of each marked data, and use the adjustment weight to optimize the deviation of environmental parameter fluctuation on health status; the particle swarm optimization formula is: ;in, For the first The particle in the first The speed update value in the dimension, For inertial weights, and As a learning factor, and It is a random number. For the optimal position of an individual, To be the globally optimal position S403: Apply particle swarm optimization algorithm to adjust all labeled data and generate the final optimized environmental parameter configuration scheme.
2. The method for dynamic control of pigsty environment and disease early warning according to claim 1, characterized in that, S5 specifically includes: generating different combinations of environmental parameters through computer simulation to construct multiple simulated environment datasets; for each simulated environment dataset, the rate of change in the health status of the pig herd is... ;in, Indicates the first Rate of change in health status under simulated conditions For the first The weights of each environmental parameter, For the first The environmental parameter at the first Values under simulated environments; calculate the mean and standard deviation for each environmental combination; compare the simulated rate of change of health status with the optimized environmental parameter configuration scheme, and calculate the difference index: the root mean square error is used to calculate the difference index. ;in, As a difference indicator, This represents the total number of simulation environment combinations. This indicates the first element in the optimized environment parameter configuration scheme. Rate of change in health status under different environments For the first The average rate of change of health status under each simulated environment; when the difference index is greater than its corresponding preset threshold, it is determined that there is an unresolved environmental fluctuation impact in the optimized environmental parameter configuration scheme; when the difference index is less than or equal to its corresponding preset threshold, it is determined that there is no unresolved environmental fluctuation impact in the optimized environmental parameter configuration scheme.
3. The method for dynamic control of pigsty environment and disease early warning according to claim 2, characterized in that, This study utilizes Hidden Markov Models (HMMs) to identify unobserved latent factors in environmental parameters and assess the health risks posed by these factors. Specifically, this involves: analyzing optimized environmental parameter configurations using HMMs to extract unobserved latent factors; and constructing a Bayesian network-based model to model the relationship between latent factors and health status. The Bayesian network model representation... ;in, The probability distribution representing health status. Indicates latent factors, This represents the set of parent nodes of the health status nodes. The number of healthy nodes is represented; a variational inference algorithm is defined to approximate the true posterior distribution, where... This is an optimized environmental parameter configuration scheme. It is a latent factor. These are the model parameters; the variational distribution is optimized by maximizing the lower bound of evidence; the parameters of the posterior distribution are alternately updated using the variational EM algorithm until convergence; for and Estimate; calculate the potential health risk index, its expression is: ;in, As a potential health risk index, This indicates the batch number; the potential health risk index is compared with its corresponding preset threshold: when the potential health risk index is greater than its corresponding preset threshold, the potential factor has a significant impact on health status; when the potential health risk index is less than or equal to its corresponding preset threshold, the potential factor has no significant impact on health status.
4. The method for dynamic control of pigsty environment and disease early warning according to claim 3, characterized in that, S6 specifically means: when the difference index is less than or equal to its corresponding preset threshold and the potential health risk index is less than or equal to its corresponding preset threshold, the optimized environmental parameter configuration scheme is determined to be accurate; otherwise, the optimized environmental parameter configuration scheme is determined to be inaccurate. When the optimized environmental parameter configuration scheme is determined to be accurate, a comprehensive scheme for dynamic control of the pig house environment and disease early warning is formed.
5. A dynamic control and disease early warning system for pigsty environment, used to implement the dynamic control and disease early warning method for pigsty environment as described in any one of claims 1 to 4, characterized in that, The system includes a data acquisition module (1), a dynamic effect modeling module (2), a data evaluation and labeling module (3), an optimization and control module (4), an optimized data evaluation module (5), and an evaluation result judgment module (6). The data acquisition module (1) collects environmental parameters and pig health data in the pig house, records temperature, humidity, aerosol concentration, pig weight change rate and behavioral abnormality index, and constructs an initial environment-health association dataset. The dynamic effect modeling module (2) processes the initial dataset through multiple regression analysis, establishes a dynamic effect model of the influence of environmental parameters on the health status of pigs, and quantifies the degree of influence of environmental parameter fluctuations on the probability of disease occurrence in pigs. The data evaluation and labeling module (3) evaluates whether the health data of each batch of pigs is significantly affected by environmental parameter fluctuations based on the established dynamic effect model. If the fluctuation influence value exceeds the preset threshold, the batch of data is labeled for optimization and control. Optimization and control module (4): Adjust environmental parameters using an adaptive control algorithm on the marked batch data to generate an optimized environmental parameter configuration scheme; Optimization data evaluation module (5): Evaluate the optimized environmental parameter configuration scheme, including simulating the changing trends of different combinations of environmental parameters, analyzing the changing patterns of pig health status under each combination, comparing the simulation results with the actual data after control, and determining whether there are any unresolved environmental fluctuations; Identify potential factors in environmental parameters that are not directly observed through a hidden Markov model, and assess the degree of health risk caused by potential factors; Evaluation result judgment module (6): Based on the evaluation results of the optimization data evaluation module, determine whether the optimized environmental parameter configuration scheme is accurate. If accurate, a comprehensive scheme for dynamic control of pig house environment and disease early warning is formed.
6. The dynamic control and disease early warning system for pigsty environment according to claim 5, characterized in that, The data acquisition module (1) includes a temperature and humidity sensor (11), an aerosol concentration detector (12), a behavior monitoring camera (13), and a weather station device (14), which are used to collect environmental parameters, pig health data, and external meteorological data in the pig house.