CN106685566A - Clock source selection method and clock server - Google Patents

Clock source selection method and clock server Download PDF

Info

Publication number
CN106685566A
CN106685566A CN201611264202.2A CN201611264202A CN106685566A CN 106685566 A CN106685566 A CN 106685566A CN 201611264202 A CN201611264202 A CN 201611264202A CN 106685566 A CN106685566 A CN 106685566A
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.)
Granted
Application number
CN201611264202.2A
Other languages
Chinese (zh)
Other versions
CN106685566B (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.)
Shanghai Dongtu vision Industrial Technology Co. Ltd.
Original Assignee
SHANGHAI DIGIGRID INTELLIGENT TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHANGHAI DIGIGRID INTELLIGENT TECHNOLOGY Co Ltd filed Critical SHANGHAI DIGIGRID INTELLIGENT TECHNOLOGY Co Ltd
Priority to CN201611264202.2A priority Critical patent/CN106685566B/en
Publication of CN106685566A publication Critical patent/CN106685566A/en
Application granted granted Critical
Publication of CN106685566B publication Critical patent/CN106685566B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock 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 invention provides a clock source selection method and a clock server. The clock source selection method comprises the steps that the received clock signals of multiple clock sources are decoded; a first effective clock source is determined from the successfully decoded clock sources; for each first effective clock source, the difference between a first clock time and a second clock time is determined, the first clock time is the time of the first effective clock source, the second clock time is the time of current standard time in a device, the clock source currently used in the device is one of the multiple clock sources; the first effective clock source where the difference between the first clock time and the second clock time is lower than a first threshold value is determined as the usable clock source; the clock source of a next moment is determined from the usable clock sources, thus a quality selection of the clock sources is not merely based on the clock signals, but is also because of the combined judgment of the first clock time and the second clock time of the effective clock source, therefore the degree of precision of the standard reference time of an internal clock server can be increased.

Description

A kind of system of selection of clock source and clock server
Technical field
The present embodiments relate to the technical field of time synchronized, more particularly to a kind of clock source system of selection and clock Server.
Background technology
In the prior art, by using Big Dipper BDS, (BeiDou Navigation Satellite System, the Big Dipper is defended Star navigation system), the external timing signal such as GPS (Global Positioning System, global positioning system) set up 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, the 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 internally how to select local clock source on clock server, believe by external clock mostly at present Number the mode that is detected of quality select local clock source, and due to the quality of clock signal, can not be with clock service Device current internal reference time sets up association, therefore, when selecting local by way of detecting external timing signal quality Zhong Yuan, reduces the degree of accuracy of clock server internal reference reference time.
The content of the invention
The embodiment of the present invention provides system of selection and the clock server of a kind of clock source, is used to improve in clock server The degree of accuracy of portion's reference time.
The embodiment of the present invention provides a kind of system of selection of clock source, including:
The clock signal of the multiple clock sources to receiving is decoded;
The first valid clock source is determined from the clock source of successfully decoded;
For each the first valid clock source, the difference of the very first time and the second time is determined, the very first time is institute The first efficient clock source time is stated, it is the fiducial time that second time provides for the clock source at equipment current time, described to set The clock source at standby current time is one in the multiple clock source;
Difference between the very first time and second time is true less than the first valid clock source of first threshold It is set to available clock source;
The clock source that the equipment subsequent time is determined in clock source can be used from described.
Preferably, described can use the clock source that the equipment is determined in clock source from described, including:
If the clock source at current time be included in it is described can be with clock source, it is determined that the clock source at current time with it is described Whether the time difference of the second time is more than Second Threshold, if so, can then be redefined down with the priority of clock source according to described The clock source at one moment;Otherwise, keep the clock source of last moment constant in subsequent time.
Preferably, also including:
If the clock source at current time can use the preferential of clock source with clock source described in being not included according to described Level, redefines the clock source of subsequent time.
Preferably, determining clock source of the equipment in initialization in the following manner:
The time corresponding to multiple effective second valid clock source that will be received is asked poor two-by-two, and determines the time Two minimum the second valid clock sources of difference;
Determine the priority of described two second valid clock sources;
Using the second valid clock source higher of priority in described two clock sources as the equipment initialization when Clock source.
Preferably, the first valid clock source is determined in the clock source from successfully decoded, including:
Measure the 3rd time and the 4th time of each clock source in the clock source of the successfully decoded 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;
Clock source by the difference between the 3rd time and the 4th time less than the 3rd threshold value, is judged to first Valid clock source.
The embodiment of the present invention also provides a kind of clock server, including:
Decoder module, the clock signal for the multiple clock sources to receiving is decoded;
Determining module, for determining the first valid clock source from the clock source of successfully decoded;
It is additionally operable to, for each first valid clock source, the difference of the very first time and the second time be determined, when described first Between be the first efficient clock source time, the fiducial time that second time provides for the clock source at equipment current time, The clock source at the equipment current time is in the multiple clock source;
Be additionally operable to by the difference between the very first time and second time less than first threshold first it is effective when Zhong Yuan is defined as available clock source;
Selecting module, for from the clock source with determination subsequent time in clock source.
Preferably, the selecting module, specifically for:
Clock source at current time be included in it is described can with clock source when, determine the clock source at current time with it is described Whether the time difference of the second time is more than Second Threshold, if so, can then be redefined down with the priority of clock source according to described 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 be not included in it is described can with clock source when, then according to it is described can be with clock source it is excellent First level, redefines the clock source of subsequent time.
Preferably, determining clock source of the equipment in initialization in the following manner:
The time corresponding to multiple effective second valid clock source that will be received is asked poor two-by-two, and determines the time Two minimum the second valid clock sources of difference;
Determine the priority of described two second valid clock sources;
Using the second valid clock source higher of priority in described two clock sources as the equipment initialization when Clock source.
Preferably, the determining module, specifically for:
Measure the 3rd time and the 4th time of each clock source in the clock source of the successfully decoded 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;
Clock source by the difference between the 3rd time and the 4th time less than the 3rd threshold value, is judged to first Valid clock source.
A kind of system of selection of clock source that above-described embodiment is provided and clock server, including:To the multiple for receiving 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 very first time of first valid clock source and the second local time, described The clock source at equipment current time described in the fiducial time that two times provided for the clock source at equipment current time is the multiple One in clock source;By the difference between the very first time and second time less than first threshold first it is effective when Zhong Yuan is defined as available clock source;From described with the clock source that subsequent time is determined in clock source, it can be seen that the present invention is real Example is applied when the clock source of subsequent time is selected, valid clock source is first determined whether out, then by the very first time of valid clock source It is compared with the second local time respectively, and is carried with the clock source at current time respectively in the very first time of valid clock source When difference between the second time for supplying is less than first threshold, the valid clock source can be defined as available clock source, then The clock source of subsequent time is determined from available clock source, due to by the clock at the very first time of valid clock source and current time Second time in source is combined judgement, will valid clock source the very first time and clock server current internal reference when Between set up association, be not that the quality for being based only on clock signal selects local clock source, therefore, it is possible to improve clock service The degree of accuracy of device internal reference reference time.
Brief description of the drawings
Technical scheme in order to illustrate more clearly the embodiments of the present invention, below will be to that will make needed for embodiment description Accompanying drawing is briefly introduced.
Fig. 1 is a kind of system of selection schematic flow sheet of clock source provided in an embodiment of the present invention;
A kind of Fig. 2 method flow schematic diagrams that local clock source is obtained in initialization for the embodiment of the present invention is provided;
Fig. 3 is a kind of structural representation of clock server provided in an embodiment of the present invention.
Specific embodiment
In order that the purpose of the present invention, technical scheme and beneficial effect become more apparent, below in conjunction with accompanying 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 is not limited to GPS clock signal source, north Bucket satellite clock source, IRIG-B (Inter Range Instrumentation Group, the 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, NTP) clock source, 1PPS clock sources, 1PPS+TOD clock sources, (1PPS+TOD) signal source of clock in telecommunication mobile system no matter is applied to, the IRIG-B in power system is still applied to Signal source of clock can apply in the embodiment of the present invention.
Fig. 1 illustrates a kind of system of selection schematic flow sheet of clock source provided in an embodiment of the present invention, such as Fig. 1 Shown, the method may include:
S101, the clock signal of multiple clock sources to receiving are decoded.
S102, the first valid clock source is determined from the clock source of successfully decoded,
S103, for each the first valid clock source, determine the difference of the very first time and the second time, the very first time It is the first efficient clock source time, the fiducial time that second time provides for the clock source at equipment current time, institute The clock source for stating equipment current time is in the multiple clock source.
Equipment can receive multiple clock sources, and equipment needs to be selected from multiple clock sources a clock source as clock source Fiducial time, different moment are provided, equipment is possible to the different clock source of selection and provides fiducial time.Equipment current time Clock source is also referred to as the clock source that equipment is used at current time.Wherein, clock of the fiducial time of equipment according to current time The temporal information that source is provided ceaselessly is changing.
S104, the difference between the very first time and the second time is defined as less than the first valid clock source of first threshold Clock source can be used.
S105, from available clock source determine equipment subsequent time clock source.
Clock source of the equipment in subsequent time is determined from available clock source, it is, determining equipment from available clock In the clock source that subsequent time is used.
In above-mentioned steps S101, the clock signal of the multiple clock sources to receiving is decoded, can be by multiple The clock signal of multiple clock sources of the mode that the symbol format that clock source is each exported is carried out to receiving is decoded.
Specifically, the head of code element, the tail of code element first to the respective output of multiple clock sources differentiate, to multiple The head of code element of the respective output of clock source, the tail of code element are determined after coming, to the code element of the respective output of multiple clock sources Each field is parsed, and is deposited during each field of the code element of the respective output of multiple clock sources then is corresponded into codec register Whether storage, the state of the code element of the respective output of the multiple clock sources required for finally confirming is complete, that is, required for judging to confirm All fields of respective output of multiple clock sources whether meet the requirements, if the respective output of required multiple clock sources 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, solution can be first determined whether The quality of the clock signal of the multiple clock sources after code success, that is, judge 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, so that Determine the first valid clock source.Specifically, each clock source in satisfactory clock source is measured respectively at the selected moment Time be each clock source in the 3rd time and satisfactory clock source selected moment later moment in time time i.e. the Four times, and by the difference between the 3rd time and the 4th time less than the 3rd threshold value clock source, be judged to 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)), will each satisfactory clock source time and the clock source of the clock signal at the selected moment Clock signal is measured in the time of the later moment in time at selected moment and compared, if the clock letter of each satisfactory clock source Number the selected moment time and should be with the clock signal of clock source between the time of the later moment in time at selected moment difference More than the 3rd threshold value, then judge that the clock source is inactive clock source, if the clock signal of each satisfactory clock source is in choosing Difference of the time and the clock signal of the clock source that timing is carved between the time of the later moment in time at selected moment is less than the 3rd Threshold value, then can determine that the clock source is valid clock source.
After the first valid clock source is determined from the clock source of successfully decoded, each first efficient clock can be directed to Source, determines the difference of the very first time and the second time, and the very first time is the first efficient clock source time, and the second time was to set The fiducial time that the clock source at standby current time is provided, the clock source at equipment current time is in the multiple clock source It is individual.
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 that current time is obtained in initialization provided in an embodiment of the present invention Method flow schematic diagram, as shown in Fig. 2 the method may include:
Time corresponding to S201, multiple effective second valid clock source that will be received is asked poor two-by-two.
S202, two the second valid clock sources for determining difference minimum.
S203, determine two priority of the second valid clock source.
S204, using the second valid clock source higher of priority in two the second valid clock sources as current time when Zhong Yuan.
Before above-mentioned steps S201, in addition it is also necessary to which the clock signal of the multiple clock sources to receiving is decoded, 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 the method flow shown in Fig. 2.
Situation one:Two clock sources
During initialization, in the case of two clock sources are all effective, according to the priority of clock source priority can be selected high Clock source as current time clock source.
For example, it is assumed that be respectively big dipper clock source and GPS clock source in the presence of two clock sources, and big dipper clock source is excellent First level 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 in initialization When, can using big dipper clock source as current time clock source.
Situation two:Multiple clock sources
During initialization, in the case of multiple clock sources are all effective, multiple valid clock sources are compared two-by-two first, Time that will be corresponding to multiple valid clock sources is asked poor two-by-two, and determines two minimum valid clock sources of difference, so Afterwards according to the priority of the two valid clock sources, and using the clock source higher of priority ratio in the two valid clock sources as The clock source at current time.
For example, it is assumed that big dipper clock source, GPS clock source, TOD source are respectively in the presence of three clock sources, and during GPS The highest priority of Zhong Yuan, the priority in big dipper clock source is taken second place, and the priority in TOD source is minimum, and it is further assumed that north Bucket clock source, GPS clock source, TOD source are valid clock source, and measure the temporal information that big dipper clock source obtains For:9 points of 9 seconds 9 milliseconds of nanoseconds of 9 microsecond 9 when 9;The measurement temporal information that obtains of GPS clock source is:9 points of 9 seconds 9 milliseconds of 9 microseconds when 9 39 nanoseconds;The temporal information that measurement TOD source obtains is:9 points of 9 seconds 9 milliseconds of nanoseconds of 9 microsecond 49 when 9.
Then the time corresponding to multiple valid clock sources is asked poor two-by-two, will be measured what big dipper clock source obtained Temporal information " 9 points of 9 seconds 9 milliseconds of nanoseconds of 9 microsecond 9 when 9 " with measurement GPS clock source obtain temporal information " when 99 points 9 seconds 9 milli The nanosecond of 9 microsecond 49 second " asks poor, obtains for 30 nanoseconds;To measure temporal information that big dipper clock source obtains " when 99 points 9 seconds 9 milliseconds 9 The temporal information " 9 points of 9 seconds 9 milliseconds of nanoseconds of 9 microsecond 49 when 9 " that the nanosecond of microsecond 9 " obtains with measurement TOD source asks poor, obtains 40 Nanosecond;Temporal information " 9 points of 9 seconds 9 milliseconds of nanoseconds of 9 microsecond 39 when 9 " and measurement TOD source that GPS clock source is obtained will be measured The temporal information " 9 points of 9 seconds 9 milliseconds of nanoseconds of 9 microsecond 49 when 9 " for obtaining asks poor, obtains for 10 nanoseconds.
When the temporal information " 9 points of 9 seconds 9 milliseconds of nanoseconds of 9 microsecond 39 when 9 " and measurement TOD that are obtained due to measurement GPS clock source Temporal information " 9 points of 9 seconds 9 milliseconds of nanoseconds of 9 microsecond 49 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 source is minimum, because This, using GPS clock source as current time clock source.
In above-mentioned steps S105, when the clock source of subsequent time is determined from available clock source, also in two kinds of situation, one Kind of situation is the clock source comprising current time in available clock source, and a kind of situation is not comprising current time in available clock source Clock source, introduced separately below.
Situation one:The clock source comprising 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 the difference between the second time whether be more than Second Threshold, if the temporal information of the clock source at current time It is more than Second Threshold with the difference between the second time, then according to the priority that can use clock source, reselects subsequent time Clock source, otherwise, keeps the clock source at current time constant.
During below by two specific examples in available 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 source, and GPS clock source in the presence of three clock sources Highest priority, the priority in big dipper clock source takes second place, and the priority in TOD 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 10 points of 10 seconds 0 millisecond of 0 microseconds 0 are received when the fiducial time that the GPS clock source at equipment current time is provided is 10 Second, and first threshold is assumed for 30ns, Second Threshold is 10ns.
It is further assumed that the valid clock source for now receiving is big dipper clock source, GPS clock source, TOD source, and The temporal information that measurement big dipper clock source obtains is:10 points of 10 seconds 0 millisecond of nanoseconds of 0 microsecond 05 when 10;Measurement GPS clock source is obtained Temporal information be:10 points of 10 seconds 0 millisecond of nanoseconds of 0 microsecond 9 when 10;The temporal information that measurement TOD source obtains is:10 when 10 Divide 10 seconds 10 milliseconds of nanoseconds of 10 microsecond 15.Then, by 10 points when measuring the temporal information 10 obtained by big dipper clock source 10 seconds 0 millis 10 points of 10 seconds 0 millisecond of nanoseconds of 0 microsecond 0 ask poor during fiducial time 10 current with equipment second nanosecond of 0 microsecond 05, obtain 5ns, due to 5ns is less than first threshold 30ns, therefore, using big dipper clock source as clock source can be used.
10 points of 10 seconds 0 millisecond of nanoseconds of 0 microsecond 9 when measuring the temporal information 10 obtained by GPS clock source are current with equipment Fiducial time 10 when 10 points of 10 seconds 0 millisecond of nanoseconds of 0 microsecond 0 ask poor, obtain 9ns, due to 9ns be less than first threshold 30ns, because This, using GPS clock source as clock source can be used.
10 points of 10 seconds 0 millisecond of nanoseconds of 0 microsecond 15 when measuring the temporal information 10 obtained by TOD source are current with equipment Fiducial time 10 when 10 points of 10 seconds 0 millisecond of nanoseconds of 0 microsecond 0 ask poor, obtain 15ns, due to 15ns be less than first threshold 30ns, Therefore, using TOD 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 source, and these three Can be with including local clock source GPS clock source in clock source.
It is further assumed that the next second when the fiducial time of equipment being 10 after 10 points of 10 seconds 0 millisecond of nanoseconds of 0 microsecond 0, Equipment current fiducial time is changed into 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 0 when 10, and assumes that the available clock source for receiving is Big dipper clock source, GPS clock source, TOD source, and measure the temporal information that big dipper clock source obtains and be:10 point 11 when 10 0 millisecond of 0 nanosecond of microsecond 11 of second;The measurement temporal information that obtains of GPS clock source is:10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 8 when 10; The temporal information that measurement TOD source obtains is:10 points of 11 seconds 10 milliseconds of nanoseconds of 10 microsecond 20 when 10,
Due to when equipment fiducial time being 10, during 10 points of 10 second 0 millisecond of 00 nanoseconds of microsecond, measurement GPS clock source is obtained 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 5 when temporal information is 10, and when the fiducial time of equipment being 10 10 points 10 seconds 0 millisecond 0 When next second after the nanosecond of microsecond 0 is 10 points of 11 second 0 millisecond of 00 nanoseconds of microsecond when equipment fiducial time being 10, GPS is measured 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 8 when the temporal information that clock source is obtained is 10, 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 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 source, and GPS clock source in the presence of three clock sources Highest priority, the priority in big dipper clock source takes second place, and the priority in TOD source is minimum, wherein, GPS clock source conduct Local clock source.
Assuming that 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 0 when equipment current fiducial time is 10, and assume that first threshold is 30ns, Second Threshold is 10ns.
It is further assumed that the valid clock source for now receiving is big dipper clock source, GPS clock source, TOD source, and The temporal information that measurement big dipper clock source obtains is:10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 011 when 10;Measurement GPS clock source is obtained To temporal information be:10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 8 when 10;The temporal information that measurement TOD source obtains is:When 10 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 20.
10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 011 and equipment during the temporal information 10 that then measurement big dipper clock source is obtained 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 0 ask poor during current fiducial time 10, obtain 11ns, because 11ns is less than first threshold 30ns, therefore, using big dipper clock source as clock source can be used.
10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 8 when measuring the temporal information 10 obtained by GPS clock source are current with equipment Fiducial time 10 when 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 0 ask poor, obtain 8ns, due to 8ns be less than first threshold 30ns, because This, using GPS clock source as clock source can be used.
It is by the temporal information measured obtained by TOD source:10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 20 and equipment when 10 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 0 ask poor during current fiducial time 10, obtain 2011ns, because 2011ns is less than the first threshold Value 30ns, therefore, using TOD 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 source, and these three Can be with including local clock source GPS clock source in clock source.
It is further assumed that the next second when the fiducial time of equipment being 10 after 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 0 sets Standby current fiducial time is changed into 10 points of 12 seconds 0 millisecond of nanoseconds of 0 microsecond 0 when 10, and assumes that the available clock source for receiving is north Bucket clock source, GPS clock source, TOD source, and measure the temporal information that big dipper clock source obtains and be:10 points 12 seconds 0 when 10 The millisecond nanosecond of 0 microsecond 5;The measurement temporal information that obtains of GPS clock source is:10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 22 when 10;Survey The temporal information that amount TOD source obtains is:10 points of 11 seconds 10 milliseconds of nanoseconds of 10 microsecond 9 when 10,
Due at 10 during 10 points of 11 second 0 millisecond of 00 nanoseconds of microsecond, when the temporal information that measurement GPS clock source is obtained is 10 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 8, and at 10 during 10 points of 12 second 0 millisecond of 00 nanoseconds of microsecond, measurement GPS clock source is obtained 10 points of 12 seconds 0 millisecond of nanoseconds of 0 microsecond 22 when temporal information is 10, therefore, GPS clock source is being selected the temporal information at moment and is being set Difference is between the temporal information of next second when standby fiducial time is 10 after 10 points of 11 seconds 0 millisecond of nanoseconds of 0 microsecond 0 14ns, and 14ns is more than Second Threshold 10ns, therefore, it is not possible to GPS clock source is continued the clock source as current time, and It is clock source that current time is selected from big dipper clock source and TOD source to need from remaining available clock source, and by In the priority of the priority higher than TOD source in big dipper clock source, therefore, big dipper clock source may be selected as current time Clock source, will the clock source at current time switch to big dipper clock source from GPS clock source.
Situation two:Can be with local source not be included in clock 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.
During below by a specific example to not including local clock source in available clock source, how to determine local Clock source carry out detailed explanation.
Assuming that in the presence of three clock source difference 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, NTP) clock source, and IRIG-B clock sources highest priority, clock synchronization compliant with precision time protocol source it is excellent First level is taken second place, and the priority of NTP clock sources is minimum, wherein, IRIG-B clock sources set as current time local clock source Standby current time uses IRIG-B clock sources to provide fiducial time as clock source..
Assuming that 11 points of 11 seconds 11 milliseconds of nanoseconds of 11 microsecond 11 when equipment current fiducial time is 11, and assume first threshold It is 5ns.
It is further assumed that the valid clock source for now receiving is IRIG-B clock sources, clock synchronization compliant with precision time protocol source, NTP clock sources, and And the temporal information that measurement IRIG-B clock sources are obtained is:11 points of 11 seconds 11 milliseconds of nanoseconds of 11 microsecond 18 when 11;Measurement clock synchronization compliant with precision time protocol The temporal information that source obtains is:11 points of 11 seconds 11 milliseconds of nanoseconds of 11 microsecond 15 when 11;The temporal information that measurement NTP clock sources are obtained For:11 points of 11 seconds 11 milliseconds of nanoseconds of 11 microsecond 10 when 11.
Then, 11 points of 11 seconds 11 milliseconds of 11 microseconds 18 are received during the temporal information 11 that the IRIG-B clock sources that will be measured are obtained 11 points of 11 seconds 11 milliseconds of nanoseconds of 11 microsecond 11 ask poor during second current with equipment fiducial time 11,7ns is obtained, because 7ns is more than First threshold 5ns, therefore, IRIG-B clock sources are unavailable clock source, i.e., local clock source is in this cycle can not Use clock source.
11 points when measuring the temporal information 11 obtained by clock synchronization compliant with precision time protocol source 11 seconds 11 milliseconds of nanoseconds of 11 microsecond 15 are worked as with equipment 11 points of 11 seconds 11 milliseconds of nanoseconds of 11 microsecond 11 ask poor during preceding fiducial time 11, obtain 4ns, because 4ns is less than first threshold 5ns, therefore, clock synchronization compliant with precision time protocol source is available clock source.
11 points when measuring the temporal information 11 obtained by NTP clock sources 11 seconds 11 milliseconds of nanoseconds of 11 microsecond 10 are worked as with equipment 11 points of 11 seconds 11 milliseconds of nanoseconds of 11 microsecond 11 ask poor during preceding fiducial time 11, obtain 1ns, because 1ns is less than first threshold 5ns, therefore, NTP clock sources are available clock source.
So far, two available clock sources are determined for 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 IRIG-B clock sources are unavailable clock source, therefore, the clock source at current time need to be cut Change, and due to the priority of the priority higher than NTP clock sources in clock synchronization compliant with precision time protocol source, therefore, using clock synchronization compliant with precision time protocol source as current time Clock source, will the clock source at current time switch to 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 is when local clock source is selected, first determine whether out effectively , then the very first time of valid clock source, respectively be compared with the second time by clock source, and the first of valid clock source When time is less than first threshold with the difference between the second time respectively, the valid clock source can be defined as available clock Source, then determines the clock source of subsequent time from available clock source, during due to by the very first time of valid clock source with second Between be combined judgement, the very first time and clock server current internal reference time of valid clock source will set up and close Connection, is not that the quality for being based only on clock signal selects local clock source, therefore, it is possible to improve clock server inside base The degree of accuracy of quasi- reference time.
Based on identical technology design, 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, the clock signal for the multiple clock sources to receiving is decoded;
Determining module 302, for determining the first valid clock source from the clock source of successfully decoded;
It is additionally operable to, for each first valid clock source, the difference of the very first time and the second time be determined, 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 in the multiple clock source;
Be additionally operable to by the difference between the very first time and second time less than first threshold first it is effective when Zhong Yuan is defined as available clock source;
Selecting module 303, for from it is described can be with determining the local clock source in clock source.
Preferably, selecting module 303, specifically for:
The local clock source be included in it is described can with 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, then the priority of clock source can be used according to described, redefines this The clock source on ground;Otherwise, then keep local clock source constant.
Preferably, selecting module 303, is additionally operable to:
Local clock source be not included in it is described can with clock source when, then according to it is described can be with clock source it is preferential Level, redefines local clock source.
Preferably, determining the local clock source in initialization in the following manner:
The time corresponding to multiple effective second valid clock source that will be received is asked poor two-by-two, and determines the time Two minimum the second valid clock sources of difference;
Determine the priority of described two second valid clock sources;
Using the second valid clock source higher of priority in described two clock sources as local clock source.
Preferably, determining module 302, specifically for:
Measure the 3rd time and the 4th time of each clock source in the clock source of the successfully decoded 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;
Clock source by the difference between the 3rd time and the 4th time less than the 3rd threshold value, is judged to first Valid clock source.
To sum up, a kind of system of selection of clock source provided in an embodiment of the present invention and clock server, including:To receiving The clock signal of multiple clock sources decoded;The first valid clock source is determined from the clock source of successfully decoded;For every Individual first valid clock source, determines the difference between the very first time of first valid clock source and the second local time, Second time is equipment current fiducial time, and local clock source is in the multiple clock source;Will be described Difference between the very first time and second time is defined as available clock source less than the first valid clock source of first threshold; From described with the clock source that subsequent time is determined in clock source, it can be seen that the embodiment of the present invention is in selection subsequent time During clock source, valid clock source is first determined whether out, then compared the very first time of valid clock source with the second time respectively Compared with, and when the very first time of valid clock source first threshold is less than with the difference between the second time respectively, this can be had Effect clock source is defined 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 very first time of Zhong Yuan and the second time are combined judgement, will valid clock source the very first time it is current with clock server The internal reference time set up association, be not that the quality for being based only on clock signal selects local clock source, therefore, it is possible to Improve the degree of accuracy of clock server internal reference reference time.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method or computer program product. Therefore, the present invention can be using the embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Form.And, the present invention can be used to be can use in one or more computers for wherein including computer usable program code and deposited The shape of 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 is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product Figure and/or block diagram are described.It should be understood that every first-class during flow chart and/or block diagram can be realized by computer program instructions The combination of flow and/or square frame in journey and/or square frame and flow chart and/or block diagram.These computer programs can be provided The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced for reality by the instruction of computer or the computing device of other programmable data processing devices The device of the function of being specified in present one flow of flow chart or multiple one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in can guide computer or other programmable data processing devices with spy In determining the computer-readable memory that mode works so that instruction of the storage in the computer-readable memory is produced and include finger Make the manufacture of device, the command device realize in one flow of flow chart or multiple one square frame of flow and/or block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented treatment, so as in computer or The instruction performed 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 individual square frame or multiple square frames.
, but those skilled in the art once know basic creation although preferred embodiments of the present invention have been described Property concept, then can make other change and modification to these embodiments.So, appended claims are intended to be construed to include excellent Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification without deviating from essence of the invention to the present invention God and scope.So, if these modifications of the invention and modification belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising these changes and modification.

Claims (10)

1. a kind of system of selection of clock source, it is characterised in that including:
The clock signal of the multiple clock sources to receiving is decoded;
The first valid clock source is determined from the clock source of successfully decoded;
For each the first valid clock source, the difference of the very first time and the second time is determined, the very first time is described the One efficient clock source time, the fiducial time that second time provides for the clock source at equipment current time, the equipment is worked as The clock source at preceding moment is in the multiple clock source;
Difference between the very first time and second time is defined as less than the first valid clock source of first threshold Clock source can be used;
The clock source that the equipment subsequent time is determined in clock source can be used from described.
2. the method for claim 1, it is characterised in that it is described from it is described can be with determining that the equipment is next in clock source The clock source at moment, including:
If the clock source at current time be included in it is described can be with clock source, 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, then according to it is described can be with clock source it is preferential Level, 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, it is characterised in that also include:
If the clock source at current time can use the priority of clock source with clock source described in being not included according to described, Redefine the clock source of subsequent time.
4. the method for claim 1, it is characterised in that determine in the following manner the equipment in initialization when Zhong Yuan:
The time corresponding to multiple effective second valid clock source that will be 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 the second valid clock source higher of priority in described two clock sources as the equipment in initialization Source.
5. the method as described in any one of Claims 1 to 4, it is characterised in that determine in the clock source from successfully decoded First valid clock source, including:
The 3rd time and the 4th time of each clock source in the clock source of the successfully decoded are measured respectively, when the described 3rd 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;
Clock source by the difference between the 3rd time and the 4th time less than the 3rd threshold value, is judged to that first is effective Clock source.
6. a kind of clock server, it is characterised in that including:
Decoder module, the clock signal for the multiple clock sources to receiving is decoded;
Determining module, for determining the first valid clock source from the clock source of successfully decoded;
It is additionally operable to for each first valid clock source, determine the difference of the very first time and the second time, the very first time is The first efficient clock source time, it is the fiducial time that second time provides for the clock source at equipment current time, described The clock source at equipment current time is in the multiple clock source;
It is additionally operable to the first valid clock source less than first threshold by the difference between the very first time and second time It is defined as available clock source;
Selecting module, for the clock source that the clock server subsequent time is determined in clock source can be used from described.
7. clock server as claimed in claim 6, it is characterised in that the selecting module, specifically for:
Clock source at current time be included in it is described can with clock source when, 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, then according to it is described can be with clock source it is preferential Level, redefines the clock source of subsequent time;Otherwise, keep the clock source of last moment constant in subsequent time.
8. clock server as claimed in claim 7, it is characterised in that the selecting module, is additionally operable to:
Clock source at current time be not included in it is described can with clock source when, then according to it is described can be with clock source it is preferential Level, redefines the clock source of subsequent time.
9. clock server as claimed in claim 6, it is characterised in that determine the equipment in initialization in the following manner When clock source:
The time corresponding to multiple effective second valid clock source that will be 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 the second valid clock source higher of priority in described two clock sources as the equipment in initialization Source.
10. the clock server as described in any one of claim 6~9, it is characterised in that the determining module, specifically for:
The 3rd time and the 4th time of each clock source in the clock source of the successfully decoded are measured respectively, when the described 3rd 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;
Clock source by the difference between the 3rd time and the 4th time less than the 3rd threshold value, is judged to that first is effective Clock source.
CN201611264202.2A 2016-12-31 2016-12-31 A kind of selection method and clock server of clock source Active CN106685566B (en)

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 true CN106685566A (en) 2017-05-17
CN106685566B 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)

