WO2011044850A1 - 校正本地时间的方法、时钟服务器及客户机 - Google Patents

校正本地时间的方法、时钟服务器及客户机 Download PDF

Info

Publication number
WO2011044850A1
WO2011044850A1 PCT/CN2010/077767 CN2010077767W WO2011044850A1 WO 2011044850 A1 WO2011044850 A1 WO 2011044850A1 CN 2010077767 W CN2010077767 W CN 2010077767W WO 2011044850 A1 WO2011044850 A1 WO 2011044850A1
Authority
WO
WIPO (PCT)
Prior art keywords
clock
rising edge
timing
server
local time
Prior art date
Application number
PCT/CN2010/077767
Other languages
English (en)
French (fr)
Inventor
梁志科
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2011044850A1 publication Critical patent/WO2011044850A1/zh

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/0685Clock or time synchronisation in a node; Intranode synchronisation

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method for correcting local time, a clock server, and a client. Background technique
  • the third generation network puts forward new requirements for synchronization. For example, in a network using Time Division Synchronous Code Division Multiple Access (TD-SCDMA), high precision is required between base station systems. Time synchronization, for example better than 1.5 microseconds (us).
  • TD-SCDMA Time Division Synchronous Code Division Multiple Access
  • the main synchronous mode is as follows:
  • a Global Positioning System (GPS) receiver or other clock source sends a PPS (Pulse Per Second) signal to the clock server.
  • PPS Pulse Per Second
  • the clock server corrects the local time, including clearing the time below the local time to zero, and adding the local time to one second to synchronize the clock server with the clock source. . For example, if the clock server is at local time
  • the clock server corrects the local time to 31.0000000 seconds.
  • the clock server provides timing for multiple clients in the network, keeping the client in sync with the clock server, thereby enabling synchronization between clients in the network.
  • each clock server obtains a PPS signal from a clock source, and when the clock source is out of synchronization, the clock server cannot be found but still uses The PPS signal sent by the clock source corrects the local time, causing a large area of the client to lose synchronization.
  • Embodiments of the present invention provide a method, a clock server, and a client that can detect that a clock source is out of synchronization, and can avoid a local time for correcting a client out of synchronization due to a clock source out of synchronization.
  • One aspect of the present invention provides a method of correcting local time, including:
  • the clock server receives a second clock signal from at least three clock sources
  • the clock server acquires a difference between arrival times of a rising edge of every two seconds of the clock signal in the second clock signal;
  • the clock server determines whether there is a difference between the arrival time of the rising edge of the second clock signal and the arrival time of the rising edge of the other second clock signal is greater than or equal to the preset threshold;
  • the clock server corrects the local time based on the arrival of the rising edge of the other second clock signal.
  • a clock server including:
  • a receiving module configured to receive a second clock signal from at least three clock sources
  • An obtaining module configured to acquire a difference between a rising edge of each two-second clock signal in the second clock signal
  • a judging module configured to determine whether a difference between a rising edge of the second clock signal and a time of arrival of the rising edge of the other second clock signal is greater than or equal to a preset threshold, and if so, triggering the first correcting module;
  • the first correction module is configured to: after receiving the trigger of the determining module, correct the local time according to the arrival time of the rising edge of the other second clock signal.
  • Another aspect of the present invention also provides a method of correcting local time, including:
  • the client obtains the timing from at least three clock servers;
  • the client obtains a difference in timing of each of the clock servers in the clock server; the client determines whether the timing difference between the timing of one clock server and the timing of other clock servers is greater than or equal to a preset threshold. If yes, the client corrects the local time according to the timing of other clock servers;
  • the client determines that the difference between the timing of no clock server and the timing of the other clock servers is greater than or equal to the preset threshold, the client corrects the local time according to the timing from the at least three clock servers.
  • Another aspect of the present invention also provides a client, including:
  • a first obtaining module configured to acquire a timing from at least three clock servers
  • a second obtaining module configured to acquire a difference in timing of each of the clock servers from the at least three clock servers; a judging module, configured to determine whether a difference between a timing of a clock server and a timing of another clock server is greater than or equal to a preset threshold, and if so, triggering the first calibration module, if there is no timing of the clock server and other clocks When the difference of the timing of the server is greater than or equal to the preset threshold, the second calibration module is triggered;
  • the first correction module is configured to: after receiving the trigger of the determining module, correct the local time according to timing of other clock servers;
  • the second correction module is configured to: after receiving the trigger of the determining module, correct the local time according to the timing from the at least three clock servers.
  • the present invention can have the following advantages:
  • the method, the clock server and the client in this embodiment can find that the obtained clock signal is inaccurate and does not use the clock signal to correct the local time, thereby avoiding the situation that the client is out of synchronization due to the inaccuracy of the obtained clock signal. . DRAWINGS
  • FIG. 1 is a flow chart of an embodiment of a method for correcting local time in an embodiment of the present invention
  • FIG. 2 is a flowchart of another embodiment of a method for correcting local time in an embodiment of the present invention
  • FIG. 4 is a schematic diagram of an embodiment of a clock server in an embodiment of the present invention
  • FIG. 5 is a schematic diagram of another embodiment of a clock server according to an embodiment of the present invention.
  • Figure 6 is a schematic diagram of one embodiment of a client in an embodiment of the present invention. detailed description
  • Embodiments of the present invention provide a method for correcting local time and a clock server, which can enable the clock server to find that the clock source is out of synchronization, and can avoid a large area of client out-of-synchronization caused by the clock source being out of synchronization. The details are described below separately.
  • an embodiment of a method for correcting local time in an embodiment of the present invention includes: 101.
  • a clock server receives a second clock signal sent by at least three clock sources;
  • the clock server receives PPS signals sent by at least three clock sources, the at least three clock sources being independent of each other, and the clock source may be GPS or Beidou.
  • the clock server can receive the TOD (Time Of Date) information sent by the clock source periodically (every 2 seconds or once every 1 second) to correct the number of seconds in the local time.
  • TOD Time Of Date
  • the clock server can receive the TOD (Time Of Date) information sent by the clock source periodically (every 2 seconds or once every 1 second) to correct the number of seconds in the local time.
  • the clock server obtains a difference between the arrival times of the rising edges of the clock signals every two seconds. After 101, the clock server acquires the difference between the arrival times of the rising edges of the received two PPS signals. Further, the PPS signals to be compared may be all PPS signals whose rise edges do not differ by more than 0.5 seconds.
  • a timer and a comparator can be set inside the clock server to record the arrival time of the rising edge of the PPS signal sent by each clock source, and compare the difference between the arrival times of the rising edges of every two PPS signals. It is also possible to use other prior art techniques to obtain the difference in the arrival time of the rising edge of every two PPS signals, which is not enumerated here.
  • the clock server determines whether there is a difference between the rising edge of the second clock signal and the arrival time of the rising edge of the other second clock signals is greater than or equal to the preset threshold. If yes, executing 104, otherwise executing 105;
  • the preset can be preset.
  • the threshold is set to 400 nanoseconds. Then, if the difference between the arrival time of the rising edge of one PPS signal and the arrival time of the rising edge of each of the other PPS signals is greater than or equal to 400 nanoseconds, the clock source for transmitting the PPS signal can be determined. There is a loss of step.
  • the clock server corrects the local time according to the arrival time of the rising edge of the other second clock signal; the process ends.
  • the clock source transmitting the PPS signal is out of synchronization, and therefore, the clock server
  • the local time can be corrected according to the arrival time of the rising edge of the PPS signal except the one PPS. It can be seen that the clock server in this embodiment can find the out-of-synchronization clock source and avoid a large area caused by the clock source being out of synchronization. The case of a client out of sync.
  • the clock server corrects the local time according to the arrival time of the rising edge of the other PPS signals, and specifically includes: according to any one of the other second clock signals, the second clock signal The local time is corrected according to the arrival time; and the method may further include: acquiring an average value of arrival times of rising edges of two or more second clock signals of the other second clock signals, and correcting the local time according to the average value.
  • the clock server corrects the local time according to the arrival time of the rising edge of one second clock signal of the other second clock signals.
  • the rising edge is delayed by 1 second (it can also be delayed by 2 seconds or 3 seconds%), and the time below the local time is cleared to 0, and the local time is increased by 1; similarly, the clock server
  • the local time is corrected according to the average value of the rising edges of the rising clocks of the two or more second clock signals of the other second clock signals, and the average value may be delayed by 1 second (the delay may also be 2 seconds or 3 seconds). After that, the time below the local time is cleared to 0, and the number of seconds in the local time is increased by 1.
  • the clock server can Correcting the local time according to the arrival time of the rising edge of any one of the second clock signals; also obtaining an average value of the arrival times of the rising edges of the two or more second clock signals of all the second clock signals, and correcting the local according to the average value time.
  • the clock server may not correct the local time.
  • the number of seconds in the local time is not incremented by 1, the number of seconds of the local time can be corrected based on the received TOD information, so 105 can be omitted.
  • the clock server receives the second clock signal sent by at least three clock sources, and compares the arrival time of the rising edge of the clock signal every two seconds, if there is a second clock signal and the rising edge of the other second clock signal arrives at the time of arrival. The difference is greater than or equal to the preset threshold, indicating that the clock source transmitting the one second clock signal is out of synchronization, and the clock server corrects the local time according to the arrival time of the rising edge of the second clock signal except the one second clock signal. It can be seen that the clock server in this embodiment can avoid the situation that a large area of the client is out of synchronization due to the out of synchronization of the clock source.
  • the method for correcting local time in the embodiment of the present invention includes:
  • the clock server receives a second clock signal sent by three clock sources.
  • the clock server fixedly receives the TOD information sent by one of the clock sources for correcting the number of seconds of the local time.
  • the clock server obtains a difference between the arrival time of the rising edge of the clock signal every two seconds.
  • a timer independent of the local clock is set in the clock server, and is used to determine the rise of the clock signal every second. Along the coming moment.
  • the clock server determines whether there is a second clock signal rising edge arrival time and the other two seconds clock signal rising edge arrival time difference is greater than or equal to the preset threshold, and if so, then execute 204, otherwise execute 205;
  • the preset threshold can be set to 500 nanoseconds (including 100 nanoseconds of redundancy).
  • the rising edges of the three PPS signals received before and after are 29.99999985 seconds, 29.99999995 seconds, and 30.00000045 seconds, respectively.
  • the value is 100 nanoseconds
  • the difference between the first received PPS signal and the rising edge of the third received PPS signal is 600 nanoseconds
  • the second received PPS signal is received with the third
  • the difference between the rising edge of the PPS signal is 500 nanoseconds. Therefore, the difference between the arrival time of the rising edge of the third received PPS signal and the arrival time of the rising edge of the other second clock signals is greater than or equal to 500 nanoseconds. Therefore, it can be determined that the clock source transmitting the third received PPS signal is out of synchronization.
  • the clock server acquires the first and second received second clocks.
  • the average value of the rising edge of the signal that is, the average value of 29.99999985 seconds and 29.99999995 seconds is 29.99999990 seconds
  • the local time is corrected according to the average value, which may be:
  • the time below the local time in the timer is 30.99999990 seconds Cleared to 0 and increments the number of seconds in local time.
  • the difference between the third received PPS signal and the arrival time of the rising edge of the other second clock signal is greater than or equal to 500 nanoseconds, it may also be based on the first or second received second.
  • the rising edge of the clock signal corrects the local time at the arrival time. For example, when the timer is 30.99999985 seconds, the time below the local time is cleared to 0, and the local time is incremented by one.
  • the clock server may also initiate an alarm to notify The operation and maintenance personnel handle it.
  • the rising edge of the first received PPS signal and the second received PPS signal arrive at the arrival time.
  • the difference is 100 nanoseconds
  • the difference between the first received PPS signal and the rising edge of the third received PPS signal is 200 nanoseconds
  • the second received PPS signal and the third receiving The difference between the arrival time of the rising edge of the received PPS signal is 100 nanoseconds. Therefore, it is determined in 203 that the difference between the arrival time of the rising edge of one second clock signal and the arrival time of the rising edge of the other second clock signals is greater than or equal to the preset.
  • Threshold that is, if there is no clock source out of synchronization, the clock server obtains the average value of the arrival time of the rising edge of the received three second clock signal by 29.99999995 seconds, and corrects the local time according to the average value, that is, when the timer is 30.99999995 seconds Clear the time below the local time to zero and increase the number of seconds in the local time by one.
  • the clock server may also receive according to the second The rising edge of the second clock signal is corrected at the time of 29.99999995 seconds and the number of seconds in the local time is increased by one.
  • the average value obtained in 204 and 205 can be weighted averaged according to the accuracy of the clock source itself.
  • the average of the arrival times of the rising edges of the other two second clock signals may be averaged according to the accuracy of the clock source itself.
  • the clock server receives the second clock signal sent by the three clock sources, if the difference between the arrival time of the rising edge of one second clock signal and the arrival time of the rising edge of the other two second clock signals is greater than or equal to the preset threshold. , indicating that the clock source sending the one second clock signal is out of step, the clock server corrects the local time according to the average value of the arrival time of the rising edges of the other two second clock signals. It can be seen that the clock server in this embodiment can find that the clock source is out of synchronization and does not use the second clock signal sent by the clock source to correct the local time, thereby avoiding a situation in which a large area of the client is out of synchronization due to the out of synchronization of the clock source. . Moreover, the clock server in this embodiment can also improve the accuracy of the clock server, and can initiate an alarm when the clock source is found to be out of synchronization, thereby improving the user experience.
  • the client can also use the core idea in the embodiment of the present invention to correct the local time according to the timing of the clock server. Therefore, referring to FIG. 3, another embodiment of the method for correcting the local time is further provided by the embodiment of the present invention, including:
  • the client obtains a timing of at least three clock servers;
  • the client obtains the timing from a clock server and adjusts the local time according to the timing to synchronize the client with the clock server.
  • the client obtains timing from at least three clock servers, the at least three clock servers being independent of each other.
  • the client obtains a difference in timing of each two clock servers
  • the client determines whether the timing of the timing of one clock server and the timing of the other clock servers is greater than or equal to the preset threshold, and if so, executing 304, otherwise executing 305;
  • the preset threshold can be set to 500 nanoseconds (including 100 nanoseconds of redundancy).
  • the client gets the timing from three clock servers A, B, and C, and the timings obtained from clock servers A, B, and C are 30 minutes 29.99999985 seconds, 30 minutes 29.99999995 seconds, and 30 minutes 30.00000045 seconds, then the clock server A
  • the difference between the timing of the timing and the timing of the clock server B is 100 nanoseconds
  • the difference between the timing of the clock server A and the timing of the clock server C is 600 nanoseconds
  • the difference between the timing of the clock server B and the timing of the clock server C is 500 nanoseconds
  • the difference between the timing of the clock server C and the timing of the other clock servers is greater than or equal to 500 nanoseconds. Therefore, it can be determined that the clock server is out of step.
  • the client corrects the local time according to the timing of other clock servers; ends the process.
  • the client determines that the difference between the timing of one clock server and the timing of the other clock servers is greater than or equal to the preset threshold, indicating that the clock server is out of synchronization
  • the client according to this The timing of the other clock servers other than the clock server corrects the local time. It can be seen that the client in this embodiment can find that the clock server is out of synchronization (including the clock server out of synchronization caused by the out-of-synchronization of the clock source), and does not use the timing of the out-of-step clock server to correct the local time, so that the clock source can be found. Step, and avoid a situation where a large area of the client is out of synchronization due to the out of synchronization of the clock source.
  • the client corrects the local time according to the timing of all clock servers; ends the process. If the client determines that the difference between the timing of the clock server and the timing of the other clock servers is greater than or equal to the preset threshold, indicating that the clock server is out of synchronization, the client corrects the local time according to the timing of all the clock servers, which may be: The local time is corrected according to the timing of all clock servers, or according to the timing of one of the clock servers.
  • the client obtains the timing of at least three clock servers, and compares the timing of each two clock servers. If the timing of the timing of one clock server and the timing of other clock servers is greater than or equal to the preset threshold, If this clock server is out of step, the client corrects the local time according to the timing of the clock server other than the one clock server. It can be seen that the client in this embodiment can find that the clock server is out of synchronization (including the clock server out of synchronization caused by the out-of-synchronization of the clock source), and does not use the timing of the out-of-step clock server to correct the local time, so that the clock source can be found. Step, and avoid a situation where a large area of the client is out of synchronization due to the out of synchronization of the clock source.
  • an embodiment of the clock server in the embodiment of the present invention includes:
  • the receiving module 401 is configured to receive a second clock signal sent by at least three clock sources;
  • the obtaining module 402 is configured to compare the second clock signals sent by the at least three clock sources received by the receiving module 401, and obtain a difference between the arrival times of the rising edges of the clock signals every two seconds;
  • the determining module 403 is configured to determine whether a difference between the arrival time of the rising edge of the second clock signal and the arrival time of the rising edge of the other second clock signals is greater than or equal to the preset threshold, and if yes, triggering the first correction module 404 to perform the related operation. Otherwise, the second calibration module 405 is triggered to perform the related operation; the first correction module 404 is configured to: after receiving the trigger of the determining module 403, correct the local time according to the arrival time of the rising edge of the other second clock signal; or
  • the second correction module 405 is configured to: after receiving the trigger of the determining module 403, correct the local time according to the arrival time of the rising edge of all the second clock signals.
  • the first correction module 404 is used for rising edges according to other second clock signals.
  • the local time is corrected at the arrival time, and may be specifically used to correct the local time according to the arrival time of the rising edge of one second clock signal of the other second clock signal; specifically, it may also be used to acquire two or more second clocks of the other second clock signals.
  • the rising edge of the signal is the average of the arrival times, and the local time is corrected based on the average.
  • the second correction module 405 can be compared with the prior art. Similarly, the local time is corrected according to the arrival time of the rising edge of one of the second clock signals; the average value of the arrival times of the rising edges of the two or more second clock signals of all the second clock signals may also be acquired, and corrected according to the average value. local time.
  • the determining module 403 determines that the difference between the arrival time of the rising edge of one second clock signal and the arrival time of the rising edge of the other second clock signals is greater than or equal to the preset threshold, it indicates that there is no clock source out of synchronization.
  • the clock server may not correct the local time. Although the number of seconds of the local time is not increased by 1, the number of seconds of the local time may be corrected according to the received TOD information. Therefore, the second correction module 405 may be omitted.
  • the receiving module 401 receives the second clock signal sent by at least three clock sources, and the obtaining module 402 obtains the difference between the arrival times of the rising edges of the clock signal every two seconds, and the determining module 403 determines whether there is one second.
  • the difference between the arrival time of the rising edge of the clock signal and the arrival time of the rising edge of the other second clock signals is greater than or equal to the preset threshold. If yes, indicating that the clock source transmitting the one second clock signal is out of synchronization, the first correction module 404 performs the The rising edge of the second clock signal other than this one second clock signal corrects the local time at the arrival time. It can be seen that the clock service in this embodiment avoids the situation that a large area of the client is out of synchronization due to the out of synchronization of the clock source.
  • another embodiment of the clock server in the embodiment of the present invention includes: a receiving module 501, configured to receive a second clock signal sent by at least three clock sources;
  • the obtaining module 502 is configured to obtain a difference between the arrival times of the rising edges of the every two seconds clock signal received by the receiving module 501;
  • the determining module 503 is configured to determine whether there is a difference between the arrival time of the rising edge of the second clock signal and the arrival time of the rising edge of the other second clock signals is greater than or equal to the preset threshold, and if so, triggering A calibration module 504 performs a related operation, and the second calibration module 505 is triggered to perform a related operation.
  • the first calibration module 504 is configured to obtain an average value of the arrival time of the rising edge of the other second clock signal after receiving the trigger of the determining module 503. Correcting the local time based on the average value;
  • the second correction module 505 is configured to: after receiving the trigger of the determining module 503, obtain an average value of the arrival times of the rising edges of all the second clock signals, and correct the local time according to the second pulse signal corresponding to the average value.
  • the receiving module 501 receives the second clock signal sent by at least three clock sources, and the obtaining module 502 acquires the difference between the arrival time of the rising edge of the received two-second clock signal.
  • the determining module 503 determines whether there is a difference between the arrival time of the rising edge of the second clock signal and the arrival time of the rising edge of the other second clock signals is greater than or equal to the preset threshold, and if so, the first correction module 504 acquires other second clock signals.
  • the average value of the rising edge of the rising edge is corrected according to the average value; otherwise, the second correcting module 505 acquires the average value of the arrival time of the rising edge of all the second clock signals, and corrects the local time according to the second pulse signal corresponding to the average value.
  • the clock server in this embodiment may further include an alarm module 506 for initiating an alarm.
  • the determining module 503 determines the difference between the arrival time of the rising edge of one second clock signal and the arrival time of the rising edge of the other second clock signals.
  • the alarm module 506 may be triggered to perform related operations.
  • the receiving module 501 receives the second clock signal sent by at least three clock sources, and the obtaining module 502 acquires the difference between the arrival times of the rising edges of the clock signal every two seconds, and the determining module 503 determines whether there is one second.
  • the difference between the arrival time of the rising edge of the clock signal and the arrival time of the rising edge of the other second clock signals is greater than or equal to the preset threshold.
  • an embodiment of the present invention further provides a client.
  • an embodiment of a client in an embodiment of the present invention includes:
  • the first obtaining module 601 is configured to acquire timings of at least three clock servers;
  • the second obtaining module 602 is configured to obtain a difference in timing of each two clock servers acquired by the first obtaining module 601.
  • the determining module 603 is configured to determine whether the timing of the timing of the clock server and the timing of the other clock servers is greater than or equal to the preset threshold. If yes, the first calibration module 604 is triggered to perform the related operation, otherwise the second calibration module 605 is triggered. Perform related operations;
  • the first correction module 604 is configured to: after receiving the trigger of the determining module 603, correct the local time according to the timing of other clock servers;
  • the second correction module 605 is configured to: after receiving the trigger of the determining module 603, correct the local time according to the timing of all clock servers.
  • the first obtaining module 601 acquires the timing of at least three clock servers, and the second obtaining module 602 obtains the difference of the timing of each two clock servers. Then, the determining module 603 determines whether there is a clock server. The difference between the timing of the timing and the timing of the other clock servers is greater than or equal to the preset threshold. If yes, indicating that the clock server is out of synchronization, the first correction module 604 corrects the local according to the timing of the clock server other than the one clock server. time.
  • the client in this embodiment can find that the clock server is out of synchronization (including the clock server out of synchronization caused by the out-of-synchronization of the clock source), and does not use the timing of the out-of-step clock server to correct the local time, so that the clock source can be found. Steps and avoid situations where a large area of the client is out of sync due to out-of-synchronization of the clock source.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Electric Clocks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)
  • Computer And Data Communications (AREA)

