WO2016177090A1 - 时钟同步方法及装置 - Google Patents

时钟同步方法及装置 Download PDF

Info

Publication number
WO2016177090A1
WO2016177090A1 PCT/CN2016/076004 CN2016076004W WO2016177090A1 WO 2016177090 A1 WO2016177090 A1 WO 2016177090A1 CN 2016076004 W CN2016076004 W CN 2016076004W WO 2016177090 A1 WO2016177090 A1 WO 2016177090A1
Authority
WO
WIPO (PCT)
Prior art keywords
station
delay
time point
local clock
predetermined data
Prior art date
Application number
PCT/CN2016/076004
Other languages
English (en)
French (fr)
Inventor
杨茂华
陶春寿
王帆
肖金锽
万娟
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016177090A1 publication Critical patent/WO2016177090A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter

Definitions

  • the present invention relates to the field of communications, and in particular to a clock synchronization method and apparatus.
  • GPS Global Position System
  • IEEE 1588 Institute for Electrical and Electronic Engineers
  • the timing accuracy cannot meet the requirements, and the satellite wireless communication cannot provide the Ethernet for the IEEE 1588 scheme to transmit the clock signal;
  • the air interface environment of the satellite system is complex and the transmission delay is large.
  • the GPS timing scheme although the theoretical accuracy can meet the requirements, the antenna is affected by the external environment, such as the rainy day signal will have a large rain attenuation, the antenna The work may be abnormal, which makes the maintenance of the project greatly difficult. Therefore, in the related art, there is a problem of high cost, complicated networking, and low timing accuracy when realizing master-slave network clock synchronization.
  • the present invention provides a clock synchronization method and apparatus to solve at least the problems of high cost, complex networking, and low timing accuracy when implementing master-slave network clock synchronization in the related art.
  • a clock synchronization method including: a first station located in a first network acquires a transmission time point at which a second station located in a second network transmits n predetermined data, wherein n predetermined data are transmitted from the second station to the first station along the same transmission path, n ⁇ 1; the first station according to the transmission time point of the n predetermined data, the first Receiving, by the station, a receiving time point of the n predetermined data, and delaying, adjusting a first local clock of the first station to be synchronized with a second local clock of the second station, where the delay is A delay of the predetermined delay test data transmitted from the second station to the first station along the transmission path.
  • the first station according to the sending time point of the n predetermined data, the receiving time point of receiving the n predetermined data by the first station, and delaying the first station Adjusting the first local clock to be synchronized with the second local clock of the second station includes: the first station according to the sending time point of the n predetermined data, Receiving, by the first station, a receiving time point of the n predetermined data, and the time delay obtaining a time difference between the first local clock and the second local clock; The time difference adjusts a phase of the first local clock to cause a first local clock of the first station to be adjusted to be synchronized with a second local clock of the second station.
  • the first station obtains the first time according to the sending time point of the n predetermined data, the receiving time point at which the first station receives the n predetermined data, and the time delay
  • the time difference between a local clock and the second local clock includes: the first station determining the time difference Offset by the following formula: The Offseti is the first local clock and the first obtained according to the transmission time point of the ith predetermined data, the reception time point at which the first station receives the ith predetermined data, and the delay.
  • An i-th time difference between the two local clocks; the NCRi is a transmission time point of the ith predetermined data; the Df is the time delay; and the LCRi is received by the first station The reception time point of i scheduled data.
  • the first station adjusts a phase of the first local clock according to the time difference, so that a first local clock of the first site is adjusted to a second local clock with the second site.
  • Synchronizing includes: when the time difference value is a value greater than 0, the first station increases a phase of the first local clock
  • the Offset is the time difference, the T is a period of the first local clock; when the time difference is a value less than 0, the first station will be the first local clock Phase reduction
  • the Offset is the time difference, and the T is a period of the first local clock.
  • the method further includes: the first station acquiring the link of the satellite relay Delay; the first station determines the delay by a sum of a link delay of the satellite relay and a predetermined hardware inherent delay.
  • the link delay of the first station acquiring the satellite relay includes one of the following:
  • a clock synchronization apparatus the apparatus being applied to a first station located in a first network, comprising: a first acquisition module configured to acquire a second located in a second network Sending, by the station, a transmission time point of n predetermined data, wherein the n predetermined data are transmitted from the second station to the first station along the same transmission path, n ⁇ 1; and an adjustment module is set according to the The transmission time point of n predetermined data, the reception time point at which the first station receives the n predetermined data, and the delay adjusts the first local clock of the first station to the second A second local clock synchronization of the station, wherein the delay is a delay of the predetermined delay test data transmitted from the second station to the first station along the transmission path.
  • the adjusting module includes: an obtaining unit, configured to receive, according to the sending time point of the n predetermined data, a receiving time point at which the first station receives the n predetermined data, and the Delaying the time difference between the first local clock and the second local clock; the adjusting unit is configured to adjust a phase of the first local clock according to the time difference, so that the first The first local clock of the station is adjusted to be synchronized with the second local clock of the second station.
  • the obtaining unit obtains the time difference value by determining the time difference offset by the following formula:
  • the Offseti is the first local clock and the first obtained according to the transmission time point of the ith predetermined data, the reception time point at which the first station receives the ith predetermined data, and the delay.
  • the adjusting unit includes: a first adjusting subunit, configured to increase a phase of the first local clock when the time difference value is a value greater than 0
  • the Offset is the time difference
  • the T is a period of the first local clock
  • the second adjustment subunit is set to be when the time difference is a value less than 0.
  • Phase reduction of a local clock The Offset is the time difference
  • the T is a period of the first local clock.
  • the device further includes: a second acquiring module configured to acquire a link delay of the satellite relay; a determining module configured to link delay through the satellite relay and a predetermined hardware inherent time The sum of the delays determines the delay.
  • the second obtaining module acquires the link delay of the satellite relay by using one of the following manners:
  • T d (t2 - t1) ⁇ 2, where t1 is a first time point at which the second station transmits the delay test data, and t2 is a second time point at which the satellite relay receives the delay test data;
  • T d (t2-t1) ⁇ 2, where t1 is the first time point at which the second station sends the delay test data And t2 is a second time point at which the satellite relay receives the delay test data.
  • a first station located in the first network acquires a transmission time point at which the second station located in the second network transmits n predetermined data, wherein the n predetermined data are along the same transmission path from the Transmitting, by the first station, the first station, n ⁇ 1; receiving, by the first station, the receiving time of the n predetermined data according to the sending time point of the n predetermined data Pointing, and delaying, adjusting a first local clock of the first station to be synchronized with a second local clock of the second station, wherein the delay is a predetermined delay test data along the transmission path The delay from the second station to the first station.
  • the invention solves the problems of high cost, complex networking, and low timing precision when implementing master-slave network clock synchronization in the related art, thereby achieving the effects of reducing clock synchronization cost, reducing networking complexity, and improving positioning accuracy.
  • FIG. 1 is a flow chart of a clock synchronization method according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing the structure of a clock synchronization apparatus according to an embodiment of the present invention
  • FIG. 3 is a block diagram showing the structure of an adjustment module 24 in a clock synchronization apparatus according to an embodiment of the present invention
  • FIG. 4 is a block diagram showing the structure of an adjustment unit 34 in a clock synchronization apparatus according to an embodiment of the present invention
  • FIG. 5 is a block diagram showing a preferred structure of a clock synchronization apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of interaction of a primary station, a relay, and an end station according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a clock synchronization method according to an embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
  • Step S102 the first station located in the first network acquires a transmission time point at which the second station located in the second network sends n predetermined data, where the n predetermined data are transmitted from the second station to the same transmission path.
  • Step S104 the first station adjusts the first local clock of the first station to the second station according to the sending time point of the n predetermined data, the receiving time point of receiving the n predetermined data by the first station, and the delay The second local clock synchronization, wherein the delay is a delay of the predetermined delay test data transmitted from the second station to the first station along the transmission path.
  • the first network may be a slave network
  • the second network may be a master network.
  • the first station sends a first local clock of the first station according to a sending time point of the n predetermined data, a receiving time point at which the first station receives n predetermined data, and a delay Adjusting to the second local clock synchronization with the second station includes: the first station obtains the first local according to the transmission time point of the n predetermined data, the reception time point at which the first station receives the n predetermined data, and the delay a time difference between the clock and the second local clock; the first station adjusts a phase of the first local clock according to the time difference, so that the first local clock of the first station is adjusted to the second local clock with the second station Synchronize. That is, the time difference between the first station and the second station is determined first, and then the local clock of the first station is adjusted according to the determined time difference, so that the simple and fast synchronization between the first station and the second station can be achieved.
  • the purpose of the clock is not limited to the first clock.
  • the first station obtains the first local clock and the second local according to a sending time point of the n predetermined data, a receiving time point at which the first station receives n predetermined data, and the foregoing delay.
  • the time difference between the clocks includes: the first station determines the time difference Offset by the following formula:
  • the Offseti is the ith time between the first local clock and the second local clock obtained according to the transmission time point of the ith predetermined data, the reception time point at which the first station receives the ith predetermined data, and the delay.
  • Time difference; NCRi is the transmission time point of the i-th predetermined data; Df is the above-mentioned delay;
  • LCRi is the reception time point at which the first station receives the ith predetermined data.
  • the first station adjusts a phase of the first local clock according to the time difference, so that the first local clock of the first station is adjusted to be synchronized with the second local clock of the second station, including: When the time difference is a value greater than 0, the first station increases the phase of the first local clock
  • the Offset is a time difference, and T is a period of the first local clock; when the time difference is less than 0, the first station reduces the phase of the first local clock.
  • Offset is the time difference and T is the period of the first local clock.
  • the foregoing first station obtains the foregoing delay in multiple manners.
  • the first station located in the first network acquires the second station located in the second network to send the first predetermined data.
  • the method further includes: obtaining, by the first station, a link delay of the satellite relay; and determining, by the first station, the delay by using a total of a link delay of the satellite relay and a predetermined hardware inherent delay.
  • the delay of the link of the satellite relay may be obtained in multiple ways.
  • the link delay may be acquired by the second node, and the link delay may be acquired by the first node itself, or the satellite may be acquired.
  • the link delay determined by the relay is described below.
  • the first station receives the delay test data sent by the second station that is forwarded by the satellite relay, where the delay test data carries the first time point t1 and the satellite in which the second station sends the delay test data.
  • the first station receives the delay test data sent by the second station forwarded by the satellite relay, where the delay test data carries the link delay determined by the satellite relay, where the satellite relay can pass
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • a clock synchronization device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again.
  • the term “module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 2 is a structural block diagram of a clock synchronization apparatus according to an embodiment of the present invention.
  • the apparatus may be applied to a first station located in a first network. As shown in FIG. 2, the apparatus includes a first acquisition module 22 and an adjustment module 24. The device will be described below.
  • the first obtaining module 22 is configured to acquire a sending time point of the second station located in the second network to send n predetermined data, where the n predetermined data are transmitted from the second station to the first station along the same transmission path, n ⁇ 1; an adjustment module 24, connected to the first acquisition module 22, configured to receive a time point according to the transmission time of the n predetermined data, a reception time point at which the first station receives n predetermined data, and a time delay will be first
  • the first local clock of the station is adjusted to be synchronized with the second local clock of the second station, wherein the delay is a delay of the predetermined delay test data transmitted from the second station to the first station along the transmission path.
  • FIG. 3 is a structural block diagram of an adjustment module 24 in a clock synchronization apparatus according to an embodiment of the present invention. As shown in FIG. 3, the adjustment module 24 includes an obtaining unit 32 and an adjusting unit 34. The adjustment module 24 will be described below.
  • the obtaining unit 32 is configured to obtain a time between the first local clock and the second local clock according to the sending time point of the n predetermined data, the receiving time point at which the first station receives the n predetermined data, and the time delay a difference unit;
  • the adjusting unit 34 is connected to the obtaining unit 32, and configured to adjust a phase of the first local clock according to the time difference to adjust the first local clock of the first station to the second local clock of the second station Synchronize.
  • the obtaining unit 32 may obtain the time difference value by: determining the time difference offset by the following formula:
  • the Offseti is the ith time between the first local clock and the second local clock obtained according to the transmission time point of the ith predetermined data, the reception time point at which the first station receives the ith predetermined data, and the delay.
  • the difference is; NCRi is the transmission time point of the ith predetermined data; Df is the delay; LCRi is the reception time point at which the first station receives the ith predetermined data.
  • FIG. 4 is a block diagram showing the structure of an adjustment unit 34 in a clock synchronization apparatus according to an embodiment of the present invention. As shown in FIG. 4, the adjustment unit 34 includes a first adjustment subunit 42 and/or a second adjustment subunit 44. This adjustment unit 34 will be described.
  • the first adjusting sub-unit 42 is configured to increase the phase of the first local clock when the time difference value is greater than 0
  • the Offset is a time difference
  • T is a period of the first local clock.
  • the second adjustment subunit 44 is configured to reduce the phase of the first local clock when the time difference is less than 0.
  • the Offset is a time difference
  • T is a period of the first local clock.
  • FIG. 5 is a block diagram of a preferred structure of a clock synchronization apparatus according to an embodiment of the present invention. As shown in FIG. 5, the apparatus includes a second acquisition module 52 and a determination module 54 in addition to all the modules shown in FIG. The device will be described.
  • the second obtaining module 52 is configured to acquire a link delay of the satellite relay; the determining module 54 is connected to the second obtaining module 52 and the first acquiring module 22, and is configured to be acquired according to the received delay test data. Delay.
  • the second acquiring module 52 may obtain the link delay of the satellite relay by using one of the following manners:
  • T d (t2-t1) ⁇ 2, where And t1 is a first time point at which the second station sends the delay test data, and t2 is a second time point at which the satellite relay receives the delay test data;
  • T d (t2-t1) ⁇ 2;
  • T d (t2 - t1) ⁇ 2
  • t1 is the first time point at which the second station transmits the delay test data
  • t2 is the satellite relay receiving the delay test data. The second time point.
  • the foregoing sending time point may be carried in the foregoing predetermined data, where the predetermined data may be sent in the form of frame data, and the first network is the slave network and the second The network is the main network as an example.
  • the first step define the respective architecture of the master-slave network.
  • the main network is mainly composed of the primary station A (the same second station as above).
  • the satellite relay G, the slave network is mainly composed of the end station F (same as the first station described above).
  • Step 2 The primary station A transmits the altitude measurement data with the timing information (the same delay test data as above), and forwards it through the relay G, and the terminal station F receives the data forwarded by the G, and calculates the satellite ranging link.
  • Delay plus hardware delay, that is, the data delay sent by the primary station A to the secondary station F is Df.
  • the third step the primary station A sends the frame data with the timing information, and the timing information detected by the terminal station F, that is, the transmission time point is that the primary station A counts with the local clock CLOCK_A of the primary station A as a reference.
  • the count result is given to the end station F; when the timing information is detected when the frame i (i.e., the i-th frame data) is transmitted, the count value is recorded as NCRi.
  • the terminal station F decodes the data each time, and detects the timing information, that is, the reception time point is also counted based on the local clock CLOCK_F, and the count value is recorded as LCRi when the timing information is detected when the frame i is received.
  • the voltage of the Oven Controlled Crystal Oscillator (OCXO for short) realizes the real-time synchronization of the clock of the master-slave network.
  • the main station A transmits frame data with timing information by the primary station A, and the timing information can be at any position of the transmission frame; after the primary station A transmits the frame data to the relay (ie, the above-mentioned satellite relay G) The relay then transmits the frame data to the end station F, and the end station F receives the frame data from the air interface.
  • the relay ie, the above-mentioned satellite relay G
  • the relay transmits the frame data to the end station F, and the end station F receives the frame data from the air interface.
  • FIG. 6 is a schematic diagram of interaction between the primary station, the relay, and the end station according to an embodiment of the present invention.
  • the value of the delay Df of data from the primary station A to the secondary station F is determined by the following values:
  • D path (T d above) is the link delay and D hw is the hardware delay.
  • the primary station A transmits the frame data with the timing information, and the timing information detected by the terminal station F is that the primary station A counts on the basis of the local clock CLOCK_A, and gives the counting result to the end station F;
  • the count value is recorded as NCRi.
  • the detected timing information is also counted based on the local clock CLOCK_F, and the count value is recorded as LCRi when the timing information is detected when the frame i is received.
  • the master-slave network clock is synchronized in real time.
  • Embodiment 1 Satellite communication system, the primary station A fixes the timing information at the frame header position.
  • the primary station A transmits frame data with timing information in the frame header. Each time the timing information is detected, the primary station A counts based on the local 3.84 M clock, and the count value is recorded as NCRi when the timing information is detected when the frame i is transmitted.
  • the satellite transponder acts as a relay G.
  • the end station F solves the data each time, and the detected timing information is also counted based on the local 61.44 M clock.
  • the count value is recorded as LCRi.
  • the delay value Df of the frame data from the primary station A to the terminal station F is 120.3 ms.
  • the primary station A calculates the Offseti value to adjust the phase of the end station for 10 ms, and adjusts the voltage of the OCXO by acquiring the values of the real-time NCR and LCR, thereby realizing the clock synchronization of the master-slave network.
  • Embodiment 2 Satellite communication system, the primary station A fixes the timing information at the end of the frame.
  • the primary station A transmits frame data with timing information at the end of the frame, and each time the timing information is detected, the primary station A counts based on the local 3.84 M clock, and the count value is recorded as NCRi when the timing information is detected when the frame i is transmitted.
  • the satellite transponder acts as a relay G.
  • the end station F solves the data each time, and the detected timing information is also counted based on the local 61.44 M clock.
  • the count value is recorded as LCRi.
  • the delay value Df of the frame data from the primary station A to the terminal station F is 120.3 ms.
  • the primary station A calculates the Offseti value to adjust the phase of the end station for 10 ms, and adjusts the voltage of the OCXO by acquiring the values of the real-time NCR and LCR, thereby realizing the clock synchronization of the master-slave network.
  • Embodiment 3 Satellite communication system, the primary station A fixes the timing information in the middle of the frame.
  • the primary station A transmits frame data with timing information in the middle of the frame. Each time the timing information is detected, the primary station A counts based on the local 3.84 M clock, and the count value is recorded as NCRi when the timing information is detected when the frame i is transmitted.
  • the satellite transponder acts as a relay G.
  • the end station F solves the data each time, and the detected timing information is also counted based on the local 61.44 M clock.
  • the count value is recorded as LCRi.
  • the delay value Df of the frame data from the primary station A to the terminal station F is 120.3 ms.
  • the primary station A calculates the Offseti value to adjust the phase of the end station for 10 ms, and adjusts the voltage of the OCXO by acquiring the values of the real-time NCR and LCR, thereby realizing the clock synchronization of the master-slave network.
  • Embodiment 4 Satellite communication system, the timing information is variable in the position of the frame transmitted by the primary station A.
  • the primary station A transmits frame data with timing information, and the timing information is at any position of the frame. Each time the timing information is detected, the primary station A counts based on the local 3.84 M clock, and the count value is recorded as NCRi when the timing information is detected when the frame i is transmitted.
  • the satellite transponder acts as a relay G.
  • the end station F solves the data each time, and the detected timing information is also counted based on the local 61.44 M clock.
  • the count value is recorded as LCRi.
  • the delay value Df of the frame data from the primary station A to the terminal station F is 120.3 ms.
  • the primary station A calculates the Offseti value to adjust the phase of the end station for 10 ms, and adjusts the voltage of the OCXO by acquiring the values of the real-time NCR and LCR, thereby realizing the clock synchronization of the master-slave network.
  • the master-slave network has high system timing precision and has a wide networking range when the networking is simple and does not depend on Ethernet. And through special processing of the transmitted frame data, the network master-slave synchronization is realized, the networking cost is low, the coverage is wide, and the timing precision can reach the hundred nanosecond level, which can meet the requirements of some communication systems.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the first station located in the first network acquires a transmission time point at which the second station located in the second network sends n predetermined data, where the n predetermined data are transmitted from the second station to the same along the same transmission path.
  • the first station adjusts the first local clock of the first station to the second station according to a sending time point of the n predetermined data, a receiving time point at which the first station receives the n predetermined data, and a delay.
  • the second local clock is synchronized, wherein the delay is a delay of the predetermined delay test data transmitted from the second station to the first station along the transmission path.
  • the foregoing storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), and a Random Access Memory (RAM).
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • the processor performs the above steps S1-S2 according to the stored program code in the storage medium.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the clock synchronization method and apparatus have the following beneficial effects: solving the problem of high cost, complex networking, and low timing accuracy when implementing master-slave network clock synchronization in the related art.
  • the cost of clock synchronization is reduced, the complexity of the networking is reduced, and the positioning accuracy is improved.

Landscapes

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

Abstract

本发明提供了一种时钟同步方法及装置,该方法包括:位于第一网络中的第一站点获取位于第二网络中的第二站点发送n个预定数据的发送时间点,其中,该n个预定数据沿相同的传输路径从第二站点传输到第一站点,n≥1;上述第一站点根据n个预定数据的发送时间点、第一站点接收到该n个预定数据的接收时间点、以及时延将第一站点的第一本地时钟调整到与第二站点的第二本地时钟同步,其中,上述时延为预先确定的时延测试数据沿上述传输路径从第二站点传输到第一站点的时延。从而解决了相关技术中存在的在实现主从网络时钟同步时,成本高、组网复杂、定时精度低的问题,进而达到了降低时钟同步的成本,降低组网复杂度以及提高定位精度的效果。

Description

时钟同步方法及装置 技术领域
本发明涉及通信领域,具体而言,涉及一种时钟同步方法及装置。
背景技术
以往的无线系统,从网络几乎均采用全球定位系统(Global Position System,简称为GPS)或者电气和电子工程师协会(Institute for Electrical and Electronic Engineers,简称为IEEE)1588作为系统定时方案。二者各有优缺点:GPS定时方案,定时精度高,可达20ns左右,但需要外加天线,组网成本高,工程维护也比较复杂;IEEE 1588定时方案,无需外加天线,相对GPS定时方案来说,组网成本低,工程维护简单,但需要通过以太网数据线来传送时钟信号,仍要组网,且定时精度不高,一般在微秒级,达不到某些系统的对于组网和精度的要求。例如,在卫星通讯系统中,对从网络定时精度要求在百纳秒左右,若采用IEEE 1588方案,定时精度达不到要求,且卫星无线通讯也无法提供以太网供IEEE 1588方案传输时钟信号;此外,卫星系统空口环境复杂,传输时延大,若使用GPS定时方案,虽然理论上精度能达到要求,但由于天线受外界环境影响比较大,比如下雨天信号会有较大的雨衰,天线工作可能会出现异常,使得工程维护难度大大增加。因此,在相关技术中,存在着在实现主从网络时钟同步时,成本高、组网复杂、定时精度低的问题。
针对相关技术中存在的在实现主从网络时钟同步时,成本高、组网复杂、定时精度低的问题,目前尚未提出有效的解决方案。
发明内容
本发明提供了一种时钟同步方法及装置,以至少解决相关技术中存在的在实现主从网络时钟同步时,成本高、组网复杂、定时精度低的问题。
根据本发明的一个方面,提供了一种时钟同步方法,包括:位于第一网络中的第一站点获取位于第二网络中的第二站点发送n个预定数据的发送时间点,其中,所述n个预定数据沿相同的传输路径从所述第二站点传输到所述第一站点,n≥1;所述第一站点根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及时延将所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步,其中,所述时延为预先确定的时延测试数据沿所述传输路径从所述第二站点传输到所述第一站点的时延。
可选地,所述第一站点根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及时延将所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步包括:所述第一站点根据所述n个预定数据的所述发送时间点、 所述第一站点接收到所述n个预定数据的接收时间点、以及所述时延得到所述第一本地时钟与所述第二本地时钟之间的时间差值;所述第一站点根据所述时间差值调整所述第一本地时钟的相位,以使得所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步。
可选地,所述第一站点根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及所述时延得到所述第一本地时钟与所述第二本地时钟之间的时间差值包括:所述第一站点通过如下公式确定所述时间差值Offset:
Figure PCTCN2016076004-appb-000001
其中,所述Offseti为根据第i个预定数据的发送时间点、所述第一站点接收到第i个预定数据的接收时间点以及所述时延得到的所述第一本地时钟与所述第二本地时钟之间的第i个时间差值;所述NCRi为所述第i个预定数据的发送时间点;所述Df为所述时延;所述LCRi为所述第一站点接收到第i个预定数据的接收时间点。
可选地,所述第一站点根据所述时间差值调整所述第一本地时钟的相位,以使得所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步包括:当所述时间差值为大于0的数值时,所述第一站点将所述第一本地时钟的相位增加
Figure PCTCN2016076004-appb-000002
其中,所述Offset为所述时间差值,所述T为所述第一本地时钟的周期;当所述时间差值为小于0的数值时,所述第一站点将所述第一本地时钟的相位减小
Figure PCTCN2016076004-appb-000003
其中,所述Offset为所述时间差值,所述T为所述第一本地时钟的周期。
可选地,在位于第一网络中的第一站点获取位于第二网络中的第二站点发送第一预定数据的发送时间点之前,还包括:所述第一站点获取卫星中继的链路时延;所述第一站点通过所述卫星中继的链路时延和预先确定的硬件固有时延的总和确定所述时延。
可选地,所述第一站点获取所述卫星中继的链路时延包括以下之一:
所述第一站点接收所述第二站点在确定了所述链路时延后广播的所述链路时延,其中,所述第二站点通过如下公式确定所述链路时延Td:Td=(t2-t1)×2,其中,t1为所述第二站点发送所述时延测试数据的第一时间点,t2为所述卫星中继接收到所述时延测试数据的第二时间点;
所述第一站点接收经由所述卫星中继转发的所述第二站点发送的所述时延测试数据,其中,所述时延测试数据中携带有所述第二站点发送所述时延测试数据的第一时间点t1和所述 卫星中继接收到所述时延测试数据的第二时间点t2;所述第一站点根据如下公式确定所述链路时延Td:Td=(t2-t1)×2;
所述第一站点接收经由所述卫星中继转发的所述第二站点发送的所述时延测试数据,其中,所述时延测试数据中携带有所述卫星中继确定的所述链路时延,其中,所述卫星中继通过如下公式确定所述链路时延Td:Td=(t2-t1)×2,其中,t1为所述第二站点发送所述时延测试数据的第一时间点,t2为所述卫星中继接收到所述时延测试数据的第二时间点。
根据本发明的另一方面,提供了一种时钟同步装置,所述装置应用于位于第一网络中的第一站点中,包括:第一获取模块,设置为获取位于第二网络中的第二站点发送n个预定数据的发送时间点,其中,所述n个预定数据沿相同的传输路径从所述第二站点传输到所述第一站点,n≥1;调整模块,设置为根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及时延将所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步,其中,所述时延为预先确定的时延测试数据沿所述传输路径从所述第二站点传输到所述第一站点的时延。
可选地,所述调整模块包括:获得单元,设置为根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及所述时延得到所述第一本地时钟与所述第二本地时钟之间的时间差值;调整单元,设置为根据所述时间差值调整所述第一本地时钟的相位,以使得所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步。
可选地,所述获得单元通过如下方式得到所述时间差值:通过如下公式确定所述时间差值Offset:
Figure PCTCN2016076004-appb-000004
其中,所述Offseti为根据第i个预定数据的发送时间点、所述第一站点接收到第i个预定数据的接收时间点以及所述时延得到的所述第一本地时钟与所述第二本地时钟之间的第i个时间差值;所述NCRi为所述第i个预定数据的发送时间点;所述Df为所述时延;所述LCRi为所述第一站点接收到第i个预定数据的接收时间点。
可选地,所述调整单元包括:第一调整子单元,设置为当所述时间差值为大于0的数值时,将所述第一本地时钟的相位增大
Figure PCTCN2016076004-appb-000005
其中,所述Offset为所述时间差值,所述T为所述第一本地时钟的周期;第二调整子单元,设置为当所述时间差值为小于0的数值时,将所述第一本地时钟的相位减小
Figure PCTCN2016076004-appb-000006
其中,所述Offset为所述时间差值, 所述T为所述第一本地时钟的周期。
可选地,所述装置还包括:第二获取模块,设置为获取卫星中继的链路时延;确定模块,设置为通过所述卫星中继的链路时延和预先确定的硬件固有时延的总和确定所述时延。
可选地,所述第二获取模块通过如下方式之一获取所述卫星中继的所述链路时延:
接收所述第二站点在确定了所述链路时延后广播的所述链路时延,其中,所述第二站点通过如下公式确定所述链路时延Td:Td=(t2-t1)×2,其中,t1为所述第二站点发送所述时延测试数据的第一时间点,t2为所述卫星中继接收到所述时延测试数据的第二时间点;
接收经由所述卫星中继转发的所述第二站点发送的所述时延测试数据,其中,所述时延测试数据中携带有所述第二站点发送所述时延测试数据的第一时间点t1和所述卫星中继接收到所述时延测试数据的第二时间点t2;根据如下公式确定所述链路时延Td:Td=(t2-t1)×2;
接收经由所述卫星中继转发的所述第二站点发送的所述时延测试数据,其中,所述时延测试数据中携带有所述卫星中继确定的所述链路时延,其中,所述卫星中继通过如下公式确定所述链路时延Td;Td=(t2-t1)×2,其中,t1为所述第二站点发送所述时延测试数据的第一时间点,t2为所述卫星中继接收到所述时延测试数据的第二时间点。
通过本发明,采用位于第一网络中的第一站点获取位于第二网络中的第二站点发送n个预定数据的发送时间点,其中,所述n个预定数据沿相同的传输路径从所述第二站点传输到所述第一站点,n≥1;所述第一站点根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及时延将所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步,其中,所述时延为预先确定的时延测试数据沿所述传输路径从所述第二站点传输到所述第一站点的时延。解决了相关技术中存在的在实现主从网络时钟同步时,成本高、组网复杂、定时精度低的问题,进而达到了降低时钟同步的成本,降低组网复杂度以及提高定位精度的效果。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的时钟同步方法的流程图;
图2是根据本发明实施例的时钟同步装置的结构框图;
图3是根据本发明实施例的时钟同步装置中调整模块24的结构框图;
图4是根据本发明实施例的时钟同步装置中调整单元34的结构框图;
图5是根据本发明实施例的时钟同步装置的优选结构框图;
图6是根据本发明实施例的主站、中继、端站的交互示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
在本实施例中提供了一种时钟同步方法,图1是根据本发明实施例的时钟同步方法的流程图,如图1所示,该流程包括如下步骤:
步骤S102,位于第一网络中的第一站点获取位于第二网络中的第二站点发送n个预定数据的发送时间点,其中,该n个预定数据沿相同的传输路径从第二站点传输到第一站点,n≥1;
步骤S104,上述第一站点根据n个预定数据的发送时间点、第一站点接收到该n个预定数据的接收时间点、以及时延将第一站点的第一本地时钟调整到与第二站点的第二本地时钟同步,其中,上述时延为预先确定的时延测试数据沿上述传输路径从第二站点传输到第一站点的时延。
其中,上述的第一网络可以为从网络,上述的第二网络可以为主网络。通过上述步骤,利用数据的发送时间点、接收时间点以及数据发送过程中的时延来同步第一站点和第二站点的时钟,从而无需额外组网调整时钟,并且,数据的发送时间点和接收时间点都是唯一确定的,不会存在误差,因此,时钟调整的精度高,解决了相关技术中存在的在实现主从网络时钟同步时,成本高、组网复杂、定时精度低的问题,进而达到了降低时钟同步的成本,降低组网复杂度以及提高定位精度的效果。
在一个可选的实施例中,上述第一站点根据上述n个预定数据的发送时间点、第一站点接收到n个预定数据的接收时间点、以及时延将第一站点的第一本地时钟调整到与第二站点的第二本地时钟同步包括:第一站点根据n个预定数据的发送时间点、第一站点接收到上述n个预定数据的接收时间点、以及上述时延得到第一本地时钟与第二本地时钟之间的时间差值;上述第一站点根据时间差值调整第一本地时钟的相位,以使得第一站点的第一本地时钟调整到与第二站点的第二本地时钟同步。即,先确定第一站点和第二站点的时间差值,然后,可以根据确定的时间差值调整第一站点的本地时钟,从而可以达到简单快速的同步第一站点和第二站点之间的时钟的目的。
在一个可选的实施例中,上述第一站点根据n个预定数据的发送时间点、第一站点接收 到n个预定数据的接收时间点、以及上述时延得到第一本地时钟与第二本地时钟之间的时间差值包括:第一站点通过如下公式确定时间差值Offset:
Figure PCTCN2016076004-appb-000007
其中,Offseti为根据第i个预定数据的发送时间点、第一站点接收到第i个预定数据的接收时间点以及上述时延得到的第一本地时钟与第二本地时钟之间的第i个时间差值;NCRi为第i个预定数据的发送时间点;Df为上述时延;LCRi为第一站点接收到第i个预定数据的接收时间点。
在一个可选的实施例中,上述第一站点根据上述时间差值调整第一本地时钟的相位,以使得第一站点的第一本地时钟调整到与第二站点的第二本地时钟同步包括:当上述时间差值为大于0的数值时,第一站点将第一本地时钟的相位增大
Figure PCTCN2016076004-appb-000008
其中,该Offset为时间差值,T为第一本地时钟的周期;当上述时间差值为小于0的数值时,第一站点将第一本地时钟的相位减小
Figure PCTCN2016076004-appb-000009
其中,Offset为时间差值,T为第一本地时钟的周期。
上述的第一站点获取上述时延的方式有多种,在一个可选的实施例中,在位于第一网络中的第一站点获取位于第二网络中的第二站点发送第一预定数据的发送时间点之前,还包括:该第一站点获取卫星中继的链路时延;第一站点通过上述卫星中继的链路时延和预先确定的硬件固有时延的总和确定上述时延。
其中,在获取卫星中继的链路时延时,可以有多种获取方式,可以通过第二节点获取该链路时延,可以通过第一节点本身获取该链路时延,也可以获取卫星中继确定的链路时延,下面分别对上述方式进行说明:
上述第一站点接收第二站点在确定了上述链路时延后广播的链路时延,其中,该第二站点通过如下公式确定上述链路时延Td:Td=(t2-t1)×2,其中,t1为第二站点发送时延测试数据的第一时间点,t2为卫星中继接收到所述时延测试数据的第二时间点;
上述第一站点接收经由卫星中继转发的上述第二站点发送的时延测试数据,其中,该时延测试数据中携带有第二站点发送上述时延测试数据的第一时间点t1和卫星中继接收到上述时延测试数据的第二时间点t2;该第一站点根据如下公式确定上述链路时延Td:Td=(t2-t1)×2;
上述第一站点接收经由卫星中继转发的第二站点发送的时延测试数据,其中,该时延测试数据中携带有卫星中继确定的上述链路时延,其中,该卫星中继可以通过如下公式确定上 述链路时延Td:Td=(t2-t1)×2,其中,t1为第二站点发送上述时延测试数据的第一时间点,t2为卫星中继接收到上述时延测试数据的第二时间点。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
在本实施例中还提供了一种时钟同步装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图2是根据本发明实施例的时钟同步装置的结构框图,该装置可以应用于位于第一网络中的第一站点中,如图2所示,该装置包括第一获取模块22和调整模块24,下面对该装置进行说明。
第一获取模块22,设置为获取位于第二网络中的第二站点发送n个预定数据的发送时间点,其中,该n个预定数据沿相同的传输路径从第二站点传输到第一站点,n≥1;调整模块24,连接至上述第一获取模块22,设置为根据上述n个预定数据的发送时间点、第一站点接收到n个预定数据的接收时间点、以及时延将第一站点的第一本地时钟调整到与第二站点的第二本地时钟同步,其中,上述时延为预先确定的时延测试数据沿传输路径从第二站点传输到第一站点的时延。
图3是根据本发明实施例的时钟同步装置中调整模块24的结构框图,如图3所示,该调整模块24包括获得单元32和调整单元34,下面对该调整模块24进行说明。
获得单元32,设置为根据上述n个预定数据的发送时间点、第一站点接收到上述n个预定数据的接收时间点、以及上述时延得到第一本地时钟与第二本地时钟之间的时间差值;调整单元34,连接至上述获得单元32,设置为根据上述时间差值调整第一本地时钟的相位,以使得第一站点的第一本地时钟调整到与第二站点的第二本地时钟同步。
在一个可选的实施例中,上述获得单元32可以通过如下方式得到上述时间差值:通过如下公式确定上述时间差值Offset:
Figure PCTCN2016076004-appb-000010
其中,Offseti为根据第i个预定数据的发送时间点、第一站点接收到第i个预定数据的接收时间点以及时延得到的第一本地时钟与第二本地时钟之间的第i个时间差值;NCRi为第i个预 定数据的发送时间点;Df为时延;LCRi为第一站点接收到第i个预定数据的接收时间点。
图4是根据本发明实施例的时钟同步装置中调整单元34的结构框图,如图4所示,该调整单元34包括第一调整子单元42和/或第二调整子单元44,下面对该调整单元34进行说明。
第一调整子单元42,设置为当上述时间差值为大于0的数值时,将第一本地时钟的相位增大
Figure PCTCN2016076004-appb-000011
其中,该Offset为时间差值,T为第一本地时钟的周期;第二调整子单元44,设置为当上述时间差值为小于0的数值时,将上述第一本地时钟的相位减小
Figure PCTCN2016076004-appb-000012
其中,该Offset为时间差值,T为第一本地时钟的周期。
图5是根据本发明实施例的时钟同步装置的优选结构框图,如图5所示,该装置除包括图2所示的所有模块外,还包括第二获取模块52和确定模块54,下面对该装置进行说明。
第二获取模块52,设置为获取卫星中继的链路时延;确定模块54,连接至上述第二获取模块52和第一获取模块22,设置为根据接收到的上述时延测试数据获取时延。
在一个可选的实施例中,上述第二获取模块52可以通过如下方式之一获取上述卫星中继的链路时延:
接收第二站点在确定了上述链路时延后广播的链路时延,其中,该第二站点通过如下公式确定上述链路时延Td:Td=(t2-t1)×2,其中,t1为所述第二站点发送所述时延测试数据的第一时间点,t2为所述卫星中继接收到所述时延测试数据的第二时间点;
接收经由卫星中继转发的上述第二站点发送的时延测试数据,其中,该时延测试数据中携带有第二站点发送上述时延测试数据的第一时间点t1和卫星中继接收到上述时延测试数据的第二时间点t2;根据如下公式确定上述链路时延Td:Td=(t2-t1)×2;
接收经由卫星中继转发的第二站点发送的时延测试数据,其中,该时延测试数据中携带有卫星中继确定的上述链路时延,其中,该卫星中继可以通过如下公式确定上述链路时延Td:Td=(t2-t1)×2,其中,t1为第二站点发送上述时延测试数据的第一时间点,t2为卫星中继接收到上述时延测试数据的第二时间点。
在上述各的实施例中,上述的发送时间点可以携带在上述的预定数据中,上述的预定数据可以是以帧数据的形式进行发送的,下面以上述的第一网络为从网络,第二网络为主网络为例进行说明。
根据本发明实施例的网络主从同步系统定时的方法主要包括以下步骤:
第一步:定义好主从网络各自的架构。主网络主要由主站A(同上述的第二站点)组成, 卫星中继G,从网络主要由端站F(同上述的第一站点)组成。
第二步:主站A通过发送带定时信息的高度测量数据(同上述的时延测试数据),通过中继G转发,端站F收到G转发的数据,计算出卫星测距链路时延;再加上硬件时延,即得到主站A发出到从端站F的数据时延为Df。
第三步:主站A发送带有定时信息的帧数据,端站F每次检测到的定时信息,即发送时间点均是主站A均以主站A的本地时钟CLOCK_A为基准进行计数,并将计数结果给到端站F的;发送帧i(即,第i个帧数据)时检测到定时信息时计数值记为NCRi。端站F每次解出数据,检测到该定时信息,即接收时间点也以本地时钟CLOCK_F为基准进行计数,接收到帧i时检测到定时信息时计数值记为LCRi。
第四步:端站F通过计算Offseti=NCRi+Df-LCRi值来来调整本地10ms的相位,达到与主站10ms相位同步,并且通过实时获取的NCR值与本地的LCR值作比较,调整恒温晶体振荡器(Oven Controlled Crystal Oscillator,简称为OCXO)的电压,实现主从网络的时钟实时同步。
下面对上述实施例中的网络主从同步系统定时方法的各个步骤进行详细说明:
针对主站A向端站F发送帧数据进行说明:
101)主网络中由主站A发送带有定时信息的帧数据,定时信息可在发送帧的任意位置;主站A将帧数据将传给中继(即,上述的卫星中继G)后,中继再将帧数据传给端站F,端站F从空口接收帧数据,如图6所示,图6是根据本发明实施例的主站、中继、端站的交互示意图。
针对时延进行说明:
201)数据从主站A到从端站F的时延Df的值由以下值确定:
Df=Dpath+Dhw
其中Dpath(同上述的Td)为链路时延,Dhw为硬件时延。
针对上述的第三步进一步解析:
301)主站A发送带有定时信息的帧数据,端站F每次检测到的定时信息是主站A以本地时钟CLOCK_A为基准进行计数,并将计数结果给到端站F的;发送帧i时检测到定时信息时计数值记为NCRi。端站F每次解出数据,检测到定时信息也以本地时钟CLOCK_F为基准进行计数,接收到帧i时检测到定时信息时计数值记为LCRi。
针对第四步进一步解析:
401)端站根据Offseti=NCRi+Df-LCRi的值来调整本地10ms的相位,达到与主站10ms相位同步,并且通过实时获取的NCR值与本地的LCR值作比较,调整OCXO的电压,实现主从网络的时钟实时同步。
下面结合具体实施方式进行说明:
实施例1:卫星通讯系统,主站A将定时信息固定置于帧头位置。
主站A发送帧头带有定时信息的帧数据,每次检测到定时信息主站A均以本地3.84M时钟为基准进行计数,发送帧i时检测到定时信息时计数值记为NCRi。卫星转发器作为中继G。端站F每次解出数据,检测到定时信息也以本地61.44M时钟为基准进行计数,接收到帧i时检测到定时信息时计数值记为LCRi。使用卫星测距方法测得帧数据从主站A发出到端站F解出的时延值Df为120.3ms。主站A上电时刻,主站A计算Offseti值来调整端站10ms相位,并且通过获取实时的NCR和LCR的值,调整OCXO的电压,从而实现主从网络的时钟同步。
实施例2:卫星通讯系统,主站A将定时信息固定置于帧尾位置。
主站A发送帧尾带有定时信息的帧数据,每次检测到定时信息主站A均以本地3.84M时钟为基准进行计数,发送帧i时检测到定时信息时计数值记为NCRi。卫星转发器作为中继G。端站F每次解出数据,检测到定时信息也以本地61.44M时钟为基准进行计数,接收到帧i时检测到定时信息时计数值记为LCRi。使用卫星测距方法测得帧数据从主站A发出到端站F解出的时延值Df为120.3ms。主站A上电时刻,主站A计算Offseti值来调整端站10ms相位,并且通过获取实时的NCR和LCR的值,调整OCXO的电压,从而实现主从网络的时钟同步。
实施例3:卫星通讯系统,主站A将定时信息固定置于帧中间位置。
主站A发送帧中间位置带有定时信息的帧数据,每次检测到定时信息主站A均以本地3.84M时钟为基准进行计数,发送帧i时检测到定时信息时计数值记为NCRi。卫星转发器作为中继G。端站F每次解出数据,检测到定时信息也以本地61.44M时钟为基准进行计数,接收到帧i时检测到定时信息时计数值记为LCRi。使用卫星测距方法测得帧数据从主站A发出到端站F解出的时延值Df为120.3ms。主站A上电时刻,主站A计算Offseti值来调整端站10ms相位,并且通过获取实时的NCR和LCR的值,调整OCXO的电压,从而实现主从网络的时钟同步。
实施例4:卫星通讯系统,定时信息在主站A发送的帧的位置可变。
主站A发送带有定时信息的帧数据,定时信息在帧的任意位置。每次检测到定时信息主站A均以本地3.84M时钟为基准进行计数,发送帧i时检测到定时信息时计数值记为NCRi。卫星转发器作为中继G。端站F每次解出数据,检测到定时信息也以本地61.44M时钟为基准进行计数,接收到帧i时检测到定时信息时计数值记为LCRi。使用卫星测距方法测得帧数据从主站A发出到端站F解出的时延值Df为120.3ms。主站A上电时刻,主站A计算Offseti值来调整端站10ms相位,并且通过获取实时的NCR和LCR的值,调整OCXO的电压,从而实现主从网络的时钟同步。
通过本发明实施例中的定时方案,可实现在组网简单、不依赖于以太网的情况下,主从网络具有较高的系统定时精度,并且具有组网范围广的优点。并且通过对发送的帧数据进行特殊处理,实现网络主从同步,组网成本低,覆盖范围广,定时精度能够达到百纳秒级,能满足某些通讯系统的要求。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:
S1,位于第一网络中的第一站点获取位于第二网络中的第二站点发送n个预定数据的发送时间点,其中,该n个预定数据沿相同的传输路径从第二站点传输到第一站点,n≥1;
S2,上述第一站点根据n个预定数据的发送时间点、第一站点接收到该n个预定数据的接收时间点、以及时延将第一站点的第一本地时钟调整到与第二站点的第二本地时钟同步,其中,上述时延为预先确定的时延测试数据沿上述传输路径从第二站点传输到第一站点的时延。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行上述的步骤S1-S2。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
工业实用性
如上所述,本发明实施例提供的一种时钟同步方法及装置具有以下有益效果:解决了相关技术中存在的在实现主从网络时钟同步时,成本高、组网复杂、定时精度低的问题,进而达到了降低时钟同步的成本,降低组网复杂度以及提高定位精度的效果。

Claims (12)

  1. 一种时钟同步方法,包括:
    位于第一网络中的第一站点获取位于第二网络中的第二站点发送n个预定数据的发送时间点,其中,所述n个预定数据沿相同的传输路径从所述第二站点传输到所述第一站点,n≥1;
    所述第一站点根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及时延将所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步,其中,所述时延为预先确定的时延测试数据沿所述传输路径从所述第二站点传输到所述第一站点的时延。
  2. 根据权利要求1所述的方法,其中,所述第一站点根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及时延将所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步包括:
    所述第一站点根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及所述时延得到所述第一本地时钟与所述第二本地时钟之间的时间差值;
    所述第一站点根据所述时间差值调整所述第一本地时钟的相位,以使得所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步。
  3. 根据权利要求2所述的方法,其中,所述第一站点根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及所述时延得到所述第一本地时钟与所述第二本地时钟之间的时间差值包括:
    所述第一站点通过如下公式确定所述时间差值Offset:
    Figure PCTCN2016076004-appb-100001
    其中,所述Offseti为根据第i个预定数据的发送时间点、所述第一站点接收到第i个预定数据的接收时间点以及所述时延得到的所述第一本地时钟与所述第二本地时钟之间的第i个时间差值;所述NCRi为所述第i个预定数据的发送时间点;所述Df为所述时延;所述LCRi为所述第一站点接收到第i个预定数据的接收时间点。
  4. 根据权利要求2所述的方法,其中,所述第一站点根据所述时间差值调整所述第一本地时钟的相位,以使得所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步包括:
    当所述时间差值为大于0的数值时,所述第一站点将所述第一本地时钟的相位增大
    Figure PCTCN2016076004-appb-100002
    其中,所述Offset为所述时间差值,所述T为所述第一本地时钟的周期;
    当所述时间差值为小于0的数值时,所述第一站点将所述第一本地时钟的相位减小
    Figure PCTCN2016076004-appb-100003
    其中,所述Offset为所述时间差值,所述T为所述第一本地时钟的周期。
  5. 根据权利要求1至4中任一项所述的方法,其中,在位于第一网络中的第一站点获取位于第二网络中的第二站点发送第一预定数据的发送时间点之前,还包括:
    所述第一站点获取卫星中继的链路时延;
    所述第一站点通过所述卫星中继的链路时延和预先确定的硬件固有时延的总和确定所述时延。
  6. 根据权利要求5所述的方法,其中,所述第一站点获取所述卫星中继的链路时延包括以下之一:
    所述第一站点接收所述第二站点在确定了所述链路时延后广播的所述链路时延,其中,所述第二站点通过如下公式确定所述链路时延Td:Td=(t2-t1)×2,其中,t1为所述第二站点发送所述时延测试数据的第一时间点,t2为所述卫星中继接收到所述时延测试数据的第二时间点;
    所述第一站点接收经由所述卫星中继转发的所述第二站点发送的所述时延测试数据,其中,所述时延测试数据中携带有所述第二站点发送所述时延测试数据的第一时间点t1和所述卫星中继接收到所述时延测试数据的第二时间点t2;所述第一站点根据如下公式确定所述链路时延Td:Td=(t2-t1)×2;
    所述第一站点接收经由所述卫星中继转发的所述第二站点发送的所述时延测试数据,其中,所述时延测试数据中携带有所述卫星中继确定的所述链路时延,其中,所述卫星中继通过如下公式确定所述链路时延Td:Td=(t2-t1)×2,其中,t1为所述第二站点发送所述时延测试数据的第一时间点,t2为所述卫星中继接收到所述时延测试数据的第二时间点。
  7. 一种时钟同步装置,应用于位于第一网络中的第一站点中,包括:
    第一获取模块,设置为获取位于第二网络中的第二站点发送n个预定数据的发送时间点,其中,所述n个预定数据沿相同的传输路径从所述第二站点传输到所述第一站点,n≥1;
    调整模块,设置为根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及时延将所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步,其中,所述时延为预先确定的时延测试数据沿所述传 输路径从所述第二站点传输到所述第一站点的时延。
  8. 根据权利要求7所述的装置,其中,所述调整模块包括:
    获得单元,设置为根据所述n个预定数据的所述发送时间点、所述第一站点接收到所述n个预定数据的接收时间点、以及所述时延得到所述第一本地时钟与所述第二本地时钟之间的时间差值;
    调整单元,设置为根据所述时间差值调整所述第一本地时钟的相位,以使得所述第一站点的第一本地时钟调整到与所述第二站点的第二本地时钟同步。
  9. 根据权利要求8所述的装置,其中,所述获得单元通过如下方式得到所述时间差值:
    通过如下公式确定所述时间差值Offset:
    Figure PCTCN2016076004-appb-100004
    其中,所述Offseti为根据第i个预定数据的发送时间点、所述第一站点接收到第i个预定数据的接收时间点以及所述时延得到的所述第一本地时钟与所述第二本地时钟之间的第i个时间差值;所述NCRi为所述第i个预定数据的发送时间点;所述Df为所述时延;所述LCRi为所述第一站点接收到第i个预定数据的接收时间点。
  10. 根据权利要求8所述的装置,其中,所述调整单元包括:
    第一调整子单元,设置为当所述时间差值为大于0的数值时,将所述第一本地时钟的相位增大
    Figure PCTCN2016076004-appb-100005
    其中,所述Offset为所述时间差值,所述T为所述第一本地时钟的周期;
    第二调整子单元,设置为当所述时间差值为小于0的数值时,将所述第一本地时钟的相位减小
    Figure PCTCN2016076004-appb-100006
    个周期,其中,所述Offset为所述时间差值,所述T为所述第一本地时钟的周期。
  11. 根据权利要求7至10中任一项所述的装置,其中,还包括:
    第二获取模块,设置为获取卫星中继的链路时延;
    确定模块,设置为通过所述卫星中继的链路时延和预先确定的硬件固有时延的总和确定所述时延。
  12. 根据权利要求11所述的装置,其中,所述第二获取模块通过如下方式之一获取所述卫星 中继的所述链路时延:
    接收所述第二站点在确定了所述链路时延后广播的所述链路时延,其中,所述第二站点通过如下公式确定所述链路时延Td:Td=(t2-t1)×2,其中,t1为所述第二站点发送所述时延测试数据的第一时间点,t2为所述卫星中继接收到所述时延测试数据的第二时间点;
    接收经由所述卫星中继转发的所述第二站点发送的所述时延测试数据,其中,所述时延测试数据中携带有所述第二站点发送所述时延测试数据的第一时间点t1和所述卫星中继接收到所述时延测试数据的第二时间点t2;根据如下公式确定所述链路时延Td:Td=(t2-t1)×2;
    接收经由所述卫星中继转发的所述第二站点发送的所述时延测试数据,其中,所述时延测试数据中携带有所述卫星中继确定的所述链路时延,其中,所述卫星中继通过如下公式确定所述链路时延Td:Td=(t2-t1)×2,其中,t1为所述第二站点发送所述时延测试数据的第一时间点,t2为所述卫星中继接收到所述时延测试数据的第二时间点。
PCT/CN2016/076004 2015-10-14 2016-03-09 时钟同步方法及装置 WO2016177090A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510663247.6 2015-10-14
CN201510663247.6A CN105245324A (zh) 2015-10-14 2015-10-14 时钟同步方法及装置

Publications (1)

Publication Number Publication Date
WO2016177090A1 true WO2016177090A1 (zh) 2016-11-10

Family

ID=55042838

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/076004 WO2016177090A1 (zh) 2015-10-14 2016-03-09 时钟同步方法及装置

Country Status (2)

Country Link
CN (1) CN105245324A (zh)
WO (1) WO2016177090A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105245324A (zh) * 2015-10-14 2016-01-13 中兴通讯股份有限公司 时钟同步方法及装置
CN108737001B (zh) * 2017-04-24 2020-02-07 广东虚拟现实科技有限公司 一种数据处理方法及相关设备
CN108333601B (zh) * 2018-01-30 2021-02-09 北京空间飞行器总体设计部 一种用于高轨遥感卫星的精密测距系统
CN108809617B (zh) * 2018-04-18 2021-12-14 京信网络系统股份有限公司 一种时延补偿方法及终端
CN115549834A (zh) * 2021-06-29 2022-12-30 中兴通讯股份有限公司 时钟同步方法、装置、系统、电子设备及可读介质
CN115243356A (zh) * 2022-07-13 2022-10-25 厦门九华通信设备厂 一种基于绝对时间同步的静止轨道卫星通信同步方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100074383A1 (en) * 2008-09-23 2010-03-25 Electronics And Telecommunications Research Institute Timestamping method and apparatus for precise network synchronization
CN101938825A (zh) * 2009-06-30 2011-01-05 华为技术有限公司 一种数字用户线中时间同步的方法、装置和系统
CN102025480A (zh) * 2009-09-14 2011-04-20 中兴通讯股份有限公司 在级联基站中实现边界时钟的方法与装置
CN103117829A (zh) * 2012-12-21 2013-05-22 杨德朝 一种不对称网络间的时间同步与补偿方法或者装置
US20140064303A1 (en) * 2012-09-04 2014-03-06 Khalifa University of Science, Technology, and Research Methods and devices for clock synchronization
CN105245324A (zh) * 2015-10-14 2016-01-13 中兴通讯股份有限公司 时钟同步方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100074383A1 (en) * 2008-09-23 2010-03-25 Electronics And Telecommunications Research Institute Timestamping method and apparatus for precise network synchronization
CN101938825A (zh) * 2009-06-30 2011-01-05 华为技术有限公司 一种数字用户线中时间同步的方法、装置和系统
CN102025480A (zh) * 2009-09-14 2011-04-20 中兴通讯股份有限公司 在级联基站中实现边界时钟的方法与装置
US20140064303A1 (en) * 2012-09-04 2014-03-06 Khalifa University of Science, Technology, and Research Methods and devices for clock synchronization
CN103117829A (zh) * 2012-12-21 2013-05-22 杨德朝 一种不对称网络间的时间同步与补偿方法或者装置
CN105245324A (zh) * 2015-10-14 2016-01-13 中兴通讯股份有限公司 时钟同步方法及装置

Also Published As

Publication number Publication date
CN105245324A (zh) 2016-01-13

Similar Documents

Publication Publication Date Title
WO2016177090A1 (zh) 时钟同步方法及装置
US10594470B2 (en) Systems and methods of clock synchronization between devices on a network
US11035941B2 (en) UWB high-precision positioning system, positioning method and apparatus, and computer readable medium
US8837530B2 (en) Method and system for adaptive synchronization of timing information generated by independently clocked communication nodes
US8837316B2 (en) RTT based ranging system and method
KR20150143801A (ko) 타임스탬프를 생성하는 방법, 장치, 그리고 시스템
WO2022011650A1 (zh) 同步系统中的测距方法、装置、设备及可读存储介质
US11133885B2 (en) Methods and devices for synchronization in communication networks
CN103905135A (zh) 实现时间同步的方法、设备和系统
EP3846379A1 (en) Clock synchronization method and apparatus, system, storage medium, and electronic device
US20140269645A1 (en) Wireless access point synchronization
WO2021008532A1 (zh) 有源天线单元时延对齐方法、装置及有源天线单元
US20190199286A1 (en) Methods for Correcting Oscillator Offsets in Ultra-Wideband (UWB) Networks
CN105338613A (zh) 一种采用无线通信对分散节点对时同步的系统和方法
US20160170382A1 (en) Time Synchronization Control Apparatus And Method
Kim et al. Synchronized sensing for wireless monitoring of large structures
WO2023124403A1 (zh) 一种时钟同步的方法、装置和系统
US20040121806A1 (en) Mobile communications system, radio base station control system, and radio base station control method
US20220269223A1 (en) Wireless time servicing method, device, and system
CN109699068B (zh) 一种基站同步方法和装置
US20180302188A1 (en) System and method for simultaneous transmission of the same radio signal packet from multiple anchor nodes
CN104780602A (zh) 无线通信网络中的时钟自同步方法
US9455824B1 (en) Distributed network synchronization methods and architectures
CN111884751A (zh) 一种基于ptp的智能电网时间同步方法和装置
US11758508B2 (en) Access Point (AP) placement using Fine Time Measurement (FTM)

Legal Events

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

Ref document number: 16789084

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16789084

Country of ref document: EP

Kind code of ref document: A1