Livestock breeding house environment detection method

By combining multiple types of detection terminals with the LSTM attention prediction model, the system achieves full-dimensional detection and dynamic control of the livestock and poultry housing environment, solving the problems of single detection dimensions and disconnect between prediction and control in existing technologies, and improving livestock and poultry health and breeding efficiency.

CN121297940APending Publication Date: 2026-01-09盐城市盐都区张庄街道综合服务中心
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511468425.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

Existing livestock and poultry housing environmental monitoring technologies suffer from problems such as limited monitoring dimensions, a disconnect between prediction and control, and the generalization of threshold settings, making it difficult to achieve comprehensive environmental management and leading to increased health risks and breeding costs for livestock and poultry.

Method used

The system uses multiple types of detection terminals to collect basic environmental, harmful gas, livestock and poultry behavior and microbial parameters. Combined with the LSTM attention prediction model, it performs dynamic detection and hierarchical control. By dynamically adjusting the sampling frequency and behavior influence coefficient, the system optimizes the data to achieve full-dimensional detection and precise control.

Benefits of technology

It achieves the accuracy of all-dimensional environmental monitoring and the foresight of prediction, reduces the risk of missed pollution detection, improves the targeting and energy efficiency of regulation, and is in line with the development trend of efficient, green and precise aquaculture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121297940A_ABST
    Figure CN121297940A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of livestock breeding environment monitoring, in particular to a livestock breeding house environment detection method which comprises the steps that multiple types of detection terminals are deployed to collect basic environment, harmful gas, livestock behaviors, microorganism parameters and livestock basic information, the aggregation state is judged, and a multi-source data matrix is constructed; the sampling frequency is dynamically adjusted in combination with the exercise amount, the excretion confidence coefficient and the aggregation state, non-aggregation area environmental reasons are analyzed, and behavior influence coefficient optimization data are introduced; training an LSTM attention model by using the effective data, and outputting an environment prediction result containing microbial parameters; starting three-level regulation and control based on a temperature and humidity index and a microorganism safety threshold value, and optimizing the model after reinspection; and combining the industrial standard and the production data to update the differential threshold. Physical, chemical and biological full-dimension detection is achieved, accurate response of the accumulation area is achieved, the reason of the non-accumulation area is transparent, and the method is suitable for closed or semi-closed livestock breeding scenes such as large-scale hog houses and chicken houses.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of livestock breeding environment monitoring, and particularly relates to a livestock breeding house environment detection method. BACKGROUND

[0002] Under the background of rapid development of intensive livestock breeding mode, the environmental quality of breeding house has become a core factor affecting the health status, production performance and breeding economic benefits of livestock and poultry. The key indicators such as daily weight gain, egg production rate and survival rate of livestock and poultry are strongly correlated with environmental parameters such as temperature and humidity, harmful gas concentration and microbial content in the house. Suitable environmental conditions can significantly improve the production performance of livestock and poultry, while unsuitable environment can directly restrict the breeding benefit. However, the current livestock and poultry house environment detection technology still has many defects, which is difficult to meet the needs of precision and full-dimensional environment control of large-scale breeding.

[0003] The existing technology generally has the problem of single detection dimension. Most schemes only focus on a certain type of physical or chemical parameters, and cannot realize multi-dimensional collaborative detection of "physics, chemistry and biology". For example, some technologies only design detection devices for temperature and humidity, collect temperature and humidity data in the house through fixed sensors, but ignore the stimulating effect of harmful gases such as ammonia and hydrogen sulfide on the respiratory tract of livestock and poultry. Another technology pays attention to the concentration control of harmful gases, monitors related indicators through gas sensors, but does not include microbial parameters in the detection system. However, in the actual breeding scene, the microorganisms (such as E. coli and Staphylococcus) in the house are not only the main cause of digestive tract and respiratory diseases of livestock and poultry, but also accelerate the decomposition of organic matter in manure, forming the superimposed effect of "biological pollution and chemical pollution". The existing single-dimensional detection cannot cover such compound risks, which is easy to cause pollution hidden danger missing, and poses a potential threat to the health of livestock and poultry.

[0004] At the same time, the existing technology lacks targeted detection strategies for the environmental response of livestock and poultry aggregation behavior and non-aggregation behavior. Livestock and poultry are prone to aggregation in scenes such as after feeding and cold weather. The metabolic heat of livestock and poultry in the aggregation area is superimposed, and the local environmental parameters change more dramatically. The concentration of carbon dioxide will also fluctuate significantly due to the enhancement of respiratory function. However, the existing detection mostly adopts fixed frequency sampling, which cannot timely capture the rapid environmental changes in the aggregation area, resulting in missing detection of local abnormal state. For non-aggregation areas, the existing technology can only identify the state that "livestock and poultry do not aggregate", but cannot locate the root cause of non-aggregation through environmental detection, which may be that the local temperature is not suitable, the concentration of harmful gases is too high, or the ground humidity or microbial content is too high. This detection mode of "knowing the phenomenon but not the cause" makes it difficult for breeding personnel to take targeted control measures, and the production performance of livestock and poultry is significantly affected by the long-term unsuitable environment.

[0005] In addition, the prior art also has the problems of disconnection between prediction and regulation and generalization of threshold setting. Some technologies have environmental prediction functions and can predict temperature and humidity changes through time series models, but they do not include microbial safety thresholds in the prediction system and cannot achieve coordinated early warning of "physical parameters, chemical parameters, and biological parameters". In the regulation link, most schemes use a rough mode of "all-on and all-off", which starts all ventilation equipment or disinfection devices when a parameter exceeds the standard, resulting in serious waste of energy. At the same time, the environmental threshold setting does not fully consider the differences between livestock breeds and growth stages, and a unified standard is adopted, for example, the temperature requirements of piglets and fattening pigs are not distinguished, and the humidity adaptation range of chicks and laying hens is not distinguished. This "one-size-fits-all" threshold design does not meet the industry standard of "setting environmental parameters by breed and growth stage" in "Environmental Parameters and Measurement Methods for Large-scale Livestock Farms", further exacerbating the mismatch between environmental control and livestock physiological needs, and easily causing stress reactions in livestock.

[0006] These technical defects collectively result in the difficulty of existing environmental detection schemes to form a complete closed loop of "detection, prediction, regulation, and optimization", which not only increases the risk of disease transmission and breeding costs of livestock, but also restricts the development of large-scale livestock breeding towards high efficiency, green, and precision. It is urgent to fill the gap in microbial detection, optimize dynamic detection logic, and perfect the prediction and regulation mechanism to build a full-dimensional environmental detection method that meets the actual breeding needs through technological innovation. SUMMARY

[0007] To solve the above problems, the technical scheme adopted by the present application is as follows.

[0008] A livestock breeding house environment detection method, comprising the following steps:

[0009] Step one, deploy multiple types of detection terminals to collect basic environmental parameters, harmful gas parameters, livestock behavior parameters, microbial parameters, and livestock basic information, determine the detection point aggregation state, and associate various data to build a multi-source data matrix;

[0010] Step two, dynamically adjust the sampling frequency in combination with the livestock activity, excretion behavior confidence, and aggregation state, introduce a behavior influence coefficient to optimize the collected data to obtain effective data, and analyze the environmental reasons in the non-aggregation area;

[0011] Step three, train an LSTM attention prediction model with effective data as input, and output an environmental prediction data matrix containing microbial parameters;

[0012] Step four, evaluate the environmental suitability based on the temperature and humidity index and the microbial safety threshold, start the hierarchical regulation, calculate the error rate after rechecking, and optimize the model;

[0013] Step five, update the activity reference value, thermal comfort interval, and microbial safety threshold in combination with industry standards and production data.

[0014] As preferred, the multi-type detection terminal in step one includes a basic environment detection terminal, a harmful gas detection terminal, a livestock behavior detection terminal, and a microorganism detection terminal. The microorganism detection terminal adopts an ATP bioluminescence method sensor and is mainly deployed around the excretion area and feeding trough. The aggregation state is determined by comparing the number of livestock around the detection point with a preset aggregation threshold value. The basic environment detection terminal is deployed according to a preset grid spacing with key area supplement points. The key areas include ventilation openings, livestock aggregation areas, and excretion areas. The harmful gas detection terminal is co-located with the basic environment detection terminal. The livestock behavior detection terminal includes a high-definition camera and an RFID reader. Each livestock wears an RFID ear tag that stores breed and growth stage information.

[0015] As preferred, the livestock behavior parameters in step one are obtained by capturing image frames by a camera at a preset period, identifying livestock contours by a target detection algorithm, calculating motion amounts by an angle point matching method, and clustering to obtain excretion behavior confidence. The livestock basic information is obtained by reading ear tag information by an RFID reader at a preset period and associating it to the detection point coordinates.

[0016] As preferred, the dynamic adjustment of the sampling frequency in step two is specifically: the aggregation area sampling frequency is directly increased to a high-frequency sampling frequency, and the initial sampling frequency is restored after the aggregation state is removed. When the non-aggregation area duration exceeds a preset non-aggregation duration, local temperature, humidity, harmful gas concentration, ground humidity, and microorganism parameters are detected and a cause label is generated. The cause label includes high temperature, harmful gas exceeding the standard, high humidity, and microorganism exceeding the standard. The cause label is generated by comparing the non-aggregation area environmental parameters with the corresponding breed stage suitable interval.

[0017] As preferred, the behavior influence coefficient in step two includes a motion amount proportion, an excretion behavior confidence proportion, and a microorganism activity correction term. When the microorganism parameter exceeds a preset microorganism safety threshold, the behavior influence coefficient is increased by a preset correction ratio. The effective data is the collected data multiplied by the behavior influence coefficient. The motion amount reference value is set with reference to the relevant standards of environmental parameters of large-scale livestock farms, which are adapted to the corresponding livestock breed and growth stage.

[0018] As preferred, the input features of the effective data in step three include effective temperature, effective humidity, effective ammonia concentration, effective hydrogen sulfide concentration, effective CO2 concentration, motion amount, excretion behavior confidence, and effective microorganism parameter. The effective microorganism parameter is the microorganism parameter multiplied by the behavior influence coefficient. The LSTM attention prediction model adopts an Adam optimizer trained at a preset learning rate. The mean square error between the predicted value and the actual value is used as the loss function to iterate until the preset condition is met. The attention layer allocates weights according to the correlation between the features and future environmental parameters. The weight of the microorganism parameter is set based on its correlation with future harmful gas parameters.

[0019] As preferred, the temperature and humidity index in step four is calculated according to a general formula for animal husbandry, and the preset thermal comfort interval is set according to the relevant standards for the environment quality of livestock and poultry farms; the hierarchical regulation and control is specifically: the first-level regulation and control is for a single parameter exceeding the standard, the sterilization device is started when the microbial parameter exceeds the standard, and the corresponding regulation and control device is started when other parameters exceed the standard; the second-level regulation and control is for two or more parameters exceeding the standard, and the global ventilation and sterilization device is started; the third-level regulation and control is for the temperature and humidity index, harmful gas and microbial parameters all exceeding the standard, and the global ventilation, sterilization and ground treatment device is started; the sterilization agent used by the sterilization device is an adaptive sterilization agent with a preset concentration, and the ground treatment device operates according to a preset treatment mode.

[0020] As preferred, the error rate in step four includes a microbial parameter error rate, which is the absolute value of the difference between the rechecked effective microbial data and the predicted microbial data, divided by the predicted microbial data and multiplied by a percentage coefficient; when the error rate exceeds a preset threshold, the corresponding feature weight of the prediction model is adjusted and the retraining is performed by supplementing the rechecked data.

[0021] As preferred, the production data in step five includes the daily weight gain, survival rate and morbidity rate of livestock and poultry, the daily weight gain is obtained by a weighing sensor, and the survival rate is obtained by image recognition; the threshold updating is specifically: when the morbidity rate is higher than the industry standard and the microbial parameters exceed the standard, the microbial safety threshold is lowered; when the daily weight gain is lower than the standard and the exercise amount is generally low, the exercise amount reference value is lowered; and when the survival rate is lower than the standard and the temperature and humidity index exceeds the upper limit, the upper limit of the thermal comfort interval is lowered.

[0022] As preferred, the high-frequency sampling frequency, the initial sampling frequency, the preset non-aggregation time length and the preset correction ratio in step two, the preset learning rate, the preset iteration number, the preset loss function threshold and the preset prediction period in step three, the preset spraying period, the preset rechecking period and the preset error rate threshold in step four, and the preset threshold lowering ratio and the preset interval lowering amplitude in step five are all configurable parameters.

[0023] Compared with the prior art, the present application has the beneficial effects that:

[0024] The present application realizes the four-dimensional linkage detection of "physics, chemistry, biology and behavior" through the full-dimensional four-parameter linkage collection and the two-dimensional data association, fills in the biological pollution detection blank by including the microbial parameter, and can cover the superimposed risks of "biological pollution and chemical pollution"; the logical relationship between parameters is strengthened through the two-dimensional data association of "time stamp and coordinate", the risk of missing local pollution is greatly reduced, and the data quality is improved, providing reliable input for subsequent dynamic optimization and prediction.

[0025] The application realizes accurate detection of the gathering area and transparent reasons for the non-gathering area through high-frequency sampling of the gathering area and reason tag generation mechanism of the non-gathering area; the high-frequency sampling design of the gathering area ensures that the rapid capture of the dramatic changes in the local environment can be achieved, and the abnormal missed detection caused by fixed frequency sampling can be avoided; the reason tag generation function of the non-gathering area can accurately locate the environmental inducement of the non-gathering of livestock and poultry, get rid of the blind detection dilemma of "only knowing the state but not knowing the reason", make the subsequent control measures more targeted, and ensure that the livestock and poultry are in a suitable environment.

[0026] The application achieves the double advantages of prediction foresight and accuracy through the LSTM attention model combined with the microbial characteristics and the dynamic optimization mechanism; the design of the LSTM attention model combined with the microbial characteristics fully utilizes the correlation between the microbial activity change and the harmful gas concentration, and improves the foresight of the environmental prediction; the weight distribution of the key features in the attention layer further optimizes the prediction accuracy, and at the same time, through the dynamic model optimization mechanism, the reliability of the prediction result in long-term use is ensured, and sufficient time is reserved for early intervention.

[0027] The application realizes efficient hierarchical control and reasonable controllable energy consumption through the three-level control strategy matched with the risk level and the multi-device linkage logic; the three-level control strategy matches the control strength according to the risk level, avoids the extensive mode of "all-on and all-off", reduces the invalid running time of the device, and realizes the balance between energy consumption and treatment effect; the control logic of the microbial special disinfection and the multi-device linkage can quickly control biological and chemical pollution, improve the treatment efficiency, and reduce the energy waste in the breeding process.

[0028] The application strengthens the scene adaptability and breeding benefit optimization through the differentiated threshold matched with the variety stage and the scenario parameter configuration; the differentiated threshold design fully considers the physiological differences of the livestock and poultry varieties and the growth stages, meets the requirement of "setting parameters according to scenes" in the industry standard, and can effectively reduce the stress risk of sensitive groups such as young livestock and poultry; the overall detection method can be flexibly adjusted according to the breeding varieties, the shed type, and the regional climate, provides a customized solution for different scale breeding scenes, helps to comprehensively improve the breeding benefit, and meets the development trend of efficient, green and precise livestock breeding. BRIEF DESCRIPTION OF DRAWINGS

[0029] Figure 1 The overall technical scheme of the application is a closed-loop flowchart;

[0030] Figure 2 The multi-source data acquisition and matrix construction flowchart of the application is shown in the figure;

[0031] Figure 3 The dynamic detection optimization flowchart of the application is shown in the figure;

[0032] Figure 4 The hierarchical control and feedback optimization flowchart of the application is shown in the figure. DETAILED DESCRIPTION

[0033] 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, and not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0034] In the description of the present application, it should be noted that the terms "upper", "lower", "inner", "outer", "top / bottom end" and the like indicate the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second" are only for the purpose of description, and cannot be understood as indicating or implying relative importance.

[0035] In the description of the present application, it should be noted that unless otherwise explicitly specified and limited, the terms "mounting", "provided with", "sleeved / connected", "connected" and the like should be broadly understood, for example, "connected" can be fixedly connected, or can be detachably connected, or integrally connected; can be mechanically connected, or can be electrically connected; can be directly connected, or can be indirectly connected through an intermediate medium; can be internal communication of two elements. For a person of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0036] Embodiment

[0037] This embodiment takes the large-scale summer fattening pig house in the south as the application scene, the breeding variety is three-way crossbred pig, the growth stage is the middle period of fattening, the area in the house is 1000m2, the number of pigs is 500, the house type is closed, and the core process of the claim is strictly followed. The actual use method and working principle are described as follows by explicitly expanding through "step one to step five":

[0038] Step one: multi-source data acquisition and association, constructing full-dimensional data matrix

[0039] This step focuses on the collection, state determination and matrix construction of multi-source data, and the specific implementation process is as follows:

[0040] First, the terminal deployment is detected. The deployment principle is to preset the grid spacing combined with key area supplement, and the preset grid spacing is 10 m x 10 m in the embodiment. The deployment mode of various terminals is as follows: 44 basic environment detection terminals are deployed to cover the whole area in the grid, one terminal is supplemented every 2 vents, 2 terminals are supplemented within 3 m around the feeding trough, the whole area above the manure leakage plate in the excretion area is covered with a spacing of 5 m, the terminal is equipped with a PT100 platinum resistance temperature sensor, a Sensirion SHT35 humidity sensor, and a YGC-FS-485 wind speed sensor, the PT100 temperature sensor has an accuracy of ±0.3°C in the embodiment, the SHT35 humidity sensor has an accuracy of ±2%RH, and the YGC-FS-485 wind speed sensor has an accuracy of ±0.1 m / s; the harmful gas detection terminal is co-located with the basic environment terminal, and contains an Alphasense NH3-B4 ammonia sensor, an Alphasense H2S-B4 hydrogen sulfide sensor, and a Senseair S8 infrared CO2 sensor, the NH3-B4 ammonia sensor has a resolution of 0.1 ppm in the embodiment, the H2S-B4 hydrogen sulfide sensor has a resolution of 0.05 ppm, and the Senseair S8 CO2 sensor has a resolution of 1 ppm, and dust is filtered through the built-in filter during collection; the livestock behavior detection terminal is composed of 6 high-definition cameras and 2 RFID readers, the cameras are deployed at the four corners and the middle of the house, have a resolution of 1920 x 1080 and a frame rate of 25 fps, and the RFID readers are deployed at the entrances and exits of the house; 20 microbial detection terminals are used, which are ATP fluorescence detectors, have a detection range of 0 to 9999 RLU and a response time of not more than 15 s, and are mainly deployed above the manure leakage plate in the excretion area, and 5 terminals are deployed around the feeding trough every 5 m.

[0041] Then, the parameter and aggregation state collection is carried out. The multi-parameter collection process is as follows: real-time collection of basic environment and harmful gas parameters; the camera captures one frame of image every 10 s, identifies the pig outline through the target detection algorithm, calculates the motion amount through the angle point matching method, the motion amount is the average value of the moving distance of the pig outline in each frame of image, and the excretion behavior confidence is calculated through the clustering algorithm, the excretion behavior confidence is to divide the stay duration into "short duration cluster" and "long duration cluster", the short duration cluster corresponds to the excretion behavior, the long duration cluster corresponds to the rest behavior, and the probability that the stay behavior belongs to the short duration cluster is calculated; the RFID reader reads the livestock ear tag information every 30 min, the ear tag stores the variety "three-way crossbred pig" and the growth stage "middle fattening", and the distance between the ear tag and the detection point is detected through the camera, and when the distance is not greater than 5 m, it is considered to be associated; the microbial terminal collects the microbial activity value every 30 min. The aggregation state determination mode is as follows: the number of pigs in each 10 m2 detection point area is counted through the camera, the preset aggregation threshold is 3 in the embodiment, and when the number is greater than or equal to 3, it is determined as "aggregation area", otherwise it is "non-aggregation area".

[0042] Finally, the data matrix is constructed. The construction rule is to associate all data according to the timestamp combined with the detection point coordinates. In this embodiment, the timestamp is accurate to s, and the detection point coordinates are accurate to m. Each matrix record contains the collection time, coordinates, temperature, humidity, wind speed, ammonia concentration, hydrogen sulfide concentration, CO2 concentration, exercise amount, excretion behavior confidence, microbial activity value, breed, growth stage, and aggregation state, realizing the spatio-temporal linkage of multi-source data.

[0043] Step two: dynamic detection optimization based on livestock behavior and aggregation state

[0044] This step is aimed at dynamic adjustment of sampling frequency, reason analysis of non-aggregation area, and effective data calculation. The specific operation mode is as follows:

[0045] The sampling frequency adjustment mode of the aggregation area is: if the detection point is an aggregation area, the sampling frequency is directly increased from the initial frequency to the high-frequency sampling frequency. In this embodiment, the initial frequency is 5 min / time, and the high-frequency sampling frequency is 1 min / time. When the number of pigs is less than 3 for 5 consecutive minutes, the aggregation state is released, and the initial sampling frequency is restored. Taking the detection point (20m, 5m) as an example, this point is the aggregation area around the feeding trough, and the sampling frequency is adjusted according to the above rules.

[0046] The sampling frequency adjustment and reason analysis process of the non-aggregation area is: if the non-aggregation area duration exceeds the preset non-aggregation time, in this embodiment, the preset non-aggregation time is 10 min, the local temperature, humidity, harmful gas concentration, ground humidity, and microbial activity value are detected, the comparison is made with the suitable environment interval of finishing pigs in the middle period, the suitable environment interval of finishing pigs in the middle period is temperature 20-24℃, ammonia not more than 10ppm, etc., the reason label is generated, for example, the local temperature of detection point (80m, 5m) is 27℃, which is higher than the suitable interval, and the label of "high temperature leading to non-aggregation" is generated; if the duration does not exceed the preset time, the frequency is adjusted combined with the exercise amount and excretion behavior confidence. If "exercise amount greater than or equal to exercise amount reference value" or "excretion behavior confidence greater than or equal to preset confidence threshold" is collected for 2 consecutive times, it is increased to high frequency, otherwise the initial frequency is maintained. In this embodiment, the exercise amount reference value is 0.3m / s, and the preset confidence threshold is 0.6.

[0047] The calculation of the behavior influence coefficient and the effective data generation process are as follows: the behavior influence coefficient includes the exercise amount proportion, the excretion behavior confidence proportion, and the microbial activity correction term. In this embodiment, the exercise amount proportion weight is 40%, the excretion behavior confidence proportion weight is 60%, if the microbial activity value is greater than the preset microbial safety threshold, the coefficient is increased by the preset correction proportion, in this embodiment, the preset microbial safety threshold is 500 RLU, and the preset correction proportion is 10%. Taking a certain aggregation area detection point as an example, the actual exercise amount is 0.25 m / s, the excretion behavior confidence is 0.724, the microbial activity value is 480 RLU and does not exceed the standard, the behavior influence coefficient = (0.25 / 0.3) x 40% + 0.724 x 60% + 0, and the result is about 0.767; the effective data = original collected data x behavior influence coefficient, for example, the original ammonia concentration of this point is 8 ppm, the effective ammonia concentration = 8 x 0.767, and the result is about 6.14 ppm.

[0048] Step three: environment prediction based on LSTM attention mechanism

[0049] This step focuses on the training and environment prediction of the LSTM attention model, and the detailed implementation is as follows:

[0050] Before model training, data preparation and feature selection need to be completed. The training data set uses multi-source data matrix in the past 30 days, and 24 groups of data are selected every day, that is, 1 group per hour, including the average value of effective data in this hour, covering different time periods such as before feeding, after feeding, and night, and different environment states such as normal and exceeding the standard; 8 types of effective data are selected as input features, which are effective temperature, effective humidity, effective ammonia concentration, effective hydrogen sulfide concentration, effective CO2 concentration, exercise amount, excretion behavior confidence, and effective microbial parameter, effective microbial parameter = microbial activity value x behavior influence coefficient, and the feature selection is based on "Pears correlation coefficient with future environment parameters is greater than or equal to 0.7".

[0051] The specific operation of model training and prediction is as follows: the model adopts the structure of "LSTM hidden layer + attention layer", in this embodiment, the LSTM hidden layer is set to 64 neurons, the attention layer allocates weights according to the "correlation of features and future harmful gas parameters", ammonia feature weight 0.3, microbial feature weight 0.2, temperature feature weight 0.15, humidity feature weight 0.15, CO2 feature weight 0.1, hydrogen sulfide feature weight 0.1, exercise amount feature weight 0.05, and excretion behavior confidence feature weight 0.05; the training parameter adopts Adam optimizer, in this embodiment, the preset learning rate is 0.001, the mean square error of the predicted value and the actual value is taken as the loss function, the iteration training is performed until the loss function is less than or equal to 0.05, in this embodiment, the preset loss function threshold is 0.05, and the iteration number is greater than or equal to 1000 times; when the prediction is executed, the data aggregation terminal triggers once every 30 minutes, each time the effective data in the last 1 hour is called, at least 12 groups, and the environmental prediction data matrix of the future 1 hour is output, which is divided into 6 segments according to 10 min / segment, including the predicted temperature, predicted humidity, predicted ammonia concentration, predicted hydrogen sulfide concentration, predicted CO2 concentration, predicted microbial activity value and corresponding detection point coordinates of each segment.

[0052] Step four: hierarchical regulation and feedback combining thermal comfort and microbial safety

[0053] This step focuses on environmental suitability assessment, hierarchical regulation execution and model feedback optimization, and the specific execution mode is as follows:

[0054] The environmental suitability assessment is carried out from the aspects of thermal comfort and microbial safety. The thermal comfort assessment adopts the general temperature and humidity index calculation of animal husbandry, the temperature and humidity index is abbreviated as THI, the formula is temperature and humidity index = (temperature + humidity percentage x temperature) x 0.72 + 40.6, in this embodiment, the preset thermal comfort interval of fattening pigs in the middle period is 60 to 65, the interval is set according to the standard "environmental quality related standards for livestock and poultry farms", the standard number is NY / T388-2021; the microbial safety assessment compares the predicted microbial activity value with the preset microbial safety threshold, in this embodiment, the preset microbial safety threshold is 500 RLU.

[0055] The hierarchical regulation matches different measures according to risk levels. The first-level regulation is started for the single parameter exceeding the standard, for example, only the microbial activity value exceeds the standard, the atomizing disinfection nozzle above the detection point is started, the atomizing disinfection nozzle is internally provided with a preset concentration of adaptive disinfectant, the adaptive disinfectant is 0.3% peracetic acid in the embodiment, the preset spraying period is sprayed, the preset spraying period is 1 min every 15 min in the embodiment; if only the temperature exceeds the standard, the wet curtain cooling device is started. The second-level regulation is started for two or more parameters exceeding the standard, for example, the predicted temperature 25℃ exceeds the upper limit of 24℃, the microbial activity value 510RLU exceeds the threshold value of 500RLU, the “global ventilation equipment + disinfection equipment” is started, the global ventilation equipment is operated at full power, and the disinfection equipment is sprayed for a preset spraying time, which is 5 min in the embodiment. The third-level regulation is started for the temperature and humidity index exceeding the upper limit of the thermal comfort interval, the harmful gas concentration exceeding the standard and the microbial activity value exceeding the standard, the “ground treatment equipment” is added on the basis of the second-level regulation, for example, the quicklime spreader is operated.

[0056] The regulation effect feedback and model optimization process is that effective data is collected according to a preset reinspection period after regulation, the reinspection period of the first-level regulation is 5 min, the reinspection period of the second-level regulation is 3 min, and the reinspection period of the third-level regulation is 1 min in the embodiment; the error rate calculation includes the error rate of the conventional parameter and the error rate of the microbial parameter, the error rate of the microbial parameter = |reinspection effective microbial data-predicted microbial data| / predicted microbial data*100%; if any error rate is greater than a preset error rate threshold, the preset error rate threshold is 10% in the embodiment, the corresponding feature weight of the prediction model is adjusted, for example, the microbial parameter error rate exceeds the standard, the microbial feature weight is increased from 0.2 to 0.25, the reinspection data is supplemented to the training set, the model is retrained, and the retraining iteration number is 500 times in the embodiment.