Description

校正本地时间的方法、 时钟服务器 s :户机 本申请要求了 2009年 10月 15日提交的, 申请号为 200910197337.5, 发 明名称为"校正本地时间的方法以及时钟服务器"的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及通信技术领域, 具体涉及校正本地时间的方法、 时钟服务器 及客户机。 背景技术
第三代网络对同步提出了新的要求, 例如, 在采用时分同步的码分多址 技术 (TD-SCDMA, Time Divis ion- Synchronous Code Division Multiple Access) 的网络中, 基站系统之间需要高精度的时间同步, 例如优于 1.5微秒(us )。
目前主用采用如下同步方式: 全球定位系统 (GPS, Global Positioning System )接收机或其它时钟源向时钟服务器发送秒脉沖 (PPS, Pulse Per Second) 信号。 当时钟服务器接收到 PPS信号的上升沿时, 时钟服务器校正本地时间, 包括将本地时间的秒以下的时间清 0, 以及将本地时间的秒数加一秒, 从而 使时钟服务器与时钟源保持同步。 例如, 若时钟服务器在本地时间为
30.9999999秒时, 接收到输入的 PPS信号的上升沿, 则时钟服务器将本地时 间校正为 31.0000000秒。
同时, 时钟服务器为网络中的多个客户机提供授时, 使客户机与时钟服 务器保持同步, 从而实现网络中的客户机之间保持同步。
在对现有技术的研究和实践过程中, 本发明的发明人发现, 现有技术中, 每个时钟服务器从一个时钟源获得 PPS信号, 当时钟源失步时, 时钟服务器 无法发现而仍然使用该时钟源发送的 PPS信号校正本地时间, 从而造成较大 面积的客户机失步。 发明内容
本发明实施例提供能够发现时钟源失步, 能够避免因时钟源失步而造成 客户机失步的校正本地时间的方法、 时钟服务器以及客户机。 本发明一方面提供了一种校正本地时间的方法, 包括:
时钟服务器接收来自至少三个时钟源的秒时钟信号;
所述时钟服务器获取所述秒时钟信号中每两个秒时钟信号的上升沿到来 时刻的差值;
所述时钟服务器判断是否有一个秒时钟信号的上升沿到来时刻与其它秒 时钟信号的上升沿到来时刻的差值均大于或等于预置门限;
若是, 则所述时钟服务器根据所述其它秒时钟信号的上升沿到来时刻校 正本地时间。
本发明另一方面提供了一种时钟服务器, 包括:
接收模块, 用于接收来自至少三个时钟源的秒时钟信号;
获取模块, 用于获取所述秒时钟信号中的每两个秒时钟信号的上升沿到 来时刻的差值;
判断模块, 用于判断是否有一个秒时钟信号的上升沿到来时刻与其它秒 时钟信号的上升沿到来时刻的差值均大于或等于预置门限, 若是, 则触发第 一校正模块;
第一校正模块, 用于收到所述判断模块的触发后, 根据所述其它秒时钟 信号的上升沿到来时刻校正本地时间。
本发明另一方面还提供了一种校正本地时间的方法, 包括:
客户机获取来自至少三个时钟服务器的授时;
所述客户机获取所述时钟服务器中每两个时钟服务器的授时的差值; 所述客户机判断是否有一个时钟服务器的授时与其它时钟服务器的授时 的差值均大于或等于预置门限, 若是, 所述客户机根据其它时钟服务器的授 时校正本地时间;
若所述客户机判定没有一个时钟服务器的授时与其它时钟服务器的授时 的差值均大于或等于预置门限, 所述客户机根据所述来自至少三个时钟服务 器的授时校正本地时间。
本发明另一方面还提供了一种客户机, 包括:
第一获取模块, 用于获取来自至少三个时钟服务器的授时;
第二获取模块, 用于获取所述来自至少三个时钟服务器的授时中每两个 时钟服务器的授时的差值; 判断模块, 用于判断是否有一个时钟服务器的授时与其它时钟服务器的 授时的差值均大于或等于预置门限, 若是, 则触发第一校正模块, 若没有一 个时钟服务器的授时与其它各时钟服务器的授时的差值均大于或等于预置门 限时, 则触发第二校正模块;
所述第一校正模块, 用于收到所述判断模块的触发后, 根据其它时钟服 务器的授时校正本地时间;
所述第二校正模块, 用于收到所述判断模块的触发后, 根据所述来自至 少三个时钟服务器的授时校正本地时间。
从以上技术方案可以看出, 本发明可以具有以下优点:
本实施例中的方法、 时钟服务器以及客户机可以发现所获得时钟信号的 不准确且不使用时钟信号校正本地时间, 从而避免了因所获得的时钟信号不 准确而造成的客户机失步的情况。 附图说明
图 1是本发明实施例中校正本地时间的方法的一个实施例的流程图; 图 2是本发明实施例中校正本地时间的方法的另一实施例的流程图; 图 3是本发明实施例中校正本地时间的方法的另一实施例的流程图; 图 4是本发明实施例中时钟服务器的一个实施例的示意图;
图 5是本发明实施例中时钟服务器的另一实施例的示意图;
图 6是本发明实施例中客户机的一个实施例的示意图。 具体实施方式
本发明实施例提供一种校正本地时间的方法以及时钟服务器, 能够使时 钟服务器发现时钟源失步, 能够避免因时钟源失步而造成较大面积的客户机 失步。 以下分别进行详细说明。
请参阅图 1, 本发明实施例中校正本地时间的方法的一个实施例, 包括: 101、 时钟服务器接收至少三个时钟源发送的秒时钟信号;
时钟服务器接收至少三个时钟源发送的 PPS信号,该至少三个时钟源是相 互独立的, 时钟源可以为 GPS或北斗。
时钟服务器可以周期性地(每 2秒或每 1秒一次)接收时钟源发送的日时 间 (TOD, Time Of Date )信息, 以校正本地时间的秒数, 具体执行方式为现 有公知技术, 此处不作赘述。
102、 时钟服务器获取每两个秒时钟信号的上升沿到来时刻的差值; 在 101之后, 时钟服务器获取接收到每两个 PPS信号的上升沿到来时刻的 差值。 进一步的, 进行比较的 PPS信号可以是上升沿到来时刻相差不超过 0.5 秒的所有 PPS信号。
可以在时钟服务器内部设置一个计时器和一个比较器, 用于记录各个时 钟源发送的 PPS信号的上升沿到来时刻, 并比较每两个 PPS信号的上升沿到来 时刻的差值。也可以采用其它现有公知技术获取每两个 PPS信号的上升沿到来 时刻的差值, 此处不——列举。
103、时钟服务器判断是否有一个秒时钟信号的上升沿到来时刻与其它各 秒时钟信号的上升沿到来时刻的差值大于等于预置门限, 若是, 则执行 104, 否则执行 105;
在为时钟服务器提供 PPS信号的所有时钟源中,同时有两个以上的时钟源 出现失步的概率是非常低的, 可以不作考虑。 因此, 本发明实施例中, 以考 虑有且仅有一个时钟源出现失步的情况为例进行说明。
由于时钟源的误差一般为 200纳秒,因此,在各个时钟源不失步的情况下, 每两个时钟源的上升沿到来时刻的差值应该不大于 400纳秒, 因此, 可以将预 置门限设置为 400纳秒, 那么, 若有一个 PPS信号的上升沿到来时刻与其它各 PPS信号的上升沿到来时刻的差值均大于等于 400纳秒, 则可以确定发送这一 个 PPS信号的时钟源出现失步。
104、 时钟服务器根据其它秒时钟信号的上升沿到来时刻校正本地时间; 流程结束。
在 103中若判定有一个 PPS信号的上升沿到来时刻与其它各 PPS信号的上 升沿到来时刻的差值均大于等于预置门限,说明发送这一个 PPS信号的时钟源 失步, 因此, 时钟服务器可以根据除了这一个 PPS之外的其它 PPS信号的上升 沿到来时刻校正本地时间, 可见, 本实施例中的时钟服务器可以发现失步的 时钟源, 并避免因时钟源失步而造成较大面积的客户机失步的情况。
此处需要说明的是,时钟服务器根据其它 PPS信号的上升沿到来时刻校正 本地时间, 具体可以包括: 根据其它秒时钟信号中的任一个秒时钟信号的上 升沿到来时刻校正本地时间; 具体也可以包括: 获取其它秒时钟信号中的两 个以上的秒时钟信号的上升沿到来时刻的平均值, 并根据该平均值校正本地 时间。
此处还需要说明的是, 由于执行 102和 103需要一定的时间, 因此, 可以 理解的是, 时钟服务器根据其它秒时钟信号中的一个秒时钟信号的上升沿到 来时刻校正本地时间, 可以在该上升沿到来时刻延迟 1秒(也可以延迟 2秒或 3 秒 ... ...)后将本地时间的秒以下的时间清 0, 并将本地时间的秒数加 1 ; 同理, 时钟服务器根据其它秒时钟信号中的两个以上的秒时钟信号的上升沿到来时 刻的平均值校正本地时间, 可以在该平均值延迟 1秒 (也可以延迟 2秒或 3 秒 ... ... )后将本地时间的秒以下的时间清 0, 并将本地时间的秒数加 1。
105、 根据所有秒时钟信号的上升沿到来时刻校正本地时间, 流程结束。 可以理解的是,若 103中判定没有一个秒时钟信号的上升沿到来时刻与其 它各秒时钟信号的上升沿到来时刻的差值大于等于预置门限,说明没有时钟 源失步,则时钟服务器可以根据所有秒时钟信号中的任一个的上升沿到来时 刻校正本地时间;也可以获取所有秒时钟信号中的两个以上的秒时钟信号的 上升沿到来时刻的平均值, 并根据该平均值校正本地时间。
此处需要说明的是, 当 103中判定没有一个秒时钟信号与其它秒时钟信号 的上升沿到来时刻的差值大于等于预置门限时, 说明没有时钟源失步, 时钟 服务器可以不校正本地时间, 虽然会导致本地时间的秒数没有加 1, 但可以根 据接收的 TOD信息校正本地时间的秒数, 因此, 105是可以省略的。
本实施例中, 时钟服务器接收至少三个时钟源发送的秒时钟信号, 并比 较每两个秒时钟信号的上升沿到来时刻, 若有一个秒时钟信号与其它秒时钟 信号的上升沿到来时刻的差值大于等于预置门限, 说明发送这一个秒时钟信 号的时钟源失步, 则时钟服务器根据除这一个秒时钟信号之外的其它秒时钟 信号的上升沿到来时刻校正本地时间。 可见, 本实施例中的时钟服务器可以 免了因时钟源失步而造成较大面积的客户机失步的情况。
为便于理解, 下面以一更具体的实施例, 对本发明实施例中的校正本地 时间的方法进行详细说明。 请参阅图 2, 本发明实施例中的校正本地时间的方 法的另一实施例包括:
201、 时钟服务器接收三个时钟源发送的秒时钟信号;
本实施例中, 时钟服务器固定接收其中一个时钟源发送的 TOD信息, 用 于校正本地时间的秒数。
202、 时钟服务器获取每两个秒时钟信号的上升沿到来时刻的差值; 本实施例中, 在时钟服务器中设置了一个独立于本地时钟的计时器, 用 于确定每个秒时钟信号的上升沿到来时刻。
203、时钟服务器判断是否有一个秒时钟信号的上升沿到来时刻与其它各 秒时钟信号的上升沿到来时刻的差值大于等于预置门限, 若是, 则执行 204, 否则执行 205;
本实施例中, 预置门限可以设为 500纳秒(含 100纳秒的冗余)。
假设前后接收到的三个 PPS信号的上升沿到来时刻分别为 29.99999985 秒、 29.99999995秒和 30.00000045秒, 那么第一个接收到的 PPS信号与第二个 接收到的 PPS信号的上升沿到来时刻的差值为 100纳秒, 第一个接收到的 PPS 信号与第三个接收到的 PPS信号的上升沿到来时刻的差值为 600纳秒, 第二个 接收到的 PPS信号与第三个接收到的 PPS信号的上升沿到来时刻的差值为 500 纳秒, 因此,第三个接收的 PPS信号的上升沿到来时刻与其它各秒时钟信号的 上升沿到来时刻的差值均大于等于 500纳秒, 因此, 可以确定发送第三个接收 的 PPS信号的时钟源失步。
204、 获取其它两个秒时钟信号的上升沿到来时刻的平均值, 才艮据该平均 值校正本地时间; 流程结束。
对应于 203中的 支设, 确定第三个接收的 PPS信号与其它秒时钟信号的上 升沿到来时刻的差值大于等于 500纳秒之后,时钟服务器获取第一个和第二个 接收的秒时钟信号的上升沿到来时刻的平均值, 即 29.99999985秒和 29.99999995秒的平均值 29.99999990秒, 并根据该平均值校正本地时间, 具体 可以为: 在计时器为 30.99999990秒时将本地时间的秒以下的时间清 0, 并将 本地时间的秒数加 1。
可以理解的是,在确定第三个接收的 PPS信号与其它秒时钟信号的上升沿 到来时刻的差值大于等于 500纳秒之后,也可以根据第一个或第二个接收的秒 时钟信号的上升沿到来时刻校正本地时间, 例如, 在计时器为 30.99999985秒 时将本地时间的秒以下的时间清 0, 并将本地时间的秒数加 1。
此处还需要说明的是, 当判定有一个秒时钟信号的上升沿到来时刻与其 它各秒时钟信号的上升沿到来时刻的差值大于等于预置门限时, 时钟服务器 还可以发起告警, 以通知运维人员进行处理。
205、 获取三个秒时钟信号的上升沿到来时刻的平均值, 并根据该平均值 校正本地时间, 流程结束。
若将 203中的假设改为第三个接收的秒时钟信号的上升沿到来时刻为 30.00000005秒, 那么, 第一个接收到的 PPS信号与第二个接收到的 PPS信号的 上升沿到来时刻的差值为 100纳秒, 第一个接收到的 PPS信号与第三个接收到 的 PPS信号的上升沿到来时刻的差值为 200纳秒, 第二个接收到的 PPS信号与 第三个接收到的 PPS信号的上升沿到来时刻的差值为 100纳秒, 因此, 203中判 定没有一个秒时钟信号的上升沿到来时刻与其它各秒时钟信号的上升沿到来 时刻的差值大于等于预置门限, 即确定没有时钟源失步, 则时钟服务器获取 接收到的三个秒时钟信号的上升沿到来时刻的平均值 29.99999995秒, 并根据 该平均值校正本地时间, 即在计时器为 30.99999995秒时将本地时间的秒以下 的时间清 0, 并将本地时间的秒数加 1。
可以理解的是,若 203中判定没有一个秒时钟信号的上升沿到来时刻与其 它各秒时钟信号的上升沿到来时刻的差值大于等于预置门限, 则时钟服务器 也可以根据第二个接收的秒时钟信号的上升沿到来时刻 29.99999995秒校正 并将本地时间的秒数加 1。
此外还需要说明的是, 在 204和 205中获取平均值时可以根据时钟源自身 的精度进行加权平均。 例如, 在 204中, 可以根据时钟源自身的精度, 对其它 两个秒时钟信号的上升沿到来时刻进行加权平均获得平均值。
本实施例中, 时钟服务器接收三个时钟源发送的秒时钟信号, 若有一个 秒时钟信号的上升沿到来时刻与其它各两个秒时钟信号的上升沿到来时刻的 差值大于等于预置门限, 说明发送这一个秒时钟信号的时钟源失步, 则时钟 服务器根据其它两个秒时钟信号的上升沿到来时刻的平均值校正本地时间。 可见, 本实施例中的时钟服务器可以发现时钟源失步且不使用该时钟源发送 的秒时钟信号校正本地时间, 从而避免了因时钟源失步而造成较大面积的客 户机失步的情况。 并且, 本实施例中的时钟服务器还能够提高时钟服务器的 精度, 能够在发现时钟源失步时发起告警, 提高了用户体验。
可以理解的是, 客户机根据时钟服务器的授时校正本地时间也可以采用 本发明实施例中的核心思想。 因此, 请参阅图 3, 本发明实施例还提供校正本 地时间的方法的另一实施例, 包括:
301、 客户机获取至少三个时钟服务器的授时;
现有技术中, 客户机从一个时钟服务器获得授时, 并根据该授时调整本 地时间, 以实现客户机与时钟服务器的同步。
本实施例中, 客户机从至少三个时钟服务器获得授时, 该至少三个时钟 服务器是相互独立的。
302、 客户机获取每两个时钟服务器的授时的差值;
303、客户机判断是否有一个时钟服务器的授时与其它各时钟服务器的授 时的差值大于等于预置门限, 若是, 则执行 304, 否则执行 305;
本实施例中, 预置门限可以设为 500纳秒(含 100纳秒的冗余)。
假设客户机从三个时钟服务器甲、 乙和丙获得授时, 且从时钟服务器甲、 乙和丙获得的授时分别为 30分 29.99999985秒、 30分 29.99999995秒和 30分 30.00000045秒, 那么时钟服务器甲的授时与时钟服务器乙的授时的差值为 100纳秒, 时钟服务器甲的授时与时钟服务器丙的授时的差值为为 600纳秒, 时钟服务器乙的授时与时钟服务器丙的授时的差值为 500纳秒, 因此, 时钟服 务器丙的授时与其它各时钟服务器的授时的差值均大于等于 500纳秒, 因此, 可以确定时钟服务器丙失步。
在为客户机提供授时的所有时钟服务器中, 同时有两个以上的时钟服务 器出现失步的概率是非常低的, 可以不作考虑。 因此, 本发明实施例中, 以 考虑有且仅有一个时钟服务器出现失步的情况为例进行说明。
304、 客户机根据其它时钟服务器的授时校正本地时间; 结束流程。
若客户机判定有一个时钟服务器的授时与其它各时钟服务器的授时的差 值大于等于预置门限, 说明这一个时钟服务器失步, 则客户机根据除了这一 个时钟服务器之外的其他时钟服务器的授时校正本地时间。 可见, 本实施例 中的客户机可以发现时钟服务器失步 (包括因时钟源失步引起的时钟服务器 失步), 且不使用失步的时钟服务器的授时校正本地时间, 从而可以发现时钟 源失步, 并避免因时钟源失步而造成较大面积的客户机失步的情况。
305、 客户机根据所有时钟服务器的授时校正本地时间; 结束流程。 若客户机判定没有一个时钟服务器的授时与其它各时钟服务器的授时的 差值大于等于预置门限, 说明没有时钟服务器失步, 则客户机根据所有时钟 服务器的授时校正本地时间, 具体可以为: 根据所有时钟服务器的授时的平 均值, 或根据其中一个时钟服务器的授时校正本地时间。
本实施例中, 客户机获得至少三个时钟服务器的授时, 并比较每两个时 钟服务器的授时, 若有一个时钟服务器的授时与其它各时钟服务器的授时的 差值大于等于预置门限, 说明这一个时钟服务器失步, 则客户机根据除这一 个时钟服务器之外的其他时钟服务器的授时校正本地时间。 可见, 本实施例 中的客户机可以发现时钟服务器失步 (包括因时钟源失步引起的时钟服务器 失步), 且不使用失步的时钟服务器的授时校正本地时间, 从而可以发现时钟 源失步, 并避免因时钟源失步而造成较大面积的客户机失步的情况。
下面对本发明实施例中的时钟服务器进行详细说明, 请参阅图 4, 本发明 实施例中的时钟服务器的一个实施例包括:
接收模块 401, 用于接收至少三个时钟源发送的秒时钟信号;
获取模块 402, 用于比较接收模块 401接收到的至少三个时钟源发送的秒 时钟信号, 获取每两个秒时钟信号的上升沿到来时刻的差值;
判断模块 403,用于判断是否有一个秒时钟信号的上升沿到来时刻与其它 各秒时钟信号的上升沿到来时刻的差值大于等于预置门限, 若是, 则触发第 一校正模块 404执行相关操作, 否则触发第二校正模块 405执行相关操作; 第一校正模块 404, 用于收到判断模块 403的触发后, 根据其它秒时钟信 号的上升沿到来时刻校正本地时间; 或者
第二校正模块 405, 用于收到判断模块 403的触发后, 根据所有秒时钟信 号的上升沿到来时刻校正本地时间。
此处需要说明的是,第一校正模块 404用于根据其它秒时钟信号的上升沿 到来时刻校正本地时间, 具体可以用于才艮据其它秒时钟信号中的一个秒时钟 信号的上升沿到来时刻校正本地时间; 具体也可以用于获取其它秒时钟信号 中的两个以上的秒时钟信号的上升沿到来时刻的平均值, 并根据该平均值校 正本地时间。
可以理解的是,第二校正模块 405在判断模块判定没有一个秒时钟信号的 上升沿到来时刻与其它各秒时钟信号的上升沿到来时刻的差值大于等于预置 门限时, 可以与现有技术一样, 才艮据其中一个秒时钟信号的上升沿到来时刻 校正本地时间; 也可以获取所有秒时钟信号中的两个以上的秒时钟信号的上 升沿到来时刻的平均值, 并根据该平均值校正本地时间。
此处需要说明的是, 当判断模块 403判定没有一个秒时钟信号的上升沿到 来时刻与其它各秒时钟信号的上升沿到来时刻的差值大于等于预置门限时, 说明没有时钟源失步, 时钟服务器可以不校正本地时间, 虽然会导致本地时 间的秒数没有加 1, 但可以根据接收的 TOD信息校正本地时间的秒数, 因此, 第二校正模块 405是可以省略的。
本实施例的时钟服务器中,接收模块 401接收至少三个时钟源发送的秒时 钟信号, 获取模块 402获取每两个秒时钟信号的上升沿到来时刻的差值, 判断 模块 403判断是否有一个秒时钟信号的上升沿到来时刻与其它各秒时钟信号 的上升沿到来时刻的差值大于等于预置门限, 若是, 说明发送这一个秒时钟 信号的时钟源失步,则第一校正模块 404根据除这一个秒时钟信号之外的其它 秒时钟信号的上升沿到来时刻校正本地时间。 可见, 本实施例中的时钟服务 从而避免了因时钟源失步而造成较大面积的客户机失步的情况。
为便于理解, 下面以一更具体的实施例对本发明实施例中的时钟服务器 进行详细说明。请参阅图 5,本发明实施例中的时钟服务器的另一实施例包括: 接收模块 501, 用于接收至少三个时钟源发送的秒时钟信号;
获取模块 502, 用于获取接收模块 501接收到的每两个秒时钟信号的上升 沿到来时刻的差值;
判断模块 503,用于判断是否有一个秒时钟信号的上升沿到来时刻与其它 各秒时钟信号的上升沿到来时刻的差值大于等于预置门限, 若是, 则触发第 一校正模块 504执行相关操作, 否则触发第二校正模块 505执行相关操作; 第一校正模块 504, 用于收到判断模块 503的触发后, 获取其它秒时钟信 号的上升沿到来时刻的平均值, 根据该平均值校正本地时间;
第二校正模块 505, 用于收到判断模块 503的触发后, 获取所有秒时钟信 号的上升沿到来时刻的平均值, 并根据该平均值对应的秒脉沖信号校正本地 时间。
本实施例的时钟服务器中,接收模块 501接收至少三个时钟源发送的秒时 钟信号, 获取模块 502获取接收的每两个秒时钟信号的上升沿到来时刻的差 值。
然后,判断模块 503判断是否有一个秒时钟信号的上升沿到来时刻与其它 各秒时钟信号的上升沿到来时刻的差值大于等于预置门限, 若是, 则第一校 正模块 504获取其它秒时钟信号的上升沿到来时刻的平均值,根据该平均值校 正本地时间;否则第二校正模块 505获取所有秒时钟信号的上升沿到来时刻的 平均值, 并根据该平均值对应的秒脉沖信号校正本地时间。
此外,本实施例中的时钟服务器还可以包括告警模块 506,用于发起告警; 判断模块 503在判定有一个秒时钟信号的上升沿到来时刻与其它各秒时钟信 号的上升沿到来时刻的差值大于等于预置门限时,除了触发第一校正模块 504 执行相关操作之外, 还可以触发告警模块 506执行相关操作。
本实施例的时钟服务器中,接收模块 501接收至少三个时钟源发送的秒时 钟信号, 获取模块 502获取每两个秒时钟信号的上升沿到来时刻的差值, 判断 模块 503判断是否有一个秒时钟信号的上升沿到来时刻与其它各秒时钟信号 的上升沿到来时刻的差值大于等于预置门限, 若是, 说明发送这一个秒时钟 信号的时钟源失步,则第一校正模块 504根据除这一个秒时钟信号之外的其它 秒时钟信号的上升沿到来时刻校正本地时间,否则第二校正模块 505根据所有 秒时钟信号的上升沿到来时刻的平均值校正本地时间。 可见, 本实施例中的 地时间, 从而避免了因时钟源失步而造成较大面积的客户机失步的情况。 并 且, 本实施例中的时钟服务器还能够提高时钟服务器的精度, 能够在发现时 钟源失步时发起告警, 提高了用户体验。 相应于图 3所示实施例, 本发明实施例还提供一种客户机。 请参阅图 6, 本发明实施例中客户机的一个实施例包括:
第一获取模块 601, 用于获取至少三个时钟服务器的授时;
第二获取模块 602, 用于获取第一获取模块 601获取的每两个时钟服务器 的授时的差值;
判断模块 603,用于判断是否有一个时钟服务器的授时与其它各时钟服务 器的授时的差值大于等于预置门限, 若是, 则触发第一校正模块 604执行相关 操作, 否则触发第二校正模块 605执行相关操作;
第一校正模块 604, 用于收到判断模块 603的触发后, 根据其它时钟服务 器的授时校正本地时间;
第二校正模块 605, 用于收到判断模块 603的触发后, 根据所有时钟服务 器的授时校正本地时间。
本实施例的客户机中, 第一获取模块 601获取至少三个时钟服务器的授 时, 第二获取模块 602获取每两个时钟服务器的授时的差值, 然后, 判断模块 603判断是否有一个时钟服务器的授时与其它各时钟服务器的授时的差值大 于等于预置门限, 若是, 说明这一个时钟服务器失步, 则第一校正模块 604 根据除这一个时钟服务器之外的其它时钟服务器的授时校正本地时间。可见, 本实施例中的客户机可以发现时钟服务器失步 (包括因时钟源失步引起的时 钟服务器失步), 且不使用失步的时钟服务器的授时校正本地时间, 从而可以 发现时钟源失步,并避免因时钟源失步而造成较大面积的客户机失步的情况。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分是 可以通过程序来指令相关的硬件来完成, 该程序可以存储于一计算机可读存 储介质中, 存储介质可以包括: 只读内存(ROM, Read-Only Memory )、 随 机存取存储器(RAM, Random Access Memory ), 磁盘或光盘等。
以上实施例的说明只是用于帮助理解本发明的方法及其核心思想; 同时, 对 于本领域的一般技术人员, 依据本发明的思想, 在具体实施方式及应用范围 上均会有改变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。

Claims

权利 要 求
1、 一种校正本地时间的方法, 其特征在于, 包括:
时钟服务器接收来自至少三个时钟源的秒时钟信号;
所述时钟服务器获取所述秒时钟信号中每两个秒时钟信号的上升沿到来 时刻的差值;
所述时钟服务器判断是否有一个秒时钟信号的上升沿到来时刻与其它秒 时钟信号的上升沿到来时刻的差值均大于或等于预置门限;
若是, 则所述时钟服务器根据所述其它秒时钟信号的上升沿到来时刻校 正本地时间。
2、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述其它秒时钟 信号的上升沿到来时刻校正本地时间包括:
获取所述其它秒时钟信号中至少两个秒时钟信号的上升沿到来时刻的平 均值, 根据该平均值校正本地时间;
或,
根据所述其它秒时钟信号中的任一个秒时钟信号的上升沿到来时刻校正 本地时间。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述方法还包括: 若判定没有一个秒时钟信号的上升沿到来时刻与其它秒时钟信号的上升 沿到来时刻的差值均大于或等于预置门限, 则所述时钟服务器获取所有秒时 钟信号中至少两个秒时钟信号的上升沿到来时刻的平均值并根据该平均值校 正本地时间, 或者, 根据任意一个秒时钟信号的上升沿到来时刻校正本地时 间。
4、 根据权利要求 1或 2所述的方法, 其特征在于, 所述时钟服务器接收来 自三个时钟源的秒时钟信号;
所述方法还包括: 若判定没有一个秒时钟信号的上升沿到来时刻与其它 秒时钟信号的上升沿到来时刻的差值均大于或等于预置门限, 则所述时钟服 务器根据所接收的第二个秒时钟信号的上升沿到来时刻校正本地时间。
5、 根据权利要求 1至 4任意一项所述的方法, 其特征在于, 所述方法还包 括: 若判定有一个秒时钟信号的上升沿到来时刻与其它秒时钟信号的上升沿 到来时刻的差值均大于或等于预置门限, 则所述时钟服务器发起告警。
6、 根据权利要求 2所述的方法, 其特征在于, 所述获取其它秒时钟信号 中至少两个秒时钟信号的上升沿到来时刻的平均值包括: 根据时钟源自身的 精度, 对所述其它秒时钟信号中至少两个秒时钟信号的上升沿到来时刻进行 加权平均获得所述平均值。
7、 根据权利要求 1至 6任意一项所述的方法, 其特征在于, 所述预置门限 为 500纳秒。
8、 一种时钟服务器, 其特征在于, 包括:
接收模块, 用于接收来自至少三个时钟源的秒时钟信号;
获取模块, 用于获取所述秒时钟信号中的每两个秒时钟信号的上升沿到 来时刻的差值;
判断模块, 用于判断是否有一个秒时钟信号的上升沿到来时刻与其它秒 时钟信号的上升沿到来时刻的差值均大于或等于预置门限, 若是, 则触发第 一校正模块;
第一校正模块, 用于收到所述判断模块的触发后, 根据所述其它秒时钟 信号的上升沿到来时刻校正本地时间。
9、 根据权利要求 8所述的时钟服务器, 其特征在于, 第一校正模块用于 获取所述其它秒时钟信号中至少两个秒时钟信号的上升沿到来时刻的平均 值, 根据该平均值校正本地时间;
或者,
第一校正模块用于根据所述其它秒时钟信号中的任一个秒时钟信号的上 升沿到来时刻校正本地时间。
10、 根据权利要求 8所述的时钟服务器, 其特征在于, 判断模块还用于判 断没有一个秒时钟信号的上升沿到来时刻与其它秒时钟信号的上升沿到来时 刻的差值均大于或等于预置门限时, 触发第二校正模块;
所述服务器还包括:
第二校正模块, 用于获取所有秒时钟信号中至少两个秒时钟信号的上升 根据任意一个秒时钟信号的上升沿到来时刻校正本地时间。
11、 一种校正本地时间的方法, 其特征在于, 包括:
客户机获取来自至少三个时钟服务器的授时; 所述客户机获取所述时钟服务器中每两个时钟服务器的授时的差值; 所述客户机判断是否有一个时钟服务器的授时与其它时钟服务器的授时 的差值均大于或等于预置门限, 若是, 所述客户机根据其它时钟服务器的授 时校正本地时间;
若所述客户机判定没有一个时钟服务器的授时与其它时钟服务器的授时 的差值均大于或等于预置门限, 所述客户机根据所述来自至少三个时钟服务 器的授时校正本地时间。
12、 根据权利要求 11所述的方法, 其特征在于, 所述根据所述来自至少 三个时钟服务器的授时校正本地时间包括:
根据所述至少三个时钟服务器中所有时钟服务器的授时的平均值校正本 地时间, 或根据所述至少三个时钟服务器中任意一个时钟服务器的授时校正 本地时间。
13、 一种客户机, 其特征在于, 包括:
第一获取模块, 用于获取来自至少三个时钟服务器的授时;
第二获取模块, 用于获取所述来自至少三个时钟服务器的授时中每两个 时钟服务器的授时的差值;
判断模块, 用于判断是否有一个时钟服务器的授时与其它时钟服务器的 授时的差值均大于或等于预置门限, 若是, 则触发第一校正模块, 若没有一 个时钟服务器的授时与其它各时钟服务器的授时的差值均大于或等于预置门 限时, 则触发第二校正模块;
所述第一校正模块, 用于收到所述判断模块的触发后, 根据其它时钟服 务器的授时校正本地时间;
所述第二校正模块, 用于收到所述判断模块的触发后, 根据所述来自至 少三个时钟服务器的授时校正本地时间。
14、 根据权利要求 13所述的客户机, 其特征在于, 所述第二校正模块用 于根据所述至少三个时钟服务器中所有时钟服务器的授时的平均值校正本地 时间, 或者根据所述至少三个时钟服务器中任意一个时钟服务器的授时校正 本地时间。
PCT/CN2010/077767 2009-10-15 2010-10-15 校正本地时间的方法、时钟服务器及客户机 WO2011044850A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910197337.5 2009-10-15
CN2009101973375A CN101695188B (zh) 2009-10-15 2009-10-15 校正本地时间的方法以及时钟服务器

