A clock timing device for an Internet of Things instrument
By designing the watchdog counting unit and the network clock acquisition unit in the IoT smart water meter, using watchdog technology and network clock calibration methods, the timing accuracy and reliability problems are solved, and the stable operation and low power consumption of the system are achieved. .
Patent Information
- Application Number
- CN201911111245.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-14
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2039-11-14
AI Technical Summary
The existing timing devices of low-power IoT smart water meters have problems with low timing accuracy and reliability, which are prone to system reset or clock deviation due to external reasons, affecting the accuracy of reporting time.
A IoT instrument clock timing device is designed, including a watchdog counting unit, a calculation processing unit, a timing comparison unit, a processing comparison clock unit and a network clock acquisition unit. Through watchdog technology and network clock calibration method, the clock is ensured. Stability and accuracy enable automatic calibration of the system and low power consumption.
The device is not affected during system reset or timing reset, ensuring the accurate completion of timing tasks, improving the reliability and timing accuracy of the system, and reducing power consumption.
Smart Images

Figure CN110856146B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of timing devices, in particular to a timing device for a clock of an Internet of Things instrument. Background Art
[0002] Low-power IoT smart water meters use IoT technology to transmit water meter collected data to the IoT platform through GPRS communication. Currently, low-power IoT smart water meters are mainly divided into 2G, 3G, 4G, and NB_IoT low-power IoT water meters. Among them, the way 2G, 3G, and 4G low-power IoT water meters handle low power consumption is to power off the IoT communication module and put the main control chip into sleep mode to achieve low power consumption. Since NB_IoT technology has long-term network attachment capabilities, the low-power consumption method of NB_IoT low-power IoT water meters is to use both the NB_IoT module and the main control chip to achieve low power consumption. The entire low-power IoT smart meter system is in a dormant state when not working, and a corresponding reporting time is set in its system. When the clock in the system reaches the reporting time set in the system, the entire low-power IoT smart meter system is awakened from the low-power state to the working mode, so as to collect and analyze data, and process and report data to the IoT platform.
[0003] In the entire low-power IoT smart meter operation mechanism, the IoT timing clock device is required to be able to operate stably and accurately time. Since most of the existing timing devices use clock chips or internal timers of single-chip microcomputers, the system may be reset due to external reasons during system operation, or the clock operation may be deviated due to the accuracy of internal and external crystal oscillators, or the clock may be inaccurate due to the aging of capacitors over a long period of use. As a result, the low-power IoT smart meter will not report the time when it is reported, affecting the use and promotion of low-power IoT smart meters. Therefore, the existing technology has the problem of low timing accuracy and reliability. Summary of the invention
[0004] In order to overcome the above-mentioned shortcomings of the prior art, an object of the present invention is to provide an Internet of Things instrument clock timing device, which has the advantages of high timing accuracy and reliability.
[0005] The technical solution adopted by the present invention to solve its technical problem is:
[0006] A clock timing device for an Internet of Things instrument comprises a watchdog counting unit, a calculation processing unit, a timing comparison unit, a processing comparison clock unit, a network clock acquisition unit and a watchdog initial value register, wherein the watchdog counting unit is communicatively coupled to the calculation processing unit and transmits a reset signal to the calculation processing unit, the watchdog initial value register is communicatively coupled to the calculation processing unit and stores a clock initial value, the calculation processing unit is communicatively coupled to the timing comparison unit and transmits a cumulative value with a timestamp to the timing comparison unit, the timing comparison unit is communicatively coupled to the processing comparison clock unit and transmits the cumulative value to the processing comparison clock unit, the network clock acquisition unit is communicatively coupled to the processing comparison clock unit and transmits network clock information to the processing comparison clock unit, and the processing comparison clock unit is communicatively coupled to the watchdog initial value register and transmits a calibration value to the watchdog initial value register.
[0007] As a further improvement of the present invention: the watchdog counting unit is provided with an oscillator, a counter and a watchdog register for driving the watchdog counting unit to count.
[0008] As a further improvement of the present invention: the timing comparison unit is provided with a timer memory, and the timer memory is provided with a comparison value.
[0009] As a further improvement of the present invention: the processing comparison clock unit is provided with a comparator memory, and the comparator memory is preset with a comparison threshold and calibration range information.
[0010] As a further improvement of the present invention: the processing comparison clock unit is communicatively coupled to the watchdog counting unit.
[0011] Compared with the prior art, the present invention has the following beneficial effects:
[0012] When the IoT smart water meter system connected to the timing device is reset or the system is reset and restarted according to the timing setting due to external reasons during operation, the watchdog clock is not affected. When the system clock reaches the timing time, it does not affect the system timing task processing, thereby ensuring the stable operation of the system and the reliability of the system during operation. At the same time, it also has the advantage of low power consumption.
[0013] The timing device automatically calibrates the unit duration of the internal clock according to the network time by comparing and calibrating the network clock with the internal clock. It has higher accuracy and more automatic clock setting capabilities, ensuring that the system timing tasks are completed accurately within the scheduled time, achieving the advantage of higher timing accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 Schematic diagram of the unit connection structure in this embodiment;
[0015] Figure 2 Schematic diagram of the connection structure of the watchdog counting unit in this embodiment.
[0016] Figure numerals: 11, watchdog counting unit; 12, calculation processing unit; 13, timing comparison unit; 14, processing comparison clock unit; 15, network clock acquisition unit; 16, watchdog initial value register. DETAILED DESCRIPTION
[0017] The present invention is further described with reference to the accompanying drawings and embodiments:
[0018] Example:
[0019] A clock timing device for an Internet of Things instrument, such as Figure 1 and Figure 2 As shown, it includes a watchdog counting unit 11, a calculation processing unit 12, a timing comparison unit 13, a processing comparison clock unit 14, a network clock acquisition unit 15 and a watchdog initial value register 16. The watchdog counting unit 11 is communicatively coupled to the calculation processing unit 12 and transmits a reset signal to the calculation processing unit 12. The watchdog initial value register 16 is communicatively coupled to the calculation processing unit 12 and stores the clock initial value. The calculation processing unit 12 is communicatively coupled to the timing comparison unit 13 and transmits an accumulated value with a timestamp to the timing comparison unit 13. The timing comparison unit 13 is communicatively coupled to the processing comparison clock unit 14 and transmits the accumulated value to the processing comparison clock unit 14. In this embodiment, the network clock acquisition unit 15 is connected to the Internet through the GPRS communication mode and obtains network clock information through the Internet. The network clock acquisition unit 15 is communicatively coupled to the processing comparison clock unit 14 and transmits the network clock information to the processing comparison clock unit 14. The processing comparison clock unit 14 is communicatively coupled to the watchdog initial value register 16 and transmits a calibration value to the watchdog initial value register 16.
[0020] The watchdog counting unit 11 is provided with an oscillator, a counter and a watchdog register for driving the watchdog counting unit 11 to count.
[0021] The timing comparison unit 13 is provided with a timer memory, and a comparison value is stored in the timer memory.
[0022] The processing comparison clock unit 14 is provided with a comparator memory, and the comparator memory is preset with a comparison threshold and calibration range information.
[0023] The process comparison clock unit 14 is communicatively coupled to the watchdog counting unit 11 .
[0024] In this embodiment, the processing and comparison clock unit 14 is connected to the Internet of Things water meter system. When the processing and comparison clock unit 14 does not send a watchdog signal to the Internet of Things water meter system, the Internet of Things water meter system is in a sleep state. When the processing and comparison clock unit 14 sends a watchdog signal to the Internet of Things water meter system, the Internet of Things water meter system is awakened from sleep and collects and uploads data, and then enters sleep again, effectively reducing power consumption and achieving the advantage of low power consumption during operation.
[0025] The watchdog technology unit has an internal independent oscillator drive. The watchdog clock is set by frequency division. The watchdog technology unit performs internal startup work, and the oscillator and counter start counting. When the counter count reaches the frequency division setting value, the signal is transmitted to the watchdog counter, and the watchdog counter starts counting and accumulating. The watchdog register is preset with a reset value. When the watchdog counter count accumulation value is equal to the reset value set in the watchdog register, a reset signal is output, and the register is reset to the initial value.
[0026] After receiving the reset signal sent by the watchdog counting unit 11, the computing processing unit 12 is awakened from the sleep state, starts to accumulate the reset signal to obtain the accumulated value, and reads the clock initial value in the watchdog initial value register 16, and uses the clock initial value to transmit the accumulated value with a timestamp to the timing comparison unit 13.
[0027] The timing comparison unit 13 compares the accumulated value with the comparison value preset in the timer memory. When the accumulated value is less than the comparison value, the timing comparison unit 13 does not output the accumulated value, and the IoT smart water meter system connected to the timing device is in a dormant state; when the accumulated value is equal to the comparison value, the timing comparison unit 13 transmits the accumulated value to the processing comparison clock unit 14.
[0028] The network clock acquisition unit 15 acquires network clock information through the Internet, and transmits the network clock information to the processing and comparing clock unit 14 .
[0029] The processing comparison clock unit 14 obtains the comparison threshold, calibration range information, network clock information and cumulative value with timestamp preset in the comparator memory, and the processing comparison clock unit 14 compares the network event information with the timestamp of the cumulative value.
[0030] When the difference is less than the set comparison threshold, a watchdog signal is output, so that the Internet of Things water meter system connected to the timing device is awakened from sleep and data is collected and uploaded.
[0031] In this embodiment, the calibration range information includes a maximum calibration value and a minimum calibration value. When the difference is between the maximum calibration value and the minimum calibration value, the processing comparison clock unit 14 transmits the network clock information to the watchdog initial value register 16, and updates the clock initial value through the network clock information to improve the timing accuracy. After several cycles (5 cycles are used in this embodiment), the network clock information and timestamp are obtained again, and the difference is calculated again. The reset value of the watchdog register and the watchdog frequency division are calculated by the recalculated difference and the cycle, and the unit duration of the watchdog clock is calibrated, which can also improve the timing accuracy.
[0032] This embodiment has the following advantages:
[0033] When the IoT smart water meter system connected to the timing device is reset or the system is reset and restarted according to the timing setting due to external reasons during operation, the watchdog clock is not affected. When the system clock reaches the timing time, it does not affect the system timing task processing, thereby ensuring the stable operation of the system and the reliability of the system during operation. At the same time, it also has the advantage of low power consumption.
[0034] The timing device automatically calibrates the unit duration of the internal clock according to the network time by comparing and calibrating the network clock with the internal clock. It has higher accuracy and more automatic clock setting capabilities, ensuring that the system timing tasks are completed accurately within the scheduled time.
[0035] In summary, after reading the present invention document, ordinary technicians in this field can make various other corresponding transformation schemes based on the technical scheme and technical concept of the present invention without creative mental work, which all fall within the scope of protection of the present invention.
Claims
1. An IoT instrument clock timing device, characterized in that: The invention comprises a watchdog counting unit (11), a computing processing unit (12), a timing comparison unit (13), a processing comparison clock unit (14), a network clock acquisition unit (15) and a watchdog initial value register (16), wherein the watchdog counting unit (11) is communicatively coupled to the computing processing unit (12) and transmits a reset signal to the computing processing unit (12), the watchdog initial value register (16) is communicatively coupled to the computing processing unit (12) and stores a clock initial value, and the computing processing unit (12) is communicatively coupled to the timing comparison unit (13) The timing comparison unit (13) is coupled to and transmits the accumulated value with a time stamp to the timing comparison unit (13), the timing comparison unit (13) is communicatively coupled to the processing comparison clock unit (14) and transmits the accumulated value with a time stamp to the processing comparison clock unit (14), the network clock acquisition unit (15) is communicatively coupled to the processing comparison clock unit (14) and transmits network clock information to the processing comparison clock unit (14), the processing comparison clock unit (14) is communicatively coupled to the watchdog initial value register (16) and transmits a calibration value to the watchdog initial value register (16); The processing and comparison clock unit (14) compares the network clock information with the timestamp of the accumulated value with the timestamp; when the comparison result meets the preset condition, the processing and comparison clock unit (14) outputs a watchdog signal to the Internet of Things water meter system, and the watchdog signal wakes up the Internet of Things water meter system from sleep mode and performs data collection and uploading; The watchdog counting unit (11) is provided with an oscillator, a watchdog counter and a watchdog register for driving the watchdog counting unit (11) to count; A reset value is preset in the watchdog register. When the accumulated count value of the watchdog counter is equal to the reset value set in the watchdog register, a reset signal is output and the watchdog register is reset to the initial value.
2. The IoT instrument clock timing device according to claim 1, characterized in that: The timing comparison unit (13) is provided with a timer memory, in which a comparison value is provided.
3. The IoT instrument clock timing device according to claim 1, characterized in that: The processing comparison clock unit (14) is provided with a comparator memory, and the comparator memory is preset with a comparison threshold and calibration range information.
4. The IoT instrument clock timing device according to claim 1, characterized in that: The process comparison clock unit (14) is communicatively coupled to the watchdog counting unit (11).