[0057] Step five: differentiated threshold update based on variety stage and production data

[0058] This step focuses on differentiated threshold update combined with industry standards and production data, and the detailed operation process is as follows:

[0059] The threshold updating period and data source are set as follows: the updating period is every Sunday morning, when the livestock and poultry activity is less, and does not affect the normal breeding production; the data source includes two types, one is industry standard data, such as “Environmental Parameters and Measurement Methods for Large-scale Livestock Farms” and “Environmental Quality Related Standards for Livestock and Poultry Farms”, the standard number of “Environmental Parameters and Measurement Methods for Large-scale Livestock Farms” is GB / T17824.3-2008, and the standard number of “Environmental Quality Related Standards for Livestock and Poultry Farms” is NY / T388-2021; the other is actual production data in the shed, such as daily weight gain, survival rate and morbidity of livestock and poultry, the daily weight gain is collected by a weighing sensor for 3 times per week, the survival rate is obtained by image recognition to count the number of surviving pigs, and the morbidity is obtained by recording the abnormal behavior of pigs by a veterinarian.

[0060] The specific updating logic of each threshold is as follows: the microbial safety threshold is updated, if the morbidity in the past 1 week is higher than the industry standard, which is 2% in this embodiment, and the microbial activity value exceeds the current threshold value for many times, the preset threshold value is adjusted by the preset threshold value adjustment ratio, which is 10% in this embodiment, for example, from 500RLU to 450RLU; the exercise amount reference value is updated, if the daily weight gain is lower than the industry standard, which is 0.8kg in this embodiment, and the exercise amount of pigs in the shed is generally lower than the current reference value, the preset threshold value is adjusted by the preset threshold value adjustment ratio, which is 10% in this embodiment, for example, from 0.3m / s to 0.27m / s; the thermal comfort interval is updated, if the survival rate is lower than the industry standard, which is 98% in this embodiment, and the temperature and humidity index exceeds the upper limit of the current interval for many times, the upper limit is adjusted by the preset interval adjustment amplitude, which is 2 in this embodiment, for example, from 65 to 63.

[0061] After the method is applied to the fattening pig house, the environmental abnormality missed detection in the gathering area is significantly reduced, the non-gathering area regulation is changed from “blind trial” to “targeted treatment”, and the proportion of time that livestock and poultry are in a suitable environment is improved; the predictive model is prospective, so that the regulation intervention is more timely, and the continuous stress of environmental over-standard on livestock and poultry is avoided; the hierarchical regulation combined with threshold updating ensures the environmental quality while reducing the invalid operation of equipment, and the overall breeding precision management level is significantly improved, which meets the development direction of efficient and green large-scale livestock breeding.

[0062] The above is only a preferred specific embodiment of the present application; however, the protection scope of the present application is not limited thereto. Any person skilled in the art can make equivalent replacement or change within the technical scope disclosed in the present application according to the technical solution and improvement concept of the present application, which should be covered within the protection scope of the present application.

Claims

1. A livestock breeding house environment detection method, characterized by, Comprise the following steps: Step one, deploy multi-type detection terminal to collect basic environmental parameters, harmful gas parameters, livestock and poultry behavior parameters, microbial parameters and livestock and poultry basic information, determine the aggregation state of detection point, correlate various data to construct multi-source data matrix; Step two, combined with the exercise amount, excretion behavior confidence and aggregation state, dynamically adjust the sampling frequency, introduce the behavior influence coefficient to optimize the collected data to obtain effective data, and analyze the environment of the non-aggregation area; Step three, take the effective data as input to train the LSTM attention prediction model, and output the environmental prediction data matrix containing microbial parameters; Step four, based on the temperature and humidity index and the microbial safety threshold, evaluate the environmental suitability, start the hierarchical control, calculate the error rate after rechecking and optimize the model; Step five, combined with industry standards and production data, update the exercise amount reference value, thermal comfort interval and microbial safety threshold.

2. The livestock housing environment detection method according to claim 1, characterized in that, The multi-type detection terminal in step one includes a basic environment detection terminal, a harmful gas detection terminal, a livestock and poultry behavior detection terminal and a microbial detection terminal, the microbial detection terminal adopts an ATP bioluminescence sensor and is mainly deployed around the excretion area and feeding trough, the aggregation state is determined by comparing the number of livestock and poultry around the detection point with the preset aggregation threshold through the camera, the basic environment detection terminal is deployed according to the preset grid spacing with key area supplement, the key area includes ventilation port, livestock and poultry aggregation area and excretion area, the harmful gas detection terminal is co-located with the basic environment detection terminal, the livestock and poultry behavior detection terminal includes a high-definition camera and an RFID reader, and each livestock and poultry wears an RFID ear tag storing breed and growth stage information.