Publications (1)

Publication Number Publication Date
WO2011044850A1 true WO2011044850A1 (zh) 2011-04-21

Family

ID=42094111

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/077767 WO2011044850A1 (zh) 2009-10-15 2010-10-15 校正本地时间的方法、时钟服务器及客户机

Country Status (2)

Country Link
CN (1) CN101695188B (zh)
WO (1) WO2011044850A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112444800A (zh) * 2020-10-19 2021-03-05 中科传启(苏州)科技有限公司 一种超声测距装置的校正方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101695188B (zh) * 2009-10-15 2012-01-04 上海华为技术有限公司 校正本地时间的方法以及时钟服务器
CN102238719B (zh) * 2010-04-27 2014-10-08 中国移动通信集团公司 时间同步方法、装置及分布式时间同步系统
CN102231656B (zh) * 2011-06-20 2016-09-14 南京中兴新软件有限责任公司 Ntp服务器时钟同步保持方法、系统及装置
CN103049038B (zh) * 2011-10-17 2015-10-14 卡斯柯信号有限公司 用于三取二安全系统的硬件时钟同步电路
CN106027191B (zh) * 2016-05-23 2018-09-21 北京小米移动软件有限公司 时间的更新方法、装置和终端设备
CN106685566B (zh) * 2016-12-31 2018-10-02 上海东土远景工业科技有限公司 一种时钟源的选择方法和时钟服务器
CN111830892B (zh) * 2019-04-22 2022-09-23 新疆金风科技股份有限公司 风力发电机组统计时间校准方法和装置、存储介质
CN114020096B (zh) * 2021-11-17 2023-09-15 成都天奥电子股份有限公司 一种时间同步抗干扰方法、装置、时频终端及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004080265A (ja) * 2002-08-14 2004-03-11 Ntt Docomo Inc 基地局及び同期制御方法
CN1629652A (zh) * 2003-12-19 2005-06-22 德克萨斯仪器股份有限公司 从连网时间服务器向卫星定位系统(sps)接收器提供时间的系统和方法
CN1829146A (zh) * 2005-02-28 2006-09-06 富士通株式会社 用于时间校准的方法和装置
CN101695188A (zh) * 2009-10-15 2010-04-14 上海华为技术有限公司 校正本地时间的方法以及时钟服务器

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE506739C2 (sv) * 1995-09-29 1998-02-09 Ericsson Telefon Ab L M Drift och underhåll av klockdistributionsnät med redundans
SE504920C2 (sv) * 1995-09-29 1997-05-26 Ericsson Telefon Ab L M Förfarande och system för redundant klockdistribution till telekommunikationsutrustningar i vilka byte av vald klocksignal bland de inkommande klocksignalerna ständigt sker
JP3460118B2 (ja) * 1998-08-26 2003-10-27 富士通株式会社 同期網システムのクロック管理方法及び伝送装置
CN100535824C (zh) * 2004-09-23 2009-09-02 华为技术有限公司 提高卫星时间同步脉冲保持性能的方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004080265A (ja) * 2002-08-14 2004-03-11 Ntt Docomo Inc 基地局及び同期制御方法
CN1629652A (zh) * 2003-12-19 2005-06-22 德克萨斯仪器股份有限公司 从连网时间服务器向卫星定位系统(sps)接收器提供时间的系统和方法
CN1829146A (zh) * 2005-02-28 2006-09-06 富士通株式会社 用于时间校准的方法和装置
CN101695188A (zh) * 2009-10-15 2010-04-14 上海华为技术有限公司 校正本地时间的方法以及时钟服务器

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112444800A (zh) * 2020-10-19 2021-03-05 中科传启(苏州)科技有限公司 一种超声测距装置的校正方法

Also Published As

Publication number Publication date
CN101695188B (zh) 2012-01-04
CN101695188A (zh) 2010-04-14

Similar Documents

Publication Publication Date Title
WO2011044850A1 (zh) 校正本地时间的方法、时钟服务器及客户机
US8705509B2 (en) Time synchronizer
US9357516B2 (en) Transfer of synchronization in a hybrid global navigation satellite packet network system
JP6384697B2 (ja) 同期方法、同期装置、および基地局
US9237541B2 (en) Methods and arrangements for estimating timing offset differences in a cellular network
JP5285497B2 (ja) 移動通信方法及び無線基地局
KR20160068835A (ko) 무선 디바이스들에 대한 글로벌 시간 동기화 서버
US20190150106A1 (en) Wireless communication system, wireless terminal, and time synchronization method
WO2014083725A1 (ja) 同期装置、同期システム、無線通信装置及び同期方法
JP2012170076A (ja) アビオニクスネットワーク内のフリーランニングノードを時間同期させる方法
JP5505562B2 (ja) 無線伝送装置及び無線伝送方法
RU2004117529A (ru) Связь в асинхронной радиосети
US10159055B2 (en) GPS time-aiding and frequency correction
CN105228240A (zh) 一种定时同步方法、设备及基站
WO2010072176A1 (zh) 一种时钟同步的方法、装置和系统
CN108134644B (zh) 同步方法、装置、同步设备及系统
WO2017063322A1 (zh) 时间同步方法、主时间同步装置、通信系统及存储介质
WO2016065642A1 (zh) 一种同步装置及方法
WO2014100982A1 (zh) 一种空口同步方法及相关装置
JP4294409B2 (ja) 無線通信システムおよび移動無線装置
WO2016000324A1 (zh) 时间同步的实现方法及装置
KR101967027B1 (ko) 비정상 동작 상황을 개선한 gps를 이용하는 장치의 utc 시간 동기 방법
KR102064575B1 (ko) 디바이스 간의 시각 동기 정밀도를 향상시키는 방법, 장치, 시스템 및 컴퓨터 프로그램
EP3972160A1 (en) Time synchronization method, service board, and network device
JP2022521216A (ja) 無線デバイス間の距離における変化を検知するための方法、装置、およびデバイス可読メディア

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10823079

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10823079

Country of ref document: EP

Kind code of ref document: A1