Modeling method and system for dynamic distribution of bacteria in henhouse

By constructing rasterized spatial topological relationships and causal contribution analysis in the chicken coop, a bacterial dynamic distribution prediction model was generated, which solved the problems of sparseness and high-dimensional data complexity of bacterial distribution monitoring in the chicken coop, and achieved high-precision and strong generalization of bacterial distribution prediction.

CN120296363AActive Publication Date: 2025-07-11INST OF ANIMAL HUSBANDRY & VETERINARY MEDICINE ANHUI ACAD OF AGRI SCI

Patent Information

Application Number
CN202510772725.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-07-11
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

In the prior art, bacterial distribution monitoring in chicken houses is difficult to cover the complete spatial dimension due to the sparse sensors and sampling points, and it is impossible to effectively predict the bacterial distribution in unmonitored areas. The high-dimensional characteristics of multi-source parameters increase the complexity of data acquisition and the prediction deviation of the model.

Method used

By obtaining the environmental parameters and bacterial concentration data of multiple discrete monitoring points in the chicken house, interpolation calculation is performed based on the rasterized spatial topological relationship, risk weight coefficients are generated based on the causal contribution analysis, weight feature matrix is constructed, and a nonlinear superposition relationship between bacterial migration probability and risk weight is constructed to construct a bacterial dynamic distribution prediction model.

Benefits of technology

High-precision and strong generalized bacterial dynamic distribution prediction in the chicken house are achieved, the prediction accuracy of unmonitored areas and the physical interpretability of the model are improved, and multi-factor decision support is provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120296363A_ABST
    Figure CN120296363A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for modeling dynamic distribution of bacteria in a henhouse, particularly relates to the technical field of livestock and poultry breeding risk modeling analysis, and is used for solving the problem of insufficient bacteria distribution prediction precision caused by sparse monitoring data and multi-factor coupling in the prior art. The method comprises the following steps: acquiring environmental parameters and bacterial concentration data of discrete monitoring points of a henhouse, and generating a rasterized spatial topological relation based on a structural layout; environmental parameter interpolation complementation is carried out by utilizing connectivity of adjacent grids; generating a risk weight by combining the path alignment analysis of the equipment physical connection topology and the causal fluctuation chain; constructing a weight feature matrix and calculating a bacterial migration probability between grids; and finally, outputting a dynamic distribution prediction result through the nonlinear superposition model. And data sparsity compensation, physical interpretability modeling and multi-factor dynamic coupling analysis are realized, and the prediction precision and the regulation and control level are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of risk modeling and analysis for livestock and poultry breeding, and more specifically, to a method and system for modeling the dynamic distribution of bacteria in a chicken coop. Background Art

[0002] In the livestock and poultry breeding environment, the monitoring and prediction of the bacterial distribution in a chicken coop are important links to ensure animal health and production safety. In the prior art, data is usually obtained by deploying a limited number of environmental sensors (such as temperature and humidity, gas concentration detection devices) inside the chicken coop and combining with regular manual sampling (such as air, surface flora samples) to construct a bacterial distribution model. However, limited by hardware costs and operational feasibility, the spatial distribution of sensors and sampling points is often relatively sparse, making it difficult to fully cover the complex environment inside the chicken coop (such as ventilation dead corners, chicken group gathering areas, etc.). In addition, the dynamic spread of bacteria is affected by the coupling of multiple factors, including the spatial heterogeneity of environmental parameters, the time-varying characteristics of chicken group activity patterns, etc., further increasing the dimension and complexity of data acquisition.

[0003] Current modeling methods based on chicken coop monitoring data usually directly input the collected discrete data into a machine learning model for training and prediction. However, due to the sparsity of monitoring data in the spatial dimension and the high-dimensional characteristics of multi-source parameters, the model is prone to over-rely on the noise information of local sampling points, resulting in the prediction results of unmonitored areas deviating from the true distribution, making it difficult to balance training accuracy and generalization ability, and unable to effectively guide the precise regulation of the chicken coop environment. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a method and system for modeling the dynamic distribution of bacteria in a chicken coop to solve the problems raised in the above background art.

[0005] To achieve the above object, the present invention provides the following technical solutions: A method for modeling the dynamic distribution of bacteria in a chicken coop, comprising the following steps: S1. Obtain the environmental parameter data and bacterial concentration data of multiple discrete monitoring points in the chicken coop, and generate a grid-based spatial topological relationship based on the chicken coop structure layout; S2. Perform spatial interpolation calculation on the environmental parameter data according to the adjacent grid connectivity in the grid-based spatial topological relationship to generate interpolation environmental parameter data for unmonitored areas; S3. Based on the path alignment relationship between the physical connection topology between devices in the chicken coop and the causal fluctuation chain of environmental parameters, generate a risk weight coefficient for potential bacterial sources through causal contribution analysis; S4. Align the environmental parameter data, interpolation environmental parameter data, and bacterial concentration data according to the grid position, and construct a weight feature matrix in combination with the risk weight coefficient; S5. Based on the bacterial concentration gradient distribution in different grid regions of the weight feature matrix, combined with the ventilation path connectivity of the grid-based spatial topology relationship, generate the bacterial migration probability between each grid; S6. Construct a bacterial dynamic distribution prediction model according to the non-linear superposition relationship between the bacterial migration probability and the risk weight coefficient, and output the evaluation and prediction results of each grid region in the chicken house.

[0006] In a preferred embodiment, obtain the environmental parameter data and bacterial concentration data of multiple discrete monitoring points in the chicken house, and generate a grid-based spatial topology relationship based on the chicken house structure layout, including: Select multiple monitoring points in the chicken house through a preset discrete monitoring point distribution rule; collect the environmental parameter data of each monitoring point; synchronously obtain the bacterial concentration data corresponding to the position of each monitoring point; divide the internal space of the chicken house into grid units of equal size, and establish a connectivity mapping relationship between adjacent grids to generate a grid-based spatial topology relationship.

[0007] In a preferred embodiment, perform spatial interpolation calculation on the environmental parameter data according to the adjacent grid connectivity in the grid-based spatial topology relationship to generate interpolation environmental parameter data for the unmonitored area, including: Based on the adjacency matrix of the grid-based spatial topology relationship, determine all adjacent monitoring point grids of the grid in the unmonitored area, and filter out the adjacent monitoring point grids that have a strong or weak connectivity relationship with the grid in the unmonitored area; According to the connectivity type between the adjacent monitoring point grid and the grid in the unmonitored area, assign an interpolation weight to each adjacent monitoring point grid; Extract the environmental parameter data of the adjacent monitoring point grid, combined with the assigned interpolation weight, and generate the interpolation environmental parameter data of the grid in the unmonitored area through inverse distance weighted average calculation; Integrate the interpolation environmental parameter data according to the grid position and the original monitoring point data, and update the environmental parameter data set to cover all grid regions of the chicken house.

[0008] In a preferred embodiment, based on the path alignment relationship between the physical connection topology of the equipment rooms in the chicken house and the causal fluctuation chain of the environmental parameters, generate the risk weight coefficient of potential bacterial sources through causal contribution degree analysis, including: Extract the causal fluctuation chain of the environmental parameters through a causal discovery algorithm, and the causal fluctuation chain is generated by the temporal correlation between the environmental parameter data and the bacterial concentration data; Map the equipment nodes in the physical connection topology of the equipment rooms to the nodes of the causal fluctuation chain, and filter out the group of equipment nodes whose physical connection path matches the causal propagation path; According to the number of matching paths and the centrality value of the equipment nodes in the physical connection topology, calculate the initial risk weight of each equipment node; Adjust the initial risk weight based on the direct causal influence strength of the bacterial concentration nodes in the causal fluctuation chain to generate the final risk weight coefficient.

[0009] In a preferred embodiment, align the environmental parameter data, interpolated environmental parameter data, and bacterial concentration data according to the grid position, and construct a weight feature matrix in combination with the risk weight coefficient, including: Based on the grid cell numbers in the rasterized spatial topology relationship, align the environmental parameter data of the original monitoring points, the interpolated environmental parameter data, and the bacterial concentration data of the corresponding grid according to the same grid index; Assign corresponding weight values to each grid cell according to the final risk weight coefficient, and the weight values are derived from the normalized risk weight coefficients of the device nodes associated with the corresponding grid; Multiply the environmental parameter data, interpolated environmental parameter data, and bacterial concentration data element by element with the assigned weight values according to the grid position to generate a weighted environmental parameter matrix, a weighted interpolated parameter matrix, and a weighted bacterial concentration matrix; Stitch the weighted environmental parameter matrix, the weighted interpolated parameter matrix, and the weighted bacterial concentration matrix along the grid space dimension to form a multi-dimensional weight feature matrix, and each element of the multi-dimensional weight feature matrix contains the weighted environmental parameters, interpolated parameters, and bacterial concentration data.

[0010] In a preferred embodiment, based on the bacterial concentration gradient distribution in different grid regions of the weight feature matrix, and in combination with the ventilation path connectivity of the rasterized spatial topology relationship, generate the bacterial migration probability between each grid, including: Calculate the concentration gradient values of each grid cell in the east-west direction and the north-south direction based on the weighted bacterial concentration in the weight feature matrix to generate a bacterial concentration gradient distribution map; Extract the connectivity types of the ventilation paths between each grid according to the adjacency matrix of the rasterized spatial topology relationship, and the connectivity types include strong connectivity and weak connectivity; Combine the concentration gradient values with the ventilation path connectivity types in grid pairs, and correct the concentration gradient values through the gradient attenuation factor; Calculate the bacterial migration probability of each grid pair based on the corrected concentration gradient values and the Euclidean distance between grids; Normalize the bacterial migration probabilities of all grid pairs to generate a probability transition matrix for the dynamic distribution prediction model.

[0011] In a preferred embodiment, the bacterial migration probability is positively correlated with the corrected concentration gradient value and negatively correlated with the Euclidean distance between grids.

[0012] In a preferred embodiment, a prediction model for the dynamic distribution of bacteria is constructed based on the non-linear superposition relationship between the bacteria migration probability and the risk weight coefficient, and the evaluation and prediction results of each grid area in the chicken coop are output, including: Based on the bacteria migration probability in the probability transition matrix and the normalized risk weight coefficient, a Markov chain model with grids as nodes is constructed; Taking the weighted bacteria concentration data of the multi-dimensional weight feature matrix as the initial state, input it into the Markov chain model for iterative calculation; Set the model convergence condition that the change rate of bacteria concentration in two adjacent iterations is lower than the preset change rate threshold. After reaching the convergence condition, terminate the calculation and output the final bacteria concentration distribution; Associate the final bacteria concentration distribution with the interpolated environmental parameter data according to the grid position to generate the evaluation and prediction results including the environmental parameter influence factors.

[0013] In a preferred embodiment, the iteration updates the bacteria concentration of each grid through the exponential weighted sum of the bacteria migration probability and the risk weight coefficient.

[0014] On the other hand, the present invention provides a system for modeling the dynamic distribution of bacteria in a chicken coop, including the following modules: A data topology module for obtaining the environmental parameter data and bacteria concentration data of multiple discrete monitoring points in the chicken coop, and generating a grid-based spatial topology relationship based on the chicken coop structure layout; An interpolation calculation module for performing spatial interpolation calculation on the environmental parameter data according to the connectivity of adjacent grids in the grid-based spatial topology relationship to generate the interpolated environmental parameter data of the unmonitored area; A causal weight module for generating the risk weight coefficient of potential bacteria sources through causal contribution degree analysis based on the path alignment relationship between the physical connection topology among devices in the chicken coop and the causal fluctuation chain of environmental parameters; A matrix construction module for aligning the environmental parameter data, the interpolated environmental parameter data and the bacteria concentration data according to the grid position, and constructing a weight feature matrix in combination with the risk weight coefficient; A migration probability module for generating the bacteria migration probability between each grid based on the bacteria concentration gradient distribution in different grid areas of the weight feature matrix and the ventilation path connectivity of the grid-based spatial topology relationship; A dynamic prediction module for constructing a prediction model for the dynamic distribution of bacteria based on the non-linear superposition relationship between the bacteria migration probability and the risk weight coefficient, and outputting the evaluation and prediction results of each grid area in the chicken coop.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. By integrating the physical structure constraints of the chicken coop and the data correlation characteristics of multi-source environmental parameters, the present invention constructs a spatio-temporal dynamic prediction scheme suitable for complex breeding environments; through the interpolation calculation based on the rasterized spatial topological relationship and the construction of the weight feature matrix, it effectively solves the problem of prediction distortion in uncovered areas caused by the sparsity of traditional monitoring data; through the path alignment analysis of the physical connection topology between devices and the causal fluctuation chain, the statistical correlation of environmental parameters is transformed into an interpretable physical propagation path weight, significantly improving the physical interpretability of the bacterial source risk assessment; by combining the ventilation path connectivity and the migration probability calculation of the concentration gradient, the model can adaptively capture the propagation differences between the airflow directivity and natural diffusion.

[0016] 2. The present invention further integrates the migration probability and risk weight through a non-linear superposition mechanism, achieving high-precision and strong generalization in dynamic distribution prediction; the multi-dimensional parameter correlation of the weight feature matrix and the iterative optimization of the Markov chain ensure the continuity of the model in the time and space dimensions, providing multi-factor decision support for the precise regulation of the chicken coop environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flowchart of the method for modeling the dynamic distribution of bacteria in the chicken coop of the present invention; Figure 2 is a schematic structural diagram of the system for modeling the dynamic distribution of bacteria in the chicken coop of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0019] Embodiment 1: Figure 1 The method for modeling the dynamic distribution of bacteria in the chicken coop of the present invention is given, which includes the following steps: S1. Obtain the environmental parameter data and bacterial concentration data of multiple discrete monitoring points in the chicken coop, and generate a rasterized spatial topological relationship based on the chicken coop structure layout; S2. Perform spatial interpolation calculation on the environmental parameter data according to the adjacent grid connectivity in the rasterized spatial topological relationship to generate the interpolated environmental parameter data of the unmonitored area; S3. Based on the path alignment relationship between the physical connection topology between devices in the chicken coop and the causal fluctuation chain of environmental parameters, generate the risk weight coefficient of potential bacterial sources through causal contribution analysis; S4. Align the environmental parameter data, interpolated environmental parameter data, and bacterial concentration data according to the grid positions, and construct a weighted feature matrix by combining the risk weight coefficients; S5. Based on the bacterial concentration gradient distribution in different grid regions of the weighted feature matrix, and combined with the ventilation path connectivity of the rasterized spatial topological relationship, generate the bacterial migration probability between each grid; S6. Construct a bacterial dynamic distribution prediction model according to the non-linear superposition relationship between the bacterial migration probability and the risk weight coefficient, and output the evaluation and prediction results of each grid region in the chicken house.

[0020] S1. Obtain the environmental parameter data and bacterial concentration data of multiple discrete monitoring points in the chicken house, and generate a rasterized spatial topological relationship based on the structural layout of the chicken house. The specific implementation steps are as follows: Select multiple monitoring points in the chicken house through a preset discrete monitoring point distribution rule. The monitoring points cover the ventilation openings, feed feeding areas, and areas with intensive chicken activities. The discrete monitoring point distribution rule is as follows: According to the plane layout diagram of the chicken house, set at least two monitoring points in the ventilation opening area to capture the difference between the incoming and outgoing air. The incoming air monitoring point is located 0.5 meters away from the inner wall of the ventilation opening, and the outgoing air monitoring point is located at the end of the ventilation duct; Set a monitoring point every 2 meters along the feeding path in the feed feeding area, and the monitoring point is 0.3 meters away from the edge of the feed trough; Install sensors in the areas with intensive chicken activities at a density of one monitoring point per 5 square meters. The intensive area is defined as the area where the chickens stay for more than 8 hours a day. When selecting the monitoring points, fixed obstacles such as pillars, equipment bases, and drinking water devices should be avoided. The installation position of the sensor is 1.5 meters above the ground and is fixed to the metal bracket through a magnetic base to ensure no physical contact with the chicken activity range.

[0021] Collect the environmental parameter data of each monitoring point. The environmental parameter data includes temperature and humidity, ammonia concentration, and carbon dioxide concentration. The temperature and humidity data is collected by temperature and humidity sensors, which need to be calibrated in a standard constant temperature and humidity chamber (temperature 25°C ± 0.1°C, humidity 50% ± 1%) before installation. The data collection frequency is once every 10 minutes. The data anomaly determination rule is: if the collected values exceed the temperature range of -10°C to 50°C or the humidity range of 0% to 100% continuously for three times, then trigger the sensor failure alarm and enable the backup sensor. The ammonia concentration data is collected by ammonia sensors. The sensor warm-up time is 30 minutes, and the data is marked as invalid during the warm-up period. The measurement range is 0 to 100 ppm. If the detected value reaches 90% of the full scale continuously for 5 times, then automatically switch to the low concentration range mode (0 to 50 ppm). The carbon dioxide concentration data is collected by carbon dioxide sensors. Before data collection, zero calibration needs to be carried out in a nitrogen atmosphere, and the calibration duration is 10 minutes. The measurement range is 0 to 5000 ppm. If the fluctuation range of the detected value exceeds ±100 ppm, then re-execute the calibration process. All sensor data is transmitted to the central controller through the RS485 bus. The data transmission protocol is Modbus-RTU. The data storage format is a JSON structure associated with timestamps, and the storage period is 30 days. The expired data is automatically archived to the offline database.

[0022] Synchronously obtain the bacterial concentration data of the corresponding positions of each monitoring point. The bacterial concentration data is generated by culturing and counting after being collected by an air microbial sampler and surface swabs. The air microbial sampler adopts the impaction sampling principle, with the model MAS-100NT, a sampling flow rate of 100 liters per minute, and a sampling time of 5 minutes each time. If the environmental wind speed exceeds 2 m / s during sampling, then suspend sampling and record the wind speed anomaly event. The sampled culture medium plates are cultured in a 36°C constant temperature incubator for 48 hours, and the humidity of the incubator is maintained at 60% ± 5%. After the culture, the colony-forming units (CFU) are counted by an automatic colony counter. The spots with a colony diameter less than 1 mm are not included in the statistics. The surface swabs are collected by using sterile cotton swabs to smear and sample on the walls, floors, and equipment surfaces in the corresponding areas of the monitoring points. The sampling area is a standard area of 10 cm × 10 cm. The sampling cotton swabs are immersed in 10 ml of phosphate buffer solution and shaken at a speed of 2000 revolutions per minute by a vortex oscillator for 1 minute. Take 1 ml of the eluate, filter it through a 0.22 μm filter membrane, and then inoculate it on a blood agar plate. The culture conditions are the same as those of the air samples. The bacterial concentration data is recorded in units of CFU per cubic meter (air samples) and CFU per square centimeter (surface samples). If the relative standard deviation (RSD) of the results of three parallel experiments on the same sample exceeds 15%, then re-sample and detect.

[0023] Based on the wall partition positions, ventilation duct orientations, and equipment installation coordinates in the chicken coop structure layout, the internal space of the chicken coop is divided into grid cells of equal size, and a connectivity mapping relationship between adjacent grids is established to generate a grid-based spatial topological relationship. The size of the grid cells is dynamically adjusted according to the total area of the chicken coop. The standard size is 1 meter × 1 meter. If the length or width of the chicken coop is not an integer number of meters, the size of the edge grids is scaled proportionally, with the scaling ratio not exceeding 20% of the standard size. The wall partition positions are determined by the load-bearing wall markings in the architectural drawings. The ventilation duct orientations are deduced backward based on the data of the air flow sensors of model FVA-40 installed inside the ducts. If there is no air flow through a certain section of the duct for 1 hour continuously, it is determined to be in the closed state and removed from the topological relationship. The equipment installation coordinates are surveyed on-site by a laser rangefinder, and the coordinate error is controlled within ±5 centimeters. The connectivity mapping relationship between adjacent grids is defined as follows: If two grid cells share a common side or corner point and there is no wall or fixed obstacle blocking in the actual space, they are marked as weakly connected; if there is a direct connection through a ventilation duct, they are marked as strongly connected regardless of the physical distance; if there is an equipment obstacle (such as a feed conveyor) between two grids, they are marked as unconnected. The grid-based spatial topological relationship is stored in the form of an adjacency matrix. The row and column indices of the matrix correspond to the grid numbers. The value of the matrix element is 0 indicating unconnected, 1 indicating weakly connected, and 2 indicating strongly connected. The adjacency matrix is updated once a day. If a chicken coop structure modification event (such as wall demolition) is detected, the matrix regeneration is immediately triggered.

[0024] S2. Perform spatial interpolation calculations on the environmental parameter data according to the adjacent grid connectivity in the grid-based spatial topological relationship to generate interpolated environmental parameter data for the unmonitored areas. The specific implementation steps are as follows: Based on the adjacency matrix of the grid-based spatial topological relationship, determine all adjacent monitored point grids of the grids in the unmonitored areas, and filter out the adjacent monitored point grids that have a strong or weak connectivity relationship with the grids in the unmonitored areas. The adjacency matrix is derived from the grid-based spatial topological relationship generated in step S1, and the value of its matrix element is 0 indicating unconnected, 1 indicating weakly connected, and 2 indicating strongly connected. The grids in the unmonitored areas are defined as the grid cells that are not covered by the discrete monitored points in step S1 in the current step. The filtering logic is: Traverse the row corresponding to the grid in the unmonitored area in the adjacency matrix, and extract the column indices of all elements with values of 1 or 2, which are the adjacent monitored point grids marked as weakly or strongly connected. If there are no adjacent monitored point grids for the grid in the unmonitored area (i.e., all elements in the corresponding row of the adjacency matrix are 0), mark this grid as an interpolation abnormal area, and fill it with the average value of the global environmental parameters of the chicken coop in the subsequent steps. The global average value is the arithmetic average of all monitored point data.

[0025] Interpolate weights are assigned to each adjacent monitored grid cell according to the connectivity type between the adjacent monitored grid cells and the unmonitored area grid cells. The weight of a strong connectivity relationship is twice that of a weak connectivity relationship. The weight assignment rule is as follows: if the adjacent monitored grid cell and the unmonitored area grid cell have a strong connectivity relationship (the value of the adjacency matrix element is 2), the initial value of its interpolation weight is 2; if it has a weak connectivity relationship (the value of the adjacency matrix element is 1), the initial value of the interpolation weight is 1. The weight normalization process is achieved by dividing the initial weight value of each monitored grid cell by the total weight of its connected group. For example, if an adjacent monitored grid cell contains two strong connections (initial weight 2) and one weak connection (initial weight 1), the total weight is 5, and the normalized weights are 0.4, 0.4, and 0.2 respectively. If all adjacent monitored grid cells are weakly connected, the total weight is the number of monitored points, and the normalized weight is the weight 1 of each monitored point divided by the number.

[0026] Extract the environmental parameter data of the adjacent monitored grid cells. Combine the assigned interpolation weights and calculate the interpolated environmental parameter data of the unmonitored area grid cells through inverse distance weighted averaging. In the inverse distance weighted averaging calculation, the distance is the Euclidean distance between the center point of the unmonitored area grid cell and the center point of the adjacent monitored grid cell. The distance value is converted to the actual physical distance through the grid cell size. For example, if the grid size is 1 m × 1 m and the adjacent monitored grid cell is directly above the unmonitored area grid cell, the distance is 1 m; if it is in the upper right diagonal position, the distance is 1.414 m. The inverse distance weight is calculated as 1 divided by (distance + 0.1 m) to avoid division by zero errors, where 0.1 m is the smoothing factor.