3. The livestock housing environment detection method of claim 1, wherein, The livestock and poultry behavior parameters in step one are obtained by capturing image frames through the camera at a preset period, identifying livestock and poultry contours through a target detection algorithm, calculating exercise amount through an angle point matching method, and obtaining excretion behavior confidence through a clustering algorithm, and the livestock and poultry basic information is obtained by reading the ear tag information through the RFID reader at a preset period and associating it to the detection point coordinates.

4. The livestock housing environment detection method of claim 1, wherein, In step two, the dynamic adjustment of the sampling frequency is as follows: the sampling frequency in the aggregation area is directly increased to a high frequency, and the initial sampling frequency is restored after the aggregation state is removed; when the duration of the non-aggregation area exceeds the preset non-aggregation time, the local temperature and humidity, harmful gas concentration, ground humidity and microbial parameters are detected to generate a cause label, the cause label includes high temperature, harmful gas exceeding, high humidity and microbial exceeding, which is generated by comparing the environmental parameters of the non-aggregation area with the corresponding breed stage suitable interval.

5. The livestock housing environment detection method of claim 1, wherein, The behavior influence coefficient in step two includes exercise amount proportion, excretion behavior confidence proportion and microbial activity correction term, when the microbial parameter exceeds the preset microbial safety threshold, the behavior influence coefficient is increased by a preset correction ratio, the effective data is the collected data multiplied by the behavior influence coefficient, and the exercise amount reference value is set according to the environmental parameter related standard of large-scale livestock and poultry farm, which is suitable for the corresponding livestock and poultry breed and growth stage.

6. The livestock housing environment detection method according to claim 1, wherein The input features of the effective data in step three include effective temperature, effective humidity, effective ammonia concentration, effective hydrogen sulfide concentration, effective CO2 concentration, exercise amount, excretion behavior confidence, and effective microorganism parameter, which is the microorganism parameter multiplied by a behavior influence coefficient; the LSTM attention prediction model is trained by an Adam optimizer at a preset learning rate, and the mean square error of the predicted value and the actual value is used as the loss function to iterate until the preset condition is met; the attention layer allocates weights according to the correlation of the features and future environmental parameters, and the weight of the microorganism parameter is set based on its correlation with future harmful gas parameters.

7. The livestock housing environment detection method according to claim 1, characterized in that, The temperature and humidity index in step four is calculated according to a general formula for animal husbandry, and the preset thermal comfort interval is set according to relevant standards for livestock and poultry farm environmental quality; the hierarchical regulation is as follows: the first regulation is for single parameter exceeding the standard, and the disinfection equipment is started when the microorganism parameter exceeds the standard, and the corresponding regulation equipment is started when other parameters exceed the standard; the second regulation is for two or more parameters exceeding the standard, and the global ventilation and disinfection equipment is started; The third regulation is for temperature and humidity index, harmful gas and microorganism parameter all exceeding the standard, and the global ventilation, disinfection and ground treatment equipment is started; the disinfectant used by the disinfection equipment is an adaptive disinfectant with a preset concentration, and the ground treatment equipment operates according to a preset treatment mode.

8. The livestock housing environment detection method of claim 1, wherein, The error rate in step four includes the microorganism parameter error rate, which is the absolute value of the difference between the rechecked effective microorganism data and the predicted microorganism data divided by the predicted microorganism data and multiplied by a percentage coefficient; when the error rate exceeds the preset threshold, adjust the corresponding feature weight of the prediction model and supplement the rechecked data for retraining.

9. The livestock housing environment detection method of claim 1, wherein, The production data in step five includes daily weight gain, survival rate and morbidity of livestock and poultry, daily weight gain is obtained by weighing sensor, and survival rate is obtained by image recognition; the threshold updating is as follows: when the morbidity is higher than the industry standard and the microorganism parameter exceeds the standard, the microorganism safety threshold is lowered; when the daily weight gain is lower than the standard and the exercise amount is generally low, the exercise amount reference value is lowered; when the survival rate is lower than the standard and the temperature and humidity index exceeds the upper limit, the upper limit of the thermal comfort interval is lowered.

10. The livestock housing environment detection method of claim 1, wherein, The high-frequency sampling frequency, initial sampling frequency, preset non-aggregation time, preset correction ratio in step two, the preset learning rate, preset iteration number, preset loss function threshold, preset prediction period in step three, the preset spraying period, preset rechecking period, preset error rate threshold in step four, and the preset threshold lowering ratio, preset interval lowering amplitude in step five are all configurable parameters.