CN105897394B - A kind of clock synchronization adjustment method and device - Google Patents
A kind of clock synchronization adjustment method and device Download PDFInfo
- Publication number
- CN105897394B CN105897394B CN201610429889.4A CN201610429889A CN105897394B CN 105897394 B CN105897394 B CN 105897394B CN 201610429889 A CN201610429889 A CN 201610429889A CN 105897394 B CN105897394 B CN 105897394B
- Authority
- CN
- China
- Prior art keywords
- parameter
- max
- difference delta
- equal
- local clock
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L7/00—Arrangements for synchronising receiver with transmitter
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L7/00—Arrangements for synchronising receiver with transmitter
- H04L7/0008—Synchronisation information channels, e.g. clock distribution lines
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
A kind of clock synchronization adjustment method and device disclosed in the present application, crystal oscillator generate a pulse, the pulse number C that monitoring crystal oscillator generates, if C ≠ C in each crystal oscillator perioda, then local clock Ts increases preset set time t, if C=Ca, then local clock Ts increases time P2.C increases to CmaxWhen be zeroed out, count again.And when each C is reset to the first parameter CmaxIt is adjusted.Periodically judge whether deviation of the local clock Ts with respect to reference clock Tm is increasing, if so, carrying out the adjustment of P2, i.e., by amendment local clock Ts in CmaxA crystal oscillator periodic accumulation time [t* (Cmax- 1)+P2] so that local clock Ts is equal in same time period accumulation interval with reference clock Tm, complete the synchronous adjustment of local clock Ts and reference clock Tm.
Description
Technical field
This application involves the communications fields, more specifically to a kind of clock synchronization adjustment method and device.
Background technique
In dcs, it is contemplated that the scheduling and control of real-time, the requirement to time unification are stringenter.
Oscillator of the crystal oscillator as high-precision and high stability, is widely used in each node data processing equipment of system, as frequency
Rate generator is that data processing equipment generates clock signal.But nominal frequency identical crystal oscillator frequency stability from
± 1 to ± 100ppm differs, and causes the clock of the data processing equipment of each node asynchronous, leads to the number for being distributed in each node
It is difficult normal co-ordination and operation according to processing equipment.
Summary of the invention
In view of this, the application proposes a kind of clock synchronization adjustment method and device, it is intended to each in dcs
The clock of the data processing equipment of node synchronizes adjustment, the normal co-ordination of the data processing equipment to ensure each node
With the purpose of operation.
To achieve the goals above, it is proposed that scheme it is as follows:
A kind of clock synchronization adjustment method, comprising:
Whether the pulse number C that monitoring crystal oscillator generates is equal to the second parameter Ca, when the pulse number C is not equal to described the
Two parameter CaWhen, then local clock Ts increases preset set time t in each crystal oscillator period, when the pulse number C is equal to
The second parameter CaWhen, then the local clock Ts increased time is third parameter P2, and, the pulse that monitoring crystal oscillator generates
Whether number C is equal to the first parameter Cmax, when the pulse number C is equal to the first parameter CmaxWhen, then the pulse number C
It resets, the first parameter CmaxWith the second parameter CaFor positive integer, and Ca≤Cmax;
When each pulse number C is reset, to the first parameter CmaxIt is adjusted, so that the local clock
Ts is synchronous with the reference clock Tm;
Using preset time T as the period, judge whether deviation of the local clock Ts with respect to reference clock Tm increases;
If the deviation of the relatively described reference clock Tm of the local clock Ts is increasing, the third parameter P2 is carried out
Adjustment so that the local clock Ts is synchronous with the reference clock Tm.
Preferably, described to judge whether deviation of the local clock Ts with respect to reference clock Tm increases and include:
Using preset time T as the period, the difference DELTA T that the reference clock Tm subtracts the local clock Ts is calculated, and remember
Record the difference DELTA T;
Judge whether the difference DELTA T is greater than zero or less than zero, if the difference DELTA T is greater than zero, judges the difference
Whether Δ T is greater than difference DELTA T', and the difference DELTA T' once judges that the local clock Ts is inclined with respect to reference clock Tm to be preceding
The difference last Δ T whether difference records when increasing;
If the difference DELTA T less than zero, judges whether the difference DELTA T is less than the difference DELTA T'.
Preferably, the adjustment for carrying out the third parameter P2 includes:
If the difference DELTA T is greater than zero, and the difference DELTA T is greater than the difference DELTA T', then increases the third parameter
P2;
If the difference DELTA T is less than zero, and the difference DELTA T is less than the difference DELTA T', then reduces the third parameter
P2。
Preferably, described to carry out the first parameter CmaxAdjustment include:
Judge whether the third parameter P2 is equal to preset minimum threshold P2minOr max-thresholds P2max;
If the third parameter P2 is equal to the minimum threshold P2minOr it is equal to the max-thresholds P2max, then described in reduction
First parameter Cmax, the first parameter CmaxIt is reduced to minimum threshold C1When will no longer reduce;
If the third parameter P2 is not equal to the minimum threshold P2min, and it is not equal to the max-thresholds P2max, then increase
The big first parameter Cmax, the first parameter CmaxIncrease to max-thresholds C2When will no longer increase.
Preferably, the minimum threshold P2minIt is zero, the max-thresholds P2maxFor 2t, the minimum threshold C1It is zero,
The max-thresholds C2It is 65535.
A kind of clock synchronizing controls, comprising:
Whether monitoring unit, the pulse number C for monitoring crystal oscillator generation are equal to the second parameter Ca, when the pulse number
C is not equal to the second parameter CaWhen, then local clock Ts increases preset set time t in each crystal oscillator period, when described
Pulse number C is equal to the second parameter CaWhen, then the local clock Ts increased time is third parameter P2, and, monitoring
Whether the pulse number C that crystal oscillator generates is equal to the first parameter Cmax, when the pulse number C is equal to the first parameter CmaxWhen,
Then the pulse number C is reset, the first parameter CmaxWith the second parameter CaFor positive integer, and Ca≤Cmax;
The first adjustment unit is used for when each pulse number C is reset, to the first parameter CmaxIt is adjusted,
So that the local clock Ts is synchronous with the reference clock Tm;
First judging unit, for judging the local clock Ts with respect to reference clock Tm's using preset time T as the period
Whether deviation is increasing;
Second adjustment unit, if the deviation for the relatively described reference clock Tm of the local clock Ts is increasing,
The adjustment of the third parameter P2 is carried out, so that the local clock Ts is synchronous with the reference clock Tm.
Preferably, first judging unit includes:
Difference unit, for calculating the reference clock Tm and subtracting the local clock Ts's using preset time T as the period
Difference DELTA T, and record the difference DELTA T;
Second judgment unit, for judging whether the difference DELTA T is greater than zero or less than zero, if the difference DELTA T is greater than
Zero, then judge whether the difference DELTA T is greater than difference DELTA T', if the difference DELTA T less than zero, judges that the difference DELTA T is
No to be less than difference DELTA T', the difference DELTA T' once judges that the local clock Ts is with respect to the deviation of reference clock Tm to be preceding
The no difference last Δ T recorded when increasing.
Preferably, the second adjustment unit includes:
The first adjustment subelement, for being greater than zero in the difference DELTA T, and the difference DELTA T is greater than the difference DELTA T'
When, increase the third parameter P2;
Second adjustment subelement is used in the difference DELTA T less than zero, and the difference DELTA T is less than the difference DELTA T'
When, reduce the third parameter P2.
Preferably, the first adjustment unit includes:
Third judging unit, to judge whether the third parameter P2 is equal to preset minimum threshold P2minOr maximum threshold
Value P2max;
Third adjusts subelement, for being equal to the minimum threshold P2 in the third parameter P2minOr it is equal to the maximum
Threshold value P2maxWhen, reduce the first parameter Cmax, the first parameter CmaxIt is reduced to minimum threshold C1When will no longer reduce;
4th adjustment subelement, for being not equal to the minimum threshold P2 in the third parameter P2min, and not equal to institute
State max-thresholds P2max, then increase the first parameter Cmax, the first parameter CmaxIncrease to max-thresholds C2When will no longer
Increase.
It can be seen from the above technical scheme that a kind of clock synchronization adjustment method disclosed in the present application and device, crystal oscillator
A pulse, the pulse number C that monitoring crystal oscillator generates, if C ≠ C are generated in each crystal oscillator perioda, then local clock Ts increases pre-
If set time t, if C=Ca, then local clock Ts increases time P2.C increases to CmaxWhen be zeroed out, count again.And
When each C is reset to the first parameter CmaxIt is adjusted, therefore, local clock Ts is in every CmaxWhen a crystal oscillator period adds up
Between be [t* (Cmax-1)+P2].Periodically judge whether deviation of the local clock Ts with respect to reference clock Tm is increasing, if so,
Then carry out the adjustment of P2.
By amendment local clock Ts in CmaxA crystal oscillator periodic accumulation time [t* (Cmax- 1)+P2] so that local clock
Ts is equal in same time period accumulation interval with reference clock Tm, completes the synchronous adjustment of local clock Ts and reference clock Tm.
I.e. by making local clock Ts and reference clock the Tm synchronous adjustment of the data processing equipment of each node in dcs,
The synchronous adjustment between the local clock Ts of the data processing equipment of each node is realized, and then has ensured the data of each node
The normal co-ordination and operation of processing equipment.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of clock synchronization adjustment method disclosed in the present embodiment;
Fig. 2 is the flow chart of local clock state judging method disclosed in the present embodiment;
Fig. 3, which is that the present embodiment is disclosed, adjusts the first parameter CmaxFlow chart;
Fig. 4 is a kind of schematic diagram of clock synchronizing controls disclosed in the present embodiment;
Fig. 5 is the schematic diagram of the first judging unit disclosed in the present embodiment;
Fig. 6 is the schematic diagram of the first adjustment unit disclosed in the present embodiment.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall in the protection scope of this application.
Clock synchronous adjustment scheme disclosed in the present application, the timing mode of local clock Ts are the arteries and veins that monitoring crystal oscillator generates
Number C is rushed, is not equal to the second parameter C in the pulse number C that crystal oscillator generatesaWhen, local clock Ts increases the preset set time
T, and it is equal to C in CaWhen, local clock Ts increases P2 seconds.And periodically judge deviation of the local clock Ts with respect to reference clock Tm
Whether value is increasing, if so, carrying out CmaxWith the adjustment of P2, to realize that local clock Ts is synchronous with reference clock Tm's.
The present embodiment discloses a kind of clock synchronization adjustment method, to the first parameter CmaxIt is repaired in real time with third parameter P2
Just, shown in Figure 1, this method comprises:
Step S11: whether the pulse number C that monitoring crystal oscillator generates is equal to the second parameter Ca, when the pulse that crystal oscillator generates
Number C is not equal to the second parameter CaWhen, then local clock Ts increases preset set time t in each crystal oscillator period, when crystal oscillator produces
Raw pulse number C is equal to the second parameter CaWhen, then the local clock Ts increased time is third parameter P2, and monitors crystal oscillator and produce
Whether raw pulse number C is equal to the first parameter Cmax, when the pulse number C that crystal oscillator generates is equal to the first parameter CmaxWhen, then will
Pulse number C is reset, wherein Ca≤Cmax。
Crystal oscillator generates a pulse, i.e. clock signal in each crystal oscillator period, and local clock Ts receives crystal oscillator production every time
Raw clock signal carries out the cumulative of time.Counting corresponding with crystal oscillator is arranged in local data processing equipment in the application
Device, for recording the pulse number C of crystal oscillator generation.Work as C=CaWhen, Ts=Ts+P2;As C ≠ CaWhen, Ts=Ts+t;And work as C
Reach CmaxAutomatic clear after value.Therefore, local clock Ts is in every CmaxA cumulative time in crystal oscillator period [t* (Cmax-1)+P2].In advance
First set the first parameter Cmax, the second parameter CaWith the value of third parameter P2, local clock Ts is not before C is reset also, using pre-
If P2 and t carry out timing.And after C clearing, if the value of P2 has an amendment, if local clock Ts with preset t, amendment after
P2 and CmaxCarry out timing.The application is for CaWithout limitation to concrete modification mode, need to only guarantee in adjustment CmaxAfterwards, Ca's
Value is not more than Cmax?.And CaAnd CmaxFor positive integer.
Step S12: when each pulse number C is reset, to the first parameter CmaxIt is adjusted, so that local clock
Ts is synchronous with reference clock Tm.
Step S13: using preset time T as the period, judge deviation of the local clock Ts with respect to reference clock Tm whether
Increase.
The clock for choosing any one node in each node of dcs is reference clock Tm, other nodes
It is adjustment target with reference clock Tm, carries out clock synchronous adjustment.
Step S14: if deviation of the local clock Ts with respect to reference clock Tm is increasing, the third parameter P2 is carried out
Adjustment so that local clock Ts is synchronous with reference clock Tm.
By adjusting the first parameter CmaxWith third parameter P2, i.e. amendment local clock Ts is in CmaxWhen a crystal oscillator periodic accumulation
Between [t* (Cmax- 1)+P2] so that local clock Ts is equal in same time period accumulation interval with reference clock Tm, realize local
The synchronous adjustment of clock Ts and reference clock Tm.
The present embodiment discloses a kind of local clock state judging method, shown in Figure 2, comprising:
Step S21: when using preset time T as the period, calculating the difference DELTA T that reference clock Tm subtracts local clock Ts, and
Record the difference DELTA T.
Step S22: judge whether difference DELTA T is greater than zero or less than zero.
Step S23: if difference DELTA T is greater than zero, judge whether difference DELTA T is greater than difference DELTA T'.
Difference DELTA T' be it is preceding it is primary judge deviation of the local clock Ts with respect to reference clock Tm whether increase when record
Difference last Δ T.For the first time judge deviation of the local clock Ts with respect to reference clock Tm whether increase when, Δ T'=
Last Δ T=0;N-th judge deviation of the local clock Ts with respect to reference clock Tm whether increase when, Δ T'=
Last Δ T, last Δ T is the Δ T of (N-1) secondary record, and N is positive integer.Difference DELTA T is greater than zero, illustrates local clock Ts
Opposite reference clock Tm, which is in, delays state, if difference DELTA T is greater than difference DELTA T', when illustrating that local clock Ts is referred to relatively
The degree that clock Tm is in state of delaying is increasing.That is deviation of the local clock Ts with respect to reference clock Tm is increasing.
Step S24: if difference DELTA T less than zero, judges whether difference DELTA T is less than difference DELTA T'.
Difference DELTA T illustrates that local clock Ts is in Lead conditions with respect to reference clock Tm, if difference DELTA T is big less than zero
In difference DELTA T', then illustrate that local clock Ts is increasing with respect to the reference clock Tm degree for being in Lead conditions.That is local clock
Deviation of the Ts with respect to reference clock Tm is increasing.
The present embodiment discloses a kind of the first parameter C of adjustmentmaxMethod, it is shown in Figure 3, comprising:
Step S31: judge whether third parameter P2 is equal to preset minimum threshold P2minOr max-thresholds P2max。
Usual P2minIt is set as zero, P2maxIt is set as 2t.T is that the pulse number C generated in crystal oscillator is not equal to the second parameter
CaWhen, local clock Ts is in each increased set time in crystal oscillator period.
Step S32: if third parameter P2 is equal to minimum threshold P2minOr it is equal to max-thresholds P2max, then reduce the first parameter
Cmax(such as setting Cmax=Cmax-1).First parameter CmaxIt is reduced to minimum threshold C1When will no longer reduce.
In the time adjusted value for only adjusting the period by correcting each time, local clock Ts and reference clock cannot achieve
When the synchronization of Tm, reduce adjustment period time.First parameter CmaxMinimum threshold C1It is usually arranged as zero.
Step S33: if third parameter P2 is not equal to minimum threshold P2min, and it is not equal to max-thresholds P2max, then increase
One parameter Cmax(such as setting Cmax=Cmax+1).First parameter CmaxIncrease to max-thresholds C2When will no longer increase.Maximum threshold
Value C2It is usually arranged as 65535.
The present embodiment discloses a kind of method for adjusting third parameter P2
If difference DELTA T be greater than zero, and difference DELTA T be greater than difference DELTA T', then increase third parameter P2 (such as setting P2=P2
+1).That is degree of the local clock Ts with respect to reference clock Tm in state of delaying increases third parameter P2 when increasing, to increase
Add the every C of local clock TsmaxA cumulative time in crystal oscillator period is [t* (Cmax- 1)+P2] so that local clock Ts and reference clock
Tm is synchronous.
If difference DELTA T less than zero, and difference DELTA T be less than difference DELTA T', then reduce third parameter P2 (such as setting P2=
P2-1).That is local clock Ts is in the degree of Lead conditions when increasing with respect to reference clock Tm, reduces third parameter P2, with
Reduce the every C of local clock TsmaxA cumulative time in crystal oscillator period is [t* (Cmax- 1)+P2] so that when local clock Ts and reference
Clock Tm is synchronous.
For the various method embodiments described above, for simple description, therefore, it is stated as a series of action combinations, but
Be those skilled in the art should understand that, the application is not limited by the described action sequence because according to the application, certain
A little steps can be performed in other orders or simultaneously.
The present embodiment discloses a kind of clock synchronizing controls, shown in Figure 4, which includes:
Whether monitoring unit 101, the pulse number C for monitoring crystal oscillator generation are equal to the second parameter Ca, as pulse number C
Not equal to the second parameter CaWhen, then local clock Ts increases preset set time t in each crystal oscillator period, when pulse
Number C is equal to the second parameter CaWhen, then local clock Ts increases third parameter P2 seconds, and monitors the pulse number that crystal oscillator generates
Whether C is equal to the first parameter Cmax, when pulse number C is equal to the first parameter CmaxWhen, then pulse number C is zeroed out,
Wherein Ca≤Cmax。
The first adjustment unit 102 is used for when each pulse number C is reset, to the first parameter CmaxIt is adjusted
It is whole, so that the local clock Ts is synchronous with the reference clock Tm;
First judging unit 103, for judging local clock Ts with respect to reference clock Tm's using preset time T as the period
Whether deviation is increasing.
Second adjustment unit 104 carries out third for increasing in deviation of the local clock Ts with respect to reference clock Tm
The adjustment of parameter P2, so that local clock Ts is synchronous with reference clock Tm.
The present embodiment discloses a kind of first judging unit, shown in Figure 5, comprising:
Difference unit 1031 subtracts the local clock Ts's for using preset time T as the period, calculating reference clock Tm
Difference DELTA T, and record difference DELTA T;
Second judgment unit 1032, for judging whether difference DELTA T is greater than zero or less than zero, if difference DELTA T is greater than zero,
Judge whether difference DELTA T is greater than difference DELTA T', it is poor if difference DELTA T less than zero, judges whether difference DELTA T is less than difference DELTA T'
Value Δ T' is the preceding primary difference last for judging deviation of the local clock Ts with respect to reference clock Tm and whether recording when increasing
ΔT。
The present embodiment discloses a kind of the first adjustment unit, shown in Figure 6, comprising:
Third judging unit 1021, to judge whether the third parameter P2 is equal to preset minimum threshold P2minOr most
Big threshold value P2max;
Third adjusts subelement 1022, for being equal to the minimum threshold P2 in the third parameter P2minOr it is equal to described
Max-thresholds P2maxWhen, reduce the first parameter Cmax, the first parameter CmaxIt is reduced to minimum threshold C1When will no longer subtract
It is small;
4th adjustment subelement 1023, for being not equal to the minimum threshold P2 in the third parameter P2min, and differ
In the max-thresholds P2maxWhen, increase the first parameter Cmax, the first parameter CmaxIncrease to max-thresholds C2Shi Jiang
No longer increase.
The present embodiment discloses a kind of second adjustment unit, comprising:
The first adjustment subelement, for being greater than zero in the difference DELTA T, and the difference DELTA T is greater than the difference DELTA T'
When, increase the third parameter P2;
Second adjustment subelement is used in the difference DELTA T less than zero, and the difference DELTA T is less than the difference DELTA T'
When, reduce the third parameter P2.
For device embodiment, since it essentially corresponds to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
It needs that some or all of the modules therein is selected to achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not
In the case where making the creative labor, it can understand and implement.
Herein, relational terms such as first and second and the like be used merely to by an entity or operation with it is another
One entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this reality
Relationship or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability
Contain, so that the process, method, article or equipment for including a series of elements not only includes those elements, but also including
Other elements that are not explicitly listed, or further include for elements inherent to such a process, method, article, or device.
In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element
Process, method, article or equipment in there is also other identical elements.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.
The foregoing description of the disclosed embodiments makes professional and technical personnel in the field can be realized or use the application.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the application
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Claims (5)
1. a kind of clock synchronization adjustment method characterized by comprising
Whether the pulse number C that monitoring crystal oscillator generates is equal to the second parameter Ca, when the pulse number C is not equal to second ginseng
Number CaWhen, then local clock Ts increases preset set time t in each crystal oscillator period, when the pulse number C is equal to described
Second parameter CaWhen, then the local clock Ts increased time is third parameter P2, and, the pulse number that monitoring crystal oscillator generates
Whether C is equal to the first parameter Cmax, when the pulse number C is equal to the first parameter CmaxWhen, then the pulse number C is clear
Zero, the first parameter CmaxWith the second parameter CaFor positive integer, and Ca≤Cmax;
When each pulse number C is reset, to the first parameter CmaxBe adjusted so that the local clock Ts with
Reference clock Tm is synchronous;
Using preset time T as the period, judge whether deviation of the local clock Ts with respect to reference clock Tm increases;
If the deviation of the relatively described reference clock Tm of the local clock Ts is increasing, the tune of the third parameter P2 is carried out
It is whole, so that the local clock Ts is synchronous with the reference clock Tm;
It is described using preset time T as the period, judge whether deviation of the local clock Ts with respect to reference clock Tm increases packet
It includes:
Using preset time T as the period, the difference DELTA T that the reference clock Tm subtracts the local clock Ts is calculated, and record institute
State difference DELTA T;
Judge whether the difference DELTA T is greater than zero or less than zero, if the difference DELTA T is greater than zero, judges that the difference DELTA T is
No to be greater than difference DELTA T', the difference DELTA T' once judges that the local clock Ts is with respect to the deviation of reference clock Tm to be preceding
The difference last Δ T recorded when no increase;
If the difference DELTA T less than zero, judges whether the difference DELTA T is less than the difference DELTA T';
The adjustment for carrying out the third parameter P2 includes:
If the difference DELTA T is greater than zero, and the difference DELTA T is greater than the difference DELTA T', then increases the third parameter P2;
If the difference DELTA T is less than zero, and the difference DELTA T is less than the difference DELTA T', then reduces the third parameter P2.
2. the method according to claim 1, wherein described carry out the first parameter CmaxAdjustment include:
Judge whether the third parameter P2 is equal to preset minimum threshold P2minOr max-thresholds P2max;
If the third parameter P2 is equal to the minimum threshold P2minOr it is equal to the max-thresholds P2max, then reduce described first
Parameter Cmax, the first parameter CmaxIt is reduced to minimum threshold C1When will no longer reduce;
If the third parameter P2 is not equal to the minimum threshold P2min, and it is not equal to the max-thresholds P2max, then increase institute
State the first parameter Cmax, the first parameter CmaxIncrease to max-thresholds C2When will no longer increase.
3. according to the method described in claim 2, it is characterized in that, the minimum threshold P2minIt is zero, the max-thresholds
P2maxFor 2t, the minimum threshold C1It is zero, the max-thresholds C2It is 65535.
4. a kind of clock synchronizing controls characterized by comprising
Whether monitoring unit, the pulse number C for monitoring crystal oscillator generation are equal to the second parameter Ca, when the pulse number C is differed
In the second parameter CaWhen, then local clock Ts increases preset set time t in each crystal oscillator period, when the pulse
Number C is equal to the second parameter CaWhen, then the local clock Ts increased time is third parameter P2, and, monitoring crystal oscillator produces
Whether raw pulse number C is equal to the first parameter Cmax, when the pulse number C is equal to the first parameter CmaxWhen, then it is described
Pulse number C is reset, the first parameter CmaxWith the second parameter CaFor positive integer, and Ca≤Cmax;
The first adjustment unit is used for when each pulse number C is reset, to the first parameter CmaxIt is adjusted, so that
The local clock Ts is synchronous with reference clock Tm;
First judging unit, for judging deviation of the local clock Ts with respect to reference clock Tm using preset time T as the period
Whether value is increasing;
Second adjustment unit carries out if the deviation for the relatively described reference clock Tm of the local clock Ts is increasing
The adjustment of the third parameter P2, so that the local clock Ts is synchronous with the reference clock Tm;
First judging unit includes:
Difference unit, for calculating the difference that the reference clock Tm subtracts the local clock Ts using preset time T as the period
Δ T, and record the difference DELTA T;
Second judgment unit, for judging whether the difference DELTA T is greater than zero or less than zero, if the difference DELTA T is greater than zero,
Judge whether the difference DELTA T is greater than difference DELTA T', if the difference DELTA T judges whether the difference DELTA T is less than less than zero
Difference DELTA T', the difference DELTA T' once judge whether deviation of the local clock Ts with respect to reference clock Tm is increasing to be preceding
The difference last Δ T of added-time record;
The second adjustment unit includes:
The first adjustment subelement, for the difference DELTA T be greater than zero, and the difference DELTA T be greater than the difference DELTA T' when, increase
The big third parameter P2;
Second adjustment subelement, in the difference DELTA T less than zero, and the difference DELTA T be less than the difference DELTA T' when, subtract
The small third parameter P2.
5. device according to claim 4, which is characterized in that the first adjustment unit includes:
Third judging unit, to judge whether the third parameter P2 is equal to preset minimum threshold P2minOr max-thresholds
P2max;
Third adjusts subelement, for being equal to the minimum threshold P2 in the third parameter P2minOr it is equal to the max-thresholds
P2maxWhen, reduce the first parameter Cmax, the first parameter CmaxIt is reduced to minimum threshold C1When will no longer reduce;
4th adjustment subelement, for being not equal to the minimum threshold P2 in the third parameter P2min, and not equal to described in most
Big threshold value P2max, then increase the first parameter Cmax, the first parameter CmaxIncrease to max-thresholds C2When will no longer increase.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610429889.4A CN105897394B (en) | 2016-06-16 | 2016-06-16 | A kind of clock synchronization adjustment method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610429889.4A CN105897394B (en) | 2016-06-16 | 2016-06-16 | A kind of clock synchronization adjustment method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105897394A CN105897394A (en) | 2016-08-24 |
CN105897394B true CN105897394B (en) | 2019-02-15 |
Family
ID=56731109
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610429889.4A Active CN105897394B (en) | 2016-06-16 | 2016-06-16 | A kind of clock synchronization adjustment method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105897394B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110661609B (en) * | 2018-06-28 | 2024-02-02 | 杭州海康机器人股份有限公司 | Clock synchronization method and first equipment |
CN109765578B (en) * | 2019-02-19 | 2020-11-03 | 武汉元光科技有限公司 | Bus GPS equipment clock calibration method and device |
CN112511156B (en) * | 2020-11-18 | 2024-03-22 | 河南卓正电子科技有限公司 | Pulse metering and storing method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102081400A (en) * | 2011-02-17 | 2011-06-01 | 北京和利时系统工程有限公司 | Sequence of event (SOE) recording module and adjusting method thereof |
CN102929735A (en) * | 2012-10-19 | 2013-02-13 | 北京星网锐捷网络技术有限公司 | Clock-correcting method and equipment |
CN103138863A (en) * | 2011-12-01 | 2013-06-05 | 中兴通讯股份有限公司 | Time synchronization method and device |
CN103901942A (en) * | 2012-12-28 | 2014-07-02 | 联芯科技有限公司 | Clock precision calibration method and device for terminal |
-
2016
- 2016-06-16 CN CN201610429889.4A patent/CN105897394B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102081400A (en) * | 2011-02-17 | 2011-06-01 | 北京和利时系统工程有限公司 | Sequence of event (SOE) recording module and adjusting method thereof |
CN103138863A (en) * | 2011-12-01 | 2013-06-05 | 中兴通讯股份有限公司 | Time synchronization method and device |
CN102929735A (en) * | 2012-10-19 | 2013-02-13 | 北京星网锐捷网络技术有限公司 | Clock-correcting method and equipment |
CN103901942A (en) * | 2012-12-28 | 2014-07-02 | 联芯科技有限公司 | Clock precision calibration method and device for terminal |
Also Published As
Publication number | Publication date |
---|---|
CN105897394A (en) | 2016-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10057051B2 (en) | Dual path timing wander removal | |
US9209965B2 (en) | Network interface with clock recovery module on line card | |
JP5350787B2 (en) | Time synchronization method and apparatus using time stamp | |
CN103763055B (en) | The method of precise synchronization time a kind of | |
CN105897394B (en) | A kind of clock synchronization adjustment method and device | |
US9124415B2 (en) | PLL glitchless phase adjustment system | |
EP2528255B1 (en) | A method and a device for controlling frequency synchronization | |
WO2018137548A1 (en) | Clock synchronization device and method | |
EP2512048A2 (en) | System and method to overcome wander accumulation to achieve precision clock distribution over large networks | |
CN106712885B (en) | Clock synchronizing method, the network equipment and network system | |
JP2014238357A (en) | Reception device, time difference calculation method and program | |
CN107800529B (en) | Clock frequency synchronization method of network node | |
CN105515704A (en) | Clock synchronization method and optical network unit | |
KR101733660B1 (en) | 10gbaset method and apparatus for data aided timing recovery in 10gbaset system | |
CN108631897B (en) | A kind of correcting time in network method and device | |
WO2013163793A1 (en) | Automatic time and frequency synchronization over an asynchronous network | |
JP2007306497A (en) | Clock synchronization method and circuit in packet transmission | |
CN114520703B (en) | Clock drift compensation method and circuit for time synchronization between industrial network devices | |
JP2011055402A (en) | Synchronous transmission apparatus and jitter suppression method | |
WO2016177240A1 (en) | Frequency synchronization method and device | |
US8442074B1 (en) | Systems and methods for passing timing information over packet networks | |
CN102005723A (en) | IEEE1588-based data synchronization method for fiber differential protection device | |
CN105722207A (en) | Self-adaptive clock synchronization method for wireless network at low transmission speeds | |
JP5098388B2 (en) | Clock correction circuit and method and system | |
CN103227707A (en) | Synchronization processing apparatus, synchronization processing method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |