CN105897394A - Method and device for synchronous adjustment of clocks - Google Patents

Method and device for synchronous adjustment of clocks Download PDF

Info

Publication number
CN105897394A
CN105897394A CN201610429889.4A CN201610429889A CN105897394A CN 105897394 A CN105897394 A CN 105897394A CN 201610429889 A CN201610429889 A CN 201610429889A CN 105897394 A CN105897394 A CN 105897394A
Authority
CN
China
Prior art keywords
parameter
max
difference delta
equal
time
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
CN201610429889.4A
Other languages
Chinese (zh)
Other versions
CN105897394B (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.)
Qiao Hong Cnc Technology (shanghai) Co Ltd
Original Assignee
Qiao Hong Cnc Technology (shanghai) 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 Qiao Hong Cnc Technology (shanghai) Co Ltd filed Critical Qiao Hong Cnc Technology (shanghai) Co Ltd
Priority to CN201610429889.4A priority Critical patent/CN105897394B/en
Publication of CN105897394A publication Critical patent/CN105897394A/en
Application granted granted Critical
Publication of CN105897394B publication Critical patent/CN105897394B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0008Synchronisation 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

The invention discloses a method and a device for synchronous adjustment of clocks. A crystal oscillator produces a pulse at each crystal oscillator period. The method comprises the following steps of monitoring a number C of the pulses produced by the crystal oscillator, if C is not equal to Ca, adding a preset fixed time t to a local clock Ts, and if C is equal to Ca, adding a time P2 to the local clock Ts; resetting when the C is increased to Cmax and recounting; adjusting the first parameter Cmax when resetting the C at each time; and periodically judging whether a deviation value of the local clock Ts relative to a reference clock Tm is increased, if yes, adjusting the P2, namely correcting an accumulated time [t*(Cmax-1)+P2] of the local clock Ts in the Cmax crystal oscillator periods to make the accumulated time of the local clock Ts be equal to that of the reference clock Tm in the same time bucket in order to complete synchronous adjustment of the local clock Ts and the reference clock Tm.

Description

A kind of clock synchronization adjustment method and device
Technical field
The application relates to the communications field, more particularly, it relates to a kind of clock synchronization adjustment method and device.
Background technology
In dcs, it is contemplated that the scheduling of real-time and control, the requirement to time unification The strictest.Crystal oscillator, as high accuracy and the agitator of high stability, is widely used in each node of system In data handling equipment, it is that data handling equipment produces clock signal as frequency generator.But, i.e. Make the crystal oscillator frequency degree of stability that nominal frequency is identical also from ± 1 to ± 100ppm, cause the number of each node Clock according to processing equipment is asynchronous, causes the data handling equipment being distributed in each node to be difficult to normal association Adjust work and operation.
Summary of the invention
In view of this, the application proposes a kind of clock synchronization adjustment method and device, is intended to distributed AC servo system In system, the clock of the data handling equipment of each node carries out synchronization control, to ensure the data of each node The normal co-ordination of processing equipment and the purpose of operation.
To achieve these goals, it is proposed that scheme as follows:
A kind of clock synchronization adjustment method, including:
Whether the pulse number C that monitoring crystal oscillator produces is equal to the second parameter Ca, when described pulse number C not Equal to described second parameter CaTime, then local clock Ts increases the set time preset in each crystal oscillator cycle T, when described pulse number C is equal to described second parameter CaTime, the most described local clock Ts increase time Between be the 3rd parameter P2, and, whether the pulse number C that monitoring crystal oscillator produces equal to the first parameter Cmax, When described pulse number C is equal to described first parameter CmaxTime, the most described pulse number C resets, described First parameter CmaxWith the second parameter CaFor positive integer, and Ca≤Cmax
When each described pulse number C resets, to described first parameter CmaxIt is adjusted, so that institute State local clock Ts Tong Bu with described reference clock Tm;
With preset time T as cycle, it is judged that the described local clock Ts deviation value relative to reference clock Tm Whether increase;
If the deviation value of described local clock Ts the most described reference clock Tm is increasing, then carry out described The adjustment of the 3rd parameter P2, so that described local clock Ts is Tong Bu with described reference clock Tm.
Preferably, described judge whether the described local clock Ts deviation value relative to reference clock Tm increases Including:
With preset time T as cycle, calculate described reference clock Tm and deduct the difference of described local clock Ts Value Δ T, and record described difference DELTA T;
Judge that described difference DELTA T, whether more than zero or less than zero, if described difference DELTA T is more than zero, then judges Whether described difference DELTA T is more than difference DELTA T', and described difference DELTA T' is front once to judge described local clock Ts The difference last Δ T of record when whether the deviation value of reference clock Tm increases relatively;
If described difference DELTA T is less than zero, then judge that whether described difference DELTA T is less than described difference DELTA T'.
Preferably, the adjustment carrying out described 3rd parameter P2 described in includes:
If described difference DELTA T is more than zero, and described difference DELTA T is more than described difference DELTA T', then increase described the Three parameters P2;
If described difference DELTA T is less than zero, and described difference DELTA T is less than described difference DELTA T', then reduce described the Three parameters P2.
Preferably, described first parameter C is carried out described inmaxAdjustment include:
Judge that whether described 3rd parameter P2 is equal to the minimum threshold P2 presetminOr max-thresholds P2max
If described 3rd parameter P2 is equal to described minimum threshold P2minOr equal to described max-thresholds P2max, Then reduce described first parameter Cmax, described first parameter CmaxIt is reduced to minimum threshold C1Time will no longer subtract Little;
If described 3rd parameter P2 is not equal to described minimum threshold P2min, and it is not equal to described max-thresholds P2max, then described first parameter C is increasedmax, described first parameter CmaxIncrease to max-thresholds C2Shi Jiang No longer increase.
Preferably, described minimum threshold P2minIt is zero, described max-thresholds P2maxFor 2t, described minimum Threshold value C1It is zero, described max-thresholds C2It is 65535.
A kind of clock synchronizing controls, including:
Monitoring means, whether the pulse number C produced for monitoring crystal oscillator is equal to the second parameter Ca, work as institute State pulse number C and be not equal to described second parameter CaTime, then local clock Ts increased in each crystal oscillator cycle Add default set time t, when described pulse number C is equal to described second parameter CaTime, the most described The time that ground clock Ts increases is the 3rd parameter P2, and, whether the pulse number C that monitoring crystal oscillator produces Equal to the first parameter Cmax, when described pulse number C is equal to described first parameter CmaxTime, the most described arteries and veins Rush number C to reset, described first parameter CmaxWith the second parameter CaFor positive integer, and Ca≤Cmax
First adjustment unit, for when each described pulse number C resets, to described first parameter Cmax It is adjusted, so that described local clock Ts is Tong Bu with described reference clock Tm;
First judging unit, for preset time T as cycle, it is judged that described local clock Ts joins relatively Whether the deviation value examining clock Tm is increasing;
Second adjustment unit, if for the deviation value of described local clock Ts the most described reference clock Tm Increasing, then carrying out the adjustment of described 3rd parameter P2, so that described local clock Ts and described reference Clock Tm synchronizes.
Preferably, described first judging unit includes:
Difference unit, for preset time T as cycle, calculates described reference clock Tm and deducts described Difference DELTA T of local clock Ts, and record described difference DELTA T;
Second judging unit, is used for judging whether described difference DELTA T is more than zero or less than zero, if described difference Δ T is more than zero, then judge whether described difference DELTA T is more than difference DELTA T', if described difference DELTA T is less than zero, then Judge described difference DELTA T whether less than difference DELTA T', described difference DELTA T' is front once to judge described local clock The difference last Δ the T whether Ts deviation value relative to reference clock Tm records when increasing.
Preferably, described second adjustment unit includes:
First adjusts subelement, and for being more than zero in described difference DELTA T, and described difference DELTA T is more than described During difference DELTA T', increase described 3rd parameter P2;
Second adjusts subelement, and for being less than zero in described difference DELTA T, and described difference DELTA T is less than described During difference DELTA T', reduce described 3rd parameter P2.
Preferably, described first adjustment unit includes:
3rd judging unit, in order to judge that whether described 3rd parameter P2 is equal to the minimum threshold P2 presetmin Or max-thresholds P2max
3rd adjusts subelement, for being equal to described minimum threshold P2 in described 3rd parameter P2minOr etc. In described max-thresholds P2maxTime, reduce described first parameter Cmax, described first parameter CmaxIt is reduced to Minimum threshold C1Time will no longer reduce;
4th adjusts subelement, for being not equal to described minimum threshold P2 in described 3rd parameter P2min, and It is not equal to described max-thresholds P2max, then described first parameter C is increasedmax, described first parameter CmaxIncrease Big to max-thresholds C2Time will no longer increase.
From above-mentioned technical scheme it can be seen that a kind of clock synchronization adjustment method disclosed in the present application and dress Putting, crystal oscillator produces a pulse in each crystal oscillator cycle, monitors the pulse number C that crystal oscillator produces, if C ≠Ca, then local clock Ts increases the set time t preset, if C=Ca, then local clock Ts increases Time P2.C increases to CmaxTime be zeroed out, again count.And when each C resets to described One parameter CmaxBeing adjusted, therefore, local clock Ts is at every CmaxThe individual cumulative time in crystal oscillator cycle is [t* (Cmax-1)+P2].Periodically judge that whether the local clock Ts deviation value relative to reference clock Tm exists Increase, the most then carry out the adjustment of P2.
By revising local clock Ts at CmaxIndividual crystal oscillator periodic accumulation time [t* (Cmax-1)+P2], with Make local clock Ts and reference clock Tm equal at same time period accumulation interval, complete local clock Ts Synchronization control with reference clock Tm.The i.e. data by making each node in dcs process and set Standby local clock Ts and reference clock Tm synchronization control, it is achieved that the data handling equipment of each node Synchronization control between local clock Ts, and then ensured the normal association of the data handling equipment of each node Adjust work and operation.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present application or technical scheme of the prior art, below will be to reality Execute the required accompanying drawing used in example or description of the prior art to be briefly described, it should be apparent that below, Accompanying drawing in description is only some embodiments of the application, for those of ordinary skill in the art, On the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the flow chart of a kind 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 is that the present embodiment is disclosed adjusts the first parameter CmaxFlow chart;
Fig. 4 is the schematic diagram of a kind 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.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is carried out Clearly and completely describe, it is clear that described embodiment is only some embodiments of the present application, and It is not all, of embodiment.Based on the embodiment in the application, those of ordinary skill in the art are not doing Go out the every other embodiment obtained under creative work premise, broadly fall into the scope of the application protection.
Clock synchronization control scheme disclosed in the present application, the timing mode of local clock Ts is, monitors crystal oscillator The pulse number C produced, the pulse number C produced at crystal oscillator are not equal to the second parameter CaTime, time local Clock Ts increases the set time t preset, and at C equal to CaTime, local clock Ts increases the P2 second.And Periodically judge whether the local clock Ts deviation value relative to reference clock Tm is increasing, the most then enter Row CmaxWith the adjustment of P2, synchronization with reference clock Tm to realize local clock Ts.
The open a kind of clock synchronization adjustment method of the present embodiment, to the first parameter CmaxEnter with the 3rd parameter P2 Row is revised in real time, and shown in Figure 1, the method includes:
Step S11: whether the pulse number C that monitoring crystal oscillator produces is equal to the second parameter Ca, when crystal oscillator produces Raw pulse number C is not equal to the second parameter CaTime, then local clock Ts increased in each crystal oscillator cycle The set time t preset, the pulse number C produced when crystal oscillator are equal to the second parameter CaTime, then during this locality The time that clock Ts increases is the 3rd parameter P2, and whether the pulse number C that produces of monitoring crystal oscillator is equal to the One parameter Cmax, the pulse number C produced when crystal oscillator is equal to the first parameter CmaxTime, then by pulse number C resets, wherein Ca≤Cmax
Crystal oscillator produces pulse, i.e. a clock signal in each crystal oscillator cycle, and local clock Ts receives every time The clock signal produced to crystal oscillator, carries out the cumulative of a time.Local data processing equipment in the application The enumerator corresponding with crystal oscillator is set, for recording the pulse number C that crystal oscillator produces.Work as C=CaTime, Ts=Ts+P2;As C ≠ CaTime, Ts=Ts+t;And when C arrives CmaxAutomatic clear after value.Therefore, Local clock Ts is at every CmaxIndividual cumulative time in crystal oscillator cycle [t* (Cmax-1)+P2].Preset first Parameter Cmax, the second parameter CaWith the value of the 3rd parameter P2, local clock Ts before C does not also reset, P2 and t preset is utilized to carry out timing.And after C resets, if the value of P2 has correction, local Clock Ts is then with default t, revised P2 and CmaxCarry out timing.The application is for CaTo specifically Amendment mode does not limits, and only need to ensure adjusting CmaxAfter, CaValue be not more than Cmax?.And, CaAnd CmaxFor positive integer.
Step S12: when each described pulse number C resets, to the first parameter CmaxIt is adjusted, So that local clock Ts is Tong Bu with reference clock Tm.
Step S13: with preset time T as cycle, it is judged that local clock Ts is relative to reference clock Tm's Whether deviation value is increasing.
Choosing the clock of any one node in each node of dcs is reference clock Tm, Other nodes, with reference clock Tm for adjusting target, carry out clock synchronization control.
Step S14: if the deviation value that local clock Ts is relative to reference clock Tm is increasing, then carry out institute State the adjustment of the 3rd parameter P2, so that local clock Ts is Tong Bu with reference clock Tm.
By adjusting the first parameter CmaxWith the 3rd parameter P2, i.e. revise local clock Ts at CmaxIndividual crystalline substance Shake the periodic accumulation time [t* (Cmax-1)+P2] so that local clock Ts and reference clock Tm is identical Time period accumulation interval is equal, it is achieved the synchronization control of local clock Ts and reference clock Tm.
The open a kind of local clock state judging method of the present embodiment, shown in Figure 2, including:
Step S21: when with preset time T as cycle, calculating reference clock Tm and deduct local clock Ts Difference DELTA T, and record described difference DELTA T.
Step S22: judge that whether difference DELTA T is more than zero or less than zero.
Step S23: if difference DELTA T is more than zero, then judge that whether difference DELTA T is more than difference DELTA T'.
Difference DELTA T' once judges before being whether the local clock Ts deviation value relative to reference clock Tm is increasing The difference last Δ T of Shi Jilu.Judge that the local clock Ts deviation value relative to reference clock Tm is for the first time No when increasing, Δ T'=last Δ T=0;N-th judges that local clock Ts is relative to reference clock Tm Deviation value whether when increasing, Δ T'=last Δ T, last Δ T are the Δ T, N of (N-1) secondary record For positive integer.Difference DELTA T is more than zero, illustrates that local clock Ts is in, relative to reference clock Tm, the state of delaying, If difference DELTA T is more than difference DELTA T', then explanation local clock Ts is in relative to reference clock Tm and delays shape The degree of state is increasing.The i.e. local clock Ts deviation value relative to reference clock Tm is increasing.
Step S24: if difference DELTA T is less than zero, then judge that whether difference DELTA T is less than difference DELTA T'.
Difference DELTA T is less than zero, illustrates that local clock Ts is in Lead conditions relative to reference clock Tm, if Difference DELTA T is more than difference DELTA T', then explanation local clock Ts is in Lead conditions relative to reference clock Tm Degree is increasing.The i.e. local clock Ts deviation value relative to reference clock Tm is increasing.
The open one of the present embodiment adjusts the first parameter CmaxMethod, shown in Figure 3, including:
Step S31: judge that whether the 3rd parameter P2 is equal to the minimum threshold P2 presetminOr max-thresholds P2max
Generally P2minIt is set to zero, P2maxIt is set to 2t.T is the pulse number C produced at crystal oscillator In the second parameter CaTime, the set time that local clock Ts increased in each crystal oscillator cycle.
Step S32: if the 3rd parameter P2 is equal to minimum threshold P2minOr equal to max-thresholds P2max, then Reduce the first parameter Cmax(such as set Cmax=Cmax-1).First parameter CmaxIt is reduced to minimum threshold C1Time will no longer reduce.
Only by revise each time adjust the cycle time adjusted value, it is impossible to realize local clock Ts with During the synchronization of reference clock Tm, the time that reduces adjusts the cycle.First parameter CmaxMinimum threshold C1Logical Set up and be set to zero.
Step S33: if the 3rd parameter P2 is not equal to minimum threshold P2min, and it is not equal to max-thresholds P2max, Then increase the first parameter Cmax(such as set Cmax=Cmax+1).First parameter CmaxIncrease to maximum threshold Value C2Time will no longer increase.Max-thresholds C2It is usually arranged as 65535.
The present embodiment discloses a kind of method adjusting the 3rd parameter P2
If difference DELTA T is more than zero, and difference DELTA T is more than difference DELTA T', then increase the 3rd parameter P2 and (such as set Determine P2=P2+1).The degree that i.e. local clock Ts is in, relative to reference clock Tm, the state of delaying is increasing Time, increase the 3rd parameter P2, to increase the every C of local clock TsmaxThe individual cumulative time in crystal oscillator cycle is [t* (Cmax-1)+P2] so that local clock Ts is Tong Bu with reference clock Tm.
If difference DELTA T is less than zero, and difference DELTA T is less than difference DELTA T', then reduce the 3rd parameter P2 and (such as set Determine P2=P2-1).The degree that i.e. local clock Ts is in Lead conditions relative to reference clock Tm is increasing Time, reduce the 3rd parameter P2, to reduce the every C of local clock TsmaxThe individual cumulative time in crystal oscillator cycle is [t* (Cmax-1)+P2] so that local clock Ts is Tong Bu with reference clock Tm.
For aforesaid each method embodiment, in order to be briefly described, therefore it is all expressed as a series of dynamic Combining, but those skilled in the art should know, the application is not by described sequence of movement Limiting, because according to the application, some step can use other orders or carry out simultaneously.
The open a kind of clock synchronizing controls of the present embodiment, shown in Figure 4, this device includes:
Monitoring means 101, whether the pulse number C produced for monitoring crystal oscillator is equal to the second parameter Ca, When pulse number C is not equal to described second parameter CaTime, then local clock Ts increased in each crystal oscillator cycle Add default set time t, when pulse number C is equal to described second parameter CaTime, then local clock Ts Increase by the 3rd parameter P2 second, and whether the pulse number C that monitoring crystal oscillator produces is equal to the first parameter Cmax, When pulse number C is equal to described first parameter CmaxTime, then pulse number C is zeroed out, wherein Ca≤Cmax
First adjustment unit 102, for when each described pulse number C resets, to described first ginseng Number CmaxIt is adjusted, so that described local clock Ts is Tong Bu with described reference clock Tm;
First judging unit 103, for preset time T as cycle, it is judged that local clock Ts joins relatively Whether the deviation value examining clock Tm is increasing.
Second adjustment unit 104, for increasing in the local clock Ts deviation value relative to reference clock Tm Add, carry out the adjustment of the 3rd parameter P2, so that local clock Ts is Tong Bu with reference clock Tm.
The present embodiment discloses a kind of first judging unit, shown in Figure 5, including:
Difference unit 1031, for preset time T as cycle, calculates reference clock Tm and deducts described Difference DELTA T of local clock Ts, and record difference DELTA T;
Second judging unit 1032, is used for judging whether difference DELTA T is more than zero or less than zero, if difference DELTA T More than zero, then judge that difference DELTA T, whether more than difference DELTA T', if difference DELTA T is less than zero, then judges difference DELTA T Whether less than difference DELTA T', difference DELTA T' once judges inclined relative to reference clock Tm of local clock Ts before being The difference last Δ T whether difference records when increasing.
The present embodiment discloses a kind of first adjustment unit, shown in Figure 6, including:
3rd judging unit 1021, in order to judge that whether described 3rd parameter P2 is equal to the minimum threshold preset P2minOr max-thresholds P2max
3rd adjusts subelement 1022, for being equal to described minimum threshold P2 in described 3rd parameter P2min Or equal to described max-thresholds P2maxTime, reduce described first parameter Cmax, described first parameter Cmax It is reduced to minimum threshold C1Time will no longer reduce;
4th adjusts subelement 1023, for being not equal to described minimum threshold in described 3rd parameter P2 P2min, and it is not equal to described max-thresholds P2maxTime, increase described first parameter Cmax, described first ginseng Number CmaxIncrease to max-thresholds C2Time will no longer increase.
The present embodiment discloses a kind of second adjustment unit, including:
First adjusts subelement, and for being more than zero in described difference DELTA T, and described difference DELTA T is more than described During difference DELTA T', increase described 3rd parameter P2;
Second adjusts subelement, and for being less than zero in described difference DELTA T, and described difference DELTA T is less than described During difference DELTA T', reduce described 3rd parameter P2.
For device embodiment, owing to it essentially corresponds to embodiment of the method, so relevant part ginseng See that the part of embodiment of the method illustrates.Device embodiment described above is only schematically, The wherein said unit illustrated as separating component can be or may not be physically separate, makees The parts shown for unit can be or may not be physical location, i.e. may be located at a place, Or can also be distributed on multiple NE.Can select according to the actual needs part therein or The whole module of person realizes the purpose of the present embodiment scheme.Those of ordinary skill in the art are not paying creation Property work in the case of, be i.e. appreciated that and implement.
In this article, the relational terms of such as first and second or the like be used merely to an entity or Operation separates with another entity or operating space, and not necessarily requires or imply these entities or operation Between exist any this reality relation or order.And, term " includes ", " comprising " or Its any other variant of person is intended to comprising of nonexcludability, so that include the mistake of a series of key element Journey, method, article or equipment not only include those key elements, but also its including being not expressly set out His key element, or also include the key element intrinsic for this process, method, article or equipment.? In the case of there is no more restriction, statement " including ... " key element limited, it is not excluded that Including process, method, article or the equipment of described key element there is also other identical element.
In this specification, each embodiment uses the mode gone forward one by one to describe, and each embodiment stresses Being the difference with other embodiments, between each embodiment, identical similar portion sees mutually.
Described above to the disclosed embodiments, makes professional and technical personnel in the field be capable of or uses The application.Multiple amendment to these embodiments will be aobvious and easy for those skilled in the art See, generic principles defined herein can in the case of without departing from spirit herein or scope, Realize in other embodiments.Therefore, the application is not intended to be limited to the embodiments shown herein, And it is to fit to the widest scope consistent with principles disclosed herein and features of novelty.

Claims (9)

1. a clock synchronization adjustment method, it is characterised in that including:
Whether the pulse number C that monitoring crystal oscillator produces is equal to the second parameter Ca, when described pulse number C not Equal to described second parameter CaTime, then local clock Ts increases the set time preset in each crystal oscillator cycle T, when described pulse number C is equal to described second parameter CaTime, the most described local clock Ts increase time Between be the 3rd parameter P2, and, whether the pulse number C that monitoring crystal oscillator produces equal to the first parameter Cmax, When described pulse number C is equal to described first parameter CmaxTime, the most described pulse number C resets, described First parameter CmaxWith the second parameter CaFor positive integer, and Ca≤Cmax
When each described pulse number C resets, to described first parameter CmaxIt is adjusted, so that institute State local clock Ts Tong Bu with described reference clock Tm;
With preset time T as cycle, it is judged that the described local clock Ts deviation value relative to reference clock Tm Whether increase;
If the deviation value of described local clock Ts the most described reference clock Tm is increasing, then carry out described The adjustment of the 3rd parameter P2, so that described local clock Ts is Tong Bu with described reference clock Tm.
Method the most according to claim 1, it is characterised in that described judgement described local clock Ts Whether the deviation value of relative reference clock Tm increases includes:
With preset time T as cycle, calculate described reference clock Tm and deduct the difference of described local clock Ts Value Δ T, and record described difference DELTA T;
Judge that described difference DELTA T, whether more than zero or less than zero, if described difference DELTA T is more than zero, then judges Whether described difference DELTA T is more than difference DELTA T', and described difference DELTA T' is front once to judge described local clock Ts The difference last Δ T of record when whether the deviation value of reference clock Tm increases relatively;
If described difference DELTA T is less than zero, then judge that whether described difference DELTA T is less than described difference DELTA T'.
Method the most according to claim 2, it is characterised in that described in carry out described 3rd parameter P2 Adjustment include:
If described difference DELTA T is more than zero, and described difference DELTA T is more than described difference DELTA T', then increase described the Three parameters P2;
If described difference DELTA T is less than zero, and described difference DELTA T is less than described difference DELTA T', then reduce described the Three parameters P2.
Method the most according to claim 1, it is characterised in that described in carry out described first parameter CmaxAdjustment include:
Judge that whether described 3rd parameter P2 is equal to the minimum threshold P2 presetminOr max-thresholds P2max
If described 3rd parameter P2 is equal to described minimum threshold P2minOr equal to described max-thresholds P2max, Then reduce described first parameter Cmax, described first parameter CmaxIt is reduced to minimum threshold C1Time will no longer subtract Little;
If described 3rd parameter P2 is not equal to described minimum threshold P2min, and it is not equal to described max-thresholds P2max, then described first parameter C is increasedmax, described first parameter CmaxIncrease to max-thresholds C2Shi Jiang No longer increase.
Method the most according to claim 4, it is characterised in that described minimum threshold P2minIt is zero, Described max-thresholds P2maxFor 2t, described minimum threshold C1It is zero, described max-thresholds C2It is 65535.
6. a clock synchronizing controls, it is characterised in that including:
Monitoring means, whether the pulse number C produced for monitoring crystal oscillator is equal to the second parameter Ca, work as institute State pulse number C and be not equal to described second parameter CaTime, then local clock Ts increased in each crystal oscillator cycle Add default set time t, when described pulse number C is equal to described second parameter CaTime, the most described The time that ground clock Ts increases is the 3rd parameter P2, and, whether the pulse number C that monitoring crystal oscillator produces Equal to the first parameter Cmax, when described pulse number C is equal to described first parameter CmaxTime, the most described arteries and veins Rush number C to reset, described first parameter CmaxWith the second parameter CaFor positive integer, and Ca≤Cmax
First adjustment unit, for when each described pulse number C resets, to described first parameter Cmax It is adjusted, so that described local clock Ts is Tong Bu with described reference clock Tm;
First judging unit, for preset time T as cycle, it is judged that described local clock Ts joins relatively Whether the deviation value examining clock Tm is increasing;
Second adjustment unit, if for the deviation value of described local clock Ts the most described reference clock Tm Increasing, then carrying out the adjustment of described 3rd parameter P2, so that described local clock Ts and described reference Clock Tm synchronizes.
Device the most according to claim 6, it is characterised in that described first judging unit includes:
Difference unit, for preset time T as cycle, calculates described reference clock Tm and deducts described Difference DELTA T of local clock Ts, and record described difference DELTA T;
Second judging unit, is used for judging whether described difference DELTA T is more than zero or less than zero, if described difference Δ T is more than zero, then judge whether described difference DELTA T is more than difference DELTA T', if described difference DELTA T is less than zero, then Judge described difference DELTA T whether less than difference DELTA T', described difference DELTA T' is front once to judge described local clock The difference last Δ the T whether Ts deviation value relative to reference clock Tm records when increasing.
Device the most according to claim 7, it is characterised in that described second adjustment unit includes:
First adjusts subelement, and for being more than zero in described difference DELTA T, and described difference DELTA T is more than described During difference DELTA T', increase described 3rd parameter P2;
Second adjusts subelement, and for being less than zero in described difference DELTA T, and described difference DELTA T is less than described During difference DELTA T', reduce described 3rd parameter P2.
Device the most according to claim 6, it is characterised in that described first adjustment unit includes:
3rd judging unit, in order to judge that whether described 3rd parameter P2 is equal to the minimum threshold P2 presetmin Or max-thresholds P2max
3rd adjusts subelement, for being equal to described minimum threshold P2 in described 3rd parameter P2minOr etc. In described max-thresholds P2maxTime, reduce described first parameter Cmax, described first parameter CmaxIt is reduced to Minimum threshold C1Time will no longer reduce;
4th adjusts subelement, for being not equal to described minimum threshold P2 in described 3rd parameter P2min, and It is not equal to described max-thresholds P2max, then described first parameter C is increasedmax, described first parameter CmaxIncrease Big to max-thresholds C2Time will no longer increase.
CN201610429889.4A 2016-06-16 2016-06-16 A kind of clock synchronization adjustment method and device Active CN105897394B (en)

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 true CN105897394A (en) 2016-08-24
CN105897394B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109765578A (en) * 2019-02-19 2019-05-17 武汉元光科技有限公司 Bus GPS equipment clock calibration method and device
CN110661609A (en) * 2018-06-28 2020-01-07 杭州海康机器人技术有限公司 Clock synchronization method and first equipment
CN112511156A (en) * 2020-11-18 2021-03-16 河南卓正电子科技有限公司 Pulse metering and storing method

Citations (4)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110661609A (en) * 2018-06-28 2020-01-07 杭州海康机器人技术有限公司 Clock synchronization method and first equipment
CN110661609B (en) * 2018-06-28 2024-02-02 杭州海康机器人股份有限公司 Clock synchronization method and first equipment
CN109765578A (en) * 2019-02-19 2019-05-17 武汉元光科技有限公司 Bus GPS equipment clock calibration method and device
CN112511156A (en) * 2020-11-18 2021-03-16 河南卓正电子科技有限公司 Pulse metering and storing method
CN112511156B (en) * 2020-11-18 2024-03-22 河南卓正电子科技有限公司 Pulse metering and storing method

Also Published As

Publication number Publication date
CN105897394B (en) 2019-02-15

Similar Documents

Publication Publication Date Title
US9124415B2 (en) PLL glitchless phase adjustment system
WO2018137548A1 (en) Clock synchronization device and method
EP2787664B1 (en) Time synchronization method and apparatus
CN105897394A (en) Method and device for synchronous adjustment of clocks
CN105743598B (en) A kind of Industrial Ethernet clock synchronizing method and system
CN106209084A (en) Two-way timing jitter or drift eliminate
TWI605685B (en) Delay control circuit and clock generation circuit including the same
CN107959564A (en) Control device and communicator
CN104300969B (en) A kind of high-precise synchronization clock implementation method based on all-digital phase-locked loop
CN104158616B (en) The synchronous method and device of clock in a kind of fibre-optic transmission system (FOTS)
GB2536318A (en) Synchronising devices
US20200259631A1 (en) Synchronising Devices Using Clock Signal Delay Comparison
KR101733660B1 (en) 10gbaset method and apparatus for data aided timing recovery in 10gbaset system
CN115486059A (en) Signal processing method, device, equipment, storage medium and computer equipment
WO2014118984A1 (en) Signal processing apparatus
US8867682B2 (en) Dejitter (desynchronize) technique to smooth gapped clock with jitter/wander attenuation using all digital logic
CN104753497B (en) Method and device for correcting OSCPPS
JP2017108254A (en) Phase synchronization circuit and phase synchronization method
EP3419209B1 (en) A method and apparatus for controlling an average fill level of an asynchronous first-in-first-out, fifo
JP5566310B2 (en) GPS jitter reduction device
EP3972160B1 (en) Time synchronization method, service board, and network device
EP2458756A2 (en) Node system and supervisory node
EP3594762A1 (en) Devices, systems, and methods for reducing jitter in control systems
CN102005723A (en) IEEE1588-based data synchronization method for fiber differential protection device
CN106301653B (en) A kind of distribution node clock correcting method of Distributed real-time tasks

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