Livestock and poultry house greenhouse gas monitoring method, device, equipment and medium

By using a multi-task learning network and a digital twin simulation system, combined with physiological stress state, individual behavior and meteorological data, dynamic modulation factors are generated, which solves the problem of inaccurate data in greenhouse gas monitoring of livestock and poultry houses, realizes accurate prediction and optimized control, and improves the accuracy of monitoring data and emission reduction efficiency.

CN122196433APending Publication Date: 2026-06-12INST OF GEOGRAPHICAL SCI & NATURAL RESOURCE RES CAS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INST OF GEOGRAPHICAL SCI & NATURAL RESOURCE RES CAS
Filing Date
2026-03-16
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing methods for monitoring greenhouse gases in livestock and poultry houses cannot accurately obtain the emission levels of the population. Traditional monitoring technologies are prone to failure under extreme weather conditions, resulting in inaccurate data and an inability to effectively optimize emission reduction.

Method used

By employing a multi-task learning network combined with meteorological forecast big data and a digital twin simulation system, dynamic modulation factors are generated by acquiring physiological stress state data, individual behavior data, and gas concentration data of the oral and nasal microenvironment. Dynamic individual emission source strength is calculated, and accurate prediction and optimized control of future gas concentration fields are performed.

🎯Benefits of technology

It enables accurate prediction and optimized control of greenhouse gas emissions from livestock and poultry houses, overcomes the data distortion problem of traditional monitoring technologies, effectively addresses animal stress and emission surges under extreme weather conditions, improves the accuracy of monitoring data, and provides support for intelligent emission reduction optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122196433A_ABST
    Figure CN122196433A_ABST
Patent Text Reader

Abstract

The application discloses a livestock and poultry house greenhouse gas method, device, equipment and medium, belongs to big data analysis, carbon emission monitoring and intelligent livestock technology field. The method comprises the following steps: acquiring target sensing big data and weather forecast big data of target animals; generating a dynamic modulation factor based on physiological stress state data and individual behavior data; calculating a dynamic individual emission source intensity based on the dynamic modulation factor and the oral-nasal microenvironment gas concentration data; inputting the weather forecast big data as a dynamic boundary condition and the dynamic individual emission source intensity as a dynamic source term into a preset climate prediction driven digital twin simulation system, deducing the time and space distribution of the gas concentration field in the house at multiple future moments; and taking the minimization of the cumulative emission, the operation energy consumption and the predicted animal group stress level in the future prediction time domain as the optimization target, and rolling optimizing the future control action sequence under the weather disturbance to control the house environment. The application can monitor the greenhouse gas emission of the livestock and poultry house.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of big data analysis, carbon emission monitoring and smart animal husbandry technology, and specifically relates to a method, device, equipment and medium for monitoring greenhouse gases in livestock and poultry houses. Background Technology

[0002] With the increasing severity of global climate change, greenhouse gas emission reduction in agriculture has become an international consensus. Livestock farming, as a part of agriculture, primarily involves the raising of terrestrial animals. As a major anthropogenic source of methane emissions, livestock farming faces unprecedented challenges in carbon emission accounting and control technologies.

[0003] Currently, widely used technologies mainly fall into two categories: one is the "gold standard" measurement based on the respiration chamber, which, while highly accurate, restricts animal activity, alters their physiological state, and is extremely costly, making it unsuitable for large-scale production environments; the other is eddy covariance based on micrometeorology techniques or monitoring using single-point sensors within the barn. However, livestock and poultry barns are semi-enclosed, complex fluid environments, influenced by mechanical ventilation, thermal buoyancy-driven flow, and animal movement, resulting in strong spatiotemporal heterogeneity in the gas concentration field. Traditional fixed-point monitoring often leads to data distortion due to improper sampling locations (such as in ventilation dead zones or dilution zones at air inlets), failing to represent the true emission levels of the entire herd.

[0004] Therefore, monitoring greenhouse gases in livestock and poultry houses requires not only acquiring local gas concentration information but also comprehensive analysis combining multi-source information such as physiological stress data, individual behavioral data, and meteorological forecast data. In recent years, although target perception big data and meteorological forecast big data have been gradually applied to smart farming and ecological environment monitoring, existing methods for monitoring greenhouse gases in livestock and poultry houses still fall short in their ability to integrate and utilize the aforementioned multi-source data.

[0005] Therefore, in the monitoring of greenhouse gases in livestock and poultry houses, the feedback adjustment based on real-time sensors often fails due to the large thermal inertia of the equipment when faced with extreme weather changes. This causes animals to suffer from heat and cold stress, triggering a nonlinear surge in greenhouse gas emissions. Ultimately, this leads to inaccurate calculations of monitored greenhouse gas data and makes emission reduction optimization difficult. Summary of the Invention

[0006] This application provides a method, apparatus, equipment, and medium for monitoring greenhouse gas emissions in livestock and poultry houses, which can accurately monitor greenhouse gas emissions from the microenvironment of livestock and poultry houses and optimize emission reduction.

[0007] On the one hand, embodiments of this application provide a method for monitoring greenhouse gases in livestock and poultry houses, the method comprising: Acquire target perception big data and weather forecast big data of the target animal. The target perception big data includes physiological stress state data, individual behavior data and oral and nasal microenvironment gas concentration data. Based on the physiological stress state data and individual behavior data, a multi-task learning network is used to synchronously identify animal behavior categories and generate dynamic modulation factors for correcting the baseline emission rate. Based on the dynamic modulation factor and the gas concentration data of the oral and nasal microenvironment, the dynamic individual emission source strength modulated by physiological stress is calculated. Using the meteorological forecast big data as dynamic boundary conditions and the dynamic individual emission source strength as dynamic source terms, the data is input into a preset climate forecast-driven digital twin simulation system to deduce the spatiotemporal distribution of the gas concentration field in the house at multiple future moments. Based on model predictive control algorithms, with the optimization objectives of minimizing cumulative emissions, operating energy consumption, and predicted stress levels of animal populations in the future prediction time domain, the future control action sequence is continuously optimized under meteorological disturbances to control the environment inside the enclosure.

[0008] Optionally, before generating a dynamic modulation factor for correcting the baseline emission rate by simultaneously identifying animal behavior categories through a multi-task learning network based on the physiological stress state data and individual behavior data, the method further includes: A training dataset is obtained, which includes synchronously collected time series of animal physiological signals, inertial measurement unit data, manually labeled behavioral categories, and real comprehensive heat stress index and methane emission rate synchronously obtained through rumen capsule and respiratory metabolic reference system as supervision signals; A multi-task learning network architecture is constructed, which includes a shared spatiotemporal feature extraction layer, a behavior classification branch, a stress index regression branch, and a dynamic modulation factor generation branch. The input of the dynamic modulation factor generation branch is the output of the shared spatiotemporal feature extraction layer and the attention-weighted features of the behavior classification branch, and an initial modulation factor is generated through a gating fusion unit. Design a joint loss function, which includes the cross-entropy loss of the behavior classification branch, the mean square error loss of the stress index regression branch, and the dynamic modulation factor fitting loss. The dynamic modulation factor fitting loss is used to constrain the difference between the initial modulation factor and the reference modulation factor calculated based on the real methane emission rate. An end-to-end backpropagation algorithm is used to iteratively update the network parameters of the multi-task learning network with the goal of minimizing the joint loss function until the network converges, thus obtaining the trained multi-task learning network.

[0009] Optionally, the step of simultaneously identifying animal behavior categories and generating dynamic modulation factors for correcting the baseline emission rate based on the physiological stress state data and individual behavior data through a multi-task learning network includes: The time series of animal physiological signals and inertial measurement unit data within the current time window are acquired, standardized and preprocessed, and then input into the multi-task learning network. Through network forward propagation, the probability vector of each behavior category is output by the behavior classification branch, the continuous value of the comprehensive heat stress index of the current window is output by the stress index regression branch, and a dynamic modulation factor with a value within the preset physiological range is output by the dynamic modulation factor generation branch. Based on the behavior category probability vector, the behavior corresponding to the maximum probability is selected as the current main behavior state of the animal, and the corresponding confidence level is recorded. The dynamic modulation factor is multiplied by the baseline emission rate determined in advance based on the animal's weight and behavioral category to obtain the dynamic modulation factor modulated by physiological stress.

[0010] Optionally, the step of calculating the dynamic individual emission source strength modulated by physiological stress based on the dynamic modulation factor and the gas concentration data of the oral and nasal microenvironment includes: The original time series of gas concentration in the oral and nasal microenvironment was preprocessed, and the instantaneous spike noise caused by violent head shaking or sudden changes in respiratory airflow was removed by a sliding window adaptive median filtering algorithm to obtain a smoothed gas concentration series in the respiratory zone. Based on the smoothed respiratory zone gas concentration sequence, the concentration pulse corresponding to each hiccup event of the animal is identified by the peak detection algorithm, and the concentration feature parameters of each pulse are extracted. The concentration feature parameters include peak amplitude, rising edge slope, half width at half maximum and pulse area. Based on the dynamic modulation factor output by the multi-task learning network, and combined with the respiratory frequency and respiratory depth coefficient corresponding to the animal's current behavior category, a respiratory dynamics model is constructed to estimate the gas exchange volume and gas mixing coefficient of the respiratory zone in a single respiratory cycle of the animal. The concentration pulse characteristic parameters are input into a pre-trained gas diffusion reverse calculation model. The reverse calculation model takes the pulse characteristic parameters as input and the actual emission mass of a single emission event as output, eliminating the measurement deviation of local concentration in the breathing zone caused by factors such as airflow dilution and sensor response delay. Based on the actual emission mass of the single emission event and the corresponding hiccup event time interval, the instantaneous emission rate under the current behavioral state is calculated; at the same time, the dynamic modulation factor is used as a multiplicative coefficient to correct the theoretical emission rate calculated based on metabolic weight and basal behavioral metabolic rate, so as to obtain the theoretical corrected emission rate. A data fusion algorithm based on Kalman filtering is used to optimally weight and fuse the instantaneous emission rate with the theoretical corrected emission rate. At the same time, the confidence level of the inverse solution model is introduced as an adjustment factor for the observation noise covariance matrix, and the fused dynamic individual emission source strength is output.

[0011] Optionally, before inputting the concentration pulse feature parameters into a pre-trained gas diffusion inverse calculation model, the method further includes: A CFD simulation model of the animal head-collar sensor system was constructed in advance in a laboratory environment to simulate the gas diffusion and transmission process between the mouth and nose emission point and the collar sensor location under different breathing intensities, different head orientations, and different environmental wind speeds. The CFD simulation model generates a massive simulation dataset, which includes input parameters: emission source strength, breathing rate, ambient wind speed, and head posture angle; and output parameters: the concentration pulse waveform characteristics detected at the sensor location. Using the concentration pulse waveform features as input and the corresponding real emission source strength as output, a deep neural network based on an attention mechanism is trained to construct a nonlinear inverse mapping relationship from sensor observation to real source strength, thereby obtaining the gas diffusion inverse solution model.

[0012] Optionally, the step of using the meteorological forecast big data as dynamic boundary conditions and the dynamic individual emission source strength as dynamic source terms, inputting them into a preset climate forecast-driven digital twin simulation system, and extrapolating the spatiotemporal distribution of the indoor gas concentration field at multiple future moments includes: Based on the meteorological forecast big data, the dynamic air inlet boundary conditions of the three-dimensional geometric model of the livestock and poultry house are constructed. The wind speed and wind direction data are converted into the velocity vector field of the air inlet, the temperature and humidity data are converted into the thermodynamic initial state of the airflow in the air inlet, and the solar radiation intensity is converted into the dynamic heat flux boundary of the roof and enclosure structure. Based on the dynamic individual emission source intensity sequence of each animal, and combined with the individual three-dimensional spatial coordinates of each animal, the emission source intensity is dynamically mapped in time sequence to the moving point source term in the component transport equation. The distribution and area of ​​fecal waste areas identified by the thermal infrared imaging system are obtained. The ammonia volatilization rate on the surface of the fecal waste is estimated by combining the temperature and moisture content of the fecal waste. The volatilization rate is then mapped as a surface source term. The dynamic air inlet boundary conditions and dynamic source terms are substituted into the preset unsteady computational fluid dynamics control equation set, and discretized in the spatial domain using the finite volume method and in the time domain using a second-order implicit scheme. The unsteady computational fluid dynamics control equation set includes the continuity equation, momentum equation, energy equation, k-ε turbulence equation and component transport equations for methane and ammonia. Within each computation time step, the discrete set of control equations is solved iteratively until the residuals converge, and the distribution data of the velocity field, temperature field, pressure field and greenhouse gas concentration field in the three-dimensional space of the chamber at the current time are obtained. The calculation result at the current moment is used as the initial field for the next time step, and the spatiotemporal distribution sequence of gas concentration field in the cell for multiple future moments is output. The spatiotemporal distribution sequence of gas concentration field in the cell contains the predicted values ​​of methane and ammonia concentrations at any spatial point in the cell at each predicted moment.

[0013] Optionally, the step of dynamically mapping the emission source intensity into a moving point source term in the component transport equation in chronological order, based on the dynamic individual emission source intensity sequence of each animal and combined with the individual three-dimensional spatial coordinates of each animal, includes: The three-dimensional spatial coordinate sequence of each animal is obtained, and the three-dimensional spatial coordinate sequence is smoothed by Kalman filtering to remove abnormal points caused by positioning jumps, so as to obtain the continuous movement trajectory of the animal. The continuous motion trajectory is time-aligned with the dynamic individual emission source intensity sequence to construct a "time-space-source intensity" triplet data stream for each animal; In the pre-set indoor environment grid system, the computational grid cell where each animal is located is dynamically located based on the real-time spatial coordinates of each animal, and the corresponding emission source strength value is assigned to the source term of the methane component transport equation of that grid cell; The point source intensity of a single grid point is distributed to multiple adjacent grid cells according to a Gaussian distribution weight to simulate the actual spatial distribution range of emissions caused by animal head movement and respiratory airflow diffusion. At the start of each computation time step, the grid assignment and source strength allocation of all moving point sources are updated according to the latest position coordinates of each animal, so as to realize the real-time dynamic update of source terms as the animals move.

[0014] On the other hand, embodiments of this application provide a greenhouse gas monitoring device for livestock and poultry houses, the device comprising: The acquisition module is used to acquire target perception big data and weather forecast big data of the target animal. The target perception big data includes physiological stress state data, individual behavior data and oral and nasal microenvironment gas concentration data. The generation module is used to generate a dynamic modulation factor for correcting the baseline emission rate by synchronously identifying animal behavior categories through a multi-task learning network based on the physiological stress state data and individual behavior data. The calculation module is used to calculate the dynamic individual emission source strength modulated by physiological stress based on the dynamic modulation factor and the gas concentration data of the oral and nasal microenvironment. The extrapolation module is used to take the meteorological forecast big data as dynamic boundary conditions and the dynamic individual emission source strength as dynamic source terms, input them into a preset climate forecast-driven digital twin simulation system, and extrapolate the spatiotemporal distribution of the gas concentration field in the chamber at multiple future moments. The optimization module is used to optimize the future control action sequence under meteorological disturbances by using model predictive control algorithms to minimize the cumulative emissions, operating energy consumption and predicted stress level of the animal population in the future prediction time domain.

[0015] In another aspect, embodiments of this application provide an electronic device, the device comprising: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the greenhouse gas monitoring method for livestock and poultry houses as described in the first aspect.

[0016] In another aspect, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the greenhouse gas monitoring method for livestock and poultry houses as described in the first aspect.

[0017] In another aspect, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform the greenhouse gas monitoring method for livestock and poultry houses as described in the first aspect.

[0018] Compared with existing technologies, the greenhouse gas monitoring method, apparatus, equipment, and medium for livestock and poultry houses in this application can achieve accurate prediction and optimized control of greenhouse gas emissions from livestock and poultry houses by acquiring multi-source data and utilizing multi-task learning networks and digital twin simulation systems. This method overcomes the limitations of traditional monitoring technologies, such as data distortion and inability to represent population emission levels. It effectively addresses animal stress and emission surges under extreme weather conditions, thereby improving the accuracy of greenhouse gas monitoring data and providing support for intelligent and refined emission reduction optimization of livestock and poultry house environments. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings. Figure 1 This is a flowchart illustrating a method for monitoring greenhouse gases in livestock and poultry houses according to an embodiment of this application; Figure 2This is a structural block diagram of a greenhouse gas monitoring device for livestock and poultry houses provided in another embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] To facilitate understanding of the embodiments of this application, further explanation and description will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of this application. In the drawings, the dimensions and relative dimensions of components may be exaggerated for clarity and / or descriptive purposes. When exemplary embodiments can be implemented differently, a specific process sequence may be performed in a different order than that described. For example, two consecutively described processes may be performed substantially simultaneously or in the reverse order of their description. Furthermore, the same reference numerals denote the same components.

[0022] The terminology used herein is for the purpose of describing particular embodiments and is not intended to be limiting. As used herein, unless the context clearly indicates otherwise, the singular forms “a” and “(the)” are also intended to include the plural forms. Furthermore, when the terms “comprising” and / or “including” and variations thereof are used in this specification, it indicates the presence of the stated features, integrals, steps, operations, parts, components, and / or groups thereof, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, parts, components, and / or groups thereof. It should also be noted that, as used herein, the terms “substantially,” “about,” and other similar terms are used as approximate terms rather than as terms of degree, thus explaining the inherent biases in measurements, calculated values, and / or provided values ​​that would be recognized by one of ordinary skill in the art.

[0023] For ease of understanding, the following explains some key terms in this embodiment: Physiological stress status data: These data indicate physiological indicators of an animal's non-specific response to environmental stimuli (such as heat, cold, and disease), including heart rate, body temperature, respiratory rate, and skin conductance. This data is used to assess the animal's health and comfort and is associated with greenhouse gas emissions.

[0024] Individual behavioral data: This data describes the animal's activity patterns and behaviors over a specific time period, such as standing, lying down, eating, drinking, walking, and resting. This data can be obtained through sensors or video analysis and is used to identify the animal's daily activity patterns.

[0025] Oral and nasal microenvironment gas concentration data: This data refers to the measured gas concentration values ​​in the local area around the animal's mouth and nose, especially greenhouse gases such as methane and ammonia. This data directly reflects the gas emissions during the animal's respiration and digestion processes, but it is easily affected by local airflow and sensor location.

[0026] Big data on meteorological forecasts: This data refers to the predicted meteorological conditions of the external environment of livestock and poultry houses, such as temperature, humidity, wind speed, wind direction, and solar radiation intensity over a future period. This data serves as the dynamic boundary conditions for the digital twin simulation system, influencing the evolution of the environment inside the houses.

[0027] Multi-task learning network: This network is a machine learning model that learns multiple related tasks simultaneously by sharing parts of the network structure. In this embodiment, the network can be used to simultaneously identify animal behavior categories, predict stress levels, and generate dynamic modulation factors, thereby improving the model's generalization ability and efficiency.

[0028] Dynamic Modulation Factor: This factor is a multiplicative coefficient used to adjust the baseline greenhouse gas emission rate of animals. It is dynamically generated based on the animal's real-time physiological stress state and behavioral category, reflecting the impact of individual animal differences and environmental changes on the emission rate.

[0029] Dynamic individual emission source strength: This source strength refers to the rate of greenhouse gas emissions from a single animal at a specific moment. This source strength is dynamically changing, modulated by various factors such as animal physiological stress, behavioral activity, and gas concentration in the oral and nasal microenvironment, and is used to accurately characterize the real-time emission contribution of each animal.

[0030] Climate Forecast-Driven Digital Twin Simulation System: This system is a virtual livestock and poultry house environment built based on physical models and real-time data. It can simulate airflow, heat and humidity transfer, and gas diffusion processes within the house, and uses big data from meteorological forecasts as a driving force to predict the spatiotemporal distribution of the future house environment.

[0031] Model predictive control (MMCC) algorithm: This algorithm is an advanced control strategy that predicts future behavior by building a system model and, within each control cycle, calculates and executes the optimal control action based on the prediction results and the optimization objective. This algorithm can handle complex systems with multiple variables and constraints, achieving forward-looking optimal control.

[0032] To address the problems of existing technologies, this application provides a method, apparatus, equipment, storage medium, and program product for monitoring greenhouse gases in livestock and poultry houses. In this application, by acquiring multi-source data and utilizing a multi-task learning network and a digital twin simulation system, accurate prediction and optimized control of greenhouse gas emissions from livestock and poultry houses are achieved. This method overcomes the limitations of traditional monitoring technologies, such as data distortion and inability to represent population emission levels. It effectively addresses animal stress and emission surges under extreme weather conditions, thereby improving the accuracy of greenhouse gas monitoring data and providing support for intelligent and refined emission reduction optimization of livestock and poultry house environments.

[0033] The following section first introduces the greenhouse gas monitoring method for livestock and poultry houses provided in the embodiments of this application.

[0034] Figure 1 A flowchart illustrating a method for monitoring greenhouse gases in livestock and poultry houses according to an embodiment of this application is shown. Figure 1 As shown, the method for monitoring greenhouse gases in livestock and poultry houses may include S101-S105: S101, acquire target perception big data and weather forecast big data of the target animal, wherein the target perception big data includes physiological stress state data, individual behavior data and oral and nasal microenvironment gas concentration data.

[0035] In this embodiment, physiological stress data can be recorded by manually observing the animal's respiratory rate and mental state, or collected using simple wearable sensors (e.g., heart rate monitors). Individual behavioral data can be obtained through manual video observation and labeling of the animal's activity type. Oral and nasal microenvironment gas concentration data can be obtained by periodically reading data from small gas sensors attached to the animal's collar. Weather forecast big data can be obtained from publicly available weather websites or weather bureaus. Alternatively, physiological stress data can be collected using bioelectric sensors or temperature sensor arrays deployed on the animal's body surface. Individual behavioral data can be obtained by using ordinary cameras installed in livestock sheds, combined with simple image processing algorithms to identify the animal's approximate activity area. Oral and nasal microenvironment gas concentration data can be obtained by integrating low-cost electrochemical gas sensors onto the animal's collar and transmitting data at a fixed frequency. Weather forecast big data can be obtained by subscribing to commercial weather service interfaces.

