WO2017152540A1 - Time source selection method and device - Google Patents

Time source selection method and device Download PDF

Info

Publication number
WO2017152540A1
WO2017152540A1 PCT/CN2016/086911 CN2016086911W WO2017152540A1 WO 2017152540 A1 WO2017152540 A1 WO 2017152540A1 CN 2016086911 W CN2016086911 W CN 2016086911W WO 2017152540 A1 WO2017152540 A1 WO 2017152540A1
Authority
WO
WIPO (PCT)
Prior art keywords
time source
time
source signal
protocol
pulse
Prior art date
Application number
PCT/CN2016/086911
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 WO2017152540A1 publication Critical patent/WO2017152540A1/en

Links

Images

Classifications

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

Definitions

  • the present application relates to, but is not limited to, the field of communications, and in particular, to a time source selection method and apparatus.
  • 3G (TD-SCDMA and CDMA2000) base stations and 4G base stations require time synchronization.
  • the base station should give priority to selecting the satellite receiver for air calibration.
  • the ground time can be used.
  • the ground time can also be used as the redundant backup of the air time.
  • the base station immediately Switch to ground timing.
  • the ground timing requires the establishment of a time synchronization network, and all nodes from the time source to the base station require time synchronization.
  • the standards for domestic and international time synchronization have gradually improved, and operators have gradually required networked devices to have high-precision time synchronization.
  • the time synchronization interface includes at least two types of time protocol interfaces.
  • the time synchronization device usually supports at least two interfaces.
  • the related method is to select an optimal time source from each time protocol interface separately, and determine a time source from the selected optimal time source through configuration, so that the device cannot automatically select.
  • An optimal time source is generated, which affects the accuracy and reliability of time synchronization.
  • a multi-protocol interface scenario shows that device D has three time sources.
  • A provides time synchronization through the PTP (Precision Time Protocol) interface.
  • B and C pass 1PPS+TOD (l pulse per The second&Time of Day interface provides time synchronization.
  • the PTP interface utilizes the transmission time of the Ethernet packet, which is suitable for long-distance transmission and can be used for inter-office and intra-office time allocation.
  • the 1PPS+TOD interface is suitable for short-distance transmission and can only be used for intra-office time allocation.
  • the 1PPS second pulse is The 1HZ clock signal uses the rising edge as the on-time edge, the TOD message indicates the current 1PPS rising edge time, and the ToD protocol message transmission frequency is once per second.
  • Multiple time sources of the PTP interface can select the optimal time source through the BMC algorithm (Best Master Clock Algorithm). Multiple time sources of the 1PPS+TOD interface can pass the information of the second pulse state and default priority. The optimal time source is selected. However, for the optimal time source of the 1PPS+TOD interface and the PTP interface, the optimal time source of one system cannot be automatically selected because of different parameters in the information, and thus cannot be transmitted to other time synchronization devices. Optimal time source.
  • the main technical problem to be solved by the embodiments of the present invention is to provide a time source selection method and device, so as to solve the problem that multiple types of interfaces in the related art can work simultaneously, and an optimal time source signal cannot be automatically selected for time transmission, thereby Technical issues that affect the efficiency and accuracy of time synchronization.
  • a time source selection method including:
  • the time source signal including a time source signal of a precise time protocol, or a time source signal including a precise time protocol and a time source signal of a second pulse + day time protocol.
  • the time source signal of the precise time protocol is converted to a time source signal of a second pulse + day time protocol.
  • a path is selected from the obtained time source signals of one or more seconds pulse + day time protocol as the system optimal time source signal.
  • the system optimal time source signal is output as a synchronous time source signal.
  • converting the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol comprises:
  • the optimal time source signal is selected from the received time source signals of at least two precise time protocols.
  • the optimal time source signal is converted to a time source signal of the second pulse + day time protocol.
  • the target time protocol is one of the multiple time protocols, or one of the multiple time protocols.
  • converting the time source signal of the precise time protocol into the time source signal of the second pulse + day time protocol further includes:
  • the time source signal of the received one or more precise time protocol is directly converted into a time source signal of the second pulse + day time protocol.
  • selecting one of the obtained time source signals of one or more seconds pulse + day time protocol as the system optimal time source signal includes:
  • One of the time source signals of the effective one-way or multi-channel second pulse + day time protocol is selected as the optimal time source signal of the system.
  • the method further includes: after selecting one of the time source signals obtained from the one or more seconds pulse + day time protocol as the system optimal time source signal, and selecting the optimal time source of the system Before the signal is output as the synchronous time source signal, delay compensation processing is performed on the optimal time source signal of the system.
  • a time source selection device includes: a receiving module, a conversion module, a selection module, and an output module.
  • the receiving module is configured to receive at least two time source signals, wherein the time source signal includes a time source signal of a precise time protocol, or a time source signal including a precise time protocol and a time source signal of a second pulse + day time protocol.
  • a conversion module configured to convert the time source signal of the precise time protocol into a time source signal of a second pulse + day time protocol.
  • the selection module is configured to select one of the time source signals of the obtained one or more seconds pulse + day time protocol as the system optimal time source signal.
  • the output module is configured to output the optimal time source signal of the system as a synchronous time source signal.
  • the conversion module includes: a first selection submodule and a first conversion submodule.
  • the conversion module converts the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol, including:
  • the first selection sub-module is configured to select an optimal time source signal from the received time source signals of at least two precise time protocols.
  • the first conversion sub-module is configured to convert the optimal time source signal into a time source signal of the second pulse + day time protocol.
  • the conversion module further includes: a second conversion submodule.
  • Converting, by the conversion module, the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol further includes:
  • the second conversion submodule is configured to directly convert the received time source signal of one or more precise time protocols into a time source signal of the second pulse + day time protocol.
  • the selection module includes: a detection submodule and a second selection submodule.
  • the detection sub-module is configured to detect the validity of the obtained time source signal of one or more seconds pulse + day time protocol.
  • the second selection submodule is configured to select one of the time source signals of the effective one or more second pulse + day time protocol as the optimal time source signal of the system.
  • the device further includes a delay compensation module; the delay compensation module is disposed between the selection module and the output module.
  • a delay compensation module configured to select, after the selection module selects one of the obtained one or more second pulse + day time protocol time source signals as the system optimal time source signal, and the output module Before the system optimal time source signal is output as the synchronous time source signal, delay compensation processing is performed on the optimal time source signal of the system.
  • a computer readable storage medium storing computer executable instructions for implementing the time source selection method when executed by a processor.
  • An embodiment of the present invention provides a time source selection method, including: receiving at least two time source signals, where the time source signal includes a time source signal of a PTP protocol, or a time source signal including a PTP protocol and a 1PPS+TOD protocol.
  • Time source signal ; converting the time source signal of the received PTP protocol into a time source signal of the 1PPS+TOD protocol, and selecting one of the time source signals of the obtained one or more 1PPS+TOD protocols as the system optimal time source signal.
  • the optimal time source signal of the system is output, so that the device can automatically select an optimal time source signal for time transmission when multiple types of interfaces work simultaneously.
  • the optimal time source can only be selected from the time source signals of each time protocol, and the automatic selection cannot be performed for different types of time sources, thereby reducing the efficiency and reliability of time synchronization.
  • the time source selection method provided by the embodiment of the present invention can select an optimal time source signal for the time source signal with different time protocols, and automatically select one when the selected optimal time source signal quality is reduced. Time source with better signal quality and switching, optionally improving the accuracy of time synchronization.
  • FIG. 1 is a schematic diagram of a multi-protocol interface scenario according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a time source selection method according to Embodiment 1 of the present invention.
  • FIG. 3 is a flowchart of a time source selection method based on a 1PPS+TOD interface according to Embodiment 1 of the present invention
  • FIG. 4 is a schematic diagram of a time source selection apparatus according to Embodiment 2 of the present invention.
  • FIG. 5 is a schematic diagram of a time source selection device based on a 1PPS+TOD interface according to Embodiment 2 of the present invention.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • the embodiment of the present invention provides a time source selection method. Please refer to the flowchart of the time source selection method shown in FIG. 2 .
  • the flow of the time source selection method includes steps S201-S204:
  • time source signal includes a time source signal of a PTP protocol, or a time source signal including a PTP protocol and a time source signal of a 1PPS+TOD protocol.
  • the time source signals include but are not limited to the time source signal of the PTP protocol and the time source signal of the 1PPS+TOD protocol.
  • the above process can also be used to unify each type of time source signal into one type. And then select the optimal time source signal to complete the time synchronization.
  • the time source signals of various time protocol types are unified in type, and the most accurate time source signal is automatically selected to complete time synchronization, thereby preventing the device from being configured for different interfaces.
  • a signal is automatically reselected. The better quality time source is synchronized to deliver the optimal time source for other time synchronization devices.
  • the interface supporting the different time protocols has two processing modes: one is to select an optimal time source signal from the time source signals of the PTP protocol, and then The optimal time source signal is converted into a time source signal of the second pulse + day time protocol, thereby reducing the signal conversion process; the other is directly converting the received time source signal of at least one precise time protocol into a second pulse + day time.
  • the time source signal of the protocol does not need to select the optimal time source signal, thereby ensuring more accurate selection of the optimal time source signal of the system. For the above two treatment methods, reasonable selection can be made according to actual needs.
  • step S203 before selecting one of the time source signals of the obtained one or more channels of the 1PPS+TOD protocol as the optimal time source signal of the system, it is necessary to detect the validity of each time source signal.
  • the time source signal When a time source signal is detected to be absent or abnormal, the time source signal will not be used as a candidate time source for the optimal system time source signal.
  • the time source signal When the detected time source signal is valid, the time source signal may be As the optimal system time source signal.
  • an optimal system time source signal is periodically selected from the plurality of valid time source signals according to the parameter information carried by the 1PPS+TOD protocol.
  • the selection criteria specified by the 1PPS+TOD protocol include, but are not limited to, the second pulse state, the default priority, etc., and comprehensively consider the optimal one-way time source signal.
  • the optimal source is arbitrated according to the default priority. For example, when the optimal 1PPS+TOD time source signal selection is performed, the second pulse state is arranged in descending order of 0x00>0x01>0x05>0x03>0x04>0x02, and the highest is the optimal candidate source. If there are equal seconds pulse states The candidate source arbitrates the optimal 1PPS+TOD time source signal according to the default priority. Therefore, the system optimal time source signal selection process is:
  • the time source signal with the highest default priority is selected from the multiple valid time source signals. If the default priorities of the at least two time source signals are the same and the highest, the time source with the same default priority is the highest. The time source signal with the best second pulse state is selected as the optimal time source signal of the system.
  • the above selection process is not unique, and the second pulse state can be judged first, and then the default priority can be judged, and the judgment can be made at the same time. For other parameters, the above selection process can also be used.
  • the system optimal time source signal is reselected and automatically switched to the newly selected system optimal time source signal; similarly, if the selected system is the most If the quality of the excellent time source signal is improved, then the system optimal time source is reselected. Number and automatically switch. In addition, if all of the time source signals entered are invalid, then no output time is selected or the output time is not available.
  • the method further includes: delaying compensation of the selected optimal time source signal after selecting the optimal system time source signal and outputting the optimal system time source signal as the synchronous time source signal deal with. Because of the fixed error introduced inside the processing device (which is usually caused by the chip or the trace), it is necessary to perform delay compensation processing on the system time source signal to reduce the fixed error.
  • step S204 when the system optimal time source signal after the delay compensation processing is output, firstly, it is determined by which time protocol type interface output of the optimal time source signal of the system, if the optimal time source signal of the system is If the time protocol type does not match the time protocol type of the output interface, the system optimal time source signal of the target time protocol is converted into a time protocol supported by the output interface, and is output as a synchronous time source signal.
  • This embodiment describes a time source selection method based on the 1PPS+TOD protocol in detail with reference to FIG. 3.
  • the PTP input interface and the PTP output interface are software interfaces, and both have the following features:
  • PTP input interface 1) Implement the PTP slave status function, and periodically exchange PTP protocol packets with the upper-level time synchronization device to calculate path delay and synchronization time. If there are multiple master states, select the optimal master state according to the BMC algorithm.
  • the PTP protocol packet carries the information such as the optimal time source priority, time class, and time precision, and selects an optimal time source signal from the multiple time source signals through the information carried in the packet; 2)
  • the time source signal of the 1PPS+TOD protocol is output; 3) the Slave is mapped to the second pulse state in the time information message in the TOD message according to the clock level in the Announce message received in the optimal main state in the case of time lock;
  • the clock level and clock status according to the current maintenance time are mapped to the second pulse status in the time information message in the TOD message.
  • PTP output interface Receive the optimal 1PPS+TOD of the input, update the output time counter, and do not introduce the selection of the counter clock source in this embodiment; implement the PTP main state function, and periodically perform PTP protocol report with the next-level time synchronization device. Text interaction, time synchronization.
  • the time source selection method step based on 1PPS+TOD includes S301-S304:
  • the plurality of PTP input interfaces and the plurality of 1PPS+TOD input interfaces are synchronized with the previous time, and respectively receive a corresponding number of time source signals of the PTP protocol and a corresponding number of time source signals of the 1PPS+TOD protocol.
  • S304 Perform validity determination on the 1PPS signal and the TOD signal in the time source signals of all 1PPS+TOD protocols respectively, and when the 1PPS signal and the TOD signal in the time source signal of the 1PPS+TOD protocol are both valid, A candidate time source for the time source signal of the 1PPS+TOD protocol.
  • S306 Perform time delay compensation processing on the selected time source signal of the optimal 1PPS+TOD protocol.
  • Performing state mapping in S303 is performed in a time-locked state.
  • the clock level and clock state are operated according to the current maintenance time (ie, the time when the local device is running). Maps to the second pulse state in the time information message in the TOD message.
  • the lock refers to that the PTP interacts with the PTP message of the upper-level main state, and has calculated the path delay and other parameters to complete the time synchronization process, and the time jitter error can be within the received range; the hold refers to the PTP.
  • the clock punctuality adopted by the local device After the slave state loses communication with the peer master state after the lock state, or the peer master state is no longer granted, the clock punctuality adopted by the local device, the external time source is re-acquired in the hold state, and the time source is locked.
  • free running refers to the running time maintained by the clock after the chip is powered on.
  • the clock source can be selected according to the designer's choice.
  • the local crystal oscillator or external clock source is connected; the time starting point is generally UTC (Coordinated Universal Time) time stamp starting point or user defined.
  • the medium-moving TOD outputs the GPS week number and the week second, so the free running time is later than the GPS time-scale starting point. You can choose not to output the 1PPS+TOD time source signal, or one of them. During the source selection process, the time source is invalid. In addition, the TOD second pulse status output in the free running state is 0x02 (ie unavailable).
  • the clock level in the time source signal of the optimal PTP protocol is mapped to the second pulse state.
  • mapping relationship refer to Table 1:
  • the output second pulse state is mapped according to the punctual clock level.
  • the clock level defined by G.781 Option I is taken as an example.
  • the clock levels are QL-PRC and QL-SSU respectively. -A, QL-SSU-B, QL-SEC, QL-DNU. Therefore, the clock level in the time source signal of the optimal PTP protocol is mapped to the second pulse state.
  • Table 2 For the mapping relationship, refer to Table 2:
  • the default priority is 1, 2, ... N digits, and the higher the digital value, the lower the level, the default priority of each path is different, and the purpose is that the second pulse state is equal, according to The default priority dictates the optimal 1PPS+TOD time source signal.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • FIG. 4 is a schematic diagram of a time source selection device according to the embodiment.
  • the time source selection device includes: a receiving module 401, a conversion module 402, and a selection module. 403 and output module 404.
  • the receiving module 401 is configured to receive at least two time source signals, where the time source signal includes a time source signal of the PTP protocol, or a time source signal including a PTP protocol and a time source signal of the 1PPS+TOD protocol.
  • the conversion module 402 is configured to convert the time source signal of the PTP protocol into a time source signal of the 1PPS+TOD protocol.
  • the selecting module 403 is configured to select one of the time source signals of the obtained one or more 1PPS+TOD protocols as the system optimal time source signal.
  • the output module 404 is configured to output the system optimal time source signal as a synchronous time source signal.
  • the conversion module 402 includes: a first selection submodule 4021 and a first conversion submodule 4022.
  • the conversion module 402 converts the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol, including:
  • the first selection sub-module 4021 is configured to select an optimal time source signal from the received time source signals of at least two PTP protocols.
  • the first conversion sub-module 4022 is configured to convert the optimal time source signal into a time source signal of the 1PPS+TOD protocol.
  • the conversion module 402 has another structure, which includes a second conversion submodule, which directly converts the received time source signal of at least one PTP protocol into a time source signal of the 1PPS+TOD protocol. There is no need to select the optimal time source signal, and thus to ensure a more accurate selection of the system optimal time source signal. For the above two conversion modules, reasonable selection can be made according to actual needs.
  • the selection module 403 includes: a detection submodule 4031 and a second selection submodule 4032.
  • the selection module selects one of the time source signals of the obtained one or more second pulse + day time protocol as the optimal time source signal of the system, including:
  • the detection sub-module 4031 is configured to detect the validity of the obtained time source signal of one or more 1PPS+TOD protocols.
  • the selection sub-module 4032 is configured to select one of the time source signals of the active one-way or multiple-channel 1PPS+TOD protocol as the optimal time source signal of the system.
  • Efficient time source signals are filtered out from the unified one or more optimal time source signals to eliminate the absence or abnormality of the signals, and then carry the parameter information and other periodic ones from the effective one or more according to the target time protocol.
  • the optimal time source signal of the system is selected in the optimal time source signal of the road.
  • a delay compensation module 405 is further provided, and the delay compensation module 405 is configured to perform delay compensation processing on the optimal time source signal of the system.
  • the reason for delay compensation processing on the received optimal time source signal of the system is that because of the fixed error introduced inside the processing device (the error is generally caused by the chip or the trace), the time source signal of the system needs to be extended. Time compensation processing to reduce fixed errors.
  • FIG. 5 is another time source selection device according to the embodiment.
  • the selection device includes a receiving module 501, a conversion module 502, a selection module 503, and an output module.
  • the receiving module 501 includes a PTP input interface 5011 and a 1PPS+TOD input interface 5012.
  • the PTP input interface 5011 is configured to receive a time source signal of the PTP protocol
  • the 1PPS+TOD input interface 5012 is configured to receive a time source signal of the 1PPS+TOD protocol.
  • the output module 504 includes a PTP output interface 5041 and a 1PPS+TOD output interface 5042.
  • the PTP output interface 5041 is configured to output a time source signal of the PTP protocol
  • the 1PPS+TOD output interface 5042 is configured to output a time source signal of the 1PPS+TOD protocol.
  • the structure and function of the conversion module 502, the selection module 503, and the delay compensation module 505 are similar to those of the conversion module 402, the selection module 403, and the delay compensation module 405 in FIG. 4, and are not described herein again.
  • the PTP input interface 5011 and the 1PPS+TOD input interface 5012 respectively receive the time source signal of the corresponding PTP protocol and the time source signal of the 1PPS+TOD protocol, and convert the time source signal of the PTP protocol into the 1PPS+TOD protocol through the conversion module 502.
  • the time source signal is then selected by the selection module 503 to select the time source signal of the optimal 1PPS+TOD protocol. If the output is output through the 1PPS+TOD output interface, the output is directly performed without protocol conversion; if output through the PTP output interface, The time source signal of the 1PPS+TOD protocol needs to be converted into a time source signal of the PTP protocol, and then output.
  • some modules in the time source selection device protected by the embodiment can be implemented not only in the form of software, but also in the form of hardware, even in a combination of software and hardware, such as the selection module 403 in FIG. And delay compensation module 405 (or selection module 503 and delay compensation module 505 in FIG. 5).
  • the selection module 403 includes a signal detector and an input determiner, wherein the signal detector is configured to detect the validity of the time source signal, and may be a CPLD (Complex Programmable Logic Device) or a digital phase locked loop.
  • the input determiner is configured to select an optimal one-time source signal for time synchronization from an effective multi-path source signal, which can be completed by a CPU (Central Processing Unit) and software, and the CPU usually needs to support A variety of serial ports;
  • the delay compensation module 405 can be implemented by supporting a 1588 PHY (Physical Layer) chip or a professional chip.
  • a computer readable storage medium storing computer executable instructions for implementing the time source selection method when executed by a processor.
  • each module or each step of the above embodiments of the present invention can be implemented by a general computing device, which can be concentrated on a single computing device, or Distributed on a network of computing devices, optionally, they can be implemented by program code executable by the computing device, so that they can be stored in a storage medium (ROM/RAM, disk, optical disk)
  • the computing device is executed, and in some cases, the steps shown or described may be performed in an order different than that herein, or they may be fabricated separately for each integrated circuit module, or a plurality of modules thereof or The steps are made into a single integrated circuit module. Therefore, embodiments of the invention are not limited to any particular combination of hardware and software.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the solution of the embodiment of the present invention receives at least two time source signals, where the time source signal includes a time source signal of a PTP protocol, or a time source signal including a PTP protocol and a time source signal of a 1PPS+TOD protocol; and the received PTP protocol
  • the time source signal is converted into a time source signal of the 1PPS+TOD protocol, and one of the time source signals of the obtained one or more 1PPS+TOD protocols is selected as the optimal time source signal of the system, and then the optimal time source signal of the system is selected.
  • the output enables the device to automatically select an optimal time source signal for time transfer when multiple types of interfaces work simultaneously.
  • the optimal time source can only be selected from the time source signals of each time protocol, and the automatic selection cannot be performed for different types of time sources, thereby reducing the efficiency and reliability of time synchronization.
  • the time source selection method provided by the embodiment of the present invention can select an optimal time source signal for the time source signal with different time protocols, and automatically select one when the selected optimal time source signal quality is reduced. Time source with better signal quality and switching, optionally improving the accuracy of time synchronization.

Abstract

Disclosed are a time source selection method and device. The method comprises: receiving at least two paths of time source signals, wherein the time source signals contain a time source signal of a precision time protocol, or comprise a time source signal of a precision time protocol and a time source signal of a 1 pulse per second and time of day protocol; converting the received time source signal of the precision time protocol into the time source signal of the 1 pulse per second and time of day protocol; selecting one path from the obtained one or more paths of time source signals of the 1 pulse per second and time of day protocol to serve as an optimal time source signal of a system; and outputting the optimal time source signal of the system.

Description

一种时间源选择方法及装置Time source selection method and device 技术领域Technical field
本申请涉及但不限于通信领域,尤其涉及一种时间源选择方法及装置。The present application relates to, but is not limited to, the field of communications, and in particular, to a time source selection method and apparatus.
背景技术Background technique
随着移动通信技术的发展,3G(TD-SCDMA和CDMA2000)基站和4G基站要求实现时间同步。正常情况下,基站应优先选择卫星接收机进行空中校时,但对于无法实现空中授时的基站可以采用地面授时方式,地面授时也可以作为空中授时的冗余备份,一旦卫星授时不可用,基站立即切换到地面授时。地面授时要求组建时间同步网,从时间源到基站之间的所有节点要求具备时间同步功能。国内和国际时间同步方面的标准逐渐趋于完善,运营商也逐渐要求入网设备具备高精度时间同步功能。With the development of mobile communication technologies, 3G (TD-SCDMA and CDMA2000) base stations and 4G base stations require time synchronization. Under normal circumstances, the base station should give priority to selecting the satellite receiver for air calibration. However, for the base station that cannot realize the air time, the ground time can be used. The ground time can also be used as the redundant backup of the air time. Once the satellite time is not available, the base station immediately Switch to ground timing. The ground timing requires the establishment of a time synchronization network, and all nodes from the time source to the base station require time synchronization. The standards for domestic and international time synchronization have gradually improved, and operators have gradually required networked devices to have high-precision time synchronization.
时间同步接口包括至少两种时间协议接口,为满足运营商多种场景部署,时间同步设备通常支持至少两种接口。在设备输入端存在多个时间源情况下,相关的做法是分别从每种时间协议接口中选择最优时间源,从选择的最优时间源中通过配置确定一个时间源,导致设备无法自动选择出一个最优时间源,从而影响时间同步的精确性和可靠性。如图1所示的一种多协议接口场景示意图,设备D存在3个时间源,A通过PTP(Precision Time Protocol,精确时间协议)接口提供时间同步,B和C通过1PPS+TOD(l pulse per second&Time of Day,秒脉冲+日时间)接口提供时间同步。其中,PTP接口利用传递以太网报文同步时间,适合远近距离传输,可以同时用于局间和局内时间分配;1PPS+TOD接口适合近距离传输,只能够用于局内时间分配,1PPS秒脉冲为1HZ的时钟信号,采用上升沿作为准时沿,TOD消息标示当前1PPS上升沿时间,ToD协议报文发送频率为每秒1次。PTP接口的多个时间源可以通过BMC算法(Best Master Clock Algorithm,最佳主时钟算法)选择最优时间源,1PPS+TOD接口的多个时间源可以通过秒脉冲状态、缺省优先级等信息选择最优时间源,但对于1PPS+TOD接口与PTP接口的最优时间源,因为信息中的参数定义方式不同等原因而无法自动选择一个系统最优时间源,从而无法向其他时间同步设备传递最优时间源。 The time synchronization interface includes at least two types of time protocol interfaces. To meet the operator's multiple scenarios, the time synchronization device usually supports at least two interfaces. In the case where there are multiple time sources at the input of the device, the related method is to select an optimal time source from each time protocol interface separately, and determine a time source from the selected optimal time source through configuration, so that the device cannot automatically select. An optimal time source is generated, which affects the accuracy and reliability of time synchronization. As shown in Figure 1, a multi-protocol interface scenario shows that device D has three time sources. A provides time synchronization through the PTP (Precision Time Protocol) interface. B and C pass 1PPS+TOD (l pulse per The second&Time of Day interface provides time synchronization. The PTP interface utilizes the transmission time of the Ethernet packet, which is suitable for long-distance transmission and can be used for inter-office and intra-office time allocation. The 1PPS+TOD interface is suitable for short-distance transmission and can only be used for intra-office time allocation. The 1PPS second pulse is The 1HZ clock signal uses the rising edge as the on-time edge, the TOD message indicates the current 1PPS rising edge time, and the ToD protocol message transmission frequency is once per second. Multiple time sources of the PTP interface can select the optimal time source through the BMC algorithm (Best Master Clock Algorithm). Multiple time sources of the 1PPS+TOD interface can pass the information of the second pulse state and default priority. The optimal time source is selected. However, for the optimal time source of the 1PPS+TOD interface and the PTP interface, the optimal time source of one system cannot be automatically selected because of different parameters in the information, and thus cannot be transmitted to other time synchronization devices. Optimal time source.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本发明实施例要解决的主要技术问题是,提供一种时间源选择方法及装置,以解决相关技术中多种类型接口同时工作的情况下无法自动选择一个最优时间源信号进行时间传递,从而影响时间同步效率和精度的技术问题。The main technical problem to be solved by the embodiments of the present invention is to provide a time source selection method and device, so as to solve the problem that multiple types of interfaces in the related art can work simultaneously, and an optimal time source signal cannot be automatically selected for time transmission, thereby Technical issues that affect the efficiency and accuracy of time synchronization.
一种时间源选择方法,包括:A time source selection method, including:
接收至少两路时间源信号,所述时间源信号中包含精确时间协议的时间源信号,或者包含精确时间协议的时间源信号和秒脉冲+日时间协议的时间源信号。Receiving at least two time source signals, the time source signal including a time source signal of a precise time protocol, or a time source signal including a precise time protocol and a time source signal of a second pulse + day time protocol.
将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号。The time source signal of the precise time protocol is converted to a time source signal of a second pulse + day time protocol.
从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号。A path is selected from the obtained time source signals of one or more seconds pulse + day time protocol as the system optimal time source signal.
将所述系统最优时间源信号作为同步时间源信号输出。The system optimal time source signal is output as a synchronous time source signal.
可选地,将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号包括:Optionally, converting the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol comprises:
从接收的至少两路精确时间协议的时间源信号中选择最优时间源信号。The optimal time source signal is selected from the received time source signals of at least two precise time protocols.
将所述最优时间源信号转换成所述秒脉冲+日时间协议的时间源信号。The optimal time source signal is converted to a time source signal of the second pulse + day time protocol.
可选地,所述目标时间协议为所述多种时间协议中的一种,或者所述多种时间协议以外的一种。Optionally, the target time protocol is one of the multiple time protocols, or one of the multiple time protocols.
可选地,将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号还包括:Optionally, converting the time source signal of the precise time protocol into the time source signal of the second pulse + day time protocol further includes:
将接收的一路或多路精确时间协议的时间源信号直接转换成秒脉冲+日时间协议的时间源信号。The time source signal of the received one or more precise time protocol is directly converted into a time source signal of the second pulse + day time protocol.
可选地,所述从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号包括: Optionally, selecting one of the obtained time source signals of one or more seconds pulse + day time protocol as the system optimal time source signal includes:
检测得到的一路或多路秒脉冲+日时间协议的时间源信号的有效性;Detecting the validity of the time source signal of one or more seconds pulse + day time protocol;
从有效的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为所述系统最优时间源信号。One of the time source signals of the effective one-way or multi-channel second pulse + day time protocol is selected as the optimal time source signal of the system.
可选地,所述方法还包括:在从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号之后,且在将所述系统最优时间源信号作为同步时间源信号输出之前,对所述系统最优时间源信号进行延时补偿处理。Optionally, the method further includes: after selecting one of the time source signals obtained from the one or more seconds pulse + day time protocol as the system optimal time source signal, and selecting the optimal time source of the system Before the signal is output as the synchronous time source signal, delay compensation processing is performed on the optimal time source signal of the system.
可选地一种时间源选择装置,包括:接收模块、转换模块、选择模块和输出模块。Optionally, a time source selection device includes: a receiving module, a conversion module, a selection module, and an output module.
接收模块,设置为接收至少两路时间源信号,所述时间源信号中包含精确时间协议的时间源信号,或者包含精确时间协议的时间源信号和秒脉冲+日时间协议的时间源信号。The receiving module is configured to receive at least two time source signals, wherein the time source signal includes a time source signal of a precise time protocol, or a time source signal including a precise time protocol and a time source signal of a second pulse + day time protocol.
转换模块,设置为将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号。And a conversion module configured to convert the time source signal of the precise time protocol into a time source signal of a second pulse + day time protocol.
选择模块,设置为从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号。The selection module is configured to select one of the time source signals of the obtained one or more seconds pulse + day time protocol as the system optimal time source signal.
输出模块,设置为将所述系统最优时间源信号作为同步时间源信号输出。The output module is configured to output the optimal time source signal of the system as a synchronous time source signal.
可选地,所述转换模块包括:第一选择子模块和第一转换子模块。Optionally, the conversion module includes: a first selection submodule and a first conversion submodule.
所述转换模块将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号包括:The conversion module converts the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol, including:
第一选择子模块,设置为从接收的至少两路精确时间协议的时间源信号中选择最优时间源信号。The first selection sub-module is configured to select an optimal time source signal from the received time source signals of at least two precise time protocols.
第一转换子模块,设置为将所述最优时间源信号转换成所述秒脉冲+日时间协议的时间源信号。The first conversion sub-module is configured to convert the optimal time source signal into a time source signal of the second pulse + day time protocol.
可选地,所述转换模块还包括:第二转换子模块。Optionally, the conversion module further includes: a second conversion submodule.
所述转换模块将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号还包括: Converting, by the conversion module, the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol further includes:
第二转换子模块,设置为将接收的一路或多路精确时间协议的时间源信号直接转换成秒脉冲+日时间协议的时间源信号。The second conversion submodule is configured to directly convert the received time source signal of one or more precise time protocols into a time source signal of the second pulse + day time protocol.
可选地,所述选择模块包括:检测子模块和第二选择子模块。Optionally, the selection module includes: a detection submodule and a second selection submodule.
检测子模块,设置为检测得到的一路或多路秒脉冲+日时间协议的时间源信号的有效性。The detection sub-module is configured to detect the validity of the obtained time source signal of one or more seconds pulse + day time protocol.
第二选择子模块,设置为从有效的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为所述系统最优时间源信号。The second selection submodule is configured to select one of the time source signals of the effective one or more second pulse + day time protocol as the optimal time source signal of the system.
可选地,所述装置还包括延时补偿模块;所述延时补偿模块设置在所述选择模块和所述输出模块之间。Optionally, the device further includes a delay compensation module; the delay compensation module is disposed between the selection module and the output module.
延时补偿模块,设置为在所述选择模块从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号之后,且在所述输出模块将所述系统最优时间源信号作为同步时间源信号输出之前,对所述系统最优时间源信号进行延时补偿处理。a delay compensation module, configured to select, after the selection module selects one of the obtained one or more second pulse + day time protocol time source signals as the system optimal time source signal, and the output module Before the system optimal time source signal is output as the synchronous time source signal, delay compensation processing is performed on the optimal time source signal of the system.
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现所述的时间源选择方法。A computer readable storage medium storing computer executable instructions for implementing the time source selection method when executed by a processor.
本发明实施例的有益效果是:The beneficial effects of the embodiments of the present invention are:
本发明实施例提供了一种时间源选择方法,包括:接收至少两路时间源信号,该时间源信号中包含PTP协议的时间源信号,或包含PTP协议的时间源信号和1PPS+TOD协议的时间源信号;将接收的PTP协议的时间源信号转换成1PPS+TOD协议的时间源信号,并从得到的一路或多路1PPS+TOD协议的时间源信号中选择一路作为系统最优时间源信号,然后将该系统最优时间源信号输出,使得设备在多种类型接口同时工作的情况下可自动选择一个最优时间源信号进行时间传递。而相关技术中,只能从每种时间协议的时间源信号中选择最优时间源,对于不同类型的时间源却无法进行自动选择,从而降低了时间同步的效率和可靠性。本发明实施例提供的时间源选择方法,对于存在不同时间协议的时间源信号,能够选择最优的时间源信号进行传递,当发现选择的最优时间源信号质量降低时,会自动重新选择一个信号质量较优的时间源并进行切换,可选地提升了时间同步的精准性。 An embodiment of the present invention provides a time source selection method, including: receiving at least two time source signals, where the time source signal includes a time source signal of a PTP protocol, or a time source signal including a PTP protocol and a 1PPS+TOD protocol. Time source signal; converting the time source signal of the received PTP protocol into a time source signal of the 1PPS+TOD protocol, and selecting one of the time source signals of the obtained one or more 1PPS+TOD protocols as the system optimal time source signal Then, the optimal time source signal of the system is output, so that the device can automatically select an optimal time source signal for time transmission when multiple types of interfaces work simultaneously. In the related art, the optimal time source can only be selected from the time source signals of each time protocol, and the automatic selection cannot be performed for different types of time sources, thereby reducing the efficiency and reliability of time synchronization. The time source selection method provided by the embodiment of the present invention can select an optimal time source signal for the time source signal with different time protocols, and automatically select one when the selected optimal time source signal quality is reduced. Time source with better signal quality and switching, optionally improving the accuracy of time synchronization.
附图概述BRIEF abstract
图1为本发明实施例提供的一种多协议接口场景示意图;FIG. 1 is a schematic diagram of a multi-protocol interface scenario according to an embodiment of the present invention;
图2为本发明实施例一提供的一种时间源选择方法流程图;2 is a flowchart of a time source selection method according to Embodiment 1 of the present invention;
图3为本发明实施例一提供的一种基于1PPS+TOD接口的时间源选择方法流程图;FIG. 3 is a flowchart of a time source selection method based on a 1PPS+TOD interface according to Embodiment 1 of the present invention;
图4为本发明实施例二提供的一种时间源选择装置示意图;4 is a schematic diagram of a time source selection apparatus according to Embodiment 2 of the present invention;
图5为本发明实施例二提供的一种基于1PPS+TOD接口的时间源选择装置示意图。FIG. 5 is a schematic diagram of a time source selection device based on a 1PPS+TOD interface according to Embodiment 2 of the present invention.
本发明的实施方式Embodiments of the invention
下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
实施例一:Embodiment 1:
本发明实施例提供了一种时间源选择方法,请参见图2所示的时间源选择方法流程图。图2中,时间源选择方法的流程包括步骤S201-S204:The embodiment of the present invention provides a time source selection method. Please refer to the flowchart of the time source selection method shown in FIG. 2 . In FIG. 2, the flow of the time source selection method includes steps S201-S204:
S201,接收至少两路时间源信号,所述时间源信号中包含PTP协议的时间源信号,或者包含PTP协议的时间源信号和1PPS+TOD协议的时间源信号。S201. Receive at least two time source signals, where the time source signal includes a time source signal of a PTP protocol, or a time source signal including a PTP protocol and a time source signal of a 1PPS+TOD protocol.
S202,将所述PTP协议的时间源信号转换成1PPS+TOD协议的时间源信号。S202. Convert the time source signal of the PTP protocol into a time source signal of the 1PPS+TOD protocol.
S203,从得到的一路或多路1PPS+TOD协议的时间源信号中选择一路作为系统最优时间源信号。S203. Select one of the time source signals of the obtained one or more channels of the 1PPS+TOD protocol as the system optimal time source signal.
S204,将系统最优时间源信号作为同步时间源信号输出。S204. Output the system optimal time source signal as a synchronous time source signal.
上述时间源信号包括但不限于PTP协议的时间源信号和1PPS+TOD协议的时间源信号,对于其他类型的时间源信号,同样可采用上述流程,将每种类型的时间源信号统一成一种类型,进而选择最优时间源信号完成时间同步。通过上述流程,将多种时间协议类型的时间源信号进行类型统一,自动选择出最精确的时间源信号完成时间同步,从而避免设备针对不同接口进行配置。同时当同步的时间源信号质量下降,精度降低时,会自动重新选择一个信号 质量较优的时间源进行同步,从而为其他时间同步设备传递最优的时间源。The time source signals include but are not limited to the time source signal of the PTP protocol and the time source signal of the 1PPS+TOD protocol. For other types of time source signals, the above process can also be used to unify each type of time source signal into one type. And then select the optimal time source signal to complete the time synchronization. Through the above process, the time source signals of various time protocol types are unified in type, and the most accurate time source signal is automatically selected to complete time synchronization, thereby preventing the device from being configured for different interfaces. At the same time, when the quality of the synchronized time source signal is degraded and the accuracy is lowered, a signal is automatically reselected. The better quality time source is synchronized to deliver the optimal time source for other time synchronization devices.
可选地,在S202步骤中,支持不同时间协议的接口在接收多路时间源信号后,存在两种处理方式:一种是从PTP协议的时间源信号中选择最优时间源信号,然后将最优时间源信号转换成秒脉冲+日时间协议的时间源信号,进而减少信号转换的过程;另一种是直接将接收的至少一路精确时间协议的时间源信号直接转换成秒脉冲+日时间协议的时间源信号,无需进行最优时间源信号的选择,进而保证更精准的选择出系统最优时间源信号。对于上述两种处理方式,可根据实际需求进行合理选择。Optionally, in the step S202, after receiving the multiple time source signals, the interface supporting the different time protocols has two processing modes: one is to select an optimal time source signal from the time source signals of the PTP protocol, and then The optimal time source signal is converted into a time source signal of the second pulse + day time protocol, thereby reducing the signal conversion process; the other is directly converting the received time source signal of at least one precise time protocol into a second pulse + day time. The time source signal of the protocol does not need to select the optimal time source signal, thereby ensuring more accurate selection of the optimal time source signal of the system. For the above two treatment methods, reasonable selection can be made according to actual needs.
可选地,在S203步骤中,从得到的一路或多路1PPS+TOD协议的时间源信号中选择一路作为系统最优时间源信号之前,需要对各路时间源信号的有效性进行检测,当检测到某一路时间源信号不存在或者不正常时,此路时间源信号将不作为最优系统时间源信号的候选时间源,当检测到的一路时间源信号有效时,此路时间源信号可作为最优系统时间源信号。检测完各路时间源信号的有效性后,根据1PPS+TOD协议携带的参数信息周期性的从多路有效的时间源信号中选择一路最优的系统时间源信号。Optionally, in step S203, before selecting one of the time source signals of the obtained one or more channels of the 1PPS+TOD protocol as the optimal time source signal of the system, it is necessary to detect the validity of each time source signal. When a time source signal is detected to be absent or abnormal, the time source signal will not be used as a candidate time source for the optimal system time source signal. When the detected time source signal is valid, the time source signal may be As the optimal system time source signal. After detecting the validity of each time source signal, an optimal system time source signal is periodically selected from the plurality of valid time source signals according to the parameter information carried by the 1PPS+TOD protocol.
对于1PPS+TOD协议规定的选择标准包括但不限于秒脉冲状态、缺省优先级等,综合考量选出最优的一路时间源信号。在秒脉冲状态相等情况下,按照缺省优先级裁定最优源。如:在进行最优1PPS+TOD时间源信号选择时,秒脉冲状态按照0x00>0x01>0x05>0x03>0x04>0x02由高到低顺序排列,最高为最优侯选源,如果存在秒脉冲状态相等的候选源,按照缺省优先级裁定最优1PPS+TOD时间源信号。因此,系统最优时间源信号选择过程为:The selection criteria specified by the 1PPS+TOD protocol include, but are not limited to, the second pulse state, the default priority, etc., and comprehensively consider the optimal one-way time source signal. In the case where the second pulse states are equal, the optimal source is arbitrated according to the default priority. For example, when the optimal 1PPS+TOD time source signal selection is performed, the second pulse state is arranged in descending order of 0x00>0x01>0x05>0x03>0x04>0x02, and the highest is the optimal candidate source. If there are equal seconds pulse states The candidate source arbitrates the optimal 1PPS+TOD time source signal according to the default priority. Therefore, the system optimal time source signal selection process is:
从多路有效的时间源信号中选择缺省优先级最高的时间源信号,若至少两个时间源信号的缺省优先级相同且为最高,则从缺省优先级相同且为最高的时间源信号中选择出秒脉冲状态最好的时间源信号作为系统最优时间源信号。上述选择过程不唯一,也可先判断秒脉冲状态,再判断缺省优先级,也可同时进行判断,对于其他参数,同样可以采用上述选择过程。Selecting the time source signal with the highest default priority from the multiple valid time source signals. If the default priorities of the at least two time source signals are the same and the highest, the time source with the same default priority is the highest. The time source signal with the best second pulse state is selected as the optimal time source signal of the system. The above selection process is not unique, and the second pulse state can be judged first, and then the default priority can be judged, and the judgment can be made at the same time. For other parameters, the above selection process can also be used.
此外,如果已选择的系统最优时间源信号质量降低或失效,则重新选择系统最优时间源信号,自动切换到新选择的系统最优时间源信号中;同理,如果已选择的系统最优时间源信号质量提高,则重新选择系统最优时间源信 号并进行自动切换。此外,如果输入的所有时间源信号均无效,则选择不输出时间或者输出时间不可用。In addition, if the selected system optimal time source signal quality is reduced or invalid, the system optimal time source signal is reselected and automatically switched to the newly selected system optimal time source signal; similarly, if the selected system is the most If the quality of the excellent time source signal is improved, then the system optimal time source is reselected. Number and automatically switch. In addition, if all of the time source signals entered are invalid, then no output time is selected or the output time is not available.
可选地,该方法还包括:在选择出最优系统时间源信号之后,且将最优的系统时间源信号作为同步时间源信号输出之前,对选择出的最优时间源信号进行延时补偿处理。因为处理设备内部引入的固定误差(该误差一般由芯片内部或者走线导致),所以需要对该系统时间源信号进行延时补偿处理以减小固定误差。Optionally, the method further includes: delaying compensation of the selected optimal time source signal after selecting the optimal system time source signal and outputting the optimal system time source signal as the synchronous time source signal deal with. Because of the fixed error introduced inside the processing device (which is usually caused by the chip or the trace), it is necessary to perform delay compensation processing on the system time source signal to reduce the fixed error.
在S204步骤中,将延时补偿处理后的系统最优时间源信号进行输出时,首先判断该系统最优时间源信号通过哪种时间协议类型的接口输出,如果该系统最优时间源信号的时间协议类型与输出接口的时间协议类型不匹配,则将目标时间协议的系统最优时间源信号转换为输出接口支持的时间协议,并作为同步时间源信号输出。In the step S204, when the system optimal time source signal after the delay compensation processing is output, firstly, it is determined by which time protocol type interface output of the optimal time source signal of the system, if the optimal time source signal of the system is If the time protocol type does not match the time protocol type of the output interface, the system optimal time source signal of the target time protocol is converted into a time protocol supported by the output interface, and is output as a synchronous time source signal.
本实施例结合图3对基于1PPS+TOD协议的时间源选择方法进行详细说明。This embodiment describes a time source selection method based on the 1PPS+TOD protocol in detail with reference to FIG. 3.
首先,PTP输入接口和PTP输出接口均为软件接口,二者具备如下特性:First, the PTP input interface and the PTP output interface are software interfaces, and both have the following features:
PTP输入接口:1)实现PTP从状态功能,与上一级时间同步设备周期性进行PTP协议报文交互,计算路径延迟,同步时间,如果存在多个主状态,根据BMC算法选择最优主状态;其中,PTP协议报文中携带最优时间源优先级、时间等级和时间精度等信息,通过其报文携带的信息,从多路时间源信号中选择一个最优时间源信号;2)实现输出1PPS+TOD协议的时间源信号;3)Slave在时间锁定情况下,根据接收到最优主状态Announce报文中的时钟等级,映射为TOD报文中的时间信息消息中的秒脉冲状态;从状态在时间失锁保持或者自由运行情况下,根据当前维护时间运行的时钟等级及时钟状态映射为TOD报文中的时间信息消息中的秒脉冲状态。PTP input interface: 1) Implement the PTP slave status function, and periodically exchange PTP protocol packets with the upper-level time synchronization device to calculate path delay and synchronization time. If there are multiple master states, select the optimal master state according to the BMC algorithm. The PTP protocol packet carries the information such as the optimal time source priority, time class, and time precision, and selects an optimal time source signal from the multiple time source signals through the information carried in the packet; 2) The time source signal of the 1PPS+TOD protocol is output; 3) the Slave is mapped to the second pulse state in the time information message in the TOD message according to the clock level in the Announce message received in the optimal main state in the case of time lock; When the status is lost or free running in time, the clock level and clock status according to the current maintenance time are mapped to the second pulse status in the time information message in the TOD message.
PTP输出接口:接收输入的最优1PPS+TOD,更新输出时间计数器,对于计数器时钟源的选择本实施例不做介绍;实现PTP主状态功能,与下一级时间同步设备周期性进行PTP协议报文交互,进行时间同步。PTP output interface: Receive the optimal 1PPS+TOD of the input, update the output time counter, and do not introduce the selection of the counter clock source in this embodiment; implement the PTP main state function, and periodically perform PTP protocol report with the next-level time synchronization device. Text interaction, time synchronization.
可选地,基于1PPS+TOD的时间源选择方法步骤包括S301-S304: Optionally, the time source selection method step based on 1PPS+TOD includes S301-S304:
S301,多个PTP输入接口和多个1PPS+TOD输入接口与上一级时间同步后,分别接收到对应数量的PTP协议的时间源信号和对应数量的1PPS+TOD协议的时间源信号。S301. The plurality of PTP input interfaces and the plurality of 1PPS+TOD input interfaces are synchronized with the previous time, and respectively receive a corresponding number of time source signals of the PTP protocol and a corresponding number of time source signals of the 1PPS+TOD protocol.
S302,通过BMC算法从对应数量的PTP协议的时间源信号中选择一路最优PTP协议的时间源信号。S302. Select, by using a BMC algorithm, a time source signal of an optimal PTP protocol from a time source signal of a corresponding number of PTP protocols.
S303,将最优PTP协议的时间源信号中的时钟等级映射为秒脉冲状态,并输出一路1PPS+TOD协议的时间源信号。S303. Map a clock level in the time source signal of the optimal PTP protocol to a second pulse state, and output a time source signal of the 1PPS+TOD protocol.
S304,对所有1PPS+TOD协议的时间源信号中的1PPS信号和TOD信号分别进行有效性判断,当一路1PPS+TOD协议的时间源信号中的1PPS信号和TOD信号均有效时,才能作为最优1PPS+TOD协议的时间源信号的候选时间源。S304: Perform validity determination on the 1PPS signal and the TOD signal in the time source signals of all 1PPS+TOD protocols respectively, and when the 1PPS signal and the TOD signal in the time source signal of the 1PPS+TOD protocol are both valid, A candidate time source for the time source signal of the 1PPS+TOD protocol.
S305,根据每路1PPS+TOD协议的时间源信号中1PPS和TOD的有效性、TOD报文中的秒脉冲状态、每路缺省优先级等信息周期性进行裁定,选择出最优1PPS+TOD协议的时间源信号。S305, periodically determining, according to the validity of 1PPS and TOD in the time source signal of each 1PPS+TOD protocol, the second pulse state in the TOD message, and the default priority of each channel, selecting the optimal 1PPS+TOD The time source signal of the protocol.
S306,将选择出的最优1PPS+TOD协议的时间源信号进行延时补偿处理。S306: Perform time delay compensation processing on the selected time source signal of the optimal 1PPS+TOD protocol.
S307,判断将延时补偿处理后的时间源信号是否通过PTP输出接口,如果延时补偿处理后的时间源信号通过PTP输出接口,则执行S308;如果延时补偿处理后的时间源信号未通过PTP输出接口,则直接将该时间源信号输出。S307, determining whether the time source signal after the delay compensation processing passes the PTP output interface, if the time source signal after the delay compensation processing passes the PTP output interface, executing S308; if the time source signal after the delay compensation processing fails The PTP output interface directly outputs the time source signal.
S308,将该时间源信号由1PPS+TOD协议转换成PTP协议并输出。S308. Convert the time source signal into a PTP protocol by the 1PPS+TOD protocol and output the signal.
在S303中进行状态映射时是在时间锁定的状态下进行的,当从状态在时间失锁保持或者自由运行情况下,根据当前维护时间(即本地设备运行的时间)运行的时钟等级及时钟状态映射为TOD报文中的时间信息消息中的秒脉冲状态。其中,锁定是指PTP从状态通过与上一级主状态PTP报文交互,已经计算出路径延时等参数,完成时间同步过程,且时间抖动误差可以在接收的范围之内;保持是指PTP从状态在锁定状态后失去与对端主状态之间通信,或者对端主状态不再授时,由本地设备所采用时钟守时,保持状态下重新获取到外部时间源且锁定时间源,则状态转为锁定;自由运行是指芯片上电正常运行后,由时钟维护的运行时间,时钟源根据设计者选择,可以采用 本地晶振,也或者外部时钟源接入;时间起始点一般为UTC(协调世界时,Coordinated Universal Time)时标起点或用户定义。Performing state mapping in S303 is performed in a time-locked state. When the slave state is lost in time or free running, the clock level and clock state are operated according to the current maintenance time (ie, the time when the local device is running). Maps to the second pulse state in the time information message in the TOD message. The lock refers to that the PTP interacts with the PTP message of the upper-level main state, and has calculated the path delay and other parameters to complete the time synchronization process, and the time jitter error can be within the received range; the hold refers to the PTP. After the slave state loses communication with the peer master state after the lock state, or the peer master state is no longer granted, the clock punctuality adopted by the local device, the external time source is re-acquired in the hold state, and the time source is locked. Turn to lock; free running refers to the running time maintained by the clock after the chip is powered on. The clock source can be selected according to the designer's choice. The local crystal oscillator or external clock source is connected; the time starting point is generally UTC (Coordinated Universal Time) time stamp starting point or user defined.
对于自由运行状态,由于UTC时标起点和GPS(全球定位系统,Global Positioning System)时标起点不一致,中移动TOD输出GPS周数和周内秒,因此自由运行的时间如果晚于GPS时标起点,可选择不输出1PPS+TOD时间源信号,或者其中之一,在选源过程中会裁定此时间源无效。此外,自由运行状态下输出的TOD秒脉冲状态为0x02(即不可用)。For the free running state, since the UTC time-scale starting point and the GPS (Global Positioning System) time-scale starting point are inconsistent, the medium-moving TOD outputs the GPS week number and the week second, so the free running time is later than the GPS time-scale starting point. You can choose not to output the 1PPS+TOD time source signal, or one of them. During the source selection process, the time source is invalid. In addition, the TOD second pulse status output in the free running state is 0x02 (ie unavailable).
可选地,在时间锁定情况下,将最优PTP协议的时间源信号中的时钟等级映射为秒脉冲状态,其映射关系可以参考表1:Optionally, in the case of time locking, the clock level in the time source signal of the optimal PTP protocol is mapped to the second pulse state. For the mapping relationship, refer to Table 1:
表1Table 1
Figure PCTCN2016086911-appb-000001
Figure PCTCN2016086911-appb-000001
在时间自由运行或保持情况下,输出的秒脉冲状态按照守时的时钟等级映射,以G.781Option I定义的时钟等级为例介绍,时钟等级由高到低分别为QL-PRC、QL-SSU-A、QL-SSU-B、QL-SEC、QL-DNU。因此,将最优PTP协议的时间源信号中的时钟等级映射为秒脉冲状态,其映射关系可以参考表2: In the case of free running or holding time, the output second pulse state is mapped according to the punctual clock level. The clock level defined by G.781 Option I is taken as an example. The clock levels are QL-PRC and QL-SSU respectively. -A, QL-SSU-B, QL-SEC, QL-DNU. Therefore, the clock level in the time source signal of the optimal PTP protocol is mapped to the second pulse state. For the mapping relationship, refer to Table 2:
表2Table 2
时钟等级Clock level 秒脉冲状态Second pulse state
QL_PRCQL_PRC 0x010x01
QL_SSU-AQL_SSU-A 0x050x05
QL_SSU-BQL_SSU-B 0x030x03
QL_SEC/EECQL_SEC/EEC 0x040x04
QL_DNUQL_DNU 0x020x02
需要注意的是,上述时钟等级由上至下依次减小。It should be noted that the above clock levels are sequentially reduced from top to bottom.
可选地,在S305中,缺省优先级为1、2……N数字,数字值越高,表示等级越低,每一路的缺省优先级不同,目的在于秒脉冲状态相等情况下,按照缺省优先级裁定最优1PPS+TOD时间源信号。Optionally, in S305, the default priority is 1, 2, ... N digits, and the higher the digital value, the lower the level, the default priority of each path is different, and the purpose is that the second pulse state is equal, according to The default priority dictates the optimal 1PPS+TOD time source signal.
实施例二:Embodiment 2:
本实施例提供了一种时间源选择装置,请参见图4,图4为本实施例提供的一种时间源选择装置示意图,该时间源选择装置包括:接收模块401、转换模块402、选择模块403和输出模块404。The present embodiment provides a time source selection device. Referring to FIG. 4, FIG. 4 is a schematic diagram of a time source selection device according to the embodiment. The time source selection device includes: a receiving module 401, a conversion module 402, and a selection module. 403 and output module 404.
接收模块401,设置为接收至少两路时间源信号,所述时间源信号中包含PTP协议的时间源信号,或包含PTP协议的时间源信号和1PPS+TOD协议的时间源信号。The receiving module 401 is configured to receive at least two time source signals, where the time source signal includes a time source signal of the PTP protocol, or a time source signal including a PTP protocol and a time source signal of the 1PPS+TOD protocol.
转换模块402,设置为将所述PTP协议的时间源信号转换成1PPS+TOD协议的时间源信号。The conversion module 402 is configured to convert the time source signal of the PTP protocol into a time source signal of the 1PPS+TOD protocol.
选择模块403,设置为从得到的一路或多路1PPS+TOD协议的时间源信号中选择一路作为系统最优时间源信号。The selecting module 403 is configured to select one of the time source signals of the obtained one or more 1PPS+TOD protocols as the system optimal time source signal.
输出模块404,设置为将所述系统最优时间源信号作为同步时间源信号输出。The output module 404 is configured to output the system optimal time source signal as a synchronous time source signal.
可选地,在转换模块402中包括:第一选择子模块4021和第一转换子模块4022。 Optionally, the conversion module 402 includes: a first selection submodule 4021 and a first conversion submodule 4022.
所述转换模块402将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号包括:The conversion module 402 converts the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol, including:
第一选择子模块4021,设置为从接收的至少两路PTP协议的时间源信号中选择最优时间源信号。The first selection sub-module 4021 is configured to select an optimal time source signal from the received time source signals of at least two PTP protocols.
第一转换子模块4022,设置为将所述最优时间源信号转换成所述1PPS+TOD协议的时间源信号。The first conversion sub-module 4022 is configured to convert the optimal time source signal into a time source signal of the 1PPS+TOD protocol.
此外,转换模块402还存在另一种结构,其包括第二转换子模块,该第二转换子模块是直接将接收的至少一路PTP协议的时间源信号转换成1PPS+TOD协议的时间源信号,无需进行最优时间源信号的选择,进而保证更精准的选择出系统最优时间源信号。对于上述两种转换模块,可根据实际需求进行合理选择。In addition, the conversion module 402 has another structure, which includes a second conversion submodule, which directly converts the received time source signal of at least one PTP protocol into a time source signal of the 1PPS+TOD protocol. There is no need to select the optimal time source signal, and thus to ensure a more accurate selection of the system optimal time source signal. For the above two conversion modules, reasonable selection can be made according to actual needs.
可选地,选择模块403包括:检测子模块4031和第二选择子模块4032。Optionally, the selection module 403 includes: a detection submodule 4031 and a second selection submodule 4032.
选择模块从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号包括:The selection module selects one of the time source signals of the obtained one or more second pulse + day time protocol as the optimal time source signal of the system, including:
检测子模块4031,设置为检测得到的一路或多路1PPS+TOD协议的时间源信号的有效性。The detection sub-module 4031 is configured to detect the validity of the obtained time source signal of one or more 1PPS+TOD protocols.
选择子模块4032,设置为从有效的一路或多路1PPS+TOD协议的时间源信号中选择一路作为所述系统最优时间源信号。The selection sub-module 4032 is configured to select one of the time source signals of the active one-way or multiple-channel 1PPS+TOD protocol as the optimal time source signal of the system.
从统一后的一路或多路最优时间源信号中筛选出有效的时间源信号,排除信号不存在或者不正常的情况,然后根据目标时间协议携带参数信息等周期性的从有效的一路或多路最优时间源信号中选择系统最优时间源信号。Efficient time source signals are filtered out from the unified one or more optimal time source signals to eliminate the absence or abnormality of the signals, and then carry the parameter information and other periodic ones from the effective one or more according to the target time protocol. The optimal time source signal of the system is selected in the optimal time source signal of the road.
此外,在选择模块403和输出模块404之间,还设有延时补偿模块405,该延时补偿模块405设置为对系统最优时间源信号进行延时补偿处理。对接收到的系统最优时间源信号进行延时补偿处理的原因是:因为处理设备内部引入的固定误差(该误差一般由芯片内部或者走线导致),所以需要对该系统时间源信号进行延时补偿处理以减小固定误差。In addition, between the selection module 403 and the output module 404, a delay compensation module 405 is further provided, and the delay compensation module 405 is configured to perform delay compensation processing on the optimal time source signal of the system. The reason for delay compensation processing on the received optimal time source signal of the system is that because of the fixed error introduced inside the processing device (the error is generally caused by the chip or the trace), the time source signal of the system needs to be extended. Time compensation processing to reduce fixed errors.
可选地,请参见图5,图5为本实施例提供的另一种时间源选择装置,在该选择装置中,包括接收模块501、转换模块502、选择模块503、输出模 块504和延时补偿模块505。其中,接收模块501包括PTP输入接口5011和1PPS+TOD输入接口5012,PTP输入接口5011设置为接收PTP协议的时间源信号,1PPS+TOD输入接口5012设置为接收1PPS+TOD协议的时间源信号;输出模块504包括PTP输出接口5041和1PPS+TOD输出接口5042,PTP输出接口5041设置为输出PTP协议的时间源信号,1PPS+TOD输出接口5042设置为输出1PPS+TOD协议的时间源信号。转换模块502、选择模块503和延时补偿模块505的结构和作用与图4中的转换模块402、选择模块403和延时补偿模块405的结构和作用类似,这里不再赘述。Optionally, please refer to FIG. 5. FIG. 5 is another time source selection device according to the embodiment. The selection device includes a receiving module 501, a conversion module 502, a selection module 503, and an output module. Block 504 and delay compensation module 505. The receiving module 501 includes a PTP input interface 5011 and a 1PPS+TOD input interface 5012. The PTP input interface 5011 is configured to receive a time source signal of the PTP protocol, and the 1PPS+TOD input interface 5012 is configured to receive a time source signal of the 1PPS+TOD protocol. The output module 504 includes a PTP output interface 5041 and a 1PPS+TOD output interface 5042. The PTP output interface 5041 is configured to output a time source signal of the PTP protocol, and the 1PPS+TOD output interface 5042 is configured to output a time source signal of the 1PPS+TOD protocol. The structure and function of the conversion module 502, the selection module 503, and the delay compensation module 505 are similar to those of the conversion module 402, the selection module 403, and the delay compensation module 405 in FIG. 4, and are not described herein again.
PTP输入接口5011和1PPS+TOD输入接口5012分别接收到对应的PTP协议的时间源信号和1PPS+TOD协议的时间源信号,通过转换模块502将PTP协议的时间源信号转换成1PPS+TOD协议的时间源信号,然后通过选择模块503选择出最优的1PPS+TOD协议的时间源信号,如果通过1PPS+TOD输出接口输出,则直接进行输出,无需进行协议转换;如果通过PTP输出接口输出,则需要将1PPS+TOD协议的时间源信号转换成PTP协议的时间源信号,然后进行输出。The PTP input interface 5011 and the 1PPS+TOD input interface 5012 respectively receive the time source signal of the corresponding PTP protocol and the time source signal of the 1PPS+TOD protocol, and convert the time source signal of the PTP protocol into the 1PPS+TOD protocol through the conversion module 502. The time source signal is then selected by the selection module 503 to select the time source signal of the optimal 1PPS+TOD protocol. If the output is output through the 1PPS+TOD output interface, the output is directly performed without protocol conversion; if output through the PTP output interface, The time source signal of the 1PPS+TOD protocol needs to be converted into a time source signal of the PTP protocol, and then output.
此外,本实施例保护的时间源选择装置中的部分模块不仅可以通过软件的形式实现,同样也可以通过硬件的形式实现,甚至以软硬结合的方式来实现,如图4中的选择模块403和延时补偿模块405(或者图5中的选择模块503和延时补偿模块505)。选择模块403中包括信号检测器和输入判决器,其中,信号检测器设置为对时间源信号的有效性进行检测,可由CPLD(Complex Programmable Logic Device,复杂可编程逻辑器件)或数字锁相环等硬件实现;输入判决器设置为从有效的多路时间源信号中选择最优的一路时间源信号进行时间同步,可由CPU(Central Processing Unit,中央处理器)和软件共同完成,同时CPU通常需要支持多种串口;延时补偿模块405可通过支持1588的PHY(Physical Layer,物理层)芯片或者专业芯片等实现。In addition, some modules in the time source selection device protected by the embodiment can be implemented not only in the form of software, but also in the form of hardware, even in a combination of software and hardware, such as the selection module 403 in FIG. And delay compensation module 405 (or selection module 503 and delay compensation module 505 in FIG. 5). The selection module 403 includes a signal detector and an input determiner, wherein the signal detector is configured to detect the validity of the time source signal, and may be a CPLD (Complex Programmable Logic Device) or a digital phase locked loop. Hardware implementation; the input determiner is configured to select an optimal one-time source signal for time synchronization from an effective multi-path source signal, which can be completed by a CPU (Central Processing Unit) and software, and the CPU usually needs to support A variety of serial ports; the delay compensation module 405 can be implemented by supporting a 1588 PHY (Physical Layer) chip or a professional chip.
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现所述的时间源选择方法。A computer readable storage medium storing computer executable instructions for implementing the time source selection method when executed by a processor.
本领域的技术人员应该明白,上述本发明实施例的每个模块或每个步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分 布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储介质(ROM/RAM、磁碟、光盘)中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成每个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。所以,本发明实施例不限制于任何特定的硬件和软件结合。It should be understood by those skilled in the art that each module or each step of the above embodiments of the present invention can be implemented by a general computing device, which can be concentrated on a single computing device, or Distributed on a network of computing devices, optionally, they can be implemented by program code executable by the computing device, so that they can be stored in a storage medium (ROM/RAM, disk, optical disk) The computing device is executed, and in some cases, the steps shown or described may be performed in an order different than that herein, or they may be fabricated separately for each integrated circuit module, or a plurality of modules thereof or The steps are made into a single integrated circuit module. Therefore, embodiments of the invention are not limited to any particular combination of hardware and software.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
工业实用性Industrial applicability
本发明实施例方案接收至少两路时间源信号,该时间源信号中包含PTP协议的时间源信号,或包含PTP协议的时间源信号和1PPS+TOD协议的时间源信号;将接收的PTP协议的时间源信号转换成1PPS+TOD协议的时间源信号,并从得到的一路或多路1PPS+TOD协议的时间源信号中选择一路作为系统最优时间源信号,然后将该系统最优时间源信号输出,使得设备在多种类型接口同时工作的情况下可自动选择一个最优时间源信号进行时间传递。而相关技术中,只能从每种时间协议的时间源信号中选择最优时间源,对于不同类型的时间源却无法进行自动选择,从而降低了时间同步的效率和可靠性。 本发明实施例提供的时间源选择方法,对于存在不同时间协议的时间源信号,能够选择最优的时间源信号进行传递,当发现选择的最优时间源信号质量降低时,会自动重新选择一个信号质量较优的时间源并进行切换,可选地提升了时间同步的精准性。 The solution of the embodiment of the present invention receives at least two time source signals, where the time source signal includes a time source signal of a PTP protocol, or a time source signal including a PTP protocol and a time source signal of a 1PPS+TOD protocol; and the received PTP protocol The time source signal is converted into a time source signal of the 1PPS+TOD protocol, and one of the time source signals of the obtained one or more 1PPS+TOD protocols is selected as the optimal time source signal of the system, and then the optimal time source signal of the system is selected. The output enables the device to automatically select an optimal time source signal for time transfer when multiple types of interfaces work simultaneously. In the related art, the optimal time source can only be selected from the time source signals of each time protocol, and the automatic selection cannot be performed for different types of time sources, thereby reducing the efficiency and reliability of time synchronization. The time source selection method provided by the embodiment of the present invention can select an optimal time source signal for the time source signal with different time protocols, and automatically select one when the selected optimal time source signal quality is reduced. Time source with better signal quality and switching, optionally improving the accuracy of time synchronization.

Claims (11)

  1. 一种时间源选择方法,包括:A time source selection method, including:
    接收至少两路时间源信号,所述时间源信号中包含精确时间协议的时间源信号,或者包含精确时间协议的时间源信号和秒脉冲+日时间协议的时间源信号;Receiving at least two time source signals, the time source signal including a time source signal of a precise time protocol, or a time source signal including a precise time protocol and a time source signal of a second pulse + day time protocol;
    将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号;Converting the time source signal of the precise time protocol into a time source signal of a second pulse + day time protocol;
    从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号;Selecting one channel from the obtained time source signal of one or more seconds pulse + day time protocol as the system optimal time source signal;
    将所述系统最优时间源信号作为同步时间源信号输出。The system optimal time source signal is output as a synchronous time source signal.
  2. 如权利要求1所述的时间源选择方法,其中,所述将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号包括:The time source selection method according to claim 1, wherein said converting the time source signal of said precise time protocol into a time source signal of a second pulse + day time protocol comprises:
    从接收的至少两路精确时间协议的时间源信号中选择最优时间源信号;Selecting an optimal time source signal from the received time source signals of at least two precise time protocols;
    将所述最优时间源信号转换成所述秒脉冲+日时间协议的时间源信号。The optimal time source signal is converted to a time source signal of the second pulse + day time protocol.
  3. 如权利要求1所述的时间源选择方法,其中,将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号还包括:The time source selection method according to claim 1, wherein converting the time source signal of the precise time protocol into the time source signal of the second pulse + day time protocol further comprises:
    将接收的一路或多路精确时间协议的时间源信号直接转换成秒脉冲+日时间协议的时间源信号。The time source signal of the received one or more precise time protocol is directly converted into a time source signal of the second pulse + day time protocol.
  4. 如权利要求1-3任一项所述的时间源选择方法,其中,所述从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号包括:The time source selection method according to any one of claims 1 to 3, wherein the selecting one of the time source signals of the obtained one or more second pulse + day time protocol as the system optimal time source signal comprises:
    检测得到的一路或多路秒脉冲+日时间协议的时间源信号的有效性;Detecting the validity of the time source signal of one or more seconds pulse + day time protocol;
    从有效的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为所述系统最优时间源信号。One of the time source signals of the effective one-way or multi-channel second pulse + day time protocol is selected as the optimal time source signal of the system.
  5. 如权利要求1-3任一项所述的时间源选择方法,所述方法还包括:在从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号之后,且在将所述系统最优时间源信号作为同步时间源信号 输出之前,对所述系统最优时间源信号进行延时补偿处理。The time source selection method according to any one of claims 1 to 3, further comprising: selecting one of the time source signals from the obtained one or more second pulse + day time protocol as the system optimal time source. After the signal, and the optimal time source signal of the system is used as the synchronous time source signal Before the output, delay compensation processing is performed on the optimal time source signal of the system.
  6. 一种时间源选择装置,包括:接收模块、转换模块、选择模块和输出模块;A time source selection device includes: a receiving module, a conversion module, a selection module, and an output module;
    所述接收模块,设置为接收至少两路时间源信号,所述时间源信号中包含精确时间协议的时间源信号,或者包含精确时间协议的时间源信号和秒脉冲+日时间协议的时间源信号;The receiving module is configured to receive at least two time source signals, where the time source signal includes a time source signal of a precise time protocol, or a time source signal including a precise time protocol and a time source signal of a second pulse + day time protocol ;
    所述转换模块,设置为将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号;The conversion module is configured to convert the time source signal of the precise time protocol into a time source signal of a second pulse + day time protocol;
    所述选择模块,设置为从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号;The selecting module is configured to select one path from the obtained time source signals of one or more seconds pulse + day time protocol as the system optimal time source signal;
    所述输出模块,设置为将所述系统最优时间源信号作为同步时间源信号输出。The output module is configured to output the optimal time source signal of the system as a synchronous time source signal.
  7. 如权利要求6所述的时间源选择装置,其中,所述转换模块包括:第一选择子模块和第一转换子模块;The time source selection device according to claim 6, wherein the conversion module comprises: a first selection submodule and a first conversion submodule;
    所述转换模块将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号包括:The conversion module converts the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol, including:
    所述第一选择子模块,设置为从接收的至少两路精确时间协议的时间源信号中选择最优时间源信号;The first selection submodule is configured to select an optimal time source signal from the received time source signals of at least two precise time protocols;
    所述第一转换子模块,设置为将所述最优时间源信号转换成所述秒脉冲+日时间协议的时间源信号。The first conversion submodule is configured to convert the optimal time source signal into a time source signal of the second pulse + day time protocol.
  8. 如权利要求6所述的时间源选择装置,其中,所述转换模块还包括:第二转换子模块;The time source selection device according to claim 6, wherein the conversion module further comprises: a second conversion submodule;
    所述转换模块将所述精确时间协议的时间源信号转换成秒脉冲+日时间协议的时间源信号还包括:Converting, by the conversion module, the time source signal of the precise time protocol into a time source signal of the second pulse + day time protocol further includes:
    所述第二转换子模块,设置为将接收的一路或多路精确时间协议的时间源信号直接转换成秒脉冲+日时间协议的时间源信号。The second conversion submodule is configured to directly convert the received time source signal of one or more precise time protocols into a time source signal of a second pulse + day time protocol.
  9. 如权利要求6-8任一项所述的时间源选择装置,其中,所述选择模块 包括:检测子模块和第二选择子模块;Time source selection device according to any of claims 6-8, wherein said selection module The method includes: a detection submodule and a second selection submodule;
    所述选择模块从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号包括:The selecting module selects one of the time source signals of the obtained one or more second pulse + day time protocol as the system optimal time source signal, including:
    所述检测子模块,设置为检测得到的一路或多路秒脉冲+日时间协议的时间源信号的有效性;The detecting submodule is configured to detect the validity of the obtained time source signal of one or more seconds pulse + day time protocol;
    所述第二选择子模块,设置为从有效的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为所述系统最优时间源信号。The second selection submodule is configured to select one of the time source signals of the effective one or more second pulse + day time protocol as the optimal time source signal of the system.
  10. 如权利要求6-8任一项所述的时间源选择装置,所述装置还包括延时补偿模块;所述延时补偿模块设置在所述选择模块和所述输出模块之间;The time source selection device according to any one of claims 6-8, further comprising a delay compensation module; the delay compensation module being disposed between the selection module and the output module;
    所述延时补偿模块,设置为在所述选择模块从得到的一路或多路秒脉冲+日时间协议的时间源信号中选择一路作为系统最优时间源信号之后,且在所述输出模块将所述系统最优时间源信号作为同步时间源信号输出之前,对所述系统最优时间源信号进行延时补偿处理。The delay compensation module is configured to select, after the selection module selects one of the time source signals of the obtained one or more seconds pulse + day time protocol as the system optimal time source signal, and in the output module Before the optimal time source signal of the system is output as the synchronous time source signal, delay compensation processing is performed on the optimal time source signal of the system.
  11. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现权利要求1至5任意一项所述的时间源选择方法。 A computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the time source selection method of any one of claims 1 to 5.
PCT/CN2016/086911 2016-03-10 2016-06-23 Time source selection method and device WO2017152540A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610134258.XA CN107181551A (en) 2016-03-10 2016-03-10 A kind of time source system of selection and device
CN201610134258.X 2016-03-10

Publications (1)

Publication Number Publication Date
WO2017152540A1 true WO2017152540A1 (en) 2017-09-14

Family

ID=59788865

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/086911 WO2017152540A1 (en) 2016-03-10 2016-06-23 Time source selection method and device

Country Status (2)

Country Link
CN (1) CN107181551A (en)
WO (1) WO2017152540A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515109A (en) * 2019-08-16 2019-11-29 中国航空工业集团公司西安飞行自动控制研究所 A kind of method and device merging the autonomous PNT time based on multiple information sources
CN112653533A (en) * 2020-12-17 2021-04-13 中国航空工业集团公司西安航空计算技术研究所 Intelligent time service management method for complex system
CN115499082A (en) * 2022-11-08 2022-12-20 电信科学技术第五研究所有限公司 Comprehensive source selection method based on multi-time source fusion

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107655475B (en) * 2017-11-03 2024-03-26 河南思维轨道交通技术研究院有限公司 Synchronous pulse signal acquisition method, navigation data synchronous processing method and system
CN112688752B (en) * 2019-10-18 2022-11-25 华为技术有限公司 Time synchronization method, message processing method and device for time synchronization
CN113641548A (en) * 2020-04-27 2021-11-12 北京小马智行科技有限公司 Control method and device for automatic driving vehicle and automatic driving vehicle
CN113271121B (en) * 2021-04-06 2022-08-05 北京大学 Cable transmission method
CN115442881A (en) * 2021-06-03 2022-12-06 中国移动通信有限公司研究院 Time source signal determination method, device, network equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070064851A1 (en) * 2005-09-02 2007-03-22 Sbc Knowledge Ventures Lp Method for synchronizing a customer edge router or customer premise equipment associated therewith
CN102006135A (en) * 2010-12-03 2011-04-06 北京华环电子股份有限公司 Method and device for selecting synchronous clock source
CN102036361A (en) * 2009-09-25 2011-04-27 华为技术有限公司 Processing method, device and system for clock source selection
WO2012062198A1 (en) * 2010-11-08 2012-05-18 中国移动通信集团公司 Time synchronization method and time synchronization device for mobile communications system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101923315A (en) * 2009-06-17 2010-12-22 华东电力试验研究院有限公司 Time synchronization method of electric power system and device thereof
CN101873187A (en) * 2010-05-25 2010-10-27 中兴通讯股份有限公司 Method and system of clock synchronization
CN202008583U (en) * 2010-12-30 2011-10-12 安徽工程大学 Clock source of synchronous phasor measuring device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070064851A1 (en) * 2005-09-02 2007-03-22 Sbc Knowledge Ventures Lp Method for synchronizing a customer edge router or customer premise equipment associated therewith
CN102036361A (en) * 2009-09-25 2011-04-27 华为技术有限公司 Processing method, device and system for clock source selection
WO2012062198A1 (en) * 2010-11-08 2012-05-18 中国移动通信集团公司 Time synchronization method and time synchronization device for mobile communications system
CN102006135A (en) * 2010-12-03 2011-04-06 北京华环电子股份有限公司 Method and device for selecting synchronous clock source

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515109A (en) * 2019-08-16 2019-11-29 中国航空工业集团公司西安飞行自动控制研究所 A kind of method and device merging the autonomous PNT time based on multiple information sources
CN112653533A (en) * 2020-12-17 2021-04-13 中国航空工业集团公司西安航空计算技术研究所 Intelligent time service management method for complex system
CN115499082A (en) * 2022-11-08 2022-12-20 电信科学技术第五研究所有限公司 Comprehensive source selection method based on multi-time source fusion
CN115499082B (en) * 2022-11-08 2023-03-10 电信科学技术第五研究所有限公司 Comprehensive source selection method based on multi-time source fusion

Also Published As

Publication number Publication date
CN107181551A (en) 2017-09-19

Similar Documents

Publication Publication Date Title
WO2017152540A1 (en) Time source selection method and device
CN105429725B (en) A kind of submicrosecond grade clock synchronizing method and system based on SOPC networkings
US8730868B2 (en) Network node, time synchronization method and network system
US8705578B2 (en) Method and system for implementing time synchronization in local area network (LAN)
CN103001720B (en) Time synchronization method and device
US8689035B2 (en) Communication system, communication interface, and synchronization method
US9264132B2 (en) Universal asymmetry compensation for packet timing protocols
US10165534B2 (en) Master synchronisation
US9876596B2 (en) Method and device for detecting fault in synchronization link
WO2020043181A1 (en) Clock synchronization method and apparatus, system, storage medium, and electronic device
US10444788B2 (en) Device, system, and method for synchronizing time partition windows
WO2017012486A1 (en) Otn network element and otn clock and time synchronization method and system
WO2018205811A1 (en) Clock synchronization method, time reference source device and clock reproduction device
EP2448168A1 (en) Method and system for bearing time synchronization protocol in optical transport network
JP7107393B2 (en) Monitoring system and synchronization method
US20220038252A1 (en) Methods, Apparatus and Computer-Readable Media for Synchronization Over an Optical Network
WO2020135198A1 (en) Clock synchronization method and device, and storage medium
WO2016106908A1 (en) Method and system for synchronizing clocks in sdh network
WO2021008532A1 (en) Active antenna unit delay alignment method and apparatus and active antenna unit
CN104683088B (en) Multi-reference synchronization method, device and system
WO2016058347A1 (en) Method and apparatus for implementing time and clock synchronization
CN201928290U (en) GPS (global positioning system), Beidou and pulse multi-benchmark PTP (picture transfer protocol) master clock
WO2015184763A1 (en) Method, apparatus and system for instructing to select synchronization time source
JPH10191473A (en) Monitor control system
CN106559867B (en) Fission type clock synchronization system and method between nodes in wireless network

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16893186

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16893186

Country of ref document: EP

Kind code of ref document: A1