Low-power livestock ear tag temperature measurement system and control method thereof

By designing a low-power livestock ear tag temperature measurement system, and using LoRa wireless modules and machine learning models to process temperature data, the system solves the problems of high power consumption and lack of consideration for environmental factors in existing technologies, and achieves long battery life, long-range communication, and scientific body temperature monitoring.

CN116762720BActive Publication Date: 2026-07-24XIAN HAOCHEN INTELLIGENT CONTROL TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAN HAOCHEN INTELLIGENT CONTROL TECHNOLOGY CO LTD
Filing Date
2023-08-11
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing livestock body temperature measurement systems suffer from high power consumption, large weight, inconvenience for large-scale application, and insufficient consideration of the influence of ambient temperature and seasonal factors.

Method used

A low-power livestock ear tag temperature measurement system was designed, including ear tag hardware, sub-unit hardware and host hardware. It uses a LoRa wireless module for data transmission and processes temperature data through a custom protocol and machine learning model, taking into account ambient temperature and seasonal factors to determine anomalies.

Benefits of technology

It achieves low power consumption, long battery life, long communication distance, and scientific body temperature anomaly detection, improving data processing efficiency and system stability, and is suitable for temperature monitoring in medium and large-sized livestock farms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116762720B_ABST
    Figure CN116762720B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of low-power livestock ear tag temperature measurement system and its control method, compared with prior art, solve the large-scale livestock farm cannot be measured quickly, temperature measurement ear tag endurance time is short and the defect that abnormal data processing method is simple and over-reliance on experience.The present application includes ear tag hardware, extension hardware and host hardware, the ear tag hardware is communicated with host hardware by extension hardware.The present application is based on the hardware of temperature measurement ear tag, extension and host, specifically designs temperature measurement ear tag acquisition and low-power transmission strategy, data upload automatic backoff strategy;Effectively improve the efficient and stability of temperature measurement ear tag transmission, greatly reduce the power consumption and speed of temperature measurement ear tag.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent livestock devices, specifically a low-power livestock ear tag temperature measurement system and its control method. Background Technology

[0002] Literature review and field research revealed that livestock temperature can serve as a simple and intuitive indicator for disease diagnosis. Wu Yan et al. from Northwest A&F University developed a real-time remote monitoring system for livestock body temperature based on ZigBee wireless sensor network technology. The system's temperature measurement node uses the low-power, low-cost CC2430 MCU; however, the large and heavy battery and other hardware make it inconvenient to wear on individual livestock. Liu Zhongchao designed an Android-based real-time livestock body temperature monitoring system. This system transmits livestock body temperature data wirelessly to the Android mobile platform, allowing users to view livestock numbers and temperatures in real time. However, this system did not adequately consider low power consumption, leading to frequent maintenance of the temperature measurement terminal and increasing labor costs for farms. JS Church et al. from Canada used infrared thermal imaging technology to observe the eye temperature of a large number of individual livestock for early disease prevention and monitoring; however, large-scale application of this method faces significant challenges.

[0003] In summary, livestock body temperature measurement systems must possess characteristics such as low power consumption, light weight, and ease of large-scale application. Furthermore, practical applications have revealed that, due to the varying sizes of farms, the communication distances between different components of the livestock body temperature measurement system must be appropriate to meet the needs of farms of different sizes. In addition, regarding livestock body temperature data processing, other livestock measurement systems also fail to consider the impact of factors such as ambient temperature, season, and time on livestock body temperature.

[0004] Therefore, developing a low-power livestock ear tag temperature measurement system has become an urgent technical problem to be solved. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies, such as the inability of large-scale livestock farms to quickly measure livestock body temperature, short battery life of temperature-measuring ear tags, and simplistic and overly experience-based methods for handling abnormal data. This invention provides a low-power livestock ear tag temperature measurement system and its control method to solve the above problems.

[0006] To achieve the above objectives, the technical solution of the present invention is as follows:

[0007] A low-power livestock ear tag temperature measurement system includes ear tag hardware, sub-unit hardware, and main unit hardware. The ear tag hardware communicates with the main unit hardware via the sub-unit hardware.

[0008] The ear tag hardware includes a microprocessor. The microprocessor's peripheral circuitry is connected to an ear tag cow number setting DIP switch, an ear tag channel setting DIP switch, a DS18B20 temperature sensor, and an ear tag LoRa wireless module. The microprocessor is used for acquiring and transmitting body temperature data and encapsulating a custom protocol. The DS18B20 temperature sensor is used for acquiring livestock body temperature data. The ear tag LoRa wireless module is used for information interaction with the extension hardware. The ear tag cow number setting DIP switch and the ear tag channel setting DIP switch are used to set the ear tag hardware number and the LoRa wireless module channel frequency, respectively.

[0009] The aforementioned extension hardware includes an extension main controller, and the peripheral circuit of the extension main controller is connected to a clock module, a temperature and humidity module, an extension number DIP switch, an extension channel setting DIP switch, and an extension LoRa wireless module.

[0010] The host hardware includes a host main controller, on which a host LoRa wireless module and a serial port module are connected.

[0011] The LoRa wireless module for the ear tag is a PCB antenna, and the microprocessor model is STC15W4K.

[0012] A control method for a low-power livestock ear tag temperature measurement system includes the following steps:

[0013] Ear tag hardware collects livestock temperature data: Ear tag hardware collects ear temperature data from livestock;

[0014] Temperature data transmission: Low-power data transmission is performed between the ear tag hardware and the receiver hardware;

[0015] The extension unit hardware is responsible for receiving, sending, and processing data;

[0016] Data transmission, reception and processing of the host hardware: The extension hardware sends data to the host hardware, which then processes it.

[0017] The ear tag hardware collects livestock ear temperature data, including the following steps:

[0018] The ear tag hardware is initialized, and the microprocessor reads the values ​​of the ear tag number setting DIP switch and the ear tag channel setting DIP switch.

[0019] Read the data measured by the DS18B20 temperature sensor and send the data to the ear tag LoRa wireless module to transmit to the extension hardware;

[0020] When sending data, first send a two-digit preamble, and the extension hardware will detect and identify whether the beginning of the data format is correct; then send a one-digit data type, so that the extension hardware can identify that it is ear tag temperature data; then send a one-digit cow number to distinguish individual cows; then send two digits of temperature data, which are the integer part and the decimal part of the temperature; finally send a one-digit check code to mark the end of the data string.

[0021] Once the data is completely transmitted by the LoRa wireless module of the ear tag, the microcontroller immediately starts timer one.

[0022] If the ear tag hardware receives a confirmation command from the extension hardware within 2 hours, the ear tag hardware will enter a sleep state; if the ear tag hardware does not receive a confirmation command from the extension hardware within 2 hours, then timer three will start counting.

[0023] Timer 3 counts a random backoff time. If the ear tag hardware receives an acknowledgment command from the extension hardware within the timer 3 countdown, the system enters sleep mode.

[0024] If the ear tag hardware does not receive a confirmation command from the extension hardware within the random backoff time of Timer 3, then Timer 3 will be reset and restarted.

[0025] This process will repeat 3 times. If the ear tag hardware still does not receive the confirmation instruction from the extension hardware within the third random backoff time after the timer is reset, the data transmission is considered to have failed.

[0026] If data transmission fails, the ear tag hardware immediately enters sleep mode, waiting to be woken up by the next overflow of Timer 1 or Timer 3.

[0027] The transmission of the temperature data includes the following steps:

[0028] The communication between the ear tag hardware and the extension hardware adopts a "request-answer" method;

[0029] When the ear tag hardware completes temperature measurement, it sends out a command string carrying temperature data, cow number, and data type via the LoRa wireless module;

[0030] After the extension hardware receives the data string completely according to the data protocol, it sends a command string to the ear tag hardware indicating that the data has been completely received. If the data received by the extension hardware is different from the custom communication protocol, it will be regarded as noise and not processed.

[0031] The instruction string format is set as follows:

[0032] The instruction from the ear tag hardware module with device address n to send temperature data to the extension data management module, and the response from the extension data management module are as follows:

[0033] Send: 55 AA 01 n 18 20 00 00 00 00 00 FE;

[0034] Response: 66 BB 01 n FC;

[0035] After receiving the confirmation data reception command string from the extension hardware, the ear tag hardware enters sleep mode and waits for the next wake-up.

[0036] The data reception, transmission, and processing of the extension unit hardware includes the following steps:

[0037] The extension unit hardware waits for data commands to receive and send data;

[0038] When the ear tag hardware receives the temperature data, it receives and saves the correct data, and then sends a confirmation data command to the ear tag hardware.

[0039] When it receives a self-clock calibration command from the host hardware, it rewrites its own clock data according to the data in the command, and then sends a clock data confirmation command to the host hardware.

[0040] When it receives a data request instruction from the host hardware, it transmits the data it has stored and processed through the LoRa wireless module of the extension unit, and then starts a timer to wait for the host hardware to send an instruction confirming that the data has been received completely.

[0041] If the extension hardware receives an acknowledgment from the host hardware during the timer's first countdown, it will clear its own data; if the extension hardware does not receive an acknowledgment from the host hardware during the timer's first countdown, the extension hardware will continue to save its own data and continue to wait for the next instruction.

[0042] Extension hardware processing:

[0043] After the extension hardware fully receives the temperature data sent by the ear tag hardware, it determines which season and time of day it is based on the data read from the current clock module. Then it reads the current pen temperature and uses a support vector machine-based network model trained on a large amount of data to determine the upper limit of the normal body temperature of the beef cattle.

[0044] Compare the received temperature data with the upper limit of normal body temperature predicted by the network model;

[0045] If the received temperature data is lower than the estimated normal body temperature, the received data will be appended with clock data and stored in a three-dimensional array predefined according to the cow number, number of times, and number of data bits.

[0046] If the received temperature data is higher than the estimated normal body temperature, then add a data anomaly flag after the received data, add clock data, and store it in a predefined three-dimensional array;

[0047] When the extension unit hardware receives temperature data for the second or subsequent times, it will determine whether the temperature data is normal, and then check whether the temperature data and clock data are the same as the previously stored data.

[0048] If the values ​​are the same, the received temperature data will not be stored; otherwise, it will be stored in a three-dimensional array.

[0049] The data transmission, reception, and processing of the host hardware includes the following steps:

[0050] The host hardware is waiting for data instructions from the computer.

[0051] When the serial port module of the host hardware receives the data clock calibration command from the computer, it converts the valid data in the command into a command that the slave hardware can recognize and transmits it through the host LoRa wireless module.

[0052] When the serial port module of the host hardware receives the instruction from the computer to request data from the extension, it converts the instruction into an instruction that the extension hardware can recognize, sends it through the host LoRa wireless module, and then starts timer two to count.

[0053] If the host hardware does not receive temperature data from the extension hardware within the timer's second counting period, the host sends a data reception failure command to the computer and waits for the computer's next command.

[0054] If the host hardware receives the temperature data sent by the extension hardware within the timer two counting time, it stores the data into a predefined three-dimensional array according to the number, count, and digit information in the temperature data. After the entire temperature data is received, a data reception confirmation command is sent to the extension hardware.

[0055] The data from the three-dimensional array is uploaded to the host computer via a serial port module in batches according to the cow number and the number of times. The host computer then displays the temperature data string based on the cow number, time, and abnormal data bit information.

[0056] Beneficial effects

[0057] The present invention discloses a low-power livestock ear tag temperature measurement system and its control method. Compared with the prior art, based on the three hardware components of the temperature measurement ear tag, the sub-unit, and the host, it specifically designs a temperature measurement ear tag acquisition and low-power transmission strategy and an automatic data upload backoff strategy; effectively improving the efficiency and stability of temperature measurement ear tag transmission, and greatly reducing the power consumption and speed of the temperature measurement ear tag.

[0058] This invention specifically designs the secondary unit hardware and data processing model. The secondary unit hardware can act as a relay device in network communication, greatly increasing the system's communication distance. The data processing model fully considers the impact of ambient temperature and time on livestock body temperature, making the method for determining abnormal livestock body temperature more scientific and reasonable. Simultaneously, the invention specifically designs the host hardware and data storage method. The host acts as a relay device, making the system's communication structure more rational and greatly improving the system's data aggregation efficiency. Finally, considering the efficiency of data transmission between various hardware devices, a custom communication protocol more suitable for this system is designed, enabling rapid and efficient measurement, processing, and aggregation of livestock body temperature.

[0059] This invention has the advantages of long battery life, long communication distance, and real-time data processing results, and can monitor and judge the individual temperature of livestock in medium and large-sized livestock farms. Attached Figure Description

[0060] Figure 1 This is a structural diagram of the livestock ear tag temperature measurement system of the present invention;

[0061] Figure 2 This is a schematic diagram of the ear tag hardware in this invention;

[0062] Figure 3 This is a schematic diagram of the extension hardware in this invention;

[0063] Figure 4 This is a schematic diagram of the host hardware structure in this invention;

[0064] Figure 5 This is a hardware acquisition response diagram of the ear tag in this invention;

[0065] Figure 6 This invention relates to an analytical diagram of the data reception process via the serial port of a mobile extension.

[0066] Figure 7 This is a diagram illustrating the low-power transmission strategy between the ear tag hardware and the extension hardware in this invention.

[0067] Figure 8 This is a flowchart illustrating the data reception process of the extension unit hardware in this invention.

[0068] Figure 9 This is a schematic diagram of a three-dimensional model of the extension data storage in this invention;

[0069] Figure 10 This is a flowchart of the data duplication processing strategy for extension units in this invention;

[0070] Figure 11 This is a flowchart of the host hardware workflow in this invention. Detailed Implementation

[0071] To provide a better understanding of the structural features and effects achieved by the present invention, a detailed description is provided below, accompanied by preferred embodiments and accompanying drawings:

[0072] like Figure 1 As shown, the present invention discloses a low-power livestock ear tag temperature measurement system, comprising ear tag hardware, relay hardware, and host hardware. The ear tag hardware communicates with the host hardware via the relay hardware. This ear tag system is hardware-wise composed of ear tag hardware, relay hardware (relay station), and host hardware (data upload station). The operating principle is as follows: the ear tag hardware is worn on the ears of cattle and sheep, and measures the animal's body temperature at regular intervals, sending the data to the relay hardware. The relay hardware collects body temperature data from multiple measurements taken by multiple ear tags throughout the day. Upon receiving a data request command from the host hardware at a specific time, the relay hardware sends all data to the host hardware. The host hardware is connected to a computer client, allowing users to view the data on the computer client.

[0073] like Figure 2 As shown, the ear tag hardware includes a microprocessor. The microprocessor's serial port (peripheral circuit) is connected to a DIP switch for setting the animal's cow number, a DIP switch for setting the ear tag channel, a DS18B20 temperature sensor, and an ear tag LoRa wireless module. The microprocessor controls the acquisition and transmission of body temperature data and encapsulates a custom protocol. The DS18B20 temperature sensor is used to acquire animal body temperature data. The ear tag LoRa wireless module is used for information exchange with the sub-unit hardware. The DIP switches for setting the animal's cow number and setting the ear tag channel are used to set the ear tag hardware's number and the LoRa wireless module's channel frequency, respectively. This allows ear tags in different pen areas to operate on different channel frequencies, ensuring that temperature-measuring ear tags do not interfere with each other during communication and improving the reliability of the temperature-measuring ear tags. A power module supplies power to the entire ear tag hardware.

[0074] The LoRa wireless module for the ear tag uses a PCB antenna, and the microprocessor is an STC15W4K. In this type of microcontroller's low-power design, the power-down mode can be woken up by a dedicated wake-up timer overflowing from sleep mode. When the microcontroller is woken up, it initializes the system according to the program and then executes the data acquisition task. After acquisition, the data is sent to the extension hardware via the LoRa RF module. Upon receiving confirmation from the extension data management module, it sets the M1 and M0 pins connected to the LoRa RF module high, thus putting the LoRa wireless RF module into sleep mode. Simultaneously, the microcontroller sets the remaining I / O ports to disabled input and output mode, and then enters power-down mode, waiting for the next wake-up timer.

[0075] like Figure 3As shown, the extension hardware includes an extension main controller. The serial port (peripheral circuit) of the extension main controller is connected to a clock module, a temperature and humidity module, an extension number DIP switch, an extension channel setting DIP switch, and an extension LoRa wireless module. For example... Figure 4 As shown, the host hardware includes a host main controller, on which a host LoRa wireless module and a serial port module are connected.

[0076] The ear tag temperature measurement system is designed to accurately measure the body temperature of livestock. It is worn on the animal's ear. Considering that livestock may be moved between different pens during the livestock rearing process, the ear tag hardware incorporates ear tag numbering and channel switching switches. When livestock are moved to a new pen as a group, simply adjust the ear tag channel switching switch to match the channel of the unit in the new pen. When moving an individual animal, both the ear tag numbering and channel switching switches must be adjusted. This re-assigns the animal's number to the new pen and adjusts the channel to match the unit's channel, allowing the ear tag to perform temperature measurement and data transmission normally.

[0077] Regarding the low power consumption of the temperature-sensing ear tag, we tested the power consumption values ​​of the main energy-consuming components of the temperature-sensing ear tag hardware in different operating modes, as shown in Tables 1 and 2. Based on the data in the tables, we established a low-power calculation model for the temperature-sensing ear tag. As shown in Table 3, under our designed low-power transmission strategy algorithm between the temperature-sensing ear tag and the extension hardware, actual testing shows that if an 800 mAh lithium-ion battery is used to power the temperature-sensing ear tag, its normal operating time can reach up to 2 years.

[0078] Table 1. Comparison of power consumption values ​​of microcontrollers in different modes

[0079] Normal mode 100-120mA Low speed mode 40-50mA Idle mode 10mA hibernation mode 3uA

[0080] Table 2 Comparison of power consumption values ​​of LoRa wireless modules in different modes

[0081] Normal mode 30 mA Power saving mode 16 mA hibernation mode 8 uA 19dBm 100 mA 20dBm 135mA

[0082] In addition, considering the different sizes of various farms, we designed a three-level communication structure for the temperature measurement ear tag system. The hardware of this structure can be used as a relay communication station, making the communication distance of the entire system twice that of the LoRa wireless module. After actual testing, the effective communication distance radius of the entire system reaches 3 kilometers, which can meet the equipment layout needs of farms of different sizes.

[0083] Regarding data transmission from the extension unit hardware, since the extension unit needs to receive multiple data points from various temperature-measuring ear tags throughout the day, it requires storing a large amount of temperature data. When the extension unit hardware receives a data request instruction from the host hardware, it will send the data to the host hardware. However, the LoRa wireless module has a maximum limit on the number of bytes it can send at one time. Therefore, we designed an algorithm for both the extension unit hardware to resume transmission and the host hardware to resume reception. If the amount of data stored in the extension unit hardware exceeds the maximum number of bytes that the LoRa wireless module can send at one time, the extension unit hardware will first send the maximum number of bytes allowed by the LoRa wireless module. The first byte of the remaining data will be marked, and after a certain period of time, the data will be sent again from the marked value. When the host hardware receives data, it will check whether it has received the complete temperature data of a single temperature-measuring ear tag and whether it has received the end flag of all data. If not, it will continue to wait until the reception is complete before sending all the data to the computer.

[0084] Table 3. Comparison of power consumption of the temperature measurement module in different modes.

[0085] Normal mode 150 mA hibernation mode 15uA Receive data mode 170 mA 20dBm transmission mode 256 mA

[0086] Here, a control method for a low-power livestock ear tag temperature measurement system is also provided, including the following steps:

[0087] The first step is to use ear tag hardware to collect temperature data from the livestock's ears: such as Figure 5 As shown, the ear tag hardware collects ear temperature data from livestock.

[0088] (1) The ear tag hardware is initialized, and the microprocessor reads the values ​​of the ear tag number setting DIP switch and the ear tag channel setting DIP switch.

[0089] (2) Read the data measured by the DS18B20 temperature sensor and send the data to the ear tag LoRa wireless module to send to the extension hardware;

[0090] When sending data, first send a two-digit preamble to check if the extension hardware recognizes the correct start of the data format; then send a one-digit data type to allow the extension hardware to recognize that it is ear tag temperature data; then send a one-digit cow number to distinguish individual cows; then send two digits of temperature data, which are the integer part and the decimal part of the temperature; finally send a one-digit checksum to mark the end of the data string.

[0091] (3) Once the data is completely transmitted by the LoRa wireless module of the ear tag, the microcontroller immediately starts timer one to start the count.

[0092] If the ear tag hardware receives a confirmation command from the extension hardware within 2 hours, the ear tag hardware will enter a sleep state; if the ear tag hardware does not receive a confirmation command from the extension hardware within 2 hours, then timer three will start counting.

[0093] (4) Timer 3 performs a random backoff time. If the ear tag hardware receives an acknowledgment command from the extension hardware within the timer 3 time, the system enters sleep time.

[0094] If the ear tag hardware does not receive a confirmation command from the extension hardware within the random backoff time of Timer 3, then Timer 3 will be reset and restarted.

[0095] This process will repeat 3 times. If the ear tag hardware still does not receive the confirmation command from the extension hardware within the third random backoff time after the timer is reset, the data transmission is considered to have failed.

[0096] (5) After data transmission fails, the ear tag hardware immediately enters sleep mode and waits for the next timer one or timer three overflow to wake it up.

[0097] The second step is the transmission of temperature data: low-power data transmission is performed between the ear tag hardware and the extension hardware.

[0098] (1) The communication between the ear tag hardware and the extension hardware adopts the "request-answer" method;

[0099] When the ear tag hardware completes temperature measurement, it sends out a command string carrying temperature data, cow number, and data type via the LoRa wireless module.

[0100] (2) After the extension hardware has received the data string completely according to the data protocol, it sends a command string to the ear tag hardware indicating that the data has been received completely; if the data received by the extension hardware is different from the custom communication protocol, it will be regarded as noise and will not be processed.

[0101] The instruction string format is set as follows:

[0102] The instruction from the ear tag hardware module with device address n to send temperature data to the extension data management module, and the response from the extension data management module are as follows:

[0103] Send: 55 AA 01 n 18 20 00 00 00 00 00 FE;

[0104] Response: 66 BB 01 n FC.

[0105] like Figure 6 The diagram shows the process of receiving data via the serial port of the extension unit.

[0106] (3) After the ear tag hardware receives the confirmation data received instruction string from the extension hardware, it enters sleep mode and waits for the next wake-up.

[0107] The third step involves the extension unit hardware receiving, sending, and processing data, such as... Figure 7 As shown.

[0108] (1) such as Figure 8 As shown, the extension hardware waits for data commands to receive and send data;

[0109] When the ear tag hardware receives the temperature data, it receives and saves the correct data, and then sends a confirmation data command to the ear tag hardware.

[0110] When it receives a self-clock calibration command from the host hardware, it rewrites its own clock data according to the data in the command, and then sends a clock data confirmation command to the host hardware.

[0111] When it receives a data request instruction from the host hardware, it transmits the data it has stored and processed through the LoRa wireless module of the extension unit, and then starts a timer to wait for the host hardware to send an instruction confirming that the data has been received completely.

[0112] If the extension hardware receives an acknowledgment from the host hardware during the timer's first countdown, it will clear its own data; if the extension hardware does not receive an acknowledgment from the host hardware during the timer's first countdown, it will continue to save its own data and wait to receive the next instruction.

[0113] (2) Extension hardware data processing, such as Figure 10 As shown:

[0114] Since the body temperature of beef cattle is affected by many factors such as the temperature and humidity of the pen environment, the time of day, and the season, considering these factors when judging abnormal body temperature during the growth process of beef cattle can avoid misjudgment and achieve accurate identification.

[0115] After the extension hardware fully receives the temperature data sent by the ear tag hardware, it determines which season and time of day it is based on the data read from the current clock module. Then it reads the current pen temperature and uses a support vector machine-based network model trained on a large amount of data to determine the upper limit of the normal body temperature of the beef cattle.

[0116] Compare the received temperature data with the upper limit of normal body temperature predicted by the network model;

[0117] If the received temperature data is lower than the estimated normal body temperature, the received data will be appended with clock data and stored in a three-dimensional array predefined according to the cow number, number of times, and number of data bits.

[0118] If the received temperature data is higher than the estimated normal body temperature, an abnormal data flag is added to the received data, followed by clock data, and then stored in a predefined three-dimensional array, such as... Figure 9 As shown.

[0119] When the extension unit hardware receives temperature data for the second or subsequent times, it will determine whether the temperature data is normal, and then check whether the temperature data and clock data are the same as the previously stored data.

[0120] If the values ​​are the same, the received temperature data will not be stored; otherwise, it will be stored in a three-dimensional array.

[0121] The fourth step involves data transmission, reception, and processing by the host hardware: the extension hardware sends data to the host hardware, which then processes it. For example... Figure 11 As shown.

[0122] (1) The host hardware waits for data instructions from the computer;

[0123] When the serial port module of the host hardware receives the data clock calibration command from the computer, it converts the valid data in the command into a command that the slave hardware can recognize and transmits it through the host LoRa wireless module.

[0124] When the serial port module of the host hardware receives the instruction from the computer to request data from the extension, it converts the instruction into an instruction that the extension hardware can recognize, sends it through the host LoRa wireless module, and then starts timer two to count.

[0125] If the host hardware does not receive temperature data from the extension hardware within the timer's second counting period, the host sends a data reception failure command to the computer and waits for the computer's next command.

[0126] (2) If the host hardware receives the temperature data sent by the extension hardware within the timer two counting time, it stores the data in a predefined three-dimensional array according to the cow number, count, and number of bits in the temperature data. After the entire temperature data is received, it sends a data reception confirmation command to the extension hardware. Then, the data in the three-dimensional array is uploaded to the host computer in batches through the serial port module according to the cow number and count. The host computer displays the temperature data string according to the cow number, time, and abnormal data bit information.

[0127] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.

Claims

1. A control method for a low-power livestock ear tag temperature measurement system, the livestock ear tag temperature measurement system comprising ear tag hardware, sub-unit hardware, and host hardware, wherein the ear tag hardware communicates with the host hardware via the sub-unit hardware, the ear tag hardware comprising a microprocessor, and peripheral circuits of the microprocessor being connected to an ear tag cow number setting DIP switch, an ear tag channel setting DIP switch, a DS18B20 temperature sensor, and an ear tag LoRa wireless module, wherein the microprocessor is used for acquiring and transmitting body temperature data and encapsulating a custom protocol, the DS18B20 temperature sensor is used for acquiring livestock body temperature data, the ear tag LoRa wireless module is used for information interaction with the sub-unit hardware, and the ear tag cow number setting DIP switch and the ear tag channel setting DIP switch are respectively used to set the ear tag hardware number and the LoRa wireless module channel frequency; The extension hardware includes an extension main controller, and the extension main controller has a clock module, a temperature and humidity module, an extension number DIP switch, an extension channel setting DIP switch, and an extension LoRa wireless module connected to its peripheral circuit; the host hardware includes a host main controller, and the host main controller has a host LoRa wireless module and a serial port module connected to it. Its features are, The control method includes the following steps: 11) Ear tag hardware for collecting livestock temperature data: Ear tag hardware collects ear temperature data from livestock; The ear tag hardware collects livestock ear temperature data, including the following steps: 111) The ear tag hardware is initialized, and the microprocessor reads the values ​​of the ear tag number setting DIP switch and the ear tag channel setting DIP switch. 112) Read the data measured by the DS18B20 temperature sensor and send the data to the ear tag LoRa wireless module to transmit to the extension hardware; When sending data, first send a two-digit preamble, and the extension hardware will detect and identify whether the beginning of the data format is correct; then send a one-digit data type, so that the extension hardware can identify that it is ear tag temperature data; then send a one-digit cow number to distinguish individual cows; then send two digits of temperature data, which are the integer part and the decimal part of the temperature; finally send a one-digit check code to mark the end of the data string. 113) Once the data is completely transmitted by the LoRa wireless module of the ear tag, the microcontroller immediately starts timer one. If the ear tag hardware receives an acknowledgment command from the extension hardware within 2 10 minutes, the ear tag hardware enters sleep mode; if the ear tag hardware does not receive an acknowledgment command from the extension hardware within 2 10 minutes, then timer three will start. 114) Timer 3 will count a random backoff time. If the ear tag hardware receives an acknowledgment command from the extension hardware within the timer 3 countdown, the system will enter sleep mode. If the ear tag hardware does not receive a confirmation command from the extension hardware within the random backoff time of Timer 3, then Timer 3 will be reset and restarted. This process will repeat 3 times. If the ear tag hardware still does not receive the confirmation instruction from the extension hardware within the third random backoff time after the timer is reset, the data transmission is considered to have failed. 115) After data transmission fails, the ear tag hardware immediately enters sleep mode and waits for the next timer one or timer three overflow to wake it up; 12) Temperature data transmission: Low-power data transmission is performed between the ear tag hardware and the extension hardware; 13) The extension unit hardware performs data reception, transmission, and processing; 14) Data transmission, reception and processing of the host hardware: The extension hardware sends data to the host hardware, which then processes it.

