CN111756462B - Time calibration method and device for clock - Google Patents

Time calibration method and device for clock Download PDF

Info

Publication number
CN111756462B
CN111756462B CN201910241765.7A CN201910241765A CN111756462B CN 111756462 B CN111756462 B CN 111756462B CN 201910241765 A CN201910241765 A CN 201910241765A CN 111756462 B CN111756462 B CN 111756462B
Authority
CN
China
Prior art keywords
time
pointer
network
clock
system time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910241765.7A
Other languages
Chinese (zh)
Other versions
CN111756462A (en
Inventor
伦观涛
易磊
陈彪
李国武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Wutai Electronics Co ltd
Original Assignee
Shanghai Wutai Electronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Wutai Electronics Co ltd filed Critical Shanghai Wutai Electronics Co ltd
Priority to CN201910241765.7A priority Critical patent/CN111756462B/en
Publication of CN111756462A publication Critical patent/CN111756462A/en
Application granted granted Critical
Publication of CN111756462B publication Critical patent/CN111756462B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Electric Clocks (AREA)

Abstract

The embodiment of the application discloses a time calibration method and a time calibration device of a clock, which are connected with an Internet wireless access point through a wireless network module; acquiring network time from a time server of a network through the Internet wireless access point; and updating the current system time according to the acquired network time and synchronizing the current system time with the network time, and controlling the motor to drive the pointer to rotate according to the difference between the current system time and the pointer time of the clock so as to synchronize with the current system time. The time adjustment method and the time adjustment device of the clock can achieve more accurate time synchronization by acquiring the network time of the network and automatically adjusting the pointer according to the network time.

Description

Time calibration method and device for clock
Technical Field
The embodiment of the application relates to the technical field of consumer electronics, in particular to a time calibration method and device of a clock.
Background
A timepiece is a timing device, and is also a precision instrument that meters and indicates time.
The clock is an indispensable article in people's daily life, but the inaccurate time of clock is also a well-known shortcoming that puzzles people from the time the clock was invented. For example, time may not be synchronized for various reasons, such as insufficient battery power, no horizontal placement or collision problems, and there is a possibility that time may not be synchronized, such as when an external clock reference source signal is lost, the frequency of the reference source deviates too much from the local crystal oscillator frequency, the reference source frequency is unstable, and jitter is too large, for example, mainly for the following reasons: if the clock reference source is a global positioning system (Global Positioning System, GPS), it may be a satellite card antenna failure or a satellite lock deficiency; if a line clock, it may be a transmission line fault between the base station and the clock reference source; if the clock reference source is a shared clock, the clock reference source may be an exception to another standard configuration.
The current clock synchronization technology, for example, uses manual calibration, and uses radio wave propagation time information, i.e. uses radio waves to transmit time standard.
However, the above-described time synchronization method, if manually calibrated, results in time and effort, is expensive if radio waves are used, and requires the arrangement of radio wave emitting devices.
Disclosure of Invention
Aspects of the present application provide a time calibration method and apparatus for a clock, which acquire network time of the internet through an internet wireless access point and automatically calibrate a pointer according to the network time, thereby achieving more accurate time synchronization.
An aspect of the present application provides a time calibration method of a clock, including: connecting an Internet wireless access point through a wireless network module; acquiring network time from a time server of a network through the Internet wireless access point; and updating the current system time according to the acquired network time and synchronizing the current system time with the network time, and controlling the motor to drive the pointer to rotate according to the difference between the current system time and the pointer time of the clock so as to synchronize with the current system time.
Optionally, the controlling the motor to drive the pointer to rotate according to the difference between the current system time and the pointer time of the clock to synchronize with the current system time specifically includes:
and comparing the current system time with the pointer time in real time to obtain a difference value between the system time and the pointer time, and driving the pointer to rotate at a speed faster than the system time according to the difference value so as to synchronize the time indicated by the pointer with the system time.
Optionally, the wireless network module is periodically powered by a switch to connect to the internet wireless access point to periodically calibrate time.
Optionally, the method further comprises: periodically detecting the battery power, and controlling the pointer to stop at a zero position through the motor when the battery power is lower than a threshold value; or periodically detecting the battery power, and controlling the pointer to stop at a preset position through the motor when the battery power is lower than a threshold value.
Optionally, the method further comprises: and calibrating the count value of the crystal oscillator according to the difference value of the network time and the system time, and calculating the crystal oscillator frequency by adopting the following formula:
wherein the method comprises the steps of
Wherein f estimate Is an estimation of the actual frequency of the crystal, f orig Is the crystal vibration frequency t used for the system to schedule in the last time period net Is the current network time, t, obtained from the network sys Is the local current system time of the clock, t inter Is the time interval between two synchronizations.
In another aspect, the present application also provides a time calibration device for a clock, including:
the wireless network module is used for connecting with an Internet wireless access point;
and the processor is used for acquiring accurate network time from a time server of a network through the Internet wireless access point, updating the current system time according to the acquired network time and synchronizing the current system time with the network time, and controlling the motor to drive the pointer to rotate according to the difference between the current system time and the pointer time of the clock so as to synchronize with the current system time.
Optionally, the processor is configured to compare the current system time and the pointer time in real time to obtain a difference between the system time and the pointer time, and drive the pointer to rotate at a speed faster than the system time according to the difference so as to synchronize the time indicated by the pointer with the system time.
Optionally, the wireless network module is periodically powered or by a switch to connect to the internet wireless access point, so that the processor periodically calibrates time.
Optionally, the processor is further configured to periodically detect a battery level, and control the pointer to stop at the zero position by the motor when the battery level is below a threshold; or, the device is used for periodically detecting the battery power, and when the battery power is lower than a threshold value, the motor is used for controlling the pointer to stop at a preset position.
Optionally, the processor is further configured to calibrate a count value of the crystal oscillator according to a difference value between the network time and the system time, and calculate a crystal oscillator frequency according to the following formula:
wherein the method comprises the steps of
Wherein f estimate Is an estimation of the actual frequency of the crystal, f orig Is the crystal vibration frequency t used for the system to schedule in the last time period net Is the current network time, t, obtained from the network sys Is the local current system time of the clock, t inter Is the time interval between two synchronizations.
According to the time calibration method and the time calibration device for the clock, which are provided by the aspects of the application, the network time of the Internet is obtained, and the pointer is automatically calibrated according to the network time, so that more accurate time synchronization is realized.
Drawings
Fig. 1 is a schematic structural diagram of a time calibration device of a clock according to an embodiment of the application.
Fig. 2 is a flowchart of a time calibration method of a clock according to another embodiment of the application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship. In addition, the terms "system" and "network" are often used interchangeably herein.
Fig. 1 is a schematic structural diagram of a time calibration device of a clock according to an embodiment of the present application, where the clock may be a wall-mounted clock, a desk clock or a hand clock, and the clock includes the time calibration device.
The time calibration device of the clock comprises: the wireless network module 101, the processor 102 and the motor 103 are mutually connected through buses.
The wireless network module 101 adopts a universal asynchronous receiver Transmitter (Universal Asynchronous Receiver/Transmitter, UART) interface, accords with the network standard of an IEEE802.11 protocol stack based on the characteristic of a universal serial interface, embeds a transmission control protocol (Transmission Control Protocol, TCP)/internet protocol (Internet Protocol, IP) stack, can realize any transparent conversion among 3 interfaces of a user serial port, an ethernet and a wireless network (WIFI), and supports the baud rate range: 1200-115200 bit rate (bps), supporting a frequency range: 2.412-2.484 gigahertz (GHz), supporting a variety of network protocols: TCP, user datagram protocol (User Datagram Protocol, UDP), internet protocol (Internet Control Message Protocol, ICMP), dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP), domain name system (Domain Name System, DNS), hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP).
The processor 102 may be a single processing device or may include multiple processing devices, for example, the processing device may be a central processing unit (Central Processing Unit, CPU) or a graphics processing unit (graphics processing unit, GPU), the processor 102 may also be other general purpose control processors, digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general control processor may be a micro control processor or any conventional control processor, such as a single chip microcomputer or the like.
The motors 103 comprise a clock motor, a minute hand motor and a second hand motor, the time alignment device of the clock further comprising a hand 105, the hand 105 comprising an hour hand, a minute hand and a second hand, the clock motor being arranged to drive the hour hand, the minute hand motor being arranged to drive the minute hand, the second hand motor being arranged to drive the second hand, each motor comprising a coil and a corresponding rotor, the rotors being connected to the respective hand 105, e.g. the rotors of the clock motor being connected to the hour hand of the clock, the rotors of the minute hand motor being connected to the minute hand of the clock, the rotors of the second hand motor being connected to the second hand of the clock, the rotational speed of the rotors of each motor being dependent on the current of the motor, and the current of the motor being controlled by the processor 102.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, a peripheral component interconnect (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus system may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
In another embodiment of the present application, the time alignment device of the clock further includes a memory 104, the memory 104 is configured to store program codes or instructions, the program codes include computer operation instructions, and the processor 102 is configured to execute the program codes or instructions stored in the memory 104 to perform the related functions.
The memory 104 may comprise volatile memory, such as random access memory (random access memory, RAM), which may include static RAM or dynamic RAM. The memory 104 may also include a non-volatile memory (non-volatile memory), such as a read-only memory (PROM), a programmable read-only memory (programmable read-only memory, PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), or a flash memory (flash memory). The memory 104 may also be external flash memory, at least one disk memory, or a buffer.
In another embodiment of the present application, the time calibration device of the clock further includes a controllable switch 106 for controlling whether to supply power to the wireless network module 101, for example, the processor 102 controls the controllable switch 106 to be turned on and off, for example, when the controllable switch 106 is turned on, a battery of the clock is connected to the wireless network module 101, and when the controllable switch 106 is turned off, the battery of the clock supplies power to the wireless network module 101, and when the controllable switch 106 is turned off, the battery of the clock is disconnected from the wireless network module 101, and no power is supplied.
For example, the time calibration device of the clock further includes a power control circuit 107, where the power control circuit 107 is connected to a battery 108, and the battery 108 may be various acid or alkaline batteries, for example, one or more dry cells No. 5 or No. 7, or one or more button cells, where the power control circuit 107 is connected to the processor 102 through the bus, and the power control circuit 107 is further connected to the motor 103, the memory 104, and the controllable switch 106, respectively, and the controllable switch is further connected to the wireless network module 101, and the processor 102 controls the power control circuit 107 to supply power to the processor 102, the motor 103, and the memory 104, respectively, and controls on and off of the controllable switch 106.
The time calibration device of the clock may operate as described below, for example, after the power-on, the processor 102 first controls the motor 103 to rotate the pointer 105 to zero, for example, the processor 102 determines whether the pointer 105 returns to a zero position (e.g. 12:00 position), for example, the processor 102 determines whether the hour hand, minute hand and/or second hand returns to a zero position, for example, an infrared diode (Light Emitting Diode, LED) pair is disposed on respective gears for the hour hand, minute hand and second hand, respectively. For example, when the hour hand is in the zero position, the LED on the corresponding gear of the hour hand is turned on to the tube; when the minute hand is at the zero position, the LED on the gear corresponding to the minute hand is conducted with the pipe; when the second hand is at the zero position, the LED on the gear corresponding to the second hand is conducted to the tube, and the processor 102 acquires signals that the LEDs corresponding to the hour hand, the minute hand and the second hand are conducted to the tube respectively, so that the hour hand, the minute hand and/or the second hand are returned to the zero position.
The processor 102 is further configured to open the controllable switch 106 to power up the wireless network module 101. For example, when the processor 102 determines that the hour, minute, and/or second hand is back to the zero position, the processor 102 opens the controllable switch 106. In another embodiment of the present application, the processor 102 is further configured to open the controllable switch 106 periodically, for example, the period may be 3, 6, 9, 12, or 24 hours, to reduce the power consumption, and to reduce the number of times the controllable switch 106 is opened, for example, the processor 102 opens the controllable switch 106 once every 24 hours. In another embodiment of the application, the controllable switch 106 may also be opened manually.
The wireless network module 101 has a Wi-Fi function, and connects to an internet wireless Access Point (AP) through Wi-Fi after power-on, thereby connecting to a time server of the internet, the internet wireless Access Point may be a wireless router or a wireless terminal having a wireless AP function, the wireless router may be connected to the internet, and the wireless terminal may be connected to various communication systems such as a 2G, 3G, 4G communication system and a next generation communication system (e.g., 5G). The wireless terminal may be a device that provides voice and/or data connectivity to a user, a handheld device with wireless connectivity, or other processing device connected to a wireless modem. For example, a wireless terminal may communicate with one or more core networks via a radio access network (Radio Access Network, RAN), e.g., the wireless terminal may be a Wi-Fi enabled computer, which may be a desktop, laptop, or tablet computer, and a mobile terminal, which may be a mobile phone (or "cellular" phone) and a computer with a mobile terminal, which may be, e.g., a portable, pocket, hand-held, computer-built-in, or vehicle-mounted mobile device that exchanges voice and/or data with the radio access network.
The processor 102 is configured to detect whether the hands of the clock are in a zero position (e.g., 12:00), and if the hands of the clock (e.g., hour, minute, and/or second hands) are not in the zero position, control the motor to move the hands to the zero position and stop at the zero position, which may be referred to as pointer zeroing, and if the hands of the clock are in the zero position, control the hands to stop at the zero position. The processor 102 obtains accurate network time from a time server on the internet through the internet wireless access point, updates the current system time according to the obtained network time to synchronize with the network time, controls the motor 103 to drive the pointer 105 to rotate according to the difference between the current system time and the pointer time of the clock to synchronize with the current system time, and can correctly indicate time and synchronize with the network time. For example, the current system time and the pointer time are compared in real time to obtain a difference between the system time and the pointer time, and the pointer is driven to rotate at a speed faster than the system time according to the difference so as to synchronize the time indicated by the pointer with the system time. For example, after the pointer has zeroed, if an accurate network time has been obtained from the network, the motor 103 drives the minute hand and/or the second hand to the corresponding position after the pointer has been at the zero position for a short time, i.e. in synchronization with the current system time. In another embodiment of the present application, the motor 103 may also drive the hour hand to a corresponding position, i.e. in synchronization with the current system time.
For example, the processor 102 may drive the local crystal oscillator to update the current system time to coincide with the network time, and calibrate the pointer based on the system time to keep the pointer time indicated by the pointer coincident with the system time, e.g., compare the difference between the system time and the pointer time in real time, and drive the pointer to rotate at a faster rate than the system time is traveling based on the difference to synchronize the time indicated by the pointer with the system time.
In another embodiment of the application, the processor 102 may periodically perform network time synchronization, e.g., the processor 102 obtains the current network time through network synchronization at intervals and calibrates the current pointer time accordingly, i.e., periodically calibrates the pointer (including hour, minute, and/or second hand) position.
In another embodiment of the application, the processor 102 stops the second hand at a predetermined position when the network sync times out and retries a predetermined number of times, indicating a network abnormal state, for example, the second hand is stopped at a zero position or a 30 minute position.
In another embodiment of the present application, the processor 102 calibrates the count value of the crystal oscillator according to the difference between the network time and the local system time during time calibration, so as to improve the running accuracy of the local crystal oscillator, which may be referred to as crystal oscillator training. For example, the processor 102 may calculate the crystal frequency using the following formula:
wherein the method comprises the steps of
Wherein f estimate Is an estimation of the actual frequency of the crystal, f orig Is the crystal vibration frequency t used for the system to schedule in the last time period net Is the current network time, t, obtained from the network sys Is the local current system time of the clock, t inter Is the time interval between two synchronizations. By calculating f orig The ratio between the actual corresponding time and the actual frequency is obtained. The frequency value obtained is a floating point number, and the system time is an integer, in order not to lose accuracy when the system time is running, the crystal oscillator counter is set to be the floating point number, when the counter value is larger than f estimate When f is subtracted from the counter estimate The system seconds count is incremented by 1 and the next second is successively incremented from the remaining fraction of the counter. This, although there is a slight error in the accuracy per second, does not cause an accumulated error because when the decimal numbers are accumulated into counts of one unit, the time of one count will be reduced in that second.
In another embodiment of the application, the processor 102 calibrates the pointer position at a fixed time of day, a process that may be referred to as pointer calibration.
In another embodiment of the application, the processor 102 stops the seconds hand at a specified position (e.g., zero position) indicating this state when the number of network synchronization failures reaches an upper limit.
In another embodiment of the present application, the processor 102 periodically checks the current battery level, and when the remaining battery level is low, the second hand is stopped at the zero position to indicate a state where the remaining battery level is low.
If the processor 102 detects that the pointer of the clock is in the zero position, the pointer is controlled to stop at the zero position until time synchronization is successful, which may be referred to as pointer tracking. After the pointer tracking is completed, the processor 102 updates the current time (i.e., the system time) according to a local timing manner and drives the pointer to rotate in real time, which may be referred to as pointer walking.
If there is a large difference between the second hand and the correct time, the rotation speed of the second hand is slowed down by the motor 103 until it is synchronized with the correct time; the split case is handled if the split needle is different from the correct time, and waits in place until synchronization when the split needle is slightly advanced, otherwise it is rotated rapidly by the motor 103 until synchronization.
In another embodiment of the present application, if the processor 102 determines that the pointer 105 is not located at the zero position, the processor 102 may wait until the pointer 105 returns to the zero position, and then perform the time alignment described above. In another embodiment of the present application, if the processor 102 determines that the pointer 105 is not located at the zero position, the processor 102 may also determine the current position of the pointer 105 first, obtain a pointer time according to the current position of the pointer 105, update a current system time according to the obtained network time to synchronize with the network time, and then perform the time calibration process described above. The system time and the pointer time are compared in real time, and the pointer is driven to rotate at a speed faster than the system time according to the difference value, so that the pointer time and the system time are synchronous.
In another embodiment of the present application, the processor 102 is further configured to periodically detect the power of the battery 108, for example, the processor 102 periodically detects the power of the battery 108 through the power control circuit 107, for example, the period may be 3, 6, 9, 12, or 24 hours, and when the processor 102 detects that the power of the battery 108 is lower than a threshold (for example, 20%), the pointer 105 (for example, a minute and/or a second hand) is controlled to stop at 12 through the motor 103: a 00 position; or, when the battery 108 is below a threshold (e.g., 20%), the pointer 105 (e.g., minute and/or second hand) is controlled to stop at a predetermined position by the motor 103, e.g., 6:00 position.
According to the time calibration device of the clock, based on the wifi communication, accurate time is obtained, and the clock running time is accurate through a crystal oscillator training algorithm. The specific crystal oscillator training algorithm is described above and will not be described in detail herein.
In another embodiment of the present application, as shown in fig. 2, a flow chart of a time calibration method of a clock according to another embodiment of the present application is provided, and the time calibration method of the clock can be described as follows in conjunction with the time calibration device of the clock described above.
Step 201, start-up, the processor controls the motor to rotate the pointer and detects whether the pointer is reset to zero.
For example, the processor determines whether the hand is returned to a zero position (e.g., a 12:00 position), e.g., the processor determines whether the hour, minute and/or second hands are returned to a zero position, e.g., infrared LED pairs are provided on respective gears for the hour, minute and second hands, respectively, e.g., when the hour is in the zero position, the LED pairs on the corresponding gears of the hour are on; when the minute hand is at the zero position, the LED on the gear corresponding to the minute hand is conducted with the pipe; when the second hand is at the zero position, the LED pair tubes on the gear corresponding to the second hand are conducted, the processor acquires signals for conducting the LED pair tubes corresponding to the hour hand, the minute hand and the second hand respectively, and then the hour hand, the minute hand and/or the second hand are judged to return to the zero position.
And after the wireless network module is started, controlling the motor to rotate the pointer to return to the zero position and stop at the zero position, and controlling a power supply to supply power to the wireless network module.
Step 202, turning on a controllable switch to power up a wireless network module.
For example, the processor turns on the controllable switch when the processor determines that the hour, minute and/or second hand is back to the zero position. In another embodiment of the present application, the processor turns on the controllable switch periodically, for example, the period may be 3, 6, 9, 12 or 24 hours, and to reduce power consumption, the number of times the controllable switch is turned on is reduced as much as possible, for example, the processor turns on the controllable switch once every 24 hours. In another embodiment of the application, the controllable switch 106 may also be opened manually.
And 203, after the wireless network module is powered on, connecting the wireless access point of the Internet through Wi-Fi.
In step 204, the processor obtains accurate network time from a time server of the network through the internet wireless access point.
The Internet wireless access point can acquire accurate network time from a time server on the Internet, the processor is connected with the network through the wireless network module, and the accurate network time is acquired from the time server of the network through the Internet wireless access point.
Step 205, updating the current system time according to the acquired network time and synchronizing the current system time with the network time, and controlling the motor to drive the pointer to rotate according to the difference between the current system time and the pointer time of the clock so as to synchronize with the current system time.
For example, the current system time and the pointer time are compared in real time to obtain a difference between the system time and the pointer time, and the pointer is driven to rotate at a speed faster than the system time according to the difference so as to synchronize the time indicated by the pointer with the system time. For example, after the pointer has zeroed, if an accurate network time has been obtained from the network, the motor drives the minute hand and/or the second hand to the corresponding position after the pointer has been at the zero position for a short time, i.e. in synchronization with the current system time. In another embodiment of the application, the motor may also drive the hour hand to a corresponding position, i.e. in synchronism with the current system time.
For example, the local crystal oscillator is driven to update the current system time to be consistent with the network time, the pointer is calibrated according to the system time to enable the pointer time indicated by the pointer to be consistent with the system time, for example, the difference value between the system time and the pointer time is compared in real time, and the pointer is driven to rotate at a speed faster than the system time according to the difference value so as to enable the time indicated by the pointer to be synchronous with the system time.
In another embodiment of the application, network time synchronization may be performed periodically, e.g. by network synchronization obtaining the current network time at intervals and calibrating the current pointer time accordingly, i.e. periodically calibrating the pointer (including hour, minute and/or second hand) position.
In another embodiment of the application, when the network sync times out and retries a predetermined number of times, the stop of the second hand at a predetermined position indicates a network abnormal state, for example, the stop of the second hand at a zero position or a 30 minute position.
In another embodiment of the application, the counting value of the crystal oscillator is calibrated according to the difference value between the network time and the local system time in time calibration, so that the running accuracy of the local crystal oscillator is improved, and the process can be called crystal oscillator training. For example, the crystal oscillator frequency is calculated using the following formula:
wherein the method comprises the steps of
Wherein f estimate Is an estimation of the actual frequency of the crystal, f orig Is the crystal vibration frequency t used for the system to schedule in the last time period net Is the current network time, t, obtained from the network sys Is the local current system time of the clock, t inter Is the time interval between two synchronizations. By calculating f orig The ratio between the actual corresponding time and the actual frequency is obtained. The frequency value obtained is a floating point number, and the system time is an integer, in order not to lose accuracy when the system time is running, the crystal oscillator counter is set to be the floating point number, when the counter value is larger than f estimate When f is subtracted from the counter estimate The system seconds count is incremented by 1 and the next second is successively incremented from the remaining fraction of the counter. This, although there is a slight error in the accuracy per second, does not cause an accumulated error because when the decimal numbers are accumulated into counts of one unit, the time of one count will be reduced in that second.
In another embodiment of the application, the pointer position is calibrated at a fixed time of day, a process which may be referred to as pointer calibration.
In another embodiment of the application, stopping the seconds hand at a specified position (e.g., zero position) indicates this state when the number of network synchronization failures has reached an upper limit.
In another embodiment of the present application, the current battery level is periodically checked, and when the remaining battery level is low, a stop hand is stopped at a zero position to indicate a state where the remaining battery level is low.
If the pointer of the clock is detected to be at the zero position, the pointer is controlled to be stopped at the zero position until time synchronization is successful, and the process can be called pointer timing. After the pointer tracking is completed, the current time (i.e. the system time) is updated according to the local timing mode and the pointer is driven to rotate in real time, and this process can be called pointer travel time.
If there is a difference between the second hand and the correct time exceeding a threshold value, the rotation speed of the second hand is slowed down by the motor until the second hand is synchronous with the correct time; the situation is treated if the minute hand is different from the correct time, the minute hand waits in place until synchronous when the minute hand is slightly advanced, otherwise the minute hand is rapidly rotated by the motor until synchronous.
In another embodiment of the application, if the processor determines that the pointer is not at the zero position, the time alignment described above may be performed again by waiting for the pointer to return to the zero position.
In another embodiment of the present application, if the processor determines that the pointer is not located at the zero position, the processor may also determine the current position of the pointer first, obtain a pointer time according to the current position of the pointer, update a current system time according to the obtained network time, synchronize with the network time, and then perform the time calibration process described above. The system time and the pointer time are compared in real time, and the pointer is driven to rotate at a speed faster than the system time according to the difference value, so that the pointer time and the system time are synchronous.
In another embodiment of the application, the charge of the battery 108 is periodically detected, for example, by a power control circuit, for example, the period may be 3, 6, 9, 12 or 24 hours, when the charge of the battery is detected to be below a threshold (e.g., 20%), the hands (e.g., minute and/or second hands) are controlled to stop at 12 by the motor: a 00 position; or, when the battery level is lower than a threshold (e.g., 20%), the hand (e.g., minute and/or second hand) is controlled to stop at a predetermined position by the motor, e.g., 6:00 position.
According to the time calibration method of the clock, based on the wifi communication, accurate time is obtained, and the clock running time is accurate through the self-adaptive algorithm.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
As will be appreciated by those skilled in the art: all or part of the steps of implementing the above method embodiments may be implemented by hardware related to program instructions, where the foregoing program may be stored in a computer readable storage medium and executed by a processor inside the communication device, where the foregoing program when executed may perform all or part of the steps including the above method embodiments. Wherein the processor may be implemented as one or more processor chips or may be part of one or more application specific integrated circuits (Application Specific Integrated Circuit, ASIC); and the aforementioned storage medium may include, but is not limited to, the following types of storage media: flash Memory (Flash Memory), read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (6)

1. A method for time alignment of a clock, comprising:
connecting an Internet wireless access point through a wireless network module;
acquiring network time from a time server of a network through the Internet wireless access point; updating the current system time according to the acquired network time and synchronizing the current system time with the network time, and controlling a motor to drive the pointer to rotate according to the difference value between the current system time and the pointer time of the clock so as to synchronize with the current system time;
the wireless network module is periodically powered through a switch to connect the Internet wireless access point so as to periodically calibrate time;
and calibrating the count value of the crystal oscillator according to the difference value of the network time and the system time, and calculating the crystal oscillator frequency by adopting the following formula:
wherein the method comprises the steps of
Wherein f estimate Is an estimation of the actual frequency of the crystal, f orig Is the crystal vibration frequency t used for the system to schedule in the last time period net Is the current network time, t, obtained from the network sys Is the local current system time of the clock, t inter Is the time interval between two synchronizations.
2. The method of claim 1, wherein controlling the motor to rotate the pointer based on the difference between the current system time and the pointer time of the clock comprises:
and comparing the current system time with the pointer time in real time to obtain a difference value between the system time and the pointer time, and driving the pointer to rotate at a speed faster than the system time according to the difference value so as to synchronize the time indicated by the pointer with the system time.
3. The method of claim 1 or 2, wherein the method further comprises:
periodically detecting the battery power, and controlling the pointer to stop at a zero position through the motor when the battery power is lower than a threshold value; or alternatively, the first and second heat exchangers may be,
and periodically detecting the battery power, and controlling the pointer to stop at a preset position through the motor when the battery power is lower than a threshold value.
4. A time alignment apparatus for a clock, comprising:
the wireless network module is used for connecting with an Internet wireless access point;
the processor is used for acquiring accurate network time from a time server of a network through the Internet wireless access point, updating the current system time according to the acquired network time and synchronizing the current system time with the network time, and controlling a motor to drive the pointer to rotate according to the difference between the current system time and the pointer time of the clock so as to synchronize with the current system time; the wireless network module is periodically powered or by a switch to connect the internet wireless access point so that the processor periodically calibrates time;
the processor is further configured to calibrate a count value of the crystal oscillator according to a difference value between the network time and the system time, and calculate a crystal oscillator frequency according to the following formula:
wherein the method comprises the steps of
Wherein f estimate Is an estimation of the actual frequency of the crystal, f orig Is the crystal vibration frequency t used for the system to schedule in the last time period net Is the current network time, t, obtained from the network sys Is the local current system time of the clock, t inter Is the time interval between two synchronizations.
5. The apparatus of claim 4 wherein said processor is configured to compare in real time the current system time with the pointer time to obtain a difference between the system time and the pointer time, and to drive the pointer to rotate at a faster rate than the system time is to travel based on the difference to synchronize the time indicated by the pointer with the system time.
6. The apparatus of claim 4 or 5, wherein the processor is further configured to periodically detect battery charge, the pointer being controlled by the motor to stop at a zero position when the battery charge is below a threshold; or, the device is used for periodically detecting the battery power, and when the battery power is lower than a threshold value, the motor is used for controlling the pointer to stop at a preset position.
CN201910241765.7A 2019-03-28 2019-03-28 Time calibration method and device for clock Active CN111756462B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910241765.7A CN111756462B (en) 2019-03-28 2019-03-28 Time calibration method and device for clock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910241765.7A CN111756462B (en) 2019-03-28 2019-03-28 Time calibration method and device for clock

Publications (2)

Publication Number Publication Date
CN111756462A CN111756462A (en) 2020-10-09
CN111756462B true CN111756462B (en) 2023-09-22

Family

ID=72672091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910241765.7A Active CN111756462B (en) 2019-03-28 2019-03-28 Time calibration method and device for clock

Country Status (1)

Country Link
CN (1) CN111756462B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116136706A (en) * 2021-11-16 2023-05-19 北京罗克维尔斯科技有限公司 Time precision improving method, device, module and vehicle-mounted system
CN114253118A (en) * 2021-12-06 2022-03-29 珠海经济特区南森科技有限公司 Mechanical pointer type automobile clock system and travel time method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995461A (en) * 2014-05-14 2014-08-20 王辉 Bluetooth radio wave zero calibration and timing system and method
CN104503220A (en) * 2014-11-18 2015-04-08 深圳市金立通信设备有限公司 Terminal, clock and clock calibration system
CN104503222A (en) * 2014-12-30 2015-04-08 飞亚达(集团)股份有限公司 Watch and method for synchronizing time thereof
CN104932248A (en) * 2015-07-03 2015-09-23 烟台钟表研究所有限公司 Control method of pointer type CDMA quartz clock
CN206147282U (en) * 2016-11-04 2017-05-03 中国计量大学 Bluetooth of mobile phone calibrating device of pointer -type clock
CN107145064A (en) * 2017-07-14 2017-09-08 成都天奥电子股份有限公司 A kind of clock changes the time keeping method after battery
CN107919934A (en) * 2017-11-20 2018-04-17 广州谨华电子科技有限公司 A kind of clock and clock correcting method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7155176B2 (en) * 2004-04-08 2006-12-26 Skyworks Solutions, Inc. System for synchronizing a portable transceiver to a network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995461A (en) * 2014-05-14 2014-08-20 王辉 Bluetooth radio wave zero calibration and timing system and method
CN104503220A (en) * 2014-11-18 2015-04-08 深圳市金立通信设备有限公司 Terminal, clock and clock calibration system
CN104503222A (en) * 2014-12-30 2015-04-08 飞亚达(集团)股份有限公司 Watch and method for synchronizing time thereof
CN104932248A (en) * 2015-07-03 2015-09-23 烟台钟表研究所有限公司 Control method of pointer type CDMA quartz clock
CN206147282U (en) * 2016-11-04 2017-05-03 中国计量大学 Bluetooth of mobile phone calibrating device of pointer -type clock
CN107145064A (en) * 2017-07-14 2017-09-08 成都天奥电子股份有限公司 A kind of clock changes the time keeping method after battery
CN107919934A (en) * 2017-11-20 2018-04-17 广州谨华电子科技有限公司 A kind of clock and clock correcting method

Also Published As

Publication number Publication date
CN111756462A (en) 2020-10-09

Similar Documents

Publication Publication Date Title
US10707984B2 (en) Techniques for synchronizing slave devices
CN111756462B (en) Time calibration method and device for clock
US20160370845A1 (en) System and methods of reducing energy consumption by synchronizing sensors
JP2018534686A (en) Apparatus and method for synchronizing controllers and sensors
CA3000011A1 (en) Apparatus and methods for synchronizing a controller and sensors
CN104503221A (en) Clock calibration method
CN104917581A (en) System time correction method and device, terminal and router
US9736801B1 (en) Methods and apparatus for synchronizing devices in a wireless data communication system
WO2019003320A1 (en) Communication system, master device and slave device
US11307537B2 (en) Communication device, communication method, communication system, electronic watch, and program
CN113419598B (en) Clock synchronization system and method for multi-SOC (system on chip)
JP5261714B2 (en) High-precision time synchronization apparatus, high-precision time synchronization method, and program
WO2012071977A1 (en) Method and device for time synchronisation on rack
CN109188335B (en) System and method for detecting clock deviation of electric energy meter
US9455824B1 (en) Distributed network synchronization methods and architectures
JP2001324584A (en) Time synchronizer, time synchronizing system, and method of controlling time synchronizer
CN111756561A (en) Clock initialization configuration method and device
CN209375672U (en) A kind of time calibration device of clock
CN114499816B (en) Clock synchronization method and device, terminal equipment and readable storage medium
US10887078B2 (en) Device, system, and method for determining a forwarding delay through a networking device
CN112506110B (en) Swimming timing equipment microsecond-level timing method based on CAN bus
JP2023529605A (en) Masterless Device Cooperation in Location Positioning Systems
JP4255307B2 (en) Time data supply apparatus and time data supply method
JP4277084B2 (en) Local timer device
JP7396939B2 (en) Electronic clock and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant