CN110071778A - A kind of time synchronization method, device, equipment and medium - Google Patents

A kind of time synchronization method, device, equipment and medium Download PDF

Info

Publication number
CN110071778A
CN110071778A CN201910335042.3A CN201910335042A CN110071778A CN 110071778 A CN110071778 A CN 110071778A CN 201910335042 A CN201910335042 A CN 201910335042A CN 110071778 A CN110071778 A CN 110071778A
Authority
CN
China
Prior art keywords
time
server
clock
current
synchronization
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.)
Granted
Application number
CN201910335042.3A
Other languages
Chinese (zh)
Other versions
CN110071778B (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.)
Jiangsu Purple Software Technology Co Ltd
Original Assignee
Jiangsu Purple Software Technology 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 Jiangsu Purple Software Technology Co Ltd filed Critical Jiangsu Purple Software Technology Co Ltd
Priority to CN201910335042.3A priority Critical patent/CN110071778B/en
Publication of CN110071778A publication Critical patent/CN110071778A/en
Application granted granted Critical
Publication of CN110071778B publication Critical patent/CN110071778B/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
    • H04J3/0652Synchronisation among time division multiple access [TDMA] nodes, e.g. time triggered protocol [TTP]

Abstract

The embodiment of the invention discloses a kind of time synchronization method, device, equipment and media.The method, applied to the intelligent clock terminal device for passing through Network Time Protocol clock synchronization, it include: when the success of the current clock time of acquisition time sync server, using the current clock time of the time synchronization server as local clock time, wherein, the time synchronization server, for providing time reference by Network Time Protocol for all terminal devices in network;When obtaining the current clock time failure of the time synchronization server, obtain the current clock time of transfer server, using the current clock time of the transfer server as local clock time, wherein, the transfer server, for providing the information interacted with user for the intelligent clock terminal device.The technical solution of the embodiment of the present invention can be improved the accuracy of local clock.

Description

A kind of time synchronization method, device, equipment and medium
Technical field
The present embodiments relate to clock synchronization technology more particularly to a kind of time synchronization method, device, equipment and media.
Background technique
As intelligent terminal is using more and more extensive, guarantee that the clock accuracy of intelligent terminal is becoming equipment just The basis often run.
For only by time calibration in network realize clock synchronization intelligent terminal for, once equipment can not in network when Between sync server establish connection, will be unable to obtain accurately clock time, it is likely that impact the use of user.It is existing In technology, mainly by optimization local oscillation circuit, and optimize the algorithm for calculating clock time based on local oscillation circuit To guarantee the precision of local clock.
However, the prior art is only capable of guaranteeing the precision of local clock within the scope of certain time, with intelligent terminal Increase with the time that the time synchronization server in network disconnects, the precision of local clock will reduce, and the prior art is simultaneously It cannot overcome the problems, such as this.
Summary of the invention
The embodiment of the present invention provides a kind of time synchronization method, device, equipment and medium, improves the accuracy of local clock.
In a first aspect, the embodiment of the invention provides a kind of time synchronization method, applied to passing through Network Time Protocol clock synchronization Intelligent clock terminal device, comprising:
When acquisition time sync server current clock time success when, by the time synchronization server it is current when Clock time is as local clock time, wherein the time synchronization server, for being in network by Network Time Protocol All terminal devices provide time reference;
When obtaining the current clock time failure of the time synchronization server, the present clock of transfer server is obtained Time, using the current clock time of the transfer server as local clock time, wherein the transfer server is used for The information interacted with user is provided for the intelligent clock terminal device.
Second aspect is applied to pass through Network Time Protocol clock synchronization the embodiment of the invention also provides a kind of timing device Intelligent clock terminal device, comprising:
First clock synchronization module, for when acquisition time sync server current clock time success when, by the time The current clock time of sync server is as local clock time, wherein the time synchronization server, for passing through network Time protocol provides time reference for all terminal devices in network;
Second clock synchronization module, for when obtaining the current clock time failure of the time synchronization server, in acquisition The current clock time for turning server, using the current clock time of the transfer server as local clock time, wherein institute Transfer server is stated, for providing the information interacted with user for the intelligent clock terminal device.
The third aspect, the embodiment of the invention also provides a kind of intelligent clock terminal devices, comprising:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing Device realizes the time synchronization method that any embodiment of that present invention provides.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer Program realizes the time synchronization method that any embodiment of that present invention provides when the program is executed by processor.
The embodiment of the invention provides a kind of time synchronization method, device, equipment and medium, when passing through Network Time Protocol clock synchronization Intelligent clock terminal device can not acquisition time sync server current clock time when, intelligent clock terminal device obtain The current clock time of transfer server, as local clock time, wherein time synchronization server, when for passing through network Between agreement for all terminal devices in network provide time reference, transfer server, for mentioning for intelligent clock terminal device For the information interacted with user.That is, the embodiment of the present invention with the associated transfer of intelligent clock terminal device by that will take Be engaged in device as can interim time service time base source, when accurate network cannot be obtained by reducing generation intelligent clock terminal device Between event occurrence rate.It solves in the prior art, is passing through optimization local oscillation circuit, and be based on local oscillation circuit When optimization calculates precision of the algorithm to guarantee local clock of clock time, not can avoid suspension overlong time, caused by it is local The problem of clock accuracy declines realizes the effect for improving the accuracy of local clock.
Detailed description of the invention
Fig. 1 is a kind of flow chart for time synchronization method that the embodiment of the present invention one provides;
Fig. 2 is a kind of flow chart of time synchronization method provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of flow chart for time synchronization method that the embodiment of the present invention three provides;
Fig. 4 is a kind of structural schematic diagram for timing device that the embodiment of the present invention four provides;
Fig. 5 is a kind of structural schematic diagram for intelligent clock terminal device that the embodiment of the present invention five provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
It also should be noted that only the parts related to the present invention are shown for ease of description, in attached drawing rather than Full content.It should be mentioned that some exemplary embodiments are described before exemplary embodiment is discussed in greater detail At the processing or method described as flow chart.Although operations (or step) are described as the processing of sequence by flow chart, It is that many of these operations can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of operations can be by again It arranges.The processing can be terminated when its operations are completed, it is also possible to have the additional step being not included in attached drawing. The processing can correspond to method, function, regulation, subroutine, subprogram etc..
Embodiment one
Fig. 1 is a kind of flow chart for time synchronization method that the embodiment of the present invention one provides, and the present embodiment is applicable to intelligence The case where clock terminal equipment is set time, wherein intelligent clock terminal device synchronizes clock synchronization by Network Time Protocol, This method can be executed by timing device provided in an embodiment of the present invention, which can be used the mode of software and/or hardware It realizes, and can integrate in intelligent clock terminal device.
As shown in Figure 1, the method for the present embodiment specifically includes:
Step 110, when acquisition time sync server current clock time success when, by the time synchronization server Current clock time as local clock time.
Wherein, the time synchronization server, for being that all terminal devices in network are mentioned by Network Time Protocol For time reference.
Network Time Protocol is a kind of agreement for making terminal device time synchronization.Network Time Protocol can make end End equipment carries out time synchronization to its clock source, can also provide the time adjustment of high accurancy and precision.For the level for adapting to network Structure, Network Time Protocol use hierarchy type Annual distribution model, including primary time server, from time server and node Transmission path between (including from time server and terminal device).Primary time server be high-precise synchronization clock source, from when Between server via primary time server obtain synchronization time.Under normal circumstances, node is only with most reliable, most accurately service Device and transmission path carry out time synchronization, and therefore, common synchronous path is rendered as a hierarchical structure.In the hierarchical structure In, primary server is located at root node, and other servers are layered setting with the increase of synchronization accuracy.
Corresponding, in the present embodiment, time synchronization server may include primary time server and from time server, It can be interpreted as, time synchronization server is the general name that the server of time service is carried out exclusively with Network Time Protocol.As a result, Time synchronization server can provide time reference for all terminal devices in network, and all terminal devices refer to same with the time The arbitrary equipment of step demand, the present embodiment do not limit the type of all terminal devices.
Wherein, intelligent clock terminal device is one of above-mentioned all terminal devices type, intelligent clock terminal device It is only capable of carrying out time synchronization by Network Time Protocol, that is to say, that intelligent clock terminal device is same not comprising other times The equipment for walking module (for example, global positioning system (Global Positioning System, GPS) module).Work as intelligent clock When terminal device can not carry out time synchronization by Network Time Protocol, only clock time can be carried out according to local oscillation circuit It calculates, to guarantee local clock time deviation few as far as possible accurate network time.
It in the present embodiment, can after intelligent clock terminal device is based on network and the successful connection of time synchronization server With the current clock time that receiving time sync server is sent, intelligent clock terminal device is using the current clock time as certainly The local clock time of body completes the process according to Network Time Protocol time service.
Step 120, when obtaining the current clock time failure of the time synchronization server, obtain transfer server Current clock time, using the current clock time of the transfer server as local clock time.
Wherein, the transfer server, for providing the information interacted with user for the intelligent clock terminal device.It is right In intelligent terminal, either software form or software and combination of hardware form, be typically necessary in corresponding server Large data sets cooperation be data support, just can guarantee intelligent terminal in the interactive process with user, fast and accurately for Family provides service.To transfer server in this present embodiment, it can be understood as, be and the user on intelligent clock terminal device The associated server of interactive function, for providing interaction data basis for user, for example, when user inquires intelligence by voice When the current weather conditions of clock terminal device, intelligent clock terminal device is that the inquiry request that will be received is sent to transfer service Device, and the response message for inquiry request feedback of transfer server transmission is received, which is opened up in a particular form Show to user.
In the present embodiment, after intelligent clock terminal device is based on network and the connection failure of time synchronization server, just The current clock time of transfer server can be obtained based on the connection established with transfer server, and by the current clock time As local clock time.It wherein, may be due to parsing the optional time with the reason of time synchronization server connection failure When the address of sync server, since network cause can not succeed, it is also possible to due to optional time synchronization server itself Failure.
Further, the current clock time of transfer server can be and be obtained by Network Time Protocol, can also be with It is to be obtained by other approach, for example, GPS time service either other existing Service of Timing, are not construed as limiting in the present embodiment. It should be noted that due to there are multiple time synchronization servers in the world, and the quantity of time synchronization server is also With certain speed increase, when intelligent clock terminal device and optional time synchronization server connection failure, not shadow It rings transfer server and other optional time synchronization servers establishes connection.
The embodiment of the invention provides a kind of time synchronization methods, set when by the intelligent clock terminal of Network Time Protocol clock synchronization It is standby can not acquisition time sync server current clock time when, intelligent clock terminal device obtains the current of transfer server Clock time, as local clock time, wherein time synchronization server, for being in network by Network Time Protocol All terminal devices provide time reference, transfer server, for providing the letter interacted with user for intelligent clock terminal device Breath.That is, the embodiment of the present invention will be by that will be used as and can temporarily award with the associated transfer server of intelligent clock terminal device When time base source, reduce occur intelligent clock terminal device cannot obtain accurate network time event occur it is general Rate.It solves in the prior art, when by optimizing local oscillation circuit, and calculating clock based on local oscillation circuit optimization Between precision of the algorithm to guarantee local clock when, not can avoid suspension overlong time, caused by local clock accuracy decline Problem realizes the effect for improving the accuracy of local clock.
In an optional embodiment of the present embodiment, when the present clock of the acquisition time sync server Between, comprising:
According to pre-determined synchronization frequency, the current clock time of the time synchronization server is obtained in fixed time;
If continuously there are preset times, lost in the current clock time that fixed time obtains the time synchronization server It loses, determines the current clock time failure for obtaining the time synchronization server.
Wherein, pre-determined synchronization frequency is that the hardware characteristics based on intelligent clock terminal device are set, for providing intelligence Clock terminal equipment carries out the specific moment of time synchronization by Network Time Protocol.For example, it is contemplated that disappearing to time synchronization needs The energy content of battery of corresponding time module is consumed, can will be set as daily by the number that Network Time Protocol carries out time synchronization 6, i.e., the average time synchronization of progress in every 4 hours.
In this optional embodiment, intelligent clock terminal device is obtained according to pre-determined synchronization frequency in fixed time The current clock time of time synchronization server, when preset times occur, in the synchronous clothes of corresponding fixed time acquisition time When the current clock time failure of business device, intelligent clock terminal device obtains synchronization time from transfer server.Preset times It can be set to 1 time, i.e., once the current clock time failure of intelligent clock terminal acquisition time sync server occurs, just touch Hair intelligent clock terminal obtains synchronization time from transfer server.Specifically when preset times are arranged, it is contemplated that intelligence Local oscillation circuit and local zone time in clock terminal equipment calculate the precision of calibration.
This optional embodiment as a result, the current clock time of sync server is obtained for intelligent clock terminal device Specific time trigger condition is provided, ensure that intelligent clock terminal device can ensure that the time is same in the case where low energy consumption The accuracy of step.
Embodiment two
Fig. 2 is a kind of flow chart of time synchronization method provided by Embodiment 2 of the present invention, and the present embodiment can be with said one Or each optinal plan combines in multiple embodiments, in the present embodiment, in the acquisition time synchronization server It can also include: the time synchronization server list for obtaining and prestoring before current clock time, wherein the time synchronization clothes It is engaged in device list including the address information of at least two time synchronization servers;According to preset rules, taken from the time synchronization It is engaged in obtaining object time sync server in device list;Parse the address information of the object time sync server;It is described to obtain The current clock time of time synchronization server is taken, it can be with are as follows: if parsing the current mesh in the time synchronization server list The address information success of time synchronization server is marked, and the current goal time synchronization server is in available mode, receives The current clock time that the current goal time synchronization server is sent;When the present clock for obtaining transfer server Between, it can be with are as follows: if address information occurs and loses for each time synchronization server in the time synchronization server list It loses and/or the case where corresponding time synchronization server is in down state, then parses the address letter of the transfer server Breath;When the address information for parsing the transfer server is successful, and the transfer server is in available mode, described in reception The current clock time that transfer server is sent.
Correspondingly, the method for the embodiment of the present invention includes:
Step 210, according to pre-determined synchronization frequency, the time synchronization server list prestored is obtained in fixed time.
It wherein, include the address information of at least two time synchronization servers in the time synchronization server list.
Time synchronization server list is pre-set in intelligent clock terminal device, and storage intelligent clock terminal is set The list of the address information of standby attachable time synchronization server.Address information in setting time synchronization server list Quantity when, also need consider intelligent clock terminal device hardware characteristics, for example, the data of intelligent clock terminal device are deposited Energy storage power, response time and energy consumption etc., to guarantee the quantity setting of address information to prevent due to address in the reasonable scope The quantity of information is excessive, and caused intelligent clock terminal device response is slow.
Step 220, according to preset rules, object time synchronous service is obtained from the time synchronization server list Device.
Wherein, preset rules are preset, for determining that the object time is synchronous from time synchronization server list The rule of server.Preset rules can be the list ordering according to time synchronization server list, sequential selection object time Sync server is also possible to the current network connection speed according to time synchronization server in time synchronization server list, The corresponding time synchronization server of maximum connection speed is selected, as object time sync server, herein not to preset rules It limits.
The address information of step 230, the parsing object time sync server.
In the present embodiment, the address information of time synchronization server is parsed by domain name resolution server, for The currently used domain name resolution server corresponding with network environment of user, in time synchronization server, itself fault-free is available Under the premise of, there may be the case where address information parsing failure.
If step 240, the address for parsing current goal time synchronization server in the time synchronization server list Information success, and the current goal time synchronization server is in available mode, receives the current goal time synchronization clothes The current clock time that business device is sent.
In the present embodiment, the ground of the current goal time synchronization server in the time synchronization server list is parsed Information success in location refers to the address information success of any time sync server in parsing time synchronization server list.? That is when parse current goal time synchronization server address information failure when, using future time sync server as Current goal time synchronization server, carries out the parsing of address information, and so on, if being deposited in time synchronization server list It can be resolved success in the address information of any time sync server, and the time synchronization server is in available mode When (excluding the unavailable situation of time synchronization server caused by time synchronization server hardware failure or third party attack), it is exactly The current clock time success of acquisition time sync server.Then, it is transmitted by data, intelligent clock terminal device can connect Receive the current clock time that current goal time synchronization server is sent.
If step 250 continuously preset times occurs, in fixed time in the time synchronization server list Each time synchronization server, occurs address information failure and/or corresponding time synchronization server is in down state Situation then parses the address information of the transfer server.
In the present embodiment, the current clock time failure of acquisition time sync server, refers to and takes for time synchronization There is the case where address information failure, or corresponding time synchronization occurs in each time synchronization server being engaged in device list Server is in the case where down state, or occurs at address information failure and corresponding time synchronization server simultaneously In the down state the case where.When continuously there are preset times, fixed time acquisition time sync server it is current when Clock time failure, intelligent clock terminal device transfer to parse the address information of transfer server.It should be noted that when intelligent When clock terminal device parses the address information failure of time synchronization server, can parse the address information of transfer server at Function, for example, in the case where domain name resolution server is unstable or in the case where unstable networks that user is current.
Step 260, when parsing the address information success of the transfer server, and the transfer server is in available State receives the current clock time that the transfer server is sent.
It should be understood that transfer server provides the data source of information as intelligent clock terminal device, quantity can With not unique.In the present embodiment, and as time synchronization server category, transfer server is also to set to for intelligent clock terminal The general name of the standby server for providing information, particular number can be multiple.When the quantity of transfer server is multiple, into one Step, intelligent clock terminal device also may include transfer server list, record multiple intelligent clock terminal devices thereon Address information realizes the mechanism that connection is similarly established with time synchronization server, certainly, the foundation of transfer server list It is the hardware characteristics for relying on intelligent clock terminal device.
In an optional embodiment of the present embodiment, the method also includes:
When parsing the address information failure of the transfer server, according to local oscillating frequency, when calculating local clock Between.
In this optional real-time mode, when intelligent clock terminal device can not take from time synchronization server and transfer When being engaged in obtaining synchronization time in device, it is only capable of according to local oscillating frequency, i.e., local oscillating circuit design, when calculating local clock Between, to guarantee the time precision of intelligent clock terminal device as far as possible.
This implementation does not explain in detail place, please be detailed in previous embodiment, details are not described herein.
The technical solution of the present embodiment provides specific intelligent clock terminal device acquisition time sync server in The mode for turning the current clock time of server further ensures the accuracy of the local clock of intelligent clock terminal device.
Embodiment three
Fig. 3 is a kind of flow chart for time synchronization method that the embodiment of the present invention three provides, and the present embodiment can be with said one Or each optinal plan combines in multiple embodiments, in the present embodiment, the method can be with are as follows: when receiving user's When query time instructs, the current clock time of the transfer server is obtained;When by the present clock of the transfer server Between be used as local clock time, show the user.
Correspondingly, the method for the embodiment of the present invention includes:
Step 310, when receive user query time instruct when, when obtaining the present clock of the transfer server Between.
Wherein, query time instruction is input by user, and user can be by touching on corresponding key or display screen Mark generate the query time instruction.
In the present embodiment, in addition in above-described embodiment, according to pre-determined synchronization frequency trigger intelligent clock terminal device with Transfer server carries out outside time synchronization, can also be by the query time instruction triggers intelligent clock terminal device of user in Turn server and carries out time synchronization.When intelligent clock terminal device receive user query time instruction when, directly according to The connection of transfer server obtains the current clock time on transfer server.Specifically, intelligent clock terminal device is receiving To user query time instruction when, parse the address information of transfer server, when parsing transfer server address information at Function, and when transfer server is in available mode, receive the current clock time that the transfer server is sent.If described in parsing The address information of transfer server fails, then according to local oscillating frequency, calculates local clock time.
It is described when the query time for receiving user instructs in an optional embodiment of the present embodiment, it obtains Take the current clock time of the transfer server, comprising:
Receive the time inquiring phonetic order of user's input;
According to the time inquiring phonetic order, the current clock time of the transfer server is received.
This optional embodiment provides the mode of convenient and fast user query time a kind of as a result, is conducive to user and exists Intelligent clock terminal device is used under various environment.
Step 320, using the current clock time of the transfer server as local clock time, show the use Family.
In an optional embodiment of the present embodiment, the current clock time by the transfer server is made For local clock time, the user is showed, comprising:
The local clock time on display interface is updated using the current clock time of the transfer server;
The local clock time on the display interface is broadcasted to the user with speech form.
In this optional embodiment, display device is provided on intelligent clock terminal device, intelligent clock terminal is set The standby current clock time that will acquire first updates the local clock time on the interface of display device, then, with voice Form broadcasts the local clock time on display interface to user, can be with thereby it is ensured that user is after carrying out the speech polling time Obtain accurate current local clock time.
This implementation does not explain in detail place, please be detailed in previous embodiment, details are not described herein.
The technical solution of the present embodiment has carried out careful explanation on the basis of the above embodiments, provides another touching It sends out intelligent clock terminal device and transfer server carries out the mode of time synchronization, when ensure that the local clock for feeding back to user Between accuracy.
Example IV
Fig. 4 is a kind of structural schematic diagram for timing device that the embodiment of the present invention four provides, as shown in figure 4, described device It include: the first clock synchronization module 410 and the second clock synchronization module 420, in which:
First clock synchronization module 410, for when the success of the current clock time of acquisition time sync server, when will be described Between sync server current clock time as local clock time, wherein the time synchronization server, for passing through net Network time protocol provides time reference for all terminal devices in network;
Second clock synchronization module 420, for obtaining when obtaining the current clock time failure of the time synchronization server The current clock time of transfer server, using the current clock time of the transfer server as local clock time, wherein The transfer server, for providing the information interacted with user for the intelligent clock terminal device.
The embodiment of the invention provides a kind of timing devices, set when by the intelligent clock terminal of Network Time Protocol clock synchronization It is standby can not acquisition time sync server current clock time when, intelligent clock terminal device obtains the current of transfer server Clock time, as local clock time, wherein time synchronization server, for being in network by Network Time Protocol All terminal devices provide time reference, transfer server, for providing the letter interacted with user for intelligent clock terminal device Breath.That is, the embodiment of the present invention will be by that will be used as and can temporarily award with the associated transfer server of intelligent clock terminal device When time base source, reduce occur intelligent clock terminal device cannot obtain accurate network time event occur it is general Rate.It solves in the prior art, when by optimizing local oscillation circuit, and calculating clock based on local oscillation circuit optimization Between precision of the algorithm to guarantee local clock when, not can avoid suspension overlong time, caused by local clock accuracy decline Problem realizes the effect for improving the accuracy of local clock.
On the basis of the various embodiments described above, described device can also include:
Clock obtains module, for obtaining the time synchronization server in fixed time according to pre-determined synchronization frequency Current clock time;
Failure determining module, if obtaining the time synchronization service in fixed time for continuously there are preset times The current clock time of device fails, then determines the current clock time failure for obtaining the time synchronization server.
On the basis of the various embodiments described above, can also include:
List obtains module, for obtaining before the current clock time for obtaining the time synchronization server The time synchronization server list prestored, wherein include that at least two time synchronizations take in the time synchronization server list The address information of business device;
Object time sync server obtains module, in the present clock for obtaining the time synchronization server Before time, according to preset rules, object time sync server is obtained from the time synchronization server list;
First address information parsing module, for the current clock time for obtaining the time synchronization server it Before, parse the address information of the object time sync server;
The first clock synchronization module 410 may include:
First current clock time receiving unit, if for parsing the current goal in the time synchronization server list The address information success of time synchronization server, and the current goal time synchronization server is in available mode, receives institute State the current clock time of current goal time synchronization server transmission;
The second clock synchronization module 420 may include:
Second address information resolution unit, if for for each time synchronization in the time synchronization server list It the case where server, the failure of generation address information and/or corresponding time synchronization server are in down state, then parses The address information of the transfer server;
Second current clock time receiving unit, for working as the address information success for parsing the transfer server, and institute When stating transfer server and being in available mode, the current clock time that the transfer server is sent is received.
On the basis of the various embodiments described above, the second clock synchronization module 420 can also include:
Local clock time computing unit, for when parsing the address information failure of the transfer server, according to this Ground frequency of oscillation calculates local clock time.
On the basis of the various embodiments described above, described device can also include:
Third clock synchronization module, for obtaining working as the transfer server when the query time for receiving user instructs Preceding clock time;
Local clock time display module, for using the current clock time of the transfer server as when local clock Between, show the user.
On the basis of the various embodiments described above, third clock synchronization module may include:
Phonetic order receiving unit, for receiving the time inquiring phonetic order of user's input;
Third current clock time receiving unit, for receiving the transfer clothes according to the time inquiring phonetic order The current clock time of business device;
The local clock time display module may include:
Local clock time updating unit, for updating display interface using the current clock time of the transfer server On local clock time;
Local clock time broadcasts unit, for broadcasting the local on the display interface to the user with speech form Clock time.
Time synchronization method provided by any embodiment of the invention can be performed in above-mentioned timing device, and it is corresponding to have execution method Functional module and beneficial effect.
Embodiment five
Fig. 5 is a kind of structural schematic diagram for intelligent clock terminal device that the embodiment of the present invention five provides, as shown in figure 5, The equipment includes processor 50 and memory 51;The quantity of processor 50 can be one or more in equipment, with one in Fig. 5 For processor 50;Processor 50 in equipment can be connected with memory 51 by bus or other modes, to pass through in Fig. 5 For bus connection.
Memory 51 is used as a kind of computer readable storage medium, can be used for storing software program, journey can be performed in computer Sequence and module, if the corresponding program instruction/module of one of embodiment of the present invention time synchronization method is (for example, in timing device The first clock synchronization module 410 and the second clock synchronization module 420).The software journey that processor 50 is stored in memory 51 by operation Sequence, instruction and module realize above-mentioned time synchronization method thereby executing the various function application and data processing of equipment.
Memory 51 can mainly include storing program area and storage data area, wherein storing program area can store operation system Application program needed for system, at least one function;Storage data area, which can be stored, uses created data etc. according to terminal.This Outside, memory 51 may include high-speed random access memory, can also include nonvolatile memory, for example, at least a magnetic Disk storage device, flush memory device or other non-volatile solid state memory parts.In some instances, memory 51 can be further Including the memory remotely located relative to processor 50, these remote memories can pass through network connection to equipment.It is above-mentioned The example of network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Embodiment six
The embodiment of the present invention six also provides a kind of storage medium comprising computer executable instructions, and the computer can be held Row instruction is used to execute a kind of time synchronization method when being executed by computer processor, this method comprises:
When acquisition time sync server current clock time success when, by the time synchronization server it is current when Clock time is as local clock time, wherein the time synchronization server, for being in network by Network Time Protocol All terminal devices provide time reference;
When obtaining the current clock time failure of the time synchronization server, the present clock of transfer server is obtained Time, using the current clock time of the transfer server as local clock time, wherein the transfer server is used for The information interacted with user is provided for the intelligent clock terminal device.
It certainly, include the storage medium of computer executable instructions provided by the embodiment of the present invention, computer can be held The method operation that row instruction is not limited to the described above, can also be performed in time synchronization method provided by any embodiment of the invention Relevant operation.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but in many cases, the former is more Good embodiment.Based on this understanding, technical solution of the present invention substantially in other words contributes to the prior art Part can be embodied in the form of software products, which can store in computer readable storage medium In, floppy disk, read-only memory (Read-Only Memory, ROM), random access memory (Random such as computer Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are with so that a computer is set Standby (can be personal computer, server or the network equipment etc.) executes method described in each embodiment of the present invention.
It is worth noting that, included each unit and module are only pressed in a kind of embodiment of above-mentioned timing device It is divided, but is not limited to the above division according to function logic, as long as corresponding functions can be realized;In addition, The specific name of each functional unit is also only for convenience of distinguishing each other, the protection scope being not intended to restrict the invention.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.

Claims (10)

1. a kind of time synchronization method, which is characterized in that applied to the intelligent clock terminal device for passing through Network Time Protocol clock synchronization, packet It includes:
When the success of the current clock time of acquisition time sync server, when by the present clock of the time synchronization server Between be used as local clock time, wherein the time synchronization server, for being all in network by Network Time Protocol Terminal device provides time reference;
When obtaining the current clock time failure of the time synchronization server, when obtaining the present clock of transfer server Between, using the current clock time of the transfer server as local clock time, wherein the transfer server, for for The intelligent clock terminal device provides the information interacted with user.
2. the method according to claim 1, wherein when the present clock of the acquisition time sync server Between, comprising:
According to pre-determined synchronization frequency, the current clock time of the time synchronization server is obtained in fixed time;
If continuously there are preset times, the current clock time failure of the time synchronization server is obtained in fixed time, Then determine the current clock time failure for obtaining the time synchronization server.
3. method according to claim 1 or 2, which is characterized in that obtain working as the time synchronization server described Before preceding clock time, further includes:
Obtain the time synchronization server list prestored, wherein when including at least two in the time synchronization server list Between sync server address information;
According to preset rules, object time sync server is obtained from the time synchronization server list;
Parse the address information of the object time sync server;
The current clock time of the acquisition time sync server, comprising:
If parsing the address information success of the current goal time synchronization server in the time synchronization server list, and institute It states current goal time synchronization server and is in available mode, receive the current of the current goal time synchronization server transmission Clock time;
The current clock time for obtaining transfer server, comprising:
If address information failure occurs for each time synchronization server in the time synchronization server list, and/or Corresponding time synchronization server is in the case where down state, then parses the address information of the transfer server;
When the address information for parsing the transfer server is successful, and the transfer server is in available mode, institute is received State the current clock time of transfer server transmission.
4. according to the method described in claim 3, it is characterized by further comprising:
When parsing the address information failure of the transfer server, according to local oscillating frequency, local clock time is calculated.
5. the method according to claim 1, wherein further include:
When the query time for receiving user instructs, the current clock time of the transfer server is obtained;
Using the current clock time of the transfer server as local clock time, the user is showed.
6. according to the method described in claim 5, it is characterized in that, it is described when receive user query time instruct when, obtain Take the current clock time of the transfer server, comprising:
Receive the time inquiring phonetic order of user's input;
According to the time inquiring phonetic order, the current clock time of the transfer server is received;
It is described using the current clock time of the transfer server as local clock time, show the user, comprising:
The local clock time on display interface is updated using the current clock time of the transfer server;
The local clock time on the display interface is broadcasted to the user with speech form.
7. a kind of timing device, which is characterized in that applied to the intelligent clock terminal device for passing through Network Time Protocol clock synchronization, packet It includes:
First clock synchronization module, for when acquisition time sync server current clock time success when, by the time synchronization The current clock time of server is as local clock time, wherein the time synchronization server, for passing through network time Agreement provides time reference for all terminal devices in network;
Second clock synchronization module, for obtaining transfer clothes when obtaining the current clock time failure of the time synchronization server The current clock time of business device, using the current clock time of the transfer server as local clock time, wherein in described Turn server, for providing the information interacted with user for the intelligent clock terminal device.
8. device according to claim 7, which is characterized in that described device further include:
Clock obtains module, for obtaining the current of the time synchronization server in fixed time according to pre-determined synchronization frequency Clock time;
Failure determining module, if obtaining the time synchronization server in fixed time for continuously there are preset times Current clock time failure then determines the current clock time failure for obtaining the time synchronization server.
9. a kind of intelligent clock terminal device, which is characterized in that the intelligent clock terminal device includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as time synchronization method as claimed in any one of claims 1 to 6.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor Such as time synchronization method as claimed in any one of claims 1 to 6 is realized when execution.
CN201910335042.3A 2019-04-24 2019-04-24 Time synchronization method, device, equipment and medium Active CN110071778B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910335042.3A CN110071778B (en) 2019-04-24 2019-04-24 Time synchronization method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910335042.3A CN110071778B (en) 2019-04-24 2019-04-24 Time synchronization method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN110071778A true CN110071778A (en) 2019-07-30
CN110071778B CN110071778B (en) 2021-03-23

Family

ID=67368671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910335042.3A Active CN110071778B (en) 2019-04-24 2019-04-24 Time synchronization method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN110071778B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110717793A (en) * 2019-10-18 2020-01-21 广州创维平面显示科技有限公司 Timing method, advertising player and advertising player system
CN114520707A (en) * 2022-01-24 2022-05-20 中银金融科技有限公司 Clock synchronization method and related equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060074819A (en) * 2004-12-27 2006-07-03 주식회사 케이티 Method for synchronization of authentication bit using count information about repetitive receiving of data packet in wlan
US20080310396A1 (en) * 2007-06-18 2008-12-18 Lg Electronics Inc. Method of performing uplink synchronization in wireless communication system
CN101980555A (en) * 2010-10-26 2011-02-23 中兴通讯股份有限公司 Time setting method for mobile terminal and mobile terminal
CN102195736A (en) * 2010-03-15 2011-09-21 中兴通讯股份有限公司 Time synchronization processing method and system used in passive optical network and OLT (Optical Line Terminal)
CN202886871U (en) * 2012-09-29 2013-04-17 北京经纬恒润科技有限公司 Vehicle-mounted terminal device and multipath clock synchronization system thereof
CN105610958A (en) * 2016-01-13 2016-05-25 广东欧珀移动通信有限公司 Method and device for selecting time synchronization server and intelligent terminal
CN105915308A (en) * 2016-07-08 2016-08-31 腾讯科技(深圳)有限公司 Time synchronization method, device and system
CN108964822A (en) * 2018-06-29 2018-12-07 四川斐讯信息技术有限公司 A kind of multi-scheme obtains the method and system of network time parallel

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060074819A (en) * 2004-12-27 2006-07-03 주식회사 케이티 Method for synchronization of authentication bit using count information about repetitive receiving of data packet in wlan
US20080310396A1 (en) * 2007-06-18 2008-12-18 Lg Electronics Inc. Method of performing uplink synchronization in wireless communication system
CN102195736A (en) * 2010-03-15 2011-09-21 中兴通讯股份有限公司 Time synchronization processing method and system used in passive optical network and OLT (Optical Line Terminal)
CN101980555A (en) * 2010-10-26 2011-02-23 中兴通讯股份有限公司 Time setting method for mobile terminal and mobile terminal
CN202886871U (en) * 2012-09-29 2013-04-17 北京经纬恒润科技有限公司 Vehicle-mounted terminal device and multipath clock synchronization system thereof
CN105610958A (en) * 2016-01-13 2016-05-25 广东欧珀移动通信有限公司 Method and device for selecting time synchronization server and intelligent terminal
CN105915308A (en) * 2016-07-08 2016-08-31 腾讯科技(深圳)有限公司 Time synchronization method, device and system
CN108964822A (en) * 2018-06-29 2018-12-07 四川斐讯信息技术有限公司 A kind of multi-scheme obtains the method and system of network time parallel

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110717793A (en) * 2019-10-18 2020-01-21 广州创维平面显示科技有限公司 Timing method, advertising player and advertising player system
CN110717793B (en) * 2019-10-18 2022-11-18 创维集团智能科技有限公司 Timing method, advertising player and advertising player system
CN114520707A (en) * 2022-01-24 2022-05-20 中银金融科技有限公司 Clock synchronization method and related equipment

Also Published As

Publication number Publication date
CN110071778B (en) 2021-03-23

Similar Documents

Publication Publication Date Title
CN106453288B (en) A kind of distributed micro services frame system that supporting asynchronous mode and its implementation
WO2017088703A1 (en) Page jumping method and apparatus
CN110351283B (en) Data transmission method, device, equipment and storage medium
CN101098248B (en) Method and system for implementing universal network management based on configuration describing document
CN102624881B (en) Mobile-device-oriented service cache system architecture and development method
CN102571420B (en) Method and system for network element data management
CN106612188A (en) Method and device for extending software function based on micro service architecture
CN106713391B (en) Session information sharing method and sharing system
EP2618278B1 (en) Synchronizing endpoint data stores having disparate schemas
CN110351323A (en) A kind of parameter management method and device of application system
EP2214372A1 (en) Method and apparatus for tracking device management data changes
CN104243515A (en) Method and device for processing configuration information
CN110071778A (en) A kind of time synchronization method, device, equipment and medium
CN111475282A (en) Distributed storage load balancing method and device based on client
CN102026228B (en) Statistical method and equipment for communication network performance data
CN104052565B (en) Time synchronization method and communication terminal
CN106326372A (en) Git central warehouse management system and control method
US20210218824A1 (en) Method and device for processing mini program data
EP4050850A1 (en) Service upgrading method, device and system
CN104636395A (en) Count processing method and device
CN102843432A (en) Network communication system applicable to sharing and synchronous updating of data at multiple clients
CN112702446B (en) Distributed storage system with DNS (domain name system) cached in edge network
CN110086721A (en) One kind returning source relationship management system, method, apparatus, server and storage medium
CN107786661B (en) Information synchronization method
WO2022033291A1 (en) Ranking list service system, ranking list generation method, server, and storage medium

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