Cattle and sheep breeding recording method and system based on Internet of Things, electronic equipment and storage medium
By deploying low-power wide-area networks and IoT devices in cattle and sheep farms, collecting and analyzing breeding data, the problems of inefficiency and inaccurate data of traditional artificial dependence are solved, automated management and intelligent analysis are realized, and breeding efficiency and safety are improved.
Patent Information
- Application Number
- CN202510181269.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the traditional cattle and sheep breeding model, the collection and analysis of breeding records relies on manual operations, resulting in inefficiency, inaccurate and incomplete data, especially in remote areas, which leads to difficulty in real-time data collection and transmission.
Using the Internet of Things cattle and sheep breeding recording method, the low-power wide-area network technology is deployed to collect and transmit physiological parameters such as position data, activity volume and body temperature of cattle and sheep, combined with Gaussian filtering, principal component analysis and K-mean algorithm, the data is preprocessed, feature extraction and clustered analysis, and an analysis model is constructed to support breeding decisions.
The automated collection, transmission and analysis of cattle and sheep breeding records has been realized, the breeding efficiency and management level has been improved, labor costs and data errors have been reduced, and breeding safety and sustainability have been enhanced.
Smart Images

Figure CN120104971A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of modern breeding technology, and in particular to a cattle and sheep breeding recording method, system, electronic equipment and storage medium based on the Internet of Things. Background Art
[0002] With the advancement of science and technology and the development of Internet of Things technology, modern animal husbandry is gradually transforming towards intelligence and automation. As an important part of animal husbandry, the modernization of cattle and sheep breeding management methods is of great significance to improving breeding efficiency, reducing costs, and enhancing disease prevention and control capabilities. However, in the traditional cattle and sheep breeding model, the collection and analysis of breeding records mostly rely on manual operations, which is not only inefficient, but also easily interfered by human factors, resulting in inaccuracy and incompleteness of data. Especially in remote areas, due to the imperfect network infrastructure, the real-time collection and transmission of breeding data face huge challenges. In addition, the preprocessing, feature extraction and cluster analysis of breeding data are mostly carried out manually, which is not only time-consuming and labor-intensive, but also difficult to meet the needs of large-scale data processing.
[0003] Therefore, how to use modern information technology, especially the Internet of Things technology, to realize the automatic collection, transmission, processing and analysis of cattle and sheep breeding records has become the key to improving the level of breeding management. This requires not only solving the problems of real-time and accuracy of data collection, but also solving the problems of stability and security of data transmission. At the same time, it also requires the realization of efficient data processing and in-depth analysis to provide a scientific basis for breeding decisions. Summary of the invention
[0004] In this context, the present invention proposes a cattle and sheep breeding record method and system based on the Internet of Things, which aims to collect breeding record data by deploying a communication network and combining advanced data processing technology to realize automated management and intelligent analysis of breeding records, thereby improving breeding efficiency and economic benefits.
[0005] To achieve the above object, the present invention provides a cattle and sheep breeding recording method based on the Internet of Things, the steps comprising:
[0006] Deploy a communication network for cattle and sheep breeding records and collect breeding record data;
[0007] Pre-processing the collected breeding record data to obtain processed data;
[0008] Perform feature extraction and clustering on the processed data to obtain a data set;
[0009] Based on the data set, an analysis model is constructed, and the breeding record data of cattle and sheep are analyzed using the analysis model to provide a reference for subsequent breeding plans.
[0010] Preferably, a data transmission network is constructed using low-power wide area network technology, and the data transmission network selects a communication protocol for long-distance transmission; at the same time, base stations and terminal devices are deployed to collect the breeding record data of cattle and sheep, including location data, activity level and body temperature.
[0011] Preferably, a Gaussian filtering method is used for preprocessing. Gaussian filtering is implemented by using a Gaussian function as a weight coefficient. The function is defined as follows:
[0012]
[0013] Among them, σ represents the standard deviation, which controls the width of the Gaussian kernel; x and y are the position coordinates relative to the center of the kernel.
[0014] The process of Gaussian filtering involves convolving the Gaussian kernel with the image. For each pixel (i, j) in the image, its new pixel value I'(i, j) is calculated by the following formula:
[0015]
[0016] Among them, I(im, jn) represents the pixel value corresponding to the center of the Gaussian kernel in the original image, and G(m, n) represents the weight of the Gaussian kernel at the position (m, n). In this way, the new value of each pixel is the weighted average of the pixel values in its neighborhood, and the weight is determined by the Gaussian kernel, which effectively smoothes the image and reduces noise to obtain the processed data.
[0017] Preferably, the method for obtaining the data set includes: using principal component analysis to compress highly correlated features into principal components; using K-means algorithm to perform cluster analysis on the principal components to obtain typical features; and finally compressing the typical features to obtain the data set.
[0018] The present invention also provides a cattle and sheep breeding record system based on the Internet of Things, and the system is used to implement the above method, including: a collection module, a processing module, an extraction module and an analysis module;
[0019] The collection module is used to collect breeding record data;
[0020] The processing module is used to pre-process the collected breeding record data to obtain processed data;
[0021] The extraction module is used to perform feature extraction and clustering on the processed data to obtain a data set;
[0022] The analysis module is used to construct an analysis model based on the data set, and use the analysis model to analyze the breeding record data of cattle and sheep to provide a reference for subsequent breeding plans.
[0023] Preferably, the acquisition module uses low-power wide area network technology to build a data transmission network, and the data transmission network selects a communication protocol for long-distance transmission; at the same time, base stations and terminal devices are deployed to collect the breeding record data of cattle and sheep, including location data, activity level and body temperature.
[0024] Preferably, the workflow of the processing module includes:
[0025] Gaussian filtering is used for preprocessing. Gaussian filtering is achieved by using a Gaussian function as a weight coefficient. The function is defined as follows:
[0026]
[0027] Among them, σ represents the standard deviation, which controls the width of the Gaussian kernel; x and y are the position coordinates relative to the center of the kernel.
[0028] The process of Gaussian filtering involves convolving the Gaussian kernel with the image. For each pixel (i, j) in the image, its new pixel value I'(i, j) is calculated by the following formula:
[0029]
[0030] Among them, I(im, jn) represents the pixel value corresponding to the center of the Gaussian kernel in the original image, and G(m, n) represents the weight of the Gaussian kernel at the position (m, n). In this way, the new value of each pixel is the weighted average of the pixel values in its neighborhood, and the weight is determined by the Gaussian kernel, which effectively smoothes the image and reduces noise to obtain the processed data.
[0031] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the above method is implemented when the processor executes the program.
[0032] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the above method is implemented.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention effectively solves the problem of remoteness of cattle and sheep breeding sites and weak network infrastructure by deploying low-power wide area network technology, and realizes the real-time collection and transmission of cattle and sheep location data, activity level, body temperature and other physiological parameters. The present invention provides scientific and accurate decision-making support for cattle and sheep breeding, significantly improves breeding efficiency and management level, reduces labor costs and data errors, enhances breeding safety and sustainability, and is of great significance to promoting the intelligent development of modern animal husbandry. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0036] Figure 1 A schematic diagram of a method flow of an embodiment of the present invention;
[0037] Figure 2 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention.
[0038] Description of reference numerals:
[0039] 1010, processor; 1020, memory; 1030, input / output interface; 1040, communication interface; 1050, bus. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] Embodiment 1
[0044] As can be seen from the background technology, in the traditional cattle and sheep breeding model, the collection and analysis of breeding records mostly rely on manual operations, which is not only inefficient, but also easily interfered by human factors, resulting in inaccurate and incomplete data. Especially in remote areas, due to the imperfect network infrastructure, the real-time collection and transmission of breeding data face huge challenges. In addition, the preprocessing, feature extraction and cluster analysis of breeding data are mostly carried out manually, which is not only time-consuming and labor-intensive, but also difficult to meet the needs of large-scale data processing.
[0045] Based on this, an embodiment of the present invention provides a cattle and sheep breeding recording method based on the Internet of Things, the steps comprising:
[0046] S1. Deploy a communication network for collecting cattle and sheep breeding records to collect breeding record data.
[0047] In view of the problems that cattle and sheep farms are located in remote areas and have weak network infrastructure, low-power wide area network technology is used to build a stable and reliable data transmission network. The network selects communication protocols suitable for long-distance transmission and deploys corresponding base stations and terminal equipment to collect cattle and sheep location data, activity level, body temperature and other breeding record data.
[0048] Specifically, according to the geographical location and distribution of cattle and sheep farms, the coverage range and base station location of the low-power wide area network are planned to ensure that the network can cover each breeding area, and the influence of terrain and obstacles is considered to optimize the deployment plan of the base station. Select communication protocols suitable for long-distance transmission, such as LoRa, NB-IoT, etc. According to the characteristics and performance of the protocol, design the network topology and parameter configuration to ensure the stability and reliability of data transmission. At the same time, anti-interference and fault-tolerant measures are taken according to the environmental characteristics of remote areas. Intelligent terminal devices integrated with Beidou navigation, accelerometer, body temperature sensor, etc. are worn on cattle and sheep to collect physiological parameters such as the location, activity and body temperature of cattle and sheep in real time. The terminal equipment needs to have the characteristics of low power consumption, miniaturization, waterproof and dustproof to adapt to the field environment. The intelligent terminal device transmits the collected data to the base station through the low-power wide area network. The base station aggregates the data from each terminal and uploads it to the cloud server through a wired or wireless backhaul network. During the data transmission process, data compression and encryption measures are adopted to reduce transmission traffic and protect data security.
[0049] The planning of low-power wide area networks needs to consider many factors. This embodiment takes a pasture with an area of 5,000 square kilometers as an example. First, a radio wave propagation model, such as the Okumura-Hata model, is used to calculate the signal coverage range. Taking into account the undulating terrain, base stations can be deployed at commanding heights, such as building a base station on the top of a mountain at an altitude of 2,000 meters, with a coverage radius of up to 30 kilometers. In plain areas, a base station is arranged every 20 kilometers. For valleys where signals are difficult to reach, relay stations can be used to expand coverage. It was finally determined that 15 base stations need to be built to form a mesh structure to ensure network redundancy. The choice of communication protocol is crucial. LoRa technology has the characteristics of long-distance transmission and low power consumption, and is suitable for large areas of pasture. Using the 868MHz frequency band, the transmission distance of a single terminal can reach 15 kilometers, and it has strong penetration ability and adapts to complex terrain. The network topology adopts a star structure, and each base station serves as a gateway to connect the surrounding terminal devices. To improve reliability, a two-way communication mechanism can be adopted. The terminal sends a heartbeat packet to the base station regularly, and the base station can actively query the terminal status when it detects an abnormality. For severe weather such as sandstorms, forward error correction coding and adaptive spread spectrum technology are used to enhance anti-interference capabilities. The design of intelligent terminal equipment requires weighing multiple indicators. Taking the collar as an example in this embodiment, the weight is controlled within 200 grams, and the IP67 protection level is adopted, which can resist dust and short-term immersion in water. The built-in 2000mAh lithium battery, combined with low-power design, can work continuously for 6 months. The positioning chip of the Beidou navigation module uses the HD8040 series of Huada Beidou, which supports Beidou-3 satellite signals and has a positioning accuracy of about 2.5 meters. The matching accelerometer is still ADXL345, with a sensitivity of 4mg / LSB, which can accurately capture the movement changes of cattle and sheep. The body temperature sensor also continues to use DS18B20, with an accuracy of ±0.5℃, to ensure the accuracy of body temperature data. The data collection frequency is flexibly set according to the activity status of cattle and sheep. When cattle and sheep are stationary, data is collected once an hour, and when they are moving, data is collected once every 5 minutes, taking into account the balance between real-time data and power consumption. In the data transmission process, we focus on security and efficiency, use encryption algorithms to ensure data transmission security, and optimize transmission protocols to improve transmission efficiency, ensuring that data is transmitted to the receiving end stably and quickly.
[0050] S2. Pre-process the collected breeding record data to obtain processed data.
[0051] The collected raw farming record data may contain information such as body temperature, heart rate, respiratory rate, etc. These data often contain noise and outliers, such as abnormally high or low temperature readings due to sensor failure.
[0052] Specifically, this embodiment uses a Gaussian filtering method for preprocessing. Gaussian filtering is implemented by using a Gaussian function as a weight coefficient. The function is defined as:
[0053]
[0054] Among them, σ represents the standard deviation, which controls the width of the Gaussian kernel; x and y are the position coordinates relative to the center of the kernel.
[0055] The process of Gaussian filtering involves convolving the Gaussian kernel with the (signal) image, that is, for each pixel point (i, j) in the (signal) image, its new pixel value I'(i, j) is calculated by the following formula:
[0056]
[0057] Among them, I(im, jn) represents the pixel value corresponding to the center of the Gaussian kernel in the original image, and G(m, n) represents the weight of the Gaussian kernel at the position (m, n). In this way, the new value of each pixel is the weighted average of the pixel values in its neighborhood, and the weight is determined by the Gaussian kernel, which effectively smoothes the image and reduces noise to obtain the processed data.
[0058] S3. Perform feature extraction and clustering on the processed data to obtain a data set.
[0059] Principal component analysis is a commonly used feature extraction method. Taking the collected breeding record data as an example, there are multiple highly correlated indicators, such as body temperature and heart rate. Through principal component analysis, these highly correlated features can be compressed into a few principal components, which not only retains the main information of the data, but also reduces the data dimension. Cluster analysis helps to discover the inherent structure in the data. In this embodiment, cattle and sheep are divided into different groups according to the similarity of physiological parameters, including a healthy group, a sub-healthy group, and a suspected disease group. The clustering algorithm used in this embodiment is the K-means algorithm. By performing statistical analysis on each cluster, typical characteristics of the category, such as average body temperature and heart rate range, can be obtained. Data compression is an effective means to reduce the transmission burden. Huffman coding is a lossless compression algorithm that assigns codes of different lengths according to the frequency of data occurrence. For normal values that frequently appear in the physiological parameters of cattle and sheep, shorter codes can be assigned; while for rare abnormal values, longer codes are assigned. This method can significantly reduce the amount of data while ensuring the integrity of the data to obtain a data set.
[0060] The steps of the principal component analysis method mentioned above include:
[0061] First, the processed data is standardized to eliminate the influence of different dimensions and magnitudes so that the data can be compared on the same scale. Then, the covariance matrix of the data is calculated, which reflects the covariance relationship between the variables. The calculation formula of the covariance matrix is:
[0062]
[0063] Among them, X i Represents the observation vector of each sample; represents the sample mean vector, n represents the number of samples; T is the transposed matrix; Cov represents the covariance matrix.
[0064] Then, the principal components are determined by solving the eigenvalues and eigenvectors of the covariance matrix. The eigenvector represents the direction of the principal component, while the size of the eigenvalue reflects the importance or variance contribution of the principal component. Finally, the eigenvectors corresponding to the first few largest eigenvalues are selected as new principal components, and the original data are projected onto these principal components to obtain the reduced-dimensional data, thereby realizing data feature extraction.
[0065] Then, the K-means algorithm was used to divide the cattle and sheep into different groups according to the similarity of physiological parameters, including healthy group, sub-healthy group and suspected disease group. The steps include:
[0066] 1. Randomly select K cluster centers to initialize each cluster.
[0067] 2. Traverse all data points and assign each data point to the cluster represented by the cluster center closest to it.
[0068] 3. Recalculate the cluster center of each cluster.
[0069] 4. Repeat steps 2 to 3 until convergence is reached.
[0070] 5. Data analysis results: The final clustering result is K different cluster sets, each of which contains several similar data points. These clusters can be regarded as healthy groups, sub-healthy groups, and suspected disease groups, thereby grouping the physiological status of cattle and sheep.
[0071] S4. Based on the data set, an analysis model is constructed, and the analysis model is used to analyze the cattle and sheep breeding record data to provide a reference for subsequent breeding plans.
[0072] The clustered features are input into the pre-trained model for training to build an analysis model.
[0073] Specifically, a convolutional neural network (CNN) is used to construct a prediction model to learn the input physiological parameter characteristics of cattle and sheep, so that the growth of cattle and sheep can be analyzed according to the breeding record data collected in step S1. In this embodiment, the analysis model includes: an input layer, a convolution layer, a pooling layer, a flattening layer, a fully connected layer and an output layer.
[0074] The input layer is used to receive image data of restoration cases, which are usually photos of buildings before and after restoration, as well as detailed images of the restoration parts.
[0075] The convolution layer includes three layers of convolution, namely the first convolution layer: using 64 3x3 convolution kernels, the step size is 1, and the activation function is ReLU, the second convolution layer: using 64 3x3 convolution kernels, the step size is 1, and the activation function is also ReLU. The third convolution layer: using 128 3x3 convolution kernels, the step size is 1, and the activation function is ReLU.
[0076] The pooling layer uses a 2x2 maximum pooling with a step size of 2 to reduce the feature dimension and reduce the amount of calculation.
[0077] The flattening layer flattens the multi-dimensional feature map into one dimension so as to be input into the fully connected layer.
[0078] The fully connected layers include: the first fully connected layer: 128 neurons, the activation function is ReLU, which is used to further process the flattened features; the second fully connected layer: 64 neurons, the activation function is ReLU, which is used to reduce the complexity of the model and improve the generalization ability.
[0079] Output layer: contains multiple neurons, the activation function is softmax, and is used for multi-classification problems.
[0080] When training the above prediction model, the loss function uses the cross entropy loss function, the Adam optimizer is used, the learning rate is set to 0.001, the momentum is set to 0.9, and the learning rate is adjusted adaptively.
[0081] Finally, the constructed analysis model is used to analyze the cattle and sheep breeding record data to provide a reference for subsequent breeding plans.
[0082] The technical solution of the present invention effectively solves the problem of remoteness of cattle and sheep breeding sites and weak network infrastructure by deploying low-power wide area network technology, and realizes the real-time collection and transmission of cattle and sheep location data, activity level, body temperature and other physiological parameters. The present invention provides scientific and accurate decision-making support for cattle and sheep breeding, significantly improves breeding efficiency and management level, reduces labor costs and data errors, enhances breeding safety and sustainability, and is of great significance to promoting the intelligent development of modern animal husbandry.
[0083] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.
[0084] It should be noted that some embodiments of the present disclosure are described above. Other embodiments are within the scope of the attached claims. In some cases, it should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. The actions or steps recorded in the claims can be performed in an order different from that in the above embodiment and still achieve the desired results. In addition, the process depicted in the accompanying drawings does 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.
[0085] Embodiment 2
[0086] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present disclosure also provides a cattle and sheep breeding record system based on the Internet of Things, including: a collection module, a processing module, an extraction module and an analysis module. The collection module is used to collect breeding record data; the processing module is used to pre-process the collected breeding record data to obtain processed data; the extraction module is used to extract features and cluster the processed data to obtain a data set; the analysis module is used to construct an analysis model based on the data set, and use the analysis model to analyze the cattle and sheep breeding record data to provide a reference for subsequent breeding plans.
[0087] The following will explain in detail how the present invention solves technical problems in real life in conjunction with this embodiment.
[0088] First, use the collection module to collect breeding record data.
[0089] In view of the problems that cattle and sheep farms are located in remote areas and have weak network infrastructure, the collection module uses low-power wide area network technology to build a stable and reliable data transmission network. The network selects a communication protocol suitable for long-distance transmission and deploys corresponding base stations and terminal equipment to collect cattle and sheep location data, activity level, body temperature and other breeding record data.
[0090] Specifically, according to the geographical location and distribution of cattle and sheep farms, the coverage range and base station location of the low-power wide area network are planned to ensure that the network can cover each breeding area, and the influence of terrain and obstacles is considered to optimize the deployment plan of the base station. Select communication protocols suitable for long-distance transmission, such as LoRa, NB-IoT, etc. According to the characteristics and performance of the protocol, design the network topology and parameter configuration to ensure the stability and reliability of data transmission. At the same time, anti-interference and fault-tolerant measures are taken according to the environmental characteristics of remote areas. Intelligent terminal devices integrated with Beidou navigation, accelerometer, body temperature sensor, etc. are worn on cattle and sheep to collect physiological parameters such as the location, activity and body temperature of cattle and sheep in real time. The terminal equipment needs to have the characteristics of low power consumption, miniaturization, waterproof and dustproof to adapt to the field environment. The intelligent terminal device transmits the collected data to the base station through the low-power wide area network. The base station aggregates the data from each terminal and uploads it to the cloud server through a wired or wireless backhaul network. During the data transmission process, data compression and encryption measures are adopted to reduce transmission traffic and protect data security.
[0091] The planning of low-power wide area networks needs to consider many factors. This embodiment takes a pasture with an area of 5,000 square kilometers as an example. First, a radio wave propagation model, such as the Okumura-Hata model, is used to calculate the signal coverage range. Taking into account the undulating terrain, base stations can be deployed at commanding heights, such as building a base station on the top of a mountain at an altitude of 2,000 meters, with a coverage radius of up to 30 kilometers. In plain areas, a base station is arranged every 20 kilometers. For valleys where signals are difficult to reach, relay stations can be used to expand coverage. It was finally determined that 15 base stations need to be built to form a mesh structure to ensure network redundancy. The choice of communication protocol is crucial. LoRa technology has the characteristics of long-distance transmission and low power consumption, and is suitable for large areas of pasture. Using the 868MHz frequency band, the transmission distance of a single terminal can reach 15 kilometers, and it has strong penetration ability and adapts to complex terrain. The network topology adopts a star structure, and each base station serves as a gateway to connect the surrounding terminal devices. To improve reliability, a two-way communication mechanism can be adopted. The terminal sends a heartbeat packet to the base station regularly, and the base station can actively query the terminal status when it detects an abnormality. For severe weather such as sandstorms, forward error correction coding and adaptive spread spectrum technology are used to enhance anti-interference capabilities. The design of intelligent terminal equipment requires weighing multiple indicators. Taking the collar as an example in this embodiment, the weight is controlled within 200 grams, and the IP67 protection level is adopted, which can resist dust and short-term immersion in water. The built-in 2000mAh lithium battery, combined with the low-power design, can work continuously for 6 months. The Beidou navigation module uses u-bloxNEO-M8N, and the positioning accuracy can reach 2.5 meters. The accelerometer uses ADXL345 with a sensitivity of 4mg / LSB, which can accurately detect the movement state of cattle and sheep. The body temperature sensor uses DS18B20 with an accuracy of ±0.5℃. The data collection frequency can be dynamically adjusted according to the activity state of cattle and sheep. It is collected once an hour when stationary and once every 5 minutes when moving, which not only ensures the real-time data but also saves power. Security and efficiency are equally important during data transmission. The AES-128 encryption algorithm is used to protect data, and the key is updated regularly.
[0092] The processing module is used to pre-process the collected breeding record data to obtain processed data.
[0093] The collected raw farming record data may contain information such as body temperature, heart rate, respiratory rate, etc. These data often contain noise and outliers, such as abnormally high or low temperature readings due to sensor failure.
[0094] Specifically, this embodiment uses a Gaussian filtering method for preprocessing. Gaussian filtering is implemented by using a Gaussian function as a weight coefficient. The function is defined as:
[0095]
[0096] Among them, σ represents the standard deviation, which controls the width of the Gaussian kernel; x and y are the position coordinates relative to the center of the kernel.
[0097] The process of Gaussian filtering involves convolving the Gaussian kernel with the (signal) image, that is, for each pixel point (i, j) in the (signal) image, its new pixel value I'(i, j) is calculated by the following formula:
[0098]
[0099] Among them, I(im, jn) represents the pixel value corresponding to the center of the Gaussian kernel in the original image, and G(m, n) represents the weight of the Gaussian kernel at the position (m, n). In this way, the new value of each pixel is the weighted average of the pixel values in its neighborhood, and the weight is determined by the Gaussian kernel, which effectively smoothes the image and reduces noise to obtain the processed data.
[0100] The extraction module is used to perform feature extraction and clustering on the processed data to obtain a data set.
[0101] Principal component analysis is a commonly used feature extraction method. Taking the collected breeding record data as an example, there are multiple highly correlated indicators, such as body temperature and heart rate. Through principal component analysis, these highly correlated features can be compressed into a few principal components, which not only retains the main information of the data, but also reduces the data dimension. Cluster analysis helps to discover the inherent structure in the data. In this embodiment, cattle and sheep are divided into different groups according to the similarity of physiological parameters, including a healthy group, a sub-healthy group, and a suspected disease group. The clustering algorithm used in this embodiment is the K-means algorithm. By performing statistical analysis on each cluster, typical characteristics of the category, such as average body temperature and heart rate range, can be obtained. Data compression is an effective means to reduce the transmission burden. Huffman coding is a lossless compression algorithm that assigns codes of different lengths according to the frequency of data occurrence. For normal values that frequently appear in the physiological parameters of cattle and sheep, shorter codes can be assigned; while for rare abnormal values, longer codes are assigned. This method can significantly reduce the amount of data while ensuring the integrity of the data to obtain a data set.
[0102] The steps of the principal component analysis method mentioned above include:
[0103] First, the processed data is standardized to eliminate the influence of different dimensions and magnitudes so that the data can be compared on the same scale. Then, the covariance matrix of the data is calculated, which reflects the covariance relationship between the variables. The calculation formula of the covariance matrix is:
[0104]
[0105] Among them, X i Represents the observation vector of each sample; represents the sample mean vector, n represents the number of samples; T is the transposed matrix; Cov represents the covariance matrix.
[0106] Then, the principal components are determined by solving the eigenvalues and eigenvectors of the covariance matrix. The eigenvector represents the direction of the principal component, while the size of the eigenvalue reflects the importance or variance contribution of the principal component. Finally, the eigenvectors corresponding to the first few largest eigenvalues are selected as new principal components, and the original data are projected onto these principal components to obtain the reduced-dimensional data, thereby realizing data feature extraction.
[0107] Then, the K-means algorithm was used to divide the cattle and sheep into different groups according to the similarity of physiological parameters, including healthy group, sub-healthy group and suspected disease group. The steps include:
[0108] 1. Randomly select K cluster centers to initialize each cluster.
[0109] 2. Traverse all data points and assign each data point to the cluster represented by the cluster center closest to it.
[0110] 3. Recalculate the cluster center of each cluster.
[0111] 4. Repeat steps 2 to 3 until convergence is reached.
[0112] 5. Data analysis results: The final clustering result is K different cluster sets, each of which contains several similar data points. These clusters can be regarded as healthy groups, sub-healthy groups, and suspected disease groups, thereby grouping the physiological status of cattle and sheep.
[0113] Finally, the analysis module builds an analysis model based on the data set, and uses the analysis model to analyze the cattle and sheep breeding record data to provide a reference for subsequent breeding plans.
[0114] The clustered features are input into the pre-trained model for training to build an analysis model.
[0115] Specifically, a convolutional neural network (CNN) is used to construct a prediction model to learn the input physiological parameter characteristics of cattle and sheep, so that the growth of cattle and sheep can be analyzed according to the breeding record data collected in step S1. In this embodiment, the analysis model includes: an input layer, a convolution layer, a pooling layer, a flattening layer, a fully connected layer and an output layer.
[0116] The input layer is used to receive image data of restoration cases, which are usually photos of buildings before and after restoration, as well as detailed images of the restoration parts.
[0117] The convolution layer includes three layers of convolution, namely the first convolution layer: using 64 3x3 convolution kernels, the step size is 1, and the activation function is ReLU, the second convolution layer: using 64 3x3 convolution kernels, the step size is 1, and the activation function is also ReLU. The third convolution layer: using 128 3x3 convolution kernels, the step size is 1, and the activation function is ReLU.
[0118] The pooling layer uses a 2x2 maximum pooling with a step size of 2 to reduce the feature dimension and reduce the amount of calculation.
[0119] The flattening layer flattens the multi-dimensional feature map into one dimension so as to be input into the fully connected layer.
[0120] The fully connected layers include: the first fully connected layer: 128 neurons, the activation function is ReLU, which is used to further process the flattened features; the second fully connected layer: 64 neurons, the activation function is ReLU, which is used to reduce the complexity of the model and improve the generalization ability.
[0121] Output layer: contains multiple neurons, the activation function is softmax, and is used for multi-classification problems.
[0122] When training the above prediction model, the loss function uses the cross entropy loss function, the Adam optimizer is used, the learning rate is set to 0.001, the momentum is set to 0.9, and the learning rate is adjusted adaptively.
[0123] Finally, the constructed analysis model is used to analyze the cattle and sheep breeding record data to provide a reference for subsequent breeding plans.
[0124] The system of the above embodiment is used to implement the corresponding cattle and sheep breeding recording method based on the Internet of Things in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0125] It should be noted that the above-mentioned cattle and sheep breeding record system based on the Internet of Things is embodied in the form of functional units. The term "module" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0126] For example, a "module" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.
[0127] Embodiment 3
[0128] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the cattle and sheep breeding recording method based on the Internet of Things described in any of the above embodiments is implemented.
[0129] Figure 2 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0130] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0131] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0132] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0133] The communication interface 1040 is used to connect a communication module (not shown in the figure) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB (Universal Serial Bus), network cable, etc.), or through a wireless mode (such as mobile network, WIFI (Wireless Fidelity), Bluetooth, etc.).
[0134] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0135] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0136] The system of the above embodiment is used to implement the corresponding cattle and sheep breeding recording method based on the Internet of Things in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0137] Embodiment 4
[0138] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the cattle and sheep breeding recording method based on the Internet of Things as described in any of the above embodiments.
[0139] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0140] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the cattle and sheep breeding recording method based on the Internet of Things as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0141] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0142] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0143] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0144] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0145] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A cattle and sheep breeding recording method based on the Internet of Things, characterized in that: The method comprises: Deploy a communication network for cattle and sheep breeding records and collect breeding record data; Pre-processing the collected breeding record data to obtain processed data; Perform feature extraction and clustering on the processed data to obtain a data set; Based on the data set, an analysis model is constructed, and the breeding record data of cattle and sheep are analyzed using the analysis model to provide a reference for subsequent breeding plans.
2. The method for recording cattle and sheep breeding based on the Internet of Things according to claim 1, characterized in that: A data transmission network is constructed using low-power wide area network technology, and the data transmission network selects a communication protocol for long-distance transmission; at the same time, base stations and terminal equipment are deployed to collect the breeding record data of cattle and sheep, including location data, activity level and body temperature.
3. The cattle and sheep breeding recording method based on the Internet of Things according to claim 1 is characterized in that: Gaussian filtering is used for preprocessing. Gaussian filtering is achieved by using a Gaussian function as a weight coefficient. The function is defined as follows: Where σ represents the standard deviation, which controls the width of the Gaussian kernel; x and y are the position coordinates relative to the center of the kernel; The process of Gaussian filtering involves convolving the Gaussian kernel with the image. For each pixel (i, j) in the image, its new pixel value I'(i, j) is calculated by the following formula: Among them, I(im, jn) represents the pixel value corresponding to the center of the Gaussian kernel in the original image, and G(m, n) represents the weight of the Gaussian kernel at the (m, n) position; in this way, the new value of each pixel is the weighted average of the pixel values in its neighborhood, and the weight is determined by the Gaussian kernel, thereby effectively smoothing the image and reducing noise to obtain processed data.
4. The cattle and sheep breeding recording method based on the Internet of Things according to claim 1 is characterized in that: The method for obtaining the data set includes: using principal component analysis to compress highly correlated features into principal components; using K-means algorithm to perform cluster analysis on the principal components to obtain typical features; and finally compressing the typical features to obtain the data set.
5. A cattle and sheep breeding record system based on the Internet of Things, the system is used to implement the method described in any one of claims 1 to 4, characterized in that: include: Acquisition module, processing module, extraction module and analysis module; The collection module is used to collect breeding record data; The processing module is used to pre-process the collected breeding record data to obtain processed data; The extraction module is used to perform feature extraction and clustering on the processed data to obtain a data set; The analysis module is used to construct an analysis model based on the data set, and use the analysis model to analyze the breeding record data of cattle and sheep to provide a reference for subsequent breeding plans.
6. The cattle and sheep breeding record system based on the Internet of Things according to claim 5 is characterized in that: The acquisition module uses low-power wide area network technology to build a data transmission network, and the data transmission network selects a communication protocol for long-distance transmission; at the same time, base stations and terminal equipment are deployed to collect the breeding record data of cattle and sheep, including location data, activity level and body temperature.
7. The cattle and sheep breeding record system based on the Internet of Things according to claim 5 is characterized in that: The workflow of the processing module includes: Gaussian filtering is used for preprocessing. Gaussian filtering is achieved by using a Gaussian function as a weight coefficient. The function is defined as follows: Where σ represents the standard deviation, which controls the width of the Gaussian kernel; x and y are the position coordinates relative to the center of the kernel; The process of Gaussian filtering involves convolving the Gaussian kernel with the image. For each pixel (i, j) in the image, its new pixel value I'(i, j) is calculated by the following formula: Among them, I(im, jn) represents the pixel value corresponding to the center of the Gaussian kernel in the original image, and G(m, n) represents the weight of the Gaussian kernel at the (m, n) position; in this way, the new value of each pixel is the weighted average of the pixel values in its neighborhood, and the weight is determined by the Gaussian kernel, thereby effectively smoothing the image and reducing noise to obtain processed data.
8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 4 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 4 is implemented.