2. The control method for a low-power livestock ear tag temperature measurement system according to claim 1, characterized in that: The LoRa wireless module for the ear tag is a PCB antenna, and the microprocessor model is STC15W4K.

3. The control method for a low-power livestock ear tag temperature measurement system according to claim 1, characterized in that, The transmission of the temperature data includes the following steps: 31) The communication between the ear tag hardware and the extension hardware adopts a "request-response" method; When the ear tag hardware completes temperature measurement, it sends a data string carrying temperature data, cow number, and data type via the LoRa wireless module. 32) After the extension hardware has completely received the data string according to the data protocol, it sends the data string that has been completely received to the ear tag hardware; if the data received by the extension hardware is different from the custom communication protocol, it will be regarded as noise and not processed. The data string format is set as follows: The instruction from the ear tag hardware with device address n to send temperature data to the extension data management module, and the response from the extension data management module, are as follows: Send: 55 AA 01 n 18 20 00 00 00 00 00 FE; Response: 66 BB 01 n FC; 33) After receiving the confirmation data string from the extension hardware, the ear tag hardware enters a sleep state and waits for the next wake-up.

4. The control method for a low-power livestock ear tag temperature measurement system according to claim 1, characterized in that, The data reception, transmission, and processing of the extension unit hardware includes the following steps: 41) The extension unit hardware waits for data commands to receive and send data; When the ear tag hardware receives the temperature data, it receives and saves the correct data, and then sends a confirmation data command to the ear tag hardware. When it receives a self-clock calibration command from the host hardware, it rewrites its own clock data according to the data in the command, and then sends a clock data confirmation command to the host hardware. When it receives a data request instruction from the host hardware, it transmits the data it has stored and processed through the LoRa wireless module of the extension unit, and then starts a timer to wait for the host hardware to send an instruction confirming that the data has been received completely. If the extension hardware receives an acknowledgment from the host hardware during the timer's first countdown, it will clear its own data; if the extension hardware does not receive an acknowledgment from the host hardware during the timer's first countdown, it will continue to save its own data and wait to receive the next instruction. 42) Extension hardware processing: After the extension hardware fully receives the temperature data sent by the ear tag hardware, it determines which season and time of day it is based on the data read from the current clock module. Then it reads the current pen temperature and determines the upper limit of the normal body temperature of the beef cattle based on the network model based on support vector machine, which has been trained with a large amount of data. Compare the received temperature data with the upper limit of normal body temperature predicted by the network model; If the received temperature data is lower than the estimated normal body temperature, the received data will be incremented by clock data and stored in a three-dimensional array predefined according to the cow number, number of times, and number of data bits. If the received temperature data is higher than the estimated normal body temperature, then add a data anomaly flag after the received data, add clock data, and store it in a predefined three-dimensional array; When the extension unit hardware receives temperature data for the second or subsequent times, it will determine whether the temperature data is normal, and then check whether the temperature data and clock data are the same as the previously stored data. If the values ​​are the same, the received temperature data will not be stored; otherwise, it will be stored in a three-dimensional array.

5. The control method for a low-power livestock ear tag temperature measurement system according to claim 1, characterized in that, The data transmission, reception, and processing of the host hardware includes the following steps: 51) The host hardware is waiting for data instructions from the computer; When the serial port module of the host hardware receives the data clock calibration command from the computer, it converts the valid data in the command into a command that the slave hardware can recognize and transmits it through the host LoRa wireless module. When the serial port module of the host hardware receives the instruction from the computer to request data from the extension, it converts the instruction into an instruction that the extension hardware can recognize, transmits it through the host LoRa wireless module, and then starts timer two. 52) If the host hardware does not receive the temperature data from the extension hardware within the timer's second time, the host hardware sends a data reception failure command to the computer and waits for the computer's next command. If the host hardware receives the temperature data sent by the extension hardware within the timer two time period, it stores the data into a predefined three-dimensional array according to the number, number, and digit information in the temperature data. After receiving the entire temperature data, it sends a data reception confirmation command to the extension hardware. 53) The data of the three-dimensional array is uploaded to the host computer in batches through the serial port module according to the cow number and the number of times; the host computer displays the temperature data string according to the cow number, time and abnormal data bit information.