CN106357362A - Time synchronization method and device and PTP system - Google Patents

Time synchronization method and device and PTP system Download PDF

Info

Publication number
CN106357362A
CN106357362A CN201610978591.9A CN201610978591A CN106357362A CN 106357362 A CN106357362 A CN 106357362A CN 201610978591 A CN201610978591 A CN 201610978591A CN 106357362 A CN106357362 A CN 106357362A
Authority
CN
China
Prior art keywords
frequency
clock frequency
master clock
clock
equipment
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.)
Granted
Application number
CN201610978591.9A
Other languages
Chinese (zh)
Other versions
CN106357362B (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 time synchronization method and device and a PTP system. When the time synchronization method is applied to transparent clock equipment, the method comprises the following steps: monitoring a signal pulse sent by main clock equipment in an out-of-band mode, and extracting the frequency and phase of the signal pulse to be respectively used as a main clock frequency and a main clock phase; inserting the main clock frequency and the main clock phase into a corresponding position of an extension field in an organization vendor information format in a common PTP signal message generated in advance, and then transmitting the modified PTP signal message to a PTP port; and receiving the modified PTP signal message transmitted by the PTP port, extracting the main clock frequency and the main clock phase carried in the modified PTP signal message, and modifying the local clock frequency and/or local clock phase according to the main clock frequency and the main clock phase. Through the adoption of the method disclosed by the embodiment of the invention, a PTP protocol is extended, so that the clock equipment synchronization result in the PTP system is more precise.

Description

A kind of method for synchronizing time, device and ptp system
Technical field
The present invention relates to communication technical field, more particularly, to a kind of method for synchronizing time, device and ptp system.
Background technology
With the development of network technology, distributed system technology is increasingly used in measurement and control area, these technology bags Include network service, local computing, distributed objects etc..Many applications need the time using device node clock to produce, such as The time of each node in the protocol synchronization distributed system of fruit neither one standard, then these equipment will be unable to realize Synchronization control function in real time.Some time synchronization protocols existing are not appropriate for used in distributed measurement and control area, such as network Time protocol (ntp), it is mainly used in the synchronization of large scale system, and its precision typically only reaches a millisecond rank.And ieee1588 association View is then the time synchronization protocol formulated exclusively for measurement and control area, and this agreement can be used for appointing including Ethernet What supports the network of multicast functionality.
The clock synchronization mechanism regulation of ieee 1588 agreement, system works in master slave mode, is set by master clock (master) There is provided clock reference for from clockwork.Specific implementation is: clock equipment periodically sends sync message (sync), Calculated between time delay and the master-salve clock of this message transmissions according to the time receiving sync message from clockwork Deviation, and adjust local zone time to keep consistent with the clock of clock equipment.
Ieee1588 uses precision time protocol ptp (precision timing protocol), by reporting end to end Literary composition interaction obtains clock reference information, corrects local clock frequency and phase place.1588 agreements are based on two assumed conditions: first, In clock equipment between clockwork, network message transmission time is symmetrical.That is a message is when main Clock equipment is equal to message from the transmission time from clockwork to clock equipment to from the transmission time of clockwork;Second, In the middle of ptp message interaction process, the drift of local clock is negligible.Basic model such as Fig. 1 of sync message interaction Shown.
(1) clock equipment sends synchronous (sync) message to from clockwork, charges to depositor by sending time t1.
(2) receive sync message from clockwork, and indicate the time t2 receiving message.
(3) clock equipment follows (follow_up) message to from clockwork transmission, time t1 is embedded into and follows report Wen Zhong.
(4) ask (delay_req) message from clockwork to clock equipment forward delay interval, and embedded timestamp t3.
(5) clock equipment receives delay_req message, and indicates the time t4 receiving message.
(6) clock equipment passes through to embed timestamp t4, clock equipment in delayed response (delay_resp) message Timestamp t4 is transferred to from clockwork.
At the end of mutual message, have described 4 timestamps from clockwork, these timestamps are used for calculating from clock Equipment and the side-play amount (offset) of clock equipment, and calculate average transmission time between two clocks for the message.
Ptp end-to-end transparent clock equipment as common bridge, router or switch, forward clock equipment with All messages of interaction between clockwork.Typically, the residence time bridge of end-to-end transparent clock equipment is for interaction Ptp event message, can calculate the residence time that this message passes through this equipment, and by this residence time in this ptp event message One specific fields is added up, read after clockwork receives ptp event message the residence time wherein carrying and its It is synchronous that his timestamp enters row clock.And calculating resident used timestamp (namely residence time) is by transparent clock equipment base Produce in local clock.
But, the local clock of actually end-to-end transparent clock equipment is inaccurate, and not necessarily begins with clock equipment Keep synchronous eventually, so error also will be had based on the residence time that local clock calculates, thus impact is from clockwork Clock synchronization accuracy.
For this reason, in existing method, ptp end-to-end transparent clock equipment is typically basis and had done up residence time correction Transmission cycle to sync message in ptp event message of clock equipment and local clock equipment, calculate master clock and local The ratio (i.e. the frequency shift (FS) factor, ff) of clock rate, then revises local clock according to described ratio.But the method is deposited In the excessive problem of the local clock rate obtaining and master clock rate error, for example, it is subject to the shadow of the various factors such as network environment Ring, each sync message to the regular transmission of master clock for the ptp end-to-end transparent clock equipment, can not possibly be inherently strictly according to spy Fixed cycle is forwarded, and can only be substantially to estimate a transmission cycle to sync message, thus leading to the essence of residence time Exactness is difficult to ensure that.
Content of the invention
In order to solve above-mentioned technical problem, the invention provides a kind of method for synchronizing time, device and ptp system, permissible The local clock synchronized result realizing ptp end-to-end transparent clock equipment is more accurate.
Embodiments provide a kind of technical scheme below: method for synchronizing time, be applied to clock equipment, described Method includes:
Send precision time protocol ptp event message to transparent clock equipment, and send master clock to transparent clock equipment Frequency dependence parameter and/or master clock frequency phase relevant parameter;
Wherein, clock equipment is to have done the system superlative degree clockwork of up residence time correction.
Optionally, described send ptp event message to transparent clock equipment, comprising: with in-band method periodically to saturating Bright clockwork sends ptp event message;And,
Described 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 are periodically sent to transparent clock equipment with in-band method or out-band method Frequency phase relevant parameter.
Optionally, 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, the master clock frequency whether locking in phase parameter and/ Or master clock frequency phase parameter;
The parameter of acquisition is inserted into respectively the expansion of tissue manufacturer message format in the common ptp signal message previously generating The relevant position of exhibition field;
Amended ptp signal message is sent through Ethernet by ptp port to the ptp port of transparent clock equipment.
Optionally, described with out-band method periodically to transparent clock equipment send master clock frequency relevant parameter and/ Or frequency phase relevant parameter, comprising:
Frequency is sent using band external tapping based on the band connection line with transparent clock equipment and phase place is respectively master clock Frequency and the signal pulse of master clock frequency phase.
The embodiment of the present invention additionally provides technical scheme below:
A kind of method for synchronizing time, is applied to transparent clock equipment, and methods described includes:
The signal pulse that monitoring clock equipment is sent with out-band method, extracts frequency and the phase place of described signal pulse, Respectively as master clock frequency and master clock frequency phase;
Described master clock frequency is mutually inserted into tissue factory in the common ptp signal message previously generating with master clock frequency Then amended ptp signal message is passed to ptp port by the relevant position of the extended field of business's message format;
Receive the described amended ptp signal message of ptp port transmission, extract wherein entrained master clock frequency and Master clock frequency phase, is mutually carried out with master clock frequency relative local clock frequency and/or local clock frequency according to described master clock frequency Revise.
Optionally, described according to master clock frequency with 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 clock equipment ptp signal message that continuous n cycle sends via ptp port Rate is consistent, then enter the pre-locked state of frequency, and the frequency of the local clock of transparent clock is modified to described master clock frequency Rate;And/or,
Mutually keep when determining the frequency in the clock equipment ptp signal message that the continuous m cycle sends via ptp port Unanimously, then enter the pre-locked state of applying aspect, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
Optionally, described according to master clock frequency with master clock frequency relative local clock frequency and/or local clock frequency phase It is modified, comprising:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency Revise, and/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
The embodiment of the present invention additionally provides technical scheme below:
A kind of method for synchronizing time, is applied to transparent clock equipment, and methods described includes:
The ptp signal message that clock equipment is sent with in-band method is received by ptp port;
Extract entrained master clock frequency relevant parameter in described ptp signal message and/or the related ginseng of master clock frequency Number;
According to described relevant parameter, local clock frequency and/or local clock frequency are mutually modified.
Optionally, entrained master clock frequency relevant parameter and/or master clock frequency phase in described extraction ptp signal message Relevant parameter, comprising: at least extract master clock frequency, master clock frequency phase, whether frequency locking, the master clock frequency whether locking in phase parameter Rate and/or master clock frequency phase parameter.
Optionally, described according to relevant parameter, local clock frequency is modified, comprising:
Step 101, according to default first reference significance condition, judge master clock frequency that clock equipment sends is whether There is reference significance;
Step 102, there is reference significance when determining described master clock frequency, then obtain in described ptp signal message and use In the parameter identifying whether frequency locking;
Step 121, when described parameter corresponds to master clock frequency locking, then determine whether: subsequently received master clock sets Whether the master clock frequency in the ptp signal message that the standby continuous n cycle sends is consistent;
Step 122, keep one when the master clock frequency in the ptp signal message that clock equipment continuous n cycle sends Cause, then enter the pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to this master clock frequency.
Optionally, when the described parameter value obtaining corresponds to the non-frequency locking of master clock, or, the master clock in continuous n cycle Frequency is not consistent, then equal return to step 101, continues waiting for.
Optionally, described default first reference significance condition, comprising: each when extract in nearest setting time window The fluctuation range of individual master clock frequency meets default condition, then master clock frequency is with specific reference to meaning.
Optionally, methods described also includes:
When in the pre-locked state procedure of frequency, master clock frequency loses reference significance, or master clock frequency does not possess all the time The tlv field of the clock information of master clock is recorded in reference significance, or transparent clock equipment None- identified ptp signal message,
Then obtain the basis transmission cycle of sync message sync estimated according to clock equipment and transparent clock equipment Ground clock is with respect to the frequency shift (FS) factor of master clock;Based on the described frequency shift (FS) factor, determine ptp event message when transparent The residence time of clock equipment.
Optionally, described according to relevant parameter to local clock frequency be mutually modified, comprising:
Step 201, according to default second reference significance condition, judge master clock frequency that clock equipment sends mutually whether There is reference significance;
Step 202, mutually there is reference significance when determining described master clock frequency, then obtain in described ptp signal message and use In the parameter identifying whether lock phase;
Step 221, when described parameter correspond to master clock lock phase, then determine whether: subsequently received master clock sets Whether the master clock frequency in the ptp signal message that the standby continuous m cycle sends mutually is consistent;
Step 222, mutually keep one when the master clock frequency in the ptp signal message that clock equipment continuous m cycle sends Cause, then enter the pre-locked state of applying aspect, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
Optionally, when the described parameter value reading corresponds to the unlocked phase of master clock, or, the master clock in continuous m cycle Frequency is not mutually consistent, then equal return to step 201, continues waiting for.
Optionally, methods described also includes:
When in the pre-locked state procedure of phase place, master clock frequency mutually loses reference significance, or master clock frequency does not mutually possess all the time The tlv field of the clock information of master clock is recorded in reference significance, or transparent clock equipment None- identified ptp signal message,
Then obtain according to clock equipment and transparent clock equipment the transmission cycle of sync message is estimated local when Clock is with respect to the frequency shift (FS) factor of master clock;Based on the described frequency shift (FS) factor, determine that ptp event message sets in transparent clock Standby residence time.
Optionally,
Described acquisition is local with what transparent clock equipment was estimated to the transmission cycle of sync message according to clock equipment Clock is with respect to the frequency shift (FS) factor of master clock, comprising: receives issue one of clock equipment and carries the frequency shift (FS) factor Ptp signal message;
The tlv obtaining described ptp signal message organizes frequency shift (FS) factor ff in the extension message of manufacturer's message format The mac address of this equipment carrying in field, then read in described ff field with the corresponding frequency shift (FS) in this mac address factor Value, as the frequency shift (FS) factor values of this equipment.
Optionally, described according to master clock frequency with master clock frequency relative local clock frequency and/or local clock frequency phase It is modified, comprising:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency Revise, and/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
The embodiment of the present invention additionally provides technical scheme below:
A kind of time synchronism apparatus, are applied to clock equipment, and described device includes:
Sending module, for sending precision time protocol ptp event message to transparent clock equipment, and sets 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 the system superlative degree clockwork of up residence time correction.
Optionally, described sending module sends ptp event message to transparent clock equipment, comprising: with the in-band method cycle Property to transparent clock equipment send ptp event message;And,
Described sending module sends master clock frequency relevant parameter and/or the related ginseng of master clock frequency to transparent clock equipment Number, comprising: with in-band method or out-band method periodically to transparent clock equipment send master clock frequency relevant parameter and/ Or master clock frequency phase relevant parameter.
Optionally, described 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, the master clock frequency whether locking in phase parameter and/ Or master clock frequency phase parameter;
The parameter of acquisition is inserted into respectively the expansion of tissue manufacturer message format in the common ptp signal message previously generating The relevant position of exhibition field;
Amended ptp signal message is sent through Ethernet by ptp port to the ptp port of transparent clock equipment.
Optionally, described sending module periodically sends master clock frequency correlation to transparent clock equipment with out-band method Parameter and/or frequency phase relevant parameter, comprising:
Frequency is sent using band external tapping based on the band connection line with transparent clock equipment and phase place is respectively master clock Frequency and the signal pulse of master clock frequency phase.
The embodiment of the present invention additionally provides technical scheme below:
A kind of time synchronism apparatus, are applied to transparent clock equipment, and described device includes:
Monitoring modular, for monitoring the signal pulse that clock equipment is sent with out-band method, extracts the frequency of this pulse And phase place, respectively as master clock frequency and master clock frequency phase;
Transport module, for being mutually inserted into the common ptp letter previously generating by described master clock frequency and master clock frequency In number message, then amended ptp signal message is passed to by the relevant position of the extended field of tissue manufacturer message format Ptp port;
First processing module, for receiving the described amended ptp signal message of ptp port transmission, extracts wherein institute The master clock frequency carrying and master clock frequency phase, according to described master clock frequency and master clock frequency relative local clock frequency and/ Or local clock frequency is mutually modified.
Optionally, described 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 clock equipment ptp signal message that continuous n cycle sends via ptp port Rate is consistent, then enter the pre-locked state of frequency, and the frequency of the local clock of transparent clock is modified to described master clock frequency Rate;And/or,
Mutually keep when determining the frequency in the clock equipment ptp signal message that the continuous m cycle sends via ptp port Unanimously, then enter the pre-locked state of applying aspect, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
Optionally, described 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:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency Revise, and/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
The embodiment of the present invention additionally provides technical scheme below:
A kind of time synchronism apparatus, are applied to transparent clock equipment, and described device includes:
Receiver module, for receiving, by ptp port, the ptp signal message that clock equipment is sent with in-band method;
Extraction module, for extract entrained master clock frequency relevant parameter in described ptp signal message and/or main when Clock frequency phase relevant parameter;
Second processing module, for mutually carrying out to local clock frequency and/or local clock frequency according to described relevant parameter Revise.
Optionally, described extraction module extracts entrained master clock frequency relevant parameter and/or master in ptp signal message Clock frequency phase relevant parameter, comprising: at least extract master clock frequency, master clock frequency phase, whether frequency locking, whether lock in phase parameter Master clock frequency and/or master clock frequency phase parameter.
Optionally, described Second processing module is modified to local clock frequency according to relevant parameter, comprising:
According to default first reference significance condition, judge whether the master clock frequency that clock equipment sends has reference Meaning;
When determining described master clock frequency, there is reference significance, then obtaining in described ptp signal message for mark is The parameter of no frequency locking;
When described parameter corresponds to master clock frequency locking, then determine whether: continuous n of subsequently received clock equipment Whether the master clock frequency in the ptp signal message that the cycle sends is consistent;
When the master clock frequency in the ptp signal message that the clock equipment continuous n cycle sends is consistent, then enter The pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to this master clock frequency.
Optionally, described Second processing module is mutually modified to local clock frequency according to relevant parameter, comprising:
According to default second reference significance condition, judge whether the master clock frequency that clock equipment sends mutually has reference Meaning;
When determining described master clock frequency, mutually there is reference significance, then obtaining in described ptp signal message for mark is The parameter of no lock phase;
When described parameter corresponds to master clock lock phase, then determine whether: continuous m of subsequently received clock equipment Whether the master clock frequency in the ptp signal message that the cycle sends mutually is consistent;
When the master clock frequency in the ptp signal message that the clock equipment continuous m cycle sends mutually is consistent, then enter The pre-locked state of phase place, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
Optionally, described 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:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency Revise, and/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
The embodiment of the present invention additionally provides technical scheme below:
A kind of ptp system, comprising: the clock equipment that device as above is applied;And, device as above The transparent clock equipment applied.
The embodiment of the present invention directly carries related master clock information by clock equipment by ptp signal message and is handed down to Bright clockwork, transparent clock equipment produces more accurate local clock accordingly so that ptp event message resident when Between degree of accuracy be effectively improved.Compared to prior art according to the transmission cycle of ptp event message obtain frequency shift (FS) because Son, using the method for this factor correction local clock, it is possible to obtain the degree of accuracy of higher residence time.The embodiment of the present invention expands Open up ptp agreement, compared existing implementation, there is the more accurate feature of acquisition master clock frequency, frequency phase information, make In ptp system, clockwork synchronized result is more accurate.The embodiment of the present invention simultaneously provides numerous embodiments, can meet reality Various situations in the application of border, have the characteristics that solution is comprehensive, practical.
Brief description
Accompanying drawing is used for providing technical scheme is further understood, and constitutes a part for description, with this The embodiment of application is used for explaining the technical scheme of the application together, does not constitute the restriction to technical scheme.Attached In figure:
Fig. 1 interacts schematic diagram for precision time protocol sync message.
A kind of clock system networking schematic diagram that Fig. 2 applies for 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 is the showing of a kind of tc (transparent clock, transparent clock) local clock frequency modulation 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 representation in a kind of ptp system that Fig. 8 provides for fifth embodiment of the invention.
Time synchronism apparatus structural representation in a kind of ptp system that Fig. 9 provides for sixth embodiment of the invention.
Specific embodiment
For making the object, technical solutions and advantages of the present invention become more apparent, below in conjunction with accompanying drawing to the present invention Embodiment be described in detail.It should be noted that in the case of not conflicting, in embodiment in the application and embodiment Feature can mutual combination in any.
With reference to Fig. 2, Fig. 2 shows the clock synchronous network system of embodiment of the present invention application, in described group network system Comprise multiple master clocks, transparent clock and from clockwork.In embodiments of the present invention, transparent clock equipment refer to hold right End transparent clock equipment.
Fig. 3 shows ptp signal message format specification, ptp signal message transmission information, request and life between clockwork Order.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: in table, newly-increased master_crystal (mc) represents master clock crystal oscillator frequency;Master_lock_crystal (mlc) represents Master clock whether frequency locking;Master_phase (mp) represents master clock frequency phase;When master_lock_phase (mlp) represents main Whether clock locks phase.Wherein, mlc represents from whether (the system) superlative degree current crystal oscillator frequency of clock locks, when being easy to transparent Clock equipment or synchronization immediately or wait until that mlc is designated during the local frequency modulation of clockwork carries out clock correction based on this Synchronize after frequency locking;Mlp represents from whether the current frequency of (the system) superlative degree clock mutually locks, be easy to transparent clock or from Based in this frequency phase trimming process, whether mlp that is synchronous immediately or waiting lock phase synchronizes the local phase modulation of clock.
Fig. 5 describe tc clock according to event message interface to the timestamp information of sync message calculate frequency Displacement factor ff,
f f = δ t 0 δ t 1 ;
Wherein, △ t0 sends the cycle of synchronous (sync) message for clock equipment,
△ t0=t0 '-t0, t0, t0 ' successively in succession send sync message for clock equipment twice according to setting cycle Temporal information.
△ t1 receives the cycle of sync message for transparent clock equipment,
△ t1=t1 '-t1, t1, t1 ' successively in succession receive sync message for transparent clock equipment twice according to setting cycle Temporal information.
Described ff is carried out locally stored.
Transparent clock (namely tc) equipment is below described to the extraction of ptp signal message, identification and time bias flow process, The scheme that the embodiment of the present invention is realized is described in detail.Described below scheme can be applicable to the networking being provided as figure 2 above Framework, this network is referred to as ptp domain or ptp system.
First embodiment of the invention provides a kind of method for synchronizing time, is applied to clock equipment, and methods described includes:
Send ptp event message to transparent clock equipment, transmit master clock frequency and/or master clock to transparent clock equipment Frequency phase relevant parameter;
Described to transparent clock equipment send ptp event message, comprising: periodically set to transparent clock with in-band method Preparation send ptp event message;
Described transmit master clock frequency and/or frequency phase parameter to transparent clock equipment, comprising: by mode in band or out of band Periodically transmit master clock frequency and/or master clock frequency phase relevant parameter to transparent clock equipment.
Wherein clock equipment is to have done the system superlative degree clockwork of up 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 is periodically to transparent clock equipment transmission master clock frequency, master clock frequency equivalent parameters.Wherein, in carrying Mode refers to: between two clockworks using Ethernet interface in the way of message form carries out information exchange.Out-band method Refer to: between two clockworks, row information is entered using band external tapping tod with signal pulse form based on the connecting line of the two and hand over Mutual mode.
As an embodiment of the present embodiment, described periodically transmission to transparent clock equipment with in-band method is led Clock frequency and/or frequency phase relevant parameter, comprising: obtain respectively master clock frequency mc, frequency phase mp, whether frequency locking, whether lock phase Parameter;The parameters of acquisition are inserted into respectively tissue manufacturer message format in the common ptp signal message previously generating The relevant position of extended field, specific on position asks for an interview figure 3 above and Fig. 4;By the ptp port of clock equipment through ether Amended ptp signal message is sent to the ptp port of transparent clock equipment by net;
It should be noted that previously generating common ptp signal message in the above-described embodiment naturally it is also possible to not in advance Generate common ptp signal message, but after obtaining each relevant parameter, carry out message encapsulation process, carried respectively with generating Individual ptp signal message getparms, which constitutes other embodiment:
At least obtain master clock frequency, master clock frequency phase, whether frequency locking, the master clock frequency whether locked in phase parameter, master Clock frequency phase parameter;
After obtaining relevant parameter, carry out message encapsulation process, generate the ptp signal message carrying relevant parameter;
The ptp signal message carrying relevant parameter is sent to transparent clock equipment through Ethernet by ptp port Ptp port.
As another embodiment of the present embodiment, clock equipment is with out-band method periodically to transparent clock Equipment sends master clock frequency phase, the clock relevant parameter information of the master clock such as master clock frequency, comprising: clock equipment be based on The band connection line of transparent clock equipment sends frequency using band external tapping tod and phase place is respectively master clock frequency mc and frequency phase The signal pulse of mp.
In the present embodiment, the information that clock equipment transmission identifies whether frequency locking and whether locks phase, its object is to: mark Whether master clock enters stable state, locks phase information according to frequency locking and represents that the external time service of current master clock stably can use, for whole net Tc (transparent clock, transparent clock), the clock alignment of oc (ordinary clock, ordinary clock).
In the embodiment of the present invention is embodied as, have be joined directly together can transmit signal pulse between two clockworks In the case of connecting line, preferentially adopt out-band method;Only do not support which (namely when two in two clockworks to be communicated The connecting line that can transmit signal pulse that clock equipment room is no joined directly together) in the case of, from in-band method.In out-band method In, clock equipment is directly connected by band connection line with transparent clock equipment, so transparent clock equipment passes through signal arteries and veins Mc and mp rushing the clock equipment monitoring is not in because link delay is caused with Network Packet Loss after Ethernet transmission Errored message excessive and cannot be synchronous problem.
With reference to the method for synchronizing time flow chart shown in Fig. 6, providing for second embodiment of the invention, methods described is applied to Include the transparent clock equipment with external tapping and ptp port, comprise the following steps:
Step 1001, monitors, with external tapping, the signal pulse that clock equipment is sent with out-band method, extracts this pulse Frequency and phase place, respectively as master clock frequency mc and master clock frequency phase mp;
Mc and mp monitoring is inserted into group in the common ptp signal message previously generating with external tapping by step 1002 Knit the relevant position of the extended field of manufacturer's message format, then amended ptp signal message is passed to ptp port;
Step 1003, ptp port receives described amended ptp signal message, extracts wherein entrained master clock frequency Rate mc and master clock frequency phase mp, are mutually modified to local clock frequency and/or local clock frequency accordingly.
Wherein, makeover process specifically includes:
A. frequency correction
If ptp judges port in the ptp signal message that the continuous n of clock equipment (preferably 4) the individual cycle sends Master clock frequency mc is consistent, then enter 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) the individual cycle sends Mp is consistent, then enter the pre-locked state of applying aspect, and the phase only pupil filter of the local clock of transparent clock is this m periodicity extraction The mp arriving.
The signal pulse being sent with out-band method with external tapping monitoring clock equipment of transparent clock equipment, extracts this arteries and veins The frequency of punching and phase place, respectively as master clock frequency mc and frequency phase mp;
Because the ptp port on transparent clock equipment only can process ptp signal message or event message, for this transparent when The band external tapping of clock equipment also needs to previously generate common ptp signal message, and mc and mp monitoring is inserted into this ptp letter In number message, then amended ptp signal message is passed to by the relevant position of the extended field of tissue manufacturer message format Ptp port;
Ptp port receives the ptp signal message sending with external tapping, extracts wherein entrained master clock frequency mc and master Clock frequency phase mp, is modified to local clock accordingly, and corresponding ptp event message is in the residence time of transparent clock equipment For: the timestamp sending this ptp event message from transparent clock equipment of record on the basis of local clock, deduct this ptp thing Part message enters the timestamp of transparent clock equipment.Due to being repaiied to local clock using the method in the embodiment of the present invention Just, the local clock time of acquisition is more accurate, thus the residence time being determined on the basis of the local clock obtaining is just more Accurately, thus overcoming the defect of prior art.
With reference to the transparent clock method for synchronizing time flow chart shown in Fig. 7, providing for third embodiment of the invention, described side Method is applied to transparent clock equipment, comprises the following steps:
Step 1101, receives, by ptp port, the ptp signal message that clock equipment is sent with in-band method;
Step 1102, extracts entrained master clock frequency and/or master clock frequency phase relevant parameter in ptp signal message, According to described relevant parameter, local clock frequency and/or local clock frequency are mutually modified.
Wherein, entrained master clock frequency and/or master clock frequency phase relevant parameter in described extraction ptp signal message, Including: extract respectively entrained master clock frequency mc in ptp signal message, frequency phase mp, whether frequency locking, whether lock phase parameter.
Accordingly, for subsequently received ptp event message, it in the residence time of transparent clock is: with local when The timestamp sending this ptp event message from transparent clock equipment of record on the basis of clock, deducts this ptp event message and enters thoroughly The timestamp of bright clockwork.Due to being modified to local clock using the method in the embodiment of the present invention, acquisition local Clock time is more accurate, thus the residence time being determined on the basis of the local clock obtaining is just more accurate, thus overcoming The defect of prior art.
Wherein, makeover process specifically includes:
A. frequency correction
Step 101, according to default first reference significance condition, judge whether the master clock mc that clock equipment sends has There is reference significance.
Specific judge process may is that the fluctuation range counting each mc extracting in nearest setting time window is No meet default condition (absolute value of the difference of for example any two mc be respectively less than set the first fluctuation threshold);If it is, The mc judging master clock is with specific reference to meaning.
If step 102 has a reference significance, reading entrained in ptp signal message for identifying master clock is The parameter of no frequency locking;
If this parameter value of step 121 corresponds to master clock frequency locking;
Then determine whether: the ptp signal that the continuous n of subsequently received clock equipment (preferably 4) the individual cycle sends Whether the mc in message is consistent;
If step 122 is consistent, enter the pre-locked state of frequency, by the frequency of the local clock of transparent clock equipment It is modified to this mc.
If the described parameter value reading corresponds to the non-frequency locking of master clock, or, the mc in continuous n cycle does not keep one Cause, then equal return to step 101, continues waiting for.
In ptp system, clock equipment is likely to change, and to going up the feelings such as electricity again after clock equipment power down Condition.If transparent clock equipment is after getting master clock frequency and master clock frequency phase, not with reference to pre-conditioned to getting Whether parameter is effectively judged, but it is synchronous directly to carry out local clock according to this parameter, then clock can be caused synchronously to tie Really inaccurate problem.So, in the above-described embodiment, whether default bar is met by the frequency first determining whether master clock Part, pre-conditioned when meeting, there is reference significance, and determine whether subsequently received clock equipment continuous n week Whether the frequency in the ptp signal message that the phase sends is consistent, and is consistent just as standard to transparent clock equipment Local clock synchronize.By such step, the master clock frequency being obtained is more accurate, thus according to described main when Clock frequency carries out local clock synchronization, and synchronized result is more accurate.
In other embodiment, methods described also includes:
When in the pre-locked state procedure of frequency, master clock frequency loses reference significance, or master clock frequency does not possess all the time The tlv field of the clock information of master clock is recorded in reference significance, or transparent clock equipment None- identified ptp signal message,
Then obtain the basis transmission cycle of sync message sync estimated according to clock equipment and transparent clock equipment Ground clock is with respect to the frequency shift (FS) factor of master clock;Based on the described frequency shift (FS) factor, determine ptp event message when transparent The residence time of clock equipment.
Wherein, described the residence time in transparent clock equipment for the ptp event message is determined based on the frequency shift (FS) factor, bag Include: when the agitator that transparent clock equipment is produced with local clock cannot directly be changed based on the frequency shift (FS) factor, for ensureing The residence time arriving is accurate, by time when being entered fashionable timestamp and sent based on the ptp event message of local clock record Stamp, is all multiplied by the frequency shift (FS) factor, then calculating difference.
In other situations, described based on the frequency shift (FS) factor, determine ptp event message staying in transparent clock equipment Stay the time, also include: directly change the agitator that transparent clock equipment is produced with local clock based on the frequency shift (FS) factor, so If, residence time calculate be exactly according to the ptp event message of amended local clock record enter fashionable timestamp and Timestamp when sending.
B. phase only pupil filter
Step 201, according to default second reference significance condition, judge whether the master clock mp that clock equipment sends has There is reference significance.
Specific judge process may is that the fluctuation range counting each mp extracting in nearest setting time window is No meet default condition (absolute value of the difference of for example any two mp be respectively less than set the second fluctuation threshold);If it is, The mp judging master clock is with specific reference to meaning.
If step 202 has reference significance, read in the clock information of master clock for identifying whether to lock the ginseng of phase Number;
If this parameter value of step 221 corresponds to master clock lock phase, determine whether: subsequently received master clock Whether the mp in the ptp signal message that the continuous m of equipment (preferably 4) the individual cycle sends is consistent;
If step 222 is consistent, enter the pre-locked state of applying aspect, by the phase only pupil filter of the local clock of transparent clock For this mp.
If the described parameter value reading corresponds to the unlocked phase of master clock, or, the mp in continuous m cycle does not keep one Cause, then return to step 201 respectively, continue waiting for.
Mutually revise in step with frequency in said frequencies, if mc, mp lose in frequency and the pre-locked state procedure of phase place Reference significance, or mc or mp do not possess reference significance all the time, then adopt traditional clock software amendment scheme, by with master The interaction of the ptp event message of clockwork, determines locally frequency shift (FS) factor ff to the residence time of ptp event message. The circular of this frequency shift (FS) factor can be found in figure 5 above.Corresponding ptp event message is resident in transparent clock equipment Time is: the timestamp sending this ptp event message from transparent clock equipment of record on the basis of local clock, deducts this Ptp event message enters the timestamp of transparent clock equipment;The difference obtaining is multiplied by the frequency shift (FS) factor.
In addition, if recording the tlv word of the clock information of master clock in transparent clock equipment None- identified ptp signal message Section, then also can directly utilize said method to calculate the frequency shift (FS) factor, and then calculate residence time using this frequency shift (FS) factor.
It should be noted that in ptp domain, if each transparent clock equipment does not support that the frequency shift (FS) factor calculates work( 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 Determine and obtain (shown in Figure 5), be then disposably handed down in ptp domain by a ptp signal message by clock equipment Each transparent clock equipment.Specifically, organized using the tlv of ptp signal message in the extension message of manufacturer's message format The frequency shift (FS) factor of each transparent clock equipment of frequency_factor (ff) field identification.For example, it is possible to set described ff Every n bit position of field, a corresponding transparent clock equipment, this n bit position is used for depositing the mac address of transparent clock equipment And its corresponding frequency shift (FS) factor values.After transparent clock equipment receives ptp signal message, first find and carry in this field The mac address of this equipment, then reads and the corresponding frequency shift (FS) in this mac address factor values, as the frequency shift (FS) of this equipment Factor values, software carries out clock compensation under participating in.In this embodiment, one rather than multiple ptp signal report can only be passed through Each frequency shift (FS) factor just can be issued to corresponding transparent clock equipment by literary composition, save Internet resources, accelerate 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) sends, accounting Calculate its residence time and this time is added and is transmitted to from clockwork (or clock equipment) to ptp event message.
Can be traditional Adjusted Option from the local clock Adjusted Option of clockwork: clock equipment sets with from clock The standby time stab information tune interacting ptp event message through transparent clock equipment, utilizing the ptp event message of interaction from clockwork Whole local clock is synchronous with the clock of clock equipment.
Certainly, from the local clock Adjusted Option of clockwork can also be the local clock adjustment side with reference to transparent clock Case.It should be noted that in the case, transparent clock equipment need not calculate the residence time of ptp event message again, so Just there is no need to carry out local clock adjustment, if the clock information of the master clock that ptp port is received again with carry outer or In-band method is transmitted to from clockwork.
Generally, the frequency of clock signal and the phase place produced by agitator carrying in clockwork in ptp domain It is fixing it is impossible to change, so the Clock Synchronization Technology being related in prior art frequently referred to as passes through software mode to shaking The clock signal swinging device output is modified, to ensure the clock synchronization of the clock equipment in this clockwork and ptp domain.But It is that, because this technology is the approximate calculation under software participation, precision is poor, for this in the scheme of the embodiment of the present invention, saturating Bright clockwork and from the internal one Frequency Adjustable agitator of additional of clockwork, by changing the frequency compensation of this agitator The value of depositor so that the synchronization of the frequency of clock signal produced by this agitator and master clock, afterwards with this adjustable frequency vibration Carry out timing on the basis of swinging the clock signal of device.As master clock frequency 16khz, this Frequency Adjustable agitator adopts 2mhz, and frequency is mended The default value repaying depositor is l (16 system), then this Frequency Adjustable agitator adjustment process is: the frequency compensation in agitator is posted Storage value is revised as: [l ' * (16/2000)] of 16 systems.L ' is that 10 systems of l represent.
Phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator, citing: acquiescence phase place is mended The value repaying depositor is considered 0 impulse compensation, span 0~65535 (0 using metric 39321 (9999 hexadecimals) ~ffff hexadecimal) i.e. impulse phase be spaced apart 0.0196229ppm, such as local phase place is big 5 than main clock pulse phase intervals Individual pulse, then the value of phase compensation depositor should be 39321- (5/0.0196229) (decimal scale)=39066 (decimal scale)= 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 sets 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 the system superlative degree clockwork of up residence time correction.
In the present embodiment, described sending module sends ptp event message to transparent clock equipment, comprising: to carry interior side Formula periodically sends ptp event message to transparent clock equipment;And,
Described sending module sends master clock frequency relevant parameter and/or the related ginseng of master clock frequency to transparent clock equipment Number, comprising: with in-band method or out-band method periodically to transparent clock equipment send master clock frequency relevant parameter and/ Or master clock frequency phase relevant parameter.
In the present embodiment, described 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, the master clock frequency whether locking in phase parameter and/ Or master clock frequency phase parameter;
The parameter of acquisition is inserted into respectively the expansion of tissue manufacturer message format in the common ptp signal message previously generating The relevant position of exhibition field;
Amended ptp signal message is sent through Ethernet by ptp port to the ptp port of transparent clock equipment.
In the present embodiment, described sending module periodically sends master clock frequency to transparent clock equipment with out-band method Rate relevant parameter and/or master clock frequency phase relevant parameter, comprising:
Frequency is sent using band external tapping based on the band connection line with transparent clock equipment and phase place is respectively master clock Frequency and the signal pulse of master clock frequency phase.
With reference to a kind of time synchronism apparatus shown in Fig. 8, providing for fifth embodiment of the invention, it is applied to transparent clock and sets Standby, described device includes:
Monitoring modular, for monitoring the signal pulse that clock equipment is sent with out-band method, extracts the frequency of this pulse And phase place, respectively as master clock frequency and master clock frequency phase;
Transport module, for being mutually inserted into the common ptp letter previously generating by described master clock frequency and master clock frequency In number message, then amended ptp signal message is passed to by the relevant position of the extended field of tissue manufacturer message format Ptp port;
First processing module, for receiving the described amended ptp signal message of ptp port transmission, extracts wherein institute The master clock frequency carrying and master clock frequency phase, according to described master clock frequency and master clock frequency relative local clock frequency and/ Or local clock frequency is mutually modified.
In the present embodiment, described 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 clock equipment ptp signal message that continuous n cycle sends via ptp port Rate is consistent, then enter the pre-locked state of frequency, and the frequency of the local clock of transparent clock is modified to described master clock frequency Rate;And/or,
Mutually keep when determining the frequency in the clock equipment ptp signal message that the continuous m cycle sends via ptp port Unanimously, then enter the pre-locked state of applying aspect, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
In the present embodiment, described 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:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency Revise, and/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
With reference to a kind of time synchronism apparatus shown in Fig. 9, providing for sixth embodiment of the invention, it is applied to transparent clock and sets Standby, described device includes:
Receiver module, for receiving, by ptp port, the ptp signal message that clock equipment is sent with in-band method;
Extraction module, for extract entrained master clock frequency relevant parameter in described ptp signal message and/or main when Clock frequency phase relevant parameter;
Second processing module, for mutually carrying out to local clock frequency and/or local clock frequency according to described relevant parameter Revise.
In the present embodiment, described extraction module extracts entrained master clock frequency relevant parameter in ptp signal message And/or master clock frequency phase relevant parameter, comprising: at least extract master clock frequency, master clock frequency phase, whether frequency locking, whether lock phase Master clock frequency in parameter and/or master clock frequency phase parameter.
In the present embodiment, described Second processing module is modified to local clock frequency according to relevant parameter, comprising:
According to default first reference significance condition, judge whether the master clock frequency that clock equipment sends has reference Meaning;
When determining described master clock frequency, there is reference significance, then obtaining in described ptp signal message for mark is The parameter of no frequency locking;
When described parameter corresponds to master clock frequency locking, then determine whether: continuous n of subsequently received clock equipment Whether the master clock frequency in the ptp signal message that the cycle sends is consistent;
When the master clock frequency in the ptp signal message that the clock equipment continuous n cycle sends is consistent, then enter The pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to this master clock frequency.
In the present embodiment, described Second processing module is modified to local clock frequency according to relevant parameter, also wraps Include: when the described parameter value obtaining corresponds to the non-frequency locking of master clock, or, the frequency in continuous n cycle is not consistent, then continue Whether the continuous master clock frequency judging that clock equipment sends has reference significance.
In the present embodiment, described default first reference significance condition, comprising: when extraction in nearest setting time window To the fluctuation range of each frequency meet default condition, then the frequency of master clock is with specific reference to meaning.
In the present embodiment, described device also includes:
Frequency shift (FS) factor determining module, for when in the pre-locked state procedure of frequency master clock frequency lose with reference to meaning Justice, or master clock frequency do not possess reference significance all the time, or record in transparent clock equipment None- identified ptp signal message The tlv field of the clock information of master clock,
Then obtain the basis transmission cycle of sync message sync estimated according to clock equipment and transparent clock equipment Ground clock is with respect to the frequency shift (FS) factor of master clock;Based on the described frequency shift (FS) factor, determine ptp event message when transparent The residence time of clock equipment.
In the present embodiment, described Second processing module is mutually modified to local clock frequency according to relevant parameter, comprising:
According to default second reference significance condition, judge whether the master clock frequency that clock equipment sends mutually has reference Meaning;
When determining described master clock frequency, mutually there is reference significance, then obtaining in described ptp signal message for mark is The parameter of no lock phase;
When described parameter corresponds to master clock lock phase, then determine whether: continuous m of subsequently received clock equipment Whether the master clock frequency in the ptp signal message that the cycle sends mutually is consistent;
When the master clock frequency in the ptp signal message that the clock equipment continuous m cycle sends mutually is consistent, then enter The pre-locked state of phase place, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
In the present embodiment, described Second processing module is mutually modified to local clock frequency according to relevant parameter, also wraps Include: when the described parameter value reading corresponds to the unlocked phase of master clock, or, the master clock frequency in continuous m cycle does not mutually keep one Cause, then continue to judge whether the master clock frequency that clock equipment sends mutually has reference significance.
In the present embodiment, described frequency shift (FS) factor determining module, is additionally operable to when main in the pre-locked state procedure of phase place Clock frequency mutually loses reference significance, or master clock frequency does not mutually possess reference significance all the time, or transparent clock equipment cannot be known The tlv field of the clock information of master clock is recorded in other ptp signal message,
Then obtain the basis transmission cycle of sync message sync estimated according to clock equipment and transparent clock equipment Ground clock is with respect to the frequency shift (FS) factor of master clock;Based on the described frequency shift (FS) factor, determine ptp event message when transparent The residence time of clock equipment.
In the present embodiment, described frequency shift (FS) factor determining module obtains according to clock equipment and transparent clock equipment The local clock that the transmission cycle of sync message is estimated is with respect to the frequency shift (FS) factor of master clock, comprising: when receiving main The ptp signal message carrying the frequency shift (FS) factor that clock equipment issues;
The tlv obtaining described ptp signal message organizes frequency shift (FS) factor ff in the extension message of manufacturer's message format The mac address of this equipment carrying in field, then read in described ff field with the corresponding frequency shift (FS) in this mac address factor Value, as the frequency shift (FS) factor values of this equipment.
In the present embodiment, described 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:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency Revise, and/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
The embodiment of the present invention additionally provides a kind of ptp system, and described ptp system includes: time synchronism apparatus as mentioned above The clock equipment applied, and the transparent clock equipment that time synchronism apparatus as described in figure 8 above, Fig. 9 are applied.
Process details with regard to described time synchronism apparatus is referred to the description of above-mentioned method for synchronizing time, therefore in this not Repeat again.
The embodiment of the present invention is directed to manufacturer's extension information in ptp signal message tlv entity norm and has carried out carrying master clock Frequency, frequency phase information inside definition, provide a kind of for need with frequency co-phasing operation scene local clock frequency modulation phase modulation adjust A kind of perfect square case, there is provided the more efficient time bias mode synchronous with master clock of tc.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.All within the spirit and principles in the present invention, made any repair Change, equivalent, improvement etc., should be included within the scope of the present invention.

Claims (31)

1. a kind of method for synchronizing time, is applied to clock equipment it is characterised in that methods described includes:
Send precision time protocol ptp event message to transparent clock equipment, and send master clock frequency to transparent clock equipment Relevant parameter and/or master clock frequency phase relevant parameter;
Wherein, clock equipment is to have done the system superlative degree clockwork of up residence time correction.
2. the method for claim 1 is it is characterised in that described send ptp event message, bag to transparent clock equipment Include: ptp event message is periodically sent to transparent clock equipment with in-band method;And,
Described send master clock frequency relevant parameter and/or master clock frequency phase relevant parameter to transparent clock equipment, comprising: to carry Interior mode or out-band method periodically send master clock frequency relevant parameter and/or master clock frequency phase to transparent clock equipment Relevant parameter.
3. method as claimed in claim 2 is it is characterised in that described periodically sent out to transparent clock equipment with in-band method 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, master clock frequency and/or the master whether locking in phase parameter Clock frequency phase parameter;
The parameter of acquisition is inserted into respectively the extension word of tissue manufacturer message format in the common ptp signal message previously generating The relevant position of section;
Amended ptp signal message is sent through Ethernet by ptp port to the ptp port of transparent clock equipment.
4. method as claimed in claim 2 is it is characterised in that described periodically sent out to transparent clock equipment with out-band method Send master clock frequency relevant parameter and/or frequency phase relevant parameter, comprising:
Frequency is sent using band external tapping based on the band connection line with transparent clock equipment and phase place is respectively master clock frequency Signal pulse with master clock frequency phase.
5. a kind of method for synchronizing time, is applied to transparent clock equipment it is characterised in that methods described includes:
The signal pulse that monitoring clock equipment is sent with out-band method, extracts frequency and the phase place of described signal pulse, respectively As master clock frequency and master clock frequency phase;
Described master clock frequency and master clock frequency are mutually inserted into tissue manufacturer in the common ptp signal message previously generating disappear Then amended ptp signal message is passed to ptp port by the relevant position of the extended field of breath form;
Receive the described amended ptp signal message of ptp port transmission, extract wherein entrained master clock frequency and main when Clock frequency phase, is mutually modified with master clock frequency relative local clock frequency and/or local clock frequency according to described master clock frequency.
6. method as claimed in claim 5 it is characterised in that described according to master clock frequency and master clock frequency relative local when Clock frequency and/or local clock frequency are mutually modified, comprising:
Protect when determining the master clock frequency in the clock equipment ptp signal message that the continuous n cycle sends via ptp port Hold consistent, then enter the pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to described master clock frequency; And/or,
Mutually keep one when determining the frequency in the clock equipment ptp signal message that the continuous m cycle sends via ptp port Cause, then enter the pre-locked state of applying aspect, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
7. method as claimed in claim 5 it is characterised in that described according to master clock frequency and master clock frequency relative local when Clock frequency and/or local clock frequency are mutually modified, comprising:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency correction, And/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
8. a kind of method for synchronizing time, is applied to transparent clock equipment it is characterised in that methods described includes:
The ptp signal message that clock equipment is sent with in-band method is received by ptp port;
Extract entrained master clock frequency relevant parameter in described ptp signal message and/or master clock frequency phase relevant parameter;
According to described relevant parameter, local clock frequency and/or local clock frequency are mutually modified.
9. method as claimed in claim 8 is it is characterised in that entrained in described extraction ptp signal message master clock frequency Rate relevant parameter and/or master clock frequency phase relevant parameter, comprising: at least extract master clock frequency, master clock frequency phase, whether lock Frequently the master clock frequency in phase parameter and/or master clock frequency phase parameter, whether are locked.
10. method as claimed in claim 9 is it is characterised in that described repair to local clock frequency according to relevant parameter Just, comprising:
Step 101, according to default first reference significance condition, judge whether the master clock frequency that clock equipment sends has Reference significance;
Step 102, there is reference significance when determining described master clock frequency, then obtain in described ptp signal message and be used for marking Know the parameter of whether frequency locking;
Step 121, when described parameter corresponds to master clock frequency locking, then determine whether: subsequently received clock equipment is even Whether the master clock frequency in the ptp signal message that the continuous n cycle sends is consistent;
Step 122, it is consistent when the master clock frequency in the ptp signal message that clock equipment continuous n cycle sends, then Enter the pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to this master clock frequency.
11. methods as claimed in claim 10 are it is characterised in that to correspond to master clock unlocked when the described parameter value obtaining Frequently, or, the master clock frequency in continuous n cycle is not consistent, then equal return to steps 101, continues waiting for.
12. methods as claimed in claim 10 are it is characterised in that described default first reference significance condition, comprising: when The fluctuation range of each master clock frequency extracted in nearly setting time window meets default condition, then master clock frequency tool Body reference significance.
13. methods as claimed in claim 10 are it is characterised in that methods described also includes:
When in the pre-locked state procedure of frequency, master clock frequency loses reference significance, or master clock frequency does not possess reference all the time The tlv field of the clock information of master clock is recorded in meaning, or transparent clock equipment None- identified ptp signal message,
Then obtain according to clock equipment and transparent clock equipment the transmission cycle of sync message sync is estimated local when Clock is with respect to the frequency shift (FS) factor of master clock;Based on the described frequency shift (FS) factor, determine that ptp event message sets in transparent clock Standby residence time.
14. methods as claimed in claim 9 are it is characterised in that described mutually repair to local clock frequency according to relevant parameter Just, comprising:
Step 201, according to default second reference significance condition, judge whether the master clock frequency that clock equipment sends mutually has Reference significance;
Step 202, mutually there is reference significance when determining described master clock frequency, then obtain in described ptp signal message and be used for marking Know the parameter whether locking phase;
Step 221, when described parameter corresponds to master clock lock phase, then determine whether: subsequently received clock equipment is even Whether the master clock frequency in the ptp signal message that the continuous m cycle sends mutually is consistent;
Step 222, mutually it is consistent when the master clock frequency in the ptp signal message that clock equipment continuous m cycle sends, then Enter the pre-locked state of applying aspect, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
15. methods as claimed in claim 14 are it is characterised in that to correspond to master clock unlocked when the described parameter value reading Phase, or, the master clock frequency in continuous m cycle is not mutually consistent, then equal return to step 201, continues waiting for.
16. methods as claimed in claim 9 are it is characterised in that methods described also includes:
When in the pre-locked state procedure of phase place, master clock frequency mutually loses reference significance, or master clock frequency does not mutually possess reference all the time The tlv field of the clock information of master clock is recorded in meaning, or transparent clock equipment None- identified ptp signal message,
Then obtain the local clock phase with transparent clock equipment, the transmission cycle of sync message estimated according to clock equipment The frequency shift (FS) factor for master clock;Based on the described frequency shift (FS) factor, determine ptp event message in transparent clock equipment Residence time.
17. methods as claimed in claim 16 it is characterised in that
The local clock that described acquisition is estimated to the transmission cycle of sync message according to clock equipment and transparent clock equipment The frequency shift (FS) factor with respect to master clock, comprising: receive the ptp carrying the frequency shift (FS) factor that clock equipment issues Signal message;
The tlv obtaining described ptp signal message organizes the frequency shift (FS) factor ff field in the extension message of manufacturer's message format In the mac address of this equipment that carries, then read in described ff field with the corresponding frequency shift (FS) in this mac address factor values, Frequency shift (FS) factor values as this equipment.
18. methods as claimed in claim 8 it is characterised in that described according to master clock frequency with master clock frequency relative local Clock frequency and/or local clock frequency are mutually modified, comprising:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency correction, And/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
A kind of 19. time synchronism apparatus, are applied to clock equipment it is characterised in that described device includes:
Sending module, for sending precision time protocol ptp event message to transparent clock equipment, and sends 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 the system superlative degree clockwork of up residence time correction.
20. devices as claimed in claim 19 are it is characterised in that described 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;And,
Described sending module sends master clock frequency relevant parameter and/or master clock frequency phase relevant parameter to transparent clock equipment, Including: with in-band method or out-band method periodically to transparent clock equipment send master clock frequency relevant parameter and/or Master clock frequency phase relevant parameter.
21. devices as claimed in claim 20 it is characterised in that described sending module 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, master clock frequency and/or the master whether locking in phase parameter Clock frequency phase parameter;
The parameter of acquisition is inserted into respectively the extension word of tissue manufacturer message format in the common ptp signal message previously generating The relevant position of section;
Amended ptp signal message is sent through Ethernet by ptp port to the ptp port of transparent clock equipment.
22. devices as claimed in claim 20 it is characterised in that described sending module with out-band method periodically to transparent Clockwork sends master clock frequency relevant parameter and/or frequency phase relevant parameter, comprising:
Frequency is sent using band external tapping based on the band connection line with transparent clock equipment and phase place is respectively master clock frequency Signal pulse with master clock frequency phase.
A kind of 23. time synchronism apparatus, are applied to transparent clock equipment it is characterised in that described device includes:
Monitoring modular, for monitoring the signal pulse that clock equipment is sent with out-band method, extracts frequency and the phase of this pulse Position, respectively as master clock frequency and master clock frequency phase;
Transport module, for being mutually inserted into, with master clock frequency, the common ptp signal report previously generating by described master clock frequency In literary composition, then amended ptp signal message is passed to ptp end by the relevant position of the extended field of tissue manufacturer message format Mouthful;
First processing module, for receiving the described amended ptp signal message of ptp port transmission, extracts wherein entrained Master clock frequency and master clock frequency phase, according to described master clock frequency and master clock frequency relative local clock frequency and/or this Ground clock frequency is mutually modified.
24. devices as claimed in claim 23 it is characterised in that described first processing module according to master clock frequency and main when Clock frequency relative local clock frequency and/or local clock frequency are mutually modified, comprising:
Protect when determining the master clock frequency in the clock equipment ptp signal message that the continuous n cycle sends via ptp port Hold consistent, then enter the pre-locked state of frequency, the frequency of the local clock of transparent clock is modified to described master clock frequency; And/or,
Mutually keep one when determining the frequency in the clock equipment ptp signal message that the continuous m cycle sends via ptp port Cause, then enter the pre-locked state of applying aspect, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
25. devices as claimed in claim 23 it is characterised in that described first processing module according to master clock frequency and main when Clock frequency relative local clock frequency and/or local clock frequency are mutually modified, comprising:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency correction, And/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
A kind of 26. time synchronism apparatus, are applied to transparent clock equipment it is characterised in that described device includes:
Receiver module, for receiving, by ptp port, the ptp signal message that clock equipment is sent with in-band method;
Extraction module, for extracting entrained master clock frequency relevant parameter in described ptp signal message and/or master clock frequency Phase relevant parameter;
Second processing module, for being mutually modified to local clock frequency and/or local clock frequency according to described relevant parameter.
27. devices as claimed in claim 26 it is characterised in that described extraction module extract ptp signal message in entrained Master clock frequency relevant parameter and/or master clock frequency phase relevant parameter, comprising: at least extract master clock frequency, master clock frequency Phase, whether frequency locking, master clock frequency and/or the master clock frequency phase parameter whether locked in phase parameter.
28. devices as claimed in claim 27 it is characterised in that described Second processing module according to relevant parameter to local when Clock frequency is modified, comprising:
According to default first reference significance condition, judge whether the master clock frequency that clock equipment sends has with reference to meaning Justice;
When determining described master clock frequency, there is reference significance, then obtain and be used in described ptp signal message identifying whether to lock The parameter of frequency;
When described parameter corresponds to master clock frequency locking, then determine whether: the subsequently received clock equipment continuous n cycle Whether the master clock frequency in the ptp signal message sending is consistent;
When the master clock frequency in the ptp signal message that the clock equipment continuous n cycle sends is consistent, then enter frequency Pre-locked state, the frequency of the local clock of transparent clock is modified to this master clock frequency.
29. devices as claimed in claim 27 it is characterised in that described Second processing module according to relevant parameter to local when Clock frequency is mutually modified, comprising:
According to default second reference significance condition, judge whether the master clock frequency that clock equipment sends mutually has with reference to meaning Justice;
When determining described master clock frequency, mutually there is reference significance, then obtain and be used in described ptp signal message identifying whether to lock The parameter of phase;
When described parameter corresponds to master clock lock phase, then determine whether: the subsequently received clock equipment continuous m cycle Whether the master clock frequency in the ptp signal message sending mutually is consistent;
When the master clock frequency in the ptp signal message that the clock equipment continuous m cycle sends mutually is consistent, then enter applying aspect Pre-locked state, the phase only pupil filter of the local clock of transparent clock is described master clock frequency phase.
30. devices as claimed in claim 26 it is characterised in that described Second processing module according to master clock frequency and main when Clock frequency relative local clock frequency and/or local clock frequency are mutually modified, comprising:
The value setting up the frequency compensation depositor of the Frequency Adjustable agitator in transparent clock equipment by modification enters line frequency correction, And/or phase only pupil filter is carried out by the value changing the phase compensation depositor of Frequency Adjustable agitator.
A kind of 31. ptp systems are it is characterised in that include: the device as described in claim 19 to 22 any one is applied Clock equipment;And, the device as described in claim 23-25 any one, or claim 26-30 any one institute The transparent clock equipment that the device stated is applied.
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 true CN106357362A (en) 2017-01-25
CN106357362B 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)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667545A (en) * 2018-04-17 2018-10-16 迈普通信技术股份有限公司 A kind of serial ports bandwidth synchronous method and device
CN108738127A (en) * 2018-04-13 2018-11-02 中国科学院微电子研究所 Remote Radio Unit, baseband processing unit, distributed base station and its synchronous method
CN110536405A (en) * 2018-05-25 2019-12-03 华为技术有限公司 A kind of synchronous method and access point
CN111107621A (en) * 2018-10-29 2020-05-05 大唐移动通信设备有限公司 Synchronization method and device
CN111181555A (en) * 2019-12-31 2020-05-19 瑞斯康达科技发展股份有限公司 PTP clock synchronization system and clock synchronization method
CN111277349A (en) * 2018-12-04 2020-06-12 深圳市中兴微电子技术有限公司 Clock synchronization method and system
CN111884678A (en) * 2020-06-20 2020-11-03 青岛鼎信通讯股份有限公司 Distribution line distance measurement method based on HPLC technology
CN111884749A (en) * 2020-07-24 2020-11-03 中国科学院精密测量科学与技术创新研究院 High-precision fixed-period PTP time synchronization method based on clock phase splitting
CN117516901A (en) * 2023-11-06 2024-02-06 北京通泰恒盛科技有限责任公司 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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄治等: "IEEE1588在工业以太网交换机中的关键应用", 《现代电子技术》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108738127A (en) * 2018-04-13 2018-11-02 中国科学院微电子研究所 Remote Radio Unit, baseband processing unit, distributed base station and its synchronous method
CN108738127B (en) * 2018-04-13 2021-04-27 中国科学院微电子研究所 Radio remote unit, baseband processing unit, distributed base station and synchronization method thereof
CN108667545A (en) * 2018-04-17 2018-10-16 迈普通信技术股份有限公司 A kind of serial ports bandwidth synchronous method and device
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
CN110536405A (en) * 2018-05-25 2019-12-03 华为技术有限公司 A kind of synchronous method and access point
CN111107621A (en) * 2018-10-29 2020-05-05 大唐移动通信设备有限公司 Synchronization method and device
CN111277349A (en) * 2018-12-04 2020-06-12 深圳市中兴微电子技术有限公司 Clock synchronization method and system
CN111277349B (en) * 2018-12-04 2023-12-22 深圳市中兴微电子技术有限公司 Clock synchronization method and system
US11664914B2 (en) 2018-12-04 2023-05-30 Sanechips Technology Co., Ltd. Clock synchronization method, system and device, and storage medium
CN111181555A (en) * 2019-12-31 2020-05-19 瑞斯康达科技发展股份有限公司 PTP clock synchronization system and clock synchronization method
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
CN111884749A (en) * 2020-07-24 2020-11-03 中国科学院精密测量科学与技术创新研究院 High-precision fixed-period PTP time synchronization method based on clock phase splitting
CN117516901A (en) * 2023-11-06 2024-02-06 北京通泰恒盛科技有限责任公司 Clock synchronization method and system for fan blade monitoring based on inertial navigation technology

Also Published As

Publication number Publication date
CN106357362B (en) 2019-05-17

Similar Documents

Publication Publication Date Title
CN106357362A (en) Time synchronization method and device and PTP system
Moreira et al. White rabbit: Sub-nanosecond timing distribution over ethernet
CN101447861B (en) IEEE 1588 time synchronization system and implementation method thereof
US8873589B2 (en) Methods and devices for clock synchronization
CN101425865B (en) Method and system for synchronizing clock of transmission network as well as subordinate clock side entity
CN101330374B (en) Method and system for synchronizing clock of transmission network as well as subordinate clock side entity
EP2528254B1 (en) Method and device for time synchronization
CN102577194B (en) System and method of synchronizing clocks in a distributed network
CN106130681B (en) For the high-accuracy clock synchronization method of time dissemination system, module, equipment and system
JP5811794B2 (en) Communication device
Jasperneite et al. Enhancements to the time synchronization standard IEEE-1588 for a system of cascaded bridges
CN102332973B (en) Real-time communication and clock synchronization method of chain network
US8819161B1 (en) Auto-syntonization and time-of-day synchronization for master-slave physical layer devices
CN102013931B (en) Time synchronization method and system, salve timing device and main timing device
CN104918319B (en) Clock synchronization simplified information interaction method applied to wireless sensor network
CN108667547A (en) A kind of Network Time Protocol conversion method and system
GB2340356A (en) Timing systems
CN101729180A (en) Method and system for synchronizing precision clocks, and precision clock frequency/time synchronizing device
CN107579793A (en) The optimization method of time synchronized, device and equipment between a kind of communication network device
CN105959076A (en) Device and method for making passive optical network possess ability of supporting time synchronization
CN102082653B (en) Method, system and device for clock synchronization
CN102983927B (en) Time compensation method for master-slave clock timing based on IEEE 1588 protocol
CN103166792B (en) Line asymmetrical compensation method, equipment and system
CN105577349A (en) Airborne network IEEE1588 protocol master-slave clock port synchronization method
CN106603183A (en) Timestamp filtering method and device

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