CN106357362B - A kind of method for synchronizing time, device and PTP system - Google Patents

A kind of method for synchronizing time, device and PTP system Download PDF

Info

Publication number
CN106357362B
CN106357362B CN201610978591.9A CN201610978591A CN106357362B CN 106357362 B CN106357362 B CN 106357362B CN 201610978591 A CN201610978591 A CN 201610978591A CN 106357362 B CN106357362 B CN 106357362B
Authority
CN
China
Prior art keywords
frequency
clock frequency
master clock
clock
phase
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201610978591.9A
Other languages
Chinese (zh)
Other versions
CN106357362A (en
Inventor
蔺吉森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Raisecom Technology Co Ltd
Original Assignee
Raisecom Technology Co Ltd
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 Raisecom Technology Co Ltd filed Critical Raisecom Technology Co Ltd
Priority to CN201610978591.9A priority Critical patent/CN106357362B/en
Publication of CN106357362A publication Critical patent/CN106357362A/en
Application granted granted Critical
Publication of CN106357362B publication Critical patent/CN106357362B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0641Change of the master or reference, e.g. take-over or failure of the master
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0647Synchronisation among TDM nodes
    • H04J3/065Synchronisation among TDM nodes using timestamps

Landscapes

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

Abstract

The invention discloses a kind of method for synchronizing time, device and PTP systems, when the method for synchronizing time is applied to transparent clock equipment, the described method includes: the signal pulse that monitoring clock equipment is sent with out-of-band way, the frequency and phase for extracting the signal pulse, respectively as master clock frequency and master clock frequency phase;The master clock frequency is mutually inserted into the corresponding position for organizing the extended field of manufacturer's message format in pre-generated common PTP signal message with master clock frequency, modified PTP signal message is then passed into the port PTP;The modified PTP signal message of the port PTP transmission is received, wherein entrained master clock frequency and master clock frequency phase are extracted, is mutually modified according to the master clock frequency with master clock frequency relative local clock frequency and/or local clock frequency.The embodiment of the present invention extends PTP protocol, keeps clockwork synchronized result in PTP system more accurate.

Description

A kind of method for synchronizing time, device and PTP system
Technical field
The present invention relates to fields of communication technology, more particularly, to a kind of method for synchronizing time, device and PTP system.
Background technique
With the development of network technology, distributed system technology is increasingly used in measurement and control area, these technology packets Include network communication, local computing, distributed objects etc..The time that many applications need that device node clock is used to generate, such as The time of each node in the protocol synchronization distributed system of none standard of fruit, then these equipment will be unable to realize Real-time synchronization control function.Existing some time synchronization protocols are not appropriate for being used in distributed measurement and control area, such as network Time protocol (NTP), it is mainly used for the synchronization of large scale system, and precision generally only reaches a millisecond rank.And IEEE1588 is assisted View is then a time synchronization protocol formulating exclusively for measurement and control area, which can be used for times including Ethernet including What supports the network of multicast functionality.
The clock synchronization mechanism of 1588 agreement of IEEE provides that system works in master slave mode, set by master clock (Master) It is standby to provide clock reference to from clockwork.Specific implementation are as follows: clock equipment periodicity sending sync message (Sync), From between the time delay and master-salve clock that clockwork calculates the message transmissions according to the time for receiving Sync message Deviation, and local zone time is adjusted to keep consistent with the clock of clock equipment.
IEEE1588 uses precision time protocol PTP (Precision Timing Protocol), by reporting end to end Text interaction obtains clock reference information, corrects local clock frequency and phase.1588 agreements are based on two assumed conditions: first, In clock equipment and between clockwork, network message transmission time is symmetrical.That is a message from it is main when Clock equipment is equal to message from the transmission time from clockwork to clock equipment to from the transmission time of clockwork;Second, In PTP message interaction process, the drift of local clock be can be ignored.Basic model such as Fig. 1 of sync message interaction It is shown.
(1) clock equipment sends synchronous (Sync) message to from clockwork, and sending time T1 is charged to register.
(2) Sync message is received from clockwork, and indicates the time T2 for receiving message.
(3) clock equipment follows (Follow_Up) message to from clockwork transmission, and time T1 is embedded into and follows report Wen Zhong.
(4) (Delay_Req) message is requested from clockwork to clock equipment forward delay interval, and is embedded in time stamp T 3.
(5) clock equipment receives Delay_Req message, and indicates the time T4 for receiving message.
(6) clock equipment in delayed response (Delay_Resp) message by being embedded in time stamp T 4, clock equipment Time stamp T 4 is transferred to from clockwork.
At the end of mutual message, possess 4 timestamps from clockwork, these timestamps are for calculating from clock The offset (Offset) of equipment and clock equipment, and calculate average transmission time of the message between two clocks.
The end-to-end transparent clock equipment of PTP as common bridge, router or interchanger, forwarding clock equipment with From all messages of interaction between clockwork.Typically, the residence time bridge of end-to-end transparent clock equipment is for interactive PTP event message can calculate residence time of the message Jing Guo the equipment, and by the residence time in the PTP event message One specific fields is added up, read after receiving PTP event message from clockwork the residence time wherein carried and its It is synchronous that his timestamp carries out clock.And calculating resident used timestamp (namely residence time) is by transparent clock equipment base It is generated in local clock.
But the local clock of actually end-to-end transparent clock equipment is inaccurate, and not necessarily begins with clock equipment It keeps synchronizing eventually, so will also have error based on the residence time that local clock calculates, to influence from clockwork Clock synchronization accuracy.
For this purpose, the end-to-end transparent clock equipment of PTP is usually that basis had done the correction of uplink residence time in existing method Clock equipment and local clock equipment to the sending cycle of Sync message in PTP event message, calculate master clock and local The ratio (i.e. the frequency shift (FS) factor, Ff) of clock rate, then corrects local clock according to the ratio.But this method is deposited In the excessive problem of the local clock rate and master clock rate error of acquisition, such as the shadow by various factors such as network environments It rings, each Sync message that the end-to-end transparent clock equipment of PTP periodically sends master clock, can not be inherently strictly according to spy What fixed cycle was forwarded, can only substantially estimate a sending cycle to Sync message, so as to cause the essence of residence time Exactness is difficult to ensure.
Summary of the invention
It, can be in order to solve the above-mentioned technical problems, the present invention provides a kind of method for synchronizing time, device and PTP system Realize that the local clock synchronized result of the end-to-end transparent clock equipment of PTP is more accurate.
The embodiment of the invention provides following technical schemes: a kind of method for synchronizing time, is applied to clock equipment, described Method includes:
Precision time protocol PTP event message is sent to transparent clock equipment, and sends master clock to transparent clock equipment Frequency dependence parameter and/or master clock frequency phase relevant parameter;
Wherein, clock equipment is to have done this system superlative degree clockwork of uplink residence time correction.
Optionally, described to send PTP event message to transparent clock equipment, comprising: with in-band method periodically to saturating Bright clockwork sends PTP event message;Also,
It is described to send master clock frequency relevant parameter and/or master clock frequency phase relevant parameter to transparent clock equipment, comprising: Master clock frequency relevant parameter and/or master clock periodically are sent to transparent clock equipment with in-band method or out-of-band way Frequency phase relevant parameter.
Optionally, it is described with in-band method periodically to transparent clock equipment send master clock frequency relevant parameter and/ Or frequency phase relevant parameter, comprising:
At least obtain master clock frequency, master clock frequency phase, whether frequency locking, whether master clock frequency in locking phase parameter and/ Or master clock frequency phase parameter;
The parameter that will acquire is inserted into the expansion that manufacturer's message format is organized in pre-generated common PTP signal message respectively Open up the corresponding position of field;
Modified PTP signal message is sent to by the port PTP through Ethernet the port PTP of transparent clock equipment.
Optionally, it is described with out-of-band way periodically to transparent clock equipment send master clock frequency relevant parameter and/ Or frequency phase relevant parameter, comprising:
Based on utilizing with the band connection line of transparent clock equipment, band external tapping issues frequency and phase is respectively master clock The signal pulse of frequency and master clock frequency phase.
The embodiment of the invention also provides following technical schemes:
A kind of method for synchronizing time is applied to transparent clock equipment, which comprises
The signal pulse that monitoring clock equipment is sent with out-of-band way, extracts the frequency and phase of the signal pulse, Respectively as master clock frequency and master clock frequency phase;
The master clock frequency is mutually inserted into pre-generated common PTP signal message with master clock frequency and organizes factory Then modified PTP signal message is passed to the port PTP by the corresponding position of the extended field of quotient's message format;
Receive the modified PTP signal message of the port PTP transmission, extract wherein entrained master clock frequency and Master clock frequency phase, according to the master clock frequency and master clock frequency relative local clock frequency and/or local clock frequency Xiang Jinhang Amendment.
Optionally, described according to master clock frequency and master clock frequency relative local clock frequency and/or local clock frequency phase It is modified, comprising:
When determining the master clock frequency in the PTP signal message that clock equipment is sent via the port PTP continuous n period Rate is consistent, then enters the pre-locked state of frequency, and the frequency of the local clock of transparent clock is modified to the master clock frequency Rate;And/or
When the frequency determined in the PTP signal message that clock equipment is sent via the port the PTP continuous m period is mutually kept Unanimously, then enter the pre-locked state of phase, be the master clock frequency phase by the phase only pupil filter of the local clock of transparent clock.
Optionally, described according to master clock frequency and master clock frequency relative local clock frequency and/or local clock frequency phase It is modified, comprising:
By modifying the value progress frequency added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment Amendment, and/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carry out phase only pupil filter.
The embodiment of the invention also provides following technical schemes:
A kind of method for synchronizing time is applied to transparent clock equipment, which comprises
The PTP signal message that clock equipment is sent with in-band method is received by the port PTP;
Extract master clock frequency relevant parameter and/or master clock frequency entrained in the PTP signal message mutually related ginseng Number;
Local clock frequency and/or local clock frequency are mutually modified according to the relevant parameter.
Optionally, described to extract master clock frequency relevant parameter and/or master clock frequency phase entrained in PTP signal message Relevant parameter, comprising: at least extraction master clock frequency, master clock frequency phase, whether frequency locking, whether the master clock frequency in locking phase parameter Rate and/or master clock frequency phase parameter.
It is optionally, described that local clock frequency is modified according to relevant parameter, comprising:
Step 101, according to preset first reference significance condition, judge master clock frequency that clock equipment is sent is whether With reference significance;
Step 102, when determining the master clock frequency with reference significance, then obtain and used in the PTP signal message In the parameter for identifying whether frequency locking;
Step 121 corresponds to master clock frequency locking when the parameter, then further judgement: subsequently received master clock is set Whether the master clock frequency in PTP signal message that the standby continuous n period sends is consistent;
Master clock frequency in step 122, the PTP signal message sent when clock equipment continuous n period keeps one It causes, then enters the pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to the master clock frequency.
Optionally, when the parameter value of acquisition corresponds to the non-frequency locking of master clock, alternatively, the master clock in continuous n period Frequency is not consistent, then equal return step 101, continues waiting for.
Optionally, the preset first reference significance condition, comprising: each when being extracted in nearest setting time window The fluctuation range of a master clock frequency meets preset condition, then master clock frequency is with specific reference to meaning.
Optionally, the method also includes:
When master clock frequency loses reference significance or master clock frequency and do not have always in the pre-locked state procedure of frequency Reference significance or transparent clock equipment can not identify the TLV field that the clock information of master clock is recorded in PTP signal message,
Then obtain the sheet estimated according to clock equipment and transparent clock equipment the sending cycle of sync message Sync The frequency shift (FS) factor of the ground clock relative to master clock;Based on the frequency shift (FS) factor, determine PTP event message when transparent The residence time of clock equipment.
It is optionally, described that local clock frequency is mutually modified according to relevant parameter, comprising:
Step 201, according to preset second reference significance condition, judge master clock frequency that clock equipment is sent mutually whether With reference significance;
Step 202 mutually has reference significance when determining master clock frequency, then obtains and use in the PTP signal message In the parameter for identifying whether locking phase;
Step 221 corresponds to master clock locking phase when the parameter, then further judgement: subsequently received master clock is set Whether the master clock frequency in the PTP signal message that the standby continuous m period sends mutually is consistent;
Master clock frequency in step 222, the PTP signal message sent when clock equipment continuous m period mutually keeps one It causes, then enters the pre-locked state of phase, be the master clock frequency phase by the phase only pupil filter of the local clock of transparent clock.
Optionally, when the parameter value of reading corresponds to the non-locking phase of master clock, alternatively, the master clock in continuous m period Frequency is not consistent mutually, then equal return step 201, continues waiting for.
Optionally, the method also includes:
When master clock frequency mutually loses reference significance in the pre-locked state procedure of phase or master clock frequency does not have mutually always Reference significance or transparent clock equipment can not identify the TLV field that the clock information of master clock is recorded in PTP signal message,
When the local that then acquisition estimates the sending cycle of sync message according to clock equipment and transparent clock equipment The frequency shift (FS) factor of the clock relative to master clock;Based on the frequency shift (FS) factor, determine that PTP event message is set in transparent clock Standby residence time.
Optionally,
It is described to obtain the local estimated according to clock equipment and transparent clock equipment the sending cycle of sync message The frequency shift (FS) factor of the clock relative to master clock, comprising: receive the carrying frequency shift (FS) factor that clock equipment issues PTP signal message;
The TLV for obtaining the PTP signal message organizes frequency shift (FS) factor Ff in the extension message of manufacturer's message format The MAC Address of this equipment carried in field then reads the frequency shift (FS) factor corresponding with the MAC Address in the Ff field Value, the frequency shift (FS) factor values as this equipment.
Optionally, described according to master clock frequency and master clock frequency relative local clock frequency and/or local clock frequency phase It is modified, comprising:
By modifying the value progress frequency added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment Amendment, and/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carry out phase only pupil filter.
The embodiment of the invention also provides following technical schemes:
A kind of time synchronism apparatus, is applied to clock equipment, and described device includes:
Sending module for sending precision time protocol PTP event message to transparent clock equipment, and is set to transparent clock Preparation send master clock frequency relevant parameter and/or master clock frequency phase relevant parameter;
Wherein, clock equipment is to have done this system superlative degree clockwork of uplink residence time correction.
Optionally, the sending module sends PTP event message to transparent clock equipment, comprising: with the in-band method period Property to transparent clock equipment send PTP event message;Also,
The sending module sends master clock frequency relevant parameter and/or master clock frequency mutually related ginseng to transparent clock equipment Number, comprising: with in-band method or out-of-band way periodically to transparent clock equipment send master clock frequency relevant parameter and/ Or master clock frequency phase relevant parameter.
Optionally, the sending module periodically sends master clock frequency correlation to transparent clock equipment with in-band method Parameter and/or frequency phase relevant parameter, comprising:
At least obtain master clock frequency, master clock frequency phase, whether frequency locking, whether master clock frequency in locking phase parameter and/ Or master clock frequency phase parameter;
The parameter that will acquire is inserted into the expansion that manufacturer's message format is organized in pre-generated common PTP signal message respectively Open up the corresponding position of field;
Modified PTP signal message is sent to by the port PTP through Ethernet the port PTP of transparent clock equipment.
Optionally, the sending module periodically sends master clock frequency correlation to transparent clock equipment with out-of-band way Parameter and/or frequency phase relevant parameter, comprising:
Based on utilizing with the band connection line of transparent clock equipment, band external tapping issues frequency and phase is respectively master clock The signal pulse of frequency and master clock frequency phase.
The embodiment of the invention also provides following technical schemes:
A kind of time synchronism apparatus, is applied to transparent clock equipment, and described device includes:
Monitoring modular, the signal pulse sent for monitoring clock equipment with out-of-band way, extracts the frequency of the pulse And phase, respectively as master clock frequency and master clock frequency phase;
Transmission module is believed for the master clock frequency to be mutually inserted into pre-generated common PTP with master clock frequency The corresponding position that the extended field of manufacturer's message format is organized in number message, then passes to modified PTP signal message The port PTP;
First processing module extracts wherein institute for receiving the modified PTP signal message of the port PTP transmission The master clock frequency and master clock frequency phase of carrying, according to the master clock frequency and master clock frequency relative local clock frequency and/ Or local clock frequency is mutually modified.
Optionally, the first processing module according to master clock frequency and master clock frequency relative local clock frequency and/or Local clock frequency is mutually modified, comprising:
When determining the master clock frequency in the PTP signal message that clock equipment is sent via the port PTP continuous n period Rate is consistent, then enters the pre-locked state of frequency, and the frequency of the local clock of transparent clock is modified to the master clock frequency Rate;And/or
When the frequency determined in the PTP signal message that clock equipment is sent via the port the PTP continuous m period is mutually kept Unanimously, then enter the pre-locked state of phase, be the master clock frequency phase by the phase only pupil filter of the local clock of transparent clock.
Optionally, the first processing module according to master clock frequency and master clock frequency relative local clock frequency and/or Local clock frequency is mutually modified, comprising:
By modifying the value progress frequency added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment Amendment, and/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carry out phase only pupil filter.
The embodiment of the invention also provides following technical schemes:
A kind of time synchronism apparatus, is applied to transparent clock equipment, and described device includes:
Receiving module, for receiving the PTP signal message that clock equipment is sent with in-band method by the port PTP;
Extraction module, for extract in the PTP signal message entrained master clock frequency relevant parameter and/or it is main when Clock frequency phase relevant parameter;
Second processing module is used for according to the relevant parameter to local clock frequency and/or local clock frequency Xiang Jinhang Amendment.
Optionally, the extraction module extracts master clock frequency relevant parameter and/or master entrained in PTP signal message Clock frequency phase relevant parameter, comprising: at least extraction master clock frequency, master clock frequency phase, whether frequency locking, whether in locking phase parameter Master clock frequency and/or master clock frequency phase parameter.
Optionally, the Second processing module is modified local clock frequency according to relevant parameter, comprising:
According to preset first reference significance condition, whether the master clock frequency for judging that clock equipment is sent has reference Meaning;
When determining the master clock frequency with reference significance, then obtain in the PTP signal message is for identifying The parameter of no frequency locking;
When the parameter corresponds to master clock frequency locking, then further judgement: the continuous n of subsequently received clock equipment is a Whether the master clock frequency in PTP signal message that the period sends is consistent;
When the master clock frequency in the PTP signal message that clock equipment continuous n period sends is consistent, then enter The frequency of the local clock of transparent clock is modified to the master clock frequency by the pre-locked state of frequency.
Optionally, the Second processing module is mutually modified local clock frequency according to relevant parameter, comprising:
According to preset second reference significance condition, whether the master clock frequency for judging that clock equipment is sent mutually has reference Meaning;
Mutually there is reference significance when determining the master clock frequency, then obtain in the PTP signal message is for identifying The parameter of no locking phase;
When the parameter corresponds to master clock locking phase, then further judgement: the continuous m of subsequently received clock equipment is a Whether the master clock frequency in the PTP signal message that the period sends mutually is consistent;
When the master clock frequency in the PTP signal message that clock equipment continuous m period sends mutually is consistent, then enter The phase only pupil filter of the local clock of transparent clock is the master clock frequency phase by the pre-locked state of phase.
Optionally, the Second processing module according to master clock frequency and master clock frequency relative local clock frequency and/or Local clock frequency is mutually modified, comprising:
By modifying the value progress frequency added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment Amendment, and/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carry out phase only pupil filter.
The embodiment of the invention also provides following technical schemes:
A kind of PTP system, comprising: clock equipment applied by device as described above;And device as described above Applied transparent clock equipment.
The embodiment of the present invention is directly carried related master clock information by PTP signal message by clock equipment and is handed down to Bright clockwork, transparent clock equipment generate more accurate local clock accordingly so that PTP event message it is resident when Between accuracy be effectively improved.Compared with the prior art according to the sending cycle of PTP event message obtain frequency shift (FS) because Son can obtain the accuracy of higher residence time using the method for factor amendment local clock.The embodiment of the present invention expands PTP protocol has been opened up, existing implementation is compared, has had the characteristics that acquisition master clock frequency, frequency phase information are more accurate, makes Clockwork synchronized result is more accurate in PTP system.The embodiment of the present invention simultaneously provides numerous embodiments, can satisfy reality Various situations in the application of border, have the characteristics that solution is comprehensive, practical.
Detailed description of the invention
Attached drawing is used to provide to further understand technical scheme, and constitutes part of specification, with this The embodiment of application is used to explain the technical solution of the application together, does not constitute the limitation to technical scheme.Attached In figure:
Fig. 1 is precision time protocol sync message interaction schematic diagram.
Fig. 2 is a kind of clock system networking schematic diagram of application of the embodiment of the present invention.
Fig. 3 is signal message format specification schematic diagram.
Fig. 4 is the expanded application schematic diagram in the embodiment of the present invention to PTP signal TLV entity norm.
Fig. 5 shows for TC (Transparent clock, transparent clock) local clock frequency modulation a kind of in the embodiment of the present invention It is intended to.
Fig. 6 is second embodiment of the invention transparent clock method for synchronizing time flow chart.
Fig. 7 is third embodiment of the invention transparent clock method for synchronizing time flow chart.
Time synchronism apparatus structural schematic diagram in a kind of PTP system that Fig. 8 provides for fifth embodiment of the invention.
Time synchronism apparatus structural schematic diagram in a kind of PTP system that Fig. 9 provides for sixth embodiment of the invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Referring to Fig. 2, Fig. 2 shows the clock synchronous network systems of application of the embodiment of the present invention, in the group network system Comprising multiple master clocks, transparent clock and from clockwork.In embodiments of the present invention, transparent clock equipment refers to end pair Hold transparent clock equipment.
Fig. 3 shows that PTP signal message format specification, PTP signal message transmit information, request and life between clockwork It enables.Fig. 4 is the expansion in the embodiment of the present invention to PTP signal message TLV (Type, Length, Value) tissue manufacturer message format Exhibition: it increases Master_Crystal (MC) in table newly and represents master clock crystal oscillator frequency;Master_lock_Crystal (MLC) is represented Master clock whether frequency locking;Master_phase (MP) represents master clock frequency phase;When Master_lock_phase (MLP) represents main Clock whether locking phase.Wherein, MLC is represented from whether (this system) highest current crystal oscillator frequency of clock locks, when being convenient for transparent Clock equipment is based on synchronizing or waiting immediately until MLC is identified as during this progress clock correction from clockwork local frequency modulation It is synchronized after frequency locking;MLP is represented from whether the current frequency of (this system) highest clock mutually locks, convenient for transparent clock or from Clock local phase modulation is based on whether synchronous immediately or waiting locking phase MLP is synchronized in this frequency phase correction course.
Fig. 5 describe TC clock according to event message interface to the timestamp information of sync message frequency is calculated Displacement factor Ff,
Wherein, △ t0 is the period that clock equipment sends synchronous (Sync) message,
△ t0=t0 '-t0, t0, t0 ' it is that clock equipment according to the setting period successively sends sync message in succession twice Temporal information.
△ t1 is the period that transparent clock equipment receives sync message,
△ t1=t1 '-t1, t1, t1 ' be transparent clock equipment according to setting the period successively twice in succession receive sync message Temporal information.
The Ff is locally stored.
Transparent clock (namely TC) equipment is described below to the extraction of PTP signal message, identification and time bias process, The scheme realized to the embodiment of the present invention is described in detail.Scheme as described below can be applied to the networking as provided by figure 2 above Framework, the network are referred to as the domain PTP or PTP system.
First embodiment of the invention provides a kind of method for synchronizing time, is applied to clock equipment, which comprises
PTP event message is sent to transparent clock equipment, transmits master clock frequency and/or master clock to transparent clock equipment Frequency phase relevant parameter;
It is described to send PTP event message to transparent clock equipment, comprising: periodically to be set to transparent clock with in-band method Preparation send PTP event message;
It is described to transmit master clock frequency and/or frequency phase parameter to transparent clock equipment, comprising: to pass through mode in band or out of band Periodically master clock frequency and/or master clock frequency phase relevant parameter are transmitted to transparent clock equipment.
Wherein clock equipment is to have done this system superlative degree clockwork of uplink residence time correction.
On the one hand, PTP event message is periodically sent to transparent clock equipment with in-band method;On the other hand, pass through Mode in band or out of band periodically transmits master clock frequency, master clock frequency equivalent parameters to transparent clock equipment.Wherein, in band Mode refers to: between two clockworks by Ethernet interface in such a way that message form carries out information exchange.Out-of-band way It refers to: information friendship being carried out using band external tapping TOD in the form of signal pulse based on the connecting line of the two between two clockworks Mutual mode.
As an embodiment of the present embodiment, described periodically sent to transparent clock equipment with in-band method is led Clock frequency and/or frequency phase relevant parameter, comprising: respectively obtain master clock frequency MC, frequency phase MP, whether frequency locking, whether locking phase Parameter;The parameters that will acquire, which are inserted into respectively in pre-generated common PTP signal message, organizes manufacturer's message format The corresponding position of extended field, specific insertion position is see figure 3 above and Fig. 4;By the port PTP of clock equipment through ether Modified PTP signal message is sent to the port PTP of transparent clock equipment by net;
It should be noted that pre-generating common PTP signal message in the above-described embodiment, naturally it is also possible to not in advance Common PTP signal message is generated, but after obtaining each relevant parameter, message encapsulation process is carried out, is carried respectively with generating A PTP signal message getparms, which constitute other embodiments:
At least obtain master clock frequency, master clock frequency phase, whether frequency locking, whether master clock frequency in locking phase parameter, master Clock frequency phase parameter;
After obtaining relevant parameter, message encapsulation process is carried out, generates the PTP signal message for carrying relevant parameter;
The PTP signal message for carrying relevant parameter is sent to transparent clock equipment through Ethernet by the port PTP The port PTP.
As another embodiment of the present embodiment, clock equipment is with out-of-band way periodically to transparent clock Equipment sends the clock relevant parameter information of master clock frequency phase, the master clocks such as master clock frequency, comprising: clock equipment be based on The band connection line of transparent clock equipment utilizes band external tapping TOD sending frequency and phase is respectively master clock frequency MC and frequency phase The signal pulse of MP.
In the present embodiment, clock equipment transmission identify whether frequency locking and whether the information of locking phase, its object is to: identify Whether master clock enters stable state, and indicating that the external time service of current master clock is stablized according to frequency locking locking phase information can be used, and is used for whole net The clock alignment of TC (Transparent clock, transparent clock), OC (Ordinary clock, ordinary clock).
In specific implementation of the embodiment of the present invention, there is what is be connected directly can transmit signal pulse between two clockworks In the case where connecting line, out-of-band way is preferentially used;Only do not support which (namely when two in two clockworks to be communicated Clock equipment room is without the connecting line that can transmit signal pulse being connected directly) in the case where, select in-band method.In out-of-band way In, clock equipment directly passes through band connection line with transparent clock equipment and is connected, so transparent clock equipment passes through signal arteries and veins Rush the MC and MP of clock equipment monitored be not in after Ethernet transmits because of link delay and Network Packet Loss caused by Errored message is excessive and the problem that can not synchronize.
Referring to shown in Fig. 6, for the method for synchronizing time flow chart that second embodiment of the invention provides, the method is applied to It include the transparent clock equipment with external tapping and the port PTP, comprising the following steps:
Step 1001, the signal pulse sent with external tapping monitoring clock equipment with out-of-band way, extracts the pulse Frequency and phase, respectively as master clock frequency MC and master clock frequency phase MP;
Step 1002, the MC monitored and MP are inserted into group in pre-generated common PTP signal message with external tapping The corresponding position of the extended field of manufacturer's message format is knitted, modified PTP signal message is then passed into the port PTP;
Step 1003, the port PTP receives the modified PTP signal message, extracts wherein entrained master clock frequency Rate MC and master clock frequency phase MP is accordingly mutually modified local clock frequency and/or local clock frequency.
Wherein, makeover process specifically includes:
A. frequency is corrected
If PTP judges port in the PTP signal message that the continuous n of clock equipment (preferably 4) a period sends Master clock frequency MC is consistent, then enters the pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to this Master clock MC;
B. phase only pupil filter
If PTP judges port in the PTP signal message that the continuous m of clock equipment (preferably 4) a period sends MP is consistent, then enters the pre-locked state of phase, is the m periodicity extraction by the phase only pupil filter of the local clock of transparent clock The MP arrived.
The signal pulse of transparent clock equipment sent with external tapping monitoring clock equipment with out-of-band way, extracts the arteries and veins The frequency and phase of punching, respectively as master clock frequency MC and frequency phase MP;
Since the port PTP in transparent clock equipment is only capable of handling PTP signal message or event message, when transparent thus The band external tapping of clock equipment also needs to pre-generate common PTP signal message, and the MC monitored and MP are inserted into PTP letter The corresponding position that the extended field of manufacturer's message format is organized in number message, then passes to modified PTP signal message The port PTP;
The port PTP receives the PTP signal message sent with external tapping, extracts wherein entrained master clock frequency MC and master Clock frequency phase MP, is accordingly modified local clock, residence time of the corresponding PTP event message in transparent clock equipment Are as follows: the slave transparent clock equipment recorded on the basis of local clock issues the timestamp of the PTP event message, subtracts the PTP thing Part message enters the timestamp of transparent clock equipment.Due to being repaired using the method in the embodiment of the present invention to local clock Just, the local clock time of acquisition is more accurate, so that the residence time determined on the basis of the local clock of acquisition is just more Accurately, to overcome the defect of the prior art.
Referring to shown in Fig. 7, for the transparent clock method for synchronizing time flow chart that third embodiment of the invention provides, the side Method is applied to transparent clock equipment, comprising the following steps:
Step 1101, the PTP signal message that clock equipment is sent with in-band method is received by the port PTP;
Step 1102, master clock frequency and/or master clock frequency phase relevant parameter entrained in PTP signal message are extracted, Local clock frequency and/or local clock frequency are mutually modified according to the relevant parameter.
It is wherein, described to extract master clock frequency and/or master clock frequency phase relevant parameter entrained in PTP signal message, Include: extract respectively master clock frequency MC entrained in PTP signal message, frequency phase MP, whether frequency locking, whether locking phase parameter.
Correspondingly, for subsequently received PTP event message, in the residence time of transparent clock are as follows: with it is local when The slave transparent clock equipment recorded on the basis of clock issues the timestamp of the PTP event message, subtracts the PTP event message and enters thoroughly The timestamp of bright clockwork.Due to being modified using the method in the embodiment of the present invention to local clock, the local of acquisition Clock time is more accurate, so that the residence time of determination is with regard to more accurate on the basis of the local clock of acquisition, to overcome The defect of the prior art.
Wherein, makeover process specifically includes:
A. frequency is corrected
Step 101, according to preset first reference significance condition, whether the master clock MC for judging that clock equipment is sent has There is reference significance.
Specific deterministic process may is that the fluctuation range for counting each MC extracted in nearest setting time window is It is no to meet preset condition (such as the absolute value of the difference of any two MC is respectively less than the first fluctuation threshold set);If it is, Judge the MC of master clock with specific reference to meaning.
If step 102, having reference significance, read in PTP signal message entrained is for identifying master clock The parameter of no frequency locking;
If step 121, the parameter value correspond to master clock frequency locking;
Then further judgement: the PTP signal that the continuous n of subsequently received clock equipment (preferably 4) a period sends Whether the MC in message is consistent;
If step 122, consistent, enter the pre-locked state of frequency, by the frequency of the local clock of transparent clock equipment It is modified to the MC.
If the parameter value read corresponds to the non-frequency locking of master clock, alternatively, the MC in continuous n period does not keep one It causes, then equal return step 101, continues waiting for.
In PTP system clock equipment be likely to change and clock equipment power down after to the feelings such as powering on again Condition.If transparent clock equipment after getting master clock frequency and master clock frequency phase, does not combine preset condition to getting Whether parameter is effectively judged, but it is synchronous directly to carry out local clock according to the parameter, then will cause the synchronous knot of clock The problem of fruit inaccuracy.So in the above-described embodiment, by first determining whether the frequency of master clock meets default item Part then has reference significance when meeting preset condition, and further judges subsequently received clock equipment continuous n week Whether the frequency in PTP signal message that the phase sends is consistent, and is consistent just as standard to transparent clock equipment Local clock synchronize.In this way the step of, master clock frequency obtained is more accurate, thus according to it is described main when Clock frequency carries out local clock and synchronizes, and synchronized result is more accurate.
In other embodiment, the method also includes:
When master clock frequency loses reference significance or master clock frequency and do not have always in the pre-locked state procedure of frequency Reference significance or transparent clock equipment can not identify the TLV field that the clock information of master clock is recorded in PTP signal message,
Then obtain the sheet estimated according to clock equipment and transparent clock equipment the sending cycle of sync message Sync The frequency shift (FS) factor of the ground clock relative to master clock;Based on the frequency shift (FS) factor, determine PTP event message when transparent The residence time of clock equipment.
Wherein, described to be based on the frequency shift (FS) factor, determine PTP event message in the residence time of transparent clock equipment, packet It includes: when can not directly modify the oscillator for generating local clock to transparent clock equipment based on the frequency shift (FS) factor, to guarantee The residence time arrived is accurate, the time when timestamp when PTP event message recorded based on local clock is entered and sending Stamp, multiplied by the frequency shift (FS) factor, then calculating difference.
In other situations, described to be based on the frequency shift (FS) factor, determine PTP event message staying in transparent clock equipment Stay the time, further includes: the oscillator that local clock is generated to transparent clock equipment is directly modified based on the frequency shift (FS) factor, in this way If, the calculating of residence time be exactly timestamp when being entered according to the PTP event message that modified local clock record with Timestamp when sending.
B. phase only pupil filter
Step 201, according to preset second reference significance condition, whether the master clock MP for judging that clock equipment is sent has There is reference significance.
Specific deterministic process may is that the fluctuation range for counting each MP extracted in nearest setting time window is It is no to meet preset condition (such as the absolute value of the difference of any two MP is respectively less than the second fluctuation threshold set);If it is, Judge the MP of master clock with specific reference to meaning.
If step 202 has reference significance, read in the clock information of master clock for identifying whether the ginseng of locking phase Number;
If step 221, the parameter value correspond to master clock locking phase, further judge: subsequently received master clock Whether the MP in PTP signal message that the continuous m of equipment (preferably 4) a period sends is consistent;
If step 222, consistent, enter the pre-locked state of phase, by the phase only pupil filter of the local clock of transparent clock For the MP.
If the parameter value read corresponds to the non-locking phase of master clock, alternatively, the MP in continuous m period does not keep one It causes, then return step 201 respectively, continues waiting for.
In said frequencies and frequency phase amendment step, if MC, MP lose in frequency and the pre-locked state procedure of phase Reference significance or MC or MP do not have reference significance always, then use traditional clock software amendment scheme, by with master The interaction of the PTP event message of clockwork determines the frequency shift (FS) factor Ff of the local residence time to PTP event message. The circular of the frequency shift (FS) factor can be found in figure 5 above.Corresponding PTP event message is in the resident of transparent clock equipment Time are as follows: the slave transparent clock equipment recorded on the basis of local clock issues the timestamp of the PTP event message, subtracts this PTP event message enters the timestamp of transparent clock equipment;By obtained difference multiplied by the frequency shift (FS) factor.
In addition, if transparent clock equipment can not identify the TLV word for recording the clock information of master clock in PTP signal message Section then directly can also calculate the frequency shift (FS) factor using the above method, and then calculate residence time using the frequency shift (FS) factor.
It should be noted that in the domain PTP, if each transparent clock equipment does not support the frequency shift (FS) factor to calculate function Can, the calculating of the frequency shift (FS) factor can be by clock equipment by interacting PTP event message with each equipment in these equipment Determination obtains (shown in Figure 5), is then disposably handed down in the domain PTP by clock equipment by a PTP signal message Each transparent clock equipment.Specifically, being organized in the extension message of manufacturer's message format using the TLV of PTP signal message The frequency shift (FS) factor of each transparent clock equipment of Frequency_factor (Ff) field identification.For example, the Ff can be set Field per BIT N number of, one transparent clock equipment of correspondence, this N number of BIT is used to store the MAC Address of transparent clock equipment And its corresponding frequency shift (FS) factor values.After transparent clock equipment receives PTP signal message, first finds and carry in the field The MAC Address of this equipment then reads frequency shift (FS) factor values corresponding with the MAC Address, the frequency shift (FS) as this equipment Factor values, software participate in lower progress clock compensation.In this embodiment, one can only be passed through rather than multiple PTP signal reports Each frequency shift (FS) factor just can be issued to corresponding transparent clock equipment by text, saved Internet resources, accelerated inclined to frequency Move the acquisition speed of the factor.
After transparent clock equipment often receives the PTP event message that clock equipment (or from clockwork) is sent, accounting It calculates its residence time and the time is added to PTP event message and be transmitted to from clockwork (or clock equipment).
Can be traditional Adjusted Option from the local clock Adjusted Option of clockwork: clock equipment is set with from clock The standby time stab information tune in PTP event message through transparent clock equipment interaction PTP event message, from clockwork using interaction Whole local clock is synchronous with the clock of clock equipment.
Certainly, the local clock adjustment side with reference to transparent clock is also possible to from the local clock Adjusted Option of clockwork Case.It should be noted that in the case, transparent clock equipment no longer needs to calculate the residence time of PTP event message, so With regard to It is not necessary to carry out local clock adjustment, if the clock information for the master clock that the port PTP is received again with band it is outer or In-band method is transmitted to from clockwork.
Under normal circumstances, the frequency and phase of clock signal caused by the oscillator carried in clockwork in the domain PTP Be it is fixed, cannot change, thus Clock Synchronization Technology involved in the prior art frequently referred to as pass through software mode to vibration The clock signal for swinging device output is modified, to guarantee that the clockwork is synchronous with the clock of clock equipment in the domain PTP.But It is that, since the technology is the approximate calculation under software participates in, precision is poor, thus in the scheme of the embodiment of the present invention, saturating Bright clockwork and one Frequency Adjustable oscillator of additional inside the clockwork, by the frequency compensation for modifying the oscillator The value of register, so that the frequency of clock signal caused by the oscillator is synchronous with master clock, later with the adjustable frequency vibration It swings and carries out timing on the basis of the clock signal of device.Such as master clock frequency 16KHZ, which uses 2MHZ, and frequency is mended The default value for repaying register is L (16 system), then the Frequency Adjustable oscillator adjusts process are as follows: posts the frequency compensation in oscillator Storage value modification are as follows: [L ' * (16/2000)] of 16 systems.10 systems that L ' is L indicate.
Value by modifying the phase compensation register of Frequency Adjustable oscillator carries out phase only pupil filter, citing: default phase is mended The value for repaying register is considered 0 impulse compensation, value range 0~65535 (0 using metric 39321 (9999 hexadecimals) ~FFFF hexadecimal) 0.0196229ppm is divided between impulse phase, such as local phase is bigger than main clock pulse phase intervals by 5 A pulse, then the value of phase compensation register should be 39321- (5/0.0196229) (decimal system)=39066 (decimal system)= 989A (hexadecimal).
Fourth embodiment of the invention provides a kind of time synchronism apparatus, is applied to clock equipment, and described device includes:
Sending module for sending precision time protocol PTP event message to transparent clock equipment, and is set to transparent clock Preparation send master clock frequency relevant parameter and/or master clock frequency phase relevant parameter;
Wherein, clock equipment is to have done this system superlative degree clockwork of uplink residence time correction.
In the present embodiment, the sending module sends PTP event message to transparent clock equipment, comprising: with interior side Formula periodically sends PTP event message to transparent clock equipment;Also,
The sending module sends master clock frequency relevant parameter and/or master clock frequency mutually related ginseng to transparent clock equipment Number, comprising: with in-band method or out-of-band way periodically to transparent clock equipment send master clock frequency relevant parameter and/ Or master clock frequency phase relevant parameter.
In the present embodiment, the sending module periodically sends master clock frequency to transparent clock equipment with in-band method Rate relevant parameter and/or frequency phase relevant parameter, comprising:
At least obtain master clock frequency, master clock frequency phase, whether frequency locking, whether master clock frequency in locking phase parameter and/ Or master clock frequency phase parameter;
The parameter that will acquire is inserted into the expansion that manufacturer's message format is organized in pre-generated common PTP signal message respectively Open up the corresponding position of field;
Modified PTP signal message is sent to by the port PTP through Ethernet the port PTP of transparent clock equipment.
In the present embodiment, the sending module periodically sends master clock frequency to transparent clock equipment with out-of-band way Rate relevant parameter and/or master clock frequency phase relevant parameter, comprising:
Based on utilizing with the band connection line of transparent clock equipment, band external tapping issues frequency and phase is respectively master clock The signal pulse of frequency and master clock frequency phase.
Referring to shown in Fig. 8, for a kind of time synchronism apparatus that fifth embodiment of the invention provides, set applied to transparent clock Standby, described device includes:
Monitoring modular, the signal pulse sent for monitoring clock equipment with out-of-band way, extracts the frequency of the pulse And phase, respectively as master clock frequency and master clock frequency phase;
Transmission module is believed for the master clock frequency to be mutually inserted into pre-generated common PTP with master clock frequency The corresponding position that the extended field of manufacturer's message format is organized in number message, then passes to modified PTP signal message The port PTP;
First processing module extracts wherein institute for receiving the modified PTP signal message of the port PTP transmission The master clock frequency and master clock frequency phase of carrying, according to the master clock frequency and master clock frequency relative local clock frequency and/ Or local clock frequency is mutually modified.
In the present embodiment, the first processing module is according to master clock frequency and master clock frequency relative local clock frequency And/or local clock frequency is mutually modified, comprising:
When determining the master clock frequency in the PTP signal message that clock equipment is sent via the port PTP continuous n period Rate is consistent, then enters the pre-locked state of frequency, and the frequency of the local clock of transparent clock is modified to the master clock frequency Rate;And/or
When the frequency determined in the PTP signal message that clock equipment is sent via the port the PTP continuous m period is mutually kept Unanimously, then enter the pre-locked state of phase, be the master clock frequency phase by the phase only pupil filter of the local clock of transparent clock.
In the present embodiment, the first processing module is according to master clock frequency and master clock frequency relative local clock frequency And/or local clock frequency is mutually modified, comprising:
By modifying the value progress frequency added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment Amendment, and/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carry out phase only pupil filter.
Referring to shown in Fig. 9, for a kind of time synchronism apparatus that sixth embodiment of the invention provides, set applied to transparent clock Standby, described device includes:
Receiving module, for receiving the PTP signal message that clock equipment is sent with in-band method by the port PTP;
Extraction module, for extract in the PTP signal message entrained master clock frequency relevant parameter and/or it is main when Clock frequency phase relevant parameter;
Second processing module is used for according to the relevant parameter to local clock frequency and/or local clock frequency Xiang Jinhang Amendment.
In the present embodiment, the extraction module extracts master clock frequency relevant parameter entrained in PTP signal message And/or master clock frequency phase relevant parameter, comprising: at least extraction master clock frequency, master clock frequency phase, whether frequency locking, whether locking phase Master clock frequency and/or master clock frequency phase parameter in parameter.
In the present embodiment, the Second processing module is modified local clock frequency according to relevant parameter, comprising:
According to preset first reference significance condition, whether the master clock frequency for judging that clock equipment is sent has reference Meaning;
When determining the master clock frequency with reference significance, then obtain in the PTP signal message is for identifying The parameter of no frequency locking;
When the parameter corresponds to master clock frequency locking, then further judgement: the continuous n of subsequently received clock equipment is a Whether the master clock frequency in PTP signal message that the period sends is consistent;
When the master clock frequency in the PTP signal message that clock equipment continuous n period sends is consistent, then enter The frequency of the local clock of transparent clock is modified to the master clock frequency by the pre-locked state of frequency.
In the present embodiment, the Second processing module is modified local clock frequency according to relevant parameter, also wraps Include: when the parameter value of acquisition corresponds to the non-frequency locking of master clock, alternatively, the frequency in continuous n period is not consistent, then after Whether the continuous master clock frequency for judging that clock equipment is sent has reference significance.
In the present embodiment, the preset first reference significance condition, comprising: extracted when in nearest setting time window To the fluctuation range of each frequency meet preset condition, then the frequency of master clock is with specific reference to meaning.
In the present embodiment, described device further include:
Frequency shift (FS) factor determining module loses for working as master clock frequency in the pre-locked state procedure of frequency with reference to meaning Perhaps master clock frequency does not have reference significance or transparent clock equipment always and can not identify and record in PTP signal message justice The TLV field of the clock information of master clock,
Then obtain the sheet estimated according to clock equipment and transparent clock equipment the sending cycle of sync message Sync The frequency shift (FS) factor of the ground clock relative to master clock;Based on the frequency shift (FS) factor, determine PTP event message when transparent The residence time of clock equipment.
In the present embodiment, the Second processing module is mutually modified local clock frequency according to relevant parameter, comprising:
According to preset second reference significance condition, whether the master clock frequency for judging that clock equipment is sent mutually has reference Meaning;
Mutually there is reference significance when determining the master clock frequency, then obtain in the PTP signal message is for identifying The parameter of no locking phase;
When the parameter corresponds to master clock locking phase, then further judgement: the continuous m of subsequently received clock equipment is a Whether the master clock frequency in the PTP signal message that the period sends mutually is consistent;
When the master clock frequency in the PTP signal message that clock equipment continuous m period sends mutually is consistent, then enter The phase only pupil filter of the local clock of transparent clock is the master clock frequency phase by the pre-locked state of phase.
In the present embodiment, the Second processing module is mutually modified local clock frequency according to relevant parameter, also wraps It includes: when the parameter value of reading corresponds to the non-locking phase of master clock, alternatively, the master clock frequency in continuous m period does not keep one mutually It causes, then whether the master clock frequency for continuing to judge that clock equipment is sent mutually has reference significance.
In the present embodiment, the frequency shift (FS) factor determining module is also used to when main in the pre-locked state procedure of phase Clock frequency mutually loses reference significance, and perhaps master clock frequency does not mutually have reference significance or transparent clock equipment always and can not know The TLV field of the clock information of master clock is recorded in other PTP signal message,
Then obtain the sheet estimated according to clock equipment and transparent clock equipment the sending cycle of sync message Sync The frequency shift (FS) factor of the ground clock relative to master clock;Based on the frequency shift (FS) factor, determine PTP event message when transparent The residence time of clock equipment.
In the present embodiment, the frequency shift (FS) factor determining module is obtained according to clock equipment and transparent clock equipment The frequency shift (FS) factor of the local clock that the sending cycle of sync message is estimated relative to master clock, comprising: when receiving main The PTP signal message for the carrying frequency shift (FS) factor that clock equipment issues;
The TLV for obtaining the PTP signal message organizes frequency shift (FS) factor Ff in the extension message of manufacturer's message format The MAC Address of this equipment carried in field then reads the frequency shift (FS) factor corresponding with the MAC Address in the Ff field Value, the frequency shift (FS) factor values as this equipment.
In the present embodiment, the Second processing module is according to master clock frequency and master clock frequency relative local clock frequency And/or local clock frequency is mutually modified, comprising:
By modifying the value progress frequency added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment Amendment, and/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carry out phase only pupil filter.
The embodiment of the invention also provides a kind of PTP system, the PTP system includes: time synchronism apparatus as described above Applied clock equipment, and transparent clock equipment applied by the time synchronism apparatus as described in figure 8 above, Fig. 9.
The description of above-mentioned method for synchronizing time is referred to about the processing details of the time synchronism apparatus, therefore not in this It repeats again.
The embodiment of the present invention has carried out carrying master clock for manufacturer's extension information in PTP signal message TLV entity norm The inside definition of frequency, frequency phase information, provides a kind of for need to be with the local clock frequency modulation phase modulation tune under frequency co-phasing operation scene Perfect square case provides a kind of more efficient time bias mode synchronous with master clock of TC.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.

Claims (20)

1. a kind of method for synchronizing time is applied to transparent clock equipment, which is characterized in that the described method includes:
The signal pulse that monitoring clock equipment is sent with out-of-band way, extracts the frequency and phase of the signal pulse, respectively As master clock frequency and master clock frequency phase;
The master clock frequency is mutually inserted into pre-generated common PTP signal message with master clock frequency organizes manufacturer to disappear The corresponding position for ceasing the extended field of format, then passes to the port PTP for modified PTP signal message;
Receive the modified PTP signal message of the port PTP transmission, extract wherein entrained master clock frequency and it is main when Clock frequency phase is mutually modified according to the master clock frequency with master clock frequency relative local clock frequency and/or local clock frequency.
2. the method as described in claim 1, which is characterized in that it is described according to master clock frequency and master clock frequency relative local when Clock frequency and/or local clock frequency are mutually modified, comprising:
When the master clock frequency determined in the PTP signal message that clock equipment is sent via the port the PTP continuous n period is protected It holds unanimously, then enters the pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to the master clock frequency; And/or
When the frequency determined in the PTP signal message that clock equipment is sent via the port the PTP continuous m period mutually keeps one It causes, then enters the pre-locked state of phase, be the master clock frequency phase by the phase only pupil filter of the local clock of transparent clock.
3. the method as described in claim 1, which is characterized in that it is described according to master clock frequency and master clock frequency relative local when Clock frequency and/or local clock frequency are mutually modified, comprising:
By modifying the value progress frequency amendment added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment, And/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carries out phase only pupil filter.
4. a kind of method for synchronizing time is applied to transparent clock equipment, which is characterized in that the described method includes:
The PTP signal message that clock equipment is sent with in-band method is received by the port PTP;
Extract master clock frequency relevant parameter and/or master clock frequency phase relevant parameter entrained in the PTP signal message;
Local clock frequency and/or local clock frequency are mutually modified according to the relevant parameter;
Wherein, described to extract master clock frequency relevant parameter and/or master clock frequency entrained in PTP signal message mutually related ginseng Number, comprising: at least extraction master clock frequency, master clock frequency phase, whether frequency locking, whether master clock frequency in locking phase parameter and/ Or master clock frequency phase parameter;
It is described that local clock frequency is modified according to relevant parameter, comprising:
Step 101, according to preset first reference significance condition, whether the master clock frequency for judging that clock equipment is sent has Reference significance;
Step 102, when determining the master clock frequency with reference significance, then obtain in the PTP signal message for marking Know whether the parameter of frequency locking;
Step 121 corresponds to master clock frequency locking when the parameter, then further judgement: subsequently received clock equipment connects Whether the master clock frequency in PTP signal message that the continuous n period sends is consistent;
Master clock frequency in step 122, the PTP signal message sent when clock equipment continuous n period is consistent, then Into the pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to the master clock frequency;
It is described that local clock frequency is mutually modified according to relevant parameter, comprising:
Step 201, according to preset second reference significance condition, whether the master clock frequency for judging that clock equipment is sent mutually has Reference significance;
Step 202 mutually has reference significance when determining master clock frequency, then obtains in the PTP signal message for marking Know whether the parameter of locking phase;
Step 221 corresponds to master clock locking phase when the parameter, then further judgement: subsequently received clock equipment connects Whether the master clock frequency in the PTP signal message that the continuous m period sends mutually is consistent;
Master clock frequency in step 222, the PTP signal message sent when clock equipment continuous m period is mutually consistent, then It is the master clock frequency phase by the phase only pupil filter of the local clock of transparent clock into the pre-locked state of phase.
5. method as claimed in claim 4, which is characterized in that when the parameter value of acquisition corresponds to the non-frequency locking of master clock, Alternatively, the master clock frequency in continuous n period is not consistent, then equal return step 101, continues waiting for.
6. method as claimed in claim 4, which is characterized in that the preset first reference significance condition, comprising: when nearest The fluctuation range for each master clock frequency extracted in setting time window meets preset condition, then master clock frequency has Reference significance.
7. method as claimed in claim 4, which is characterized in that the method also includes:
When master clock frequency loses reference significance in the pre-locked state procedure of frequency or master clock frequency does not have reference always Meaning or transparent clock equipment can not identify the TLV field that the clock information of master clock is recorded in PTP signal message,
When the local that then acquisition estimates the sending cycle of sync message Sync according to clock equipment and transparent clock equipment The frequency shift (FS) factor of the clock relative to master clock;Based on the frequency shift (FS) factor, determine that PTP event message is set in transparent clock Standby residence time.
8. method as claimed in claim 4, which is characterized in that when the parameter value of reading corresponds to the non-locking phase of master clock, Alternatively, the master clock frequency in continuous m period is not consistent mutually, then equal return step 201, continues waiting for.
9. method as claimed in claim 4, which is characterized in that the method also includes:
When master clock frequency mutually loses reference significance in the pre-locked state procedure of phase or master clock frequency does not have reference mutually always Meaning or transparent clock equipment can not identify the TLV field that the clock information of master clock is recorded in PTP signal message,
Then obtain the local clock phase estimated according to clock equipment with sending cycle of the transparent clock equipment to sync message For the frequency shift (FS) factor of master clock;Based on the frequency shift (FS) factor, determine PTP event message in transparent clock equipment Residence time.
10. method as claimed in claim 9, which is characterized in that
It is described to obtain the local clock estimated according to clock equipment and transparent clock equipment the sending cycle of sync message The frequency shift (FS) factor relative to master clock, comprising: receive the PTP for the carrying frequency shift (FS) factor that clock equipment issues Signal message;
The TLV for obtaining the PTP signal message organizes frequency shift (FS) factor Ff field in the extension message of manufacturer's message format The MAC Address of this equipment of middle carrying then reads frequency shift (FS) factor values corresponding with the MAC Address in the Ff field, Frequency shift (FS) factor values as this equipment.
11. method as claimed in claim 4, which is characterized in that described according to master clock frequency and master clock frequency relative local Clock frequency and/or local clock frequency are mutually modified, comprising:
By modifying the value progress frequency amendment added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment, And/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carries out phase only pupil filter.
12. a kind of time synchronism apparatus, it is applied to transparent clock equipment, which is characterized in that described device includes:
Monitoring modular, the signal pulse sent for monitoring clock equipment with out-of-band way extract the frequency and phase of the pulse Position, respectively as master clock frequency and master clock frequency phase;
Transmission module, for the master clock frequency to be mutually inserted into pre-generated common PTP signal report with master clock frequency The corresponding position that the extended field of manufacturer's message format is organized in text, then passes to the end PTP for modified PTP signal message Mouthful;
First processing module is extracted wherein entrained for receiving the modified PTP signal message of the port PTP transmission Master clock frequency and master clock frequency phase, according to the master clock frequency and master clock frequency relative local clock frequency and/or this Ground clock frequency is mutually modified.
13. device as claimed in claim 12, which is characterized in that the first processing module according to master clock frequency and it is main when Clock frequency relative local clock frequency and/or local clock frequency are mutually modified, comprising:
When the master clock frequency determined in the PTP signal message that clock equipment is sent via the port the PTP continuous n period is protected It holds unanimously, then enters the pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to the master clock frequency; And/or
When the frequency determined in the PTP signal message that clock equipment is sent via the port the PTP continuous m period mutually keeps one It causes, then enters the pre-locked state of phase, be the master clock frequency phase by the phase only pupil filter of the local clock of transparent clock.
14. device as claimed in claim 12, which is characterized in that the first processing module according to master clock frequency and it is main when Clock frequency relative local clock frequency and/or local clock frequency are mutually modified, comprising:
By modifying the value progress frequency amendment added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment, And/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carries out phase only pupil filter.
15. a kind of time synchronism apparatus, it is applied to transparent clock equipment, which is characterized in that described device includes:
Receiving module, for receiving the PTP signal message that clock equipment is sent with in-band method by the port PTP;
Extraction module, for extracting master clock frequency relevant parameter and/or master clock frequency entrained in the PTP signal message Phase relevant parameter;
Second processing module, for being mutually modified according to the relevant parameter to local clock frequency and/or local clock frequency;
Wherein, the extraction module extracts master clock frequency relevant parameter and/or master clock frequency entrained in PTP signal message Phase relevant parameter, comprising: at least extraction master clock frequency, master clock frequency phase, whether frequency locking, whether the master clock in locking phase parameter Frequency and/or master clock frequency phase parameter;
The Second processing module is modified local clock frequency according to relevant parameter, comprising:
According to preset first reference significance condition, judge whether the master clock frequency that clock equipment is sent has with reference to meaning Justice;
When determining the master clock frequency with reference significance, then obtain in the PTP signal message for identifying whether to lock The parameter of frequency;
When the parameter corresponds to master clock frequency locking, then further judgement: subsequently received clock equipment continuous n period Whether the master clock frequency in the PTP signal message of transmission is consistent;
When the master clock frequency in the PTP signal message that the clock equipment continuous n period sends is consistent, then into frequency The frequency of the local clock of transparent clock is modified to the master clock frequency by pre-locked state;
The Second processing module is mutually modified local clock frequency according to relevant parameter, comprising:
According to preset second reference significance condition, whether the master clock frequency for judging that clock equipment is sent mutually has with reference to meaning Justice;
Mutually there is reference significance when determining the master clock frequency, then obtain in the PTP signal message for identifying whether to lock The parameter of phase;
When the parameter corresponds to master clock locking phase, then further judgement: subsequently received clock equipment continuous m period Whether the master clock frequency in the PTP signal message of transmission is mutually consistent;
When the master clock frequency in the PTP signal message that the clock equipment continuous m period sends mutually is consistent, then into phase The phase only pupil filter of the local clock of transparent clock is the master clock frequency phase by pre-locked state.
16. device as claimed in claim 15, which is characterized in that the Second processing module according to master clock frequency and it is main when Clock frequency relative local clock frequency and/or local clock frequency are mutually modified, comprising:
By modifying the value progress frequency amendment added in the frequency compensation register of the Frequency Adjustable oscillator of transparent clock equipment, And/or the value of the phase compensation register by modifying Frequency Adjustable oscillator carries out phase only pupil filter.
17. a kind of PTP system characterized by comprising clock equipment and, as described in claim 12-14 any one Device or claim 15-16 any one described in transparent clock equipment applied by device;Wherein, when described main Clock equipment includes:
Sending module for sending precision time protocol PTP event message to transparent clock equipment, and is sent out to transparent clock equipment Send master clock frequency relevant parameter and/or master clock frequency phase relevant parameter;
Wherein, clock equipment is to have done this system superlative degree clockwork of uplink residence time correction.
18. system as claimed in claim 17, which is characterized in that the sending module sends PTP thing to transparent clock equipment Part message, comprising: PTP event message is periodically sent to transparent clock equipment with in-band method;Also,
Transparent clock equipment included by the system is transparent applied by device described in claim 12-14 any one Clockwork;The sending module sends master clock frequency relevant parameter and/or master clock frequency Xiang Xiangguan to transparent clock equipment Parameter, comprising: master clock frequency relevant parameter and/or master clock frequency are periodically sent to transparent clock equipment with out-of-band way Phase relevant parameter;Or
Transparent clock equipment included by the system is transparent applied by device described in claim 15-16 any one Clockwork;The sending module sends master clock frequency relevant parameter and/or master clock frequency Xiang Xiangguan to transparent clock equipment Parameter, comprising: master clock frequency relevant parameter and/or master clock frequency are periodically sent to transparent clock equipment with in-band method Phase relevant parameter.
19. system as claimed in claim 18, which is characterized in that the sending module is with in-band method periodically to transparent Clockwork sends master clock frequency relevant parameter and/or frequency phase relevant parameter, comprising:
At least obtain master clock frequency, master clock frequency phase, whether frequency locking, whether master clock frequency in locking phase parameter and/or master Clock frequency phase parameter;
The parameter that will acquire is inserted into the extension word that manufacturer's message format is organized in pre-generated common PTP signal message respectively The corresponding position of section;
Modified PTP signal message is sent to by the port PTP through Ethernet the port PTP of transparent clock equipment.
20. system as claimed in claim 18, which is characterized in that the sending module is with out-of-band way periodically to transparent Clockwork sends master clock frequency relevant parameter and/or frequency phase relevant parameter, comprising:
Based on utilizing with the band connection line of transparent clock equipment, band external tapping issues frequency and phase is respectively master clock frequency With the signal pulse of master clock frequency phase.
CN201610978591.9A 2016-11-07 2016-11-07 A kind of method for synchronizing time, device and PTP system Active CN106357362B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610978591.9A CN106357362B (en) 2016-11-07 2016-11-07 A kind of method for synchronizing time, device and PTP system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610978591.9A CN106357362B (en) 2016-11-07 2016-11-07 A kind of method for synchronizing time, device and PTP system

Publications (2)

Publication Number Publication Date
CN106357362A CN106357362A (en) 2017-01-25
CN106357362B true CN106357362B (en) 2019-05-17

Family

ID=57861371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610978591.9A Active CN106357362B (en) 2016-11-07 2016-11-07 A kind of method for synchronizing time, device and PTP system

Country Status (1)

Country Link
CN (1) CN106357362B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108738127B (en) * 2018-04-13 2021-04-27 中国科学院微电子研究所 Radio remote unit, baseband processing unit, distributed base station and synchronization method thereof
CN108667545B (en) * 2018-04-17 2020-06-02 迈普通信技术股份有限公司 Serial port bandwidth synchronization method and device
CN110536405B (en) * 2018-05-25 2021-08-03 华为技术有限公司 Synchronization method and access point
CN111107621B (en) * 2018-10-29 2021-02-26 大唐移动通信设备有限公司 Synchronization method and device
CN111277349B (en) 2018-12-04 2023-12-22 深圳市中兴微电子技术有限公司 Clock synchronization method and system
CN111181555B (en) * 2019-12-31 2023-09-12 瑞斯康达科技发展股份有限公司 PTP clock synchronization system and clock synchronization method
CN111884678A (en) * 2020-06-20 2020-11-03 青岛鼎信通讯股份有限公司 Distribution line distance measurement method based on HPLC technology
CN111884749B (en) * 2020-07-24 2022-05-20 中国科学院精密测量科学与技术创新研究院 High-precision fixed period PTP time synchronization method based on clock split phase
CN117516901B (en) * 2023-11-06 2024-05-31 北京通泰恒盛科技有限责任公司 Clock synchronization method and system for fan blade monitoring based on inertial navigation technology

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102123046A (en) * 2011-01-21 2011-07-13 烽火通信科技股份有限公司 Packet transport network (PTN) device and method for realizing time synchronization protection switching (PS) by using main cross disk and spare cross disk of PTN device
CN102185686A (en) * 2011-05-16 2011-09-14 中兴通讯股份有限公司 Institute of electrical and electronic engineers (IEEE)-1588-protocol-based frequency regulation method and network device
WO2011120262A1 (en) * 2010-03-31 2011-10-06 中兴通讯股份有限公司 Time synchronization processing method and device
CN103117845A (en) * 2012-11-13 2013-05-22 华为技术有限公司 Modification method, device and system of transparent clock residence time

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011120262A1 (en) * 2010-03-31 2011-10-06 中兴通讯股份有限公司 Time synchronization processing method and device
CN102123046A (en) * 2011-01-21 2011-07-13 烽火通信科技股份有限公司 Packet transport network (PTN) device and method for realizing time synchronization protection switching (PS) by using main cross disk and spare cross disk of PTN device
CN102185686A (en) * 2011-05-16 2011-09-14 中兴通讯股份有限公司 Institute of electrical and electronic engineers (IEEE)-1588-protocol-based frequency regulation method and network device
CN103117845A (en) * 2012-11-13 2013-05-22 华为技术有限公司 Modification method, device and system of transparent clock residence time

Also Published As

Publication number Publication date
CN106357362A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
CN106357362B (en) A kind of method for synchronizing time, device and PTP system
Moreira et al. White rabbit: Sub-nanosecond timing distribution over ethernet
US8873589B2 (en) Methods and devices for clock synchronization
US8817823B2 (en) Method and device for time synchronization
JP5811794B2 (en) Communication device
CN104507156B (en) For the time synchronization improved method based on IEEE 1588PTP mechanism of wireless network
CN101447861B (en) IEEE 1588 time synchronization system and implementation method thereof
Jasperneite et al. Enhancements to the time synchronization standard IEEE-1588 for a system of cascaded bridges
US8446896B2 (en) Time synchronization using packet-layer and physical-layer protocols
WO2018006686A1 (en) Method, apparatus and device for optimizing time synchronization between communication network devices
CN101425865B (en) Method and system for synchronizing clock of transmission network as well as subordinate clock side entity
Garner et al. Synchronization of audio/video bridging networks using IEEE 802.1 AS
CN101977104A (en) IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof
CN103166792B (en) Line asymmetrical compensation method, equipment and system
WO2004036341A3 (en) Synchronizing between terminals of asynchronous networks using timestamps
CN102006157A (en) Time synchronization method and system
CN105577349A (en) Airborne network IEEE1588 protocol master-slave clock port synchronization method
CN105978652B (en) Equipment, system and method at synchronous pair of Redundant Ethernet
CN107786293A (en) Method for synchronizing time, clock equipment, from clockwork and clock synchronization system
CN103259640A (en) Method and device for synchronizing time
WO2014037684A1 (en) Methods and devices for clock synchronization
CN109921871A (en) A kind of method for synchronizing time, device and network system
CN108683472A (en) A kind of clock synchronizing method based on Time delay measurement
WO2018076651A1 (en) Time synchronization method, device and computer storage medium
CN207884639U (en) A kind of network node, temporal noise transmission characteristic measuring device and synchronous communication network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant