Livestock and poultry breeding house air quality real-time monitoring method and system

By deploying multiple air quality acquisition nodes in livestock and poultry sheds, generating spatiotemporal sequences of air quality, and identifying and tracking the temporal evolution of abnormal areas, the problem of insufficient spatial distribution and temporal evolution in existing air quality monitoring technologies has been solved, achieving more accurate air quality monitoring.

CN122631160APending Publication Date: 2026-08-25LUDONG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610784018.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-02
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing air quality monitoring technologies for livestock and poultry farms cannot accurately reflect the spatial distribution and temporal evolution of air pollution, are prone to false alarms and missed alarms, lack dynamic tracking and systematic analysis of abnormal areas, and are difficult to distinguish between short-term disturbances and continuous cumulative anomalies.

Method used

Multiple air quality acquisition nodes are deployed in livestock and poultry sheds to generate spatiotemporal air quality sequences. By combining the overall shed reference status and location adjacency relationships, abnormal areas are identified, and real-time air quality monitoring results are generated through time window matching and regional block evolution.

Benefits of technology

It enables accurate monitoring of the spatial location and temporal evolution of air quality, distinguishes between short-term disturbances and continuous cumulative anomalies, and improves the ability to judge anomaly trends and the interpretability of monitoring results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122631160A_ABST
    Figure CN122631160A_ABST
Patent Text Reader

Abstract

The application provides a livestock and poultry breeding house air quality real-time monitoring method and system, the method comprises the following steps: at least two air quality collection nodes are arranged in the breeding house, ammonia, carbon dioxide, temperature and humidity data are collected, and air quality space-time sequences are generated; local abnormal area is identified based on the space-time sequences; abnormal evolution characteristics are extracted by matching adjacent time window abnormal area blocks; finally, the ratio of the gas concentration in the area to the reference concentration of the whole house is combined to generate the final monitoring result. Through multi-point arrangement and space-time evolution analysis, the present scheme realizes fine and dynamic monitoring of the air quality in the breeding house, effectively solving the problem that the traditional single-point monitoring cannot reflect the spatial difference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of agricultural and environmental monitoring technology, and in particular relates to a method and system for real-time monitoring of air quality in livestock and poultry breeding sheds. Background Technology

[0002] Air quality in livestock and poultry sheds directly affects animal growth performance, disease control, feed conversion efficiency, and the safety of workers' working environment. It is also a fundamental component of modern livestock environmental control systems. Current livestock air quality monitoring typically focuses on parameters such as ammonia, carbon dioxide, temperature, and humidity, using several fixed sensors for continuous data collection. The instantaneous values ​​at each monitoring point are then compared with preset thresholds to trigger alarms, ventilation linkage, or environmental adjustments. This approach offers advantages such as ease of deployment, low cost, and easy integration into existing control systems, making it the most relevant and mainstream technical solution in current livestock environmental monitoring systems. However, in long-term practical use, this monitoring method, centered on fixed-point data collection and fixed threshold judgment, has gradually revealed significant shortcomings.

[0003] First, air pollution in livestock sheds is not uniformly distributed. Pollution sources are often concentrated above drainage ditches, near water lines, in localized dead corners, and in areas with dense animal activity. Influenced by shed structure, ventilation methods, seasonal conditions, and stocking density, the concentration of harmful gases and humidity levels at different locations at the same time can vary significantly. Current technologies often use values ​​from a few monitoring points to represent the overall air quality, which can mask high-risk areas with the overall average, leading to inconsistencies between monitoring results and actual spatial distribution. Second, current technologies typically focus on a single point in time, lacking the ability to track the persistence, expansion, and migration of abnormal areas over continuous time windows. Therefore, it is difficult to distinguish between short-term disturbances and continuous cumulative anomalies, and it is also difficult to accurately reflect the development trend of abnormal air problems. Third, livestock sheds are complex environments with high dust, high humidity, and highly corrosive gases. Instantaneous values ​​from a single monitoring point are easily affected by local airflow, sensor hysteresis, and environmental disturbances. Without unified temporal organization and spatial correlation analysis, false alarms, missed alarms, and inaccurate judgments of the location and severity of anomalies are common. Looking further ahead, most existing technologies remain at the level of linear processing, which involves collecting data, comparing thresholds, and issuing alarms. They lack systematic analysis of the spatial correlation between air conditions at multiple locations, the formation process of abnormal areas, and the evolution of abnormal areas over time. Therefore, although they can provide basic monitoring information, they are still insufficient in terms of interpretability, location capabilities, and dynamic monitoring capabilities at aquaculture sites. Summary of the Invention

[0004] This invention discloses a method and system for real-time monitoring of air quality in livestock and poultry breeding sheds, in order to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the first aspect of the present invention provides a method for real-time monitoring of air quality in livestock and poultry breeding sheds, the method comprising: At least two air quality monitoring nodes are set up in the livestock and poultry breeding house to collect the ammonia concentration, carbon dioxide concentration, temperature and humidity of each air quality monitoring node, and generate a spatiotemporal sequence of air quality. Based on the aforementioned air quality spatiotemporal sequence, combined with the overall reference state and location adjacency relationship, the results of identifying areas with abnormal air quality are obtained. Based on the results of the air quality anomaly areas, the regional blocks within adjacent time windows are matched to generate the air quality anomaly evolution results; Based on the results of the air quality anomaly evolution, and combined with the ratio of the gas concentration within the region to the overall reference concentration, real-time air quality monitoring results are generated.

[0006] Furthermore, the generation of the air quality spatiotemporal sequence specifically includes: A discrete time window is constructed by setting a unified start time and a fixed sampling period; For any location, any parameter category, and any time window, with the center time of the window as the target, the original sampled value that is closest to the center time within the window is selected as the representative value of the window; When a parameter at a certain location has no sampled value within the current time window, read the representative value generated in the previous time window at that location or the baseline value written during the system calibration phase. The air state vector is formed by combining the representative values ​​of ammonia, carbon dioxide, temperature, and humidity at the same location and within the same time window, thus creating a spatiotemporal sequence of air quality.

[0007] Furthermore, the results of identifying areas with abnormal air quality specifically include: By fixing a time window, the corresponding parameters at all positions are averaged to obtain the overall reference state; Based on the difference between the state vector at each location and the reference state, a location anomaly index is constructed. The location anomaly index includes a multi-parameter normalization bias, an ammonia and humidity coupling term, and a neighborhood gradient term. The location anomaly index is compared with the region determination threshold to filter out the set of abnormal locations; Based on the adjacency table established during the site selection phase, the set of abnormal locations is connected and merged to generate results for areas with abnormal air quality.

[0008] Furthermore, the specific results of generating the air quality anomaly evolution include: Read the fixed installation coordinates corresponding to the location number, and calculate the center position and area size of each abnormal area block; A method combining set similarity and spatial displacement is used to calculate the matching score between the i-th region block in the current time window and the j-th region block in the previous time window; Calculate the matching score for each pair of blocks, and uniquely pair them according to the score from largest to smallest. Establish the successfully matched blocks as a regional evolution chain. Based on the aforementioned regional evolution chain, the duration, expansion trend, migration distance, and change smoothness features are extracted to generate air quality anomaly evolution results.

[0009] Furthermore, the extraction of duration, expansion trend, migration distance, and change smoothness features specifically includes: For the first occurrence of the aforementioned regional evolution chain, only the duration feature is calculated; For the regional evolution chain that extends over two time windows, calculate the duration characteristics, expansion trend characteristics, and migration distance characteristics; For the regional evolution chain that extends for three or more time windows, calculate the duration feature, expansion trend feature, migration distance feature, and change smoothness feature; The above features are weighted and combined to generate a comprehensive evolution value as the result of air quality anomaly evolution.

[0010] Furthermore, the generation of real-time air quality monitoring results specifically includes: Traverse each abnormal region block under the current time window, call back the air quality spatiotemporal sequence, read the representative values ​​of ammonia and carbon dioxide at the location within the region block, and calculate the regional average ammonia value and regional average carbon dioxide value. The ratios of the regional average ammonia value to the overall reference ammonia value and the ratio of the regional average carbon dioxide value to the overall reference carbon dioxide value are weighted and superimposed with the comprehensive evolution value corresponding to the regional evolution chain. Generate regional risk intensity and compare it with a pre-stored table of level thresholds to generate regional-level monitoring results; The risk intensity of all areas under the current time window is summarized and aggregated to generate aggregate-level monitoring results.

[0011] Furthermore, the rounding and summarizing of the risk intensity of all regions under the current time window specifically includes: The highest regional-level monitoring result among all current regions will be used as the overall baseline level for the housing complex. The status of the entire building is displayed in detail by combining the number of the highest-level areas and the coverage area. The output includes the current time window index, the overall monitoring level, the location set of each abnormal area and its corresponding level, and the structured monitoring results.

[0012] Furthermore, the air quality sampling nodes are deployed at locations including the air inlet, the middle, above the sewage ditch, and near the water supply line; The air quality acquisition node includes an electrochemical ammonia sensor, a non-spectral infrared carbon dioxide sensor, and an integrated digital temperature and humidity sensor.

[0013] Furthermore, after generating the air quality anomaly evolution results, the method also includes: When the matching score is lower than the set threshold, the current block will be treated as a newly emerging abnormal area and a new chain will be built. When the duration of the regional evolution chain exceeds a preset reference duration, it is determined to be a continuous accumulation anomaly; When the smoothness of the change in the regional evolution chain is higher than a set value, it is determined to be a short-term disturbance anomaly.

[0014] In a second aspect of the present invention, a real-time air quality monitoring system for livestock and poultry breeding sheds is provided, the system comprising: The data acquisition module is used to deploy at least two air quality acquisition nodes in livestock and poultry breeding houses and collect environmental parameters; the collected environmental parameters are organized according to a unified time window and fixed spatial location to generate an air quality spatiotemporal sequence; The region identification module is used to identify local abnormal regions based on the spatiotemporal sequence of air quality and generate results for abnormal air quality regions. The evolution extraction module is used to match regional blocks within adjacent time windows based on the air quality anomaly region results to generate air quality anomaly evolution results; The monitoring and judgment module is used to generate real-time air quality monitoring results based on the air quality anomaly evolution results and the ratio of the gas concentration in the area to the overall reference concentration.

[0015] The beneficial technical effects of the present invention are at least as follows: To address the aforementioned problems, this invention provides a method and system for real-time monitoring of air quality in livestock and poultry sheds. It organizes air parameters from multiple locations within the shed according to a unified time window and fixed spatial location, forming a spatiotemporal sequence of air quality that simultaneously expresses temporal continuity and spatial differences. Based on this, it identifies local anomaly regions by combining regional adjacency relationships, thus elevating the monitored object from discrete point values ​​to a regional state with spatial location significance. Furthermore, this invention matches and tracks anomaly regions within the continuous time window, extracting evolutionary characteristics such as persistence, expansion, migration, and smoothness of change in the anomaly regions. This enables the system to distinguish between short-term disturbance-type anomalies and continuous cumulative anomalies, thereby improving its ability to judge the development trend of anomalies. In the final monitoring stage, this invention jointly determines the evolutionary state of the anomaly region with the air quality level within the region, generating real-time air quality monitoring results at the regional and shed levels. This ensures that the output conclusion is no longer a simple single-point exceedance signal, but a structured monitoring result that simultaneously reflects the location of the anomaly region, the development state of the anomaly, and the current monitoring level. Through this holistic design tailored to specific scenarios in livestock sheds, the present invention can more realistically express the spatial distribution characteristics and temporal evolution patterns of air quality within the sheds, enhance the ability to identify local anomalies, judge abnormal trends, and interpret on-site monitoring results, thereby overcoming the shortcomings of existing technologies in terms of insufficient spatial perception, insufficient dynamic tracking, and weak engineering practicality of monitoring results. Attached Figure Description

[0016] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.

[0017] Figure 1 This is a flowchart of a method for real-time monitoring of air quality in livestock and poultry breeding sheds according to the present invention.

[0018] Figure 2 This is a framework diagram of a real-time air quality monitoring system for livestock and poultry breeding sheds according to the present invention. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0020] In one or more embodiments, such as Figure 1 As shown, a method for real-time monitoring of air quality in livestock and poultry breeding houses is disclosed, the method comprising the following: S1: At least two air quality collection nodes are set up in the livestock and poultry breeding house to collect the ammonia concentration, carbon dioxide concentration, temperature and humidity of each air quality collection node, and generate an air quality spatiotemporal sequence.

[0021] Specifically, several fixed monitoring locations are deployed within livestock and poultry sheds along the direction of airflow and in typical pollution-forming areas. Each location is equipped with an air quality data acquisition node, which includes at least an ammonia sensor, a carbon dioxide sensor, and a temperature and humidity sensor. The ammonia sensor preferably uses an electrochemical device, providing continuous numerical output; the carbon dioxide sensor preferably uses a non-dispersive infrared device, also providing continuous numerical output; and the temperature and humidity sensor uses an integrated digital device, providing two continuous numerical outputs. Each node is assigned a unique location number upon installation. The identification number is entered into the data acquisition terminal by construction personnel based on the building's layout, such as corresponding to areas like the air inlet, middle section, above the sewage ditch, and near the water supply line. Each original record is automatically accompanied by the sampling time from the data acquisition terminal. and parameter category identifier The parameter categories are limited to four types: ammonia, carbon dioxide, temperature, and humidity. Therefore, the raw data entering this step has a uniform structure, meaning each record explicitly includes location, parameter category, sampling time, and sampled value. Although each acquisition node operates according to the same sampling period, due to hardware latency and communication timing, the actual transmission time usually has slight deviations. For example, a node might transmit at a slightly different time. Upload ammonia levels, another node at time... Upload the carbon dioxide value, and another node at time... Upload temperature and humidity values. Directly comparing these records one by one would result in a mixture of multiple adjacent time points; therefore, it's necessary to compress the continuously arriving raw records onto a unified time reference. Here, we employ the concept of equal-interval time segmentation from discrete time series analysis, combined with the classic nearest-neighbor resampling method. Using the center of a fixed time window as a reference, the sample closest to the center time within the window is selected as the representative value. This method originates from conventional time-series resampling processing. The focus of this application is to apply it to the air quality collection scenario in livestock sheds, characterized by "fixed location, multiple parameter categories, and micro-hourly delays," enabling the resampling results to simultaneously retain location and parameter category information.

[0022] In the specific calculation, a unified start time is first set. and fixed sampling period For any position Any parameter category Any time window Using the center time of the window as the target, select the record with the smallest distance from the center time from all original records within the window as the representative value of the window, written as: ; in, Indicates position In the Within a time window, the parameter category is The representative value; Indicates position Corresponding parameter category The The original sampled value comes directly from the corresponding sensor; The sampling time corresponding to this original sample value is recorded by the clock of the acquisition terminal; This serves as the unified start time for this round of monitoring; The sampling period is set in advance; The time window number; The original record number is used to satisfy the minimum time distance condition. Based on the above formula, representative values ​​of each parameter within a unified time window can be directly generated. For example, take... , The current generation of the first If a time window represents a value, then the center time of that window is... If the location The ammonia sensor uploaded three records within this window, with sampling times of respectively. , , The corresponding sampled values ​​are respectively , , The distances of the three records to the center of the window are respectively , , Therefore, the sampling time is taken as The record, its corresponding value The ammonia value represented by this window, i.e. In the same way, the location The carbon dioxide, temperature, and humidity channels can generate [the following] separately. , and When a parameter at a certain location has no sampled value within the current time window, the acquisition terminal reads the representative value of the same type already generated in the previous time window for that location as the representative value for the current time window. If the location is in the initial monitoring stage and a representative value for the previous time window has not yet been formed, the baseline value of the same type written for that location during the system calibration stage is used as the representative value for the current time window. Thus, representative values ​​for ammonia, carbon dioxide, temperature, and humidity at any location and in any time window can be completely generated, maintaining a unified location index and a unified time window index, directly forming a complete air condition at the same time and location.

[0023] After obtaining four representative values ​​within a unified time window, a multivariate state representation method is used to combine ammonia, carbon dioxide, temperature, and humidity at the same location and within the same time window into a single air state vector. This approach originates from state-space modeling and the construction of state vectors in multivariate time series representation. This application limits the state components to the four core parameters of indoor air quality monitoring to directly serve subsequent regional anomaly identification. The expression is as follows: ; in, Indicates position In the time window The state of the air; This represents the ammonia value within this window at this location, corresponding to the parameter category of ammonia in the previous formula. ; This represents the carbon dioxide value within this window at this location, corresponding to the parameter category of carbon dioxide. ; This represents the temperature value within this window at this location, corresponding to the parameter category of temperature. ; This represents the humidity value within this window at this location, corresponding to the parameter category of humidity. The reason for using this combined expression is that abnormal air quality in livestock sheds is not determined by a single indicator, but rather by multiple parameters. For example, if a certain location above a sewage ditch experiences a sustained increase in ammonia levels over several consecutive time windows, while humidity remains high, this state has different implications in regional determination than "slightly higher ammonia levels but lower humidity." Therefore, combining the four types of parameters into a unified state allows for more accurate subsequent regional comparisons. After completing this structure, all locations are numbered. In all time windows The state above Arranging the data chronologically yields the output of this step—the air quality spatiotemporal sequence. This sequence allows for horizontal comparison of air conditions at different locations within the same time window, and vertical tracking of state changes within consecutive time windows at the same location. Therefore, the next step can directly use this air quality spatiotemporal sequence as input for anomaly region identification. Ultimately, the output of this step is unique: the air quality spatiotemporal sequence. .

[0024] S2: Based on the aforementioned air quality spatiotemporal sequence, combined with the overall reference state and location adjacency relationship, identify the results of areas forming air quality anomalies.

[0025] Specifically, step two directly calls the air quality spatiotemporal sequence output in step one. And in each time window The air conditions at all locations are synchronously compared, thus transforming the "discrete location states in the spatiotemporal sequence" into "locatable anomalous region results within the rounding step." The input here is not the original sampled values, but rather the state vector that has been uniformly organized in step one. ,in , , , Representing positions In the time window The values ​​of ammonia, carbon dioxide, temperature, and humidity are represented below. Step two has two core tasks: first, to determine whether each location deviates significantly from the overall environment of the shed at the same time; and second, to determine whether this deviation forms a continuous area spatially. The first part corresponds to "anomaly identification," and the second part corresponds to "regional merging." This approach comes from the weighted distance metric in multivariate statistics and the neighborhood consistency judgment in graph structures. Based on this, this application has made two modifications to the formation mechanism of air pollution in livestock sheds: First, the simple multi-parameter deviation is rewritten as "normalized deviation + ammonia and humidity coupling term," because a high humidity environment in the livestock shed amplifies the significance of ammonia anomalies; second, the single-point deviation is rewritten as "local deviation + neighboring point gradient," because typical areas such as drainage ditches, corner stagnant areas, and near drinking water lines often exhibit localized continuous accumulation rather than isolated point abrupt changes. A fixed time window is first established. The average of the corresponding parameters for all positions is used to obtain the rounding reference state. , , , This step is equivalent to extracting the "overall background at the same moment" from the air quality spatiotemporal sequence output in step one. Then, based on the difference between the state vector at each location and the background, a location anomaly index is constructed. The first four terms of the index are derived from the expansion of the classical weighted Euclidean distance after component normalization. Normalization ensures that different parameters participate in the calculation on a uniform scale. The added coupling term amplifies the anomalous features of high-ammonia, high-humidity regions, while the added neighbor gradient term characterizes the local accumulation boundary. Its expression is: ; in, Indicates position In the time window Abnormal index below; , , , Take directly from the state vector output in step one ; , , , For the same time window The rounded reference value is obtained by averaging the parameters corresponding to all positions. These are small positive numbers pre-written into the system to maintain the stability of normalized calculations; This is the adjustment coefficient for the coupling term between ammonia and humidity; This is the adjustment coefficient for the neighborhood gradient term; For position The set of adjacent positions is pre-established during the deployment phase according to the actual installation order of the sensors. For example, front and back positions in the same layout direction and left and right positions in the same local area can be defined as adjacent. For set Number of positions in; For set The derivation of this formula can be understood as a three-step process: first, constructing the basic deviation terms for the four parameters using the classical squared deviation; then, dividing each term by the corresponding reference value and adding a small positive number to obtain the dimensionless normalized deviation; finally, superimposing the ammonia humidity coupling term and the neighborhood gradient term, so that the calculation result simultaneously possesses three characteristics: multi-parameter deviation, local high humidity amplification, and spatial boundary enhancement. Since each term undergoes the same form of normalization, the entire... Since it is a dimensionless quantity, the terms can be directly added together. This formula can be used directly when applied to a specific calculation scenario, such as within a certain time window. Below, step one gives the location. The state is , , , The corresponding rounding reference value is , , , ,Pick , , And determined by the site layout table. Meanwhile, step one is given , The first four items are respectively , , , The coupling term is The neighborhood gradient term is , accumulated to obtain The formation process of this value and its corresponding practical meaning are also clear: location. The ammonia, carbon dioxide, temperature, and humidity levels deviated from the background values. Ammonia and humidity were both high, and there was a significant gradient between them and the adjacent locations. Therefore, it was identified as a high-risk deviation point.

[0026] After obtaining the anomaly indices for all locations, the next step is not to immediately output the high-index locations one by one, but to transform them into spatially continuous anomalous regions. The approach used here is derived from the neighborhood consistency criterion in graph theory: if a location has a high anomaly index, and the anomaly indices of its neighboring locations are also generally high, then that location is more likely to belong to a genuine anomalous region than an occasional isolated disturbance. Therefore, in the location anomaly index... Based on this, a regional judgment criterion is constructed to incorporate both local anomalies and neighborhood anomalies into the judgment. This criterion is written as: ; in, Indicates time window The following set of locations were determined to be abnormal; The position calculated by the previous formula Abnormal index; Still indicating location The set of adjacent positions; Adjacent positions Abnormal index; This is the threshold for region determination. The logical relationship between this equation and the previous one is clear: the previous equation first converts the state vector output from step one into a location-level anomaly index, and the subsequent equation then converts the location-level anomaly index into a region-level anomaly point set. Therefore, the subsequent equation takes the result of the previous equation as input. Threshold This can be calculated using normal operating samples within the cycle, for example, by selecting several consecutive normal operating time windows during the commissioning phase and analyzing all positions. We perform statistical analysis and use the highest quantile as the threshold. We'll continue using the previous position... For example, if the anomaly index calculation result of adjacent locations is , Then the region determination quantity at that location is If the threshold obtained by system calibration is Then the position Included in the set of abnormal locations After performing the same calculation on all locations, if the result is obtained within a certain time window Then, based on the adjacency table established during the site layout phase, Perform connectivity merging, and then merge the resulting number of nodes. A connected subset is denoted as For example, location. , , consecutive adjacent and position If independent, then two air quality anomaly areas are formed within this time window, denoted as... and Therefore, the air quality anomaly area results output in this step can be written as a set of multiple region blocks, for example, within a time window. Lower output Thus, step two further transforms the spatiotemporal air quality sequence formed in step one into directly locatable anomalous region blocks. Subsequent steps can then directly analyze the correspondence and change relationships of these regional blocks within a continuous time window.

[0027] S3: Based on the results of the air quality anomaly area, match the regional blocks within adjacent time windows to generate the air quality anomaly evolution results.

[0028] Specifically, step three continues along the lines of the air quality anomaly areas identified in step two. Step two covers each time window. Several abnormal region blocks have been given below. Each region block is essentially a set of location numbers, for example... or Here is the time window The next Each local anomaly region is denoted as... Based on this input, this step first matches local abnormal region blocks in adjacent time windows; when a current region block successfully matches a region block in the previous time window, the matching chain is uniformly recorded as the . An abnormal region evolution chain is identified, and this evolution chain is placed within a time window. The corresponding current region block is denoted as .so, It only represents the local area number within a single time window. This only indicates the evolution chain number that is continuously tracked across a time window. Subsequently, this step revolves around... The system extracts features such as persistence, expansion, migration, and smoothness of change to generate the final air quality anomaly evolution results. This design is directly related to the livestock shed scenario: air anomalies rarely manifest as completely static, fixed patches; more commonly, they gradually expand, slowly move, or fluctuate along drainage ditches, water lines, or ventilation dead zones. Therefore, a single moment's anomaly area cannot directly reflect the strength of the risk; it is necessary to string together regional changes within a continuous time window into an evolutionary chain. In practical implementation, each location number is first read from the location coordinate table already saved during the site selection phase. Corresponding fixed installation coordinates Then for each region block Calculate its center position The calculation method involves averaging the coordinates of all location numbers within a region; simultaneously, the number of locations within that region is calculated. Here The number of positions directly derived from the region block. The values ​​are directly derived from the average position coordinates within the region block. Therefore, each quantity in this step is obtained from the region block output in step two through deterministic computation. The cross-time matching of region blocks uses a joint determination method combining set similarity and spatial displacement. The set similarity part comes from the classic Jaccard coefficient, which measures the degree of overlap between two sets through intersection and union. The spatial displacement part comes from the idea of ​​displacement normalization in discrete kinematics, used to constrain the movement amplitude of the region center within adjacent time windows. Combining the two yields a matching score suitable for tracking abnormal areas in livestock sheds. ; in, Indicates time window The Individual blocks and time windows The Matching scores between blocks; and These represent the sets of regional block locations in the two time windows, respectively. Both sets are directly derived from the results of the air quality anomaly areas in step two. This indicates the number of common locations between two blocks. This indicates the total number of locations after merging the two regions; and These represent the center positions of the two area blocks, which are obtained by averaging the installation coordinates corresponding to all position numbers within each block. This represents the Euclidean distance between the centers of two regions. A reference scale is preset for the cell, which can be the cell length, width, or the larger of the two, to normalize the displacement term; This is the displacement penalty coefficient, empirically set during system deployment based on point density and air diffusion velocity. The derivation of this formula can be understood as follows: first, using the Jaccard coefficient, establish the basic criterion that "the greater the overlap between regions, the more likely they belong to the same evolved object"; then, subtract a penalty term proportional to the center displacement to prevent regions with "almost no overlap but whose centers instantaneously span a large distance" from being misclassified as the same object. Since both the first and second terms have undergone normalization processing... It is a dimensionless quantity, so its magnitude can be directly compared. In actual calculations, the time window... and Calculate each pair of regions between them. A matching score matrix is ​​formed, and then unique pairings are performed according to the scores from largest to smallest. For each current region block, only the highest-scoring region that exceeds the threshold is retained. The preceding region blocks are used to obtain a chain of regional evolution across time. For example, if the time window... A region block is Time window There are two candidate region blocks, namely and Then the crossover ratio between the former and the predecessor region is The latter is the intersection and union ratio. If the center displacement of the former is ,Pick , Then its matching score is The latter scored negatively, so the former was matched as the same evolutionary object, and the latter was treated as a newly emerging region and a separate chain was built. In this way, the set of region blocks output in step two was transformed into a region evolution chain with temporal continuity.

[0029] After obtaining the regional evolutionary chains, anomalous evolutionary features are further extracted from each chain. Based on the actual manifestations of abnormal air quality in the livestock sheds, this step unifies the evolutionary features into a single comprehensive evolutionary value. subscript Indicates the first An established regional evolution chain. This comprehensive evolution value consists of four parts: the first part is the persistence term, which describes how long the anomalous region has existed continuously; the second part is the expansion term, which describes whether the current region is expanding relative to the previous time window; the third part is the migration term, which describes whether the center of the anomalous region has moved along the direction of the body; and the fourth part is the curvature term, which describes whether the change in region size is smooth. The ideas of the first two terms come from the growth rate and duration expression in discrete time series, the third term comes from discrete displacement normalization, and the fourth term comes from second-order difference, used to characterize the curvature of the trajectory of region size change. Combining these four parts, it is possible to simultaneously distinguish between "continuously expanding anomalies," "translational anomalies," and "short-term jump anomalies." Its expression is written as: ; in, Indicates the first Regional evolution chain in time window The comprehensive evolution value; This represents the number of consecutive time windows in which the evolution chain has been successfully matched from its first appearance to the current time window. This value is obtained by directly accumulating the aforementioned matching process. This is a preset reference duration length used to normalize the duration term; , , These represent the regional size of the evolution chain in the current time window, the previous time window, and the time window before that, respectively. These sizes are directly obtained from the number of positions of the corresponding regional blocks. This indicates a positive expansion, used to highlight the trend of increasing area. and These represent the regional centers of the evolution chain in the current and previous time windows, respectively, and are obtained by averaging the position coordinates of the corresponding regional blocks. Consistent with the previous formula, it still represents the reference scale within the round; , , , These represent the weight coefficients for the persistence, extension, migration, and curvature terms, respectively, and are set during the system deployment phase. This formula is calculated hierarchically according to the time length of the evolution chain. For the first occurrence and just established in the current time window... The evolution chain of the abnormal region, take and order , , At this point, the extension term, migration term, and curvature term are all zero, and the overall evolution value is given only by the persistence term; for evolution chains that have continued into the second time window, the actual... , , , Calculate the persistence term, extension term, and migration term, and let This makes the curvature term zero; for evolution chains lasting three or more time windows, the four terms in the formula are calculated in full. Thus, The duration of the anomaly is characterized by four factors: whether the region represented by the positive expansion is expanding, whether the region represented by the central displacement term is migrating along the direction within the interval, and whether the change in the size of the region represented by the second-order difference term is smooth. These four factors together constitute the comprehensive evolution value under the current time window. Substituting this formula into specific numerical values ​​allows for a direct visualization of the effects of each feature. For example, a certain anomaly region within a time window... , , The region blocks are as follows: , , Then there is , , If the corresponding center positions are in sequence , , The current displacement is This evolutionary chain has existed continuously. A time window. Let... , , , , , The continuous term is The extended items are The migration item is The curvature term is Therefore, we get The on-site significance of this result is very clear: the area has been continuously appearing, expanding steadily in size, with the center slightly moving along the direction of the structure, and the growth trajectory is smooth. It belongs to a typical continuous cumulative anomaly, rather than a one-off short-term fluctuation.

[0030] Following the above method, the evolution chains of all regions within the current time window are calculated one by one. This yields the results of air quality anomaly evolution. The results consist of two parts: one part is the region blocks themselves corresponding to each regional evolution chain within the current time window, which is the set of still existing anomalous region locations; the other part is the comprehensive evolution value corresponding to each regional evolution chain. For example, within a certain time window, the evolution result can be written as "regional block". correspond , area block correspond The result obtained in this way is strictly connected with the previous step: step two gives the abnormal region at a certain moment, and step three gives the temporal evolution of the abnormal region based on this; at the same time, it directly serves the next step of real-time monitoring and judgment, because continuously expanding regions and short-term disturbance regions should show different results in the final monitoring level.

[0031] S4: Based on the results of the abnormal air quality evolution, and combined with the ratio of the gas concentration within the region to the overall reference concentration, generate real-time air quality monitoring results.

[0032] Specifically, step four continues from the air quality anomaly evolution results obtained in step three. Step three is within the current time window. Two types of directly usable information have been given below: one type is the first The region block corresponding to the evolution chain of the abnormal region in the current time window is denoted as... The other type is the comprehensive evolution value corresponding to the region block. This value already incorporates duration, regional expansion, center migration, and smoothness, thus representing the abnormal development state of the evolution chain of the abnormal region within the current time window. This step then performs two transformations: first, converting the "regional evolution state" into "regional risk intensity," and then converting the "regional risk intensity" into "real-time air quality monitoring results." This approach originates from the weighted comprehensive judgment method in engineering risk assessment, whose original form is typically written as a linear combination of several normalized indicators, used to unify multiple heterogeneous indicators into a single risk quantity. This application modifies this idea in two ways for the livestock housing scenario: First, the comprehensive evolution value obtained in step three... First, it directly incorporates the risk source as a time-dimensional factor, giving greater weight to continuously expanding anomaly areas in the final judgment. Second, it no longer uses only the location and duration of the area, but also simultaneously incorporates the average levels of ammonia and carbon dioxide within the area, ensuring that both "strong evolution" and "high gas concentration" are reflected in the final monitoring results. In specific implementation, the current time window... Each abnormal region block below Iterate through all the position numbers. The spatiotemporal sequence of air quality in step one of the callback process. Read these locations within the time window and The average ammonia level is obtained by averaging the values ​​at all locations within the region. and regional average carbon dioxide value At the same time, the reference ammonia value for the entire building within the same time window is read from step two. Reference carbon dioxide value for the whole building Then, compared with the output of step three Constructing regional risk intensity together The construction process of this quantity can be understood as follows: First, the average gas level within the region is compared with the whole reference value to obtain two dimensionless relative intensity terms; then, these two relative intensity terms are compared with the already dimensionless evolution value. Weighted summaries are applied to form a single regional risk intensity. Its expression is: ; in, Indicates the first An abnormal region within the time window The intensity of regional risk below; This is the comprehensive evolution value of the region output in step three; For area blocks ammonia values ​​corresponding to all positions within the chamber The average result; For area blocks Carbon dioxide representative values ​​corresponding to all positions within the range The average result; and These are the reference values ​​for the total ammonia and carbon dioxide levels formed in the same time window during step two; These are small positive numbers pre-written into the system to keep the denominator stable; , , The weighting coefficients are set during the system calibration phase based on the enclosure type, the species being cultured, and experience samples. The left side of the equation... This is a dimensionless regional risk quantity; the three terms on the right are all dimensionless quantities. The normalized composite evolution value from step three, and These are the normalized ratios of the regional gas level relative to the overall background level, therefore the terms can be directly linearly superimposed, and the calculation relationship holds. This formula is strictly connected to step three: step three first compresses the "how the region evolves" into... This step further combines "how it evolves" with "what is the current gas level within the region" into... Therefore, the time evolution information and current air quality information are unified into a single risk measure. Substituting this into a specific calculation scenario yields clear results. For example, the current time window. There is an abnormal region block below. Step three has yielded the comprehensive evolution value of the region. The ammonia values ​​at four locations within this area were read from step one. , , , The regional average ammonia value is The representative values ​​of carbon dioxide in this region are as follows: , , , The regional average carbon dioxide value is The rounding reference value given in step two within the same time window is... , ;Pick , , , ,but Calculated sequentially, we get ,final The implications of this result on-site are clear: on the one hand, the area has shown signs of continuous expansion, and on the other hand, the levels of ammonia and carbon dioxide within the area are significantly higher than the background levels for the entire building, thus raising its overall risk to a high level.

[0033] In obtaining the risk intensity of the entire region Then, all regions within the current time window will be... The monitoring level for each area is generated by comparing it one by one with a pre-stored threshold table. The threshold table was obtained during the system debugging phase using two types of samples: one type consists of continuous operation samples under normal ventilation, normal manure removal, and conventional stocking density conditions; the other type consists of typical abnormal samples such as sewage accumulation in drainage ditches, localized dampness, and insufficient ventilation at high stocking densities. The thresholds are calculated using the same formula for both types of samples. After statistical analysis, tiered thresholds can be generated, for example, by writing the upper bounds for low-risk, medium-risk, and high-risk samples into a threshold table. During field operation, the threshold intervals are compared sequentially for each region. For example, in the above example, if the threshold intervals are set sequentially as follows... , and ,but Falling into the third interval corresponds to the "warning" level; if another abnormal area block is calculated... If the risk level is "highest," then it corresponds to the "concern" level. After completing the same determination for all areas within the current time window, a regional monitoring result is generated, in the form of "set of area locations + risk intensity + monitoring level." Subsequently, the risk intensity of all areas within the current time window is summarized again, using the logic of "highest area level priority, weighted correction based on the number of areas at the same level": first, the highest level among all current areas is taken as the base level for summarization, and then the summarization status is further refined by combining the number of areas at that level and their coverage area. For example, if there is one "warning" level area and two "concern" level areas, the real-time air quality monitoring result for the summarization will be output as "warning," and the set of locations of the warning area will be displayed on the terminal, for example... and other sets of locations of interest, such as The final result is not a single numerical value, but a structured monitoring output, which includes at least the current time window index, the overall monitoring level, the location set of each abnormal area and its corresponding level.

[0034] In one or more embodiments, such as Figure 2 As shown, a real-time air quality monitoring system for livestock and poultry breeding houses is disclosed, the system comprising: The data acquisition module is used to deploy at least two air quality acquisition nodes in livestock and poultry breeding houses and collect environmental parameters; the collected environmental parameters are organized according to a unified time window and fixed spatial location to generate an air quality spatiotemporal sequence; The region identification module is used to identify local abnormal regions based on the spatiotemporal sequence of air quality and generate results for abnormal air quality regions. The evolution extraction module is used to match regional blocks within adjacent time windows based on the air quality anomaly region results to generate air quality anomaly evolution results; The monitoring and judgment module is used to generate real-time air quality monitoring results based on the air quality anomaly evolution results and the ratio of the gas concentration in the area to the overall reference concentration.

[0035] It is worth noting that the specific workflow of the real-time air quality monitoring system in livestock and poultry breeding sheds provided in this embodiment of the invention is the same as that of the real-time air quality monitoring method in livestock and poultry breeding sheds described in the above embodiment, and will not be repeated here.

[0036] This invention also provides a real-time air quality monitoring device for livestock and poultry sheds, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps described in the above embodiment of a real-time air quality monitoring method for livestock and poultry sheds, for example... Figure 1The steps S1 to S4 described above; or, when the processor executes the computer program, it implements the functions of each module in the above system embodiments.

[0037] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the real-time air quality monitoring device for livestock and poultry farms.

[0038] The aforementioned real-time air quality monitoring device for livestock and poultry sheds can be a desktop computer, laptop, handheld computer, or cloud server, etc. This device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that the device may also include input / output devices, network access devices, buses, etc.

[0039] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the real-time air quality monitoring device for livestock and poultry sheds, connecting all parts of the device via various interfaces and lines.

[0040] The memory can be used to store the computer program and / or modules. The processor, by running or executing the computer program and / or modules stored in the memory and calling the data stored in the memory, realizes various functions of the real-time air quality monitoring device in livestock and poultry breeding sheds. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created according to the operation of the controller, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD card), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0041] The module integrated into the real-time air quality monitoring device for livestock and poultry sheds, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0042] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0043] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for real-time monitoring of air quality in livestock and poultry breeding sheds, characterized in that, The method includes: At least two air quality monitoring nodes are set up in the livestock and poultry breeding house to collect the ammonia concentration, carbon dioxide concentration, temperature and humidity of each air quality monitoring node, and generate a spatiotemporal sequence of air quality. Based on the aforementioned air quality spatiotemporal sequence, combined with the overall reference state and location adjacency relationship, the results of identifying areas with abnormal air quality are obtained. Based on the results of the air quality anomaly areas, the regional blocks within adjacent time windows are matched to generate the air quality anomaly evolution results; Based on the results of the air quality anomaly evolution, and combined with the ratio of the gas concentration within the region to the overall reference concentration, real-time air quality monitoring results are generated.

2. The method for real-time monitoring of air quality in livestock and poultry breeding sheds according to claim 1, characterized in that, The generation of the air quality spatiotemporal sequence specifically includes: A discrete time window is constructed by setting a unified start time and a fixed sampling period; For any location, any parameter category, and any time window, with the center time of the window as the target, the original sampled value that is closest to the center time within the window is selected as the representative value of the window; When a parameter at a certain location has no sampled value within the current time window, read the representative value generated in the previous time window at that location or the baseline value written during the system calibration phase. The air state vector is formed by combining the representative values ​​of ammonia, carbon dioxide, temperature, and humidity at the same location and within the same time window, thus creating a spatiotemporal sequence of air quality.

3. The method for real-time monitoring of air quality in livestock and poultry breeding sheds according to claim 1, characterized in that, The results of identifying areas with abnormal air quality specifically include: By fixing a time window, the corresponding parameters at all positions are averaged to obtain the overall reference state; Based on the difference between the state vector at each location and the reference state, a location anomaly index is constructed. The location anomaly index includes a multi-parameter normalization bias, an ammonia and humidity coupling term, and a neighborhood gradient term. The location anomaly index is compared with the region determination threshold to filter out the set of abnormal locations; Based on the adjacency table established during the site selection phase, the set of abnormal locations is connected and merged to generate results for areas with abnormal air quality.

4. The method for real-time monitoring of air quality in livestock and poultry breeding sheds according to claim 1, characterized in that, The specific results of the generated air quality anomaly evolution include: Read the fixed installation coordinates corresponding to the location number, and calculate the center position and area size of each abnormal area block; A method combining set similarity and spatial displacement is used to calculate the matching score between the i-th region block in the current time window and the j-th region block in the previous time window; Calculate the matching score for each pair of blocks, and uniquely pair them according to the score from largest to smallest. Establish the successfully matched blocks as a regional evolution chain. Based on the aforementioned regional evolution chain, the duration, expansion trend, migration distance, and change smoothness features are extracted to generate air quality anomaly evolution results.

5. The method for real-time monitoring of air quality in livestock and poultry breeding sheds according to claim 4, characterized in that, The extraction duration, expansion trend, migration distance, and change smoothness features specifically include: For the first occurrence of the aforementioned regional evolution chain, only the duration feature is calculated; For the regional evolution chain that extends over two time windows, calculate the duration characteristics, expansion trend characteristics, and migration distance characteristics; For the regional evolution chain that extends for three or more time windows, calculate the duration feature, expansion trend feature, migration distance feature, and change smoothness feature; The above features are weighted and combined to generate a comprehensive evolution value as the result of air quality anomaly evolution.

6. The method for real-time monitoring of air quality in livestock and poultry breeding sheds according to claim 1, characterized in that, The generated real-time air quality monitoring results specifically include: Traverse each abnormal region block under the current time window, call back the air quality spatiotemporal sequence, read the representative values ​​of ammonia and carbon dioxide at the location within the region block, and calculate the regional average ammonia value and regional average carbon dioxide value. The ratios of the regional average ammonia value to the overall reference ammonia value and the ratio of the regional average carbon dioxide value to the overall reference carbon dioxide value are weighted and superimposed with the comprehensive evolution value corresponding to the regional evolution chain. Generate regional risk intensity and compare it with a pre-stored table of level thresholds to generate regional-level monitoring results; The risk intensity of all areas under the current time window is summarized and aggregated to generate aggregate-level monitoring results.

7. The method for real-time monitoring of air quality in livestock and poultry breeding sheds according to claim 6, characterized in that, The specific steps of rounding down and summarizing the risk intensity of all regions under the current time window include: The highest regional-level monitoring result among all current regions will be used as the overall baseline level for the housing complex. The status of the entire building is displayed in detail by combining the number of the highest-level areas and the coverage area. The output includes the current time window index, the overall monitoring level, the location set of each abnormal area and its corresponding level, and the structured monitoring results.

8. The method for real-time monitoring of air quality in livestock and poultry breeding sheds according to claim 1, characterized in that, The air quality data collection nodes are located at the air inlet, in the middle, above the sewage ditch, and near the water supply line. The air quality acquisition node includes an electrochemical ammonia sensor, a non-spectral infrared carbon dioxide sensor, and an integrated digital temperature and humidity sensor.

9. The method for real-time monitoring of air quality in livestock and poultry breeding sheds according to claim 1, characterized in that, After generating the results of the air quality anomaly evolution, the method further includes: When the matching score is lower than the set threshold, the current block will be treated as a newly emerging abnormal area and a new chain will be built. When the duration of the regional evolution chain exceeds a preset reference duration, it is determined to be a continuous accumulation anomaly; When the smoothness of the change in the regional evolution chain is lower than a set value, it is determined to be a short-term disturbance anomaly.

10. A real-time air quality monitoring system for livestock and poultry breeding sheds, characterized in that, The method for real-time monitoring of air quality in livestock and poultry breeding sheds according to any one of claims 1-9 includes: The data acquisition module is used to deploy at least two air quality acquisition nodes in livestock and poultry breeding houses and collect environmental parameters; the collected environmental parameters are organized according to a unified time window and fixed spatial location to generate an air quality spatiotemporal sequence; The region identification module is used to identify local abnormal regions based on the spatiotemporal sequence of air quality and generate results for abnormal air quality regions. The evolution extraction module is used to match regional blocks within adjacent time windows based on the air quality anomaly region results to generate air quality anomaly evolution results; The monitoring and judgment module is used to generate real-time air quality monitoring results based on the air quality anomaly evolution results and the ratio of the gas concentration in the area to the overall reference concentration.