WO2013026307A1 - Clock protection method and device - Google Patents

Clock protection method and device Download PDF

Info

Publication number
WO2013026307A1
WO2013026307A1 PCT/CN2012/076823 CN2012076823W WO2013026307A1 WO 2013026307 A1 WO2013026307 A1 WO 2013026307A1 CN 2012076823 W CN2012076823 W CN 2012076823W WO 2013026307 A1 WO2013026307 A1 WO 2013026307A1
Authority
WO
WIPO (PCT)
Prior art keywords
board
locked loop
lock
timing
standby
Prior art date
Application number
PCT/CN2012/076823
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 WO2013026307A1 publication Critical patent/WO2013026307A1/en

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION, OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • H03L7/06Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop

Definitions

  • the present invention relates to the field of communications, and in particular to a clock protection method and apparatus.
  • BACKGROUND OF THE INVENTION For a synchronous communication system, it is important to implement clock synchronization between devices.
  • a device usually adopts an interlock clock scheme of 1+1 or 1:1 hot backup, and the purpose is to use when the primary clock is abnormal and the standby clock output is normal.
  • the device can switch to the alternate clock to ensure clock synchronization and reduce business impairments.
  • the general device uses a phase-locked loop circuit to track and synchronize the external clock.
  • the present invention provides a clock protection method and apparatus to solve at least one of the above problems.
  • a clock protection method including: determining the active/standby state of the current board; when the board is a standby board, determining whether the phase locked loop of the board is locked; When the ring is out of lock, it is judged whether the lockout timing exceeds the preset threshold. When the lockout timing does not exceed the threshold, it is judged whether the phase locked loop of the main board is locked. If the lock is lost, the board is switched to the main board. , clear the lockout timing.
  • the method further includes: when the phase locked loop of the single board is locked, clearing the lost lock flag of the phase locked loop and clearing the lost lock timing; determining whether the lost lock timing exceeds the preset
  • the threshold it also includes: When the loss of lock timing exceeds the threshold, continue to count.
  • the method further includes: determining whether the lockout flag has been set, if not set, then setting the lockout flag and starting to count the lockout timing, if it is set, determining the lockout Whether the timing exceeds the preset threshold. If the board is switched to the main board, the board is replaced with the default threshold.
  • the method further includes: When the board is the main board, determine whether the phase locked loop of the board is locked, and notify the standby board of the judgment result. Determine whether the phase-locked ring of the board is locked, and notify the backup board of the result of the judgment.
  • the method includes: determining whether the phase-locked loop of the board of the main board is locked; if it is locked, determining whether the network management is mandatory, and when there is no network management, If the fault persists, the board is forcibly forced. If there is no fault, the board is forcibly determined.
  • a clock protection apparatus including: an active/standby determination module, configured to determine an active/standby state of a current board; and a standby board determination module, configured to determine when a board is a standby board Whether the phase-locked loop of the board is locked; the timing judgment module is set to determine whether the lockout timing exceeds the preset threshold when the phase-locked loop of the board is lost; the master-slave switchover module is set to not exceed the lockout timing.
  • the threshold it is determined whether the phase locked loop of the main board is locked, and when the phase locked loop of the main board loses lock, the board is switched to the main board, and the lockout timing board judgment module is cleared, and is also set to be in the single
  • the lockout flag of the phase locked loop is cleared and the lockout timing is cleared; the timing judgment module is also used to continue timing when the lockout timing exceeds the threshold.
  • the device further includes: a setting judgment module, configured to determine whether the loss of lock flag has been set, and when the loss of lock flag is not set, the lock flag is lost and the statistics of the lockout timing is started, when the lockout flag is set. , activate the timing judgment module.
  • the device further includes: a switching determination module, configured to determine, after the active/standby switching module determines that the phase locked loop of the main board is out of lock, determine whether the number of active/standby switching in the predetermined time period is less than a predetermined threshold, and when less than Activate the active/standby switchover module to switch the board to the main board and clear the lockout timing.
  • the device further includes: a main board judging module, configured to determine whether the phase locked loop of the single board is locked when the board is the main board, and notify the standby board of the judgment result.
  • the motherboard judging module includes: a state judging unit, configured to determine whether the phase locked loop of the board of the main board is locked; and the locking judging unit is configured to determine whether the network management is forced when the phase locked loop of the board is locked, If the board is faulty, the board is forcibly determined. If the board is faulty, the board is forcibly disabled. If there is no fault on the board, the board is forced.
  • the lock loss judgment unit is set to be on the board. When the PLL is out of lock, it is determined whether there is a network management force. If there is no network management force, the board is forcibly disabled.
  • the present invention is used to determine the state of the current board.
  • the current board is the standby board, according to whether the phase locked loop of the board is locked, whether the lockout timing exceeds the threshold threshold, and the lock of the current main board is used. If the phase loop is locked or not, it is determined whether the active/standby switchover is implemented. It is difficult to determine whether it is necessary to switch the clock from the operating state of the phase-locked loop and the need to introduce a new device for the phase-locked loop detection. Whether the fault point is the phase-locked loop circuit or the clock source, the protection switching when the clock is out of synchronization and the service is damaged due to the loss of the phase-locked loop is realized without adding an external device.
  • FIG. 1 is a flowchart of a clock protection method according to an embodiment of the present invention
  • FIG. 2 is a flow of a backup board side of a clock protection method according to a preferred embodiment of the present invention
  • FIG. 3 is a flowchart according to a preferred embodiment of the present invention.
  • FIG. 4 is a schematic diagram showing the functional structure of the active and standby boards according to an example of the present invention
  • FIG. 5 is a flow of the standby board side of the clock protection method according to an example of the present invention.
  • Clock Protection Method Main Board Side Flow FIG. 7 is a block diagram showing the structure of a clock protection apparatus according to an embodiment of the present invention.
  • the clock protection method includes: Step S102: determining the active/standby state of the current board; Step S104: When the board is a standby board, determining whether the phase locked loop of the board is locked; Step S106: When the phase locked loop of the board is out of lock, determine whether the lost lock timing exceeds a preset threshold; In step S108, when the lockout timing does not exceed the threshold, it is determined whether the phase locked loop of the main board is locked. If the lock is lost, the board is switched to the main board, and the lockout timing is cleared.
  • the clock protection method provided in this embodiment further sets the lockout timing on the basis of the state of the phase-locked loop of the active and standby boards, and fully utilizes these parameters and their mutual relations to determine the master/slave switchover, so that the clockless control can be judged.
  • the fault point is to realize the clock protection under the premise of the phase-locked loop circuit or the judgment of the clock source, and it is not necessary to add a new device.
  • the foregoing embodiment provides a general clock protection method, which corresponds to an active/standby switchover in a normal situation.
  • the method further includes: when the phase locked loop of the single board is locked, clearing the unlocking flag of the phase locked loop and clearing the lost lock timing; After exceeding the preset threshold, the method may further include: when the loss of lock timing exceeds the threshold, continue to time.
  • the preferred embodiment provides an adjustment method for the loss of lock flag (used to identify the current state of the phase locked loop) and the lockout timing in the above special case, which ensures the clock protection process in the loop, each time Clock protection can be successfully completed.
  • the method before determining whether the loss of lock timing exceeds a preset threshold, the method further includes: determining whether the loss of lock flag has been set, if not set, then setting the lockout flag and starting to count the loss of lock timing, if set Then, determine if the lockout timing exceeds the preset threshold. Since the clock protection method provided by the present invention is a cyclic execution method, in most cases, the lockout flag is set, but it is not excluded that the protection needs to be viewed at the beginning of the protection or the failure occurs.
  • the lock loss flag is not set.
  • the board is switched to the main board, and before the timing of the lockout is cleared, the method further includes: determining whether the number of active/standby switching times in the predetermined time period is less than a predetermined threshold, and if the value is smaller than Board, clear the lockout timing.
  • the preferred embodiment further adds a parameter for whether to perform the active/standby switchover, that is, whether the number of active/standby switchovers in the predetermined time period is less than a predetermined threshold, and the above-mentioned judgment can prevent the occurrence of frequent switching, thereby further improving system stability. .
  • the above preferred embodiment mainly provides a clock protection method on the standby board side, and the preferred embodiment provides a preferred main board side clock protection operation corresponding to the above preferred embodiment.
  • the method further includes: when the board is the main board, determining whether the phase locked loop of the board is locked, and notifying the standby board of the determination result.
  • the main function of the main board in clock protection or active/standby switching is to provide its own various status parameters as the basis for judging whether to perform the active/standby switching. The most important one is whether the phase locked loop is locked.
  • the manner in which the status of the main board phase locked loop is notified to the spare board is varied, either in a direct manner or in an indirect manner.
  • the preferred embodiment provides a preferred embodiment.
  • determining whether the phase locked loop of the board of the main board is locked, and notifying the standby board of the judgment result may include: (1) determining whether the phase locked loop of the board of the main board is locked;
  • the network management is a basis for determining whether the board is the primary board or the standby board in the existing switching mechanism.
  • the mandatory board itself has an attribute that is mandatory.
  • the preferred embodiment uses this existing attribute. Use this attribute to inform the standby board of the current state of the phase-locked loop of the board, and set the forced phase-locked loop lock, and cancel the forcing, that is, the phase-locked loop loses lock.
  • Step S202 determining the active/standby state, the current board is a standby board
  • S204 determining the state of the single-phase locked loop, if it is locked, go to step S206, if it is lost, go to step S208
  • step S206 clear the lost lock flag, the lockout timing is cleared, and the end
  • step S208 determine Whether there is a lockout flag, if not, go to step S210, if yes, go to step S212; step S210, lose the lock flag, and the lockout timing starts;
  • Step S212 determining whether the lost lock timing exceeds the threshold, and if so, ending, if no, go to step S214;
  • step S214 determine whether the main board is out of lock, if not, end, if yes, go to step S216; step S216 And determining whether it is frequent switching, if yes, ending, if no, go to step S218; step S218, the board grabs the main use; step S220, clear the lost lock flag, and ends.
  • the process of the main board side of the clock protection method according to the above preferred embodiment, as shown in FIG. 3, includes: Step S302: The active/standby state determines that the current board is the main board; Step S304, the phase locked loop lock state is judged; Step S306, the status of the master/slave determination condition is updated; in step S308, the result of the determination is sent to the standby board.
  • the environment of the application includes: the main board and the standby board.
  • Each board includes: phase-locked loop, phase-locked loop status detection, anti-frequent switching, clock active/standby status detection, active/standby Switch functions and other functional entities.
  • Step S502 determining that the current board is a standby board; Step S504, determining whether the phase locked loop of the board is out of lock, if not, turning Go to step S506, if yes, go to step S508; step S506, clear the lockout flag, clear the lockout timing, and end; Step S508, determining whether there is a loss of lock flag, if not, proceeding to step S510, if yes, proceeding to step S512; step S510, setting the lockout flag, the lockout timing begins; step S512, determining whether the lockout timing is less than 30 minutes If no, the end, that is, the standby board phase lock loop loss time is longer than the main board, it is judged that the spare board is damaged, and no switching is performed.
  • Step S514 determines whether the board is mandatory and If yes, go to step S516; step S516, determine whether the number of times of switching within 1 hour is less than 2 times, if no, end, prevent frequent switching, if yes, go to step S518; step S518, The board grabs the main use and becomes the main use state; in step S520, the lost lock flag is cleared, and the end is completed.
  • Step S602 includes: Step S602, determining that the board is the main board; Step S604, judging the state of the main board phase locked loop, if it is the locked state Go to step S606, if it is in an unlocked state, go to step S614, if it is a state other than the locked and unlocked state, end; step S606, determine whether there is a network management mandatory active/standby, if yes, end, if no, Go to step S608; Step S608, determine whether the board is faulty and cause noready, if yes, go to step S610, if no, go to step S612; step S610, the board cancels forcing, ends; step S612, the board is forced, That is, the meaning of the "phase locked loop lock" is expressed by using the active forced state line, and the priority of the lock of the phase locked loop is lower than the original switching condition, and the process ends; step S614, determining whether the network management force the board is the main use, if If yes, go to step S616; in
  • FIG. 7 is a block diagram showing the structure of a clock protection apparatus according to an embodiment of the present invention.
  • the clock protection apparatus includes: an active/standby determination module 72, configured to determine the active/standby state of the current board; the standby board determination module 74 is connected to the active/standby determination module 72, and is set to When the board is a standby board, it is determined whether the phase locked loop of the board is locked.
  • the timing determining module 76 is connected to the standby board determining module 74, and is configured to determine whether the lost lock timing exceeds when the phase locked loop of the board is lost.
  • the preset threshold; the active/standby switching module 78 is connected to the timing determining module 76, and is set to determine whether the phase locked loop of the main board is locked when the loss of lock timing does not exceed the threshold, and the phase locked loop of the main board is lost.
  • the clock protection device provided in this embodiment further sets the lockout timing on the basis of the state of the phase-locked loop of the main and standby boards, and fully utilizes these parameters and their mutual relations to determine the master/slave switchover, which can be judged without failure.
  • the clock protection is implemented on the premise of the phase-locked loop circuit or the clock source.
  • the clock protection device provided in this embodiment can be established on the original board without adding new equipment.
  • the standby board judging module is further configured to clear the lockout flag of the phase locked loop and clear the lockout timing when the phase locked loop of the single board is locked;
  • the judging module is also set to continue counting when the lockout timing exceeds the threshold.
  • the module may lose the lock flag (used to identify the current state of the phase locked loop) when a previous failure occurs in the active/standby switchover or when the active/standby switchover is not actually required. And the lockout timing is adjusted accordingly, ensuring that every clock protection can be successfully completed during the cyclic clock protection process.
  • the clock protection apparatus may further include: a setting judgment module configured to determine whether the loss of lock flag has been set, and when the loss of lock flag is not set, the lock flag is lost and statistics are started. Loss of lock timing, activates the timing determination module when the loss of lock flag is set.
  • the reason that the protection start or the failure occurs may cause the lockout flag to be unset when the lockout flag needs to be viewed, and the added module of the preferred embodiment can solve the problem. Ensure that the clock protection goes smoothly.
  • the clock protection apparatus may further include: a switching determination module, configured to determine, after the active/standby switching module determines that the phase locked loop of the main board is out of lock, determine the active/standby switching in the predetermined time period If the number of times is less than the predetermined threshold, the active/standby switchover module is activated to switch the board to the active board and the lockout timing is cleared.
  • a switching determination module configured to determine, after the active/standby switching module determines that the phase locked loop of the main board is out of lock, determine the active/standby switching in the predetermined time period If the number of times is less than the predetermined threshold, the active/standby switchover module is activated to switch the board to the active board and the lockout timing is cleared.
  • the added module of the preferred embodiment can prevent the occurrence of frequent switching and further improve the stability of the system.
  • the clock protection device may further include: a mainboard judging module configured to determine whether the phase locked loop of the single board is locked when the board is the main board, and notifying the standby board of the determination result.
  • the main function of the main board in clock protection or active/standby switching is to provide its own various status parameters as the basis for judging whether to perform the active/standby switching. The most important one is whether the phase locked loop is locked.
  • the function of the additional module of the preferred embodiment is to obtain this parameter and provide it to the spare board.
  • the motherboard determining module may include: a state determining unit configured to determine whether a phase locked loop of the board of the main board is locked; a locking determining unit connected to the state determining unit, configured to be locked in the board When the ring is locked, it is determined whether the network management is mandatory. If there is no network management force, the board is faulty. If the board is faulty, the board is forcibly disabled.
  • the lock-off judgment unit is connected to the state judgment unit, and is set to determine whether the network management is forcible when the phase-locked loop of the board is out of lock, and the board is forcibly disabled when there is no network management force.
  • the network management is a basis for determining whether the board is the primary board or the standby board in the existing switching mechanism.
  • the mandatory board itself has an attribute that is mandatory.
  • the preferred embodiment uses this existing attribute. Use this attribute to inform the standby board of the current state of the phase-locked loop of the board, and set the forced phase-locked loop lock, and cancel the forcing, that is, the phase-locked loop loses lock. From the above description, it can be seen that the technical solution provided by the present invention avoids the judgment of whether the fault point is a phase-locked loop (circuit) or a clock source, and the phase-locked loop can be realized without adding an external detecting device (circuit). Loss of lock causes protection of the clock when the clock is not synchronized and the service is damaged.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Abstract