[0027] The calculation formula for the interpolated environmental parameter value is: ; Where, represents the interpolated environmental parameter value of the unmonitored area grid cell (such as temperature, humidity, or ammonia concentration), and the unit is the original dimension of the corresponding parameter (such as °C, %, or ppm); represents the measured value of the environmental parameter of the th adjacent monitored grid cell, which is derived from the original data collected in step S1; represents the th normalized interpolation weight of the adjacent monitored grid cell, which is assigned and normalized according to the grid connectivity type in step S2 and has no unit dimension; represents the th inverse distance weight of the adjacent monitored grid cell, and the inverse distance weight is dimensionless; represents the total number of adjacent monitored grid cells with a connectivity relationship with the unmonitored area grid cell, which is derived from the screening result based on the adjacency matrix.

[0028] The calculation formula for the inverse distance weight is: ; Among them, is the Euclidean distance (unit: meter) between the grid of the unmonitored area and the grid of the th monitoring point, is a smoothing factor to prevent division by zero (default value 0.1 meter).

[0029] If the environmental parameter data of a certain adjacent monitoring point grid is missing (such as sensor failure), the weight of this monitoring point will be temporarily set to zero, and the normalized weights of the remaining monitoring points will be recalculated.

[0030] Integrate the interpolated environmental parameter data according to the grid position and the original monitoring point data, and update the environmental parameter dataset to cover all grid areas of the chicken coop. The integration rule is: the data of the original monitoring point grid remains unchanged, the data of the unmonitored area grid is replaced with the interpolation calculation result, and the interpolation abnormal area is filled with the global average value. After the dataset is updated, the environmental parameter data of each grid cell includes temperature and humidity, ammonia concentration, and carbon dioxide concentration. The data storage format is consistent with the JSON structure defined in step S1, and the timestamp is synchronized with the original data. If the parameter values of the same grid cell fluctuate by more than the preset threshold (such as temperature fluctuation ±3°C, ammonia concentration fluctuation ±10 ppm) in three consecutive interpolation calculations, an artificial review process will be triggered, and the dataset will be corrected after the review result is verified on-site by a handheld detection device of the model.

[0031] S3. Based on the path alignment relationship between the physical connection topology among devices in the chicken coop and the causal fluctuation chain of environmental parameters, generate a risk weight coefficient of potential bacterial sources through causal contribution analysis. The specific implementation steps are as follows: Extract the causal fluctuation chain of environmental parameters through a causal discovery algorithm. The causal fluctuation chain is generated from the temporal correlation between environmental parameter data and bacterial concentration data. The environmental parameter data and bacterial concentration data are sourced from the temperature, humidity, ammonia concentration, carbon dioxide concentration, and colony-forming units counted from laboratory cultures collected in step S1. The method for generating the causal fluctuation chain is as follows: Use the time-lagged mutual information analysis algorithm to calculate the mutual information values between each environmental parameter and the bacterial concentration under different time-lagged windows. The time-lagged windows are set from 0 to 24 hours with a step size of 6 hours, such as lag windows of 6 hours, 12 hours, 18 hours, and 24 hours. The mutual information values are calculated through discretized data binning. The binning rule is equal-frequency binning, with each bin containing 10% of the data samples. Select parameter pairs with mutual information values exceeding a preset threshold (e.g., the mutual information value at a 6-hour lag ≥ 0.5) as candidate causal relationships. Verify the candidate causal relationships through Granger causality tests. The lag order of the Granger causality tests is automatically selected according to the Akaike information criterion (AIC), and the significance level threshold is set at 0.05. Retain the causal pairs with the p-value corresponding to the F statistic less than 0.05. The constructed causal fluctuation chain is represented in the form of a directed graph, where the nodes are environmental parameters and bacterial concentrations, the edges are causal relationships, and the edge weights are the F statistic values of the Granger causality tests. For example, the edge weight of temperature → bacterial concentration is 8.2, and the edge weight of humidity → bacterial concentration is 5.6.

[0032] Among them, the calculation formula for calculating the mutual information value using the time-lagged mutual information analysis algorithm is: ; Among them, represents the environmental parameter and the bacterial concentration under the time-lagged window of the mutual information value (unit: bit), which is used to quantify their statistical dependence; represents the time-lagged window (unit: hour), and the value range is from 0 to 24 hours defined in step S3 with a step size of 6 hours; represents the time series dataset of a certain environmental parameter (such as temperature, humidity, or ammonia concentration), sourced from the original data collected in step S1; represents the time series dataset of the bacterial concentration, sourced from the colony-forming units (CFU) counted from laboratory cultures in step S1; represents the environmental parameter at the time point taking the value of of the marginal probability, estimated through the historical data statistical histogram; represents the bacterial concentration at the time point taking the value of of the marginal probability, calculated in the same way as ; represents environmental parameters at a time point takes a value of , and bacterial concentration at a time point takes a value of The joint probability is estimated by joint statistical analysis through a two-dimensional histogram.

[0033] Map the device nodes in the physical connection topology between devices to the nodes of the causal fluctuation chain, and filter out the group of device nodes whose physical connection paths match the causal propagation paths. The physical connection topology between devices is derived from the ventilation duct network and the feed delivery path diagram generated based on the chicken coop structure layout in step S1. The device nodes include ventilation openings, feed dispensers, and temperature control devices. The mapping rule is as follows: If the physical connection path of a device node (e.g., ventilation duct A → B → C) coincides with the causal propagation path in the causal fluctuation chain (e.g., temperature → humidity → bacterial concentration) in the spatial topology, and the time lag direction of the causal path is consistent with the medium flow direction of the physical connection path (e.g., the air flow direction from ventilation duct A to C is consistent with the causal time sequence direction of temperature → humidity → bacterial concentration), then it is determined that the paths match. The similarity threshold for path matching is set to at least two consecutive nodes overlapping (e.g., ventilation duct A corresponds to the temperature node, B corresponds to the humidity node), and the directions are consistent. If there are multiple matching paths in the device node group, select the path with the largest number of overlapping nodes as the main matching path, and the number of overlapping nodes of the main matching path should be ≥ 2. If the physical connection path of a device node is opposite to the causal path (e.g., ventilation duct C → B → A, while the causal path is temperature → humidity → bacterial concentration), then it is determined that they do not match and is excluded.

[0034] According to the number of matching paths and the centrality value of the device node in the physical connection topology, calculate the initial risk weight of each device node. The centrality value is the betweenness centrality of the device node in graph theory, and the calculation method is as follows: Traverse all the shortest paths between device nodes, and count the proportion of the number of paths passing through the current node in the total number of paths. For example, if there are 10 shortest paths in the chicken coop device network, and 5 of them pass through ventilation opening A, then its betweenness centrality is 5 / 10 = 0.5. The number of matching paths is the total number of main matching paths participated by the device node. For example, a ventilation opening node participates in 3 matching paths.

[0035] The formula for calculating the initial risk weight is expressed as: ; where represents the initial risk weight of the device node, dimensionless, and is used to quantify the risk contribution of this node in bacterial transmission; Indicates the number of main matching paths that the device node participates in, which is derived from the result of path alignment and screening in step S3 (for example, a certain vent node participates in 3 matching paths); Indicates the betweenness centrality value of the device node in graph theory, which is calculated by traversing all the shortest paths in step S3, and the value range is from 0 to 1; Indicates the empirical weight coefficient of the number of matching paths, with a default value of 0.3. The adjustable range is from 0.2 to 0.4 according to the optimization of the validation set, and it is dimensionless; Indicates the empirical weight coefficient of betweenness centrality, with a default value of 0.7. The adjustable range is from 0.6 to 0.8 according to the optimization of the validation set, and it is dimensionless.

[0036] If the device node has no matching paths, the initial weight is set to 0, and it is marked as a low-risk node in the subsequent steps. The final weight coefficient of the low-risk node is directly set to zero.

[0037] Based on the direct causal influence intensity of the bacterial concentration node in the causal fluctuation chain, adjust the initial risk weight to generate the final risk weight coefficient. The direct causal influence intensity is the F-statistic value of the edge directly pointing to the bacterial concentration node in the causal fluctuation chain. For example, the edge weight of temperature → bacterial concentration is 8.2, and the edge weight of humidity → bacterial concentration is 5.6. The adjustment rule is: multiply the initial weight by the normalized direct causal influence intensity (for example, the intensity value divided by the maximum value of all direct causal influence intensities) to obtain the final risk weight coefficient. The normalization formula is: normalized intensity = current edge F-statistic value / maximum F-statistic value, where the maximum F-statistic value is the maximum value among all the edges directly pointing to the bacterial concentration node in the causal fluctuation chain. For example, if the maximum F-statistic value is 10.0 and the F value of the edge associated with a certain device node is 8.2, then the normalized intensity is 0.82. The final weight coefficient = initial weight × normalized intensity. If a causal path associated with a certain device node has no edge directly pointing to the bacterial concentration (for example, only affects intermediate parameters such as humidity), then its final weight coefficient remains the same as the initial weight. The final weight coefficient is normalized to the range of 0 to 1 by dividing by the maximum weight value of all device nodes. For example, if the maximum weight is 4.5, then the weight of a certain node 3.0 is normalized to 0.67. The normalized weight coefficient is stored in JSON format and synchronized with the timestamp of the environmental parameter data in step S1 for constructing the weight feature matrix in step S4.

[0038] S4. Align the environmental parameter data, interpolated environmental parameter data, and bacterial concentration data according to the grid position, and construct a weight feature matrix in combination with the risk weight coefficient. The specific implementation steps are as follows: Based on the grid cell numbers in the rasterized spatial topological relationship, align the environmental parameter data of the original monitoring points, the interpolated environmental parameter data, and the bacterial concentration data of the corresponding grids according to the same grid index. The grid cell numbers are derived from the rasterized spatial topological relationship generated in step S1. The unique number of each grid cell is generated by combining its row number and column number in the chicken coop floor plan. For example, the grid number of the 3rd row and 5th column is 3-5. The alignment rule is as follows: traverse all grid cell numbers. If a grid cell is marked as a monitoring point grid in step S1, directly extract the original environmental parameter data and bacterial concentration data of this grid; if it is an unmonitored area grid generated in step S2, extract the interpolated environmental parameter data; if it is an interpolation abnormal area, fill in the global environmental parameter average value and bacterial concentration median value defined in step S2. The global environmental parameter average value is the arithmetic average of all monitoring point data. For example, the average temperature is 25.3°C, the average ammonia concentration is 8.7 ppm, and the bacterial concentration median value is 120 CFU / m³. The aligned data is stored in a dictionary structure, where the key is the grid number and the value is the corresponding environmental parameter, interpolation parameter, and bacterial concentration data. The dictionary structure is serialized and stored through the json module of Python to ensure cross-platform readability.

[0039] Assign corresponding weight values to each grid cell according to the final risk weight coefficient. The weight values are derived from the normalized risk weight coefficients of the device nodes associated with the corresponding grids. The normalized risk weight coefficients are derived from the final risk weight coefficients generated in step S3. The weight value of each grid cell is determined according to the device node it is associated with. If a grid cell is associated with multiple device nodes (such as the intersection of ventilation ducts), take the maximum normalized weight value of its associated nodes as the weight value of this grid. For example, if the intersection of ventilation ducts is associated with vent A (weight 0.82) and vent B (weight 0.75), the final weight value is 0.82; if it is not associated with any device nodes (such as the chicken activity area far from the devices), the weight value is set to 1.0, indicating the default without risk weighting. The weight values are stored in a dictionary structure corresponding to the grid numbers. For example, the weight value of grid 3-5 is 0.82, and the weight value of grid 4-2 is 1.0. If the grid associated with the device marked as a low-risk node in step S3, its weight value is forced to zero. For example, the weight of the grid at the edge of the feed delivery area is 0.

[0040] Multiply the environmental parameter data, interpolated environmental parameter data, and bacterial concentration data element - by - element with the assigned weight values according to the grid positions to generate a weighted environmental parameter matrix, a weighted interpolated parameter matrix, and a weighted bacterial concentration matrix. The element - by - element multiplication operation is achieved by traversing each grid cell: for each grid, multiply its environmental parameter data (temperature and humidity, ammonia concentration, carbon dioxide concentration) by the weight value of that grid to generate the weighted temperature and humidity values, ammonia concentration value, and carbon dioxide concentration value. For example, if the original temperature of grid 3 - 5 is 26.0 °C and the weight is 0.82, the weighted temperature is 26.0×0.82 = 21.32 °C. The interpolated environmental parameter data is processed in the same way. For example, for a grid with an interpolated humidity of 65% and a weight of 0.75, the weighted humidity is 65×0.75 = 48.75%. The generation of the weighted bacterial concentration matrix requires additional consideration of the consistency of the concentration unit. For example, the colony - forming unit of the air sample is CFU per cubic meter, and that of the surface sample is CFU per square centimeter. After unified conversion to a dimensionless normalized value, the weighting is performed. The dimensionless normalization method is: divide the original concentration value by the maximum value of this parameter in the chicken coop. For example, if the maximum air bacterial concentration is 300 CFU / m³ and the concentration of grid 3 - 5 is 150 CFU / m³, the normalized value is 0.5. If the weight value of a certain grid cell is 0 (such as the low - risk node marked in step S3), then all its weighted parameter values are set to zero and marked as invalid data in subsequent steps.

[0041] Concatenate the weighted environmental parameter matrix, the weighted interpolated parameter matrix, and the weighted bacterial concentration matrix along the grid spatial dimension to form a multi - dimensional weight feature matrix. Each element of the multi - dimensional weight feature matrix contains the weighted environmental parameters, interpolated parameters, and bacterial concentration data. The concatenation operation is carried out based on the order of the grid numbers. Arrange the weighted environmental parameters, interpolated parameters, and bacterial concentration data of each grid in row - major order to generate a three - dimensional matrix. The first dimension of the matrix is the grid row number, the second dimension is the grid column number, and the third dimension is the parameter type (temperature and humidity, ammonia, carbon dioxide, interpolated parameter, bacterial concentration). For example, the position of grid 3 - 5 in the matrix is the 3rd row and the 5th column, and its third - dimension data are the weighted temperature 21.32 °C, weighted humidity 48.75%, weighted ammonia concentration 9.84 ppm, interpolated temperature 26.1 °C, and weighted bacterial concentration 0.5 in sequence. If a certain grid is invalid data (weight value is 0), the third - dimension data at its corresponding position is filled with NaN (Not a Number) and automatically ignored in subsequent models. The multi - dimensional weight feature matrix is stored in the NumPy array format with a data type of float32, associated with the timestamp defined in step S1, and is used for calculating the bacterial migration probability in step S5. When storing the matrix, row - column compression encoding (COO format) is adopted to reduce the storage space occupation in the form of a sparse matrix. The compression ratio threshold is triggered when the proportion of non - zero elements is less than 30%.

[0042] S5. Based on the bacterial concentration gradient distribution in different grid regions of the weight feature matrix, combined with the ventilation path connectivity of the rasterized spatial topological relationship, generate the bacterial migration probability between each grid. The specific implementation steps are as follows: Calculate the concentration gradient values of each grid cell in the east-west direction and the north-south direction based on the weighted bacterial concentration in the weight feature matrix, and generate a bacterial concentration gradient distribution map. The weighted bacterial concentration data is from the bacterial concentration dimension in the multi-dimensional weight feature matrix generated in step S4. For example, the weighted bacterial concentration of grid 3-5 is 0.5 (dimensionless). The calculation method of the concentration gradient value is: for each grid cell, calculate the difference in the weighted bacterial concentration between its adjacent grid on the east side and the adjacent grid on the west side as the east-west direction gradient, and the difference in the weighted bacterial concentration between its adjacent grid on the south side and the adjacent grid on the north side as the north-south direction gradient. For example, the concentration of grid 3-6 on the east side of grid 3-5 is 0.6, and the concentration of grid 3-4 on the west side is 0.4, then the east-west direction gradient is 0.6 - 0.4 = 0.2; the concentration of grid 4-5 on the south side is 0.7, and the concentration of grid 2-5 on the north side is 0.3, then the north-south direction gradient is 0.7 - 0.3 = 0.4. The gradient distribution map is stored in the form of a two-dimensional matrix, with each grid corresponding to two gradient values (east-west, north-south), stored in the format of a NumPy array, and the data type is float32, sharing the same grid index as the multi-dimensional weight feature matrix in step S4.