[0036] Specifically, for large ruminants such as dairy cows, ergonomic neck straps (cattle ergonomics) can be designed. The core circuit board integrates a low-power MCU (such as the STM32L4 series), and peripherals include: Motion sensing module: A 9-axis IMU sensor (such as MPU-9250) is used, including a 3-axis accelerometer, a 3-axis gyroscope and a 3-axis magnetometer. The sampling frequency is set to 50Hz to capture normal motion and stress behavior characteristics under extreme weather conditions (such as high-frequency panting and trembling caused by heat stress, shivering caused by cold stress or standing for a long time).

[0037] Microenvironment gas sensing module: integrates a MEMS semiconductor gas sensor (for CH4) and an electrochemical sensor (for NH3). Since the sensors are sensitive to temperature and humidity, an SHT30 temperature and humidity sensor is also integrated into the collar for hardware compensation.

[0038] Positioning module: Integrates UWB (Ultra-Wideband) positioning tags, which work with the in-house base station to achieve high-precision indoor positioning at the 30cm level, used to map individual IDs to in-house spatial coordinates.

[0039] In some embodiments, while collecting real-time outdoor weather data, numerical weather prediction (NWP) data (such as wind speed, temperature and humidity fields for the next 72 hours output by the WRF model) and long-term climate scenario data (such as CMIP6 model data) are accessed through the API interface as feedforward inputs for subsequent microenvironment simulation models.

[0040] In some embodiments, in order to achieve more accurate gas monitoring, it is also necessary to perform signal calibration and preprocessing on the acquired target big data, specifically: For gas sensors, targeting ambient temperatures in extreme weather conditions and relative humidity This will cause baseline drift. The following correction formula is used for calibration: in, For the corrected voltage, The original voltage value of the sensor. , As the standard environmental reference value, , The sensitivity coefficients for temperature and humidity are obtained through experimental calibration.

[0041] For IMU data, the Mahony complementary filtering algorithm or extended Kalman filtering (EKF) is used to fuse accelerometer, gyroscope, and magnetometer data to calculate Euler angles (pitch, roll, and yaw) to eliminate accumulated errors. Finally, stable attitude data is obtained through state estimation, which serves as the input for subsequent behavior recognition. in, The current head posture angle of the animal. This refers to the state at the previous moment. This is the state transition matrix, which describes how the angle naturally evolves from the previous moment to the current moment without external interference. This is the state control input matrix, used to map the angular velocity measured by the gyroscope to the attitude angle state, reflecting the impact of the input on the system state update. The angular velocity measured by the gyroscope. This could be due to system uncertainty or the random error inherent in the gyroscope itself. For actual measured data from accelerometers and magnetometers, For the observation matrix, For observation noise, used to convert the predicted angle into a format that the sensor can read, for measurement noise of accelerometers and magnetometers.

[0042] S102, based on physiological stress state data and individual behavior data, synchronously identifies animal behavior categories through a multi-task learning network and generates dynamic modulation factors for correcting the baseline emission rate.

[0043] In this embodiment, a rule-based system can be constructed to identify animal behavior categories (e.g., determining whether movement occurs based on accelerometer thresholds), and an independent regression model (e.g., linear regression) can be built to generate a dynamic modulation factor based on physiological stress data. These two results are then simply combined. Alternatively, two independent neural networks can be trained: one to identify animal behavior categories from physiological stress data and individual behavior data (e.g., a convolutional neural network processing time-series data), and the other to predict a correction factor from the physiological stress data. These two networks operate independently, and their outputs are subsequently used in subsequent calculations.

[0044] S103, based on dynamic modulation factors and oral and nasal microenvironment gas concentration data, calculates the dynamic individual emission source strength modulated by physiological stress.

[0045] In other embodiments, the gas concentration data of the oral and nasal microenvironment can be directly multiplied by a dynamic modulation factor and combined with a preset empirical coefficient to roughly estimate the dynamic individual emission source strength. This method assumes a simple linear relationship between oral and nasal concentration and emission source strength and ignores gas diffusion and dilution effects. As another implementation, a simplified gas diffusion model can be constructed, for example, based on a one-dimensional or two-dimensional diffusion equation, using the oral and nasal microenvironment gas concentration data as input and combining it with a dynamic modulation factor to estimate the emission source strength through numerical solution. This model may use a fixed diffusion coefficient and boundary conditions and does not fully consider the influence of complex airflow.

[0046] S104 uses meteorological forecast big data as dynamic boundary conditions and dynamic individual emission source strength as dynamic source terms, inputs them into a preset climate forecast-driven digital twin simulation system, and extrapolates the spatiotemporal distribution of gas concentration field in the chamber at multiple future moments.

[0047] In other embodiments, a simplified computational fluid dynamics (CFD) model can be used, such as a model based on steady-state or quasi-steady-state assumptions, using large amounts of weather forecast data as fixed boundary conditions and dynamic individual emission source strengths as constant point source inputs. This model may employ coarse grid partitioning and does not consider real-time dynamic changes in weather conditions. Alternatively, an empirical regression model trained on historical data can be constructed, using large amounts of weather forecast data and dynamic individual emission source strengths as inputs to directly predict the average value of the future in-house gas concentration field or the concentration at a specific point. This model may not capture the fine spatiotemporal distribution of the in-house gas concentration field.

[0048] S105, based on model predictive control algorithm, aims to minimize the cumulative emissions, operating energy consumption and predicted stress level of animal population in the future prediction time domain. It continuously optimizes the future control action sequence under meteorological disturbances to control the environment inside the enclosure.

[0049] In this embodiment, a greedy control strategy can be employed, selecting a control action (e.g., immediately increasing ventilation or decreasing temperature) that can immediately reduce emissions or stress at each time step based on the current gas concentration and animal stress level in the enclosure, without considering the long-term impact of the action on future states. Alternatively, a conventional PID controller can be used to regulate the ventilation system or environmental control equipment, combined with heuristic rules to address meteorological disturbances. For example, when the external temperature rises, the PID controller might attempt to lower the indoor temperature, but its optimization objective may be limited to a single variable and lack the ability to optimize for multiple future objectives.

[0050] In this embodiment, by acquiring multi-source data and utilizing a multi-task learning network and a digital twin simulation system, accurate prediction and optimized control of greenhouse gas emissions from livestock and poultry houses are achieved. This method overcomes the limitations of traditional monitoring technologies, such as data distortion and inability to represent population emission levels. It effectively addresses animal stress and emission surges under extreme weather conditions, thereby improving the accuracy of greenhouse gas monitoring data and providing support for intelligent and refined emission reduction optimization of livestock and poultry house environments.

[0051] In some other embodiments, prior to S102, the method may include: The training dataset was obtained, which included time series of animal physiological signals collected synchronously, inertial measurement unit data, manually labeled behavioral categories, and real comprehensive heat stress index and methane emission rate obtained synchronously through rumen capsule and respiratory metabolic reference system as supervision signals. A multi-task learning network architecture is constructed, which includes a shared spatiotemporal feature extraction layer, an action classification branch, a stress index regression branch, and a dynamic modulation factor generation branch. The input of the dynamic modulation factor generation branch is the output of the shared spatiotemporal feature extraction layer and the attention-weighted features of the action classification branch, and the initial modulation factor is generated through a gated fusion unit. The design incorporates a joint loss function, which includes the cross-entropy loss of the behavior classification branch, the mean squared error loss of the stress index regression branch, and the dynamic modulation factor fitting loss. The dynamic modulation factor fitting loss is used to constrain the difference between the initial modulation factor and the reference modulation factor calculated based on the actual methane emission rate. An end-to-end backpropagation algorithm is used to iteratively update the network parameters of the multi-task learning network with the goal of minimizing the joint loss function until the network converges, thus obtaining the trained multi-task learning network.

[0052] In this embodiment, to accurately capture the complex physiological stress states and behavioral patterns of animals and generate reliable dynamic modulation factors, the multi-task learning network needs to be pre-trained. Therefore, a high-quality training dataset is required before training the multi-task learning network. The construction of this dataset is crucial, requiring the simultaneous collection of various physiological and behavioral data from the target animal. For example, time series of animal physiological signals can be obtained through biosensors worn on the animal (such as heart rate sensors, body temperature sensors, and skin conductivity sensors); inertial measurement unit (IMU) data is obtained through IMU sensors worn on the animal's limbs or torso to capture the animal's movement posture and behavioral patterns; manually labeled behavioral categories are typically obtained through video observation and expert judgment, providing supervisory information for the behavioral classification task. Furthermore, to provide more accurate supervisory signals, rumen capsules can monitor physiological parameters within the animal's rumen in real time, while respiratory metabolic reference systems (such as metabolic cages) can accurately measure the animal's true comprehensive heat stress index and methane emission rate under specific behavioral and physiological states. These real data serve as supervisory signals for the network, forming the basis for ensuring the model learns accurate mapping relationships.

[0053] After obtaining the training dataset, a multi-task learning network architecture needs to be constructed. This network aims to handle multiple related tasks simultaneously, thereby improving the model's generalization ability and learning efficiency. The core of the network is a shared spatiotemporal feature extraction layer, responsible for extracting representative spatiotemporal features from the input physiological signal time series and inertial measurement unit data. This shared layer can employ structures such as convolutional neural networks (CNNs) or recurrent neural networks (RNNs, such as LSTM or GRUs) to effectively capture local patterns and long-term dependencies in the time series data. Following the shared feature extraction layer, the network branches into multiple branches, each corresponding to a different task: a behavior classification branch, used to identify the animal's current behavior category (e.g., eating, drinking, resting, activity); a stress index regression branch, used to predict the animal's comprehensive heat stress index, which is typically a continuous value reflecting the animal's physiological stress level; and a dynamic modulation factor generation branch, used to generate dynamic modulation factors that correct the baseline emission rate. Notably, the input to the dynamic modulation factor generation branch not only includes the output of the shared spatiotemporal feature extraction layer but also incorporates the attention-weighted features from the behavior classification branch. This design enables the dynamic modulation factor generation to fully utilize key behavior-related information learned in the behavior classification task, and intelligently integrates this information through a gating fusion unit to generate initial modulation factors, ensuring that the modulation factors are closely related to the animal's real-time behavioral state.

[0054] To effectively train this multi-task learning network, a joint loss function needs to be designed. This loss function is a weighted sum of the losses for each task, designed to guide the network to co-optimize across all tasks. Specifically, the loss for the behavior classification branch typically uses cross-entropy loss, which measures the difference between the predicted behavior category probability distribution and the true label; the loss for the stress index regression branch uses mean squared error (MSE), which measures the difference between the predicted stress index and the true stress index in continuous values. Furthermore, to ensure the accuracy of the dynamic modulation factor, a dynamic modulation factor fitting loss is introduced. This loss constrains the difference between the initial modulation factor and a reference modulation factor calculated based on the actual methane emission rate. The reference modulation factor can be obtained by comparing the actual methane emission rate with a preset baseline emission rate, thus providing the network with a clear optimization objective and ensuring that the generated modulation factor accurately reflects the animal's actual emission level.

[0055] Finally, an end-to-end backpropagation algorithm is used to train the multi-task learning network. This algorithm calculates the gradient of the loss function with respect to the network parameters and updates the network parameters in the opposite direction of the gradient to gradually reduce the value of the loss function. The training process is an iterative update process, which typically lasts for multiple training epochs until the network's performance on the validation set no longer shows significant improvement, i.e., the network converges. Through this end-to-end training method, the network can automatically learn the complex nonlinear mapping relationship from the original input data to the final dynamic modulation factor output, thus obtaining a high-performance multi-task learning network with strong generalization ability.

[0056] This application utilizes synchronously collected heterogeneous data from multiple sources as training datasets and constructs a sophisticated network architecture comprising a shared spatiotemporal feature extraction layer, a behavior classification branch, a stress index regression branch, and a dynamic modulation factor generation branch. This architecture enables the network to learn the deep correlation between animal behavior, physiological stress states, and greenhouse gas emissions from physiological signals and individual behavioral data. Specifically, by designing a joint loss function that incorporates behavior classification, stress index regression, and dynamic modulation factor fitting, and optimizing it using an end-to-end backpropagation algorithm, the network is ensured to synergistically improve the performance of each task during multi-task learning. This not only improves the accuracy of animal behavior recognition but, more importantly, enables the generated dynamic modulation factors to accurately reflect the true emission trends of animals under different physiological stress and behavioral states, effectively solving the accuracy problem of lacking physiological stress modulation in the generation of dynamic modulation factors in traditional methods. Finally, the well-trained multi-task learning network provides more accurate and reliable input for subsequent calculation of dynamic individual emission source strength, thereby significantly improving the overall accuracy and robustness of the entire livestock and poultry house greenhouse gas monitoring method.

[0057] In some other embodiments, S102 may include: The time series of animal physiological signals and inertial measurement unit data within the current time window are acquired, standardized and preprocessed, and then input into the multi-task learning network. Through network forward propagation, the probability vector of each behavior category is output by the behavior classification branch, the continuous value of the comprehensive heat stress index of the current window is output by the stress index regression branch, and a dynamic modulation factor with a value within the preset physiological range is output by the dynamic modulation factor generation branch. Based on the behavior category probability vector, the behavior corresponding to the maximum probability is selected as the current animal's main behavioral state, and the corresponding confidence level is recorded. The dynamic modulation factor is obtained by multiplying the dynamic modulation factor by the baseline emission rate determined in advance based on the animal's weight and behavioral category.

[0058] In this embodiment, firstly, physiological signals of the animal are continuously collected using sensors worn on the animal (e.g., heart rate sensor, body temperature sensor, respiratory rate sensor, etc.), and motion posture and behavioral data (e.g., acceleration, angular velocity, etc.) of the animal are acquired through an inertial measurement unit (IMU). These raw data streams are then segmented in real-time into fixed-length time windows (e.g., 5 seconds or 10 seconds) to form sequential data for network input. Subsequently, these time-series data undergo standardization preprocessing, such as using Z-score standardization to convert the data into a distribution with a mean of 0 and a standard deviation of 1, to eliminate differences in the dimensions and numerical ranges of data from different sensors, ensuring the consistency of the input data and thereby improving the training efficiency and generalization ability of the multi-task learning network.

[0059] In the forward propagation process, the behavior classification branch outputs probability vectors for each behavior category, the stress index regression branch outputs a continuous value of the comprehensive heat stress index for the current window, and the dynamic modulation factor generation branch outputs a dynamic modulation factor with a value within a preset physiological range. The standardized preprocessed time window data is then input into the pre-trained multi-task learning network. This network performs forward propagation calculations, and its internal shared spatiotemporal feature extraction layer first extracts high-dimensional features from the input data. These features are then passed to different task branches: the behavior classification branch outputs a probability vector representing the probability distribution of the animal belonging to various preset behavior categories (e.g., resting, feeding, ruminating, walking, etc.) within the current time window; the stress index regression branch outputs a continuous value quantifying the animal's comprehensive heat stress level within the current time window; and the dynamic modulation factor generation branch, while utilizing shared features, may also combine the attention-weighted features from the behavior classification branch to ultimately output a dynamic modulation factor. The dynamic modulation factor is designed to take values ​​within a preset physiologically reasonable range (e.g., between 0.5 and 2.0) to ensure that its correction of the baseline emission rate is biologically reasonable.

[0060] When selecting the behavior with the highest probability from the behavior category probability vector as the animal's dominant behavioral state and recording the corresponding confidence level, the system analyzes the probability vector output by the behavior classification branch. In this vector, the behavior category with the highest probability value is determined as the animal's dominant behavioral state within the current time window. Simultaneously, this highest probability value itself is recorded as the corresponding confidence level, reflecting the network's confidence in the current behavior classification result. A higher confidence level indicates a more reliable classification result, while a lower confidence level may suggest the need for further analysis or serve as a reference for subsequent decisions.

[0061] When multiplying the dynamic modulation factor by a pre-determined baseline emission rate based on animal weight and behavioral category to obtain a dynamic modulation factor modulated by physiological stress, the system multiplies the dynamic modulation factor obtained from the multi-task learning network with a pre-established baseline emission rate. The baseline emission rate is determined based on the animal's weight, age, and general behavioral category (e.g., the baseline emission rate is higher in a feeding state than in a resting state) using experimental data or empirical models. Through this multiplicative correction, the dynamic modulation factor can reflect in real time the deviation of the baseline emission rate caused by factors such as physiological stress and subtle behavioral changes, thus obtaining a more accurate and more consistent dynamic individual emission source strength that reflects the animal's real-time physiological state.

[0062] This application's embodiments input real-time acquired physiological signals and inertial measurement unit data into a pre-trained multi-task learning network. The system can simultaneously output the animal's real-time behavioral category, comprehensive heat stress index, and a dynamic modulation factor within a physiological range. This dynamic modulation factor can effectively capture subtle changes in the animal's emission rate caused by environmental changes and fluctuations in physiological state, thereby significantly improving the accuracy and response speed of greenhouse gas monitoring in livestock and poultry houses. Furthermore, the confidence level records of behavioral classifications provide valuable references for subsequent data analysis and model optimization, further enhancing the system's robustness. Finally, by applying the dynamic modulation factor to the baseline emission rate, this application can obtain an individual emission source strength that truly reflects the animal's real-time physiological stress level, providing more reliable input data for subsequent in-house gas concentration field extrapolation and environmental control optimization.

[0063] In some other embodiments, S103 may include: The original time series of gas concentrations in the oral and nasal microenvironment was preprocessed, and the instantaneous spike noise caused by violent head shaking or sudden changes in respiratory airflow was removed by a sliding window adaptive median filtering algorithm to obtain a smoothed gas concentration series in the respiratory zone. Based on the smoothed respiratory zone gas concentration sequence, the concentration pulse corresponding to each hiccup event of the animal is identified by the peak detection algorithm, and the concentration feature parameters of each pulse are extracted. The concentration feature parameters include peak amplitude, rising slope, half width at half maximum and pulse area. Based on the dynamic modulation factor output by the multi-task learning network, combined with the respiratory frequency and respiratory depth coefficient corresponding to the animal's current behavioral category, a respiratory dynamics model is constructed to estimate the gas exchange volume and gas mixing coefficient of the respiratory zone in a single respiratory cycle of the animal. The concentration pulse characteristic parameters are input into a pre-trained gas diffusion inverse calculation model. The inverse calculation model takes the pulse characteristic parameters as input and the actual emission mass of a single emission event as output, eliminating the measurement deviation of local concentration in the breathing zone caused by factors such as airflow dilution and sensor response delay. Based on the actual emission mass of a single emission event and the corresponding time interval of the hiccup event, the instantaneous emission rate under the current behavioral state is calculated; at the same time, the dynamic modulation factor is used as a multiplicative coefficient to correct the theoretical emission rate calculated based on metabolic weight and basal behavioral metabolic rate, so as to obtain the theoretical corrected emission rate. A data fusion algorithm based on Kalman filtering is adopted to optimally weight and fuse instantaneous emission rates with theoretically corrected emission rates. At the same time, the confidence level of the inverse solution model is introduced as an adjustment factor for the observation noise covariance matrix, and the fused dynamic individual emission source strength is output.

[0064] In this embodiment, the preprocessing process can be implemented using a sliding window adaptive median filtering algorithm. This algorithm can effectively remove instantaneous spike noise caused by violent head movements or sudden changes in respiratory airflow, thereby obtaining a smoothed gas concentration sequence in the respiratory region. The sliding window adaptive median filtering algorithm can dynamically adjust the filtering parameters according to the local data characteristics, effectively suppressing abnormal noise points while preserving effective signal features, thus ensuring the data quality for subsequent analysis.

[0065] Furthermore, hiccups are a major form of methane emission in ruminants, manifesting as distinct pulse signals in the concentration sequence. Peak detection algorithms can accurately capture the start, peak, and end points of these pulses. Extracted concentration feature parameters include peak amplitude, rising slope, half-width at half-maximum (WHM), and pulse area. These parameters comprehensively reflect the intensity, duration, and total emission of hiccups, providing a quantitative basis for subsequent emission estimation.

[0066] Furthermore, dynamic modulation factors reflect the impact of an animal's physiological stress state on emissions, while different behavioral categories (such as standing, lying down, and feeding) correspond to different respiratory patterns. By integrating this information, respiratory dynamics models can more accurately simulate the diffusion and mixing of gases in the oral and nasal microenvironment during animal respiration, providing a physical basis for understanding the relationship between sensor-measured concentrations and actual emissions.

[0067] Subsequently, the concentration pulse characteristic parameters are input into a pre-trained gas diffusion inverse calculation model. This inverse calculation model takes the pulse characteristic parameters as input and the actual emission mass of a single emission event as output. Its core function is to eliminate measurement biases caused by factors such as airflow dilution and sensor response delay in the local concentration of the respiration zone. Through this model, the apparent concentration pulse characteristics observed by the sensor can be inverted into a more accurate estimate of the greenhouse gas mass emitted in a single belch, thereby improving the accuracy of emission estimation.

[0068] Based on this, the instantaneous emission rate under the current behavioral state is calculated using the actual emission mass of a single emission event and the corresponding time interval between hiccups. Simultaneously, a dynamic modulation factor is used as a multiplicative coefficient to correct the theoretical emission rate calculated based on metabolic weight and basal metabolic rate, resulting in a theoretically corrected emission rate. The instantaneous emission rate is directly derived from the observation and inversion of hiccup events, reflecting the actual emission intensity over a short period; while the theoretically corrected emission rate incorporates the animal's physiological metabolic characteristics and stress state, providing an emission estimate based on biological principles.

[0069] Finally, a Kalman filter-based data fusion algorithm is employed to optimally weight and fuse the instantaneous emission rate with the theoretically corrected emission rate. During the fusion process, the confidence level of the inverse calculation model is introduced as an adjustment factor for the observed noise covariance matrix. Kalman filtering, as an optimal estimation method, can effectively fuse data from different sources with varying noise characteristics, yielding more accurate and robust estimation results. The confidence level of the inverse calculation model reflects the reliability of its inversion results; using it as an adjustment factor allows for dynamic adjustment of the weight of the instantaneous emission rate in the fusion process, ensuring the accuracy of the fusion results. Ultimately, the fused dynamic individual emission source strength is output.