Cited By (6)

* Cited by examiner, † Cited by third party
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
CN114723078A (en) * 2022-03-17 2022-07-08 中核检修有限公司 Fault diagnosis method and device, terminal equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
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
CN101860430A (en) * 2010-06-24 2010-10-13 中兴通讯股份有限公司 Device and method for implementing optical network unit switching clock source
CN103051439A (en) * 2011-10-14 2013-04-17 中兴通讯股份有限公司 Method and device for selecting clock source

Patent Citations (4)

* Cited by examiner, † Cited by third party
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
CN101860430A (en) * 2010-06-24 2010-10-13 中兴通讯股份有限公司 Device and method for implementing optical network unit switching clock source
CN103051439A (en) * 2011-10-14 2013-04-17 中兴通讯股份有限公司 Method and device for selecting clock source

Cited By (6)

* Cited by examiner, † Cited by third party
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
CN114723078A (en) * 2022-03-17 2022-07-08 中核检修有限公司 Fault diagnosis method and device, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN106685566B (en) 2018-10-02

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
CN107026702A (en) The punctual method and apparatus of high accuracy
CN109525351A (en) A kind of equipment for realizing time synchronization with time reference station
US7373250B2 (en) AGPS module time synchronization method and device using system time information in mobile terminal
CN109085616A (en) A kind of satellite timing method, device and storage medium
CN104393981B (en) The time labeling method and system of a kind of multichannel measurement data parallel
CN107528654A (en) It is a kind of based on 1588 method for synchronizing time and device
CN110875818A (en) Clock synchronization method, device, system, storage medium and electronic device
CN110417503A (en) A kind of method and digital communication equipment for test clock network delay
CN102388556A (en) Method for clockclass grading and relative deivce
KR20110135578A (en) Method for tracking boc signal and system thereof
JP5261714B2 (en) High-precision time synchronization apparatus, high-precision time synchronization method, and program
CN112865903B (en) Method for synchronizing network equipment and network equipment
CN104935394A (en) Time signal generator and time tester
CN109343332A (en) Time dissemination system based on Big Dipper satellite signal
CN201185428Y (en) Time synthesis measuring instrument
CN206564608U (en) A kind of clock service module
CN204697070U (en) Time signal generator and time tester
JP2009025028A (en) Positioning system
CN112511255B (en) Time synchronization method and device
CN109856594B (en) Multi-path controllable time delay signal generating device for passive positioning of time difference measuring system
CN105717516A (en) Global navigation satellite system (GNSS) data synchronization method and method
CN113703013B (en) Signal processing method, device, system and computer readable storage medium

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