Self-diagnosis method of sensor in building hog house environment state intelligent monitoring system
The self-diagnosis method using multi-sensor technology and MAD analysis effectively identifies and addresses sensor failures in piggery monitoring systems, enhancing the accuracy and reliability of environmental control for pig health and growth.
Patent Information
- Application Number
- CN202411364965.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-03
AI Technical Summary
Traditional piggery environmental monitoring systems lack self-diagnosis capabilities, leading to inaccurate or ineffective measurement data due to sensor degradation or failure, which compromises the control of the piggery environment and impacts pig health and growth.
A self-diagnosis method using multi-sensor technology and the Median Absolute Deviation (MAD) method to identify abnormal sensors by calculating the median and deviation of sensor data, comparing gas concentration characteristics, and monitoring continuous sampling values for real-time detection of faulty sensors.
The method quickly identifies and locates faulty sensors, improving the accuracy and reliability of environmental monitoring, reducing manual intervention, and ensuring stable control of the breeding environment.
Smart Images

Figure CN119245714A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of sensor self-diagnosis, and in particular relates to a sensor self-diagnosis method in an intelligent monitoring system for environmental status of a building pig house. Background Art
[0002] With my country's increasingly limited land resources and growing demand for pork, traditional flat-bed pig farming models are no longer able to meet market demand. To address this challenge, high-rise pig farming has gradually emerged and become a new model for my country's pig farming industry. High-rise pig farming effectively overcomes land resource limitations and expands the scale of pig farming through large-scale, multi-species, and high-density farming. However, as high-rise pig farming expands, environmental monitoring and control of piggeries has become extremely complex and difficult. The environmental status of piggeries directly affects the health and growth efficiency of pigs. Therefore, the accuracy, reliability, and stability of environmental status monitoring are key prerequisites for effective environmental control.
[0003] Currently, piggery environmental status monitoring systems primarily rely on various sensors, such as temperature, humidity, and gas sensors, which provide real-time monitoring of key parameters within the piggery, such as temperature, humidity, and air quality. Farmers use the measurement results from these sensors to perform appropriate environmental control operations to ensure the pigs maintain a suitable growth environment. However, long-term exposure to complex farming environments makes sensors susceptible to various environmental factors, such as humidity, dust, and ammonia corrosion, leading to gradual degradation, aging, and even damage. The resulting deviations and even failures in measurement data can severely impact the accuracy of environmental monitoring, hindering the effective control of the piggery environment and ultimately hindering the healthy growth of pigs.
[0004] While some patented technologies have emerged in the field of environmental monitoring for pig farms in buildings, such as "Environmental Control Method and System Suitable for Pig Farms in Buildings" and "Intelligent Environmental Adjustment for Pig Farms in Buildings Based on Edge-Cloud Collaboration," these technologies primarily focus on environmental control methods and system design. However, research and patents on self-diagnostic capabilities for environmental monitoring systems remain elusive. Traditional piggery environmental monitoring systems typically lack self-diagnosis capabilities and rely primarily on the experience or expertise of farmers for regular inspections and maintenance. This is not only time-consuming and labor-intensive, but also prone to missed detections and delays, making it difficult to ensure the accuracy and real-time nature of environmental monitoring.
[0005] In building-based piggery environmental status monitoring systems, sensors can malfunction due to environmental influences, aging, damage, and other factors. This can lead to inaccurate or ineffective measurement data, compromising effective control of the piggery environment and ultimately impacting the healthy development of the pigs. Traditional building-based piggery environmental status monitoring systems typically lack automatic parameter self-diagnosis capabilities. In most cases, abnormality diagnosis still relies on regular inspections and maintenance based on the experience and expertise of farmers. This approach is not only time-consuming and labor-intensive, but also makes it difficult to ensure accurate and timely detection of abnormal parameters.
[0006] In view of this, the present invention is proposed. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a self-diagnosis method for sensors in an intelligent monitoring system for the environmental status of a building pig house, thereby solving the problems raised in the above-mentioned background technology.
[0008] In order to solve the above technical problems, the basic concept of the technical solution adopted by the present invention is:
[0009] A self-diagnosis method for sensors in an intelligent monitoring system for environmental conditions of building pig houses comprises the following steps:
[0010] S1: Sensors are placed in the feeding area, activity area, defecation area, and sleeping area of the pig house to collect real-time environmental parameters such as temperature and humidity, ammonia concentration, sulfur dioxide concentration, and light intensity;
[0011] S2: Among the arranged sensors, each sensor continuously samples N times within the set sampling period, averages the sampled data, and takes the average value as the collected value;
[0012] S3: Perform data fusion on the same environmental parameter values collected by multiple sensors in the same area, calculate the sample median and MAD value, and use the MAD method to determine whether there are any sensors with abnormal deviations;
[0013] S4: Compare and analyze the measurement results of sensors in each area based on the characteristics of gas concentration and gas flow in different areas;
[0014] S5: Monitor the continuous sampling values of each sensor within a fixed time interval in real time. If the continuous sampling value of a sensor remains unchanged within the set time, the sensor is determined to be operating abnormally.
[0015] Optionally, the sensors in step S1 include but are not limited to DHT11 digital temperature and humidity sensor, MG812 carbon dioxide sensor, MQ137 ammonia sensor, MQ136 hydrogen sulfide sensor, LM393 light intensity sensor, and the sensors are arranged symmetrically at each sampling point in the pig house.
[0016] Optionally, the steps for obtaining the collected value in step S2 are:
[0017] S2.1: According to the set sampling period, each sensor samples the environmental parameters N times continuously to obtain a set of sampling data x1, x2, ..., x N ;
[0018] S2.2: Perform average processing on the N sampling data collected by each sensor and calculate the average value x of these sampling data i,j , whose expression is: in, is the value collected by the sensor for the kth time, x i ,j is the sampling value of the sensor at position j in sampling point i.
[0019] Optionally, step S3 is to perform data fusion on the same environmental parameter values collected by multiple sensors in the same area, calculate the sample median and absolute deviation value, and determine whether there is a sensor with abnormal deviation by MAD (median absolute difference) method:
[0020] S3.1: The measured values of the same environmental parameters at all sampling points in the same area are grouped into a data sample X, where X = [x i,j ]; i = 1, 2…m, j = 1, 2…n, where i is the number of the sampling point, j is the number of the same type of sensor in each sampling point, m is the number of sampling points in a single area, and n is the number of sensors of the same type in a single sampling point;
[0021] S3.2: Sort the data sample X and calculate its median x med , whose expression is x med =median(X), and through the formula x ad =[|x i,j -x med |]; i = 1, 2…m, j = 1, 2…calculate the absolute deviation of each data from the median;
[0022] S3.3: For all absolute deviation values x ad Sort and calculate the median to get the MAD value, which is expressed as MAD=median(x ad ), where median is the median;
[0023] S3.4: Analyze whether the sensor is operating abnormally based on the obtained MAD value.
[0024] Optionally, in step S3.4, if the deviation between the sampling value of a sensor and the median exceeds 3 times the MAD value, the expression is: |xi,j -x med |>3MAD, the sensor is identified as abnormal.
[0025] Optionally, step S4 is a step of comparing and analyzing the measurement results of sensors in each area according to the characteristics of gas concentration and gas flow characteristics in different areas.
[0026] S4.1: Determine the gas concentration characteristics of different areas within the piggery based on their functions and layout, and collect gas concentration data for each area using sensors located within the area.
[0027] S4.2: Compare and analyze the gas concentration data collected by sensors in each area at the same time point and analyze the dynamic changes of the measured values in each area in combination with the flow characteristics of the gas. Finally, based on the results of the comparative analysis, identify whether there are any abnormal sensors.
[0028] Optionally, in step S5, the continuous sampling values of each sensor within a fixed time interval are monitored in real time. If the continuous sampling value of a certain sensor remains unchanged within the set time, the step of determining that the sensor is operating abnormally is as follows:
[0029] S5.1: Each sensor sets a fixed time interval Δt for data collection; during the set monitoring period, the sensor will continuously sample at these fixed time intervals and record multiple sampling values x1, x2, x3, ..., x N , where N is the total number of sampling times in the monitoring period;
[0030] S5.2: Monitor and compare the continuous sampling values of each sensor within a fixed time interval in real time to detect whether there are changes in these sampling values;
[0031] S5.3: If within the set monitoring time, all the continuous sampling values x1, x2, x3, ..., x N All remain the same and have not changed, that is, the condition x1=x2=x3=⋯⋯=x N , it is considered that the sensor cannot correctly perceive environmental changes.
[0032] Optionally, the comparison process in step S5.2 is to compare the results x of each sampling t Whether the sampling values before and after it are the same, that is, judging whether x t =x t-1 =x t-2 =...=x1.
[0033] After adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art. Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described below at the same time:
[0034] By calculating the median and deviation of each sensor's data, this method not only quickly identifies and diagnoses the presence of faulty sensors, but also precisely locates the specific sensor with the anomaly, effectively eliminating potential sources of failure. This method significantly improves the effectiveness and reliability of environmental status monitoring, ensures the accuracy of piggery environmental monitoring, and provides a solid technical foundation for the stable control of the breeding environment. This diagnostic method not only reduces the need for manual intervention but also significantly improves the automation level and response speed of the monitoring system, bringing higher efficiency and better breeding results to breeding management.
[0035] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings described below are only some embodiments. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0037] In the picture:
[0038] Figure 1 This is the self-diagnosis flow chart of the environmental status monitoring system for building pig houses;
[0039] Figure 2 This is a flowchart for the diagnosis of MAD;
[0040] Figure 3 Arrange the block diagram for a single area sensor.
[0041] It should be noted that these drawings and textual descriptions are not intended to limit the conceptual scope of the present invention in any way, but rather to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0042] The present invention will now be described in further detail with reference to the accompanying drawings.
[0043] See also Figure 1-3 As shown, in this embodiment, a self-diagnosis method for sensors in an intelligent monitoring system for the environmental status of a building pig house is provided, comprising the following steps:
[0044] S1: Sensors are placed in the feeding area, activity area, defecation area, and sleeping area of the pig house to collect real-time environmental parameters such as temperature and humidity, ammonia concentration, sulfur dioxide concentration, and light intensity;
[0045] S2: Among the arranged sensors, each sensor continuously samples N times within the set sampling period, averages the sampled data, and takes the average value as the collected value;
[0046] S3: Perform data fusion on the same environmental parameter values collected by multiple sensors in the same area, calculate the sample median and MAD value, and use the MAD method to determine whether there are any sensors with abnormal deviations;
[0047] S4: Compare and analyze the measurement results of sensors in each area based on the characteristics of gas concentration and gas flow in different areas;
[0048] S5: Monitor the continuous sampling values of each sensor within a fixed time interval in real time. If the continuous sampling value of a sensor remains unchanged within the set time, the sensor is determined to be operating abnormally.
[0049] By deeply analyzing the gas generation and flow characteristics of different areas within a piggery, the present invention designs a real-time automatic sensor diagnostic system based on multi-sensor technology and the Median Absolute Deviation (MAD) method. Specifically, the concentrations of gases such as ammonia and hydrogen sulfide in different areas (such as the feeding area, defecation area, and activity area) vary, and therefore their concentration distribution and dynamic changes vary. The present invention first rationally arranges the sensor array, using these sensors to synchronously collect environmental data from each key area.
[0050] Secondly, during the data collection process, the present invention applies multi-sensor technology to fuse and compare data from multiple sensors, enabling more accurate monitoring of environmental parameters at each sampling point. Subsequently, these sensor measurements are statistically analyzed using the median absolute difference (MAD) method. By calculating the median and deviation, the MAD method effectively identifies outliers in the data and locates potentially faulty sensors.
[0051] Finally, the present invention's diagnostic process is performed in real time, meaning the system can instantly analyze the operating status of each sensor while collecting data and quickly identify malfunctioning sensors. This automated diagnostic mechanism allows the system to promptly detect and locate problematic sensors, preventing the failure of a single sensor from causing the entire environmental monitoring system to fail. Ultimately, this invention significantly improves the effectiveness and reliability of the piggery environmental status monitoring system, ensuring precise control of piggery environmental parameters and providing a stable guarantee for the breeding process.
[0052] In this embodiment, the sensors in step S1 include but are not limited to a DHT11 digital temperature and humidity sensor, an MG812 carbon dioxide sensor, an MQ137 ammonia sensor, an MQ136 hydrogen sulfide sensor, and an LM393 light intensity sensor, and the sensors are symmetrically arranged at each sampling point in the pig house.
[0053] It's important to note that sensors are organized by function. A building-based piggery typically has four zones: feeding area, activity area, defecation area, and sleeping area. To accurately assess the environmental status of each zone, environmental parameters must be measured at at least three evenly distributed sampling points. Piggery environmental conditions are typically characterized by parameters such as ammonia concentration, sulfur dioxide concentration, light intensity, temperature, and humidity. Two or more sensors measuring these parameters should be symmetrically and evenly distributed at each sampling point to reliably and accurately capture the environmental status of the area.
[0054] In this embodiment, the steps for obtaining the collected value in step S2 are:
[0055] S2.1: According to the set sampling period, each sensor samples the environmental parameters N times continuously to obtain a set of sampling data x1, x2, ..., x N ;
[0056] S2.2: Perform average processing on the N sampling data collected by each sensor and calculate the average value x of these sampling data i,j , whose expression is: in, is the value collected by the sensor for the kth time, x i,j is the sampling value of the sensor at position j in sampling point i.
[0057] In this embodiment, step S3 is to perform data fusion on the same environmental parameter values collected by multiple sensors in the same area, calculate the sample median and absolute deviation value, and determine whether there is a sensor with abnormal deviation by MAD (median absolute difference) method.
[0058] S3.1: The measured values of the same environmental parameters at all sampling points in the same area are grouped into a data sample X, where X = [x ij ]; i = 1, 2…m, j = 1, 2…n, where i is the number of the sampling point, j is the number of the same type of sensor in each sampling point, m is the number of sampling points in a single area, and n is the number of sensors of the same type in a single sampling point;
[0059] S3.2: Sort the data sample X and calculate its median x med , whose expression is x med=median(X), and through the formula x ad =[|x i,j -x med |]; i = 1, 2…m, j = 1, 2…calculate the absolute deviation of each data from the median;
[0060] S3.3: For all absolute deviation values x ad Sort and calculate the median to get the MAD value, which is expressed as MAD=median(x ad ), where median is the median;
[0061] S3.4: Based on the obtained MAD value, analyze whether the sensor is working abnormally. If the deviation between the sampling value of a sensor and the median exceeds 3 times the MAD value, the expression is: |x i,j -x med |>3MAD, the sensor is identified as abnormal.
[0062] It's important to note that when monitoring the environment of piggeries, environmental parameters at different sampling points within the same area should generally remain relatively consistent and stable. Under normal circumstances, environmental parameters (such as temperature, humidity, and gas concentrations) vary slightly and don't fluctuate significantly over short periods of time. However, when a sensor fails or experiences performance degradation, the environmental parameter values measured by that sensor may deviate significantly from those measured by other, functioning sensors. This abnormal deviation is often a sign of sensor failure.
[0063] Specifically, the present invention adopts multi-sensor data fusion technology, and uses the measurement values of multiple identical environmental parameters at multiple sampling points for comprehensive analysis. In this process, the median absolute difference (MAD) value of the measurement values of each sensor is calculated. MAD is a powerful statistical tool used to measure the degree of dispersion of each measurement value in a data set. Compared with the average value, MAD is more robust in dealing with outliers and can more effectively resist the influence of extreme values. Therefore, by analyzing the MAD value of each sensor, it is possible to accurately identify those sensors that show significant deviations, that is, sensors that may be faulty. Once it is found that the measurement value of a certain sensor deviates significantly from that of other sensors, the system will automatically trigger further diagnostic processes to confirm whether the sensor needs to be repaired or replaced. In this way, the system can detect potential sensor failures at an early stage, avoid inaccurate environmental monitoring due to sensor failure, and ensure stable monitoring and control of pig house environmental parameters. The specific steps and methods of the entire diagnostic process are as follows: Figure 2 As shown, this not only improves the reliability of the system, but also reduces the necessity of manual intervention, making pig house environmental monitoring more intelligent and efficient.
[0064] In this embodiment, step S4 is a step of comparing and analyzing the measurement results of sensors in each area based on the gas concentration characteristics and gas flow characteristics in different areas.
[0065] S4.1: Determine the gas concentration characteristics of different areas within the piggery based on their functions and layout, and collect gas concentration data for each area using sensors located within the area.
[0066] In a building-based piggery, different types of gases are generated in different ways. For example, ammonia (or hydrogen sulfide) in a piggery primarily originates from pig excrement. Therefore, under normal circumstances, ammonia (or hydrogen sulfide) concentrations in defecation areas should be higher than in other areas. This characteristic can be used to determine whether the sensor is functioning properly.
[0067] Specifically, if the measurement value of one (or some) ammonia (or other gas such as hydrogen sulfide) concentration sensor in the defecation area is lower than the measurement value of other ammonia (or other gas such as hydrogen sulfide) concentration sensors in the area and lower than the measurement value of multiple sensors in the eating area, it indicates that the ammonia (or other gas such as hydrogen sulfide) sensor in the defecation area may be faulty. Similarly, if the measurement value of one (or some) ammonia (or other gas such as hydrogen sulfide) concentration sensor in the eating area is higher than the measurement value of other ammonia (or other gas such as hydrogen sulfide) concentration sensors in the area and higher than the measurement value of multiple sensors in the defecation area, it indicates that the ammonia (or hydrogen sulfide) sensor in the eating area may be malfunctioning.
[0068] S4.2: Compare and analyze the gas concentration data collected by sensors in each area at the same time point and analyze the dynamic changes of the measured values in each area in combination with the flow characteristics of the gas. Finally, based on the results of the comparative analysis, identify whether there are any abnormal sensors.
[0069] In this embodiment, in step S5, the continuous sampling values of each sensor within a fixed time interval are monitored in real time. If the continuous sampling value of a certain sensor remains unchanged within the set time, the step of determining that the sensor is operating abnormally is as follows:
[0070] S5.1: Each sensor sets a fixed time interval Δt for data collection; during the set monitoring period, the sensor will continuously sample at these fixed time intervals and record multiple sampling values x1, x2, x3, ..., x N , where N is the total number of sampling times in the monitoring period;
[0071] S5.2: Monitor and compare the continuous sampling values of each sensor within a fixed time interval in real time to detect whether there are changes in these sampling values;
[0072] S5.3: If within the set monitoring time, all the continuous sampling values x1, x2, x3, ..., x N All remain the same and have not changed, that is, the condition x1=x2=x3=⋯⋯=x N , it is considered that the sensor cannot correctly perceive environmental changes.
[0073] In this embodiment, the comparison process in step S5.2 is to compare the results x of each sampling. t Whether the sampling values before and after it are the same, that is, judging whether x t =x t-1 =x t-2 =...=x1.
[0074] The embodiment adopts the following standards. Three sampling points are evenly set at different locations in the eating area, activity area, defecation area, and sleeping area of the pig house. In a single sampling point, two DHT11 digital temperature and humidity sensors, MG812 carbon dioxide sensors, MQ137 ammonia sensors, MQ136 hydrogen sulfide sensors, and LM393 light intensity sensors are set in a circular symmetry, that is, six sensors of each type are set in a single area. STM32 is used as the control server. Figure 3 shown.
[0075] A single sensor samples continuously for thirty times and takes the average value as the collected value. The expression is:
[0076] Example 1: Positions 2 and 5 of the three sampling points in the piggery feeding area are set as ammonia concentration sensors. If the six ammonia sensors at the three sampling points are working normally, the sampling values are shown in Table 1.
[0077] Table 1 Ammonia sampling values when all sensors are working normally (unit: mg / m 3 )
[0078] sensor <![CDATA[x 1,2 ]]> <![CDATA[x 1,5 ]]> <![CDATA[x 2,2 ]]> <![CDATA[x 2,5 ]]> <![CDATA[x 3,2 ]]> <![CDATA[x 3,5 ]]> Sample value 0.093 0.092 0.093 0.92 0.093 0.094
[0079] Set the three sampling points 2 and 5 in the piggery feeding area as ammonia concentration sensors. The steps are as follows:
[0080] 1.1 Combine the sampling values of the six ammonia sensors at these three sampling points into a data sample X (unit, mg / m 3 )X=[0.093, 0.092, 0.093, 0.92, 0.093, 0.094], and sort the obtained data samples X (unit, mg / m 3 )X=[0.092, 0.092, 0.093, 0.093, 0.093, 0.094];
[0081] 1.2 Calculate the sample median, x med =median(X), and since the number of data is 6 (even number), the median is the average of the 3rd and 4th data (unit, mg / m 3 ), whose expression is:
[0082] 1.3 Calculate the absolute deviation of each data from the median (unit: mg / m 3 ), which is expressed as follows:
[0083] x ad =[|x i,j -x med |]
[0084] x ad =[|0.092-0.093|,|0.092-0.093|,|0.093-0.093|,|0.093-0.093|,|0.093-0.093|,|0.093-0.093|,|0.093-0.093|,|0.094-0.093|]
[0085] x ad =[0.001, 0.001, 0, 0, 0, 0.001];
[0086] 1.4 Calculation of MAD value (unit, mg / m 3 )MAD=median(x ad ), sort the absolute deviations after obtaining the MAD value (unit, mg / m 3 )x ad =[0.001, 0.001, 0, 0, 0, 0.001], and since the number of absolute deviations is 6 (an even number), MAD is the average of the third and fourth data, and its expression is:
[0087] 1.5 Identifying samples with excessive deviation
[0088] Check whether the deviation between each sample value and the median exceeds 3 times the MAD value, that is, whether it satisfies: |x i,j -x med |≤3MAD. In this case, all sampling values meet the above conditions, indicating that the six sensors at the three sampling points in the area are working normally.
[0089] Example 2: A faulty ammonia sensor is placed at position 5, and the sampling values are shown in Table 2.
[0090] Table 2: Sampling values collected by the system when a sensor fails (unit: mg / m 3 )
[0091] sensor <![CDATA[x 1,2 ]]> <![CDATA[x 1,5 ]]> <![CDATA[x 2,2 ]]> <![CDATA[x 2,5 ]]> <![CDATA[x 3,2 ]]> <![CDATA[x 3,5 ]]> Sample value 0.093 0.092 0.093 0.15 0.093 0.094
[0092] 2.1 Combine the ammonia concentration data collected at each sampling point into a data sample X (unit, mg / m3) X = [0.093, 0.092, 0.093, 0.15, 0.093, 0.094], then sort the data sample to obtain X = [0.092, 0.093, 0.093, 0.093, 0.094, 0.15];
[0093] 2.2 Calculate the sample median x med =median(X) Since the number of data is 6 (even number), the median is the average of the 3rd and 4th data (unit, mg / m 3 ),Right now
[0094] 2.2 Calculate the absolute deviation of each data from the median (unit: mg / m 3 ) Its expression is: x ad =[|x i,j -x med |]
[0095] x ad =[|0.092-0.093|, 0.093-0.093|, |0.093-0.093|, |0.093-0.093|, |0.094-0.093||, |0.15-0.093|]
[0096] x ad =[0.001, 0, 0, 0.001, 0, 0.057];
[0097] 2.4 Calculation of MAD value (unit, mg / m 3 ), sort the absolute deviation values, and the result is MAD=median(x ad ) and sort the absolute deviations (unit, mg / m 3 )x ad =[0, 0, 0, 0.01, 0.001, 0.057], and since the number of absolute deviations is 6 (an even number), MAD is the average of the third and fourth data (unit, mg / m 3 ), whose expression is:
[0098] 2.5 Identifying samples with excessive deviation |x 2,5 -x med |=|0.15-0.093|=0.057>3MAD, according to the calculation, we can get x 2,5This is a sample with too large deviation, that is, the sensor corresponding to position 5 of sampling point 2 is working abnormally.
[0099] Example 3: Determining whether parameters are abnormal based on some gas characteristics
[0100] Ammonia is primarily produced by pig excrement. Therefore, under normal circumstances, the sampling value of the ammonia concentration sensor in the defecation area should be higher than that in other areas. If the measurement value of the ammonia concentration sensor in a certain area is higher than the measurement values of other ammonia sensors in the area and higher than the measurement value in the defecation area, it may indicate that the sensor is abnormal.
[0101] When a sensor in the eating area fails, the system collects ammonia concentration sampling values in the eating area and the defecation area, as shown in Table 3.
[0102] Table 3 Sampling values of an ammonia sensor in the eating area when it fails (unit: mg / m 3 )
[0103] Feeding area sensor <![CDATA[x 1,2 ]]> <![CDATA[x 1,5 ]]> <![CDATA[x 2,2 ]]> <![CDATA[x 2,5 ]]> <![CDATA[x 3,2 ]]> <![CDATA[x 3,5 ]]> Sample value 0.093 0.092 1.630 0.092 0.093 0.094 Defecation area sensor <![CDATA[x 1,2 ]]> <![CDATA[x 1,5 ]]> <![CDATA[x 2,2 ]]> <![CDATA[x 2,5 ]]> <![CDATA[x 3,2 ]]> <![CDATA[x 3,5 ]]> Sample value 1.334 1.335 1.334 1.333 1.334 1.334
[0104] Comparison revealed that the measurement value of a sensor in the eating area (sampling point 2, position 2) was abnormally higher than that of other similar sensors in the eating area and higher than that of all defecation areas. This clearly does not conform to the normal distribution of ammonia concentrations. Therefore, it was determined that the sensor in the eating area was abnormal.
[0105] When there is a sensor that does not work properly in the defecation area, the sampling values measured in the eating area and the defecation area are shown in Table 4.
[0106] Table 4 Sampling values when an ammonia sensor fails in the defecation area (unit: mg / m 3 )
[0107]
[0108]
[0109] The sampling value of the ammonia concentration sensor at position 5 of sampling point 2 in the defecation area is lower than the measurement value of similar sensors in the area and lower than the sampling value of ammonia concentration sensors in all eating areas. It is determined that the sensor parameters are abnormal.
[0110] Example 4: Determining whether parameters are abnormal based on gas flow characteristics
[0111] Because gas is fluid and pig activity constantly generates and exacerbates gas flow, gas detection values at the same location will not remain constant for long periods of time. An ammonia sensor is located at sampling point 3, position 1, in the activity area. When the sensor is functioning properly, the measured values for ten consecutive hours are shown in Table 5.
[0112] Table 5 Sampling values of ammonia sensor No. 1 at sampling point 3 when it is working normally for ten consecutive hours (unit: mg / m 3 )
[0113]
[0114] As can be seen from Table 5, the sampling values of the sensor change with time and do not remain static, which means that the sensor works normally in ten consecutive samplings.
[0115] When the sensor does not work properly, the sampling values measured for ten consecutive hours are shown in Table 6.
[0116] Table 6 Sampling values for ten consecutive hours when the No. 1 ammonia sensor at sampling point 3 fails (unit: mg / m 3 )
[0117]
[0118] From Table 6, we can get:
[0119] As can be seen from Table 6, the sensor’s sampling value remained unchanged in ten consecutive samplings with an interval of one hour, and was always 0.009 mg / m 3 From this, we can judge that the parameters of the sensor are abnormal and there may be a fault.
[0120] The present invention is not limited to the above-described embodiments. Any structural changes made under the guidance of the present invention, which have the same or similar technical solutions as the present invention, should be understood to fall within the scope of protection of the present invention. The technologies, shapes, and structural parts not described in detail in the present invention are all well-known technologies.
Claims
1. A self-diagnosis method for sensors in an intelligent monitoring system for the environmental status of a building pig house, characterized in that: The following steps are involved: S1: Sensors are placed in the feeding area, activity area, defecation area and sleeping area of the pig house to collect various environmental parameters in real time; S2: Among the arranged sensors, each sensor continuously samples N times according to the set sampling period, and averages the sampled data, taking the average value as the collected value; S3: Perform data fusion on the same environmental parameter values collected by multiple sensors in the same area, calculate the sample median and MAD value, and use the MAD method to determine whether there are sensors with abnormal deviations; S4: Compare and analyze the measurement results of sensors in each area according to the characteristics of gas concentration and gas flow in different areas; S5: Monitor the continuous sampling values of each sensor within a fixed time interval in real time. If the continuous sampling value of a sensor remains unchanged within the set time, the sensor is judged to be abnormal.
2. The self-diagnosis method of a sensor in an intelligent monitoring system for the environmental status of a building pig house according to claim 1, characterized in that: The sensors in step S1 include but are not limited to DHT11 digital temperature and humidity sensor, MG812 carbon dioxide sensor, MQ137 ammonia sensor, MQ136 hydrogen sulfide sensor, LM393 light intensity sensor, and the sensors are symmetrically arranged at each sampling point in the pig house.
3. The self-diagnosis method of a sensor in an intelligent monitoring system for the environmental status of a building pig house according to claim 1, characterized in that: The steps for obtaining the collected value in step S2 are: S2.1: According to the set sampling period, each sensor samples the environmental parameters N times continuously to obtain a set of sampling data x1, x2, ..., x N ; S2.2: Average the N sampling data collected by each sensor and calculate the average value x of these sampling data i,j , whose expression is: in, is the value collected by the sensor for the kth time, x i,j is the sampling value of the sensor at position j in sampling point i.
4. The self-diagnosis method of a sensor in an intelligent monitoring system for the environmental status of a building pig house according to claim 1, characterized in that: Step S3 is to fuse the same environmental parameter values collected by multiple sensors in the same area, calculate the sample median and absolute deviation value, and determine whether there is a sensor with abnormal deviation by MAD (median absolute difference) method: S3.1: The measured values of the same environmental parameters at all sampling points in the same area are grouped into a data sample X, where X = [x i,j ]; i = 1, 2…m, j = 1, 2…n, where i is the number of the sampling point, j is the number of the same type of sensor in each sampling point, m is the number of sampling points in a single area, and n is the number of sensors of the same type in a single sampling point; S3.2: Sort the data sample X and calculate its median x med , whose expression is x med = median(X), and by the formula x ad =[|x i,j -x med |]; i = 1, 2…m, j = 1, 2…calculate the absolute deviation of each data from the median; S3.3: For all absolute deviation values x ad Sort and calculate the median to get the MAD value, which is expressed as MAD = median (x ad ), where median is the median; S3.4: Analyze whether the sensor is working abnormally based on the obtained MAD value.
5. The self-diagnosis method of a sensor in an intelligent monitoring system for the environmental status of a building pig house according to claim 4, characterized in that: In step S3.4, if the deviation between the sampling value of a sensor and the median exceeds 3 times the MAD value, the expression is: i,j -x med |>3MAD, the sensor is identified as working abnormally.
6. The self-diagnosis method of sensors in the intelligent monitoring system of building pig house environment status according to claim 1 is characterized in that: Step S4 is a step of comparing and analyzing the measurement results of sensors in each area according to the characteristics of gas concentration and gas flow characteristics in different areas: S4.1: According to the functions and layout of each area in the pig house, determine the gas concentration characteristics in different areas and collect gas concentration data in each area using the arranged sensors; S4.2: Compare and analyze the gas concentration data collected by the sensors in each area at the same time point and analyze the dynamic changes of the measured values in each area in combination with the flow characteristics of the gas. Finally, based on the results of the comparative analysis, identify whether there are abnormal sensors.
7. The self-diagnosis method of sensors in the intelligent monitoring system of building pig house environment status according to claim 1 is characterized in that: In step S5, the continuous sampling values of each sensor within a fixed time interval are monitored in real time. If the continuous sampling value of a sensor remains unchanged within the set time, the sensor is judged to be abnormal in the following steps: S5.1: Each sensor sets a fixed time interval Δt for data collection; within the set monitoring period, the sensor will continuously sample at these fixed time intervals and record multiple sampling values x1, x2, x3,..., x N , where N is the total number of sampling times in the monitoring period; S5.2: Monitor and compare the continuous sampling values of each sensor within a fixed time interval in real time to detect whether there are changes in these sampling values; S5.3: If within the set monitoring time, all the continuous sampling values x1, x2, x3, ..., x N All remain the same and do not change, that is, the condition x1=x2=x3=┅┅=x N , it is considered that the sensor cannot correctly perceive environmental changes.
8. The self-diagnosis method of sensors in the intelligent monitoring system of building pig house environment status according to claim 7 is characterized in that: The comparison process in step S5.2 is to compare the results x of each sampling t Whether the sampling values before and after it are the same, that is, judging whether x t =x t-1 =x t-2 =...=x1.
Citation Information
Patent Citations
Sensor abnormal data identification method based on mathematical statistics
CN112528227A
Sensing network sensor fault positioning method, system, equipment and medium
CN114707632A
Intelligent pig house monitoring system
CN115349459A
Pig house system operation monitoring method and device based on Internet of Things and medium
CN118626980A
using Non-contact Information Detection Sensor
KR102347874B1