[0070] In other embodiments, future emission source intensity can be predicted based on ruminant physiological characteristics, combined with identified individual behavioral data and collected oral and nasal microenvironment gas concentration data, along with behavioral status and future weather forecast data. Estimation model: in, Animal body weight (metabolic weight) ), The metabolic regulation coefficients under different behavioral states (e.g., increased metabolic rate during feeding). It is the temperature and humidity index for future times calculated based on weather forecasts. This is the climate stress correction factor. Peak local gas concentration in the breathing zone captured by the collar sensor (used to correct hiccup discharge pulses). , For regression coefficients, This is the residual term. The embodiments of this application accurately capture animal belching emission events through refined data preprocessing and peak detection. Simultaneously, by combining a respiratory dynamics model and a gas diffusion inverse calculation model, the apparent concentration observed by the sensor can be converted into a more accurate emission mass, effectively eliminating measurement errors caused by airflow dilution and sensor response delay. Furthermore, by using a Kalman filter algorithm to optimally weight and fuse the instantaneous observed emission rate and the theoretically corrected emission rate, and by introducing the confidence level of the inverse calculation model for dynamic adjustment, the accuracy and robustness of dynamic individual emission source strength estimation are significantly improved. This provides a more reliable and refined dynamic source term input for subsequent digital twin simulation systems, thereby making the spatiotemporal distribution extrapolation of greenhouse gas concentration fields in livestock and poultry houses more accurate, and providing a solid data foundation for precise environmental control and the formulation of greenhouse gas emission reduction strategies.

[0071] In other embodiments, the method further includes, before inputting the concentration pulse feature parameters into a pre-trained gas diffusion inverse calculation model: A CFD simulation model of the animal head-collar sensor system was constructed in advance in a laboratory environment to simulate the gas diffusion and transmission process between the mouth and nose emission point and the collar sensor location under different breathing intensities, different head orientations, and different environmental wind speeds. A massive simulation dataset is generated through a CFD simulation model. The dataset includes input parameters: emission source strength, breathing rate, ambient wind speed, and head posture angle; and output parameters: the concentration pulse waveform characteristics detected at the sensor location. Using the concentration pulse waveform features as input and the corresponding real emission source strength as output, a deep neural network based on an attention mechanism is trained to construct a nonlinear inverse mapping relationship from sensor observation to real source strength, thus obtaining a gas diffusion inverse solution model.

[0072] In this embodiment, a computational fluid dynamics (CFD) simulation model of the animal head-collar sensor system is first constructed. This model, developed in a controlled laboratory environment, accurately simulates the physical process of gas diffusion from the animal's mouth and nose to the collar sensor location. During the construction process, the geometry of the animal's head, the position and size of the collar sensor, and the boundary conditions of the surrounding environment need to be defined in detail. By adjusting the simulation parameters, the model can simulate the animal's respiratory intensity under different physiological states (e.g., by changing the gas flow rate and velocity emitted from the mouth and nose), the different orientations of the animal's head in space (e.g., by rotating the head model to change the relative geometric relationship between the mouth / nose and the sensor), and the different environmental wind speed conditions that may occur within the livestock shed (e.g., by setting different inlet wind speeds and directions to simulate local airflow disturbances). This simulation can systematically reveal the laws governing gas diffusion and transport, and the characteristics of the concentration signals received by the sensor under various complex operating conditions.

[0073] Secondly, a massive simulation dataset is generated using the aforementioned CFD simulation model. By running numerous simulation scenarios across a wide range of parameters, a sufficiently diverse and large number of data samples can be obtained. The input parameters of this dataset include: the actual emission source strength at the animal's mouth and nose (i.e., the actual greenhouse gas mass flow rate emitted by the animal, which is the target that the model needs to invert), the animal's respiratory rate, the local ambient wind speed around the sensor, and the animal's head posture angles (e.g., pitch, yaw, roll). The corresponding output parameters are the pulse waveform of gas concentration changing over time, simulated by the CFD simulation at the collar sensor location, and key features extracted from it, such as the peak amplitude of the pulse, the rise slope, the full width at half maximum (FWHM), and the pulse area. These features are information that the sensor can actually observe, while the simulation provides the actual emission source strength corresponding to these observed features.

[0074] Finally, using the concentration pulse waveform features as input and the corresponding actual emission source strength as output, a deep neural network based on an attention mechanism is trained. This deep neural network can automatically learn and extract information crucial for source strength inversion from complex concentration pulse waveform features, and dynamically focus on key parts of the waveform through the attention mechanism. Through end-to-end training using the previously generated simulated dataset, the network can learn and construct a nonlinear inverse mapping relationship between the sensor-observed, environmentally disturbed concentration features and the actual, undiluted emission source strength at the animal's mouth and nose. After sufficient training and validation, this network becomes a gas diffusion inverse calculation model.

[0075] In this embodiment, a high-precision fluid dynamics simulation model can be constructed in a laboratory environment, generating a massive simulation dataset. This overcomes the difficulties and high costs of acquiring real experimental data while ensuring the diversity and accuracy of the training data. Based on this, a robust and high-precision model can be learned and built using a deep neural network based on an attention mechanism. This model accurately inverts the concentration pulse characteristics of environmentally disturbed concentrations collected by sensors into the actual individual emission source strength of animals. This significantly improves the accuracy and reliability of dynamic individual emission source strength calculation, providing more accurate and reliable input for subsequent in-house gas concentration field extrapolation and model-based predictive control environmental optimization. This enables more refined and effective monitoring and management of greenhouse gases in livestock and poultry houses.

[0076] In some other embodiments, S104 may include: Based on meteorological forecast big data, dynamic air inlet boundary conditions of a three-dimensional geometric model of livestock and poultry houses are constructed. Wind speed and direction data are converted into velocity vector fields of the air inlet, temperature and humidity data are converted into the thermodynamic initial state of the airflow at the air inlet, and solar radiation intensity is converted into dynamic heat flux boundaries of the roof and enclosure structure. Based on the dynamic individual emission source intensity sequence of each animal, and combined with the individual three-dimensional spatial coordinates of each animal, the emission source intensity is dynamically mapped into the moving point source term in the component transport equation in time order. The distribution and area of ​​fecal waste areas identified by the thermal infrared imaging system are obtained. The ammonia volatilization rate on the surface of the fecal waste is estimated by combining the temperature and moisture content of the fecal waste. The volatilization rate is then mapped to a surface source term. The dynamic inlet boundary conditions and dynamic source terms are substituted into the preset unsteady computational fluid dynamics control equations. The finite volume method is used to discretize the equations in the spatial domain, and the second-order implicit scheme is used to discretize them in the time domain. The unsteady computational fluid dynamics control equations include the continuity equation, momentum equation, energy equation, k-ε turbulence equation, and component transport equations for methane and ammonia. Within each computation time step, the discrete control equations are solved iteratively until the residuals converge, and the distribution data of the velocity field, temperature field, pressure field and greenhouse gas concentration field in the three-dimensional space of the current time are obtained. The calculation result at the current time is used as the initial field for the next time step, and the spatiotemporal distribution sequence of gas concentration field within the cell for multiple future time steps is output. The spatiotemporal distribution sequence of gas concentration field within the cell contains the predicted values ​​of methane and ammonia concentrations at any spatial point within the cell at each prediction time.

[0077] In this embodiment, dynamic air inlet boundary conditions for a three-dimensional geometric model of a livestock and poultry house are constructed based on big data from meteorological forecasts. This aims to transform real-time or predicted meteorological information from the external environment into precise boundary conditions required by the computational fluid dynamics (CFD) model within the digital twin simulation system. For example, wind speed and direction data can be acquired through sensor arrays or weather stations, and mapped to velocity vector distributions on the inlet cross-section using interpolation algorithms or fluid dynamics principles, based on the designed geometry and location of the livestock and poultry house air inlet. Temperature and humidity data directly determine the thermodynamic properties of the air entering the house. The density, enthalpy, and other thermodynamic parameters of the airflow at the inlet can be calculated using the ideal gas law or a humid air enthalpy-humidity diagram, serving as the entry conditions for the energy equations and component transport equations in the CFD model. Solar radiation intensity affects the temperature of the outer surfaces of livestock and poultry houses (such as roofs and walls), which in turn affects the thermal environment inside the houses through conduction and convection. This can be addressed by establishing a thermal balance model that takes into account parameters such as solar radiation intensity, external ambient temperature, and material thermal properties, and calculates the dynamic heat flux of the roof and inner surfaces of the enclosure structure, which serves as the thermal boundary condition for the CFD model.

[0078] Based on the dynamic individual emission source intensity sequence of each animal, combined with the individual three-dimensional spatial coordinates of each animal, the emission source intensity is dynamically mapped in time sequence to the moving point source term in the component transport equation. This solves the problem of how to accurately introduce discrete, time-varying individual animal emission data into a continuous fluid dynamics simulation model, while considering animal mobility. The dynamic individual emission source intensity sequence refers to the time-varying methane or ammonia emission rate of each animal, calculated through the aforementioned steps. The individual three-dimensional spatial coordinates can be obtained in real time using technologies such as UWB (Ultra-Wideband) positioning systems, RFID (Radio Frequency Identification) combined with inertial measurement units (IMUs), or visual recognition systems to acquire the precise three-dimensional position information of each animal within the livestock house. In CFD simulation, the source term is usually added to the right-hand side of the governing equation (such as the component transport equation), representing the generation or consumption of substances. For moving point sources, it is necessary to match the animal's real-time three-dimensional coordinates with the simulation grid, assigning the animal's emission source intensity value at the current moment to the component transport equation of its corresponding grid cell. Since the animal is moving, the assignment of this source term needs to be dynamically updated with the time step. That is, at each time step, the grid cell in which the animal is located is re-determined based on the animal's new position and the source term is updated.

[0079] This study acquires the distribution and area of ​​manure-polluted regions identified by a thermal infrared imaging system. Combined with manure temperature and moisture content, the ammonia volatilization rate on the manure surface is estimated, and this volatilization rate is mapped to a surface source term. The aim is to incorporate ammonia emissions from manure in livestock sheds into the simulation model as a surface source, thus providing a more comprehensive consideration of gas sources within the shed. The thermal infrared imaging system can identify the temperature difference between manure and the ground or animal bodies, thereby distinguishing manure-polluted areas. Image processing techniques are used to determine the distribution range and area of ​​the manure. The volatilization rate of ammonia from the manure surface is influenced by various factors, including manure temperature, moisture content, pH value, surface area, and ambient wind speed. Based on empirical formulas or semi-empirical models, combined with the manure temperature acquired by the thermal infrared system and a preset or measured moisture content, the ammonia volatilization rate per unit area can be estimated. In CFD simulation, a surface source term refers to the generation or consumption of substances that are uniformly or non-uniformly distributed on a surface area. The estimated ammonia volatilization rate is multiplied by the area of ​​the manure region to obtain the total ammonia emission, which is then added as an area source term to the ammonia component transport equation of the corresponding grid cell.

[0080] The dynamic inlet boundary conditions and dynamic source terms are substituted into a pre-defined set of unsteady computational fluid dynamics (CFD) governing equations. Discretization is performed in the spatial domain using the finite volume method and in the time domain using a second-order implicit scheme. The unsteady CFD governing equations include continuity equations, momentum equations, energy equations, k-ε turbulence equations, and component transport equations for methane and ammonia. This describes the core computational process of the digital twin simulation system, i.e., how to use CFD methods to solve fluid flow, heat transfer, and mass transport problems. The unsteady CFD governing equations are a set of partial differential equations describing fluid motion, energy transfer, and mass diffusion. They include the continuity equation describing mass conservation, the momentum equation describing momentum conservation, the energy equation describing energy conservation, the k-ε turbulence equation used to close the Navier-Stokes equations to capture eddies and mixing in the fluid, and the component transport equations describing convection, diffusion, and concentration changes caused by source terms in methane and ammonia. The finite volume method is a commonly used numerical method that divides the computational domain into a series of small control volumes (grid cells), and then integrates the governing equations within each control volume, transforming the partial differential equations into a system of algebraic equations. The second-order implicit scheme is a time-driven method used to handle unsteady-state problems. Compared to the first-order scheme, it offers higher accuracy and greater stability in time step selection.

[0081] Within each computation time step, the discretized governing equations are iteratively solved until the residuals converge, yielding the distribution data of the velocity, temperature, pressure, and greenhouse gas concentration fields in the three-dimensional space at the current time. This describes the iterative solution process of the CFD solver within each time step, ensuring the accuracy of the calculation results. Since the governing equations are highly nonlinear, iterative methods are typically required, such as the SIMPLE (Semi-Implicit Method for Pressure Linked Equations) algorithm and its variants. The calculation results are considered converged when the residuals decrease below a preset threshold.

[0082] The calculation results at the current time step are used as the initial field for the next time step, outputting a spatiotemporal distribution sequence of the gas concentration field within the chamber for multiple future time steps. This sequence includes predicted methane and ammonia concentrations at any spatial point within the chamber at each prediction time, describing the time-progression mechanism and final output of the unsteady-state simulation. The calculation results at the current time step naturally become the starting conditions for the next time step, thus achieving continuous simulation of the system's dynamic evolution. After the simulation is completed, the system outputs a series of flow velocity, temperature, pressure, and methane and ammonia concentration values ​​at three-dimensional spatial grid points within the chamber at different prediction times. These data can be used for visualization, analysis, and subsequent model predictive control.

[0083] This application's embodiments can accurately transform meteorological forecast big data, dynamic individual emission source strength, and manure emissions into boundary conditions and source terms identifiable by a digital twin simulation system in a highly refined and dynamic manner. This enables the simulation system to precisely simulate the complex airflow, heat transfer, and diffusion and distribution processes of greenhouse gases (methane, ammonia) within livestock and poultry houses, overcoming the limitations of traditional methods in processing dynamic and heterogeneous input data. By accurately extrapolating the spatiotemporal distribution of gas concentration fields within the house at multiple future moments, a reliable and high-precision predictive foundation is provided for subsequent optimization control of the house environment based on model predictive control algorithms, significantly improving the intelligence level and effectiveness of greenhouse gas monitoring and regulation.

[0084] In other embodiments, based on the dynamic individual emission source intensity sequence of each animal and combined with the individual three-dimensional spatial coordinates of each animal, the emission source intensity is dynamically mapped in time sequence to the moving point source term in the component transport equation, including: The three-dimensional spatial coordinate sequence of each animal is obtained, and the three-dimensional spatial coordinate sequence is smoothed by Kalman filtering to remove abnormal points caused by positioning jumps, so as to obtain the continuous movement trajectory of the animal. By temporally aligning continuous motion trajectories with dynamic individual emission source intensity sequences, a "time-space-source intensity" triplet data stream is constructed for each animal; In the pre-set indoor environment grid system, the computational grid cell where each animal is located is dynamically located based on the real-time spatial coordinates of each animal, and the corresponding emission source strength value is assigned to the source term of the methane component transport equation of that grid cell; The point source intensity of a single grid point is distributed to multiple adjacent grid cells according to a Gaussian distribution weight to simulate the actual spatial distribution range of emissions caused by animal head movement and respiratory airflow diffusion. At the start of each computation time step, the grid assignment and source strength allocation of all moving point sources are updated according to the latest position coordinates of each animal, so as to realize the real-time dynamic update of source terms as the animals move.

[0085] Specifically, obtaining the three-dimensional spatial coordinate sequence of each animal can be achieved through various positioning technologies, such as UWB-based ultra-wideband positioning systems, RFID radio frequency identification systems, visual tracking systems, or inertial measurement unit (IMU) and visual fusion systems. This raw positioning data often contains noise and transient jumps, affecting its accuracy and continuity. Kalman filtering, an optimal estimation algorithm, can smooth and predict noisy measurement data by fusing multi-source information and considering system dynamics and measurement noise. This effectively eliminates outliers caused by positioning jumps, resulting in a smoother and more realistic continuous movement trajectory for the animal. This ensures the accuracy of subsequent source term mapping.

[0086] Subsequently, the continuous motion trajectory and the dynamic individual emission source intensity sequence are time-aligned to construct a "time-space-source intensity" triple data stream for each animal. The continuous motion trajectory provides the animal's spatial location information at different times, while the dynamic individual emission source intensity sequence provides the animal's emission intensity information at different times. To accurately correlate emission source intensity with the animal's actual location in the simulation system, precise time alignment of these two types of data is required. This is typically achieved through methods such as timestamp matching or interpolation, ensuring that at any given moment, the animal's emission source intensity accurately corresponds to its precise spatial location at that moment. Constructing the "time-space-source intensity" triple data stream provides a complete and synchronized data foundation for the subsequent dynamic setting of moving source items in the simulation grid.

[0087] In the pre-defined indoor environmental grid system, each animal's location within its computational grid cell is dynamically determined based on its real-time spatial coordinates. The corresponding emission source intensity value is then assigned to the source term of the methane transport equation for that grid cell. This pre-defined indoor environmental grid system forms the basis of the computational fluid dynamics (CFD) simulation model, dividing the entire livestock housing space into discrete, interconnected grid cells. At each computational time step, the system determines the specific grid cell in which the animal is currently located based on its real-time spatial coordinates. Subsequently, the time-aligned dynamic individual emission source intensity value is used as the source term of the methane transport equation within that grid cell. This dynamic location and assignment mechanism allows the simulation model to reflect the impact of animal position changes on the distribution of gas emission sources in real time.

[0088] To more realistically simulate the spatial distribution characteristics of actual animal gas emissions, this application distributes the point source intensity of a single grid point to multiple adjacent grid cells using a Gaussian distribution weighting method. This simulates the actual spatial distribution range of emissions caused by animal head movement and respiratory airflow diffusion. Actual animal gas emissions are not strictly speaking an infinitesimally small point, but rather released from the mouth and nose region through behaviors such as breathing and burping, and are affected by minor head movements and initial diffusion from respiratory airflow. Using a Gaussian distribution or other suitable spatial distribution function as the weighting function, the total source intensity of the grid point is distributed proportionally to itself and multiple surrounding adjacent grid cells. The Gaussian distribution can simulate the diffusion trend of gas gradually attenuating from the center point outwards, which is more consistent with actual physical processes.

[0089] Finally, at the start of each computation time step, the grid assignment and source strength allocation of all moving point sources are updated based on the latest position coordinates of each animal, achieving real-time dynamic updates of source terms as the animals move. Animals in livestock sheds are constantly moving, and the locations of their emission sources are constantly changing. To accurately capture this dynamic, at the start of each computation time step in the CFD simulation model, the system reacquires the latest position coordinates of each animal. Based on these latest coordinates, the grid cell where each animal is located is redefined, and its emission source strength is recalculated and allocated to the corresponding grid cell and its neighboring grids according to Gaussian distribution weights.

[0090] In this embodiment, firstly, the animal's three-dimensional spatial coordinate sequence is smoothed using Kalman filtering, effectively eliminating instantaneous jumps and outliers in the positioning data, ensuring the continuity and accuracy of the animal's movement trajectory, and laying the foundation for accurate mapping of subsequent source terms. Secondly, the continuous movement trajectory is time-aligned with the dynamic individual emission source strength sequence, constructing a complete "time-space-source strength" data stream, ensuring the synchronous correlation between emission source strength and the animal's actual location. Furthermore, in the indoor environmental grid system, not only is the grid cell where the animal is located dynamically based on its real-time coordinates, but the point source strength of a single grid point is also innovatively distributed to multiple adjacent grid cells according to a Gaussian distribution weight. This greatly improves the limitation of traditional point source models in accurately simulating the actual spatial distribution range of emissions caused by animal head movement and respiratory airflow diffusion. Finally, at the beginning of each computation time step, the grid affiliation and source strength allocation of the moving point source are updated in real time, ensuring that the simulation model can accurately capture the real-time impact of the animal's dynamic behavior and positional changes on gas emission distribution. Through these improvements, this scheme significantly enhances the accuracy and realism of the moving point source term setting in the digital twin simulation system, thereby making the spatiotemporal distribution projection results of the gas concentration field in the barn at multiple future times more accurate and reliable, providing more solid data support for the precise control of the livestock and poultry barn environment.

[0091] In some embodiments, to meet forecasting needs, a reduced-order model can be constructed using deep learning. The training set is obtained by using batch calculations of fluid dynamics under different climatic conditions to train the neural network to learn the nonlinear mapping between "weather forecast input" and "flow field output". Alternatively, the training set is obtained by using batch calculations of CFD (flow fields under different wind speeds, temperatures, and source strengths) to train the ROM model to learn the nonlinear mapping relationship between input parameters and flow field distribution.

[0092] The loss function is defined as the mean square error (MSE) between the predicted flow field and the actual CFD flow field: After training, the ROM model, based on the short-term weather forecast accessed by S102, can deduce the indoor temperature and humidity field and gas diffusion cloud map for the next few days within milliseconds, realizing real-time interaction of the digital twin.

[0093] In other embodiments, after controlling the environment of the barn through a sequence of future control actions, the livestock and poultry barn environment containing future prediction information can also be defined as a reinforcement learning (RL) environment.

[0094] Define the state space of the intelligent agent , representing wind turbine energy consumption and weather forecast vectors for the next H hours, respectively.

[0095] Then, the agent is trained using deep reinforcement learning algorithms (such as PPO or DQN). A multi-objective reward function is designed to find the optimal policy while ensuring animal welfare. The action space is defined. This includes fan speed regulation (0-100%), wet curtain switch, and start / stop of the manure removal robot. Design a reward function. as follows: in, This refers to the national standard limit for gas concentration. For optimal comfort zone, , , , These are the weighting coefficients. It is a future stress risk penalty calculated based on a predictive model. The agent is trained using a proximal policy optimization algorithm to automatically find the ventilation combination with the lowest energy consumption and the most efficient exhaust while ensuring that the animal does not experience heat stress.

[0096] A value-based Deep Q-Network (DQN) or a policy-based PPO algorithm is employed. The agent continuously interacts with the ROM simulation environment to update its Q-value or policy gradient. The value function is iteratively updated according to the Bellman Equation. Afterwards, the intelligent agent outputs action space based on the optimization results, including: speed adjustment of the variable frequency fan (0-100%), control of the opening degree of the roller shutter, and scheduling instructions for the manure cleaning robot.

[0097] These instructions are sent to the PLC controller via the Internet of Things to coordinate and adjust the ventilation volume and manure removal frequency in the shed, thereby physically changing the environmental state inside the shed and forming a closed-loop control.

[0098] Finally, a consortium blockchain architecture (such as Hyperledger Fabric) is adopted. Key data generated in each accounting cycle (e.g., daily) is hashed and uploaded to the blockchain. The data structure includes: in, For individual animal identification, This represents the cumulative emissions for the day. For key behavior statistics, A hash digest of the environment parameters. This is a climate resilience score for the system's response to this extreme weather event.

[0099] A smart contract (Chaincode) is deployed, with a built-in baseline emission algorithm. When the actual emissions calculated by the system are lower than the baseline, the contract automatically triggers, calculates the emission reduction, and generates a corresponding digital carbon credit token. This token contains a complete traceability link; regulatory agencies or consumers can scan the QR code to view the specific animal behavior evidence and environmental monitoring report corresponding to the unit's carbon emissions, achieving truly "trustworthy digital emission reduction." Based on the greenhouse gas monitoring method for livestock and poultry houses provided in the above embodiments, this application also provides specific implementation methods for greenhouse gas monitoring devices for livestock and poultry houses. Please refer to the following embodiments.

[0100] First see Figure 2 The greenhouse gas monitoring device 200 for livestock and poultry houses provided in this application embodiment may include: The acquisition module 201 is used to acquire target perception big data and weather forecast big data of the target animal. The target perception big data includes physiological stress state data, individual behavior data and oral and nasal microenvironment gas concentration data. The generation module 202 is used to generate a dynamic modulation factor for correcting the baseline emission rate by synchronously identifying animal behavior categories through a multi-task learning network based on physiological stress state data and individual behavior data. Calculation module 203 is used to calculate the dynamic individual emission source strength modulated by physiological stress based on dynamic modulation factor and oral and nasal microenvironment gas concentration data. The simulation module 204 is used to input meteorological forecast big data as dynamic boundary conditions and dynamic individual emission source strength as dynamic source terms into a preset climate forecast-driven digital twin simulation system to simulate the spatiotemporal distribution of gas concentration field in the chamber at multiple future moments. The optimization module 205 is used to optimize the future control action sequence under meteorological disturbances by using a model predictive control algorithm to minimize the cumulative emissions, operating energy consumption and predicted stress level of the animal population in the future prediction time domain.

[0101] As an alternative implementation, the generation module 202 can be specifically used for: The training dataset was obtained, which included time series of animal physiological signals collected synchronously, inertial measurement unit data, manually labeled behavioral categories, and real comprehensive heat stress index and methane emission rate obtained synchronously through rumen capsule and respiratory metabolic reference system as supervision signals. A multi-task learning network architecture is constructed, which includes a shared spatiotemporal feature extraction layer, an action classification branch, a stress index regression branch, and a dynamic modulation factor generation branch. The input of the dynamic modulation factor generation branch is the output of the shared spatiotemporal feature extraction layer and the attention-weighted features of the action classification branch, and the initial modulation factor is generated through a gated fusion unit. The design incorporates a joint loss function, which includes the cross-entropy loss of the behavior classification branch, the mean squared error loss of the stress index regression branch, and the dynamic modulation factor fitting loss. The dynamic modulation factor fitting loss is used to constrain the difference between the initial modulation factor and the reference modulation factor calculated based on the actual methane emission rate. An end-to-end backpropagation algorithm is used to iteratively update the network parameters of the multi-task learning network with the goal of minimizing the joint loss function until the network converges, thus obtaining the trained multi-task learning network.

[0102] As an alternative implementation, the generation module 202 can be specifically used for: The time series of animal physiological signals and inertial measurement unit data within the current time window are acquired, standardized and preprocessed, and then input into the multi-task learning network. Through network forward propagation, the probability vector of each behavior category is output by the behavior classification branch, the continuous value of the comprehensive heat stress index of the current window is output by the stress index regression branch, and a dynamic modulation factor with a value within the preset physiological range is output by the dynamic modulation factor generation branch. Based on the behavior category probability vector, the behavior corresponding to the maximum probability is selected as the current animal's main behavioral state, and the corresponding confidence level is recorded. The dynamic modulation factor is obtained by multiplying the dynamic modulation factor by the baseline emission rate determined in advance based on the animal's weight and behavioral category.

[0103] As an alternative implementation, the computing module 203 can also be used for: The original time series of gas concentrations in the oral and nasal microenvironment was preprocessed, and the instantaneous spike noise caused by violent head shaking or sudden changes in respiratory airflow was removed by a sliding window adaptive median filtering algorithm to obtain a smoothed gas concentration series in the respiratory zone. Based on the smoothed respiratory zone gas concentration sequence, the concentration pulse corresponding to each hiccup event of the animal is identified by the peak detection algorithm, and the concentration feature parameters of each pulse are extracted. The concentration feature parameters include peak amplitude, rising slope, half width at half maximum and pulse area. Based on the dynamic modulation factor output by the multi-task learning network, combined with the respiratory frequency and respiratory depth coefficient corresponding to the animal's current behavioral category, a respiratory dynamics model is constructed to estimate the gas exchange volume and gas mixing coefficient of the respiratory zone in a single respiratory cycle of the animal. The concentration pulse characteristic parameters are input into a pre-trained gas diffusion inverse calculation model. The inverse calculation model takes the pulse characteristic parameters as input and the actual emission mass of a single emission event as output, eliminating the measurement deviation of local concentration in the breathing zone caused by factors such as airflow dilution and sensor response delay. Based on the actual emission mass of a single emission event and the corresponding time interval of the hiccup event, the instantaneous emission rate under the current behavioral state is calculated; at the same time, the dynamic modulation factor is used as a multiplicative coefficient to correct the theoretical emission rate calculated based on metabolic weight and basal behavioral metabolic rate, so as to obtain the theoretical corrected emission rate. A data fusion algorithm based on Kalman filtering is adopted to optimally weight and fuse instantaneous emission rates with theoretically corrected emission rates. At the same time, the confidence level of the inverse solution model is introduced as an adjustment factor for the observation noise covariance matrix, and the fused dynamic individual emission source strength is output.

[0104] As an alternative implementation, the computing module 203 can also be used for: A CFD simulation model of the animal head-collar sensor system was constructed in advance in a laboratory environment to simulate the gas diffusion and transmission process between the mouth and nose emission point and the collar sensor location under different breathing intensities, different head orientations, and different environmental wind speeds. A massive simulation dataset is generated through a CFD simulation model. The dataset includes input parameters: emission source strength, breathing rate, ambient wind speed, and head posture angle; and output parameters: the concentration pulse waveform characteristics detected at the sensor location. Using the concentration pulse waveform features as input and the corresponding real emission source strength as output, a deep neural network based on an attention mechanism is trained to construct a nonlinear inverse mapping relationship from sensor observation to real source strength, thus obtaining a gas diffusion inverse solution model.

[0105] As an optional implementation, the deduction module 204 can be specifically used for: Based on meteorological forecast big data, dynamic air inlet boundary conditions of a three-dimensional geometric model of livestock and poultry houses are constructed. Wind speed and direction data are converted into velocity vector fields of the air inlet, temperature and humidity data are converted into the thermodynamic initial state of the airflow at the air inlet, and solar radiation intensity is converted into dynamic heat flux boundaries of the roof and enclosure structure. Based on the dynamic individual emission source intensity sequence of each animal, and combined with the individual three-dimensional spatial coordinates of each animal, the emission source intensity is dynamically mapped into the moving point source term in the component transport equation in time order. The distribution and area of ​​fecal waste areas identified by the thermal infrared imaging system are obtained. The ammonia volatilization rate on the surface of the fecal waste is estimated by combining the temperature and moisture content of the fecal waste. The volatilization rate is then mapped to a surface source term. The dynamic inlet boundary conditions and dynamic source terms are substituted into the preset unsteady computational fluid dynamics control equations. The finite volume method is used to discretize the equations in the spatial domain, and the second-order implicit scheme is used to discretize them in the time domain. The unsteady computational fluid dynamics control equations include the continuity equation, momentum equation, energy equation, k-ε turbulence equation, and component transport equations for methane and ammonia. Within each computation time step, the discrete control equations are solved iteratively until the residuals converge, and the distribution data of the velocity field, temperature field, pressure field and greenhouse gas concentration field in the three-dimensional space of the current time are obtained. The calculation result at the current time is used as the initial field for the next time step, and the spatiotemporal distribution sequence of gas concentration field within the cell for multiple future time steps is output. The spatiotemporal distribution sequence of gas concentration field within the cell contains the predicted values ​​of methane and ammonia concentrations at any spatial point within the cell at each prediction time.

[0106] As an optional implementation, the deduction module 204 can be specifically used for: The three-dimensional spatial coordinate sequence of each animal is obtained, and the three-dimensional spatial coordinate sequence is smoothed by Kalman filtering to remove abnormal points caused by positioning jumps, so as to obtain the continuous movement trajectory of the animal. By temporally aligning continuous motion trajectories with dynamic individual emission source intensity sequences, a "time-space-source intensity" triplet data stream is constructed for each animal; In the pre-set indoor environment grid system, the computational grid cell where each animal is located is dynamically located based on the real-time spatial coordinates of each animal, and the corresponding emission source strength value is assigned to the source term of the methane component transport equation of that grid cell; The point source intensity of a single grid point is distributed to multiple adjacent grid cells according to a Gaussian distribution weight to simulate the actual spatial distribution range of emissions caused by animal head movement and respiratory airflow diffusion. At the start of each computation time step, the grid assignment and source strength allocation of all moving point sources are updated according to the latest position coordinates of each animal, so as to realize the real-time dynamic update of source terms as the animals move.

[0107] Figure 3 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.

[0108] An electronic device may include a processor 301 and a memory 302 storing computer program instructions.

[0109] Specifically, the processor 301 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0110] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one instance, memory 302 may include removable or non-removable (or fixed) media, or memory 302 may be non-volatile solid-state memory. Memory 302 may be internal or external to the integrated gateway disaster recovery device.

[0111] In one instance, memory 302 may be read-only memory (ROM). In one instance, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0112] Memory 302 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the livestock house greenhouse gas monitoring method according to the first aspect of this disclosure.

[0113] The processor 301 reads and executes computer program instructions stored in the memory 302 to achieve... Figure 1 A method for monitoring greenhouse gases in livestock and poultry houses, as shown in the embodiment.

[0114] In one example, the electronic device may also include a communication interface 303 and a bus 304. For example, Figure 3As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 304 and complete communication with each other.

[0115] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0116] Bus 304 includes hardware, software, or both, that couples components of an electronic device together. For example, and not as a limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 304 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0117] This electronic device can execute the greenhouse gas monitoring method for livestock and poultry houses in the embodiments of this application, thereby achieving a combination of Figures 1-2 The method and apparatus for monitoring greenhouse gases in livestock and poultry houses are described.

[0118] Furthermore, in conjunction with the greenhouse gas monitoring methods for livestock and poultry houses described in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the greenhouse gas monitoring methods for livestock and poultry houses described in the above embodiments.

[0119] In an optional embodiment, in conjunction with the greenhouse gas monitoring method for livestock and poultry houses described in the above embodiments, this application embodiment can provide a computer program product to implement the method. The instructions in the computer program product are executed by the processor of an electronic device, enabling the electronic device to implement any of the greenhouse gas monitoring methods for livestock and poultry houses described in the above embodiments.

[0120] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0121] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0122] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0123] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0124] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for monitoring greenhouse gases in livestock and poultry houses, characterized in that, include: Acquire target perception big data and weather forecast big data of the target animal. The target perception big data includes physiological stress state data, individual behavior data and oral and nasal microenvironment gas concentration data. Based on the physiological stress state data and individual behavior data, a multi-task learning network is used to synchronously identify animal behavior categories and generate dynamic modulation factors for correcting the baseline emission rate. Based on the dynamic modulation factor and the gas concentration data of the oral and nasal microenvironment, the dynamic individual emission source strength modulated by physiological stress is calculated. Using the meteorological forecast big data as dynamic boundary conditions and the dynamic individual emission source strength as dynamic source terms, the data is input into a preset climate forecast-driven digital twin simulation system to deduce the spatiotemporal distribution of the gas concentration field in the house at multiple future moments. Based on model predictive control algorithms, with the optimization objectives of minimizing cumulative emissions, operating energy consumption, and predicted stress levels of animal populations in the future prediction time domain, the future control action sequence is continuously optimized under meteorological disturbances to control the environment inside the enclosure.

2. The method according to claim 1, characterized in that, Before generating a dynamic modulation factor for correcting the baseline emission rate by simultaneously identifying animal behavior categories through a multi-task learning network based on the physiological stress state data and individual behavior data, the method further includes: A training dataset is obtained, which includes synchronously collected time series of animal physiological signals, inertial measurement unit data, manually labeled behavioral categories, and real comprehensive heat stress index and methane emission rate synchronously obtained through rumen capsule and respiratory metabolic reference system as supervision signals; A multi-task learning network architecture is constructed, which includes a shared spatiotemporal feature extraction layer, a behavior classification branch, a stress index regression branch, and a dynamic modulation factor generation branch. The input of the dynamic modulation factor generation branch is the output of the shared spatiotemporal feature extraction layer and the attention-weighted features of the behavior classification branch, and an initial modulation factor is generated through a gating fusion unit. Design a joint loss function, which includes the cross-entropy loss of the behavior classification branch, the mean square error loss of the stress index regression branch, and the dynamic modulation factor fitting loss. The dynamic modulation factor fitting loss is used to constrain the difference between the initial modulation factor and the reference modulation factor calculated based on the real methane emission rate. An end-to-end backpropagation algorithm is used to iteratively update the network parameters of the multi-task learning network with the goal of minimizing the joint loss function until the network converges, thus obtaining the trained multi-task learning network.

3. The method according to claim 2, characterized in that, The process, based on the physiological stress state data and individual behavior data, synchronously identifies animal behavior categories through a multi-task learning network and generates a dynamic modulation factor for correcting the baseline emission rate, including: The time series of animal physiological signals and inertial measurement unit data within the current time window are acquired, standardized and preprocessed, and then input into the multi-task learning network. Through network forward propagation, the probability vector of each behavior category is output by the behavior classification branch, the continuous value of the comprehensive heat stress index of the current window is output by the stress index regression branch, and a dynamic modulation factor with a value within the preset physiological range is output by the dynamic modulation factor generation branch. Based on the behavior category probability vector, the behavior corresponding to the maximum probability is selected as the current main behavior state of the animal, and the corresponding confidence level is recorded. The dynamic modulation factor is multiplied by the baseline emission rate determined in advance based on the animal's weight and behavioral category to obtain the dynamic modulation factor modulated by physiological stress.

4. The method according to claim 1, characterized in that, The calculation of the dynamic individual emission source strength modulated by physiological stress based on the dynamic modulation factor and the gas concentration data of the oral and nasal microenvironment includes: The original time series of gas concentration in the oral and nasal microenvironment was preprocessed, and the instantaneous spike noise caused by violent head shaking or sudden changes in respiratory airflow was removed by a sliding window adaptive median filtering algorithm to obtain a smoothed gas concentration series in the respiratory zone. Based on the smoothed respiratory zone gas concentration sequence, the concentration pulse corresponding to each hiccup event of the animal is identified by the peak detection algorithm, and the concentration feature parameters of each pulse are extracted. The concentration feature parameters include peak amplitude, rising edge slope, half width at half maximum and pulse area. Based on the dynamic modulation factor output by the multi-task learning network, and combined with the respiratory frequency and respiratory depth coefficient corresponding to the animal's current behavior category, a respiratory dynamics model is constructed to estimate the gas exchange volume and gas mixing coefficient of the respiratory zone in a single respiratory cycle of the animal. The concentration pulse characteristic parameters are input into a pre-trained gas diffusion reverse calculation model. The reverse calculation model takes the pulse characteristic parameters as input and the actual emission mass of a single emission event as output, eliminating the measurement deviation of local concentration in the breathing zone caused by factors such as airflow dilution and sensor response delay. Based on the actual emission mass of the single emission event and the corresponding hiccup event time interval, the instantaneous emission rate under the current behavioral state is calculated; at the same time, the dynamic modulation factor is used as a multiplicative coefficient to correct the theoretical emission rate calculated based on metabolic weight and basal behavioral metabolic rate, so as to obtain the theoretical corrected emission rate. A data fusion algorithm based on Kalman filtering is used to optimally weight and fuse the instantaneous emission rate with the theoretical corrected emission rate. At the same time, the confidence level of the inverse solution model is introduced as an adjustment factor for the observation noise covariance matrix, and the fused dynamic individual emission source strength is output.

5. The method according to claim 4, characterized in that, Before inputting the concentration pulse characteristic parameters into a pre-trained gas diffusion inverse calculation model, the method further includes: A CFD simulation model of the animal head-collar sensor system was constructed in advance in a laboratory environment to simulate the gas diffusion and transmission process between the mouth and nose emission point and the collar sensor location under different breathing intensities, different head orientations, and different environmental wind speeds. The CFD simulation model generates a massive simulation dataset, which includes input parameters: emission source strength, breathing rate, ambient wind speed, and head posture angle; and output parameters: the concentration pulse waveform characteristics detected at the sensor location. Using the concentration pulse waveform features as input and the corresponding real emission source strength as output, a deep neural network based on an attention mechanism is trained to construct a nonlinear inverse mapping relationship from sensor observation to real source strength, thereby obtaining the gas diffusion inverse solution model.

6. The method according to claim 1, characterized in that, The process involves using the meteorological forecast big data as dynamic boundary conditions and the dynamic individual emission source strength as dynamic source terms, inputting them into a preset climate forecast-driven digital twin simulation system to deduce the spatiotemporal distribution of the indoor gas concentration field at multiple future moments, including: Based on the meteorological forecast big data, the dynamic air inlet boundary conditions of the three-dimensional geometric model of the livestock and poultry house are constructed. The wind speed and wind direction data are converted into the velocity vector field of the air inlet, the temperature and humidity data are converted into the thermodynamic initial state of the airflow in the air inlet, and the solar radiation intensity is converted into the dynamic heat flux boundary of the roof and enclosure structure. Based on the dynamic individual emission source intensity sequence of each animal, and combined with the individual three-dimensional spatial coordinates of each animal, the emission source intensity is dynamically mapped in time sequence to the moving point source term in the component transport equation. The distribution and area of ​​fecal waste areas identified by the thermal infrared imaging system are obtained. The ammonia volatilization rate on the surface of the fecal waste is estimated by combining the temperature and moisture content of the fecal waste. The volatilization rate is then mapped as a surface source term. The dynamic air inlet boundary conditions and dynamic source terms are substituted into the preset unsteady computational fluid dynamics control equation set, and discretized in the spatial domain using the finite volume method and in the time domain using a second-order implicit scheme. The unsteady computational fluid dynamics control equation set includes the continuity equation, momentum equation, energy equation, k-ε turbulence equation and component transport equations for methane and ammonia. Within each computation time step, the discrete set of control equations is solved iteratively until the residuals converge, and the distribution data of the velocity field, temperature field, pressure field and greenhouse gas concentration field in the three-dimensional space of the chamber at the current time are obtained. The calculation result at the current moment is used as the initial field for the next time step, and the spatiotemporal distribution sequence of gas concentration field in the cell for multiple future moments is output. The spatiotemporal distribution sequence of gas concentration field in the cell contains the predicted values ​​of methane and ammonia concentrations at any spatial point in the cell at each predicted moment.

7. The method according to claim 6, characterized in that, The step of dynamically mapping the emission source intensity into a moving point source term in the component transport equation in chronological order, based on the dynamic individual emission source intensity sequence of each animal and combined with the individual three-dimensional spatial coordinates of each animal, includes: The three-dimensional spatial coordinate sequence of each animal is obtained, and the three-dimensional spatial coordinate sequence is smoothed by Kalman filtering to remove abnormal points caused by positioning jumps, so as to obtain the continuous movement trajectory of the animal. The continuous motion trajectory is time-aligned with the dynamic individual emission source intensity sequence to construct a "time-space-source intensity" triplet data stream for each animal; In the pre-set indoor environment grid system, the computational grid cell where each animal is located is dynamically located based on the real-time spatial coordinates of each animal, and the corresponding emission source strength value is assigned to the source term of the methane component transport equation of that grid cell; The point source intensity of a single grid point is distributed to multiple adjacent grid cells according to a Gaussian distribution weight to simulate the actual spatial distribution range of emissions caused by animal head movement and respiratory airflow diffusion. At the start of each computation time step, the grid assignment and source strength allocation of all moving point sources are updated according to the latest position coordinates of each animal, so as to realize the real-time dynamic update of source terms as the animals move.

8. A greenhouse gas monitoring device for livestock and poultry houses, characterized in that, The device includes: The acquisition module is used to acquire target perception big data and weather forecast big data of the target animal from meteorological forecast big data. The target perception big data includes physiological stress state data, individual behavior data and oral and nasal microenvironment gas concentration data. The generation module is used to generate a dynamic modulation factor for correcting the baseline emission rate by synchronously identifying animal behavior categories through a multi-task learning network based on the physiological stress state data and individual behavior data. The calculation module is used to calculate the dynamic individual emission source strength modulated by physiological stress based on the dynamic modulation factor and the gas concentration data of the oral and nasal microenvironment. The extrapolation module is used to take the meteorological forecast big data as dynamic boundary conditions and the dynamic individual emission source strength as dynamic source terms, input them into a preset climate forecast-driven digital twin simulation system, and extrapolate the spatiotemporal distribution of the gas concentration field in the chamber at multiple future moments. The optimization module is used to optimize the future control action sequence under meteorological disturbances by using model predictive control algorithms to minimize the cumulative emissions, operating energy consumption and predicted stress level of the animal population in the future prediction time domain.

9. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the greenhouse gas monitoring method for livestock and poultry houses as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the greenhouse gas monitoring method for livestock and poultry houses as described in any one of claims 1-7.