Disclosed are a clock protection method and device. The method comprises: determining an active/standby state of a current board; when the board is a standby board, determining whether a phase locked loop of the board is locked; when the phase locked loop of the board is unlocked, determining whether an unlocking time exceeds a preset threshold; when the unlocking time does not exceed the preset threshold, determining whether a phase locked loop of an active board is locked, and if the phase locked loop of the active board is unlocked, switching the standby board into an active board and clearing the unlocking time. The technical solution provided by the present invention solves the problem in the prior art that it is difficult to determine, only according to a running state of the phase locked loop, whether the clock needs to be switched and whether a new apparatus needs to be introduced for phase locked loop detection, avoids determining whether a fault point is a phase locked loop circuit or a clock source, and implements protection switching when the clock is asynchronous and the service is damaged without adding an external apparatus.

Description

时钟保护方法及装置 技术领域 本发明涉及通信领域, 具体而言, 涉及一种时钟保护方法及装置。 背景技术 对于同步通讯系统, 实现设备间的时钟同步至关重要, 目前的设备通常采用 1+1 或者 1 : 1热备份的互锁时钟方案,目的在于当主用时钟异常同时备用时钟输出正常时, 设备能够切换到备用时钟, 确保时钟的同步、 减少业务损伤。 一般设备采用锁相环电路实现对外部时钟的跟踪和同步。 然而, 第一模拟锁相环 或半模拟半数字锁相环的器件老化率较高, 常常出现因锁相环电路器件问题引起的故 障; 第二, 锁相环电路是否能够实现同步同时跟锁相环电路以及时钟源相关, 很难单 纯从锁相环的运行状态判断是否需要切换时钟; 第三, 对于锁相环电路器件的性能检 测一般需要引入新的检测电路, 增加了设备的成本和新的故障点。 针对这些问题, 目 前尚未提出有效的解决方案。 发明内容 本发明提供了一种时钟保护方法及装置, 以至少解决上述问题之一。 根据本发明的一个方面, 提供了一种时钟保护方法, 包括: 判断当前单板的主备 状态; 当单板是备用板时, 判断单板的锁相环是否锁定; 在单板的锁相环失锁时, 判 断失锁计时是否超过预置的门限; 在失锁计时没有超过门限时, 判断主用板的锁相环 是否锁定, 如果失锁, 则将上述单板倒换为主用板, 清空失锁计时。 在判断单板的锁相环是否锁定之后还包括: 在单板的锁相环锁定时, 清空锁相环 的失锁标志并将失锁计时清零; 在判断失锁计时是否超过预置的门限之后还包括: 在 失锁计时超过了门限时, 继续计时。 在判断失锁计时是否超过预置的门限之前还包括: 判断失锁标志是否已置位, 如 果没有置位, 则置失锁标志并开始统计失锁计时, 如果已置位, 则判断失锁计时是否 超过预置的门限。 在将单板倒换为主用板, 清空失锁计时之前还包括: 判断预定时间段内的主备倒 换的次数是否小于预定的阈值, 如果小于, 则将单板倒换为主用板, 清空失锁计时。 在判断当前单板的主备状态之后还包括: 当单板为主用板时, 判断单板的锁相环 是否锁定, 并将判断结果通知备用板。 判断单板的锁相环是否锁定, 并将判断结果通知备用板包括: 判断为主用板的单 板的锁相环是否锁定; 如果锁定, 则判断是否有网管强制, 在没有网管强制时, 判断 单板是否存在故障, 如果存在故障, 则取消对单板的强制, 如果不存在故障, 则将单 板置强制; 如果失锁, 则判断是否有网管强制, 在没有网管强制时, 取消对单板的强 制。 根据本发明的另一方面, 提供了一种时钟保护装置, 包括: 主备判断模块, 设置 为判断当前单板的主备状态; 备板判断模块, 设置为在单板是备用板时, 判断单板的 锁相环是否锁定; 计时判断模块, 设置为在单板的锁相环失锁时, 判断失锁计时是否 超过预置的门限; 主备倒换模块, 设置为在失锁计时没有超过门限时, 判断主用板的 锁相环是否锁定, 并在主用板的锁相环失锁时, 将单板倒换为主用板, 清空失锁计时 备板判断模块, 还设置为在单板的锁相环锁定时, 清空锁相环的失锁标志并将失 锁计时清零; 计时判断模块, 还用于在失锁计时超过了门限时, 继续计时。 上述装置还包括: 置位判断模块, 设置为判断失锁标志是否已置位, 并在失锁标 志没有置位时, 置失锁标志并开始统计失锁计时, 在失锁标志已置位时, 激活计时判 断模块。 上述装置还包括: 倒换判断模块, 设置为在主备倒换模块判断主用板的锁相环失 锁后, 判断预定时间段内的主备倒换的次数是否小于预定的阈值, 并在小于时, 激活 主备倒换模块将单板倒换为主用板, 清空失锁计时。 上述装置还包括: 主板判断模块, 设置为在单板为主用板时, 判断单板的锁相环 是否锁定, 并将判断结果通知备用板。 主板判断模块包括: 状态判断单元, 设置为判断为主用板的单板的锁相环是否锁 定; 锁定判断单元, 设置为在单板的锁相环锁定时, 判断是否有网管强制, 在没有网 管强制时, 判断单板是否存在故障, 在单板存在故障时, 取消对单板的强制, 在单板 不存在故障时, 将单板置强制; 失锁判断单元, 设置为在单板的锁相环失锁时, 判断 是否有网管强制, 在没有网管强制时, 取消对单板的强制。 通过本发明, 采用判断当前单板的状态, 在当前单板为备用板时, 根据该单板的 锁相环是否锁定、 失锁时失锁计时是否超过阈值的门限、 当前主用板的锁相环是否锁 定等因素, 判断是否进行主备倒换的方案, 解决了现有技术中很难单纯从锁相环的运 行状态判断是否需要切换时钟以及锁相环检测需要引入新设备问题, 规避了对故障点 是锁相环电路还是时钟源的判断, 在不增加外部设备的前提下实现了因锁相环失锁引 起时钟不同步、 业务损伤时的保护倒换。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部分, 本发 明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在附图 中: 图 1是根据本发明实施例的时钟保护方法的流程图; 图 2是根据本发明优选实施例的时钟保护方法备用板侧的流程; 图 3是根据本发明优选实施例的时钟保护方法主用板侧的流程; 图 4是根据本发明实例的主备板功能结构示意图; 图 5是根据本发明实例的时钟保护方法备用板侧的流程; 图 6是根据本发明实例的时钟保护方法主用板侧的流程; 图 7是根据本发明实施例的时钟保护装置的结构框图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不冲突的 情况下, 本申请中的实施例及实施例中的特征可以相互组合。 图 1是根据本发明实施例的时钟保护方法的流程图。 如图 1所示, 根据本发明实 施例的时钟保护方法包括: 步骤 S102, 判断当前单板的主备状态; 步骤 S104, 当单板是备用板时, 判断单板的锁相环是否锁定; 步骤 S106, 在单板的锁相环失锁时, 判断失锁计时是否超过预置的门限; 步骤 S108, 在失锁计时没有超过门限时, 判断主用板的锁相环是否锁定, 如果失 锁, 则将上述单板倒换为主用板, 清空失锁计时。 本实施例提供的时钟保护方法在主备板自身锁相环的状态的基础上, 进一步设置 了失锁计时, 充分利用了这些参数及其相互关系进行主备倒换的判断, 从而可以在不 判断故障点是锁相环电路还是时钟源的判断的前提下实现时钟保护, 也不需要增加新 的设备。 上述实施例提供了一种通用的时钟保护方法, 对应与通常情况下的主备倒换。 但 在现实中, 如果前一次的主备倒换失败了或者实际上不需要进行主备倒换等特殊情况 发生时, 下一次的主备倒换就会受到影响, 因此在这种情况发生时, 上述参数就需要 相应的进行调整。 优选地, 在判断单板的锁相环是否锁定之后还可以包括: 在单板的 锁相环锁定时, 清空锁相环的失锁标志并将失锁计时清零; 在判断失锁计时是否超过 预置的门限之后还可以包括: 在失锁计时超过了门限时, 继续计时。 本优选实施例给出了在上述特殊情况下, 对失锁标志 (用于标识锁相环的当前状 态) 及失锁计时的调整方法, 保证了在循环进行的时钟保护过程中, 每一次的时钟保 护都可以成功完成。 优选地, 在判断失锁计时是否超过预置的门限之前, 还可以包括: 判断失锁标志 是否已置位, 如果没有置位, 则置失锁标志并开始统计失锁计时, 如果已置位, 再判 断失锁计时是否超过预置的门限。 由于本发明提供的时钟保护方法是一种循环执行的方法, 因此在多数情况下, 失 锁标志都是置位的, 但不排除在保护开始之初或出现故障等原因会导致在需要查看失 锁标志时, 会出现失锁标志并未置位的情况, 本优选实施例即可解决这一问题, 保证 时钟保护的顺利进行。 优选地, 在将单板倒换为主用板, 清空失锁计时之前还可以包括: 判断预定时间 段内的主备倒换的次数是否小于预定的阈值, 如果小于, 则将单板倒换为主用板, 清 空失锁计时。 本优选实施例进一步添加了一个是否进行主备倒换的参数, 即判断预定时间段内 的主备倒换的次数是否小于预定的阈值, 通过上述判断即可防止频繁倒换的发生, 进 一步提高系统稳定性。 上述优选实施例主要提供了备用板侧的时钟保护方法, 本优选实施例对应于上述 优选实施例给出一种优选的主用板侧的时钟保护操作。 优选地, 在判断当前单板的主 备状态之后还包括: 当单板为主用板时, 判断单板的锁相环是否锁定, 并将判断结果 通知备用板。 主用板在时钟保护或者说主备倒换中的主要作用就是提供其本身的各种状态参 数, 作为判断是否进行主备倒换的依据, 其中最重要的就是其锁相环是否锁定。 将主用板锁相环的状态通知给备用板的方式是多种多样的, 有直接的方式也有间 接的方式, 本优选实施例给出一种优选地实施方式。 优选地, 判断为主用板的单板的 锁相环是否锁定, 并将判断结果通知备用板可以包括: ( 1 ) 判断为主用板的单板的锁相环是否锁定; TECHNICAL FIELD The present invention relates to the field of communications, and in particular to a clock protection method and apparatus. BACKGROUND OF THE INVENTION For a synchronous communication system, it is important to implement clock synchronization between devices. Currently, a device usually adopts an interlock clock scheme of 1+1 or 1:1 hot backup, and the purpose is to use when the primary clock is abnormal and the standby clock output is normal. The device can switch to the alternate clock to ensure clock synchronization and reduce business impairments. The general device uses a phase-locked loop circuit to track and synchronize the external clock. However, the aging rate of the first analog phase-locked loop or the semi-analog half-digital phase-locked loop is high, and the fault caused by the phase-locked loop circuit device problem often occurs; second, whether the phase-locked loop circuit can realize synchronization and the lock The phase loop circuit and the clock source are related, it is difficult to judge whether the clock needs to be switched from the operating state of the phase locked loop. Thirdly, the performance detection of the phase locked loop circuit device generally needs to introduce a new detection circuit, which increases the cost of the device and New point of failure. In response to these problems, no effective solution has been proposed yet. SUMMARY OF THE INVENTION The present invention provides a clock protection method and apparatus to solve at least one of the above problems. According to an aspect of the present invention, a clock protection method is provided, including: determining the active/standby state of the current board; when the board is a standby board, determining whether the phase locked loop of the board is locked; When the ring is out of lock, it is judged whether the lockout timing exceeds the preset threshold. When the lockout timing does not exceed the threshold, it is judged whether the phase locked loop of the main board is locked. If the lock is lost, the board is switched to the main board. , clear the lockout timing. After determining whether the phase locked loop of the single board is locked, the method further includes: when the phase locked loop of the single board is locked, clearing the lost lock flag of the phase locked loop and clearing the lost lock timing; determining whether the lost lock timing exceeds the preset After the threshold, it also includes: When the loss of lock timing exceeds the threshold, continue to count. Before determining whether the lockout timing exceeds the preset threshold, the method further includes: determining whether the lockout flag has been set, if not set, then setting the lockout flag and starting to count the lockout timing, if it is set, determining the lockout Whether the timing exceeds the preset threshold. If the board is switched to the main board, the board is replaced with the default threshold. If the number of the master/slave switchovers is less than the predetermined threshold, the board is switched to the main board. Lock timing. After determining the active/standby status of the current board, the method further includes: When the board is the main board, determine whether the phase locked loop of the board is locked, and notify the standby board of the judgment result. Determine whether the phase-locked ring of the board is locked, and notify the backup board of the result of the judgment. The method includes: determining whether the phase-locked loop of the board of the main board is locked; if it is locked, determining whether the network management is mandatory, and when there is no network management, If the fault persists, the board is forcibly forced. If there is no fault, the board is forcibly determined. If the lock is lost, it is determined whether there is a network management force. If there is no network management force, cancel the pair. The mandatory of the board. According to another aspect of the present invention, a clock protection apparatus is provided, including: an active/standby determination module, configured to determine an active/standby state of a current board; and a standby board determination module, configured to determine when a board is a standby board Whether the phase-locked loop of the board is locked; the timing judgment module is set to determine whether the lockout timing exceeds the preset threshold when the phase-locked loop of the board is lost; the master-slave switchover module is set to not exceed the lockout timing. When the threshold is determined, it is determined whether the phase locked loop of the main board is locked, and when the phase locked loop of the main board loses lock, the board is switched to the main board, and the lockout timing board judgment module is cleared, and is also set to be in the single When the phase locked loop of the board is locked, the lockout flag of the phase locked loop is cleared and the lockout timing is cleared; the timing judgment module is also used to continue timing when the lockout timing exceeds the threshold. The device further includes: a setting judgment module, configured to determine whether the loss of lock flag has been set, and when the loss of lock flag is not set, the lock flag is lost and the statistics of the lockout timing is started, when the lockout flag is set. , activate the timing judgment module. The device further includes: a switching determination module, configured to determine, after the active/standby switching module determines that the phase locked loop of the main board is out of lock, determine whether the number of active/standby switching in the predetermined time period is less than a predetermined threshold, and when less than Activate the active/standby switchover module to switch the board to the main board and clear the lockout timing. The device further includes: a main board judging module, configured to determine whether the phase locked loop of the single board is locked when the board is the main board, and notify the standby board of the judgment result. The motherboard judging module includes: a state judging unit, configured to determine whether the phase locked loop of the board of the main board is locked; and the locking judging unit is configured to determine whether the network management is forced when the phase locked loop of the board is locked, If the board is faulty, the board is forcibly determined. If the board is faulty, the board is forcibly disabled. If there is no fault on the board, the board is forced. The lock loss judgment unit is set to be on the board. When the PLL is out of lock, it is determined whether there is a network management force. If there is no network management force, the board is forcibly disabled. The present invention is used to determine the state of the current board. When the current board is the standby board, according to whether the phase locked loop of the board is locked, whether the lockout timing exceeds the threshold threshold, and the lock of the current main board is used. If the phase loop is locked or not, it is determined whether the active/standby switchover is implemented. It is difficult to determine whether it is necessary to switch the clock from the operating state of the phase-locked loop and the need to introduce a new device for the phase-locked loop detection. Whether the fault point is the phase-locked loop circuit or the clock source, the protection switching when the clock is out of synchronization and the service is damaged due to the loss of the phase-locked loop is realized without adding an external device. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are set to illustrate,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 1 is a flowchart of a clock protection method according to an embodiment of the present invention; FIG. 2 is a flow of a backup board side of a clock protection method according to a preferred embodiment of the present invention; FIG. 3 is a flowchart according to a preferred embodiment of the present invention. FIG. 4 is a schematic diagram showing the functional structure of the active and standby boards according to an example of the present invention; FIG. 5 is a flow of the standby board side of the clock protection method according to an example of the present invention; Clock Protection Method Main Board Side Flow; FIG. 7 is a block diagram showing the structure of a clock protection apparatus according to an embodiment of the present invention. BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. 1 is a flow chart of a clock protection method in accordance with an embodiment of the present invention. As shown in FIG. 1 , the clock protection method according to the embodiment of the present invention includes: Step S102: determining the active/standby state of the current board; Step S104: When the board is a standby board, determining whether the phase locked loop of the board is locked; Step S106: When the phase locked loop of the board is out of lock, determine whether the lost lock timing exceeds a preset threshold; In step S108, when the lockout timing does not exceed the threshold, it is determined whether the phase locked loop of the main board is locked. If the lock is lost, the board is switched to the main board, and the lockout timing is cleared. The clock protection method provided in this embodiment further sets the lockout timing on the basis of the state of the phase-locked loop of the active and standby boards, and fully utilizes these parameters and their mutual relations to determine the master/slave switchover, so that the clockless control can be judged. The fault point is to realize the clock protection under the premise of the phase-locked loop circuit or the judgment of the clock source, and it is not necessary to add a new device. The foregoing embodiment provides a general clock protection method, which corresponds to an active/standby switchover in a normal situation. However, in reality, if the previous master/slave switchover fails or does not actually require special conditions such as active/standby switchover, the next master/slave switchover will be affected, so when this happens, the above parameters It needs to be adjusted accordingly. Preferably, after determining whether the phase locked loop of the single board is locked, the method further includes: when the phase locked loop of the single board is locked, clearing the unlocking flag of the phase locked loop and clearing the lost lock timing; After exceeding the preset threshold, the method may further include: when the loss of lock timing exceeds the threshold, continue to time. The preferred embodiment provides an adjustment method for the loss of lock flag (used to identify the current state of the phase locked loop) and the lockout timing in the above special case, which ensures the clock protection process in the loop, each time Clock protection can be successfully completed. Preferably, before determining whether the loss of lock timing exceeds a preset threshold, the method further includes: determining whether the loss of lock flag has been set, if not set, then setting the lockout flag and starting to count the loss of lock timing, if set Then, determine if the lockout timing exceeds the preset threshold. Since the clock protection method provided by the present invention is a cyclic execution method, in most cases, the lockout flag is set, but it is not excluded that the protection needs to be viewed at the beginning of the protection or the failure occurs. When the lock flag is displayed, the lock loss flag is not set. This preferred embodiment can solve this problem and ensure smooth clock protection. Preferably, the board is switched to the main board, and before the timing of the lockout is cleared, the method further includes: determining whether the number of active/standby switching times in the predetermined time period is less than a predetermined threshold, and if the value is smaller than Board, clear the lockout timing. The preferred embodiment further adds a parameter for whether to perform the active/standby switchover, that is, whether the number of active/standby switchovers in the predetermined time period is less than a predetermined threshold, and the above-mentioned judgment can prevent the occurrence of frequent switching, thereby further improving system stability. . The above preferred embodiment mainly provides a clock protection method on the standby board side, and the preferred embodiment provides a preferred main board side clock protection operation corresponding to the above preferred embodiment. Preferably, after determining the active/standby state of the current board, the method further includes: when the board is the main board, determining whether the phase locked loop of the board is locked, and notifying the standby board of the determination result. The main function of the main board in clock protection or active/standby switching is to provide its own various status parameters as the basis for judging whether to perform the active/standby switching. The most important one is whether the phase locked loop is locked. The manner in which the status of the main board phase locked loop is notified to the spare board is varied, either in a direct manner or in an indirect manner. The preferred embodiment provides a preferred embodiment. Preferably, determining whether the phase locked loop of the board of the main board is locked, and notifying the standby board of the judgment result may include: (1) determining whether the phase locked loop of the board of the main board is locked;
(2)如果锁定, 则判断是否有网管强制, 在没有网管强制时, 判断单板是否存在 故障, 如果存在故障, 则取消对单板的强制, 如果不存在故障, 则将单板置强制; (2) If it is locked, it is determined whether there is a network management force. If there is no network management force, it is determined whether the board is faulty. If there is a fault, the board is forcibly disabled. If there is no fault, the board is forced.
( 3 )如果失锁,则判断是否有网管强制,在没有网管强制时,取消对单板的强制。 网管强制是现有倒换机制中判断本板是主用板还是备用板的一个依据, 对应于网 管强制单板本身也具有一个是否被强制的属性, 本优选实施例就是利用这个现有的属 性, 通过这个属性通知备用板本板锁相环当前的状态, 置强制即锁相环锁定, 取消强 制即锁相环失锁。 综上, 上述优选实施例可以总结如下: 根据上述优选实施例的时钟保护方法备用板侧的流程, 如图 2所示, 包括: 步骤 S202, 主备状态判断, 当前单板为备用板; 步骤 S204, 判断单板锁相环的状态, 如果是锁定, 转至步骤 S206, 如果是失锁, 转至步骤 S208; 步骤 S206, 清除失锁标志, 失锁计时清零, 结束; 步骤 S208, 判断是否有失锁标志, 如果没有, 转至步骤 S210, 如果有, 转至步 骤 S212; 步骤 S210, 置失锁标志, 失锁计时开始; 步骤 S212,判断失锁计时是否超出门限, 如果是, 结束, 如果否,转至步骤 S214; 步骤 S214, 判断主用板是否失锁, 如果否, 结束, 如果是, 转至步骤 S216; 步骤 S216, 判断是否是频繁倒换, 如果是, 结束, 如果否, 转至步骤 S218; 步骤 S218, 本板抢到主用; 步骤 S220, 清除失锁标志, 结束。 根据上述优选实施例的时钟保护方法主用板侧的流程, 如图 3所示, 包括: 步骤 S302, 主备状态判断, 当前单板为主用板; 步骤 S304, 锁相环锁定状态判断; 步骤 S306, 更新主备判断条件状态; 步骤 S308, 将判断结果送给备用板。 下面结合实例对上述优选实施例进行详细说明。 本实例应用的环境, 如图 4所示, 包括: 主用板及备用板, 每块单板都包括: 锁 相环、 锁相环状态检测、 防频繁倒换、 时钟主备状态检测、 主备切换等功能实体。 首先, 介绍一下现有的倒换机制。 在现有的倒换机制中, 主用时钟板和备用时钟 板之间会互送几个状态线, 在位、 网管强制、 本板时钟 READY以及主备用状态, 这 几个状态按优先级排列, 时钟板根据这 4个信号来确定本板是主用还是备用。 接着, 本实例中将"锁相环失锁"加进原有的倒换机制, 原则是锁相环失锁的优先 级低于原来的倒换条件, 不会影响到原有的时钟保护倒换机制, 同时在因锁相环失锁 导致业务损坏的情况下进行主备时钟保护倒换。 根据本发明实例的时钟保护方法备用板侧的流程, 如图 5所示, 包括: 步骤 S502, 判断当前单板为备用板; 步骤 S504, 判断单板锁相环是否失锁, 如果否, 转至步骤 S506, 如果是, 转至 步骤 S508; 步骤 S506, 清除失锁标志, 失锁计时清零, 结束; 步骤 S508, 判断是否有失锁标志, 如果否, 转至步骤 S510, 如果是, 转至步骤 S512; 步骤 S510, 置失锁标志, 失锁计时开始; 步骤 S512, 判断失锁计时是否小于 30分钟, 如果否, 结束, 即备用板锁相环失 锁时间比主用板长, 判断备用板损坏, 不做倒换, 如果是, 转至步骤 S514; 步骤 S514, 判断对板是否为处于强制且本板 ready, 如果否, 结束, 如果是, 转 至步骤 S516; 步骤 S516, 判断 1小时内倒换次数是否小于 2次, 如果否, 结束, 防频繁倒换, 如果是, 转至步骤 S518; 步骤 S518, 本板抢到主用, 变为主用状态; 步骤 S520, 清除失锁标志, 结束。 根据本发明实例的时钟保护方法主用板侧的流程, 如图 6所示, 包括: 步骤 S602, 判断单板为主用板; 步骤 S604, 判断主用板锁相环状态, 如果是锁定状态, 转至步骤 S606, 如果是 失锁状态, 转至步骤 S614, 如果是锁定及失锁状态以外的其他状态, 结束; 步骤 S606, 判断是否有网管强制主备, 如果是, 结束, 如果否, 转至步骤 S608; 步骤 S608, 判断本板是否故障导致 noready, 如果是, 转至步骤 S610, 如果否, 转至步骤 S612; 步骤 S610, 本板取消强制, 结束; 步骤 S612, 本板置强制, 即利用现用的强制状态线表达"锁相环锁定"的含义, 同 时锁相环失锁的优先级低于原来的倒换条件, 结束; 步骤 S614, 判断是否网管强制本板是主用, 如果是, 结束, 如果否, 转至步骤 S616; 步骤 S616, 本板取消强制, 即利用现用的强制状态线表达"锁相环失锁"的含义, 同时锁相环失锁的优先级低于原来的倒换条件, 结束。 图 7是根据本发明实施例的时钟保护装置的结构框图。 如图 7所示, 根据本发明 实施例的时钟保护装置包括: 主备判断模块 72, 设置为判断当前单板的主备状态; 备板判断模块 74, 连接至主备判断模块 72, 设置为在单板是备用板时, 判断单板 的锁相环是否锁定; 计时判断模块 76, 连接至备板判断模块 74, 设置为在单板的锁相环失锁时, 判断 失锁计时是否超过预置的门限; 主备倒换模块 78, 连接至计时判断模块 76, 设置为在失锁计时没有超过门限时, 判断主用板的锁相环是否锁定, 并在主用板的锁相环失锁时, 将单板倒换为主用板, 清空失锁计时。 本实施例提供的时钟保护装置在主备板自身锁相环的状态的基础上, 进一步设置 了失锁计时, 充分利用了这些参数及其相互关系进行主备倒换的判断, 可以在不判断 故障点是锁相环电路还是时钟源的判断的前提下实现时钟保护, 且本实施例提供的时 钟保护装置在原有单板上即可建立, 不需要增加新的设备。 优选地, 根据本发明优选实施例的时钟保护装置中: 备板判断模块, 还设置为在单板的锁相环锁定时, 清空锁相环的失锁标志并将失 锁计时清零; 计时判断模块, 还设置为在失锁计时超过了门限时, 继续计时。 在本优选实施例中, 上述模块会在前一次的主备倒换失败了或者实际上不需要进 行主备倒换时等特殊情况发生时, 对失锁标志 (用于标识锁相环的当前状态) 及失锁 计时进行相应的调整, 保证了在循环进行的时钟保护过程中, 每一次的时钟保护都可 以成功完成。 优选地, 根据本发明优选实施例的时钟保护装置还可以包括: 置位判断模块, 设置为判断失锁标志是否已置位, 并在失锁标志没有置位时, 置 失锁标志并开始统计失锁计时, 在失锁标志已置位时, 激活计时判断模块。 在具体实施过程中, 在保护开始之初或出现故障等原因会导致在需要查看失锁标 志时出现失锁标志并未置位的情况, 本优选实施例增设的模块即可解决这一问题, 保 证时钟保护的顺利进行。 优选地, 根据本发明优选实施例的时钟保护装置还可以包括: 倒换判断模块, 设置为在主备倒换模块判断主用板的锁相环失锁后, 判断预定时 间段内的主备倒换的次数是否小于预定的阈值, 并在小于时, 激活主备倒换模块将单 板倒换为主用板, 清空失锁计时。 本优选实施例增设的模块可防止频繁倒换的发生, 进一步提高系统稳定性。 优选地, 根据本发明优选实施例的时钟保护装置还可以包括: 主板判断模块, 设置为在单板为主用板时, 判断单板的锁相环是否锁定, 并将判 断结果通知备用板。 主用板在时钟保护或者说主备倒换中的主要作用就是提供其本身的各种状态参 数, 作为判断是否进行主备倒换的依据, 其中最重要的就是其锁相环是否锁定。 本优 选实施例增设的模块的作用就在于获取这一参数, 并提供给备用板。 优选地, 上述主板判断模块, 可以包括: 状态判断单元, 设置为判断为主用板的单板的锁相环是否锁定; 锁定判断单元, 连接至状态判断单元, 设置为在单板的锁相环锁定时, 判断是否 有网管强制, 在没有网管强制时, 判断单板是否存在故障, 在单板存在故障时, 取消 对单板的强制, 在单板不存在故障时, 将单板置强制; 失锁判断单元, 连接至状态判断单元, 设置为在单板的锁相环失锁时, 判断是否 有网管强制, 在没有网管强制时, 取消对单板的强制。 网管强制是现有倒换机制中判断本板是主用板还是备用板的一个依据, 对应于网 管强制单板本身也具有一个是否被强制的属性, 本优选实施例就是利用这个现有的属 性, 通过这个属性通知备用板本板锁相环当前的状态, 置强制即锁相环锁定, 取消强 制即锁相环失锁。 从以上的描述中,可以看出,本发明提供的技术方案规避了对故障点是锁相环(电 路) 还是时钟源的判断, 且不增加外部检测设备 (电路) 即可实现因锁相环失锁引起 时钟不同步、 业务损伤时的保护倒换。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以用通用 的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多个计算装置所 组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码来实现, 从而, 可以 将它们存储在存储装置中由计算装置来执行, 并且在某些情况下, 可以以不同于此处 的顺序执行所示出或描述的步骤, 或者将它们分别制作成各个集成电路模块, 或者将 它们中的多个模块或步骤制作成单个集成电路模块来实现。 这样, 本发明不限制于任 何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。 (3) If the lock is lost, it is judged whether there is a network management force. If there is no network management force, the board is forcibly cancelled. The network management is a basis for determining whether the board is the primary board or the standby board in the existing switching mechanism. The mandatory board itself has an attribute that is mandatory. The preferred embodiment uses this existing attribute. Use this attribute to inform the standby board of the current state of the phase-locked loop of the board, and set the forced phase-locked loop lock, and cancel the forcing, that is, the phase-locked loop loses lock. In summary, the foregoing preferred embodiments can be summarized as follows: The process of the backup board side of the clock protection method according to the above-mentioned preferred embodiment, as shown in FIG. 2, includes: Step S202, determining the active/standby state, the current board is a standby board; S204, determining the state of the single-phase locked loop, if it is locked, go to step S206, if it is lost, go to step S208; step S206, clear the lost lock flag, the lockout timing is cleared, and the end; step S208, determine Whether there is a lockout flag, if not, go to step S210, if yes, go to step S212; step S210, lose the lock flag, and the lockout timing starts; Step S212, determining whether the lost lock timing exceeds the threshold, and if so, ending, if no, go to step S214; step S214, determine whether the main board is out of lock, if not, end, if yes, go to step S216; step S216 And determining whether it is frequent switching, if yes, ending, if no, go to step S218; step S218, the board grabs the main use; step S220, clear the lost lock flag, and ends. The process of the main board side of the clock protection method according to the above preferred embodiment, as shown in FIG. 3, includes: Step S302: The active/standby state determines that the current board is the main board; Step S304, the phase locked loop lock state is judged; Step S306, the status of the master/slave determination condition is updated; in step S308, the result of the determination is sent to the standby board. The above preferred embodiments will be described in detail below with reference to examples. The environment of the application, as shown in Figure 4, includes: the main board and the standby board. Each board includes: phase-locked loop, phase-locked loop status detection, anti-frequent switching, clock active/standby status detection, active/standby Switch functions and other functional entities. First, introduce the existing switching mechanism. In the existing switching mechanism, several status lines are sent between the active clock board and the standby clock board. The in-position, the network management force, the local clock READY, and the primary standby state are arranged in priority order. The clock board determines whether the board is active or standby based on these four signals. Then, in this example, the "phase-locked loop lost lock" is added to the original switching mechanism. The principle is that the priority of the phase-locked loop loss is lower than the original switching condition, and the original clock protection switching mechanism is not affected. At the same time, the active/standby clock protection switching is performed when the service is damaged due to the loss of the lock of the phase locked loop. The flow of the backup board side of the clock protection method according to the example of the present invention, as shown in FIG. 5, includes: Step S502: determining that the current board is a standby board; Step S504, determining whether the phase locked loop of the board is out of lock, if not, turning Go to step S506, if yes, go to step S508; step S506, clear the lockout flag, clear the lockout timing, and end; Step S508, determining whether there is a loss of lock flag, if not, proceeding to step S510, if yes, proceeding to step S512; step S510, setting the lockout flag, the lockout timing begins; step S512, determining whether the lockout timing is less than 30 minutes If no, the end, that is, the standby board phase lock loop loss time is longer than the main board, it is judged that the spare board is damaged, and no switching is performed. If yes, go to step S514; Step S514, determine whether the board is mandatory and If yes, go to step S516; step S516, determine whether the number of times of switching within 1 hour is less than 2 times, if no, end, prevent frequent switching, if yes, go to step S518; step S518, The board grabs the main use and becomes the main use state; in step S520, the lost lock flag is cleared, and the end is completed. The process of the main board side of the clock protection method according to the example of the present invention, as shown in FIG. 6, includes: Step S602, determining that the board is the main board; Step S604, judging the state of the main board phase locked loop, if it is the locked state Go to step S606, if it is in an unlocked state, go to step S614, if it is a state other than the locked and unlocked state, end; step S606, determine whether there is a network management mandatory active/standby, if yes, end, if no, Go to step S608; Step S608, determine whether the board is faulty and cause noready, if yes, go to step S610, if no, go to step S612; step S610, the board cancels forcing, ends; step S612, the board is forced, That is, the meaning of the "phase locked loop lock" is expressed by using the active forced state line, and the priority of the lock of the phase locked loop is lower than the original switching condition, and the process ends; step S614, determining whether the network management force the board is the main use, if If yes, go to step S616; in step S616, the board cancels the forcing, that is, the meaning of the "phase-locked loop lost lock" is expressed by the active state line, and the phase-locked loop loses lock. Lower priority than the original switching conditions, the end. FIG. 7 is a block diagram showing the structure of a clock protection apparatus according to an embodiment of the present invention. As shown in FIG. 7, the clock protection apparatus according to the embodiment of the present invention includes: an active/standby determination module 72, configured to determine the active/standby state of the current board; the standby board determination module 74 is connected to the active/standby determination module 72, and is set to When the board is a standby board, it is determined whether the phase locked loop of the board is locked. The timing determining module 76 is connected to the standby board determining module 74, and is configured to determine whether the lost lock timing exceeds when the phase locked loop of the board is lost. The preset threshold; the active/standby switching module 78 is connected to the timing determining module 76, and is set to determine whether the phase locked loop of the main board is locked when the loss of lock timing does not exceed the threshold, and the phase locked loop of the main board is lost. When the lock is locked, the board is switched to the main board, and the lost lock timing is cleared. The clock protection device provided in this embodiment further sets the lockout timing on the basis of the state of the phase-locked loop of the main and standby boards, and fully utilizes these parameters and their mutual relations to determine the master/slave switchover, which can be judged without failure. The clock protection is implemented on the premise of the phase-locked loop circuit or the clock source. The clock protection device provided in this embodiment can be established on the original board without adding new equipment. Preferably, in the clock protection device according to the preferred embodiment of the present invention, the standby board judging module is further configured to clear the lockout flag of the phase locked loop and clear the lockout timing when the phase locked loop of the single board is locked; The judging module is also set to continue counting when the lockout timing exceeds the threshold. In the preferred embodiment, the module may lose the lock flag (used to identify the current state of the phase locked loop) when a previous failure occurs in the active/standby switchover or when the active/standby switchover is not actually required. And the lockout timing is adjusted accordingly, ensuring that every clock protection can be successfully completed during the cyclic clock protection process. Preferably, the clock protection apparatus according to the preferred embodiment of the present invention may further include: a setting judgment module configured to determine whether the loss of lock flag has been set, and when the loss of lock flag is not set, the lock flag is lost and statistics are started. Loss of lock timing, activates the timing determination module when the loss of lock flag is set. In the specific implementation process, the reason that the protection start or the failure occurs may cause the lockout flag to be unset when the lockout flag needs to be viewed, and the added module of the preferred embodiment can solve the problem. Ensure that the clock protection goes smoothly. Preferably, the clock protection apparatus according to the preferred embodiment of the present invention may further include: a switching determination module, configured to determine, after the active/standby switching module determines that the phase locked loop of the main board is out of lock, determine the active/standby switching in the predetermined time period If the number of times is less than the predetermined threshold, the active/standby switchover module is activated to switch the board to the active board and the lockout timing is cleared. The added module of the preferred embodiment can prevent the occurrence of frequent switching and further improve the stability of the system. Preferably, the clock protection device according to the preferred embodiment of the present invention may further include: a mainboard judging module configured to determine whether the phase locked loop of the single board is locked when the board is the main board, and notifying the standby board of the determination result. The main function of the main board in clock protection or active/standby switching is to provide its own various status parameters as the basis for judging whether to perform the active/standby switching. The most important one is whether the phase locked loop is locked. The function of the additional module of the preferred embodiment is to obtain this parameter and provide it to the spare board. Preferably, the motherboard determining module may include: a state determining unit configured to determine whether a phase locked loop of the board of the main board is locked; a locking determining unit connected to the state determining unit, configured to be locked in the board When the ring is locked, it is determined whether the network management is mandatory. If there is no network management force, the board is faulty. If the board is faulty, the board is forcibly disabled. The lock-off judgment unit is connected to the state judgment unit, and is set to determine whether the network management is forcible when the phase-locked loop of the board is out of lock, and the board is forcibly disabled when there is no network management force. The network management is a basis for determining whether the board is the primary board or the standby board in the existing switching mechanism. The mandatory board itself has an attribute that is mandatory. The preferred embodiment uses this existing attribute. Use this attribute to inform the standby board of the current state of the phase-locked loop of the board, and set the forced phase-locked loop lock, and cancel the forcing, that is, the phase-locked loop loses lock. From the above description, it can be seen that the technical solution provided by the present invention avoids the judgment of whether the fault point is a phase-locked loop (circuit) or a clock source, and the phase-locked loop can be realized without adding an external detecting device (circuit). Loss of lock causes protection of the clock when the clock is not synchronized and the service is damaged. Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims

权 利 要 求 书 Claims
1. 一种时钟保护方法, 包括: 1. A method of clock protection, comprising:
判断当前单板的主备状态;  Determine the active/standby status of the current board.
在所述单板是备用板时, 判断所述单板的锁相环是否锁定; 在所述单板的锁相环失锁时, 判断失锁计时是否超过预置的门限; 在所述失锁计时没有超过所述门限时, 判断主用板的锁相环是否锁定, 如 果失锁, 则将所述单板倒换为主用板, 清空所述失锁计时。  When the board is a standby board, determining whether the phase locked loop of the board is locked; when the phase locked loop of the board is out of lock, determining whether the lockout timing exceeds a preset threshold; If the lock timing does not exceed the threshold, it is determined whether the phase locked loop of the main board is locked. If the lock is lost, the board is switched to the main board, and the lost lock timing is cleared.
2. 根据权利要求 1所述的方法, 其中, 2. The method according to claim 1, wherein
在判断所述单板的锁相环是否锁定之后还包括:  After determining whether the phase locked loop of the board is locked, the method further includes:
在所述单板的锁相环锁定时, 清空锁相环的失锁标志并将所述失锁计时清 零;  When the phase locked loop of the single board is locked, the lost lock flag of the phase locked loop is cleared and the lost lock timing is cleared;
在判断所述失锁计时是否超过预置的门限之后还包括:  After determining whether the loss of lock timing exceeds a preset threshold, the method further includes:
在所述失锁计时超过了所述门限时, 继续计时。  When the lost lock timing exceeds the threshold, the timing is continued.
3. 根据权利要求 1所述的方法, 其中, 在判断所述失锁计时是否超过预置的门限 之前还包括: 3. The method according to claim 1, wherein before determining whether the loss of lock timing exceeds a preset threshold, the method further comprises:
判断所述失锁标志是否已置位, 如果没有置位, 则置所述失锁标志并开始 统计所述失锁计时, 如果已置位, 则判断所述失锁计时是否超过预置的门限。  Determining whether the loss of lock flag has been set, if not set, setting the loss of lock flag and starting to count the lockout timing, if it is set, determining whether the lockout timing exceeds a preset threshold .
4. 根据权利要求 1所述的方法, 其中, 在将所述单板倒换为主用板, 清空所述失 锁计时之前还包括: The method according to claim 1, wherein before the board is switched to the main board, before the timing of the lockout is cleared, the method further includes:
判断预定时间段内的主备倒换的次数是否小于预定的阈值, 如果小于, 则 将所述单板倒换为主用板, 清空所述失锁计时。  It is determined whether the number of active/standby switchovers in the predetermined time period is less than a predetermined threshold. If the value is less than, the board is switched to the main board, and the lockout timing is cleared.
5. 根据权利要求 1至 4任一项所述的方法, 其中, 在判断当前单板的主备状态之 后还包括: The method according to any one of claims 1 to 4, further comprising: after determining the active/standby state of the current board:
当所述单板为主用板时, 判断所述单板的锁相环是否锁定, 并将判断结果 通知备用板。 根据权利要求 5所述的方法, 其中, 判断所述单板的锁相环是否锁定, 并将判 断结果通知备用板包括: When the board is the main board, it is determined whether the phase locked loop of the board is locked, and the judgment result is notified to the standby board. The method according to claim 5, wherein determining whether the phase locked loop of the board is locked, and notifying the result of the determination to the standby board includes:
判断为主用板的所述单板的锁相环是否锁定;  Determining whether the phase locked loop of the single board of the main board is locked;
如果锁定, 则判断是否有网管强制, 在没有网管强制时, 判断所述单板是 否存在故障, 如果存在故障, 则取消对所述单板的强制, 如果不存在故障, 则 将所述单板置强制;  If it is locked, it is determined whether there is a network management force. If there is no network management force, the board is determined to be faulty. If there is a fault, the board is forcibly disabled. Forced
如果失锁, 则判断是否有网管强制, 在没有网管强制时, 取消对所述单板 的强制。 一种时钟保护装置, 包括:  If the lock is lost, it is determined whether there is a network management force. If there is no network management force, the card is forcibly cancelled. A clock protection device includes:
主备判断模块, 设置为判断当前单板的主备状态;  The master/slave judgment module is configured to determine the active/standby status of the current board.
备板判断模块, 设置为在所述单板是备用板时, 判断所述单板的锁相环是 否锁定;  The standby board determining module is configured to determine whether the phase locked loop of the single board is locked when the board is a standby board;
计时判断模块, 设置为在所述单板的锁相环失锁时, 判断失锁计时是否超 过预置的门限;  The timing judging module is configured to determine whether the lockout timing exceeds a preset threshold when the phase locked loop of the board is out of lock;
主备倒换模块, 设置为在所述失锁计时没有超过所述门限时, 判断主用板 的锁相环是否锁定, 并在所述主用板的锁相环失锁时, 将所述单板倒换为主用 板, 清空所述失锁计时。 根据权利要求 7所述的装置, 其中, 备板判断模块, 还设置为在所述单板的锁相环锁定时, 清空锁相环的失锁 标志并将所述失锁计时清零;  The master/slave switching module is configured to determine whether the phase locked loop of the main board is locked when the lockout timing does not exceed the threshold, and when the phase locked loop of the main board loses lock, the single The board is switched to the main board, and the lost lock timing is cleared. The apparatus according to claim 7, wherein the standby board determining module is further configured to clear the lockout flag of the phase locked loop and clear the lockout timing when the phase locked loop of the single board is locked;
计时判断模块, 还设置为在所述失锁计时超过了所述门限时, 继续计时。 根据权利要求 7所述的装置, 其中, 还包括: 置位判断模块, 设置为判断所述失锁标志是否已置位, 并在所述失锁标志 没有置位时, 置所述失锁标志并开始统计所述失锁计时, 在所述失锁标志已置 位时, 激活所述计时判断模块。 根据权利要求 7所述的装置, 其中, 还包括: 倒换判断模块, 设置为在所述主备倒换模块判断所述主用板的锁相环失锁 后, 判断预定时间段内的主备倒换的次数是否小于预定的阈值, 并在小于时, 激活所述主备倒换模块将所述单板倒换为主用板, 清空所述失锁计时。 The timing determination module is further configured to continue counting when the loss of lock timing exceeds the threshold. The apparatus according to claim 7, further comprising: a setting judgment module configured to determine whether the loss of lock flag has been set, and setting the lockout flag when the loss of lock flag is not set And starting to count the loss of lock timing, when the loss of lock flag has been set, the timing determination module is activated. The apparatus according to claim 7, further comprising: a switching determination module, configured to determine an active/standby switchover within a predetermined time period after the active/standby switchover module determines that the phase locked loop of the main board is out of lock The number of times is less than a predetermined threshold, and when the number is less than, the active/standby switching module is activated to switch the board to the main board, and the lost lock timing is cleared.
11. 根据权利要求 7至 10任一项所述的装置, 其中, 还包括: 主板判断模块, 设置为在所述单板为主用板时, 判断所述单板的锁相环是 否锁定, 并将判断结果通知备用板。 The apparatus according to any one of claims 7 to 10, further comprising: a main board judging module, configured to determine whether the phase locked loop of the single board is locked when the board is a main board The result of the judgment is notified to the standby board.
12. 根据权利要求 11所述的装置, 其中, 所述主板判断模块包括: The device according to claim 11, wherein the motherboard determining module comprises:
状态判断单元, 设置为判断为主用板的所述单板的锁相环是否锁定; 锁定判断单元,设置为在所述单板的锁相环锁定时,判断是否有网管强制, 在没有网管强制时, 判断所述单板是否存在故障, 在所述单板存在故障时, 取 消对所述单板的强制, 在所述单板不存在故障时, 将所述单板置强制;  The state judging unit is configured to determine whether the phase locked loop of the board of the main board is locked. The lock judging unit is configured to determine whether the network management is forced when the phase locked loop of the board is locked, and there is no network management If the board is faulty, the card is forcibly determined. If the board is faulty, the board is forcibly disabled.
失锁判断单元,设置为在所述单板的锁相环失锁时,判断是否有网管强制, 在没有网管强制时, 取消对所述单板的强制。  The lockout determination unit is configured to determine whether the network management is forcible when the phase-locked loop of the board is out of lock, and the forcing of the board is cancelled when there is no network management force.
PCT/CN2012/076823 2011-08-23 2012-06-13 Clock protection method and device WO2013026307A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110243089.0A CN102957552B (en) 2011-08-23 2011-08-23 clock protection method and device
CN201110243089.0 2011-08-23

Publications (1)

Publication Number Publication Date
WO2013026307A1 true WO2013026307A1 (en) 2013-02-28

Family

ID=47745896

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/076823 WO2013026307A1 (en) 2011-08-23 2012-06-13 Clock protection method and device

Country Status (2)

Country Link
CN (1) CN102957552B (en)
WO (1) WO2013026307A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104796272B (en) * 2014-01-16 2018-11-23 中国移动通信集团广东有限公司 The monitoring method and device of network clocking

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5260979A (en) * 1991-05-28 1993-11-09 Codex Corp. Circuit and method of switching between redundant clocks for a phase lock loop
CN1324148A (en) * 2000-07-11 2001-11-28 深圳市中兴通讯股份有限公司 Jitter-free change-over method and device for main and stand-by units capable of being hot plugged and unplugged in digital communication system
CN1383287A (en) * 2001-04-26 2002-12-04 深圳市中兴通讯股份有限公司 Automatic-protecting switching device for multi-point clock synchronizing system
JP3631606B2 (en) * 1998-02-23 2005-03-23 埼玉日本電気株式会社 Clock switching circuit for communication equipment
CN101719837A (en) * 2009-11-25 2010-06-02 华为技术有限公司 Clock board, network system suitable for server and clock switching method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100282410B1 (en) * 1998-09-07 2001-02-15 서평원 System clock board
CN1655455B (en) * 2004-02-10 2010-04-28 中兴通讯股份有限公司 Method and apparatus for handling reversion of primary and secondary clock systems
CN101547053A (en) * 2008-03-28 2009-09-30 华为技术有限公司 Clock-switching method and clock-generating device
CN101958762B (en) * 2009-07-14 2014-08-13 中兴通讯股份有限公司 Main and standby clock switching device and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5260979A (en) * 1991-05-28 1993-11-09 Codex Corp. Circuit and method of switching between redundant clocks for a phase lock loop
JP3631606B2 (en) * 1998-02-23 2005-03-23 埼玉日本電気株式会社 Clock switching circuit for communication equipment
CN1324148A (en) * 2000-07-11 2001-11-28 深圳市中兴通讯股份有限公司 Jitter-free change-over method and device for main and stand-by units capable of being hot plugged and unplugged in digital communication system
CN1383287A (en) * 2001-04-26 2002-12-04 深圳市中兴通讯股份有限公司 Automatic-protecting switching device for multi-point clock synchronizing system
CN101719837A (en) * 2009-11-25 2010-06-02 华为技术有限公司 Clock board, network system suitable for server and clock switching method

Also Published As

Publication number Publication date
CN102957552A (en) 2013-03-06
CN102957552B (en) 2017-03-15

Similar Documents

Publication Publication Date Title
CN103684941B (en) Cluster based on arbitrating server splits brain preventing method and device
US10181919B2 (en) Synchronization method, controller, synchronization node, synchronous network, and storage medium
CN101150430A (en) A method for realizing network interface board switching based heartbeat mechanism
CN100499505C (en) An Ethernet protection method and apparatus
KR20120120413A (en) Method for detecting a synchronization failure of a transparent clock and related protection schemes
CN102006189A (en) Primary access server determination method and device for dual-machine redundancy backup
WO2014034345A1 (en) Vehicle control system, and vehicular electronic control unit
WO2013170736A1 (en) Packet network synchronization method, apparatus and system
CN102263663A (en) Double-network management server data maintenance method
WO2015165192A1 (en) Time synchronization method and device
WO2016095344A1 (en) Link switching method and device, and line card
CN103986649A (en) Border gateway protocol smooth restart method and routing equipment
WO2016086582A1 (en) Signal detection method and device
WO2020052687A1 (en) Network element anti-looping method and apparatus, device, and readable storage medium
WO2013023538A1 (en) Synchronization network clock maintenance method and device
WO2014000545A1 (en) Active/standby switching condition updating method, apparatus, server, and system
WO2009015593A1 (en) System upgrade method, upgrade system and monitoring entity
WO2013026307A1 (en) Clock protection method and device
CN101783770A (en) Method and system for processing message, service processing board and circuit processing board
CN103297279A (en) Switching method of main and backup single disks of software control in multi-software process system
WO2016065751A1 (en) Method for recovering link communication, service line card and system
WO2014032503A1 (en) Service protection method and system for composite link
CN101719837A (en) Clock board, network system suitable for server and clock switching method
WO2014086254A1 (en) Clock protection method and system and related ordinary clock device
CN107229305A (en) A kind of method of system clock lossless switching

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

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

Country of ref document: EP

Kind code of ref document: A1