Cattle breeding environment monitoring method, system and equipment based on data analysis
By installing sensors at multiple locations in the cattle farm, collecting ammonia and hydrogen sulfide concentration data and performing data analysis, the problem of difficulty in detecting the cattle breeding environment is solved, and accurate monitoring and abnormal identification of the cattle breeding environment is achieved, which improves the breeding benefits and the health of the cattle.
Patent Information
- Application Number
- CN202510040365.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-10
AI Technical Summary
It is difficult to detect the existing cattle breeding environment, especially when the living conditions of the cattle are different and the environment is affected by airflow, it is difficult to conduct accurate abnormal detection.
By installing sensors at multiple locations in the cattle farm, the ammonia and hydrogen sulfide concentration data are collected in real time, and data analysis methods are adopted, including sliding window processing, target window screening, data monitoring lag calculation and cattle life parameter evaluation, to monitor and analyze the cattle breeding environment.
Accurate monitoring of the cattle breeding environment is achieved, abnormal situations in the environment can be effectively identified, breeding benefits are improved, and the health of cattle is ensured.
Smart Images

Figure CN119475193B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a cattle breeding environment monitoring method, system and equipment based on data analysis. Background Art
[0002] Monitoring the cattle breeding environment is an important means to ensure the health of cattle and improve breeding efficiency. Data analysis can help monitor and optimize the cattle shed environment and improve breeding efficiency in many ways. The cattle breeding site environment is complex. If the cattle do not clean up or handle the feces improperly after defecation, the organic matter in the feces will be decomposed by microorganisms to release harmful gases such as ammonia and hydrogen sulfide. Therefore, it is necessary to install sensors in the cattle breeding environment to collect the ammonia and hydrogen sulfide concentrations in the breeding environment in real time for environmental monitoring.
[0003] In order to detect the cattle breeding environment, sensors are installed at different locations in the cattle breeding environment to collect real-time ammonia and hydrogen sulfide concentration time series in the breeding environment for environmental monitoring. However, since the living conditions of cattle in different locations in the breeding environment are different, and the environment in each location is affected by airflow, etc., resulting in different living conditions of cattle in each location, it is more difficult to detect abnormalities. Summary of the invention
[0004] In order to solve the technical problem that the existing cattle breeding environment detection is difficult, the purpose of the present invention is to provide a cattle breeding environment monitoring method, system and equipment based on data analysis. The technical scheme adopted is as follows:
[0005] In a first aspect of the present invention, a method for monitoring a cattle breeding environment based on data analysis is provided, comprising:
[0006] Obtaining ammonia concentration sequences and hydrogen sulfide concentration sequences at multiple locations in a cattle farm;
[0007] Sliding windows are performed on the ammonia concentration sequence and the hydrogen sulfide concentration sequence according to preset window sizes to obtain multiple ammonia concentration window data sets and multiple hydrogen sulfide concentration window data sets respectively;
[0008] According to the data change relationship between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window of the target position, a target window of the target position is obtained by screening; the target position is any position;
[0009] The data monitoring hysteresis of the target position is obtained according to the difference between the target window of the target position and the data at the association time of other positions; the association time is the same sampling time of the target window at other positions;
[0010] According to the data monitoring hysteresis of the target location, the life parameters of the cattle at the target location are obtained, and the life parameters of the cattle represent the life conditions of the cattle at the target location;
[0011] Based on the life parameters of cattle at various locations, the environmental risk factors at each moment are obtained to monitor the cattle breeding environment.
[0012] In one embodiment, according to the data change relationship between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target location, the target window at the target location is screened and obtained, including:
[0013] Obtaining a slope comparison factor for each window at the target location according to a difference in data change amplitude between an ammonia concentration window data set and a hydrogen sulfide concentration window data set for each window at the target location;
[0014] According to the data size relationship at each moment in the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target position, the confusion factor of each window at the target position is obtained;
[0015] According to the size relationship between the slope comparison factor and the confusion factor of each window, the target window of the target position is screened.
[0016] In one embodiment, according to the data change amplitude difference between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target position, the slope comparison factor of each window at the target position is obtained, including:
[0017]
[0018] in, The target location windows, The target location The jth data of the window, is the number of data points in the window, The target location The slope comparison factor for each window, The target location The change rate of hydrogen sulfide concentration of the jth data in the window, The target location The change rate of ammonia concentration of the jth data in the window, The target location The average value of the change rate of hydrogen sulfide concentration and the change rate of ammonia concentration of the jth data in the window, is a normalization function.
[0019] In one embodiment, the confusion factor of each window at the target location is obtained according to the data size relationship at each moment in the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target location, including:
[0020] Get the target location The median of the ammonia concentration window data set and the hydrogen sulfide concentration window data set for each window;
[0021] Get the target location the number of moments in a window that meet a preset condition, wherein the moment that meets the preset condition is: the ammonia concentration and the hydrogen sulfide concentration at the moment are respectively located on both sides of the median;
[0022] Calculate the number of times that meet the preset condition and the The ratio of the total number of moments in the windows is taken as the The confusion factor of the window.
[0023] In one embodiment, the target window of the target position is obtained by screening according to the size relationship between the slope comparison factor and the confusion factor of each window, including:
[0024] A window satisfying a preset condition is obtained as the target window, wherein the window satisfying the preset condition is a window whose slope comparison factor is greater than the confusion factor.
[0025] In one embodiment, obtaining the data monitoring hysteresis of the target location according to the difference between the target window of the target location and the data at the association time of other locations includes:
[0026] According to the ammonia concentration and hydrogen sulfide concentration at the target location, respectively, the following single data type hysteresis acquisition process is adopted to acquire the ammonia concentration data hysteresis corresponding to the ammonia concentration at the target location and the hydrogen sulfide concentration data hysteresis corresponding to the hydrogen sulfide concentration at the target location;
[0027] The process of obtaining the hysteresis of a single data type includes:
[0028] Obtaining a cross-correlation function between the data of the nth target window at the target position and the associated time of each other position, obtaining a period difference between the data of the nth target window and the associated time of each other position according to the cross-correlation function, and obtaining a comprehensive period difference;
[0029] Obtain the difference between each data of the nth target window of the target position and the data at the associated time of each other position, and obtain the comprehensive numerical difference;
[0030] Calculate the product of the comprehensive period difference and the comprehensive value difference of the nth target window at the target position to obtain the window data hysteresis of the nth target window at the target position;
[0031] Calculate the average of the window data hysteresis of all target windows at the target position and normalize them to obtain the single data type hysteresis of the target position;
[0032] The average values of the ammonia concentration data hysteresis and the hydrogen sulfide concentration data hysteresis corresponding to the ammonia concentration at the target position are calculated to obtain the data monitoring hysteresis of the target position.
[0033] In one embodiment, the hysteresis of the data at the target location is monitored to obtain the life parameters of the cattle at the target location, including:
[0034] Acquire the difference between the number of target windows and the number of non-target windows at the target position, where the non-target windows are other windows at the target position except the target window;
[0035] According to the hysteresis of the ammonia concentration data at the target location and the quantity difference, a first cattle life parameter corresponding to the ammonia concentration at the target location is obtained; the first cattle life parameter is proportional to the hysteresis of the ammonia concentration data and inversely proportional to the quantity difference;
[0036] According to the hysteresis of the hydrogen sulfide concentration data at the target location and the quantity difference, a second cattle life parameter corresponding to the hydrogen sulfide concentration at the target location is obtained; the second cattle life parameter is proportional to the hysteresis of the hydrogen sulfide concentration data and inversely proportional to the quantity difference;
[0037] The average value of the first cattle life parameter and the second cattle life parameter is calculated to obtain the cattle life parameter at the target location.
[0038] In one embodiment, based on the cattle life parameters at various locations, the environmental risk factors at various times are obtained to monitor the cattle breeding environment, including:
[0039] According to the absolute value of the difference between each ammonia concentration in the ammonia concentration sequence at the target position and its adjacent previous ammonia concentration, and the absolute value of the difference between each hydrogen sulfide concentration in the hydrogen sulfide concentration sequence at the target position and its adjacent previous hydrogen sulfide concentration, the data surge factor at each moment of the target position is obtained;
[0040] The following calculation formula is used to obtain the environmental risk factor at each moment:
[0041]
[0042] Among them, z is the zth moment, is the environmental risk factor at the zth moment, Indicates Locations, represents the number of positions, It is The data surge factor at the zth moment of the position, Indicates The life parameters of cattle at each location, is the normalization function;
[0043] The environmental risk factors at each moment are compared with the preset environmental risk factor threshold. If a preset number of consecutive environmental risk factors are greater than the preset environmental risk factor threshold, it is determined that the cattle breeding environment is abnormal.
[0044] In the second aspect of the present invention, a cattle breeding environment monitoring system based on data analysis is provided, comprising: a memory and a processor; the memory is connected to the processor; the memory is used to store program instructions; the processor is used to implement the above-mentioned cattle breeding environment monitoring method based on data analysis when the program instructions are executed.
[0045] In the third aspect of the present invention, a cattle breeding environment monitoring device based on data analysis is provided, including a computer-readable storage medium, the computer-readable storage medium storing a computer program, and the computer program, when executed by a processor, implements the steps in the above-mentioned cattle breeding environment monitoring method embodiment based on data analysis.
[0046] The present invention has the following beneficial effects: in order to monitor the cattle breeding environment based on data analysis, ammonia concentration sequences and hydrogen sulfide concentration sequences are obtained by setting a plurality of positions in the cattle breeding environment, firstly, sliding window processing is performed on the ammonia concentration sequence and the hydrogen sulfide concentration sequence in the cattle breeding environment, and according to the data change relationship between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window, the target window in each position is screened and obtained, and the target window is the data object for subsequent key analysis, and according to the difference between the target window of the target position and the data at the associated moments of other positions, the data monitoring hysteresis of the target position is obtained, and then according to the data monitoring hysteresis of the target position, the cattle life parameters of the target position are obtained, based on this method, the cattle life conditions at each position can be obtained, and the environmental risk factors at each moment are obtained by comprehensively considering the cattle life conditions at each position, so as to accurately monitor the cattle breeding environment, and solve the technical problem that the existing cattle breeding environment detection is relatively difficult. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic structural diagram of the hardware execution part of a cattle breeding environment monitoring method based on data analysis provided by one embodiment of the present invention;
[0048] Figure 2 A flow chart of a cattle breeding environment monitoring method based on data analysis provided by one embodiment of the present invention;
[0049] Figure 3 is the flowchart of step 3;
[0050] Figure 4 is a flow chart of the process of obtaining the confusion factor;
[0051] Figure 5 A flowchart of the process of obtaining hysteresis of a single data type;
[0052] Figure 6 Flow chart of the process of obtaining cattle life parameters. DETAILED DESCRIPTION
[0053] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0054] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0055] In the process of raising cattle, cattle will defecate, urinate, etc. If the feces are not cleaned in time, the high temperature environment will help the volatilization of ammonia and hydrogen sulfide. In the process of raising cattle, it is necessary to monitor the concentration of ammonia and hydrogen sulfide in the environment at all times. When the concentration of ammonia and hydrogen sulfide is too high, it may cause respiratory diseases in cattle and have a negative impact on the health of cattle. Therefore, it is necessary to monitor the cattle breeding environment according to the ammonia and hydrogen sulfide concentrations collected by sensors.
[0056] This embodiment provides a cattle breeding environment monitoring method based on data analysis. The hardware execution part of the cattle breeding environment monitoring method includes an environment monitoring device and a data processor. Figure 1 As shown, the environmental monitoring device is electrically connected to the data processor. Environmental monitoring devices are set at multiple locations in the cattle breeding farm. The number of locations and the specific selection of each location are set according to actual needs. In addition, the environmental monitoring device includes an ammonia sensor and a hydrogen sulfide sensor, the ammonia sensor is used to detect the ammonia concentration at the corresponding location, and the hydrogen sulfide sensor is used to detect the hydrogen sulfide concentration at the corresponding location. The data processor is used to perform data processing according to the received ammonia concentration and hydrogen sulfide concentration to monitor the cattle breeding environment.
[0057] like Figure 2 As shown, the cattle breeding environment monitoring method comprises the following steps:
[0058] Step 1: Obtain ammonia concentration sequences and hydrogen sulfide concentration sequences at multiple locations in a cattle farm.
[0059] Each position obtains the ammonia concentration sequence and hydrogen sulfide concentration sequence of that position. The sampling period of the sensor is set according to actual needs, and the sampling period and each sampling moment (hereinafter referred to as moment) of all positions are the same, that is, for each moment, the ammonia concentration and hydrogen sulfide concentration of all positions at that moment can be obtained. Therefore, for the same time period, the number of data in the ammonia concentration sequence and the hydrogen sulfide concentration sequence is the same.
[0060] Step 2: Slide the ammonia concentration sequence and the hydrogen sulfide concentration sequence according to the preset window size to obtain multiple ammonia concentration window data sets and multiple hydrogen sulfide concentration window data sets respectively.
[0061] The implementer sets a suitable window size (i.e., window length) according to the actual situation, and slides the window for the ammonia concentration sequence and hydrogen sulfide concentration sequence at each position according to the preset window size. For any ammonia concentration sequence, multiple ammonia concentration window data sets corresponding to the ammonia concentration sequence are obtained, and for any hydrogen sulfide concentration sequence, multiple hydrogen sulfide concentration window data sets corresponding to the hydrogen sulfide concentration sequence are obtained. Therefore, multiple windows are obtained at each position, and one window includes an ammonia concentration window data set and a hydrogen sulfide concentration window data set. Among them, the sliding window step size is set according to actual needs. In this embodiment, the sliding window step size is set to the window length. Therefore, it is equivalent to dividing the ammonia concentration sequence and the hydrogen sulfide concentration sequence into multiple subsequences, and the length of each subsequence is the window length.
[0062] Step 3: According to the data change relationship between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target position, the target window at the target position is screened and obtained.
[0063] It is common sense that the concentrations of ammonia and hydrogen sulfide at different locations in the farm will be different due to ventilation, temperature, humidity and other reasons, and the living time of cattle in different locations is different, so it is necessary to divide the living conditions of cattle. Due to the change of humidity in various parts of the cattle breeding site, humidity has a direct impact on the adsorption and dissolution of gases, especially ammonia. When the humidity is high, ammonia may combine with water to form ammonia water, changing its concentration. In addition, too high or too low humidity may affect the sensitivity and accuracy of the sensor. For the living conditions of cattle, there are various functional areas in the cattle breeding area, including cattle sheds, feeding areas, eating areas and excretion areas. Different functional areas have different pollution control due to different living conditions of cattle in them, and the concentration changes of ammonia and hydrogen sulfide in different functional areas are quite different due to different temperature and humidity conditions. For example, the excretion area is relatively humid, so the concentration changes between ammonia and hydrogen sulfide will be affected by humidity, and the cowshed part is generally semi-closed for the rest of cattle, etc., and airflow will cause the concentrations of ammonia and hydrogen sulfide to fluctuate greatly, and so on. Therefore, it is necessary to analyze the living conditions of cattle based on the data from various sensors.
[0064] For ease of explanation, the target position is set to be any position. According to the data change relationship between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target position, the target window is screened from multiple windows at the target position.
[0065] In an exemplary embodiment, Figure 3 As shown, step 3 includes the following sub-steps:
[0066] Step 3-1: Obtain the slope comparison factor of each window at the target location according to the data change amplitude difference between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target location.
[0067] Specifically: the slope comparison factor is calculated using the following calculation formula:
[0068]
[0069] in, The target location windows, The target location The jth data of the window, is the number of data points in the window, The target location Slope comparison factor for each window.
[0070] The target location The hydrogen sulfide concentration change rate of the jth data in the window is the corresponding hydrogen sulfide concentration change amplitude. In an exemplary embodiment, the hydrogen sulfide concentration change rate is specifically the hydrogen sulfide concentration change slope. Then, it is necessary to fit the target position to the jth data by curve fitting. The hydrogen sulfide concentration window data set corresponding to each window is subjected to curve fitting, and then the slope of each data point in the curve can be obtained as the slope of the hydrogen sulfide concentration change of each data point.
[0071] The target location The ammonia concentration change rate of the jth data in the window is the ammonia concentration change rate. Similarly, the ammonia concentration change rate is the corresponding ammonia concentration change amplitude. In an exemplary embodiment, the ammonia concentration change rate is specifically the ammonia concentration change slope. Then, it is necessary to fit the ammonia concentration of the target position by curve fitting. By performing curve fitting on the ammonia concentration window data set corresponding to each window, the slope of each data point in the curve can be obtained as the ammonia concentration change slope of each data point.
[0072] The target location The average value of the change rate of hydrogen sulfide concentration and the change rate of ammonia concentration of the jth data in the window, that is, and The average value of .
[0073] In this embodiment It is a normalization function. The specific normalization method is set according to actual needs, such as linear normalization.
[0074] The larger the value, the greater the slope of the j-th data point on the hydrogen sulfide concentration window data set is compared with the j-th data point on the ammonia concentration window data set, and the increase and decrease are the same. The sum of all data points is calculated and normalized to obtain the j-th data point at the target position. The slope comparison factor of the window, therefore, The larger the value, the higher the target position. The larger the slope comparison factor of the window.
[0075] Step 3-2: Obtain the confusion factor of each window at the target location according to the data size relationship at each moment in the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target location.
[0076] In an exemplary embodiment, Figure 4 As shown in Figure 2, the process of obtaining the confusion factor includes:
[0077] Step 3-2-1: Get the target location The median of the ammonia concentration window data set and the hydrogen sulfide concentration window data set for each window.
[0078] Specifically, according to the target location The ammonia concentration window data set and the hydrogen sulfide concentration window data set of the target location are combined to obtain a large data set. The data in the large data set are then sorted from large to small according to the values, and the median is found.
[0079] Step 3-2-2: Get the target location The number of moments that meet the preset conditions in a window, where the ammonia concentration and the hydrogen sulfide concentration at the moment are located on both sides of the median, respectively.
[0080] A condition is set, that is, the ammonia concentration and the hydrogen sulfide concentration are located on both sides of the median, that is, one of the ammonia concentration and the hydrogen sulfide concentration is greater than the median, and the other is less than the median. Accordingly, the time when the preset condition is met is: the ammonia concentration and the hydrogen sulfide concentration at this time are located on both sides of the median.
[0081] Since the target location A window includes multiple moments, then, to determine whether each moment satisfies the above conditions, that is, to find the number of moments where the ammonia concentration and the hydrogen sulfide concentration are respectively located on both sides of the median.
[0082] Step 3-2-3: Calculate the number of moments that meet the preset conditions and the The ratio of the total number of moments in the windows is taken as the The confusion factor of the window.
[0083] Calculate the The number of moments that meet the preset conditions in a window is The ratio of the total number of moments in the windows is used as the The confusion factor of the window.
[0084] Step 3-3: According to the relationship between the slope comparison factor and the confusion factor of each window, the target window of the target position is screened.
[0085] Each window of the target location is given a slope comparison factor and a confusion factor.
[0086] For the target location windows, compare The relationship between the slope comparison factor and the confusion factor of the window. If the slope comparison factor is greater than the confusion factor, it means that the first In each window, the concentration of hydrogen sulfide increases and decreases faster than that of ammonia, and the changes of the two are similar.
[0087] By comparing the slope comparison factor and the confusion factor of each window at the target position, the windows at the target position will be divided into two categories: the first category is: windows with a slope comparison factor greater than the confusion factor, and the second category is: windows with a slope comparison factor less than or equal to the confusion factor. The first category of windows at the target position is obtained, and the first category of windows is used as the target window at the target position. At the same time, the number of the first category of windows at the target position and the number of the second category of windows are obtained.
[0088] Step 4: According to the difference between the target window of the target position and the data at the associated time of other positions, the data monitoring hysteresis of the target position is obtained.
[0089] In order to analyze the living conditions of cattle at various locations, it is also necessary to analyze the data monitoring hysteresis of each location. Since ammonia and hydrogen sulfide are mainly produced by microorganisms in cattle after excretion and dispersed in the air, and since molecular diffusion movement takes time, the concentration rise in the drinking water and eating areas of the cattle house will be slower than that in the excretion area. And the cattle house will rise more slowly due to good ventilation, so it is necessary to compare the data rise of the target window at each location with the rise of other locations to obtain the data monitoring hysteresis of each location.
[0090] Set other positions to other positions except the target position. The target window of the target position includes multiple time points, and the time points of each position have a corresponding relationship. Set the associated time point to the sampling time point of other positions that is the same as the time point of the target window.
[0091] Since the target window of the target position includes two kinds of data, namely, ammonia concentration and hydrogen sulfide concentration, then, according to the ammonia concentration and hydrogen sulfide concentration of the target position, the following single data type hysteresis acquisition process is adopted to acquire the ammonia concentration data hysteresis corresponding to the ammonia concentration of the target position and the hydrogen sulfide concentration data hysteresis corresponding to the hydrogen sulfide concentration of the target position.
[0092] like Figure 5 As shown in the figure, the process of obtaining the hysteresis of a single data type includes:
[0093] Step 4-1: Obtain the cross-correlation function of the data at the associated time of the nth target window at the target position and other positions, obtain the period difference of the data at the associated time of the nth target window and other positions according to the cross-correlation function, and obtain the comprehensive period difference.
[0094] Set the nth target window of the target position to any target window of the target position. Get the association time of the nth target window of the target position and other positions.
[0095] The cross-correlation function of the data at the time of association between the nth target window at the target position and each other position is obtained, and the period difference of the data at the time of association between the nth target window and each other position is obtained according to the cross-correlation function. The period difference is obtained as follows:
[0096]
[0097] Among them, f(t) and g(t) represent two time series data, f(t) is fixed, g(t) slides on f(t), and there is a sliding time length when g (t) slides , so that f( ) and g(t+ ) is the largest. ) and g(t+ ) is the largest, which means that At the moment, the two time series data f(t) and g(t) are correlated, so the sliding time length is This is the desired period difference.
[0098] Therefore, the data at the associated moments of the nth target window at the target position and each of the other positions will obtain a period difference, and then the average of the period differences corresponding to the nth target window at the target position and all other positions is calculated, and the average is taken as the required comprehensive period difference.
[0099] Step 4-2: Obtain the difference between each data of the nth target window at the target position and the data at the associated time of each other position, and obtain the comprehensive numerical difference.
[0100] For each moment of the nth target window at the target position, the data of each other position at that moment will be obtained. Then, the target moment of the nth target window at the target position is set to any moment of the nth target window at the target position, and the absolute value of the difference between the data of the target moment of the nth target window at the target position and the data of each other position at that target moment is calculated, and the absolute value of the difference of each other position corresponding to the target moment is obtained, and then the average value of these absolute values of the difference is calculated to obtain the data difference corresponding to the target moment. Then the average value of the data difference corresponding to all moments of the nth target window at the target position is calculated, and the average value is the comprehensive numerical difference of the nth target window at the target position.
[0101] Step 4-3: Calculate the product of the comprehensive period difference and the comprehensive value difference of the nth target window at the target position to obtain the window data hysteresis of the nth target window at the target position.
[0102] Step 4-4: Calculate the average of the window data hysteresis of all target windows at the target location and normalize them to obtain the single data type hysteresis of the target location.
[0103] In an exemplary embodiment, the calculation formula for the hysteresis of a single data type is as follows:
[0104]
[0105] Where x is the xth position, is the single data type hysteresis corresponding to the yth data at the xth position, y is 1 or 2. When y is 1, it means that the data used in the calculation is ammonia concentration, and the single data type hysteresis obtained is ammonia concentration data hysteresis. When y is 2, it means that the data used in the calculation is hydrogen sulfide concentration, and the single data type hysteresis obtained is hydrogen sulfide concentration data hysteresis. N is the number of target windows at the xth position, is the comprehensive period difference corresponding to the yth data of the nth target window at the xth position, It is the comprehensive numerical difference corresponding to the y-th data of the n-th target window at the x-th position.
[0106] Therefore, when the data used for calculation is ammonia concentration, the above-mentioned single data type hysteresis acquisition process is adopted to obtain a single data type hysteresis, which is the ammonia concentration data hysteresis; when the data used for calculation is hydrogen sulfide concentration, the above-mentioned single data type hysteresis acquisition process is adopted to obtain a single data type hysteresis, which is the hydrogen sulfide concentration data hysteresis.
[0107] Finally, the average of the ammonia concentration data hysteresis and the hydrogen sulfide concentration data hysteresis corresponding to the ammonia concentration at the x-th position is calculated, and the average is the data monitoring hysteresis at the x-th position. Using the above process, the data monitoring hysteresis of each position is obtained.
[0108] The greater the data monitoring lag, the more delayed the value change at the corresponding position is compared to other positions.
[0109] Step 5: Monitor the hysteresis based on the data at the target location and obtain the cattle life parameters at the target location.
[0110] The data monitoring hysteresis of each location is analyzed to obtain the cattle life parameters of each location. The cattle life parameters represent the living conditions of the cattle at the corresponding location.
[0111] In an exemplary embodiment, Figure 6 As shown, a specific process of obtaining cattle life parameters is given as follows:
[0112] Step 5-1: Obtain the difference between the number of target windows and the number of non-target windows at the target position.
[0113] Step 5-2: According to the hysteresis of the ammonia concentration data and the quantity difference at the target location, the first cow life parameter corresponding to the ammonia concentration at the target location is obtained; the first cow life parameter is proportional to the hysteresis of the ammonia concentration data and inversely proportional to the quantity difference.
[0114] Step 5-3: According to the hysteresis and quantity difference of the hydrogen sulfide concentration data at the target location, the second cattle life parameter corresponding to the hydrogen sulfide concentration at the target location is obtained; the second cattle life parameter is proportional to the hysteresis of the hydrogen sulfide concentration data and inversely proportional to the quantity difference.
[0115] Step 5-4: Calculate the average value of the first cow life parameter and the second cow life parameter to obtain the cow life parameter at the target location.
[0116] The number of target windows and the number of non-target windows at the target position are obtained. The non-target windows are other windows at the target position except the target window, which correspond to the number of windows of the first category and the number of windows of the second category in the above step 3-3, respectively. Then, the absolute value of the difference between the number of target windows and the number of non-target windows at the target position is calculated.
[0117] The smaller the difference in number between the number of target windows and the number of non-target windows at the target location, the closer the number of target windows is to the number of non-target windows, indicating that the concentration changes of ammonia and hydrogen sulfide are similar and disordered, so the humidity of the surface sensor part is higher and the ventilation is better, so the living conditions of the cattle are better. The higher the hysteresis of ammonia concentration data and hydrogen sulfide concentration data, the better the living conditions of the cattle are in the drinking water and eating areas of the cowshed. Therefore, according to the hysteresis and quantity difference of ammonia concentration data at the target location, the first cattle living parameter corresponding to the ammonia concentration at the target location is obtained; the first cattle living parameter is proportional to the hysteresis of ammonia concentration data and inversely proportional to the quantity difference; according to the hysteresis and quantity difference of hydrogen sulfide concentration data at the target location, the second cattle living parameter corresponding to the hydrogen sulfide concentration at the target location is obtained; the second cattle living parameter is proportional to the hysteresis of hydrogen sulfide concentration data and inversely proportional to the quantity difference.
[0118] In an exemplary embodiment, the calculation formulas for the first cow life parameter and the second cow life parameter are given as follows:
[0119]
[0120] When y is equal to 1, is the first cow life parameter; when y is equal to 2, It is the first cattle life parameter. is the difference between the number of target windows and the number of non-target windows at the target location.
[0121] Therefore, by taking y equal to 1 and 2 respectively, we get two values, which are the life parameter of the first cow and the life parameter of the second cow.
[0122] Finally, the average values of the first cow life parameter and the second cow life parameter at the target location are calculated to obtain the cow life parameter at the target location.
[0123] Step 6: Based on the cattle life parameters at each location, obtain the environmental risk factors at each time to monitor the cattle breeding environment.
[0124] In an exemplary embodiment, the absolute value of the difference between each ammonia concentration in the ammonia concentration sequence of the target position and its adjacent previous ammonia concentration is calculated, specifically: the absolute value of the difference between the second ammonia concentration and the first ammonia concentration in the ammonia concentration sequence of the target position is calculated, the absolute value of the difference between the third ammonia concentration and the second ammonia concentration in the ammonia concentration sequence of the target position is calculated, the absolute value of the difference between the fourth ammonia concentration and the third ammonia concentration in the ammonia concentration sequence of the target position is calculated, and so on, the absolute value of the difference between the last ammonia concentration and the second to last ammonia concentration in the ammonia concentration sequence of the target position is calculated. It should be understood that since the first ammonia concentration does not have an adjacent previous ammonia concentration, the first ammonia concentration is taken as the absolute value of the difference with the adjacent previous ammonia concentration.
[0125] The absolute value of the difference between each hydrogen sulfide concentration in the hydrogen sulfide concentration sequence of the target position and its adjacent previous hydrogen sulfide concentration is calculated, specifically: the absolute value of the difference between the second hydrogen sulfide concentration and the first hydrogen sulfide concentration in the hydrogen sulfide concentration sequence of the target position is calculated, the absolute value of the difference between the third hydrogen sulfide concentration and the second hydrogen sulfide concentration in the hydrogen sulfide concentration sequence of the target position is calculated, the absolute value of the difference between the fourth hydrogen sulfide concentration and the third hydrogen sulfide concentration in the hydrogen sulfide concentration sequence of the target position is calculated, and so on, the absolute value of the difference between the last hydrogen sulfide concentration and the penultimate hydrogen sulfide concentration in the hydrogen sulfide concentration sequence of the target position is calculated. It should be understood that since the first hydrogen sulfide concentration does not have an adjacent previous hydrogen sulfide concentration, the first hydrogen sulfide concentration is taken as the absolute value of the difference with the adjacent previous hydrogen sulfide concentration.
[0126] The data surge factor at each moment of the target position is obtained using the following calculation formula:
[0127]
[0128] in, It is The data surge factor at the zth moment of the position, It is The ammonia concentration sequence at the target location The absolute value of the difference between an ammonia concentration and its adjacent previous ammonia concentration, It is The hydrogen sulfide concentration at the target location is ranked first in the sequence The absolute value of the difference between the first hydrogen sulfide concentration and the previous adjacent hydrogen sulfide concentration. The ammonia concentration and The moment corresponding to the hydrogen sulfide concentration is the zth moment.
[0129] The following calculation formula is used to obtain the environmental risk factor at each moment:
[0130]
[0131] Among them, z is the zth moment, is the environmental risk factor at the zth moment, represents the number of positions, Indicates Life parameters of cattle in different locations.
[0132] By adopting the above method, the environmental risk factors at each moment are obtained.
[0133] The higher the cattle living conditions, the longer the cattle live in the corresponding location, and the higher the possibility of the cattle being in danger. Therefore, when the cattle living conditions are higher and the environmental risk factor is higher, it means that the possibility of the cattle being in danger at the corresponding moment is higher, and the environmental risk factor at the corresponding moment is higher.
[0134] An environmental risk factor threshold is preset, and the specific value of the preset environmental risk factor threshold is set according to actual needs, such as 0.7.
[0135] Compare the environmental risk factors at each moment with the preset environmental risk factor threshold. If the preset number of environmental risk factors is greater than the preset environmental risk factor threshold, it is determined that the cattle breeding environment is abnormal. Among them, the continuous preset number is set according to actual judgment needs, such as 10. In an exemplary embodiment, the environmental risk factor at each moment is compared with 0.7, and it is marked when it is greater than 0.7. If it is marked for 10 consecutive moments, it indicates that the environment is abnormal. At this time, an alarm can be sent to the breeder so that the breeder can adopt relevant solutions in time.
[0136] In an exemplary embodiment, this embodiment also provides a cattle breeding environment monitoring system based on data analysis, including: a memory and a processor; the memory is connected to the processor, and the memory is used to store program instructions; the processor is used to implement the steps in the above-mentioned cattle breeding environment monitoring method embodiment based on data analysis when the program instructions are executed.
[0137] In an exemplary embodiment, the present invention provides a cattle breeding environment monitoring device based on data analysis, including: a computer-readable storage medium, the computer-readable storage medium storing a computer program, and the computer program, when executed by a processor, implements the steps in the above-mentioned cattle breeding environment monitoring method embodiment based on data analysis.
[0138] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0139] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A cattle breeding environment monitoring method based on data analysis, characterized in that: include: Obtaining ammonia concentration sequences and hydrogen sulfide concentration sequences at multiple locations in a cattle farm; Sliding windows are performed on the ammonia concentration sequence and the hydrogen sulfide concentration sequence according to preset window sizes to obtain multiple ammonia concentration window data sets and multiple hydrogen sulfide concentration window data sets respectively; According to the data change relationship between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window of the target position, a target window of the target position is obtained by screening; the target position is any position; The data monitoring hysteresis of the target position is obtained according to the difference between the target window of the target position and the data at the association time of other positions; the association time is the same sampling time of the target window at other positions; According to the data monitoring hysteresis of the target location, the life parameters of the cattle at the target location are obtained, and the life parameters of the cattle represent the life conditions of the cattle at the target location; Based on the life parameters of cattle at various locations, the environmental risk factors at various times are obtained to monitor the cattle breeding environment; According to the difference between the target window of the target position and the data at the associated time of other positions, the data monitoring hysteresis of the target position is obtained, including: According to the ammonia concentration and hydrogen sulfide concentration at the target location, respectively, the following single data type hysteresis acquisition process is adopted to acquire the ammonia concentration data hysteresis corresponding to the ammonia concentration at the target location and the hydrogen sulfide concentration data hysteresis corresponding to the hydrogen sulfide concentration at the target location; The process of obtaining the hysteresis of a single data type includes: Obtaining a cross-correlation function between the data of the nth target window at the target position and the associated time of each other position, obtaining a period difference between the data of the nth target window and the associated time of each other position according to the cross-correlation function, and obtaining a comprehensive period difference; Obtain the difference between each data of the nth target window of the target position and the data at the associated time of each other position, and obtain the comprehensive numerical difference; Calculate the product of the comprehensive period difference and the comprehensive value difference of the nth target window at the target position to obtain the window data hysteresis of the nth target window at the target position; Calculate the average of the window data hysteresis of all target windows at the target position and normalize them to obtain the single data type hysteresis of the target position; Calculate the average of the ammonia concentration data hysteresis and the hydrogen sulfide concentration data hysteresis corresponding to the ammonia concentration at the target location to obtain the data monitoring hysteresis of the target location; According to the data monitoring hysteresis of the target location, the life parameters of the cattle at the target location are obtained, including: Acquire the difference between the number of target windows and the number of non-target windows at the target position, where the non-target windows are other windows at the target position except the target window; According to the hysteresis of the ammonia concentration data at the target location and the quantity difference, a first cattle life parameter corresponding to the ammonia concentration at the target location is obtained; the first cattle life parameter is proportional to the hysteresis of the ammonia concentration data and inversely proportional to the quantity difference; According to the hysteresis of the hydrogen sulfide concentration data at the target location and the quantity difference, a second cattle life parameter corresponding to the hydrogen sulfide concentration at the target location is obtained; the second cattle life parameter is proportional to the hysteresis of the hydrogen sulfide concentration data and inversely proportional to the quantity difference; The average value of the first cattle life parameter and the second cattle life parameter is calculated to obtain the cattle life parameter at the target location.
2. A cattle breeding environment monitoring method based on data analysis as claimed in claim 1, characterized in that: According to the data change relationship between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target location, the target window at the target location is screened and obtained, including: Obtaining a slope comparison factor for each window at the target location according to a difference in data change amplitude between an ammonia concentration window data set and a hydrogen sulfide concentration window data set for each window at the target location; According to the data size relationship at each moment in the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target position, the confusion factor of each window at the target position is obtained; According to the size relationship between the slope comparison factor and the confusion factor of each window, the target window of the target position is screened.
3. A cattle breeding environment monitoring method based on data analysis as claimed in claim 2, characterized in that: According to the data change amplitude difference between the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target position, the slope comparison factor of each window at the target position is obtained, including: ; in, The target location windows, The target location The jth data of the window, is the number of data points in the window, The target location The slope comparison factor for each window, The target location The change rate of hydrogen sulfide concentration of the jth data in the window, The target location The change rate of ammonia concentration of the jth data in the window, The target location The average value of the change rate of hydrogen sulfide concentration and the change rate of ammonia concentration of the jth data in the window, is a normalization function.
4. A cattle breeding environment monitoring method based on data analysis as claimed in claim 2, characterized in that: According to the data size relationship at each moment in the ammonia concentration window data set and the hydrogen sulfide concentration window data set of each window at the target location, the confusion factor of each window at the target location is obtained, including: Get the target location The median of the ammonia concentration window data set and the hydrogen sulfide concentration window data set for each window; Get the target location the number of moments in a window that meet a preset condition, wherein the moment that meets the preset condition is: the ammonia concentration and the hydrogen sulfide concentration at the moment are respectively located on both sides of the median; Calculate the number of times that meet the preset condition and the The ratio of the total number of moments in the windows is taken as the The confusion factor of the window.
5. A cattle breeding environment monitoring method based on data analysis as claimed in claim 2, characterized in that: According to the relationship between the slope comparison factor and the confusion factor of each window, the target window of the target position is screened, including: A window satisfying a preset condition is obtained as the target window, wherein the window satisfying the preset condition is a window whose slope comparison factor is greater than the confusion factor.
6. A cattle breeding environment monitoring method based on data analysis as claimed in claim 1, characterized in that: Based on the life parameters of cattle at various locations, the environmental risk factors at various times are obtained to monitor the cattle breeding environment, including: According to the absolute value of the difference between each ammonia concentration in the ammonia concentration sequence at the target position and its adjacent previous ammonia concentration, and the absolute value of the difference between each hydrogen sulfide concentration in the hydrogen sulfide concentration sequence at the target position and its adjacent previous hydrogen sulfide concentration, the data surge factor at each moment of the target position is obtained; The following calculation formula is used to obtain the environmental risk factor at each moment: ; Among them, z is the zth moment, is the environmental risk factor at the zth moment, Indicates Locations, represents the number of positions, It is The data surge factor at the zth moment of the position, Indicates The life parameters of cattle at each location, is the normalization function; The environmental risk factors at each moment are compared with the preset environmental risk factor threshold. If a preset number of consecutive environmental risk factors are greater than the preset environmental risk factor threshold, it is determined that the cattle breeding environment is abnormal.
7. A cattle breeding environment monitoring system based on data analysis, characterized in that it includes: Memory and processor; The memory is connected to the processor; The memory is used to store program instructions; The processor is used to implement the cattle breeding environment monitoring method based on data analysis described in any one of claims 1 to 6 when the program instructions are executed.
8. A cattle breeding environment monitoring device based on data analysis, characterized in that: It includes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in the embodiment of the cattle breeding environment monitoring method based on data analysis as described in any one of claims 1-6.
Citation Information
Patent Citations
Sheep breeding growth monitoring data transmission method and system
CN119383234A