CN106685566B - A kind of selection method and clock server of clock source - Google Patents
A kind of selection method and clock server of clock source Download PDFInfo
- Publication number
- CN106685566B CN106685566B CN201611264202.2A CN201611264202A CN106685566B CN 106685566 B CN106685566 B CN 106685566B CN 201611264202 A CN201611264202 A CN 201611264202A CN 106685566 B CN106685566 B CN 106685566B
- Authority
- CN
- China
- Prior art keywords
- clock source
- time
- clock
- source
- valid
- 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
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
- H04J3/0658—Clock or time synchronisation among packet nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
- H04J3/0658—Clock or time synchronisation among packet nodes
- H04J3/0661—Clock or time synchronisation among packet nodes using timestamps
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Electric Clocks (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
The embodiment of the present invention provides a kind of selection method and clock server of clock source, including:The clock signal of the multiple clock sources received is decoded;The first valid clock source is determined from the clock source of successfully decoded;For each first valid clock source, determine the difference at the first time with the second time, the first time is the first efficient clock source time, and second time is equipment current fiducial time, and the currently used clock source of the equipment is one in the multiple clock source;The first valid clock source that difference between the first time and second time is less than to first threshold is determined as available clock source;From described with the clock source for determining subsequent time in clock source, it can be seen that, since the first time of valid clock source and the second time are combined judgement, it is not the quality selection clock source for being based only on clock signal, therefore, it is possible to improve the accuracy of clock server internal reference reference time.
Description
Technical field
The present embodiments relate to the technical field of time synchronization more particularly to the selection methods and clock of a kind of clock source
Server.
Background technology
In the prior art, by using Big Dipper BDS, (BeiDou Navigation Satellite System, the Big Dipper are defended
Star navigation system), the external timing signals such as GPS (Global Positioning System, global positioning system) establish clock
The server internal reference time, and completed with all by time dissemination system and the time of equipment using various time output signals
It is synchronous.Wherein, external timing signal includes multiple clock signal source:GPS clock signal source, big-dipper satellite signal source of clock,
IRIG-B (Inter Range Instrumentation Group, U.S. target range instrument group) signal source of clock, PPT
(Precision Time Protocol, Precision Time Protocol) signal source of clock, TOD (Time of Day, Time of Day information)
Signal source of clock.
And be how to select local clock source in inside about clock server, at present mostly by believing external clock
Number the mode that is detected of quality select local clock source, can not be with clock service and due to the quality of clock signal
Device current internal reference time establishes association, therefore, when selecting local by way of detecting external timing signal quality
Zhong Yuan reduces the accuracy of clock server internal reference reference time.
Invention content
The embodiment of the present invention provides a kind of selection method and clock server of clock source, to improve in clock server
The accuracy of portion's reference time.
The embodiment of the present invention provides a kind of selection method of clock source, including:
The clock signal of the multiple clock sources received is decoded;
The first valid clock source is determined from the clock source of successfully decoded;
For each first valid clock source, the difference at the first time with the second time is determined, the first time is institute
The first efficient clock source time is stated, second time is the fiducial time that the clock source at equipment current time provides, described to set
The clock source at standby current time is one in the multiple clock source;
The first valid clock source that difference between the first time and second time is less than to first threshold is true
It is set to available clock source;
From described with the clock source for determining the equipment subsequent time in clock source.
Preferably, it is described from the clock source with the determining equipment in clock source, including:
If the clock source at current time is included in and described can use in clock source, it is determined that the clock source at current time with it is described
Whether the time difference of the second time redefines down more than second threshold if so, according to the priority with clock source
The clock source at one moment;Otherwise, keep the clock source of last moment constant in subsequent time.
Preferably, further including:
If the clock source at current time can be used in clock source described in being not included in, the preferential of clock source can be used according to
Grade, redefines the clock source of subsequent time.
Preferably, determining clock source of the equipment in initialization in the following manner:
Time corresponding to multiple effective second valid clock sources received is asked poor two-by-two, and determines the time
Two the second valid clock sources of difference minimum;
Determine the priority of described two second valid clock sources;
Using higher second valid clock source of priority in described two clock sources as the equipment in initialization
Clock source.
Preferably, the first valid clock source is determined in the clock source from successfully decoded, including:
Measure third time of each clock source in the clock source of the successfully decoded and the 4th time respectively, described the
Three times were time of the clock source at the selected moment, the 4th time be clock source the later moment in time at the selected moment when
Between;
Difference between the third time and the 4th time is less than to the clock source of third threshold value, is determined as first
Valid clock source.
The embodiment of the present invention also provides a kind of clock server, including:
Decoder module is decoded for the clock signal to the multiple clock sources received;
Determining module, for determining the first valid clock source from the clock source of successfully decoded;
It is additionally operable to be directed to each first valid clock source, determine at the first time and the difference of the second time, when described first
Between be the first efficient clock source time, second time is the fiducial time that the clock source at equipment current time provides,
The clock source at the equipment current time is one in the multiple clock source;
Be additionally operable to by the difference between the first time and second time be less than first threshold first it is effective when
Zhong Yuan is determined as available clock source;
Selecting module is used for from described with the clock source for determining subsequent time in clock source.
Preferably, the selecting module, is specifically used for:
The clock source at current time be included in it is described can use in clock source when, determine the clock source at current time with it is described
Whether the time difference of the second time redefines down more than second threshold if so, according to the priority with clock source
The clock source at one moment;Otherwise, keep the clock source of last moment constant in subsequent time.
Preferably, the selecting module, is additionally operable to:
Clock source at current time is not included in described when can use in clock source, then the excellent of clock source can be used according to
First grade redefines the clock source of subsequent time.
Preferably, determining clock source of the equipment in initialization in the following manner:
Time corresponding to multiple effective second valid clock sources received is asked poor two-by-two, and determines the time
Two the second valid clock sources of difference minimum;
Determine the priority of described two second valid clock sources;
Using higher second valid clock source of priority in described two clock sources as the equipment in initialization
Clock source.
Preferably, the determining module, is specifically used for:
Measure third time of each clock source in the clock source of the successfully decoded and the 4th time respectively, described the
Three times were time of the clock source at the selected moment, the 4th time be clock source the later moment in time at the selected moment when
Between;
Difference between the third time and the 4th time is less than to the clock source of third threshold value, is determined as first
Valid clock source.
The selection method and clock server for a kind of clock source that above-described embodiment provides, including:It is multiple to what is received
The clock signal of clock source is decoded;The first valid clock source is determined from the clock source of successfully decoded;For each first
Valid clock source, determines the difference between the first time of first valid clock source and the second time of local, described the
Two times were that the clock source at equipment current time described in fiducial time that the clock source at equipment current time provides is the multiple
One in clock source;By the difference between the first time and second time be less than first threshold first it is effective when
Zhong Yuan is determined as available clock source;From described with the clock source for determining subsequent time in clock source, it can be seen that the present invention is real
Example is applied when selecting the clock source of subsequent time, valid clock source is first determined whether out, then by the first time of valid clock source
It is compared with the second local time, and is carried respectively with the clock source at current time in the first time of valid clock source respectively
When difference between the second time supplied is less than first threshold, which can be determined as to available clock source, then
The clock source that subsequent time is determined from available clock source, due to by the clock of the first time of valid clock source and current time
Second time in source is combined judgement, i.e., by the first time of the valid clock source internal reference current with clock server when
Between establish association, be not the local clock source of quality selection for being based only on clock signal, therefore, it is possible to improve clock service
The accuracy of device internal reference reference time.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly introduced.
Fig. 1 is a kind of selection method flow diagram of clock source provided in an embodiment of the present invention;
Fig. 2 provides a kind of method flow schematic diagram obtaining local clock source in initialization for the embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of clock server provided in an embodiment of the present invention.
Specific implementation mode
In order to make the purpose of the present invention, technical solution and advantageous effect be more clearly understood, below in conjunction with attached drawing and implementation
Example, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only used to explain this hair
It is bright, it is not intended to limit the present invention.
It should be noted that the clock source provided in the embodiment of the present invention includes but not limited to GPS clock signal source, north
Struggle against satellite clock source, IRIG-B (Inter Range Instrumentation Group, U.S. target range instrument group) clock source,
When PTP (Precision Time Protocol, Precision Time Protocol) clock source, TOD (Time of Day, Time of Day information)
Zhong Yuan, NTP (Network Time Protocol, Network Time Protocol) clock source, 1PPS clock sources, 1PPS+TOD clock sources,
(1PPS+TOD) signal source of clock no matter being applied in telecommunication mobile system, or applied to the IRIG-B in electric system
Signal source of clock can be applied in the embodiment of the present invention.
Fig. 1 illustrates a kind of selection method flow diagram of clock source provided in an embodiment of the present invention, such as Fig. 1
Shown, this method may include:
S101, the clock signal of the multiple clock sources received is decoded.
S102, the first valid clock source is determined from the clock source of successfully decoded,
S103, it is directed to each first valid clock source, determines the difference at the first time with the second time, the first time
For the first efficient clock source time, second time is the fiducial time that the clock source at equipment current time provides, institute
The clock source for stating equipment current time is one in the multiple clock source.
Equipment can receive multiple clock sources, and equipment needs select a clock source as clock source from multiple clock sources
Fiducial time is provided, at the time of different, equipment is possible to that different clock sources is selected to provide fiducial time.Equipment current time
Clock source is also referred to as the clock source that equipment uses at current time.Wherein, the fiducial time of equipment is according to the clock at current time
The temporal information that source is provided ceaselessly is changing.
S104, the first valid clock source that the difference at the first time between the second time is less than to first threshold are determined as
Clock source can be used.
S105, the clock source that equipment subsequent time is determined from available clock source.
From available clock source determine equipment subsequent time clock source, it is, from available clock determine equipment
In the clock source that subsequent time uses.
In above-mentioned steps S101, the clock signal of the multiple clock sources received is decoded, it can be by multiple
The mode that the symbol format that clock source respectively exports carries out is decoded the clock signal of the multiple clock sources received.
Specifically, differentiating first to the head of the symbol respectively exported of multiple clock sources, the tail of symbol, to multiple
The head of the symbol respectively exported, the tail of symbol of clock source determine come after, to the symbols respectively exported of multiple clock sources
Each field is parsed, and is then corresponded in codec register each field for the symbol of multiple clock sources respectively exported and is deposited
Storage, finally confirms whether the state for the symbol of required multiple clock sources respectively exported is complete, that is, judges required for confirming
All fields respectively exported of multiple clock sources whether meet the requirements, if required multiple clock sources respectively export
All fields meet the requirements, then successfully decoded, otherwise decoding failure.
In above-mentioned steps S102, the first valid clock source is determined from the clock source of successfully decoded, can first determine whether to solve
The quality of the clock signal of multiple clock sources after code success judges the antenna condition of each clock source, satellitosis, intercalation
Whether second, precision, quality and effective marker position meet the requirements, for antenna condition, satellitosis, leap second, precision, quality
And the satisfactory clock source in effective marker position, continue to measure the clock signal of satisfactory clock source, to
Determine the first valid clock source.Specifically, each clock source in satisfactory clock source is measured respectively at the selected moment
Time, that is, third time and satisfactory clock source in each clock source select the moment later moment in time time i.e. the
Four times, and by the difference between third time and the 4th time be less than third threshold value clock source, be determined as first it is effective when
Zhong Yuan.
Specifically, 1PPS (the pulse per of each clock source in satisfactory clock source can be measured respectively
Second, pulse per second (PPS)), i.e., by the clock signal of each satisfactory clock source in the time for selecting the moment and the clock source
Clock signal is measured in the time of the later moment in time at selected moment to be compared, if the clock letter of each satisfactory clock source
Number the selected moment time and should be with the difference of the clock signal of clock source between the time of the later moment in time at selected moment
More than third threshold value, then the clock source is judged for inactive clock source, if the clock signal of each satisfactory clock source is being selected
Difference of the clock signal of time and the clock source that timing is carved between the time of the later moment in time at selected moment is less than third
Threshold value then can determine that the clock source is valid clock source.
After determining the first valid clock source in the clock source from successfully decoded, each first efficient clock can be directed to
Source determines the difference at the first time with the second time, is at the first time the first efficient clock source time, and the second time was to set
The fiducial time that the clock source at standby current time provides, the clock source at equipment current time are one in the multiple clock source
It is a.
Wherein, equipment obtains the method flow of the clock source at current time in initialization, reference can be made to Fig. 2.
Fig. 2 illustrates a kind of clock source obtaining current time in initialization provided in an embodiment of the present invention
Method flow schematic diagram, as shown in Fig. 2, this method may include:
S201, the time corresponding to multiple effective second valid clock sources received is asked poor two-by-two.
S202, two the second valid clock sources for determining difference minimum.
S203, the priority for determining two the second valid clock sources.
S204, using higher second valid clock source of priority in two the second valid clock sources as current time when
Zhong Yuan.
Before above-mentioned steps S201, it is also necessary to be decoded to the clock signal of the multiple clock sources received, then
The second valid clock source is determined from the clock source of successfully decoded.
Below in two kinds of situation, detailed explanation is carried out to method flow shown in Fig. 2.
Situation one:Two clock sources
It is all effective in two clock sources when initialization, priority can be selected high according to the priority of clock source
Clock source of the clock source as current time.
For example, it is assumed that be respectively big dipper clock source and GPS clock source there are two clock sources, and big dipper clock source is excellent
First grade is higher than GPS clock source, and it is further assumed that big dipper clock source and GPS clock source are valid clock source, then is initializing
When, it can be using big dipper clock source as the clock source at current time.
Situation two:Multiple clock sources
It is all effective in multiple clock sources when initialization, multiple valid clock sources are compared two-by-two first,
The time corresponding to multiple valid clock sources is asked poor two-by-two, and determines two valid clock sources of difference minimum, so
Afterwards according to the priority of the two valid clock sources, and using the higher clock source of priority ratio in the two valid clock sources as
The clock source at current time.
For example, it is assumed that be respectively big dipper clock source, GPS clock source, TOD clock source there are three clock sources, and when GPS
The priority of the highest priority of Zhong Yuan, big dipper clock source is taken second place, and the priority in TOD clock source is minimum, and it is further assumed that north
Bucket clock source, GPS clock source, TOD clock source are valid clock source, and measure the temporal information that big dipper clock source obtains
For:9 divide 9 seconds 9 milliseconds of 9 nanoseconds of 9 microsecond when 9;Measuring the temporal information that GPS clock source obtains is:9 divide 9 seconds 9 milliseconds of 9 microseconds when 9
39 nanoseconds;Measuring the temporal information that TOD clock source obtains is:9 divide 9 seconds 9 milliseconds of 49 nanoseconds of 9 microsecond when 9.
Then the time corresponding to multiple valid clock sources is asked poor two-by-two, i.e., will measures what big dipper clock source obtained
" 9 divide 9 seconds 9 millis to temporal information " 9 divide 9 seconds 9 milliseconds of 9 nanoseconds of 9 microsecond when 9 " when 9 with the temporal information that GPS clock source obtains is measured
49 nanosecond of 9 microsecond second " asks poor, obtains for 30 nanoseconds;To measure temporal information that big dipper clock source obtains " when 99 divide 9 seconds 9 milliseconds 9
9 nanosecond of microsecond " asks poor with the temporal information " 9 divide 9 seconds 9 milliseconds of 49 nanoseconds of 9 microsecond when 9 " that TOD clock source obtains is measured, and obtains 40
Nanosecond;The temporal information " 9 divide 9 seconds 9 milliseconds of 39 nanoseconds of 9 microsecond when 9 " and measurement TOD clock source that GPS clock source obtains will be measured
Obtained temporal information " 9 divide 9 seconds 9 milliseconds of 49 nanoseconds of 9 microsecond when 9 " asks poor, obtains for 10 nanoseconds.
When the temporal information " 9 divide 9 seconds 9 milliseconds of 39 nanoseconds of 9 microsecond when 9 " and measurement TOD that are obtained due to measurement GPS clock source
Temporal information " 9 divide 9 seconds 9 milliseconds of 49 nanoseconds of 9 microsecond when 9 " difference that Zhong Yuan is obtained is minimum, thus from GPS clock source and TOD when
Zhong Yuanzhong selects local clock source.Again due to the highest priority of GPS clock source, the priority in TOD clock source is minimum, because
This, using GPS clock source as the clock source at current time.
In above-mentioned steps S105, when determining the clock source of subsequent time from available clock source, also in two kinds of situation, one
Kind of situation is the clock source for include current time in available clock source, and a kind of situation is in available clock source comprising current time
Clock source, introduced separately below.
Situation one:The clock source for including current time in clock source can be used.
If the clock source at current time is included in available clock source, it is determined that the clock source at current time is currently provided
Temporal information and difference between the second time whether be more than second threshold, if the temporal information of the clock source at current time
Difference between the second time is more than second threshold, then according to the priority that can use clock source, reselects subsequent time
Otherwise clock source keeps the clock source at current time constant.
When below by two specific examples to can be used in clock source comprising local clock source, how to determine local
Clock source carries out detailed explanation.
Example one
Assuming that being respectively big dipper clock source, GPS clock source, TOD clock source, and GPS clock source there are three clock sources
Highest priority, the priority in big dipper clock source takes second place, and the priority in TOD clock source is minimum, wherein GPS clock source conduct
The clock source at current time, i.e. equipment current time use GPS clock source to provide fiducial time as clock source.
Assuming that the fiducial time that the GPS clock source at equipment current time provides 10 divides 10 seconds 0 millisecond of 0 microseconds 0 to receive when being 10
Second, and assume that first threshold is 30ns, second threshold 10ns.
It is further assumed that the valid clock source received at this time is big dipper clock source, GPS clock source, TOD clock source, and
Measuring the temporal information that big dipper clock source obtains is:10 divide 10 seconds 0 millisecond of 05 nanoseconds of 0 microsecond when 10;GPS clock source is measured to obtain
Temporal information be:10 divide 10 seconds 0 millisecond of 9 nanoseconds of 0 microsecond when 10;Measuring the temporal information that TOD clock source obtains is:10 when 10
Divide 10 seconds 10 milliseconds of 15 nanoseconds of 10 microsecond.Then, 10 divide 10 seconds 0 millis when will measure the obtained temporal information 10 in big dipper clock source
10 divide 10 seconds 0 millisecond of 0 nanoseconds of 0 microsecond to ask poor when second 05 nanosecond of 0 microsecond fiducial time 10 current with equipment, obtain 5ns, due to
5ns is less than first threshold 30ns, therefore, using big dipper clock source as can use clock source.
10 divide 10 seconds 0 millisecond of 9 nanoseconds of 0 microsecond current with equipment when will measure the obtained temporal information 10 of GPS clock source
Fiducial time 10 when 10 10 seconds 0 millisecond of 0 nanoseconds of 0 microsecond is divided to ask poor, obtain 9ns, since 9ns is less than first threshold 30ns, because
This, using GPS clock source as clock source can be used.
10 divide 10 seconds 0 millisecond of 15 nanoseconds of 0 microsecond current with equipment when will measure the obtained temporal information 10 in TOD clock source
Fiducial time 10 when 10 10 seconds 0 millisecond of 0 nanoseconds of 0 microsecond is divided to ask poor, obtain 15ns, since 15ns is less than first threshold 30ns,
Therefore, using TOD clock source as clock source can be used.
So far, it has been determined that three available clock sources are big dipper clock source, GPS clock source, TOD clock source, and these three
It can be with including local clock source GPS clock source in clock source.
It is further assumed that equipment fiducial time be 10 when 10 divide 10 seconds 0 millisecond of 0 nanoseconds of 0 microsecond after next second,
10 divide 11 seconds 0 millisecond of 0 nanoseconds of 0 microsecond when equipment current fiducial time becomes 10, and assume that the available clock source received is
Big dipper clock source, GPS clock source, TOD clock source, and measure the temporal information that big dipper clock source obtains and be:10 divide 11 when 10
0 millisecond of 0 11 nanosecond of microsecond of second;Measuring the temporal information that GPS clock source obtains is:10 divide 11 seconds 0 millisecond of 8 nanoseconds of 0 microsecond when 10;
Measuring the temporal information that TOD clock source obtains is:10 divide 11 seconds 10 milliseconds of 20 nanoseconds of 10 microsecond when 10,
Due to when equipment fiducial time is 10 10 divide 10 second 0 millisecond of 00 nanosecond of microsecond when, measure GPS clock source and obtain
Temporal information 10 is divided 11 seconds 0 millisecond of 5 nanoseconds of 0 microsecond when being 10, and when the fiducial time of equipment is 10 10 divide 10 seconds 0 millisecond 0
Next second after 0 nanosecond of microsecond i.e. when equipment fiducial time is 10 10 when dividing 11 second 0 millisecond of 00 nanosecond of microsecond, measures GPS
10 divide 11 seconds 0 millisecond of 8 nanoseconds of 0 microsecond when the temporal information that clock source obtains is 10, and therefore, GPS clock source is at the selected moment
Difference is 3ns between the temporal information of the latter second at temporal information and selected moment, and 3ns is less than second threshold 10ns, therefore,
GPS clock source can be continued to the clock source as current time, that is, keep the clock source at current time constant.
Example two
Assuming that being respectively big dipper clock source, GPS clock source, TOD clock source, and GPS clock source there are three clock sources
Highest priority, the priority in big dipper clock source takes second place, and the priority in TOD clock source is minimum, wherein GPS clock source conduct
Local clock source.
Assuming that 10 dividing 11 seconds 0 millisecond of 0 nanoseconds of 0 microsecond when equipment current fiducial time is 10, and assume that first threshold is
30ns, second threshold 10ns.
It is further assumed that the valid clock source received at this time is big dipper clock source, GPS clock source, TOD clock source, and
Measuring the temporal information that big dipper clock source obtains is:10 divide 11 seconds 0 millisecond of 011 nanoseconds of 0 microsecond when 10;GPS clock source is measured to obtain
To temporal information be:10 divide 11 seconds 0 millisecond of 8 nanoseconds of 0 microsecond when 10;Measuring the temporal information that TOD clock source obtains is:When 10
10 points of 11 seconds 0 millisecond of 20 nanoseconds of 0 microsecond.
10 divide 11 seconds 0 millisecond of 011 nanoseconds of 0 microsecond and equipment when then will measure temporal information 10 that big dipper clock source obtains
10 divide 11 seconds 0 millisecond of 0 nanoseconds of 0 microsecond to ask poor when current fiducial time 10, obtain 11ns, since 11ns is less than first threshold
30ns, therefore, using big dipper clock source as clock source can be used.
10 divide 11 seconds 0 millisecond of 8 nanoseconds of 0 microsecond current with equipment when will measure the obtained temporal information 10 of GPS clock source
Fiducial time 10 when 10 11 seconds 0 millisecond of 0 nanoseconds of 0 microsecond is divided to ask poor, obtain 8ns, since 8ns is less than first threshold 30ns, because
This, using GPS clock source as clock source can be used.
The obtained temporal information in TOD clock source, which will be measured, is:10 divide 11 seconds 0 millisecond of 20 nanoseconds of 0 microsecond and equipment when 10
10 divide 11 seconds 0 millisecond of 0 nanoseconds of 0 microsecond to ask poor when current fiducial time 10, obtain 2011ns, since 2011ns is less than the first threshold
Value 30ns, therefore, using TOD clock source as clock source can be used.
So far, it has been determined that three available clock sources are big dipper clock source, GPS clock source, TOD clock source, and these three
It can be with including local clock source GPS clock source in clock source.
It is further assumed that 10 next second after 11 seconds 0 millisecond of 0 nanoseconds of 0 microsecond is divided to set when the fiducial time of equipment is 10
10 divide 12 seconds 0 millisecond of 0 nanoseconds of 0 microsecond when standby current fiducial time becomes 10, and assume that the available clock source received is north
Bucket clock source, GPS clock source, TOD clock source, and measure the temporal information that big dipper clock source obtains and be:10 divide 12 seconds 0 when 10
Millisecond 5 nanosecond of 0 microsecond;Measuring the temporal information that GPS clock source obtains is:10 divide 11 seconds 0 millisecond of 22 nanoseconds of 0 microsecond when 10;It surveys
Measuring the temporal information that TOD clock source obtains is:10 divide 11 seconds 10 milliseconds of 9 nanoseconds of 10 microsecond when 10,
Due at 10 10 divide 11 second 0 millisecond of 00 nanosecond of microsecond when, when to measure temporal information that GPS clock source obtains be 10
10 points of 11 seconds 0 millisecond of 8 nanoseconds of 0 microsecond, and 10 when dividing 12 second 0 millisecond of 00 nanosecond of microsecond, measure what GPS clock source obtained at 10
Temporal information 10 divides 12 seconds 0 millisecond of 22 nanoseconds of 0 microsecond when being 10, therefore, GPS clock source the selected moment temporal information with set
When standby fiducial time is 10 10 divide next second temporal information after 11 seconds 0 millisecond of 0 nanoseconds of 0 microsecond between difference be
14ns, and 14ns is more than second threshold 10ns, therefore, it is not possible to GPS clock source is continued into the clock source as current time, and
Need to select the clock source at current time from big dipper clock source and TOD clock source from remaining available clock source, and by
Priority in big dipper clock source is higher than the priority in TOD clock source, therefore, big dipper clock source may be selected as current time
The clock source at current time is switched to big dipper clock source by clock source from GPS clock source.
Situation two:Can use in clock source does not include local source.
If local clock source is not included in available clock source, according to the priority that can use clock source, redefine
Local clock source.
When not including local clock source to can be used in clock source below by a specific example, how local is determined
Clock source carry out detailed explanation.
Assuming that there are three clock sources to distinguish IRIG-B (Inter Range Instrumentation Group, U.S.'s target
Instrument group) clock source, PTP (Precision Time Protocol, Precision Time Protocol) clock source, NTP (Network
Time Protocol, Network Time Protocol) clock source, and the highest priority of IRIG-B clock sources, clock synchronization compliant with precision time protocol source it is excellent
First grade is taken second place, and the priority of NTP clock sources is minimum, wherein clock source of the IRIG-B clock sources as current time local is set
Standby current time uses IRIG-B clock sources to provide fiducial time as clock source..
Assuming that 11 dividing 11 seconds 11 milliseconds of 11 nanoseconds of 11 microsecond when equipment current fiducial time is 11, and assume first threshold
For 5ns.
It is further assumed that the valid clock source received at this time is IRIG-B clock sources, clock synchronization compliant with precision time protocol source, NTP clock sources, and
And it measures the temporal information that IRIG-B clock sources obtain and is:11 divide 11 seconds 11 milliseconds of 18 nanoseconds of 11 microsecond when 11;Measure clock synchronization compliant with precision time protocol
The temporal information that source obtains is:11 divide 11 seconds 11 milliseconds of 15 nanoseconds of 11 microsecond when 11;Measure the temporal information that NTP clock sources obtain
For:11 divide 11 seconds 11 milliseconds of 10 nanoseconds of 11 microsecond when 11.
Then, 11 seconds 11 milliseconds of 11 microseconds 18 are divided to receive by when temporal information 11 that the IRIG-B clock sources measured obtain 11
11 divide 11 seconds 11 milliseconds of 11 nanoseconds of 11 microsecond to ask poor when fiducial time 11 second current with equipment, 7ns are obtained, since 7ns is more than
First threshold 5ns, therefore, IRIG-B clock sources are unavailable clock source, i.e., local clock source is in this period can not
Use clock source.
11 divide 11 seconds 11 milliseconds of 15 nanoseconds of 11 microsecond to work as with equipment when will measure the obtained temporal information 11 in clock synchronization compliant with precision time protocol source
11 divide 11 seconds 11 milliseconds of 11 nanoseconds of 11 microsecond to ask poor when preceding fiducial time 11, obtain 4ns, since 4ns is less than first threshold
5ns, therefore, clock synchronization compliant with precision time protocol source are available clock source.
11 divide 11 seconds 11 milliseconds of 10 nanoseconds of 11 microsecond to work as with equipment when will measure the obtained temporal information 11 of NTP clock sources
11 divide 11 seconds 11 milliseconds of 11 nanoseconds of 11 microsecond to ask poor when preceding fiducial time 11, obtain 1ns, since 1ns is less than first threshold
5ns, therefore, NTP clock sources are available clock source.
So far, determine that two available clock sources are clock synchronization compliant with precision time protocol source and NTP clock sources, and due to the clock at current time
Source IRIG-B clock sources, and therefore IRIG-B clock sources need to cut the clock source at current time for unavailable clock source
It changes, and since the priority in clock synchronization compliant with precision time protocol source is higher than the priority of NTP clock sources, using clock synchronization compliant with precision time protocol source as current time
Clock source, i.e., the clock source at current time is switched into clock synchronization compliant with precision time protocol source from IRIG-B clock sources.
According to the above as can be seen that the embodiment of the present invention first determines whether out effectively in the local clock source of selection
Then the first time of valid clock source is compared with the second time by clock source respectively, and the first of valid clock source
When time, the difference between the second time was less than first threshold respectively, which can be determined as to available clock
Then source determines the clock source of subsequent time, when due to by the first time of valid clock source with second from available clock source
Between be combined judgement, i.e., the internal reference time that the first time of valid clock source is current with clock server, which establishes, closes
Connection is not the clock source for the quality selection local for being based only on clock signal, therefore, it is possible to improve base inside clock server
The accuracy of quasi- reference time.
Based on the same technical idea, the embodiment of the present invention also provides a kind of clock server, as shown in figure 3, the clock
Server may include:
Decoder module 301 is decoded for the clock signal to the multiple clock sources received;
Determining module 302, for determining the first valid clock source from the clock source of successfully decoded;
It is additionally operable to be directed to each first valid clock source, determine at the first time and the difference of the second time, when described first
Between be the first efficient clock source time, second time is equipment current fiducial time, and the equipment is currently used
Clock source be the multiple clock source in one;
Be additionally operable to by the difference between the first time and second time be less than first threshold first it is effective when
Zhong Yuan is determined as available clock source;
Selecting module 303, for determining the local clock source in clock source from described use.
Preferably, selecting module 303, is specifically used for:
The local clock source be included in it is described can use in clock source when, determine the local clock source with it is described
Whether the time difference of the second time is more than second threshold, if so, according to the priority with clock source, redefines this
The clock source on ground;Otherwise, then keep local clock source constant.
Preferably, selecting module 303, is additionally operable to:
When can be used in clock source described in being not included in local clock source, then the preferential of clock source can be used according to
Grade, redefines local clock source.
Preferably, determining the local clock source in initialization in the following manner:
Time corresponding to multiple effective second valid clock sources received is asked poor two-by-two, and determines the time
Two the second valid clock sources of difference minimum;
Determine the priority of described two second valid clock sources;
Using higher second valid clock source of priority in described two clock sources as local clock source.
Preferably, determining module 302, is specifically used for:
Measure third time of each clock source in the clock source of the successfully decoded and the 4th time respectively, described the
Three times were time of the clock source at the selected moment, the 4th time be clock source the later moment in time at the selected moment when
Between;
Difference between the third time and the 4th time is less than to the clock source of third threshold value, is determined as first
Valid clock source.
To sum up, the selection method and clock server of a kind of clock source provided in an embodiment of the present invention, including:To receiving
The clock signals of multiple clock sources be decoded;The first valid clock source is determined from the clock source of successfully decoded;For every
A first valid clock source determines the difference between the first time of first valid clock source and the second time of local,
Second time is equipment current fiducial time, and local clock source is one in the multiple clock source;It will be described
The first valid clock source for being less than first threshold the difference between second time at the first time is determined as that clock source can be used;
From described with the clock source for determining subsequent time in clock source, it can be seen that the embodiment of the present invention is in selection subsequent time
When clock source, valid clock source is first determined whether out, then compare the first time of valid clock source with the second time respectively
Compared with, and when the first time of valid clock source, the difference between the second time was less than first threshold respectively, this can be had
Effect clock source is determined as available clock source, and the clock source of subsequent time is then determined from available clock source, due to will be effective when
The first time of Zhong Yuan is combined judgement with the second time, i.e., the first time of valid clock source and clock server is current
The internal reference time establish association, be not the local clock source of quality selection for being based only on clock signal, therefore, it is possible to
Improve the accuracy of clock server internal reference reference time.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the present invention
Form.It is deposited moreover, the present invention can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (8)
1. a kind of selection method of clock source, which is characterized in that including:
The clock signal of the multiple clock sources received is decoded;
The first valid clock source is determined from the clock source of successfully decoded;
It for each first valid clock source, determines at the first time and the difference of the second time, the first time is described the
One efficient clock source time, second time are the fiducial time that the clock source at equipment current time provides, and the equipment is worked as
The clock source at preceding moment is one in the multiple clock source;
The first valid clock source that difference between the first time and second time is less than to first threshold is determined as
Clock source can be used;
From described with the clock source for determining the equipment subsequent time in clock source;
Wherein, the first valid clock source is determined in the clock source from successfully decoded, including:
Third time of each clock source in the clock source of the successfully decoded and the 4th time are measured respectively, when the third
Between be clock source in the time at selected moment, the 4th time was time of the clock source in the later moment in time at the selected moment;
Difference between the third time and the 4th time is less than to the clock source of third threshold value, is determined as first effectively
Clock source.
2. the method as described in claim 1, which is characterized in that described to be determined one under the equipment in clock source from described
The clock source at moment, including:
If the clock source at current time can be used in clock source described in being included in, it is determined that the clock source at current time is currently provided
Time difference of time and second time whether be more than second threshold, if so, according to described preferential with clock source
Grade, redefines the clock source of subsequent time;Otherwise, keep the clock source of last moment constant in subsequent time.
3. method as claimed in claim 2, which is characterized in that further include:
If the clock source at current time can be used in clock source described in being not included in, the priority of clock source can be used according to,
Redefine the clock source of subsequent time.
4. the method as described in claim 1, which is characterized in that in the following manner determine the equipment initialization when
Zhong Yuan:
Time corresponding to multiple effective second valid clock sources received is asked poor two-by-two, and determines time difference
Two minimum the second valid clock sources;
Determine the priority of described two second valid clock sources;
Clock using higher second valid clock source of priority in described two clock sources as the equipment in initialization
Source.
5. a kind of clock server, which is characterized in that including:
Decoder module is decoded for the clock signal to the multiple clock sources received;
Determining module, for determining the first valid clock source from the clock source of successfully decoded;
It is additionally operable to be directed to each first valid clock source, determines that the difference at the first time with the second time, the first time are
The first efficient clock source time, second time is the fiducial time that the clock source at equipment current time provides, described
The clock source at equipment current time is one in the multiple clock source;
It is additionally operable to for the difference between the first time and second time to be less than the first valid clock source of first threshold
It is determined as available clock source;
Selecting module is used for from described with the clock source for determining the clock server subsequent time in clock source;
Wherein, the determining module, is specifically used for:
Third time of each clock source in the clock source of the successfully decoded and the 4th time are measured respectively, when the third
Between be clock source in the time at selected moment, the 4th time was time of the clock source in the later moment in time at the selected moment;
Difference between the third time and the 4th time is less than to the clock source of third threshold value, is determined as first effectively
Clock source.
6. clock server as claimed in claim 5, which is characterized in that the selecting module is specifically used for:
When the clock source at current time can be used in clock source described in, determine that the clock source at current time is currently provided
Time difference of time and second time whether be more than second threshold, if so, according to described preferential with clock source
Grade, redefines the clock source of subsequent time;Otherwise, keep the clock source of last moment constant in subsequent time.
7. clock server as claimed in claim 6, which is characterized in that the selecting module is additionally operable to:
Clock source at current time is not included in described when can use in clock source, then the preferential of clock source can be used according to
Grade, redefines the clock source of subsequent time.
8. clock server as claimed in claim 5, which is characterized in that determine that the equipment is initializing in the following manner
When clock source:
Time corresponding to multiple effective second valid clock sources received is asked poor two-by-two, and determines time difference
Two minimum the second valid clock sources;
Determine the priority of described two second valid clock sources;
Clock using higher second valid clock source of priority in described two clock sources as the equipment in initialization
Source.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611264202.2A CN106685566B (en) | 2016-12-31 | 2016-12-31 | A kind of selection method and clock server of clock source |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611264202.2A CN106685566B (en) | 2016-12-31 | 2016-12-31 | A kind of selection method and clock server of clock source |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106685566A CN106685566A (en) | 2017-05-17 |
CN106685566B true CN106685566B (en) | 2018-10-02 |
Family
ID=58849510
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611264202.2A Active CN106685566B (en) | 2016-12-31 | 2016-12-31 | A kind of selection method and clock server of clock source |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106685566B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107390775A (en) * | 2017-06-29 | 2017-11-24 | 上海东土远景工业科技有限公司 | A kind of clock source conversion distribution method and expanding clock |
CN110868268A (en) * | 2019-11-01 | 2020-03-06 | 南方电网数字电网研究院有限公司 | Local time timing method, device, timing equipment and storage medium |
CN111148211A (en) * | 2019-12-31 | 2020-05-12 | 京信通信系统(中国)有限公司 | Clock synchronization method and device, computer equipment and storage medium |
CN112748758A (en) * | 2020-12-28 | 2021-05-04 | 深兰人工智能(深圳)有限公司 | Clock source selection method and device, electronic equipment and storage medium |
CN113904748A (en) * | 2021-09-24 | 2022-01-07 | 济南浪潮数据技术有限公司 | Clock synchronization method, system, device and medium |
CN114723078B (en) * | 2022-03-17 | 2023-05-12 | 中核检修有限公司 | Fault diagnosis method, device, terminal equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101090341A (en) * | 2007-08-10 | 2007-12-19 | 中控科技集团有限公司 | Method and system for network clock synchronous |
CN101695188A (en) * | 2009-10-15 | 2010-04-14 | 上海华为技术有限公司 | Method for correcting local time and clock server |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101860430B (en) * | 2010-06-24 | 2014-08-13 | 中兴通讯股份有限公司 | Device and method for implementing optical network unit switching clock source |
CN103051439B (en) * | 2011-10-14 | 2017-10-10 | 中兴通讯股份有限公司 | A kind of method and device of selection clock source |
-
2016
- 2016-12-31 CN CN201611264202.2A patent/CN106685566B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101090341A (en) * | 2007-08-10 | 2007-12-19 | 中控科技集团有限公司 | Method and system for network clock synchronous |
CN101695188A (en) * | 2009-10-15 | 2010-04-14 | 上海华为技术有限公司 | Method for correcting local time and clock server |
Also Published As
Publication number | Publication date |
---|---|
CN106685566A (en) | 2017-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106685566B (en) | A kind of selection method and clock server of clock source | |
EP3905554A1 (en) | Time synchronization method and electronic device | |
CN101765198B (en) | Clock synchronization method, clock synchronization device and clock synchronization system | |
CN101398474B (en) | COMPASS and GPS double system second difference switching method | |
TW200807008A (en) | Associating a universal time with a received signal | |
CN103563287A (en) | Synchronization device and synchronization method | |
CN109085616A (en) | A kind of satellite timing method, device and storage medium | |
US7373250B2 (en) | AGPS module time synchronization method and device using system time information in mobile terminal | |
CN102388556B (en) | Method for clockclass grading and relative device | |
CN107528654A (en) | It is a kind of based on 1588 method for synchronizing time and device | |
CN112865903B (en) | Method for synchronizing network equipment and network equipment | |
CN107436443B (en) | Position information output method and device | |
JP5261714B2 (en) | High-precision time synchronization apparatus, high-precision time synchronization method, and program | |
CN112564842B (en) | Control system timing method and device for railway vehicle | |
KR20150056279A (en) | A side-peak cancellation technique to improve tracking performance for sine-phased BOC(n,n) signal | |
CN109343332A (en) | Time dissemination system based on Big Dipper satellite signal | |
US20210266086A1 (en) | Phase clock performance improvement for a system embedded with GNSS receiver | |
CN112511255B (en) | Time synchronization method and device | |
CN115150019A (en) | Multi-sensor time synchronization method, device, equipment and medium | |
JP2005134215A (en) | System for measuring difference of signal arrival time | |
CN114727377A (en) | Synchronization method, synchronization device, time server and downstream time server | |
KR20170124213A (en) | UTC Time Synchronization Method for a Device using GPS Module | |
CN113703013B (en) | Signal processing method, device, system and computer readable storage medium | |
CN109061691A (en) | Crystal oscillator module control system based on Big Dipper satellite signal | |
JP5217006B2 (en) | High-precision time synchronization apparatus, high-precision time synchronization method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20171116 Address after: 201203 room 5, building 3000, 802 East Dragon Road, Shanghai, Pudong New Area Applicant after: Shanghai Dongtu vision Industrial Technology Co. Ltd. Address before: 201112 No. 4, No. 301-1, union airway 1369, Shanghai, Minhang District Applicant before: Shanghai DIGIGRID Intelligent Technology Co., Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |