Intelligent monitoring method and system for harmful gas in livestock farm based on big data
By integrating big data from multiple sources and using an event-triggered mechanism, dynamic thresholds are generated, which solves the problems of false alarms and lack of prediction in the monitoring system for harmful gases in farms. This enables accurate gas concentration monitoring and proactive early warning, improving the system's intelligence and reliability.
Patent Information
- Application Number
- CN202511694185.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-10
AI Technical Summary
Existing hazardous gas monitoring systems in farms cannot adapt to dynamic environmental changes, resulting in frequent false alarms and a lack of predictive capabilities, making early intervention impossible. Sensor malfunctions may trigger false alarms or cause dangerous situations to be overlooked.
By employing multi-source data fusion technology based on big data and combining it with an event triggering mechanism, dynamic thresholds are generated through spatiotemporal alignment, temporal decomposition, and multivariate correlation analysis. Operational events are identified and the gas concentration prediction model is adjusted to achieve intelligent monitoring and real-time status assessment of harmful gas concentrations.
It reduced the false alarm rate and false negative rate of the system, improved the effectiveness and reliability of early warning, realized the transformation from passive response to proactive prediction, enhanced the safety and foresight of production management, and has the ability to improve itself.
Smart Images

Figure CN121499747A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of environmental gas monitoring technology, and in particular relates to a method and system for intelligent monitoring of harmful gases in livestock farms based on big data. Background Technology
[0002] Environmental monitoring in livestock farms is a crucial component of modern intensive livestock management. It aims to determine the concentration of harmful gases such as ammonia and hydrogen sulfide in the air through chemical analysis, thereby ensuring livestock health, improving production efficiency, and reducing pollution to the surrounding environment. Deploying gas sensors within the farm to analyze and detect air components in real-time or periodically is a key technological means to ensure a safe and controllable livestock environment.
[0003] Existing technologies for monitoring harmful gases in livestock farms typically involve installing gas sensors within the farming area to collect concentration data in real time. These systems compare the collected concentration values with a pre-set, fixed safety threshold. Once the real-time concentration value measured by the sensor exceeds this threshold, the system triggers an alarm, alerting management personnel or activating simple automated controls such as turning on ventilation equipment.
[0004] However, existing technical solutions have shortcomings in practical applications. First, the fixed thresholds they employ cannot adapt to the dynamic changes in the internal environment of farms. For example, normal production activities such as temperature increases or feed feeding can cause short-term, reasonable fluctuations in gas concentrations. Fixed thresholds cannot distinguish between normal fluctuations and abnormal increases, leading to frequent false alarms. Second, these systems are essentially passive response systems, only issuing alarms after the concentration of harmful gases has reached or exceeded dangerous levels, lacking predictive capabilities and unable to achieve early intervention. Finally, existing systems typically cannot effectively assess the state of the sensors themselves. When sensors malfunction or data drift occurs, erroneous output data may trigger unnecessary alarms or cause dangerous situations to be overlooked. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a method and system for intelligent monitoring of harmful gases in livestock farms based on big data. By employing multi-source data fusion technology and combining it with an event triggering mechanism, it can achieve intelligent monitoring and real-time status assessment of harmful gas concentrations in livestock farms.
[0006] The above objectives can be achieved through the following approach: The intelligent monitoring method for harmful gases in livestock farms based on big data includes the following steps: Acquire data on harmful gas concentrations, operational data, and environmental data from the farm, and perform spatiotemporal alignment and fusion to generate a multi-source dataset; Time-series decomposition and multivariate correlation analysis were performed on hazardous gas concentration data and environmental data to obtain the baseline fluctuation range of hazardous gas concentration. Adaptive weighting adjustment was then applied to the baseline fluctuation range of hazardous gas concentration to generate a dynamic threshold. Identify the event triggering information contained in the operational data, and process the multi-source dataset based on the event triggering information to generate preprocessed data; The preprocessed data is input into a preset gas concentration prediction model to generate gas concentration prediction values. Based on predicted gas concentrations and dynamic thresholds, harmful gas concentration status information or early warning signals are generated.
[0007] Preferably, generating multi-source datasets includes: Collect data on the concentration of harmful gases; Acquire operational data including ventilation equipment status and feed feeding time; Acquire environmental data including temperature and humidity; Harmful gas concentration data, operational data, and environmental data are aligned and correlated based on timestamps to generate a multi-source dataset.
[0008] Preferably, the baseline fluctuation range for harmful gas concentration includes: Time-series decomposition and multivariate correlation analysis were performed on hazardous gas concentration data and environmental data to obtain statistical characteristics of hazardous gas concentrations. Confidence intervals are calculated for the statistical characteristics of harmful gas concentrations to obtain the baseline fluctuation range of harmful gas concentrations.
[0009] Preferably, generating preprocessed data includes: Data cleaning and normalization are performed on the multi-source dataset to obtain the initial processed data; Identify feed feeding events or ventilation equipment status change events from operational data as event triggering information; The initial data is enhanced based on the event trigger information to generate preprocessed data.
[0010] Preferably, feeding events or ventilation equipment status change events are identified from operational data, and the event triggering information includes: Monitor the feed feeding schedule in the operational data and detect feed feeding events; Compare the ventilation equipment operation logs to detect events that change the status of the ventilation equipment; Detected feed feeding events or ventilation equipment status change events are marked as event trigger information.
[0011] Preferably, the predicted concentration of the generated gas includes: Extract gas concentration trend features from preprocessed data; Monitor operational and environmental data to determine whether event triggering conditions are met; When the event triggering conditions are met, the prediction weights of the gas concentration prediction model are adjusted, and the gas concentration trend characteristics are used to generate the gas concentration prediction value.
[0012] Preferably, when generating the predicted gas concentration value, the method further includes: Based on the functional zoning and breeding density of the farm, the farm is divided into multiple independent sub-areas. Historical data on harmful gas concentrations, operational data, and environmental data of each sub-area are collected to construct a dedicated historical database for each sub-area. For each sub-region's dedicated historical database, a transfer learning combined with a random forest algorithm is used to train a sub-region-specific gas concentration prediction model. Acquire data on sudden changes in the external environment surrounding the farm, define them as external environmental triggering events, and construct a threshold library for external environmental events; Monitor operational data, environmental data, and external environment data. If the operational event triggering conditions or the external environment triggering event conditions are met, then: The sub-region-specific gas concentration prediction model is invoked, the prediction weights of the sub-region-specific gas concentration prediction model are adjusted, and the real-time preprocessed data of the sub-region is combined with the sub-region-specific gas concentration prediction model to generate accurate gas concentration prediction values for the sub-region.
[0013] Preferably, generating harmful gas concentration status information or early warning signals includes: The predicted gas concentration is compared with a dynamic threshold. If the predicted gas concentration exceeds the dynamic threshold, a preliminary exceedance signal is generated. Acquire real-time operational status data of hazardous gas monitoring equipment; Based on real-time operational status data, the credibility of preliminary exceedance signals is verified and decisions are made to generate harmful gas concentration status information or early warning signals.
[0014] Preferably, after generating harmful gas concentration status information or early warning signals, the process further includes: Based on the concentration status information or early warning signal of harmful gases, generate harmful gas regulation and control instructions; Issue harmful gas regulation and control commands and collect gas concentration data after execution; The actual effect is evaluated based on the gas concentration data after execution, and an effect evaluation result is generated. Adjust the dynamic threshold or gas concentration prediction model based on the effect evaluation results.
[0015] A big data-based intelligent monitoring system for harmful gases in livestock farms, used to implement the above methods, includes: The multi-source heterogeneous data acquisition and fusion processing module is used to acquire harmful gas concentration data, operational data, and environmental data from the farm, and perform spatiotemporal alignment and fusion to generate a multi-source dataset. The dynamic threshold analysis module is used to perform time-series decomposition and multivariate correlation analysis on hazardous gas concentration data and environmental data to obtain the baseline fluctuation range of hazardous gas concentration. The module then performs adaptive weighted adjustment on the baseline fluctuation range of hazardous gas concentration to generate dynamic thresholds. The event triggering and preprocessing module is used to identify event triggering information contained in the operation data, and to process the multi-source dataset according to the event triggering information to generate preprocessed data. The intelligent gas concentration prediction module is used to input preprocessed data into a preset gas concentration prediction model to generate gas concentration prediction values. The status assessment and early warning module is used to generate hazardous gas concentration status information or early warning signals based on gas concentration prediction values and dynamic thresholds.
[0016] The present invention has the following advantages: This invention replaces the fixed thresholds of traditional monitoring methods by constructing a dynamic threshold that adapts to environmental factors. This dynamic threshold can scientifically define the normal fluctuation range of harmful gas concentrations under different temperature, humidity, and other conditions, thereby accurately distinguishing between normal concentration fluctuations caused by routine environmental changes and genuine abnormal exceedance events. This reduces the false alarm rate and false negative rate of the system, and improves the effectiveness and reliability of early warning.
[0017] This invention introduces an event-driven predictive model capable of predicting future trends in hazardous gas concentrations. By identifying key operational events such as feed feeding and the start / stop of ventilation equipment, and analyzing their impact on gas concentrations, this method achieves a shift from passive response to proactive prediction. It can issue early warnings before hazardous gas concentrations reach dangerous levels, enhancing the safety and foresight of production management.
[0018] This invention constructs a closed-loop intelligent system integrating verification and self-optimization functions, improving the reliability and intelligence level of the monitoring system. Before generating an early warning, the system verifies the operating status of relevant monitoring equipment to eliminate false information caused by hardware failures. Furthermore, the system can issue control commands, evaluate the intervention effect, and use the evaluation results to adjust the prediction model and dynamic thresholds, enabling it to continuously learn and self-improve, thus ensuring the accuracy and adaptability of the monitoring method in long-term operation. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the method of the present invention; Figure 2This is a correlation analysis diagram of environmental factors and gas concentration in Embodiment 1 of the present invention; Figure 3 This is a diagram showing the relationship between the environment and the dynamic threshold in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the system of the present invention. Detailed Implementation
[0020] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0021] Example 1: A smart monitoring method for harmful gases in livestock farms based on big data. This method employs multi-source data fusion technology combined with an event triggering mechanism to achieve intelligent monitoring and real-time status assessment of harmful gas concentrations in livestock farms. The steps include: Acquire data on harmful gas concentrations, operational data, and environmental data from the farm, and perform spatiotemporal alignment and fusion to generate a multi-source dataset; Time-series decomposition and multivariate correlation analysis were performed on hazardous gas concentration data and environmental data to obtain the baseline fluctuation range of hazardous gas concentration. Adaptive weighting adjustment was then applied to the baseline fluctuation range of hazardous gas concentration to generate a dynamic threshold. Identify the event triggering information contained in the operational data, and process the multi-source dataset based on the event triggering information to generate preprocessed data; The preprocessed data is input into a preset gas concentration prediction model to generate gas concentration prediction values. Based on predicted gas concentrations and dynamic thresholds, harmful gas concentration status information or early warning signals are generated.
[0022] First, spatiotemporal alignment technology is used to integrate discrete data on harmful gas concentrations, environmental parameters, and operational behaviors within the farm into a unified, synchronized multi-source dataset, laying the foundation for in-depth analysis. Then, two analysis paths are initiated in parallel. One path performs temporal decomposition and correlation modeling on historical gas concentration and environmental data, aiming to reveal the normal fluctuation patterns of gas concentrations under different environmental conditions, thereby generating a dynamic threshold that can adapt to environmental changes. The other path focuses on identifying key event triggering information, such as feeding and ventilation, from the operational data, and using this as a basis for feature enhancement of the multi-source dataset, generating preprocessed data that allows the model to understand the impact of specific operations. Finally, this preprocessed data containing event information is input into the prediction model to obtain high-precision predictions of future gas concentrations. The core decision-making mechanism of this method compares the predicted gas concentration value, representing future trends, with a dynamic threshold representing the normal boundary of the current operating conditions, using this as a judgment criterion to generate status information or early warning signals.
[0023] Generating multi-source datasets includes: Collect harmful gas concentration data; acquire operational data including ventilation equipment status and feed feeding time; acquire environmental data including temperature and humidity; align and correlate the harmful gas concentration data, operational data, and environmental data according to timestamps to generate a multi-source dataset.
[0024] First, three types of heterogeneous data are collected and acquired in parallel through a sensor network and automated control system deployed within the farm. The first type is core harmful gas concentration data, which is continuously monitored by electrochemical or infrared gas sensors deployed at key locations within the farming area to measure the volume concentration of key harmful gases such as ammonia and hydrogen sulfide, and a precise timestamp is added to each concentration reading.
[0025] The second category is operational data that directly affects gas generation and diffusion. This type of data is usually obtained from the automated control system of the farm, such as programmable logic controllers or data acquisition and monitoring control systems. It mainly includes the status of ventilation equipment, such as the start and stop records or speed percentage of the fans, as well as the feeding time, which is recorded as the specific time point when the automated feeding system performs the feeding action.
[0026] The third category is environmental data affecting gas evaporation rates and chemical reactions. This is collected in real-time by temperature and humidity sensors deployed in conjunction with gas sensors, which measure the temperature and relative humidity within the farm. Similarly, each data point is timestamped. After obtaining these three types of raw data streams, the core task is spatiotemporal alignment and fusion. Since the sampling frequencies and recording methods of different data sources vary—for example, gas concentration data may be collected periodically, while ventilation equipment status data is event-driven discrete recording—it is essential to unify them onto a common time reference.
[0027] The process establishes a unified time series with a preset time resolution, such as every minute. Then, the collected data on harmful gas concentrations, operational data, and environmental data are mapped onto this unified time series according to their respective timestamps. For variables with missing data at a given time point, methods such as forward imputation or linear interpolation are used to fill in the missing data, ensuring that at each timestamp, there is a complete set of data corresponding to it. This set of data comprehensively describes the harmful gas concentrations, key equipment operating status, and environmental conditions of the farm at that moment.
[0028] Ultimately, these aligned and correlated data were integrated into a structured multi-source dataset, providing high-quality data input for subsequent time series decomposition, correlation analysis, and model prediction.
[0029] The baseline fluctuation range for harmful gas concentrations includes: Time-series decomposition and multivariate correlation analysis were performed on hazardous gas concentration data and environmental data to obtain statistical characteristics of hazardous gas concentrations. Confidence intervals are calculated for the statistical characteristics of harmful gas concentrations to obtain the baseline fluctuation range of harmful gas concentrations.
[0030] First, time series decomposition and multivariate correlation analysis are performed on long-term hazardous gas concentration data and environmental data. Time series decomposition techniques, such as STL decomposition, are used to break down the raw hazardous gas concentration time series data into three components: a long-term trend term, a periodic seasonal term, and a random residual term. This step aims to remove deterministic and predictable patterns of change from the data so that subsequent analysis can focus on random fluctuations that cannot be explained by time and seasonality.
[0031] After completing the time-series decomposition, the relationship between the residuals and environmental data is analyzed, as this fluctuation best reflects concentration changes driven by environmental factors. At this point, multivariate correlation analysis is employed, such as establishing a generalized additive model, to accurately quantify the nonlinear effects of temperature and humidity—two key environmental data points—on the gas concentration residuals. This model can learn and express the normal baseline levels of gas concentration under different temperature and humidity conditions. Through this model, a series of statistical characteristics of harmful gas concentrations reflecting the core patterns of gas concentration can be obtained, such as the conditional expectation and conditional variance of gas concentration at specific temperatures and humidity levels.
[0032] These statistical characteristics are learned from historical data through model training. Based on this, confidence intervals are calculated for these statistical characteristics of hazardous gas concentrations. A confidence interval provides a statistical range within which it can be assumed with high probability that, under given environmental conditions, normal hazardous gas concentrations will fall within this range. Typically, a 95% or 99% confidence level is chosen, and the calculation formula is as follows: ; in, It is the conditional expectation value of the concentration of harmful gases predicted by a multivariate correlation analysis model under the current temperature and humidity environmental data conditions. This is the corresponding conditional standard deviation, also learned by the model from historical data, reflecting the normal fluctuation range under this environment. z is the critical value obtained from the standard normal distribution table based on the selected confidence level; for example, for a 95% confidence level, the z value is approximately 1.96. Through this calculation, a baseline fluctuation range of hazardous gas concentration that dynamically changes with environmental data is obtained, with its upper and lower bounds accurately characterizing the reasonable and normal fluctuation range of gas concentration under the current environment.
[0033] When generating dynamic thresholds, the first step is to use acquired historical hazardous gas concentration data and environmental data to obtain a baseline fluctuation range for hazardous gas concentrations through complex statistical modeling. The core of this step is to distinguish between normal fluctuations and abnormal increases in hazardous gas concentrations. The long-term hazardous gas concentration data is first decomposed into trend, seasonal, and residual terms. This helps to remove predictable periodic changes, such as circadian rhythms or seasonal effects.
[0034] Next, multivariate correlation analysis methods, such as establishing multiple regression models or gradient boosting tree models, are used to explore the quantitative relationship between environmental data, namely temperature and humidity, and the concentration residuals after time-series decomposition. Correlation analysis of environmental factors and gas concentrations is also employed. Figure 2 As shown, a model is established that can predict normal concentration levels based on current environmental conditions. Based on this model, the expected value and confidence interval of the hazardous gas concentration under any given combination of temperature and humidity can be calculated. The upper bound of this confidence interval constitutes the initial upper limit of the baseline fluctuation range of the hazardous gas concentration. After constructing the baseline range, it will be adaptively weighted to incorporate the influence of operational data, ultimately generating a dynamic threshold. The relationship between the environment and the dynamic threshold is as follows: Figure 3 As shown.
[0035] This adjustment is based on the fact that specific operational events within the farm can have short-term, dramatic, but predictable effects on gas concentrations. For example, feed administration events typically cause a significant increase in ammonia concentration over a short period. Therefore, an adjustment function can be constructed as follows: ; in, It is the dynamic threshold of the final output. It is the upper limit of the baseline fluctuation range of harmful gas concentration obtained through the aforementioned time series decomposition and correlation analysis. It is an adaptive adjustment calculated based on current operational data. This adjustment is itself a weighted combination of multiple operational factors; for example, it might be adjusted when an impending or recent feed feeding event is detected. A positive increment temporarily raises the threshold to tolerate concentration spikes resulting from normal operation; conversely, when high-power ventilation is detected, it will... A negative adjustment, because the concentration should be effectively controlled at a low level at this point, and any increase is more likely to be abnormal.
[0036] These weighting coefficients are obtained through statistical learning based on events calibrated from a large amount of historical data and their actual impact on concentration. In this way, the generated dynamic threshold is no longer a fixed red line, but a flexible and intelligent boundary that closely matches the real-time operating conditions of the farm.
[0037] The generated preprocessed data includes: Data cleaning and normalization are performed on the multi-source dataset to obtain the initial processed data; Identify feed feeding events or ventilation equipment status change events from operational data as event triggering information; The initial data is enhanced based on the event trigger information to generate preprocessed data.
[0038] First, data cleaning and normalization are performed on the spatiotemporally aligned multi-source dataset generated in the previous step to obtain initial processed data. Data cleaning aims to eliminate noise and outliers in the data. For example, moving average filtering can be used to smooth short-term fluctuations in harmful gas concentration data, or the isolated forest algorithm can be used to identify and remove isolated outliers caused by momentary sensor failures. Data normalization aims to eliminate the influence of different physical dimensions and numerical ranges, ensuring that all data features have equal weight in model training. Here, the min-max normalization method can be used to linearly map each dimension of the data to the interval [0, 1].
[0039] After completing the above steps, a clean and uniformly scaled initial processing dataset is obtained. Next, the focus is on identifying events from the operational data that have a significant abrupt impact on the concentration of harmful gases and marking them as event trigger information.
[0040] The system monitors operational data streams in real time, identifying feed feeding events by detecting feed feeding time records, and identifying status change events such as ventilation equipment activation, deactivation, or power level changes by comparing ventilation equipment status records at adjacent time points. Once these events are identified, an event trigger information marker is generated at the corresponding time point.
[0041] Finally, the initial processed data is augmented based on the event trigger information identified by these tags. Augmentation is a feature engineering technique aimed at enabling the model to more explicitly learn the correlation between event occurrence and gas concentration changes. For example, a new binary feature column can be added to the dataset, where the feature value is 1 for the corresponding time point and a short time window following a feeding event or a change in ventilation equipment status, and 0 for the rest. Furthermore, more complex derived features can be constructed, such as "time since last feeding" or "cumulative duration of ventilation equipment operation." Through these augmentations, the original initial processed data is transformed into preprocessed data containing explicit event information, providing richer and more crucial input features for subsequent predictive models.
[0042] Identify feed feeding events or ventilation equipment status change events from operational data. Event trigger information includes: Monitor the feed feeding schedule in the operational data and detect feed feeding events; Compare the ventilation equipment operation logs to detect events that change the status of the ventilation equipment; Detected feed feeding events or ventilation equipment status change events are marked as event trigger information.
[0043] First, two parallel monitoring modules are used to analyze the operational data stream in real time. The first module focuses on detecting feed feeding events, continuously monitoring operational data acquired from the automated feeding system. This data typically includes a precise feed feeding schedule. This module compares the current system time with the schedule, and once the current time matches the preset feeding time, or if it receives an immediate execution signal from the feeding system, the module immediately identifies a feed feeding event.
[0044] The second module is responsible for detecting changes in the ventilation equipment's status by continuously reading and comparing the operation logs of the ventilation equipment in the farm's environmental control system. This module caches the equipment status at the previous point in time, such as the fan's on / off status, operating power percentage, or speed. At each new point in time, it retrieves the latest equipment status and compares it with the cached old status. If a difference is found between the two statuses—for example, a fan changing from off to on, or power adjusting from 50% to 100%—the module determines that a ventilation equipment status change event has occurred and records the type and magnitude of the change.
[0045] Once any module detects a corresponding event, it immediately marks these detected feed feeding events or ventilation equipment status change events in the internal data stream. This marking can be achieved by adding a specific identifier to the corresponding timestamp row in the multi-source dataset or by setting a specific value to a dedicated event feature column. Ultimately, this set of marks with timestamps and event types collectively constitutes the event triggering information used for subsequent data augmentation processing and dynamic model adjustments.
[0046] The predicted concentration values of generated gases include: Extract gas concentration trend features from preprocessed data; Monitor operational and environmental data to determine whether event triggering conditions are met; When the event triggering conditions are met, the prediction weights of the gas concentration prediction model are adjusted, and the gas concentration trend characteristics are used to generate the gas concentration prediction value.
[0047] The first step involves extracting gas concentration trend features from the enhanced preprocessed data. Instead of simply using concentration values at a single point in time, this involves analyzing a series of hazardous gas concentration data within a historical time window to capture their inherent dynamic patterns, such as growth rate, fluctuation cycle, and inertia. This step can employ deep learning model structures capable of handling time-series dependencies, such as Long Short-Term Memory (LSTM) networks. By taking a certain length of historical data sequence as input, the hidden layer states within the model can be considered a highly condensed and abstract representation of the current gas concentration trend features.
[0048] This trend characteristic encompasses the core pattern of gas concentration evolution over time. Simultaneously, the latest operational and environmental data streams are monitored in real-time to continuously determine whether preset event triggering conditions are met. Event triggering conditions refer to key behaviors that can cause non-linear abrupt changes in harmful gas concentrations; for example, operational data showing ventilation equipment switching from off to on, or the feed dispensing system performing a feeding operation at a specified time. When the monitoring module detects that any event triggering condition is met, it enters a dynamic adjustment phase.
[0049] During this stage, the gas concentration prediction model adjusts its prediction weights. This does not mean retraining the model during prediction, but rather that the model is designed with specific structures for handling event inputs, such as attention mechanisms or gating units. When event-triggered information is activated as input, the model dynamically increases its attention to features related to that event, i.e., it increases the influence of weights associated with the event input, while potentially reducing its reliance on purely historical trend features.
[0050] Subsequently, the model combines the extracted gas concentration trend features with the activated event information to generate the final gas concentration prediction. A simplified model output can be expressed as: ; in, This represents the predicted gas concentration at the next point in time. It is a feature vector of gas concentration trend at the current time point t, extracted from historical preprocessed data. It is the event trigger information vector at the current time point t. For example, when the ventilation is turned on, the corresponding dimension of this vector is 1, otherwise it is 0. and These are the pre-trained weight matrices in the gas concentration prediction model, corresponding to trend features and event information, respectively, obtained by learning from a large amount of historical data during the model training phase. The nonlinear prediction function representing the model is responsible for integrating the effects of trends and events to generate the final prediction output.
[0051] The generation of hazardous gas concentration status information or early warning signals includes: The predicted gas concentration is compared with a dynamic threshold. If the predicted gas concentration exceeds the dynamic threshold, a preliminary exceedance signal is generated. Acquire real-time operational status data of hazardous gas monitoring equipment; Based on real-time operational status data, the credibility of preliminary exceedance signals is verified and decisions are made to generate harmful gas concentration status information or early warning signals.
[0052] First, the predicted gas concentration at a future point in time, output by the gas concentration prediction model, is compared in real time with a dynamic threshold calculated from current environmental and historical data. This dynamic threshold is not a fixed constant, but rather an upper limit that adapts to environmental conditions, representing the normal concentration fluctuation range under current conditions.
[0053] When the comparison results show that the predicted gas concentration exceeds the dynamic threshold, an alarm is not immediately issued. Instead, a preliminary exceedance signal is generated internally. This signal acts as an internal trigger, initiating the subsequent verification process. Next, the system proactively queries and retrieves real-time operational status data of the hazardous gas monitoring equipment related to the predicted point. This status data is a key indicator for measuring sensor health and data reliability, typically including whether the equipment is online, whether the power supply is normal, whether it is within the calibration validity period, and whether it has returned error codes or diagnostic information.
[0054] After acquiring this data, the credibility of the initial exceedance signals is verified and a decision is made based on preset rules. For example, a credibility evaluation function can be constructed: ; in, It is the final credibility score. , , These are binary or multivariate variables representing the device's online status, calibration status, and diagnostic status, respectively. For example, if the device is online... The value is 1 if offline and 0 if offline. , , The weighting coefficients are preset based on the importance of each state data and are obtained through historical data and expert experience.
[0055] Ultimately, the decision-making module determines the outcome based on the presence or absence of initial exceedance signals and their reliability scores. The level of the signal determines the final output. If a preliminary out-of-range signal exists and... A high score indicates that the predicted exceeding event is highly likely to be real, and a high-priority warning signal will be generated and issued. If the initial exceeding signal exists but... A low score may indicate that the exceedance is caused by a sensor malfunction. In this case, a low-priority hazardous gas concentration status message will be generated to alert management and may include an equipment maintenance suggestion. If no initial exceedance signal is found, a normal status message will be output.
[0056] After generating information on the concentration of harmful gases or warning signals, the following is also included: Based on the concentration status information or early warning signal of harmful gases, generate harmful gas regulation and control instructions; Issue harmful gas regulation and control commands and collect gas concentration data after execution; The actual effect is evaluated based on the gas concentration data after execution, and an effect evaluation result is generated. Adjust the dynamic threshold or gas concentration prediction model based on the effect evaluation results.
[0057] First, once a high-confidence warning signal is generated, control instructions are automatically triggered. Based on the current hazardous gas concentration information and combined with a pre-set expert rule base or reinforcement learning model, specific and executable hazardous gas regulation control instructions are generated. For example, if the warning indicates excessive ammonia concentration and environmental data shows high humidity, the control instruction might be "Turn on ventilation equipment No. 2 and No. 3 to 80% power and continue running for 30 minutes." This instruction not only specifies the equipment to be executed but also quantifies the operating parameters and duration to achieve the most efficient regulation effect.
[0058] Subsequently, through the interface with the farm's automated control system, this harmful gas regulation and control command is directly issued and automatically executed by actuators such as fans and heaters. During the execution of the control command and for a period of time after its completion, gas concentration data is continuously and frequently collected, forming a real-time data stream reflecting the effectiveness of the intervention measures.
[0059] Next, we proceed to the effectiveness evaluation phase. By comparing the predicted gas concentration before execution, the actual exceedance value, and the gas concentration data change curve after execution, we can quantitatively evaluate the actual effect of this control command. Evaluation indicators may include the concentration decrease rate, the time required to reach a safe concentration, and control costs, ultimately generating an effectiveness evaluation result.
[0060] Finally, and most importantly, the model and its parameters are adaptively adjusted based on the effectiveness evaluation results. If the evaluation shows that the actual concentration decrease is much slower than expected, this may indicate a bias in the gas diffusion model under current environmental conditions, or that the gas concentration prediction model is overly optimistic in its assessment of ventilation effectiveness. Accordingly, the relevant weights in the gas concentration prediction model can be automatically adjusted, such as increasing the weight of changes in ventilation equipment status on concentration prediction. Similarly, if the evaluation finds that the dynamic threshold for a certain warning is set too low, leading to an unnecessary response to a normal fluctuation, the calculation logic of the dynamic threshold will be fine-tuned based on the evaluation results; for example, the threshold may be appropriately relaxed under similar environmental and operational conditions.
[0061] To verify the feasibility of the method in this embodiment, it was applied to a large-scale modern pig farm. This pig farm is committed to improving the quality of the pigpens environment and reducing the health risks and declining production performance of livestock and poultry caused by excessively high concentrations of harmful gases such as ammonia (NH3) and hydrogen sulfide (H2S).
[0062] Currently, this pig farm primarily relies on gas concentration alarms with fixed thresholds for environmental monitoring. However, traditional methods have significant drawbacks: gas concentrations can rise instantaneously after routine operations such as feeding, easily triggering false alarms and causing alarm fatigue among management personnel; furthermore, under certain extreme high temperature and humidity conditions, even if gas concentrations do not reach the fixed threshold, they can still pose a continuous threat to livestock, and traditional methods lack the ability to detect such risks. This pig farm hopes to adopt the method described in this embodiment to achieve intelligent prediction, dynamic early warning, and closed-loop automatic control of harmful gases.
[0063] During verification, the pig farm deployed a comparative experiment in two independent buildings with identical environmental parameters and stock levels for a period of 6 months. One building served as the experimental group, equipped with the intelligent monitoring system based on the method described in this embodiment; the other building served as the control group, using a traditional fixed threshold alarm system with an ammonia threshold set at 20 ppm. The intelligent monitoring system, through a sensor network deployed within the buildings, acquired real-time data on harmful gas concentrations, temperature and humidity, and operational data, including the start / stop status of ventilation equipment and records of automated feed feeding times, and fused these data into a multi-source dataset through spatiotemporal alignment. The intelligent monitoring system executed two parallel analysis paths: first, based on historical gas concentration and environmental data, it generated dynamic thresholds that changed with the environment through time-series decomposition and multivariate correlation analysis; second, it identified event triggering information such as changes in feed feeding and ventilation status from the operational data, enhanced the data, and input it into the gas concentration prediction model to generate future concentration prediction values. Finally, the system compared the predicted values with the dynamic thresholds, verified the reliability by combining equipment status, generated early warning signals, and automatically issued control commands to drive the ventilation equipment.
[0064] To verify the beneficial effects of the method in this embodiment, data during the experiment were recorded and analyzed. Regarding the generation of the dynamic threshold, taking a specific day as an example, the environment was characterized by high temperature and humidity, with an average temperature of 31°C and humidity of 87%. Under these conditions, the volatilization of harmful gases intensifies, increasing their hazard. Based on environmental data analysis, the intelligent monitoring system adaptively lowered the dynamic threshold for ammonia to 15 ppm. At 2:00 PM, the ammonia concentration in the experimental group's building slowly climbed to 16 ppm, and the intelligent monitoring system immediately triggered an alarm and activated ventilation. In contrast, the fixed threshold alarm (20 ppm) in the control group did not issue any alarm, resulting in the pigs in that building being exposed to a higher concentration of ammonia for an extended period.
[0065] In terms of event-driven prediction and early warning, the pig farm performs automated feed feeding daily at 8:00 AM. In the control group, approximately 15 minutes after feeding, the ammonia concentration would surge from 12 ppm to 22 ppm, triggering a fixed threshold alarm each time, causing severe false alarm interference. In the experimental group, the intelligent monitoring system identified the "feed feeding" event trigger and predicted a short-term increase in concentration. Simultaneously, the intelligent monitoring system adaptively weighted and adjusted the dynamic threshold based on this event, temporarily raising the warning threshold to 25 ppm between 8:00 and 8:40 AM. Therefore, when the ammonia concentration rose to 23 ppm, the intelligent monitoring system determined it to be an expected fluctuation caused by normal operation and did not generate an alarm, effectively avoiding false alarms. On another day, due to an abnormal feed formulation, the concentration surged to 28 ppm after feeding, exceeding the temporarily adjusted dynamic threshold. The intelligent monitoring system immediately identified this as an anomaly and issued a high-priority warning, allowing managers to promptly identify the feed problem.
[0066] The closed-loop control and self-optimization mechanism of the method in this embodiment also demonstrates superiority. During a nighttime alert, the intelligent monitoring system predicted that the ammonia concentration would exceed the standard in one hour, and thus generated and issued a control command to "operate ventilation equipment No. 2 and No. 4 at 60% power for 20 minutes." After the command was executed, the intelligent monitoring system collected data on the concentration decrease, but through effect evaluation, it was found that the rate of decrease was 15% slower than the model's prediction. Based on this evaluation result, the intelligent monitoring system determined that ventilation efficiency was reduced under the current humidity conditions and automatically fine-tuned the weight of the humidity parameter in the gas concentration prediction model on the ventilation effect. Subsequently, the control commands of the intelligent monitoring system became more accurate in similar environments. Furthermore, when an ammonia sensor began to drift due to contamination, resulting in a preliminary exceedance signal, the intelligent monitoring system obtained the sensor's "needs calibration" operating status data during the reliability verification stage. Therefore, instead of generating an alert signal, it output a status message stating "Ammonia sensor data in area No. 3 is abnormal; maintenance recommended," avoiding confusion caused by equipment failure.
[0067] Data shows that the quality of the breeding environment in the experimental group's buildings was significantly improved through the intelligent monitoring system based on the method of this embodiment. During the 6-month experimental period, the average concentration of harmful gases in the experimental group was reduced by approximately 18% compared to the control group, with a warning accuracy rate of 97%, while the control group had an effective warning rate of less than 40% due to numerous false alarms. The false alarm rate in the experimental group was reduced by more than 90% compared to the control group. Automated control intervention reduced the risk response time from an average of more than 30 minutes for manual detection and operation to less than 1 minute.
[0068] Example 2: Based on Example 1, when generating the predicted gas concentration value, the following additional steps are included: Based on the functional zoning of the farm (such as nursery area, fattening area, and breeding stock area) and the stocking density, the farm is divided into multiple independent sub-regions. Historical data on harmful gas concentrations, operational data, and environmental data of each sub-region are collected to construct a dedicated historical database for each sub-region. For each sub-region's specific historical database, a transfer learning combined with a random forest algorithm is used to train a sub-region-specific gas concentration prediction model, which includes weighting factors for sub-region feature parameters (such as aquaculture species, age, and stocking density). Acquire data on sudden changes in the external environment around the farm (such as sudden temperature changes of ≥8℃ within 24 hours, heavy rain with hourly precipitation of ≥50mm, strong winds with instantaneous wind force of ≥6, etc.), define them as external environmental triggering events, and construct an external environmental event threshold library; Monitor operational data, environmental data, and external environmental data. If the operational event triggering conditions (such as changes in feed feeding or ventilation status) or the external environmental triggering event conditions (such as reaching a threshold in the external environmental event threshold database) are met, then: The system uses a dedicated gas concentration prediction model for the corresponding sub-region, instead of a pre-defined unified model. Adjust the prediction weights of sub-region feature parameters and external environmental influencing factors in the model (increase the weight ratio of humidity and air pressure-related features when external environmental factors are triggered). By combining real-time preprocessed data of the sub-region with the adjusted sub-region-specific gas concentration prediction model, accurate gas concentration prediction values for the sub-region are generated. Furthermore, the specific model is incrementally trained and its parameters are updated every 72 hours based on newly added real-time data of the sub-region.
[0069] In Example 1, a pre-set, unified gas concentration prediction model (general model) is used. However, the prediction may have large errors in local areas (especially when the farm covers a large area). By dividing the area into sub-regions and training a dedicated model, the model can be adapted to the farming patterns of different sub-regions, significantly improving the prediction accuracy of local areas.
[0070] Example 3: As Figure 2As shown, the intelligent monitoring system for harmful gases in livestock farms based on big data is used to implement the method in Example 1 or Example 2, including: The multi-source heterogeneous data acquisition and fusion processing module is used to acquire harmful gas concentration data, operational data, and environmental data from the farm, and perform spatiotemporal alignment and fusion to generate a multi-source dataset. The dynamic threshold analysis module is used to perform time-series decomposition and multivariate correlation analysis on hazardous gas concentration data and environmental data to obtain the baseline fluctuation range of hazardous gas concentration. The module then performs adaptive weighted adjustment on the baseline fluctuation range of hazardous gas concentration to generate dynamic thresholds. The event triggering and preprocessing module is used to identify event triggering information contained in the operation data, and to process the multi-source dataset according to the event triggering information to generate preprocessed data. The intelligent gas concentration prediction module is used to input preprocessed data into a preset gas concentration prediction model to generate gas concentration prediction values. The status assessment and early warning module is used to generate hazardous gas concentration status information or early warning signals based on gas concentration prediction values and dynamic thresholds.
Claims
1. A method for intelligent monitoring of harmful gases in livestock farms based on big data, characterized by the following steps: include: Acquire data on harmful gas concentrations, operational data, and environmental data from the farm, and perform spatiotemporal alignment and fusion to generate a multi-source dataset; Time-series decomposition and multivariate correlation analysis were performed on hazardous gas concentration data and environmental data to obtain the baseline fluctuation range of hazardous gas concentration. Adaptive weighting adjustment was then applied to the baseline fluctuation range of hazardous gas concentration to generate a dynamic threshold. Identify the event triggering information contained in the operational data, and process the multi-source dataset based on the event triggering information to generate preprocessed data; The preprocessed data is input into a preset gas concentration prediction model to generate gas concentration prediction values. Based on predicted gas concentrations and dynamic thresholds, harmful gas concentration status information or early warning signals are generated.
2. The intelligent monitoring method for harmful gases in livestock farms based on big data according to claim 1, characterized in that, Generating multi-source datasets includes: Collect data on the concentration of harmful gases; Acquire operational data including ventilation equipment status and feed feeding time; Acquire environmental data including temperature and humidity; Harmful gas concentration data, operational data, and environmental data are aligned and correlated based on timestamps to generate a multi-source dataset.
3. The intelligent monitoring method for harmful gases in livestock farms based on big data according to claim 1, characterized in that, The baseline fluctuation range for harmful gas concentrations includes: Time-series decomposition and multivariate correlation analysis were performed on hazardous gas concentration data and environmental data to obtain statistical characteristics of hazardous gas concentrations. Confidence intervals are calculated for the statistical characteristics of harmful gas concentrations to obtain the baseline fluctuation range of harmful gas concentrations.
4. The intelligent monitoring method for harmful gases in livestock farms based on big data according to claim 1, characterized in that, The generated preprocessed data includes: Data cleaning and normalization are performed on the multi-source dataset to obtain the initial processed data; Identify feed feeding events or ventilation equipment status change events from operational data as event triggering information; The initial data is enhanced based on the event trigger information to generate preprocessed data.
5. The intelligent monitoring method for harmful gases in livestock farms based on big data according to claim 4, characterized in that, Identify feed feeding events or ventilation equipment status change events from operational data. Event trigger information includes: Monitor the feed feeding schedule in the operational data and detect feed feeding events; Compare the ventilation equipment operation logs to detect events that change the status of the ventilation equipment; Detected feed feeding events or ventilation equipment status change events are marked as event trigger information.
6. The intelligent monitoring method for harmful gases in livestock farms based on big data according to claim 1, characterized in that, The predicted concentration values of generated gases include: Extract gas concentration trend features from preprocessed data; Monitor operational and environmental data to determine whether event triggering conditions are met; When the event triggering conditions are met, the prediction weights of the gas concentration prediction model are adjusted, and the gas concentration trend characteristics are used to generate the gas concentration prediction value.
7. The intelligent monitoring method for harmful gases in livestock farms based on big data according to claim 6, characterized in that, When generating predicted gas concentration values, the following are also included: Based on the functional zoning and breeding density of the farm, the farm is divided into multiple independent sub-areas. Historical data on harmful gas concentrations, operational data, and environmental data of each sub-area are collected to construct a dedicated historical database for each sub-area. For each sub-region's dedicated historical database, a transfer learning combined with a random forest algorithm is used to train a sub-region-specific gas concentration prediction model. Acquire data on sudden changes in the external environment surrounding the farm, define them as external environmental triggering events, and construct a threshold library for external environmental events; Monitor operational data, environmental data, and external environment data. If the operational event triggering conditions or the external environment triggering event conditions are met, then: The sub-region-specific gas concentration prediction model is invoked, the prediction weights of the sub-region-specific gas concentration prediction model are adjusted, and the real-time preprocessed data of the sub-region is combined with the sub-region-specific gas concentration prediction model to generate accurate gas concentration prediction values for the sub-region.
8. The intelligent monitoring method for harmful gases in livestock farms based on big data according to claim 1, characterized in that, The generation of hazardous gas concentration status information or early warning signals includes: The predicted gas concentration is compared with a dynamic threshold. If the predicted gas concentration exceeds the dynamic threshold, a preliminary exceedance signal is generated. Acquire real-time operational status data of hazardous gas monitoring equipment; Based on real-time operational status data, the credibility of preliminary exceedance signals is verified and decisions are made to generate harmful gas concentration status information or early warning signals.
9. The intelligent monitoring method for harmful gases in livestock farms based on big data according to claim 1, characterized in that, After generating information on the concentration of harmful gases or warning signals, the following is also included: Based on the concentration status information or early warning signal of harmful gases, generate harmful gas regulation and control instructions; Issue harmful gas regulation and control commands and collect gas concentration data after execution; The actual effect is evaluated based on the gas concentration data after execution, and an effect evaluation result is generated. Adjust the dynamic threshold or gas concentration prediction model based on the effect evaluation results.
10. A big data-based intelligent monitoring system for harmful gases in livestock farms, used to implement the method described in any one of claims 1-9, characterized in that, include: The multi-source heterogeneous data acquisition and fusion processing module is used to acquire harmful gas concentration data, operational data, and environmental data from the farm, and perform spatiotemporal alignment and fusion to generate a multi-source dataset. The dynamic threshold analysis module is used to perform time-series decomposition and multivariate correlation analysis on hazardous gas concentration data and environmental data to obtain the baseline fluctuation range of hazardous gas concentration. The module then performs adaptive weighted adjustment on the baseline fluctuation range of hazardous gas concentration to generate dynamic thresholds. The event triggering and preprocessing module is used to identify event triggering information contained in the operation data, and to process the multi-source dataset according to the event triggering information to generate preprocessed data. The intelligent gas concentration prediction module is used to input preprocessed data into a preset gas concentration prediction model to generate gas concentration prediction values. The status assessment and early warning module is used to generate hazardous gas concentration status information or early warning signals based on gas concentration prediction values and dynamic thresholds.