[0043] According to the adjacency matrix of the rasterized spatial topological relationship, extract the connectivity types of the ventilation paths between each grid. The connectivity types include strongly connected and weakly connected. The adjacency matrix is from the rasterized spatial topological relationship generated in step S1, and its element value of 0 indicates non-connectivity, 1 indicates weak connectivity, and 2 indicates strong connectivity. The extraction rule of the ventilation path connectivity type is: traverse all grid pairs in the adjacency matrix. If the element value is 2, it is marked as a strongly connected path (for example, grids 3-5 and 3-6 directly connected by a ventilation duct); if the element value is 1, it is marked as a weakly connected path (for example, grids 3-5 and 4-5 that only share a corner). If the element value is 0, the migration probability calculation for this grid pair is excluded. The physical meaning corresponding to the strongly connected path is the existence of a directional air flow channel (such as a ventilation duct), and the weakly connected path is a natural diffusion area (such as an open space). The extracted connectivity type data is stored in a dictionary structure, with the key being the grid pair (such as "3-5→3-6") and the value being the connectivity type (strong / weak).

[0044] Combine the concentration gradient values with the ventilation path connectivity types in grid pairs, and correct the concentration gradient values through the gradient attenuation factor. The attenuation factor for strongly connected paths is 0.5 times that of weakly connected paths. The gradient attenuation factor is used to simulate the resistance difference of ventilation paths to bacterial migration. Since the air flow in strongly connected paths has strong directivity, the attenuation factor is set to 0.5 (for example, corrected gradient = original gradient × 0.5), and the attenuation factor for weakly connected paths is set to 1.0. For example, the grid pair 3-5 → 3-6 is a strongly connected path, and its east-west direction gradient of 0.2 is corrected to 0.2 × 0.5 = 0.1; the grid pair 3-5 → 4-5 is a weakly connected path, and its north-south direction gradient of 0.4 is corrected to 0.4 × 1.0 = 0.4. If there is no connectivity between grid pairs (the adjacency matrix element is 0), then skip the correction calculation for this grid pair. The corrected gradient values are stored in a new dictionary structure, with the grid pair as the key and the corrected gradient value as the value (such as "3-5 → 3-6: 0.1").

[0045] Based on the corrected concentration gradient values and the Euclidean distance between grids, calculate the bacterial migration probability for each grid pair. The bacterial migration probability is positively correlated with the corrected concentration gradient value and negatively correlated with the Euclidean distance between grids. The Euclidean distance is the actual physical distance between the center points of the grids, which is converted according to the grid cell size. For example, if the grid size is 1 meter × 1 meter, the Euclidean distance between grid 3-5 and 3-6 is 1 meter, and the Euclidean distance between grid 3-5 and 4-5 is 1.414 meters (diagonal distance). The migration probability calculation formula is: migration probability = (corrected gradient value) / (distance + 0.1 meter), where 0.1 meter is a smoothing factor to avoid division by zero errors. For example, for the grid pair 3-5 → 3-6, the corrected gradient is 0.1 and the distance is 1 meter, so the migration probability = 0.1 / (1 + 0.1) = 0.091; for the grid pair 3-5 → 4-5, the corrected gradient is 0.4 and the distance is 1.414 meters, so the migration probability = 0.4 / (1.414 + 0.1) = 0.265. If the corrected gradient value is negative (indicating the concentration decreasing direction), then the migration probability is set to zero. The migration probabilities for all grid pairs are stored in a dictionary structure, with the grid pair as the key and the calculated probability value as the value.

[0046] Normalize the bacterial migration probabilities for all grid pairs to ensure that the sum of all bacterial migration probabilities is 1, and generate a probability transition matrix for the dynamic distribution prediction model. The normalization process is as follows: calculate the sum of the migration probabilities for all grid pairs, and divide each migration probability by this sum. For example, if the total migration probability is 2.0, the probability of grid pair 3-5→3-6, which is 0.091, is normalized to 0.091 / 2.0 = 0.0455. The row and column indices of the probability transition matrix correspond to the grid numbers, and the matrix element values are the normalized migration probabilities. For example, the element value at row 3-5 and column 3-6 of the matrix is 0.0455, and the element value at row 3-5 and column 4-5 is 0.1325. If the migration probability of a certain grid pair is zero or not connected, the corresponding matrix element is set to zero. The probability transition matrix is stored in the sparse matrix format (COO), only recording the rows, columns, and values of non-zero elements to reduce storage space occupancy. The compression ratio threshold of the sparse matrix is set such that the proportion of non-zero elements is less than 30%. If it is higher than this threshold, it is stored as a dense matrix.

[0047] S6. Construct a bacterial dynamic distribution prediction model based on the non-linear superposition relationship between the bacterial migration probability and the risk weight coefficient, and output the evaluation and prediction results for each grid area in the chicken coop. The specific implementation steps are as follows: Based on the bacterial migration probabilities in the probability transition matrix and combined with the normalized risk weight coefficients, construct a Markov chain model with grids as nodes. The probability transition matrix is derived from the grid-to-grid migration probability data generated in step S5, and its matrix element values are the normalized migration probabilities. The construction method of the Markov chain model is as follows: consider each grid as a state node, and the state transition probability is determined by the migration probability of the corresponding grid pair in the probability transition matrix. The normalized risk weight coefficients are derived from the final risk weight coefficients generated in step S3. The weight value of each grid node is converted into a non-linear influence factor through an exponential function. For example, the weight coefficient of grid 3-5, which is 0.82, is converted into the exponential function of the natural exponential e to the power of 0.82, and the calculation result is approximately 2.27. The state transition equation of the Markov chain model is defined as: the next state concentration is equal to the current concentration multiplied by the migration probability and then multiplied by the non-linear influence factor, ensuring that the weight coefficient participates in the calculation in exponential form to enhance the non-linear response ability of the model to high-risk areas.

[0048] Taking the weighted bacterial concentration data of the multi-dimensional weight feature matrix as the initial state, input it into the Markov chain model for iterative calculation. In each iteration, the bacterial concentration of each grid is updated through the exponential weighted sum of the bacterial migration probability and the risk weight coefficient. The multi-dimensional weight feature matrix is derived from the weighted bacterial concentration data generated in step S4, and the initial state is the weighted concentration value of each grid. For example, the initial concentration of grid 3-5 is 0.5 (dimensionless). The iterative calculation rule is as follows: traverse all grid cells, and calculate the concentration migration amount according to the migration probability from this grid to other grids in the probability transition matrix and the non-linear influence factor of the target grid. For example, the migration probability from grid 3-5 to 3-6 is 0.0455, and the weight coefficient of the target grid 3-6 is 0.75 (e to the power of 0.75 is approximately 2.12), then the migration amount is 0.5 multiplied by 0.0455 and then multiplied by 2.12, and the calculation result is approximately 0.048. After the migration amounts of all grids are accumulated, they are updated as the new concentration value of the target grid. After each iteration is completed, record the concentration values of each grid as the input for the next iteration. During the iteration process, if the concentration of a certain grid exceeds the preset upper limit (such as twice the maximum historical bacterial concentration in the chicken coop), it is truncated to the upper limit value to avoid the interference of outliers on the model convergence.

