WO2017101528A1 - Method and device for clock link switching and base station - Google Patents

Method and device for clock link switching and base station Download PDF

Info

Publication number
WO2017101528A1
WO2017101528A1 PCT/CN2016/098111 CN2016098111W WO2017101528A1 WO 2017101528 A1 WO2017101528 A1 WO 2017101528A1 CN 2016098111 W CN2016098111 W CN 2016098111W WO 2017101528 A1 WO2017101528 A1 WO 2017101528A1
Authority
WO
WIPO (PCT)
Prior art keywords
clock
link
synchronization information
clock link
server
Prior art date
Application number
PCT/CN2016/098111
Other languages
French (fr)
Chinese (zh)
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 WO2017101528A1 publication Critical patent/WO2017101528A1/en

Links

Images

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/0641Change of the master or reference, e.g. take-over or failure of the master
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/24Reselection being triggered by specific parameters
    • H04W36/30Reselection being triggered by specific parameters by measured or perceived connection quality data

Definitions

  • the present invention relates to the field of clock synchronization and handover, and in particular, to a clock link switching method, apparatus, and base station.
  • NTP Network Time Protocol
  • the full name of the IEEE1588 protocol is "Precision Clock Synchronization Protocol Standard for Network Measurement and Control Systems". It is a general specification for improving the timing synchronization capability of network systems, enabling distributed communication networks to have strict timing synchronization and applied to industrial automation systems.
  • the basic idea is to synchronize the internal clock of the network device (client) with the master clock of the master by hardware and software, and provide the operation with the synchronization setup time less than 10 ⁇ s, compared with the Ethernet delay time of 1000 ⁇ s without the IEEE1588 protocol. Significant improvements in timing synchronization metrics across the network.
  • IEEE 1588v2 is a master-slave synchronization system.
  • the master clock periodically releases the time synchronization protocol (PTP) and time information of the clock, and receives the clock from the clock port.
  • PTP time synchronization protocol
  • the system calculates the master-slave line time delay and the master-slave time difference, and uses the time difference to adjust the local time so that the slave device time maintains the frequency and phase consistent with the master time.
  • IEEE1588 can achieve both frequency synchronization and time synchronization.
  • the accuracy guarantee of time transfer mainly depends on the accuracy of the two condition counters and the symmetry of the link.
  • the communication base station uses 1588 technology for clock synchronization. Due to packet loss, delay, and service instability, the clock information is guaranteed to be uninterrupted. Multiple 1588 clock servers are deployed so that one of the 1588 clock servers is abnormal and the base station can automatically switch to another alternate clock server.
  • our communication base station determines whether the currently synchronized 1588 clock server is working properly by receiving the clock level or link loss rate sent by the 1588 clock server. If it is determined that the currently synchronized 1588 clock server is abnormal, the base station automatically switches to another. A 1588 standby clock server.
  • the clock level is the identifier carried in the announcement message (Announce message) sent by the 1588 clock server.
  • the link loss rate is divided into the primary link loss rate and the standby link loss rate.
  • the primary link loss rate is calculated according to the synchronization packet (Sync packet) sent by the currently synchronized 1588 clock server.
  • the packet loss rate of the standby link is counted according to the Announce packet sent by the standby 1588 clock server.
  • the current link handover has the following problems: it needs to wait for the primary clock server to be unavailable to trigger the handover process; before the handover, the base station receives too little data from the standby clock server, and the standby link loss rate of the base station is not Accurately, the performance of the standby clock server cannot be well judged, and the clock of the base station itself drifts, resulting in inaccurate synchronization data.
  • the embodiment of the invention provides a method, a device and a base station for switching a clock link, which solves the problem that the active and standby clocks are switched passively and the accuracy of the synchronous data is low in the related art.
  • a clock link switching method including:
  • the standby clock link is used as the new primary clock link.
  • the method After receiving the first synchronization information sent by the primary clock server and the second synchronization information sent by the backup clock server, the method further includes:
  • the standby clock link is used as the new primary clock link.
  • the step of calculating a jitter value difference between the primary clock link and the standby clock link according to the first synchronization information and the second synchronization information includes:
  • the jitter value of the standby clock link is compared with the jitter value of the primary clock link to obtain a jitter value difference between the primary clock link and the standby clock link in a predetermined time period.
  • the step of calculating the jitter value of the primary clock link according to the receiving time and the sending time of the first synchronization information in the predetermined time period includes:
  • the average of multiple jitter values is obtained to obtain the jitter value of the primary clock link.
  • the steps of using the standby clock link as the new primary clock link include:
  • the standby clock server is used as a new primary clock server, and receives synchronization information sent by the new primary clock server;
  • the step of calculating a phase difference with the new primary clock server according to the synchronization information includes:
  • the phase difference with the new primary clock server is calculated according to the transmission time and the reception time of the synchronization information, and the transmission time and the reception time of the delay request; wherein the reception time of the delay request is equal to the transmission time of the delay response information.
  • the first synchronization information includes: an Announce message, a Sync message, and a Delay_Response message.
  • the second synchronization information includes: an Announce message and a Sync message.
  • a clock link switching apparatus including:
  • a receiving module configured to receive first synchronization information sent by the primary clock server and second synchronization information sent by the backup clock server;
  • the calculation module is configured to calculate, according to the first synchronization information and the second synchronization information, a jitter value difference between the primary clock link and the standby clock link, and a packet loss rate of the standby clock link, where the primary clock link is A clock link between the primary clock servers, and the backup clock link is a clock link with the standby clock server;
  • the first processing module is configured to use the standby clock link as a new primary clock chain when the jitter value difference is within a preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value. road.
  • the clock link switching device further includes:
  • the detecting module is configured to detect a packet loss rate or availability of the primary clock server according to the first synchronization information
  • the second processing module is configured to use the standby clock link as a new primary clock link when detecting that the packet loss rate of the primary clock server is higher than a second preset value or the primary clock server is unavailable.
  • the calculation module includes:
  • a first calculating unit configured to calculate a jitter value of the primary clock link according to a receiving time and a sending time of the first synchronization information in the predetermined time period
  • a second calculating unit configured to calculate a jitter value of the standby clock link according to the receiving time and the sending time of the second synchronization information in the predetermined time period
  • the third calculating unit is configured to compare the jitter value of the standby clock link with the jitter value of the primary clock link to obtain a jitter value difference between the primary clock link and the standby clock link in the predetermined time period.
  • the first computing unit includes:
  • a first calculating subunit configured to calculate, according to a receiving time and a sending time of the plurality of first synchronization information in the predetermined time period, a plurality of transmission times of the primary clock link;
  • a second computing subunit configured to make adjacent transmission times a difference to obtain a plurality of jitter values of the primary clock link
  • the third computing subunit is configured to average the plurality of jitter values to obtain a jitter value of the primary clock link.
  • the first processing module includes:
  • a first processing unit configured to use the standby clock server as a new primary clock server and receive synchronization information sent by the new primary clock server;
  • a second processing unit configured to calculate a phase difference from the new primary clock server based on the synchronization information
  • the third processing unit is configured to adjust the local clock value according to the synchronization information and the phase difference.
  • the second processing unit includes:
  • a sending subunit configured to send a delay request message to the new primary clock server after receiving the synchronization information
  • a receiving subunit configured to receive delayed response information sent by the new primary clock server response delay request message
  • the processing subunit is configured to calculate a phase difference from the new primary clock server according to the transmission time and the reception time of the synchronization information, and the transmission time and the reception time of the delay request; wherein the reception time of the delay request is equal to the delay response The time at which the message was sent.
  • the first synchronization information includes: an Announce message, a Sync message, and a Delay_Response message.
  • the second synchronization information includes: an Announce message and a Sync message.
  • a base station including as described above Clock link switching device.
  • a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the clock link switching method in the foregoing embodiment.
  • the clock performance is good. If the clock server with good clock performance is switched to the clock source, the clock link can be quickly and accurately switched. Link switching time, and the synchronization performance of the link is improved to some extent.
  • FIG. 1 is a schematic flow chart 1 of a clock link switching method of the present invention
  • FIG. 2 is a second schematic flowchart of a clock link switching method according to the present invention.
  • Figure 3 is a flow chart showing the calculation of the clock link jitter value
  • Figure 4 is a flow chart showing the calculation of the phase difference of the clock server
  • Fig. 5 is a block diagram showing the structure of a clock link switching device of the present invention.
  • an embodiment of the present invention provides a clock link switching method, including:
  • Step S101 Receive first synchronization information sent by the primary clock server and second synchronization information sent by the backup clock server.
  • the base station creates different clock links with the primary clock server and the standby clock server, and exchanges synchronization information through the respective clock links.
  • the base station receives the first synchronization information sent by the primary clock server and feeds back the response information, and performs synchronization information interaction with the primary clock server.
  • the base station After receiving the second synchronization information sent by the standby clock server, the base station does not feed back the response information.
  • the unidirectional information transmission is performed with the standby clock server, and the second synchronization information is only used as a reference factor for evaluating the quality of the backup clock server.
  • the first synchronization information carries clock time information of the primary clock server
  • the second synchronization information carries clock time information of the standby clock server.
  • Step S102 Calculate a jitter value difference between the primary clock link and the standby clock link and a packet loss ratio of the standby clock link according to the first synchronization information and the second synchronization information.
  • the primary clock link is a clock link with the primary clock server
  • the standby clock link is a clock link with the standby clock server.
  • the jitter value of the primary clock link can be calculated according to the first synchronization information at the transmission time of the primary clock link, and the packet loss rate of the primary clock link can be calculated according to the received data information of the first synchronization information; similarly, according to the The synchronization information of the secondary clock link can calculate the jitter value of the standby clock link, and the packet loss rate of the standby clock link can be calculated according to the received data information of the second synchronization information.
  • the jitter value difference between the two clock links can be calculated according to the jitter value of the primary clock link and the jitter value of the standby clock link.
  • Step S103 When the jitter value difference is within a preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value, the standby clock link is used as the new primary clock link.
  • the primary clock link When the jitter value of the primary clock link is smaller than the jitter value of the standby clock link, the primary clock link is better than the standby clock link.
  • the current clock link does not switch.
  • the base station uses the primary clock server as the clock source.
  • the jitter value of the primary clock link is greater than the jitter value of the standby clock link, it indicates that the primary clock link is inferior to the standby clock link.
  • the difference between the jitter values of the two clock links in the preset range indicates that the jitter value of the standby clock link is smaller than the jitter value of the primary clock link, and the standby clock link is better than the primary clock link.
  • the threshold is consistent with the preset time and the packet loss rate of the standby clock link is lower than the first preset threshold, it indicates that the standby clock link is more suitable as the clock source of the base station, and the standby clock link needs to be used as the new primary clock.
  • Link that is, replace the clock source of the base station with the standby clock server.
  • the clock performance is good. If the clock server with good clock performance is switched to the clock source, the clock link can be quickly and accurately switched. Link switching time, and the synchronization performance of the link is improved to some extent.
  • the foregoing embodiment 1 describes a method for switching a clock link in a scenario where both the primary clock server and the backup clock server are available. This embodiment will be further described in conjunction with other scenarios.
  • the clock switching method further includes:
  • Step S201 Detecting a packet loss rate or availability of the primary clock server according to the first synchronization information.
  • the first synchronization information carries clock level information that can determine whether the clock server is available. Generally, the clock level is 6 to indicate that the clock of the clock server is available, otherwise it is unavailable.
  • the base station can also calculate the packet loss rate of the primary clock link by collecting the packet data carried in the first synchronization information.
  • Step S202 When it is detected that the packet loss rate of the primary clock server is higher than the second preset value, or the primary clock server is unavailable, the standby clock link is used as the new primary clock link.
  • the standby clock link is directly used as the new primary clock link, that is, the clock source of the base station is replaced with the standby clock server.
  • the packet loss rate of the primary clock link is higher than the second preset value
  • the standby clock link is directly used as the new primary clock link, that is, the clock source of the base station is replaced with the standby clock server.
  • the packet loss rate of the primary clock link exceeds 10%, it can be determined that the link quality is poor and is not suitable for the synchronous link.
  • the standby clock server is used as the new primary clock server.
  • the clock link switching method introduced in the second embodiment is a supplementary solution of the first embodiment, and the two solutions are used together to further improve the accuracy of the clock link switching.
  • the first synchronization information includes: an Announce message, a Sync message, and a Delay response message (Delay_Response message), and the second synchronization information includes an Announce message and a Sync message.
  • step S102 includes the following steps:
  • the jitter value of the primary clock link is calculated according to the reception time and the transmission time of the first synchronization information in the predetermined time period.
  • the primary clock server periodically sends a Sync message to the base station, and the Sync message carries the transmission time information, that is, the transmission time of the first synchronization information.
  • the Sync packet transmission time of the clock link is also obtained by the difference between the reception time and the transmission time. Different transmission times are used to obtain the jitter value of the primary clock link.
  • the jitter value of the standby clock link is calculated according to the receiving time and the sending time of the second synchronization information in the predetermined time period.
  • the standby clock server Similar to the primary clock server, the standby clock server periodically sends a Sync message to the base station, and the Sync message carries the transmission time information, that is, the transmission time of the second synchronization information.
  • the calculation method of the jitter value of the standby clock link is similar to the calculation method of the jitter value of the primary clock link, and therefore will not be described again.
  • the step of calculating the jitter value of the primary clock link according to the receiving time and the sending time of the first synchronization information in the predetermined time period specifically includes:
  • the plurality of transmission times of the master clock link are calculated according to the reception time and the transmission time of the plurality of first synchronization information in the predetermined time period.
  • the time when the primary clock server sends the first Sync message is (100) TM1
  • the time when the base station receives the first Sync message sent by the primary clock server is (102) TS1
  • the primary clock server sends the second.
  • the time of the Sync message is (101) TM2
  • the time when the base station receives the second Sync message sent by the primary clock server is (104) TS2
  • the base station can calculate the transmission time of the primary clock link as (
  • the adjacent transmission time is made worse to obtain multiple jitter values of the primary clock link.
  • the jitter value of the main clock link is (
  • ) (
  • ) 1(ms), this 1 (ms) is the main chain.
  • the jitter value of this time period (Jitter main 1 ), and so on, the Jitter master 2 ,..., Jitter master n is calculated.
  • the average of multiple jitter values is obtained to obtain the jitter value of the primary clock link.
  • the Jitter master 1 , the Jitter master 2 , ..., the Jitter master n are averaged to obtain the jitter value of the master clock link.
  • the base station can calculate the jitter value of the standby link by calculating the jitter value of the primary clock link, Jitter backup 1 , Jitter backup 2 , ..., Jitter backup n , and average it to obtain the jitter of the standby clock link. value.
  • the steps of using the standby clock link as the new primary clock link include:
  • the standby clock server is used as the new primary clock server and receives synchronization information sent by the new primary clock server.
  • the original standby clock server serves as a new primary clock server, and the interaction with the base station is switched to two-way interaction, that is, after receiving the Sync message sent by the original standby clock server, the base station starts sending a delay request to the original standby clock server.
  • Message (Delay_Request message)
  • the time at which the packet is sent is recorded.
  • the standby clock server records the arrival time of the Delay_Request packet, and then sends a Delay_Response message to the base station, carrying the arrival time information of the Delay_Request packet.
  • the phase difference from the new primary clock server is calculated.
  • sending a delay request message to the new primary clock server after receiving the synchronization information, sending a delay request message to the new primary clock server; receiving the delayed response information sent by the new primary clock server in response to the delay request message; and according to the sending time and the receiving time of the synchronization information, And the sending time and the receiving time of the delay request, and calculating the phase difference with the new primary clock server; wherein the receiving time of the delay request is equal to the sending time of the delayed response information.
  • the original backup clock server sends a Sync message at time T1, and the message carries (101) T1 time information, and the base station receives the Sync message at time (106)T2, and the base station is then at (111).
  • the T3 sends a Delay_Request message to the original backup clock server.
  • the original standby clock server receives the Delay_Resquest message at (108)T4, and then sends a Delay_Response message to the base station, where the message carries the T3 time information, so that the base station knows Based on the four times information of T1, T2, T3, and T4, the base station can calculate the phase difference T offset between the base station and the original backup clock server according to the information (labeled as T offset in the figure).
  • T2-T1 T delay +T offset
  • the base station is slowed down by 4 units according to the synchronization information to improve the accuracy of the base station synchronization information.
  • the clock link switching device includes:
  • the receiving module 51 is configured to receive the first synchronization information and the standby information sent by the primary clock server. Second synchronization information sent by the clock server;
  • the calculation module 52 is configured to calculate, according to the first synchronization information and the second synchronization information, a jitter value difference between the primary clock link and the backup clock link, and a packet loss rate of the standby clock link, where the primary clock link is A clock link with the primary clock server, and the standby clock link is a clock link with the standby clock server;
  • the first processing module 53 is configured to use the standby clock link as a new master clock when the jitter value difference is within a preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value. link.
  • the clock link switching device further includes:
  • the detecting module is configured to detect a packet loss rate or availability of the primary clock server according to the first synchronization information
  • the second processing module is configured to use the standby clock link as a new primary clock link when detecting that the packet loss rate of the primary clock server is higher than a second preset value or the primary clock server is unavailable.
  • the calculation module includes:
  • a first calculating unit configured to calculate a jitter value of the primary clock link according to a receiving time and a sending time of the first synchronization information in the predetermined time period
  • a second calculating unit configured to calculate a jitter value of the standby clock link according to the receiving time and the sending time of the second synchronization information in the predetermined time period
  • the third calculating unit is configured to compare the jitter value of the standby clock link with the jitter value of the primary clock link to obtain a jitter value difference between the primary clock link and the standby clock link in the predetermined time period.
  • the first computing unit includes:
  • a first calculating subunit configured to calculate, according to a receiving time and a sending time of the plurality of first synchronization information in the predetermined time period, a plurality of transmission times of the primary clock link;
  • a second computing subunit configured to make adjacent transmission times a difference to obtain a plurality of jitter values of the primary clock link
  • the third computing subunit is configured to average the plurality of jitter values to obtain a jitter value of the primary clock link.
  • the first processing module includes:
  • a first processing unit configured to use the standby clock server as a new primary clock server and receive synchronization information sent by the new primary clock server;
  • a second processing unit configured to calculate a phase difference from the new primary clock server based on the synchronization information
  • the third processing unit is configured to adjust the local clock value according to the synchronization information and the phase difference.
  • the second processing unit includes:
  • a sending subunit configured to send a delay request message to the new primary clock server after receiving the synchronization information
  • a receiving subunit configured to receive delayed response information sent by the new primary clock server response delay request message
  • the processing subunit is configured to calculate a phase difference from the new primary clock server according to the transmission time and the reception time of the synchronization information, and the transmission time and the reception time of the delay request; wherein the reception time of the delay request is equal to the delay response The time at which the message was sent.
  • the first synchronization information includes: an Announce message, a Sync message, and a Delay_Response message.
  • the second synchronization information includes: an Announce message and a Sync message.
  • the device is a device corresponding to the above-mentioned clock link switching method. All the implementation manners in the foregoing method embodiments are applicable to the device embodiment, and the same technical effects can be achieved.
  • a base station comprising the clock link switching device as described above.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • the clock server with good clock performance is switched to the clock source in time, and the clock link can be quickly implemented. Accurate switching saves link switching time and improves link synchronization performance to some extent.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

Disclosed are a method and device for clock link switching and a base station. The method comprises: receiving first synchronization information transmitted by a primary clock server and second synchronization information transmitted by a backup clock server; calculating, on the basis of the first synchronization information and the second synchronization information, the difference in jitter values of a primary clock link and of a backup clock link and a packet loss rate of the backup clock link; and, when the difference in the jitter values remains in a preset range for a preset time and the packet loss rate of the backup clock link is less than a first preset value, making the backup clock link as a new primary clock link. Embodiments of the present invention, by comparing and analyzing clock performances of both the primary clock link and the backup clock link, and selecting in a timely manner the clock server of better clock performance to switch to as a clock source, implement rapid and accurate switching of clock links, save time in link switching, and increase link synchronization performance to a certain extent.

Description

一种时钟链路切换方法、装置及基站Clock link switching method, device and base station 技术领域Technical field
本发明涉及时钟同步及切换领域,尤其涉及一种时钟链路切换方法、装置及基站。The present invention relates to the field of clock synchronization and handover, and in particular, to a clock link switching method, apparatus, and base station.
背景技术Background technique
为解决以太网定时同步能力的不足,计算机和网络业界开发出一种软件方式的网络时间协议(NTP,Network Time Protocol),以提高各网络设备之间的定时同步能力。后续NTP版本的同步准确度可以达到μs级,但是仍然不能满足测量仪器和工业控制所需的准确度。为了解决测量和控制应用的分布网络定时同步的需要,IEEE1588标准诞生。To solve the problem of Ethernet timing synchronization, the computer and network industries have developed a software-based Network Time Protocol (NTP) to improve the timing synchronization between network devices. The synchronization accuracy of subsequent NTP versions can reach μs, but still does not meet the accuracy required for measuring instruments and industrial control. In order to address the need for distributed network timing synchronization for measurement and control applications, the IEEE 1588 standard was born.
IEEE1588协议的全称是“网络测量和控制***的精密时钟同步协议标准”,是通用的提升网络***定时同步能力的规范,使分布式通信网络能够具有严格的定时同步,并且应用于工业自动化***。基本构思是通过硬件和软件将网络设备(客户机)的内时钟与主控机的主时钟实现同步,提供同步建立时间小于10μs的运用,与未执行IEEE1588协议的以太网延迟时间1000μs相比,整个网络的定时同步指标有显著的改善。The full name of the IEEE1588 protocol is "Precision Clock Synchronization Protocol Standard for Network Measurement and Control Systems". It is a general specification for improving the timing synchronization capability of network systems, enabling distributed communication networks to have strict timing synchronization and applied to industrial automation systems. The basic idea is to synchronize the internal clock of the network device (client) with the master clock of the master by hardware and software, and provide the operation with the synchronization setup time less than 10μs, compared with the Ethernet delay time of 1000μs without the IEEE1588 protocol. Significant improvements in timing synchronization metrics across the network.
IEEE 1588v2作为一种主从同步***,在***的同步过程中,主时钟周期性发布精确时间同步协议(PTP,Precision Time Protocol)时间同步协议及时间信息,从时钟端口接收主时钟端口发来的时间戳信息,***据此计算出主从线路时间延迟及主从时间差,并利用该时间差调整本地时间,使从设备时间保持与主设备时间一致的频率与相位。IEEE1588可以同时实现频率同步和时间同步,时间传递的精度保证主要依赖于两个条件计数器频率准确和链路的对称性。IEEE 1588v2 is a master-slave synchronization system. During the synchronization process of the system, the master clock periodically releases the time synchronization protocol (PTP) and time information of the clock, and receives the clock from the clock port. Based on the timestamp information, the system calculates the master-slave line time delay and the master-slave time difference, and uses the time difference to adjust the local time so that the slave device time maintains the frequency and phase consistent with the master time. IEEE1588 can achieve both frequency synchronization and time synchronization. The accuracy guarantee of time transfer mainly depends on the accuracy of the two condition counters and the symmetry of the link.
为节省成本,通讯基站采用1588技术进行时钟同步,由于网络存在丢包、延迟、业务不稳定等情况,为保证时钟信息不间断,一般网络中会 布置多个1588时钟服务器,这样其中一个1588时钟服务器出现异常,基站可以自动切换到另外备用的时钟服务器。To save costs, the communication base station uses 1588 technology for clock synchronization. Due to packet loss, delay, and service instability, the clock information is guaranteed to be uninterrupted. Multiple 1588 clock servers are deployed so that one of the 1588 clock servers is abnormal and the base station can automatically switch to another alternate clock server.
当前我们的通讯基站是通过接收1588时钟服务器发来的时钟等级或者链路丢包率来断定当前同步的1588时钟服务器工作是否正常,如果判断当前同步的1588时钟服务器异常了,基站自动切换到另外一个1588备用时钟服务器。其中,时钟等级是1588时钟服务器发送的宣告报文(Announce报文)中携带的标识。Currently, our communication base station determines whether the currently synchronized 1588 clock server is working properly by receiving the clock level or link loss rate sent by the 1588 clock server. If it is determined that the currently synchronized 1588 clock server is abnormal, the base station automatically switches to another. A 1588 standby clock server. The clock level is the identifier carried in the announcement message (Announce message) sent by the 1588 clock server.
链路丢包率分为主用链路丢包率和备用链路丢包率,主用链路丢包率是按当前同步的1588时钟服务器发送的同步报文(Sync报文)来统计的,备用链路丢包率是按备用的1588时钟服务器发生送的Announce报文来统计的。The link loss rate is divided into the primary link loss rate and the standby link loss rate. The primary link loss rate is calculated according to the synchronization packet (Sync packet) sent by the currently synchronized 1588 clock server. The packet loss rate of the standby link is counted according to the Announce packet sent by the standby 1588 clock server.
仔细分析上述切换过程,发现当前链路切换存在以下问题:需要等待主时钟服务器不可用才能触发切换过程;切换前基站接收备用时钟服务器发来的数据太少,基站的备用链路丢包率不精确不能很好地判断备用时钟服务器的性能,而且基站本身时钟存在漂移,导致同步数据不准确。After careful analysis of the above handover process, it is found that the current link handover has the following problems: it needs to wait for the primary clock server to be unavailable to trigger the handover process; before the handover, the base station receives too little data from the standby clock server, and the standby link loss rate of the base station is not Accurately, the performance of the standby clock server cannot be well judged, and the clock of the base station itself drifts, resulting in inaccurate synchronization data.
发明内容Summary of the invention
本发明实施例提供了一种时钟链路切换方法、装置及基站,解决了相关技术中主备时钟切换被动死板,且同步数据准确率低的问题。The embodiment of the invention provides a method, a device and a base station for switching a clock link, which solves the problem that the active and standby clocks are switched passively and the accuracy of the synchronous data is low in the related art.
依据本发明实施例的一个方面,提供了一种时钟链路切换方法,包括:According to an aspect of the embodiments of the present invention, a clock link switching method is provided, including:
接收主用时钟服务器发送的第一同步信息以及备用时钟服务器发送的第二同步信息;Receiving first synchronization information sent by the primary clock server and second synchronization information sent by the backup clock server;
根据第一同步信息和第二同步信息,计算主时钟链路与备时钟链路之间的抖动值差以及备时钟链路的丢包率,其中,主时钟链路为与主用时钟服务器之间的时钟链路,备时钟链路为与备用时钟服务器之间的时钟链路;Calculating, according to the first synchronization information and the second synchronization information, a jitter value difference between the primary clock link and the backup clock link, and a packet loss rate of the standby clock link, where the primary clock link is the primary clock server The clock link between the standby clock link and the backup clock server;
当抖动值差在预设范围内持续预设时间,且备时钟链路的丢包率低于第一预设值时,将备时钟链路作为新的主时钟链路。 When the jitter value difference is within the preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value, the standby clock link is used as the new primary clock link.
其中,在接收主用时钟服务器发送的第一同步信息以及备用时钟服务器发送的第二同步信息之后,还包括:After receiving the first synchronization information sent by the primary clock server and the second synchronization information sent by the backup clock server, the method further includes:
根据第一同步信息,检测主用时钟服务器的丢包率或可用性;Detecting a packet loss rate or availability of the primary clock server according to the first synchronization information;
当检测到主用时钟服务器的丢包率高于第二预设值,或主用时钟服务器不可用时,将备时钟链路作为新的主时钟链路。When it is detected that the packet loss rate of the primary clock server is higher than the second preset value, or the primary clock server is unavailable, the standby clock link is used as the new primary clock link.
其中,根据第一同步信息和第二同步信息,计算主时钟链路与备时钟链路之间的抖动值差的步骤包括:The step of calculating a jitter value difference between the primary clock link and the standby clock link according to the first synchronization information and the second synchronization information includes:
根据预定时间段内的第一同步信息的接收时间和发送时间,计算主时钟链路的抖动值;Calculating a jitter value of the primary clock link according to a receiving time and a sending time of the first synchronization information in the predetermined time period;
根据预定时间段内第二同步信息的接收时间和发送时间,计算备时钟链路的抖动值;Calculating a jitter value of the standby clock link according to the receiving time and the sending time of the second synchronization information in the predetermined time period;
将备时钟链路的抖动值与主时钟链路的抖动值作差,得到预定时间段内主时钟链路与备时钟链路之间的抖动值差。The jitter value of the standby clock link is compared with the jitter value of the primary clock link to obtain a jitter value difference between the primary clock link and the standby clock link in a predetermined time period.
其中,根据预定时间段内第一同步信息的接收时间和发送时间,计算主时钟链路的抖动值的步骤包括:The step of calculating the jitter value of the primary clock link according to the receiving time and the sending time of the first synchronization information in the predetermined time period includes:
根据预定时间段内多个第一同步信息的接收时间和发送时间,计算得到主时钟链路的多个传输时间;Calculating a plurality of transmission times of the primary clock link according to the receiving time and the sending time of the plurality of first synchronization information in the predetermined time period;
将相邻的传输时间作差,得到主时钟链路的多个抖动值;Comparing adjacent transmission times to obtain multiple jitter values of the primary clock link;
对多个抖动值取平均,得到主时钟链路的抖动值。The average of multiple jitter values is obtained to obtain the jitter value of the primary clock link.
其中,将备时钟链路作为新的主时钟链路的步骤包括:The steps of using the standby clock link as the new primary clock link include:
将备用时钟服务器作为新的主用时钟服务器,并接收新的主用时钟服务器发送的同步信息;The standby clock server is used as a new primary clock server, and receives synchronization information sent by the new primary clock server;
根据同步信息,计算与新的主用时钟服务器之间的相位差;Calculating a phase difference from the new primary clock server based on the synchronization information;
根据同步信息和相位差,调整本地时钟值。Adjust the local clock value based on the synchronization information and phase difference.
其中,根据同步信息,计算与新的主用时钟服务器之间的相位差的步骤包括:The step of calculating a phase difference with the new primary clock server according to the synchronization information includes:
在接收到同步信息后,向新的主用时钟服务器发送一延迟请求信息; After receiving the synchronization information, sending a delay request message to the new primary clock server;
接收新的主用时钟服务器响应延迟请求信息发送的延迟响应信息;Receiving delayed response information sent by the new primary clock server in response to the delay request message;
根据同步信息的发送时间和接收时间,以及延迟请求的发送时间和接收时间,计算与新的主用时钟服务器之间的相位差;其中,延迟请求的接收时间等于延迟响应信息的发送时间。The phase difference with the new primary clock server is calculated according to the transmission time and the reception time of the synchronization information, and the transmission time and the reception time of the delay request; wherein the reception time of the delay request is equal to the transmission time of the delay response information.
其中,第一同步信息包括:Announce报文、Sync报文、以及Delay_Response报文。The first synchronization information includes: an Announce message, a Sync message, and a Delay_Response message.
其中,第二同步信息包括:Announce报文和Sync报文。The second synchronization information includes: an Announce message and a Sync message.
依据本发明实施例的另一个方面,还提供了一种时钟链路切换装置,包括:According to another aspect of the embodiments of the present invention, a clock link switching apparatus is further provided, including:
接收模块,设置为接收主用时钟服务器发送的第一同步信息以及备用时钟服务器发送的第二同步信息;a receiving module, configured to receive first synchronization information sent by the primary clock server and second synchronization information sent by the backup clock server;
计算模块,设置为根据第一同步信息和第二同步信息,计算主时钟链路与备时钟链路之间的抖动值差以及备时钟链路的丢包率,其中,主时钟链路为与主用时钟服务器之间的时钟链路,备时钟链路为与备用时钟服务器之间的时钟链路;The calculation module is configured to calculate, according to the first synchronization information and the second synchronization information, a jitter value difference between the primary clock link and the standby clock link, and a packet loss rate of the standby clock link, where the primary clock link is A clock link between the primary clock servers, and the backup clock link is a clock link with the standby clock server;
第一处理模块,设置为当抖动值差在预设范围内持续预设时间,且备时钟链路的丢包率低于第一预设值时,将备时钟链路作为新的主时钟链路。The first processing module is configured to use the standby clock link as a new primary clock chain when the jitter value difference is within a preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value. road.
其中,该时钟链路切换装置还包括:The clock link switching device further includes:
检测模块,设置为根据第一同步信息,检测主用时钟服务器的丢包率或可用性;The detecting module is configured to detect a packet loss rate or availability of the primary clock server according to the first synchronization information;
第二处理模块,设置为当检测到主用时钟服务器的丢包率高于第二预设值,或主用时钟服务器不可用时,将备时钟链路作为新的主时钟链路。The second processing module is configured to use the standby clock link as a new primary clock link when detecting that the packet loss rate of the primary clock server is higher than a second preset value or the primary clock server is unavailable.
其中,计算模块包括:The calculation module includes:
第一计算单元,设置为根据预定时间段内的第一同步信息的接收时间和发送时间,计算主时钟链路的抖动值;a first calculating unit, configured to calculate a jitter value of the primary clock link according to a receiving time and a sending time of the first synchronization information in the predetermined time period;
第二计算单元,设置为根据预定时间段内第二同步信息的接收时间和发送时间,计算备时钟链路的抖动值; a second calculating unit, configured to calculate a jitter value of the standby clock link according to the receiving time and the sending time of the second synchronization information in the predetermined time period;
第三计算单元,设置为将备时钟链路的抖动值与主时钟链路的抖动值作差,得到预定时间段内主时钟链路与备时钟链路之间的抖动值差。The third calculating unit is configured to compare the jitter value of the standby clock link with the jitter value of the primary clock link to obtain a jitter value difference between the primary clock link and the standby clock link in the predetermined time period.
其中,第一计算单元包括:The first computing unit includes:
第一计算子单元,设置为根据预定时间段内多个第一同步信息的接收时间和发送时间,计算得到主时钟链路的多个传输时间;a first calculating subunit, configured to calculate, according to a receiving time and a sending time of the plurality of first synchronization information in the predetermined time period, a plurality of transmission times of the primary clock link;
第二计算子单元,设置为将相邻的传输时间作差,得到主时钟链路的多个抖动值;a second computing subunit, configured to make adjacent transmission times a difference to obtain a plurality of jitter values of the primary clock link;
第三计算子单元,设置为对多个抖动值取平均,得到主时钟链路的抖动值。The third computing subunit is configured to average the plurality of jitter values to obtain a jitter value of the primary clock link.
其中,第一处理模块包括:The first processing module includes:
第一处理单元,设置为将备用时钟服务器作为新的主用时钟服务器,并接收新的主用时钟服务器发送的同步信息;a first processing unit configured to use the standby clock server as a new primary clock server and receive synchronization information sent by the new primary clock server;
第二处理单元,设置为根据同步信息,计算与新的主用时钟服务器之间的相位差;a second processing unit configured to calculate a phase difference from the new primary clock server based on the synchronization information;
第三处理单元,设置为根据同步信息和相位差,调整本地时钟值。The third processing unit is configured to adjust the local clock value according to the synchronization information and the phase difference.
其中,第二处理单元包括:The second processing unit includes:
发送子单元,设置为在接收到同步信息后,向新的主用时钟服务器发送一延迟请求信息;a sending subunit, configured to send a delay request message to the new primary clock server after receiving the synchronization information;
接收子单元,设置为接收新的主用时钟服务器响应延迟请求信息发送的延迟响应信息;a receiving subunit, configured to receive delayed response information sent by the new primary clock server response delay request message;
处理子单元,设置为根据同步信息的发送时间和接收时间,以及延迟请求的发送时间和接收时间,计算与新的主用时钟服务器之间的相位差;其中,延迟请求的接收时间等于延迟响应信息的发送时间。The processing subunit is configured to calculate a phase difference from the new primary clock server according to the transmission time and the reception time of the synchronization information, and the transmission time and the reception time of the delay request; wherein the reception time of the delay request is equal to the delay response The time at which the message was sent.
其中,第一同步信息包括:Announce报文、Sync报文、以及Delay_Response报文。The first synchronization information includes: an Announce message, a Sync message, and a Delay_Response message.
其中,第二同步信息包括:Announce报文和Sync报文。The second synchronization information includes: an Announce message and a Sync message.
依据本发明实施例的再一个方面,还提供了一种基站,包括如上所述 的时钟链路切换装置。According to still another aspect of the embodiments of the present invention, there is also provided a base station, including as described above Clock link switching device.
在本发明实施例中,还提供了一种计算机存储介质,该计算机存储介质可以存储有执行指令,该执行指令用于执行上述实施例中的时钟链路切换方法。In the embodiment of the present invention, a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the clock link switching method in the foregoing embodiment.
本发明实施例的实施例的有益效果是:The beneficial effects of the embodiments of the embodiments of the present invention are:
通过比较分析主时钟链路和备时钟链路两条链路的是时钟性能优劣,及时选择时钟性能好的时钟服务器切换为时钟源,可实现时钟链路的快速而准确地切换,节省了链路切换时间,且在一定程度上提高了链路的同步性能。By comparing and analyzing the two clocks of the primary clock link and the backup clock link, the clock performance is good. If the clock server with good clock performance is switched to the clock source, the clock link can be quickly and accurately switched. Link switching time, and the synchronization performance of the link is improved to some extent.
附图说明DRAWINGS
图1表示本发明的时钟链路切换方法的流程示意图一;1 is a schematic flow chart 1 of a clock link switching method of the present invention;
图2表示本发明的时钟链路切换方法的流程示意图二;2 is a second schematic flowchart of a clock link switching method according to the present invention;
图3表示计算时钟链路抖动值的流程示意图;Figure 3 is a flow chart showing the calculation of the clock link jitter value;
图4表示计算时钟服务器相位差的流程示意图;Figure 4 is a flow chart showing the calculation of the phase difference of the clock server;
图5表示本发明的时钟链路切换装置的结构示意图。Fig. 5 is a block diagram showing the structure of a clock link switching device of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本发明的示例性实施例。虽然附图中显示了本发明的示例性实施例,然而应当理解,可以以各种形式实现本发明而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本发明,并且能够将本发明的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While the invention has been shown and described with reference to the embodiments Rather, these embodiments are provided so that this invention may be more fully understood and the scope of the invention can be fully conveyed by those skilled in the art.
实施例一 Embodiment 1
如图1所示,本发明的实施例提供了一种时钟链路切换方法,包括:As shown in FIG. 1 , an embodiment of the present invention provides a clock link switching method, including:
步骤S101:接收主用时钟服务器发送的第一同步信息以及备用时钟服务器发送的第二同步信息。 Step S101: Receive first synchronization information sent by the primary clock server and second synchronization information sent by the backup clock server.
基站分别与主用时钟服务器和备用时钟服务器创建有不同的时钟链路,并通过各自的时钟链路交互同步信息。其中,基站接收主用时钟服务器发送的第一同步信息并反馈响应信息,与主用时钟服务器进行同步信息交互;而基站在接收到备用时钟服务器发送的第二同步信息后,并不反馈响应信息,与备用时钟服务器为单向信息传输,第二同步信息仅作为评估备用时钟服务器质量优劣的参考因素。其中,第一同步信息携带有主用时钟服务器的时钟时间信息,第二同步信息携带有备用时钟服务器的时钟时间信息。The base station creates different clock links with the primary clock server and the standby clock server, and exchanges synchronization information through the respective clock links. The base station receives the first synchronization information sent by the primary clock server and feeds back the response information, and performs synchronization information interaction with the primary clock server. After receiving the second synchronization information sent by the standby clock server, the base station does not feed back the response information. The unidirectional information transmission is performed with the standby clock server, and the second synchronization information is only used as a reference factor for evaluating the quality of the backup clock server. The first synchronization information carries clock time information of the primary clock server, and the second synchronization information carries clock time information of the standby clock server.
步骤S102:根据第一同步信息和第二同步信息,计算主时钟链路与备时钟链路之间的抖动值差以及备时钟链路的丢包率。Step S102: Calculate a jitter value difference between the primary clock link and the standby clock link and a packet loss ratio of the standby clock link according to the first synchronization information and the second synchronization information.
其中,主时钟链路为与主用时钟服务器之间的时钟链路,备时钟链路为与备用时钟服务器之间的时钟链路。根据第一同步信息在主时钟链路的传输时间可计算主时钟链路的抖动值,根据接收到的第一同步信息的数据信息可计算主时钟链路的丢包率;同理,根据第二同步信息在主时钟链路的传输时间可计算备时钟链路的抖动值,根据接收到的第二同步信息的数据信息可计算备时钟链路的丢包率。根据主时钟链路的抖动值和备时钟链路的抖动值可计算得到两条时钟链路之间的抖动值差。The primary clock link is a clock link with the primary clock server, and the standby clock link is a clock link with the standby clock server. The jitter value of the primary clock link can be calculated according to the first synchronization information at the transmission time of the primary clock link, and the packet loss rate of the primary clock link can be calculated according to the received data information of the first synchronization information; similarly, according to the The synchronization information of the secondary clock link can calculate the jitter value of the standby clock link, and the packet loss rate of the standby clock link can be calculated according to the received data information of the second synchronization information. The jitter value difference between the two clock links can be calculated according to the jitter value of the primary clock link and the jitter value of the standby clock link.
步骤S103:当抖动值差在预设范围内持续预设时间,且备时钟链路的丢包率低于第一预设值时,将备时钟链路作为新的主时钟链路。Step S103: When the jitter value difference is within a preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value, the standby clock link is used as the new primary clock link.
当主时钟链路的抖动值小于备时钟链路的抖动值时,表明主时钟链路优于备时钟链路,当前时钟链路不发生切换,基站采用主用时钟服务器作为时钟源。当主时钟链路的抖动值大于备时钟链路的抖动值时,表明主时钟链路劣于备时钟链路。两条时钟链路的抖动值差在预设范围内表示备时钟链路的抖动值小于主时钟链路的抖动值的差值达到门限值,当备时钟链路优于主时钟链路达到门限值持续预设时间,且备时钟链路的丢包率低于第一预设阈值时,表明备时钟链路更适合作为基站的时钟源,需要将备时钟链路作为新的主时钟链路,即将基站的时钟源更换为备用时钟服务器。 When the jitter value of the primary clock link is smaller than the jitter value of the standby clock link, the primary clock link is better than the standby clock link. The current clock link does not switch. The base station uses the primary clock server as the clock source. When the jitter value of the primary clock link is greater than the jitter value of the standby clock link, it indicates that the primary clock link is inferior to the standby clock link. The difference between the jitter values of the two clock links in the preset range indicates that the jitter value of the standby clock link is smaller than the jitter value of the primary clock link, and the standby clock link is better than the primary clock link. If the threshold is consistent with the preset time and the packet loss rate of the standby clock link is lower than the first preset threshold, it indicates that the standby clock link is more suitable as the clock source of the base station, and the standby clock link needs to be used as the new primary clock. Link, that is, replace the clock source of the base station with the standby clock server.
通过比较分析主时钟链路和备时钟链路两条链路的是时钟性能优劣,及时选择时钟性能好的时钟服务器切换为时钟源,可实现时钟链路的快速而准确地切换,节省了链路切换时间,且在一定程度上提高了链路的同步性能。By comparing and analyzing the two clocks of the primary clock link and the backup clock link, the clock performance is good. If the clock server with good clock performance is switched to the clock source, the clock link can be quickly and accurately switched. Link switching time, and the synchronization performance of the link is improved to some extent.
实施例二Embodiment 2
以上实施例一介绍了在主用时钟服务器和备用时钟服务器均可用的场景下的时钟链路切换方法,下面本实施例将结合其他场景对其进一步说明。The foregoing embodiment 1 describes a method for switching a clock link in a scenario where both the primary clock server and the backup clock server are available. This embodiment will be further described in conjunction with other scenarios.
其中,如图2所示,在步骤S101之后,该时钟切换方法还包括:As shown in FIG. 2, after the step S101, the clock switching method further includes:
步骤S201:根据第一同步信息,检测主用时钟服务器的丢包率或可用性。Step S201: Detecting a packet loss rate or availability of the primary clock server according to the first synchronization information.
其中,第一同步信息中携带有可判定时钟服务器是否可用的时钟等级信息,一般时钟等级为6代表时钟服务器的时钟可用,否则为不可用。另外,基站还可通过统计第一同步信息中携带的报文数据来计算主时钟链路的丢包率。The first synchronization information carries clock level information that can determine whether the clock server is available. Generally, the clock level is 6 to indicate that the clock of the clock server is available, otherwise it is unavailable. In addition, the base station can also calculate the packet loss rate of the primary clock link by collecting the packet data carried in the first synchronization information.
步骤S202:当检测到主用时钟服务器的丢包率高于第二预设值,或主用时钟服务器不可用时,将备时钟链路作为新的主时钟链路。Step S202: When it is detected that the packet loss rate of the primary clock server is higher than the second preset value, or the primary clock server is unavailable, the standby clock link is used as the new primary clock link.
当主用时钟服务器不可用时直接将备时钟链路作为新的主时钟链路,即将基站的时钟源更换为备用时钟服务器。或者,当主时钟链路的丢包率高于第二预设值时,直接将备时钟链路作为新的主时钟链路,即将基站的时钟源更换为备用时钟服务器。通常情况下,当主时钟链路的丢包率超过10%时,可判定链路质量很差,不适合用于同步链路,这时,将备用时钟服务器作为新的主用时钟服务器。值得指出的是,本实施例二介绍的时钟链路切换方法作为实施例一的补充方案,两种方案配合使用,可进一步提高时钟链路切换的准确率。When the primary clock server is unavailable, the standby clock link is directly used as the new primary clock link, that is, the clock source of the base station is replaced with the standby clock server. Or, when the packet loss rate of the primary clock link is higher than the second preset value, the standby clock link is directly used as the new primary clock link, that is, the clock source of the base station is replaced with the standby clock server. Generally, when the packet loss rate of the primary clock link exceeds 10%, it can be determined that the link quality is poor and is not suitable for the synchronous link. In this case, the standby clock server is used as the new primary clock server. It should be noted that the clock link switching method introduced in the second embodiment is a supplementary solution of the first embodiment, and the two solutions are used together to further improve the accuracy of the clock link switching.
实施例三Embodiment 3
以上实施例一和实施例二分别介绍了不同场景下时钟链路的切换方 法,下面将结合附图对上述切换方法作进一步地解释说明。The switch modes of the clock link in different scenarios are described in the first embodiment and the second embodiment. The above switching method will be further explained below with reference to the accompanying drawings.
其中第一同步信息包括:Announce报文、Sync报文、以及延迟应答报文(Delay_Response报文),第二同步信息包括:Announce报文和Sync报文。The first synchronization information includes: an Announce message, a Sync message, and a Delay response message (Delay_Response message), and the second synchronization information includes an Announce message and a Sync message.
具体地,步骤S102包括以下步骤:Specifically, step S102 includes the following steps:
根据预定时间段内的第一同步信息的接收时间和发送时间,计算主时钟链路的抖动值。The jitter value of the primary clock link is calculated according to the reception time and the transmission time of the first synchronization information in the predetermined time period.
如图3所示,主用时钟服务器周期性地发送Sync报文给基站,Sync报文中携带了发送时刻信息,即第一同步信息的发送时间。通过接收时间与发送时间的差值,也得到时钟链路的Sync报文传输时间,不同的传输时间作差,可得到主时钟链路的抖动值。As shown in FIG. 3, the primary clock server periodically sends a Sync message to the base station, and the Sync message carries the transmission time information, that is, the transmission time of the first synchronization information. The Sync packet transmission time of the clock link is also obtained by the difference between the reception time and the transmission time. Different transmission times are used to obtain the jitter value of the primary clock link.
根据预定时间段内第二同步信息的接收时间和发送时间,计算备时钟链路的抖动值。The jitter value of the standby clock link is calculated according to the receiving time and the sending time of the second synchronization information in the predetermined time period.
与主用时钟服务器相似,备用时钟服务器周期性地发送Sync报文给基站,Sync报文中携带了发送时刻信息,即第二同步信息的发送时间。备时钟链路的抖动值的计算方法与主时钟链路的抖动值计算方法相似,故不再赘述。Similar to the primary clock server, the standby clock server periodically sends a Sync message to the base station, and the Sync message carries the transmission time information, that is, the transmission time of the second synchronization information. The calculation method of the jitter value of the standby clock link is similar to the calculation method of the jitter value of the primary clock link, and therefore will not be described again.
将备时钟链路的抖动值与主时钟链路的抖动值作差,得到预定时间段内主时钟链路与备时钟链路之间的抖动值差。即,抖动值差为Deltajitter=Jitter-JitterThe jitter value of the standby clock link is compared with the jitter value of the primary clock link to obtain a jitter value difference between the primary clock link and the standby clock link in a predetermined time period. That is, the jitter value difference is Delta jitter = Jitter standby - Jitter master .
或者,将主时钟链路的抖动值与备时钟链路的抖动值作差,得到预定时间段内主时钟链路与备时钟链路之间的抖动值差。即,抖动值差为Deltajitter=Jitter-JitterAlternatively, the jitter value of the primary clock link is compared with the jitter value of the standby clock link to obtain a jitter value difference between the primary clock link and the standby clock link in the predetermined time period. That is, the jitter value difference Delta jitter = Jitter -Jitter master device.
其中,根据预定时间段内第一同步信息的接收时间和发送时间,计算主时钟链路的抖动值的步骤具体包括:The step of calculating the jitter value of the primary clock link according to the receiving time and the sending time of the first synchronization information in the predetermined time period specifically includes:
根据预定时间段内多个第一同步信息的接收时间和发送时间,计算得到主时钟链路的多个传输时间。 The plurality of transmission times of the master clock link are calculated according to the reception time and the transmission time of the plurality of first synchronization information in the predetermined time period.
假设主用时钟服务器发送第一个Sync报文的时刻为(100)TM1,基站收到主用时钟服务器发送的第一个Sync报文的时刻为(102)TS1,主用时钟服务器发送第二个Sync报文的时刻为(101)TM2,基站收到主用时钟服务器发送的第二个Sync报文的时刻为(104)TS2,基站可以计算出主时钟链路的传输时间为(|TS2-TM2|)和(|TS1-TM1|)。Assume that the time when the primary clock server sends the first Sync message is (100) TM1, the time when the base station receives the first Sync message sent by the primary clock server is (102) TS1, and the primary clock server sends the second. The time of the Sync message is (101) TM2, and the time when the base station receives the second Sync message sent by the primary clock server is (104) TS2, and the base station can calculate the transmission time of the primary clock link as (|TS2). -TM2|) and (|TS1-TM1|).
将相邻的传输时间作差,得到主时钟链路的多个抖动值。The adjacent transmission time is made worse to obtain multiple jitter values of the primary clock link.
主时钟链路的抖动值为(|TS2-TM2|-|TS1-TM1|)=(|104-101|-|102-100|)=1(ms),这个1(ms)为主用链路这个时间段的抖动值(Jitter主1),这样以此类推计算出Jitter主2,…,Jitter主nThe jitter value of the main clock link is (|TS2-TM2|-|TS1-TM1|)=(|104-101|-|102-100|)=1(ms), this 1 (ms) is the main chain. The jitter value of this time period (Jitter main 1 ), and so on, the Jitter master 2 ,..., Jitter master n is calculated.
对多个抖动值取平均,得到主时钟链路的抖动值。The average of multiple jitter values is obtained to obtain the jitter value of the primary clock link.
即对Jitter主1,Jitter主2,…,Jitter主n取平均,得到主时钟链路的抖动值。同理,基站可采用计算主时钟链路抖动值的方式计算出备用链路的抖动值Jitter备1,Jitter备2,…,Jitter备n,并对其取平均,得到备时钟链路的抖动值。That is, the Jitter master 1 , the Jitter master 2 , ..., the Jitter master n are averaged to obtain the jitter value of the master clock link. Similarly, the base station can calculate the jitter value of the standby link by calculating the jitter value of the primary clock link, Jitter backup 1 , Jitter backup 2 , ..., Jitter backup n , and average it to obtain the jitter of the standby clock link. value.
当主用时钟服务器不可用,或主时钟链路丢包率过高,或备时钟链路传输质量优于主时钟链路传输质量且达到切换条件时,将备时钟链路作为新的主时钟链路。假设阀值Jitter临界=-100ns,若当前主备时钟链路的抖动值差Deltajitter小于该阈值,且这种情况持续超过96s(时钟防抖时间Time防抖),而且备用时钟服务器可用且备时钟链路的丢包率在门限10%以内,则判定达到主备时钟链路的切换条件,需要将备时钟链路作为新的主时钟链路。When the primary clock server is unavailable, or the primary clock link loss rate is too high, or the backup clock link transmission quality is better than the primary clock link transmission quality and the switching condition is reached, the standby clock link is used as the new primary clock chain. road. Jitter is assumed that the critical threshold = -100ns, if the current value of the jitter clock standby link Delta jitter difference is less than the threshold value, and this situation continues for more than 96S (debounce time Time clock stabilization), and the standby clock and standby server is available If the packet loss rate of the clock link is within 10% of the threshold, the switch condition of the active/standby clock link is determined. The standby clock link needs to be the new primary clock link.
其中,将备时钟链路作为新的主时钟链路的步骤包括:The steps of using the standby clock link as the new primary clock link include:
将备用时钟服务器作为新的主用时钟服务器,并接收新的主用时钟服务器发送的同步信息。The standby clock server is used as the new primary clock server and receives synchronization information sent by the new primary clock server.
这时,原备用时钟服务器作为新的主用时钟服务器,与基站之间的交互切换为双向交互,即基站在接收到原备用时钟服务器发送的Sync报文后,开始向原备用时钟服务器发送延迟请求报文(Delay_Request报文), 记录发送报文的时间,备用时钟服务器记录Delay_Request报文的到达时间,接着发送Delay_Response报文给基站,携带着Delay_Request报文的到达时间信息。At this time, the original standby clock server serves as a new primary clock server, and the interaction with the base station is switched to two-way interaction, that is, after receiving the Sync message sent by the original standby clock server, the base station starts sending a delay request to the original standby clock server. Message (Delay_Request message), The time at which the packet is sent is recorded. The standby clock server records the arrival time of the Delay_Request packet, and then sends a Delay_Response message to the base station, carrying the arrival time information of the Delay_Request packet.
根据同步信息,计算与新的主用时钟服务器之间的相位差。Based on the synchronization information, the phase difference from the new primary clock server is calculated.
具体包括:在接收到同步信息后,向新的主用时钟服务器发送一延迟请求信息;接收新的主用时钟服务器响应延迟请求信息发送的延迟响应信息;根据同步信息的发送时间和接收时间,以及延迟请求的发送时间和接收时间,计算与新的主用时钟服务器之间的相位差;其中,延迟请求的接收时间等于延迟响应信息的发送时间。Specifically, after receiving the synchronization information, sending a delay request message to the new primary clock server; receiving the delayed response information sent by the new primary clock server in response to the delay request message; and according to the sending time and the receiving time of the synchronization information, And the sending time and the receiving time of the delay request, and calculating the phase difference with the new primary clock server; wherein the receiving time of the delay request is equal to the sending time of the delayed response information.
如图4所示,假设原备用时钟服务器在T1时刻发送Sync报文,该报文中携带(101)T1时刻信息,基站在(106)T2时刻收到该Sync报文,基站接着在(111)T3时刻发送Delay_Request报文给原备用时钟服务器,原备用时钟服务器在(108)T4时刻接收到Delay_Resquest报文,之后发送Delay_Response报文给基站,该报文中携带T3时刻信息,这样基站知道了T1,T2,T3,T4这四个时刻信息,基站可以根据该信息算出基站与原备用时钟服务器之间的相位差Toffset备(图中标为Toffset)。前提基站与备用时钟服务器的上下行链路时延(Tdelay)一致,则T2-T1=Tdelay+Toffset,T4-T3=Tdelay-Toffset,这样Toffset=[(T2-T1)-(T4-T3)]/2,因此Toffset=[(106-101)-(108-111)]/2=4。As shown in FIG. 4, it is assumed that the original backup clock server sends a Sync message at time T1, and the message carries (101) T1 time information, and the base station receives the Sync message at time (106)T2, and the base station is then at (111). The T3 sends a Delay_Request message to the original backup clock server. The original standby clock server receives the Delay_Resquest message at (108)T4, and then sends a Delay_Response message to the base station, where the message carries the T3 time information, so that the base station knows Based on the four times information of T1, T2, T3, and T4, the base station can calculate the phase difference T offset between the base station and the original backup clock server according to the information (labeled as T offset in the figure). The premise base station and the standby clock server have the same uplink and downlink delay (T delay ), then T2-T1=T delay +T offset , T4-T3=T delay -T offset , such that T offset =[(T2-T1) -(T4-T3)]/2, so T offset = [(106-101)-(108-111)]/2=4.
根据同步信息和相位差,调整本地时钟值。Adjust the local clock value based on the synchronization information and phase difference.
根据以上计算得到的相位差4,将基站按照同步信息往后调慢4个单位,以提高基站同步信息的准确性。According to the phase difference 4 calculated above, the base station is slowed down by 4 units according to the synchronization information to improve the accuracy of the base station synchronization information.
实施例四Embodiment 4
以上实施例介绍了本发明的时钟链路切换方法,下面本实施例将结合附图对其对应的时钟链路切换装置做进一步介绍。The above embodiment describes the clock link switching method of the present invention. The following embodiment will further introduce the corresponding clock link switching device with reference to the accompanying drawings.
具体地,如图5所示,该时钟链路切换装置包括:Specifically, as shown in FIG. 5, the clock link switching device includes:
接收模块51,设置为接收主用时钟服务器发送的第一同步信息以及备 用时钟服务器发送的第二同步信息;The receiving module 51 is configured to receive the first synchronization information and the standby information sent by the primary clock server. Second synchronization information sent by the clock server;
计算模块52,设置为根据第一同步信息和第二同步信息,计算主时钟链路与备时钟链路之间的抖动值差以及备时钟链路的丢包率,其中,主时钟链路为与主用时钟服务器之间的时钟链路,备时钟链路为与备用时钟服务器之间的时钟链路;The calculation module 52 is configured to calculate, according to the first synchronization information and the second synchronization information, a jitter value difference between the primary clock link and the backup clock link, and a packet loss rate of the standby clock link, where the primary clock link is A clock link with the primary clock server, and the standby clock link is a clock link with the standby clock server;
第一处理模块53,设置为当抖动值差在预设范围内持续预设时间,且备时钟链路的丢包率低于第一预设值时,将备时钟链路作为新的主时钟链路。The first processing module 53 is configured to use the standby clock link as a new master clock when the jitter value difference is within a preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value. link.
其中,该时钟链路切换装置还包括:The clock link switching device further includes:
检测模块,设置为根据第一同步信息,检测主用时钟服务器的丢包率或可用性;The detecting module is configured to detect a packet loss rate or availability of the primary clock server according to the first synchronization information;
第二处理模块,设置为当检测到主用时钟服务器的丢包率高于第二预设值,或主用时钟服务器不可用时,将备时钟链路作为新的主时钟链路。The second processing module is configured to use the standby clock link as a new primary clock link when detecting that the packet loss rate of the primary clock server is higher than a second preset value or the primary clock server is unavailable.
其中,计算模块包括:The calculation module includes:
第一计算单元,设置为根据预定时间段内的第一同步信息的接收时间和发送时间,计算主时钟链路的抖动值;a first calculating unit, configured to calculate a jitter value of the primary clock link according to a receiving time and a sending time of the first synchronization information in the predetermined time period;
第二计算单元,设置为根据预定时间段内第二同步信息的接收时间和发送时间,计算备时钟链路的抖动值;a second calculating unit, configured to calculate a jitter value of the standby clock link according to the receiving time and the sending time of the second synchronization information in the predetermined time period;
第三计算单元,设置为将备时钟链路的抖动值与主时钟链路的抖动值作差,得到预定时间段内主时钟链路与备时钟链路之间的抖动值差。The third calculating unit is configured to compare the jitter value of the standby clock link with the jitter value of the primary clock link to obtain a jitter value difference between the primary clock link and the standby clock link in the predetermined time period.
其中,第一计算单元包括:The first computing unit includes:
第一计算子单元,设置为根据预定时间段内多个第一同步信息的接收时间和发送时间,计算得到主时钟链路的多个传输时间;a first calculating subunit, configured to calculate, according to a receiving time and a sending time of the plurality of first synchronization information in the predetermined time period, a plurality of transmission times of the primary clock link;
第二计算子单元,设置为将相邻的传输时间作差,得到主时钟链路的多个抖动值;a second computing subunit, configured to make adjacent transmission times a difference to obtain a plurality of jitter values of the primary clock link;
第三计算子单元,设置为对多个抖动值取平均,得到主时钟链路的抖动值。 The third computing subunit is configured to average the plurality of jitter values to obtain a jitter value of the primary clock link.
其中,第一处理模块包括:The first processing module includes:
第一处理单元,设置为将备用时钟服务器作为新的主用时钟服务器,并接收新的主用时钟服务器发送的同步信息;a first processing unit configured to use the standby clock server as a new primary clock server and receive synchronization information sent by the new primary clock server;
第二处理单元,设置为根据同步信息,计算与新的主用时钟服务器之间的相位差;a second processing unit configured to calculate a phase difference from the new primary clock server based on the synchronization information;
第三处理单元,设置为根据同步信息和相位差,调整本地时钟值。The third processing unit is configured to adjust the local clock value according to the synchronization information and the phase difference.
其中,第二处理单元包括:The second processing unit includes:
发送子单元,设置为在接收到同步信息后,向新的主用时钟服务器发送一延迟请求信息;a sending subunit, configured to send a delay request message to the new primary clock server after receiving the synchronization information;
接收子单元,设置为接收新的主用时钟服务器响应延迟请求信息发送的延迟响应信息;a receiving subunit, configured to receive delayed response information sent by the new primary clock server response delay request message;
处理子单元,设置为根据同步信息的发送时间和接收时间,以及延迟请求的发送时间和接收时间,计算与新的主用时钟服务器之间的相位差;其中,延迟请求的接收时间等于延迟响应信息的发送时间。The processing subunit is configured to calculate a phase difference from the new primary clock server according to the transmission time and the reception time of the synchronization information, and the transmission time and the reception time of the delay request; wherein the reception time of the delay request is equal to the delay response The time at which the message was sent.
其中,第一同步信息包括:Announce报文、Sync报文、以及Delay_Response报文。The first synchronization information includes: an Announce message, a Sync message, and a Delay_Response message.
其中,第二同步信息包括:Announce报文和Sync报文。The second synchronization information includes: an Announce message and a Sync message.
需要说明的是,该装置是与上述时钟链路切换方法对应的装置,上述方法实施例中所有实现方式均适用于该装置的实施例中,也能达到相同的技术效果。It should be noted that the device is a device corresponding to the above-mentioned clock link switching method. All the implementation manners in the foregoing method embodiments are applicable to the device embodiment, and the same technical effects can be achieved.
依据本发明实施例的再一个方面,还提供了一种基站,包括如上所述的时钟链路切换装置。According to still another aspect of an embodiment of the present invention, there is also provided a base station comprising the clock link switching device as described above.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:Embodiments of the present invention also provide a storage medium. Optionally, in the embodiment, the foregoing storage medium may be configured to store program code for performing the following steps:
S1,接收主用时钟服务器发送的第一同步信息以及备用时钟服务器发送的第二同步信息; S1, receiving first synchronization information sent by the primary clock server and second synchronization information sent by the backup clock server;
S2,接收主用时钟服务器发送的第一同步信息以及备用时钟服务器发送的第二同步信息;S2, receiving first synchronization information sent by the primary clock server and second synchronization information sent by the backup clock server;
S3,当抖动值差在预设范围内持续预设时间,且备时钟链路的丢包率低于第一预设值时,将备时钟链路作为新的主时钟链路。S3: When the jitter value difference is within a preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value, the standby clock link is used as the new primary clock link.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory. A variety of media that can store program code, such as a disc or a disc.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
以上所述的是本发明的优选实施方式,应当指出对于本技术领域的普通人员来说,在不脱离本发明所述的原理前提下还可以作出若干改进和润饰,这些改进和润饰也在本发明的保护范围内。The above is a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. Within the scope of protection of the invention.
工业实用性Industrial applicability
在本实施例中,通过比较分析主时钟链路和备时钟链路两条链路的是时钟性能优劣,及时选择时钟性能好的时钟服务器切换为时钟源,可实现时钟链路的快速而准确地切换,节省了链路切换时间,且在一定程度上提高了链路的同步性能。 In this embodiment, by comparing and analyzing the clock performance of the two links of the primary clock link and the backup clock link, the clock server with good clock performance is switched to the clock source in time, and the clock link can be quickly implemented. Accurate switching saves link switching time and improves link synchronization performance to some extent.

Claims (17)

  1. 一种时钟链路切换方法,包括:A clock link switching method includes:
    接收主用时钟服务器发送的第一同步信息以及备用时钟服务器发送的第二同步信息;Receiving first synchronization information sent by the primary clock server and second synchronization information sent by the backup clock server;
    根据所述第一同步信息和所述第二同步信息,计算主时钟链路与备时钟链路之间的抖动值差以及备时钟链路的丢包率,其中,所述主时钟链路为与所述主用时钟服务器之间的时钟链路,所述备时钟链路为与所述备用时钟服务器之间的时钟链路;And calculating, according to the first synchronization information and the second synchronization information, a jitter value difference between the primary clock link and the backup clock link, and a packet loss rate of the standby clock link, where the primary clock link is a clock link with the primary clock server, the standby clock link being a clock link with the standby clock server;
    当所述抖动值差在预设范围内持续预设时间,且所述备时钟链路的丢包率低于第一预设值时,将所述备时钟链路作为新的主时钟链路。When the jitter value difference is within a preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value, the standby clock link is used as a new primary clock link. .
  2. 根据权利要求1所述的时钟链路切换方法,其中,在接收主用时钟服务器发送的第一同步信息以及备用时钟服务器发送的第二同步信息之后,还包括:The clock link switching method according to claim 1, wherein after receiving the first synchronization information sent by the primary clock server and the second synchronization information sent by the backup clock server, the method further includes:
    根据所述第一同步信息,检测所述主用时钟服务器的丢包率或可用性;And detecting, according to the first synchronization information, a packet loss rate or availability of the primary clock server;
    当检测到所述主用时钟服务器的丢包率高于第二预设值,或所述主用时钟服务器不可用时,将所述备时钟链路作为新的主时钟链路。When it is detected that the packet loss rate of the primary clock server is higher than a second preset value, or the primary clock server is unavailable, the standby clock link is used as a new primary clock link.
  3. 根据权利要求1或2所述的时钟链路切换方法,其中,根据所述第一同步信息和所述第二同步信息,计算主时钟链路与备时钟链路之间的抖动值差的步骤包括:The clock link switching method according to claim 1 or 2, wherein the step of calculating a jitter value difference between the primary clock link and the standby clock link according to the first synchronization information and the second synchronization information include:
    根据预定时间段内的所述第一同步信息的接收时间和发送时间,计算所述主时钟链路的抖动值;Calculating a jitter value of the primary clock link according to a receiving time and a sending time of the first synchronization information in a predetermined time period;
    根据预定时间段内所述第二同步信息的接收时间和发送时间,计算所述备时钟链路的抖动值;Calculating a jitter value of the standby clock link according to the receiving time and the sending time of the second synchronization information in the predetermined time period;
    将所述备时钟链路的抖动值与所述主时钟链路的抖动值作差,得到所述预定时间段内主时钟链路与备时钟链路之间的抖动值差。The jitter value of the standby clock link is compared with the jitter value of the primary clock link to obtain a jitter value difference between the primary clock link and the standby clock link in the predetermined time period.
  4. 根据权利要求3所述的时钟链路切换方法,其中,根据预定时间段内所述第一同步信息的接收时间和发送时间,计算所述主时钟链路的抖动值的步骤包括: The clock link switching method according to claim 3, wherein the calculating the jitter value of the primary clock link according to the receiving time and the sending time of the first synchronization information in a predetermined time period comprises:
    根据预定时间段内多个第一同步信息的接收时间和发送时间,计算得到主时钟链路的多个传输时间;Calculating a plurality of transmission times of the primary clock link according to the receiving time and the sending time of the plurality of first synchronization information in the predetermined time period;
    将相邻的传输时间作差,得到所述主时钟链路的多个抖动值;Performing a difference between adjacent transmission times to obtain a plurality of jitter values of the primary clock link;
    对所述多个抖动值取平均,得到所述主时钟链路的抖动值。And averaging the plurality of jitter values to obtain a jitter value of the primary clock link.
  5. 根据权利要求1所述的时钟链路切换方法,其中,将所述备时钟链路作为新的主时钟链路的步骤包括:The clock link switching method according to claim 1, wherein the step of using the standby clock link as a new master clock link comprises:
    将所述备用时钟服务器作为新的主用时钟服务器,并接收所述新的主用时钟服务器发送的同步信息;Using the standby clock server as a new primary clock server, and receiving synchronization information sent by the new primary clock server;
    根据所述同步信息,计算与所述新的主用时钟服务器之间的相位差;Calculating a phase difference from the new primary clock server according to the synchronization information;
    根据所述同步信息和所述相位差,调整本地时钟值。The local clock value is adjusted based on the synchronization information and the phase difference.
  6. 根据权利要求5所述的时钟链路切换方法,其中,根据所述同步信息,计算与所述新的主用时钟服务器之间的相位差的步骤包括:The clock link switching method according to claim 5, wherein the calculating the phase difference from the new primary clock server according to the synchronization information comprises:
    在接收到所述同步信息后,向所述新的主用时钟服务器发送一延迟请求信息;After receiving the synchronization information, sending a delay request message to the new primary clock server;
    接收所述新的主用时钟服务器响应所述延迟请求信息发送的延迟响应信息;Receiving delayed response information sent by the new primary clock server in response to the delay request information;
    根据所述同步信息的发送时间和接收时间,以及所述延迟请求的发送时间和接收时间,计算与所述新的主用时钟服务器之间的相位差;其中,所述延迟请求的接收时间等于所述延迟响应信息的发送时间。Calculating a phase difference with the new primary clock server according to a sending time and a receiving time of the synchronization information, and a sending time and a receiving time of the delay request; wherein a receiving time of the delay request is equal to The transmission time of the delayed response information.
  7. 根据权利要求1所述的时钟链路切换方法,其中,所述第一同步信息包括:Announce报文、Sync报文、以及Delay_Response报文。The method for switching a clock link according to claim 1, wherein the first synchronization information comprises: an Announce message, a Sync message, and a Delay_Response message.
  8. 根据权利要求1所述的时钟链路切换方法,其中,所述第二同步信息包括:Announce报文和Sync报文。The clock link switching method according to claim 1, wherein the second synchronization information comprises: an Announce message and a Sync message.
  9. 一种时钟链路切换装置,包括:A clock link switching device includes:
    接收模块,设置为接收主用时钟服务器发送的第一同步信息以及备用时钟服务器发送的第二同步信息;a receiving module, configured to receive first synchronization information sent by the primary clock server and second synchronization information sent by the backup clock server;
    计算模块,设置为根据所述第一同步信息和所述第二同步信息,计算 主时钟链路与备时钟链路之间的抖动值差以及备时钟链路的丢包率,其中,所述主时钟链路为与所述主用时钟服务器之间的时钟链路,所述备时钟链路为与所述备用时钟服务器之间的时钟链路;a calculating module, configured to calculate according to the first synchronization information and the second synchronization information a jitter value difference between the primary clock link and the standby clock link, and a packet loss ratio of the standby clock link, wherein the primary clock link is a clock link with the primary clock server, The standby clock link is a clock link with the standby clock server;
    第一处理模块,设置为当所述抖动值差在预设范围内持续预设时间,且所述备时钟链路的丢包率低于第一预设值时,将所述备时钟链路作为新的主时钟链路。The first processing module is configured to set the standby clock link when the jitter value difference is within a preset range for a preset time, and the packet loss rate of the standby clock link is lower than the first preset value As a new master clock link.
  10. 根据权利要求9所述的时钟链路切换装置,其中,还包括:The clock link switching device according to claim 9, further comprising:
    检测模块,设置为根据所述第一同步信息,检测所述主用时钟服务器的丢包率或可用性;The detecting module is configured to detect a packet loss rate or availability of the primary clock server according to the first synchronization information;
    第二处理模块,设置为当检测到所述主用时钟服务器的丢包率高于第二预设值,或所述主用时钟服务器不可用时,将所述备时钟链路作为新的主时钟链路。a second processing module, configured to: when detecting that the packet loss rate of the primary clock server is higher than a second preset value, or when the primary clock server is unavailable, using the standby clock link as a new primary clock link.
  11. 根据权利要求9或10所述的时钟链路切换装置,其中,所述计算模块包括:The clock link switching device according to claim 9 or 10, wherein the calculation module comprises:
    第一计算单元,设置为根据预定时间段内的所述第一同步信息的接收时间和发送时间,计算所述主时钟链路的抖动值;a first calculating unit, configured to calculate a jitter value of the primary clock link according to a receiving time and a sending time of the first synchronization information in a predetermined time period;
    第二计算单元,设置为根据预定时间段内所述第二同步信息的接收时间和发送时间,计算所述备时钟链路的抖动值;a second calculating unit, configured to calculate a jitter value of the standby clock link according to a receiving time and a sending time of the second synchronization information in a predetermined time period;
    第三计算单元,设置为将所述备时钟链路的抖动值与所述主时钟链路的抖动值作差,得到所述预定时间段内主时钟链路与备时钟链路之间的抖动值差。a third calculating unit, configured to compare a jitter value of the standby clock link with a jitter value of the primary clock link to obtain jitter between the primary clock link and the standby clock link in the predetermined time period The value difference.
  12. 根据权利要求11所述的时钟链路切换装置,其中,所述第一计算单元包括:The clock link switching device according to claim 11, wherein the first calculating unit comprises:
    第一计算子单元,设置为根据预定时间段内多个第一同步信息的接收时间和发送时间,计算得到主时钟链路的多个传输时间;a first calculating subunit, configured to calculate, according to a receiving time and a sending time of the plurality of first synchronization information in the predetermined time period, a plurality of transmission times of the primary clock link;
    第二计算子单元,设置为将相邻的传输时间作差,得到所述主时钟链路的多个抖动值; a second computing subunit, configured to make adjacent transmission time differences, to obtain multiple jitter values of the primary clock link;
    第三计算子单元,设置为对所述多个抖动值取平均,得到所述主时钟链路的抖动值。And a third calculating subunit, configured to average the plurality of jitter values to obtain a jitter value of the primary clock link.
  13. 根据权利要求9所述的时钟链路切换装置,其中,所述第一处理模块包括:The clock link switching device of claim 9, wherein the first processing module comprises:
    第一处理单元,设置为将所述备用时钟服务器作为新的主用时钟服务器,并接收所述新的主用时钟服务器发送的同步信息;a first processing unit, configured to use the standby clock server as a new primary clock server, and receive synchronization information sent by the new primary clock server;
    第二处理单元,设置为根据所述同步信息,计算与所述新的主用时钟服务器之间的相位差;a second processing unit configured to calculate a phase difference from the new primary clock server according to the synchronization information;
    第三处理单元,设置为根据所述同步信息和所述相位差,调整本地时钟值。The third processing unit is configured to adjust the local clock value according to the synchronization information and the phase difference.
  14. 根据权利要求13所述的时钟链路切换装置,其中,所述第二处理单元包括:The clock link switching device of claim 13, wherein the second processing unit comprises:
    发送子单元,设置为在接收到所述同步信息后,向所述新的主用时钟服务器发送一延迟请求信息;a sending subunit, configured to send a delay request message to the new primary clock server after receiving the synchronization information;
    接收子单元,设置为接收所述新的主用时钟服务器响应所述延迟请求信息发送的延迟响应信息;a receiving subunit, configured to receive delay response information sent by the new primary clock server in response to the delay request information;
    处理子单元,设置为根据所述同步信息的发送时间和接收时间,以及所述延迟请求的发送时间和接收时间,计算与所述新的主用时钟服务器之间的相位差;其中,所述延迟请求的接收时间等于所述延迟响应信息的发送时间。Processing a subunit, configured to calculate a phase difference from the new primary clock server according to a sending time and a receiving time of the synchronization information, and a sending time and a receiving time of the delay request; wherein The receiving time of the delayed request is equal to the sending time of the delayed response information.
  15. 根据权利要求9所述的时钟链路切换装置,其中,所述第一同步信息包括:Announce报文、Sync报文、以及Delay_Response报文。The clock link switching device of claim 9, wherein the first synchronization information comprises: an Announce message, a Sync message, and a Delay_Response message.
  16. 根据权利要求9所述的时钟链路切换装置,其中,所述第二同步信息包括:Announce报文和Sync报文。The clock link switching device according to claim 9, wherein the second synchronization information comprises: an Announce message and a Sync message.
  17. 一种基站,包括如权利要求9~16任一项所述的时钟链路切换装置。 A base station comprising the clock link switching device according to any one of claims 9 to 16.
PCT/CN2016/098111 2015-12-18 2016-09-05 Method and device for clock link switching and base station WO2017101528A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510956839.7A CN106899370A (en) 2015-12-18 2015-12-18 A kind of clock chain circuit changing method, device and base station
CN201510956839.7 2015-12-18

Publications (1)

Publication Number Publication Date
WO2017101528A1 true WO2017101528A1 (en) 2017-06-22

Family

ID=59055698

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/098111 WO2017101528A1 (en) 2015-12-18 2016-09-05 Method and device for clock link switching and base station

Country Status (2)

Country Link
CN (1) CN106899370A (en)
WO (1) WO2017101528A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109218007A (en) * 2017-07-03 2019-01-15 中兴通讯股份有限公司 Routing resource, equipment and storage medium
CN112367137A (en) * 2019-09-06 2021-02-12 华为技术有限公司 Method, device, system and storage medium for realizing clock source selection

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426911B (en) 2017-08-31 2022-04-05 华为技术有限公司 Method and device for evaluating software running environment quality of equipment
CN107404412A (en) * 2017-09-12 2017-11-28 浙江中控技术股份有限公司 A kind of switching method of server, device, system and electronic equipment
CN109699068B (en) * 2017-10-20 2021-05-28 阿里巴巴集团控股有限公司 Base station synchronization method and device
CN108809762A (en) * 2018-06-13 2018-11-13 郑州云海信息技术有限公司 A kind of server network performance test methods and system
CN111405077B (en) * 2020-03-05 2023-02-17 深圳前海百递网络有限公司 Domain name switching method and device, computer readable storage medium and computer equipment
TWI748902B (en) * 2020-05-19 2021-12-01 瑞昱半導體股份有限公司 Control method and time aware bridge device for seamless precision time protocol
CN113852998B (en) * 2020-06-28 2023-07-21 ***通信集团广东有限公司 Cell switching method based on clock synchronization, terminal and network side equipment
CN112867132B (en) * 2020-12-27 2022-07-15 卡斯柯信号有限公司 Multi-link time delay jitter optimization method and device based on PTP
CN114039691B (en) * 2021-10-22 2023-05-16 中国联合网络通信集团有限公司 Time synchronization method, device, equipment and storage medium
CN115190577B (en) * 2022-05-11 2023-10-13 四川创智联恒科技有限公司 ORAN system time sequence synchronization mutual backup method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030040328A1 (en) * 2001-08-21 2003-02-27 Widcomm, Inc. System and method for synchronizing wireless communication devices
CN101882990A (en) * 2010-06-24 2010-11-10 中兴通讯股份有限公司 Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system
CN102111258A (en) * 2009-12-25 2011-06-29 华为技术有限公司 Clock synchronization method, equipment and system
CN102487301A (en) * 2010-12-01 2012-06-06 中兴通讯股份有限公司 Method and device for recovering multilink clock

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067111A (en) * 2011-10-24 2013-04-24 中兴通讯股份有限公司 Method and device of clock synchronization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030040328A1 (en) * 2001-08-21 2003-02-27 Widcomm, Inc. System and method for synchronizing wireless communication devices
CN102111258A (en) * 2009-12-25 2011-06-29 华为技术有限公司 Clock synchronization method, equipment and system
CN101882990A (en) * 2010-06-24 2010-11-10 中兴通讯股份有限公司 Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system
CN102487301A (en) * 2010-12-01 2012-06-06 中兴通讯股份有限公司 Method and device for recovering multilink clock

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
IEEE INSTRUMENTATION AND MEASUREMENT SOCIETY.: "IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems", IEEE STD 1588TM-2008, 24 July 2008 (2008-07-24), XP055391725 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109218007A (en) * 2017-07-03 2019-01-15 中兴通讯股份有限公司 Routing resource, equipment and storage medium
CN109218007B (en) * 2017-07-03 2022-11-01 中兴通讯股份有限公司 Path selection method, device and storage medium
CN112367137A (en) * 2019-09-06 2021-02-12 华为技术有限公司 Method, device, system and storage medium for realizing clock source selection

Also Published As

Publication number Publication date
CN106899370A (en) 2017-06-27

Similar Documents

Publication Publication Date Title
WO2017101528A1 (en) Method and device for clock link switching and base station
US10158444B1 (en) Event-driven precision time transfer
US8730868B2 (en) Network node, time synchronization method and network system
US8995473B2 (en) Ring based precise time data network clock phase adjustments
US20100098111A1 (en) Method and system for precise-clock synchronization, and device for precise-clock frequency/time synchronization
WO2018006686A1 (en) Method, apparatus and device for optimizing time synchronization between communication network devices
US9955447B2 (en) Clock synchronization method, mobile network system, network controller and network switch
US20180262321A1 (en) Method, device, and system for synchronizing clocks of processors
US10484163B2 (en) Measure and improve clock synchronization using combination of transparent and boundary clocks
US20140241381A1 (en) Time control device, time control method, and program
WO2012163172A1 (en) Clock synchronization method and device
EP3785383A1 (en) Timing synchronization over cable networks
WO2013051447A1 (en) Time control device, time control method, and program
US20220007321A1 (en) Network Entities and Methods for a Wireless Network System for Determining Time Information
Iwanicki et al. Gossip-based clock synchronization for large decentralized systems
WO2013159486A1 (en) Ptp clock source switching method, and master and slave clock devices and systems
US20230232347A1 (en) Data processing method and apparatus therefor
WO2010102565A1 (en) Method, apparatus and system for time synchronization
CN114389735A (en) Clock synchronization method based on IEEE802.1AS redundant master clock
CN110620630B (en) Time synchronization method, device, network equipment and computer readable storage medium
US10334539B2 (en) Metered interface
JP2014032055A (en) Communication system
WO2022127924A1 (en) Method and device for selecting clock source
CN113037418B (en) Error correction method and related device for network time service
KR20100048124A (en) Time synchronization method in bridged local area network

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: 16874588

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: 16874588

Country of ref document: EP

Kind code of ref document: A1