[0049] Set the model convergence condition that the change rates of bacterial concentrations in two adjacent iterations are both lower than the preset change rate threshold. After reaching the convergence condition, terminate the calculation and output the final bacterial concentration distribution. The preset change rate threshold is set through experiments based on historical data. By analyzing the fluctuation law of the bacterial concentration in the chicken coop, the threshold is set to 1%. The change rate calculation method is as follows: calculate the absolute value of the concentration difference between two adjacent iterations of each grid, divide it by the current concentration value, and take the average value of the change rates of all grids. For example, after the first iteration, the concentration of grid 3-5 is 0.85, and after the second iteration, it is 0.86, then the change rate is |0.86 - 0.85| / 0.85 ≈ 1.18%. If the average change rate is lower than the threshold, it is determined that the model converges. If the iteration times exceed the maximum limit (such as 100 times) and still do not converge, trigger the manual review process, check whether there are abnormalities in the input data (such as migration probability, weight coefficient), and recalculate after adjusting the parameters according to the review results. During the manual review, first check the matching of the migration probability and the weight coefficient of the high-risk grids (weight coefficient ≥ 0.8). For example, grids with a high weight coefficient but a very low migration probability may be abnormal data points.

[0050] Associate the final bacterial concentration distribution with the interpolated environmental parameter data according to the grid positions to generate an evaluation and prediction result containing the environmental parameter impact factors. The evaluation and prediction result is stored as a JSON format dataset indexed by the grid number. The interpolated environmental parameter data is sourced from the interpolated data for the unmonitored areas generated in step S2, including temperature and humidity, ammonia concentration, and carbon dioxide concentration. The association rule is: match the final bacterial concentration value of each grid with the environmental parameter data according to the grid number to generate a composite data entry containing the bacterial concentration and environmental parameters. For example, the JSON entry for grid 3-5 is {"grid number": "3-5", "bacterial concentration": 0.85, "temperature": 26.1, "humidity": 65, "ammonia": 12, "carbon dioxide": 450}, where the temperature unit is degrees Celsius, the humidity is in percentage, the units for ammonia and carbon dioxide are ppm, and the bacterial concentration is a dimensionless normalized value. The dataset is serialized and stored through the json module in Python to ensure cross-platform compatibility. If a certain grid is an interpolation anomaly area (marked in step S2), its environmental parameter data is filled with the global average value, and an additional "data source" field is added in the JSON and marked as "interpolation filling", for example, {"grid number": "4-7", "data source": "interpolation filling", "temperature": 25.3, "humidity": 60}. The stored dataset is transmitted to the chicken coop environmental monitoring system via the HTTP protocol to drive the control strategies of the ventilation equipment and disinfection device in real time.

[0051] In the steps S1 to S6 of the embodiments of the present invention, through the synergistic effect of multi-dimensional technical features, the limitations of relying on uniform sampling and linear correlation in traditional bacterial distribution modeling are broken through, and a set of spatial dynamic prediction systems adapted to the complex environment of chicken coops is constructed. In the data acquisition stage (S1), by fusing the equipment layout and the grid topology relationship, the monitoring point distribution rules are generated, solving the coverage problem of key areas (such as ventilation dead corners) under sparse data. The grid division method with equipment correlation constraints is not a simple spatial geometric division, but a dynamic modeling basis combined with the physical connection path. In step S3, based on the path alignment relationship between the causal fluctuation chain and the equipment topology, the risk weights are generated, converting the statistical correlation of environmental parameters into the interpretable weights of the physical propagation path, replacing the traditional empirical weighting or black box training mode, and significantly improving the physical interpretability of the source risk assessment. In step S5, the concentration gradient is corrected differently by the gradient attenuation factor, and the connection type (strong / weak) of the ventilation path is embedded in the calculation of the migration probability, enabling the model to adaptively capture the propagation differences between the airflow directivity and natural diffusion, breaking through the deficiencies of traditional interpolation algorithms in modeling spatial heterogeneity. Finally, the non-linear superposition model in step S6 realizes the dynamic coupling of risk weights and migration probabilities through the Markov chain and the exponential weighting mechanism. The associated output of the environmental parameter influence factors not only improves the prediction accuracy but also provides a multi-parameter decision basis for precise control. The data flow closed-loop (topological constraint → interpolation filling → causal alignment → dynamic migration → non-linear prediction) between the steps forms a logically rigorous modeling chain, solving the modeling failure problem in high-dimensional, sparse, and multi-factor coupling scenarios through the integration of physical drive and data drive.

[0052] Embodiment 2: Figure 2 The structural schematic diagram of the bacterial dynamic distribution modeling system in the chicken coop of the present invention is given. The bacterial dynamic distribution modeling system in the chicken coop includes the following modules: The data topology module is used to obtain the environmental parameter data and bacterial concentration data of multiple discrete monitoring points in the chicken coop, and generate a grid-based spatial topology relationship based on the chicken coop structure layout; The interpolation calculation module is used to perform spatial interpolation calculation on the environmental parameter data according to the connectivity of adjacent grids in the grid-based spatial topology relationship to generate the interpolated environmental parameter data of the unmonitored area; The causal weight module is used to generate the risk weight coefficient of potential bacterial sources through causal contribution degree analysis based on the path alignment relationship between the physical connection topology among the equipment in the chicken coop and the causal fluctuation chain of environmental parameters; The matrix construction module is used to align the environmental parameter data, the interpolated environmental parameter data, and the bacterial concentration data according to the grid positions, and construct a weight feature matrix in combination with the risk weight coefficient; A migration probability module, which is used to generate the bacterial migration probability between each grid based on the bacterial concentration gradient distribution in different grid regions of the weight feature matrix and in combination with the ventilation path connectivity of the rasterized spatial topological relationship. A dynamic prediction module, which is used to construct a bacterial dynamic distribution prediction model according to the non-linear superposition relationship between the bacterial migration probability and the risk weight coefficient, and output the evaluation prediction results of each grid region in the chicken coop.

[0053] The calculations involved in the embodiments are all dimensionless numerical calculations, and the preset parameters and threshold selections in the calculations are set by those skilled in the art according to the actual situation.

[0054] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product.

[0055] Those of ordinary skill in the art can realize that the modules and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application of the technical solution and the invention constraints. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0056] In addition, in each embodiment of the present application, the various functional modules can be integrated in a processing module, or each module can exist physically alone, or two or more modules can be integrated in one module.

[0057] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces, and the indirect coupling or communication connection of the device or module can be in an electrical, mechanical or other form.

[0058] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0059] Finally, the above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for modeling the dynamic distribution of bacteria in a chicken coop, characterized in that, It includes the following steps: S1. Obtain the environmental parameter data and bacterial concentration data of multiple discrete monitoring points in the chicken coop, and generate a rasterized spatial topological relationship based on the chicken coop structure layout; S2. Perform spatial interpolation calculation on the environmental parameter data according to the adjacent grid connectivity in the rasterized spatial topological relationship to generate the interpolated environmental parameter data of the unmonitored area; S3. Based on the path alignment relationship between the physical connection topology of the equipment in the chicken coop and the causal fluctuation chain of the environmental parameters, generate the risk weight coefficient of the potential bacterial source through causal contribution analysis; S4. Align the environmental parameter data, the interpolated environmental parameter data, and the bacterial concentration data according to the grid position, and construct a weight feature matrix in combination with the risk weight coefficient; S5. Based on the bacterial concentration gradient distribution of different grid areas in the weight feature matrix, and in combination with the ventilation path connectivity of the rasterized spatial topological relationship, generate the bacterial migration probability between each grid; S6. Construct a bacterial dynamic distribution prediction model according to the non-linear superposition relationship between the bacterial migration probability and the risk weight coefficient, and output the evaluation prediction results of each grid area in the chicken coop.

2. The method for modeling the dynamic distribution of bacteria in a chicken coop according to claim 1, characterized in that Obtain the environmental parameter data and bacterial concentration data of multiple discrete monitoring points in the chicken coop, and generate a rasterized spatial topological relationship based on the chicken coop structure layout, including: Select multiple monitoring points in the chicken coop through a preset discrete monitoring point distribution rule; collect the environmental parameter data of each monitoring point; synchronously obtain the bacterial concentration data corresponding to the position of each monitoring point; divide the internal space of the chicken coop into grid units of equal size, and establish a connectivity mapping relationship between adjacent grids to generate a rasterized spatial topological relationship.

3. The method for modeling the dynamic distribution of bacteria in a chicken coop according to claim 1, wherein Perform spatial interpolation calculation on the environmental parameter data according to the adjacent grid connectivity in the rasterized spatial topological relationship to generate the interpolated environmental parameter data of the unmonitored area, including: Based on the adjacency matrix of the rasterized spatial topological relationship, determine all adjacent monitoring point grids of the unmonitored area grid, and screen out the adjacent monitoring point grids with strong or weak connectivity with the unmonitored area grid; According to the connectivity type between the adjacent monitoring point grid and the unmonitored area grid, assign an interpolation weight to each adjacent monitoring point grid; Extract the environmental parameter data of the adjacent monitoring point grid, and in combination with the assigned interpolation weight, generate the interpolated environmental parameter data of the unmonitored area grid through inverse distance weighted average calculation; Integrate the interpolated environmental parameter data with the original monitoring point data according to the grid position, and update the environmental parameter data set to cover all grid areas of the chicken coop.

4. The method for modeling the dynamic distribution of bacteria in a chicken coop according to claim 1, wherein, Based on the path alignment relationship between the physical connection topology of the equipment in the chicken coop and the causal fluctuation chain of the environmental parameters, generate the risk weight coefficient of the potential bacterial source through causal contribution analysis, including: Extract the causal fluctuation chain of the environmental parameters through a causal discovery algorithm, and the causal fluctuation chain is generated by the temporal correlation between the environmental parameter data and the bacterial concentration data; Map the equipment nodes in the physical connection topology of the equipment to the nodes of the causal fluctuation chain, and screen out the group of equipment nodes whose physical connection path matches the causal propagation path; Calculate the initial risk weight of each equipment node according to the number of matching paths and the centrality value of the equipment node in the physical connection topology; Adjust the initial risk weight based on the direct causal influence intensity of the bacterial concentration node in the causal fluctuation chain to generate the final risk weight coefficient.

5. The method for modeling the dynamic distribution of bacteria in a chicken coop according to claim 1, wherein, Align the environmental parameter data, interpolated environmental parameter data, and bacterial concentration data according to the grid position, and construct a weight feature matrix in combination with the risk weight coefficient, including: Based on the grid cell numbers in the rasterized spatial topology relationship, align the environmental parameter data of the original monitoring points, the interpolated environmental parameter data, and the bacterial concentration data of the corresponding grids according to the same grid index; Assign corresponding weight values to each grid cell according to the final risk weight coefficient, and the weight values are derived from the normalized risk weight coefficients of the device nodes associated with the corresponding grids; Multiply the environmental parameter data, interpolated environmental parameter data, and bacterial concentration data element by element with the assigned weight values according to the grid position to generate a weighted environmental parameter matrix, a weighted interpolated parameter matrix, and a weighted bacterial concentration matrix; Concatenate the weighted environmental parameter matrix, the weighted interpolated parameter matrix, and the weighted bacterial concentration matrix along the grid space dimension to form a multi-dimensional weight feature matrix, and each element of the multi-dimensional weight feature matrix contains the weighted environmental parameters, interpolated parameters, and bacterial concentration data.

6. The method for modeling the dynamic distribution of bacteria in a chicken coop according to claim 1, characterized in that Based on the bacterial concentration gradient distribution in different grid regions in the weight feature matrix, combined with the ventilation path connectivity of the rasterized spatial topology relationship, generate the bacterial migration probability between each grid, including: Calculate the concentration gradient values of each grid cell in the east-west direction and the north-south direction based on the weighted bacterial concentration in the weight feature matrix to generate a bacterial concentration gradient distribution map; According to the adjacency matrix of the rasterized spatial topology relationship, extract the connectivity types of the ventilation paths between each grid, and the connectivity types include strong connectivity and weak connectivity; Combine the concentration gradient values and the ventilation path connectivity types in pairs of grids, and correct the concentration gradient values through the gradient attenuation factor; Calculate the bacterial migration probability of each grid pair based on the corrected concentration gradient value and the Euclidean distance between grids; Normalize the bacterial migration probabilities of all grid pairs to generate a probability transition matrix for the dynamic distribution prediction model.

7. The method for modeling the dynamic distribution of bacteria in a chicken coop according to claim 6, characterized in that The bacterial migration probability is positively correlated with the corrected concentration gradient value and negatively correlated with the Euclidean distance between grids.

8. The method for modeling the dynamic distribution of bacteria in a chicken coop according to claim 1, characterized in that, Construct a bacterial dynamic distribution prediction model according to the non-linear superposition relationship between the bacterial migration probability and the risk weight coefficient, and output the evaluation prediction results of each grid region in the chicken coop, including: Based on the bacterial migration probability in the probability transition matrix combined with the normalized risk weight coefficient, construct a Markov chain model with grids as nodes; Take the weighted bacterial concentration data of the multi-dimensional weight feature matrix as the initial state and input it into the Markov chain model for iterative calculation; Set the model convergence condition that the change rate of bacterial concentration in two adjacent iterations is lower than the preset change rate threshold. After reaching the convergence condition, terminate the calculation and output the final bacterial concentration distribution; Associate the final bacterial concentration distribution with the interpolated environmental parameter data according to the grid position to generate an evaluation prediction result including the environmental parameter influence factor.

9. The method for modeling the dynamic distribution of bacteria in a chicken coop according to claim 8, wherein, Iteratively update the bacterial concentration of each grid through the exponential weighted sum of the bacterial migration probability and the risk weight coefficient.

10. A chicken coop bacterial dynamic distribution modeling system for implementing the chicken coop bacterial dynamic distribution modeling method according to any one of claims 1-9, characterized in that, Including the following modules: A data topology module, which is used to obtain the environmental parameter data and bacterial concentration data of multiple discrete monitoring points in the chicken coop, and generate a rasterized spatial topology relationship based on the structural layout of the chicken coop; An interpolation calculation module, which is used to perform spatial interpolation calculation on the environmental parameter data according to the adjacent grid connectivity in the rasterized spatial topology relationship to generate the interpolated environmental parameter data of the unmonitored area; A causal weight module, which is used to generate a risk weight coefficient of potential bacterial sources through causal contribution degree analysis based on the path alignment relationship between the physical connection topology among devices in the chicken coop and the causal fluctuation chain of environmental parameters; A matrix construction module, which is used to align the environmental parameter data, the interpolated environmental parameter data and the bacterial concentration data according to the grid positions, and construct a weight feature matrix in combination with the risk weight coefficient; A migration probability module, which is used to generate the bacterial migration probability between each grid based on the bacterial concentration gradient distribution in different grid areas in the weight feature matrix and the ventilation path connectivity of the rasterized spatial topology relationship; A dynamic prediction module, which is used to construct a bacterial dynamic distribution prediction model according to the non-linear superposition relationship between the bacterial migration probability and the risk weight coefficient, and output the evaluation prediction results of each grid area in the chicken coop.

Citation Information

Patent Citations

  • Chicken house environment comfort prediction method and device based on environment data, product and storage medium

    CN114323151A

  • Microorganism spatial distribution prediction method and related equipment

    CN117577198A

  • Artificial intelligence-based crop yield prediction method and system

    CN119312989A

  • Fire monitoring and early warning method and device based on big data analysis

    CN119992742A

  • Livestock breeding house environment detection method and system

    CN120008690A

Cited By

  • Analysis method and analysis system for bacterial distribution in henhouse

    CN121189639A

  • An analysis method and analysis system for bacterial distribution in a chicken house

    CN121189639B