CN110278049A - A kind of method for synchronizing time and system - Google Patents

A kind of method for synchronizing time and system Download PDF

Info

Publication number
CN110278049A
CN110278049A CN201910608165.XA CN201910608165A CN110278049A CN 110278049 A CN110278049 A CN 110278049A CN 201910608165 A CN201910608165 A CN 201910608165A CN 110278049 A CN110278049 A CN 110278049A
Authority
CN
China
Prior art keywords
time
trip delay
round
original
fitting
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
CN201910608165.XA
Other languages
Chinese (zh)
Other versions
CN110278049B (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.)
GUIZHOU PROVINCE INSTITUTE OF MEASUREMENT
Original Assignee
GUIZHOU PROVINCE INSTITUTE OF MEASUREMENT
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 GUIZHOU PROVINCE INSTITUTE OF MEASUREMENT filed Critical GUIZHOU PROVINCE INSTITUTE OF MEASUREMENT
Priority to CN201910608165.XA priority Critical patent/CN110278049B/en
Publication of CN110278049A publication Critical patent/CN110278049A/en
Application granted granted Critical
Publication of CN110278049B publication Critical patent/CN110278049B/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
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • 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/0682Clock or time synchronisation in a network by delay compensation, e.g. by compensation of propagation delay or variations thereof, by ranging

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)
  • Electric Clocks (AREA)

Abstract

The invention discloses a kind of method for synchronizing time and systems.The method for synchronizing time includes: to obtain original communication round-trip delay data;The original communication round-trip delay data include original round trip delay time and original time deviation, and the original round trip delay time and the original time deviation correspond;The original communication round-trip delay data are fitted, the communication round-trip delay data after determining fit slope and fitting;Communication round-trip delay data after the fitting include the round trip delay time after fitting and the time deviation after fitting;According to the communication round-trip delay data and the synchronous local zone time of the original communication round-trip delay data after the fitting.Network time service precision and timing tracking accuracy can be improved using method for synchronizing time provided by the present invention and system.

Description

A kind of method for synchronizing time and system
Technical field
The present invention relates to the communications fields, more particularly to a kind of method for synchronizing time and system.
Background technique
Network Time Protocol (Network Time Protocol, NTP), is very widely used in current internet Time synchronization protocol, it was proposed by the D.L.Mills professor of Delaware university, the U.S. in 1985 earliest, and was designed and real Existing, clock is synchronous the purpose is to being carried out by local computer with clock source, improves the precision of local zone time to make the world Different machinery compartments can maintain unified, standard a time on internet, to operate in a variety of and extensive distributed network System in network environment distributes accurate and reliable temporal information.
Network time synchronization technology is weeded out the old and bring forth the new constantly.The Time synchronization technique of early stage needs to set up dedicated network Each system provides service, higher cost.Network Time Protocol in addition to can by the time unification of equipment each in network a to time, This time can be absolute time (such as UTC Universal Time Coordinated (Universal Time Coordinated, UTC)) or phase To time (time of certain host in network), package outside the round-trip delay on network can also be estimated, and independently estimate Computer clock deviation, to realize at the high accurancy and precision computer school on network, it is to be designed on internet Different machines is set to maintain a kind of communications protocol of same time.
In March, 1992, NTP/v3 comes out, which summarizes and combine NTP previous version and DTSS, formally introduces Calibration principle, and the algorithm of clock selecting and clock filtering is improved, and also introduce the broadcast mode of time message transmission, Previous version of this version instead of NTP;The critical function that NTP is realized is the clock tune to computer operating system It is whole;While NTP/v3 is studied and is released, keep the research of function also simultaneously in relation to improving the time in operating system kernel It carries out capablely;It is proposed within 1994 [RFC 1589], i.e. the core schema of chronometer time holding, this realization can be computer The time accuracy of operating system is maintained at the microsecond order of magnitude;Almost simultaneously, NTP/v4 recommendation on improvement is had also been proposed;To it is local when The improvement of clock adjustment algorithm, communication pattern, new clock driver and adaptation rule etc. describes specific direction.
The NTP/v4 in research and test will be suitable for IPV6, improve clock models now, in various synchronisation sources and network Frequency and time are more accurately predicted and adjusted in the case where access, propose that corresponding new algorithm will reduce network jitter and oscillation Device drift conflict, and by accelerate originate when time synchronization convergence rate, redesign work in frequency locking ring and phaselocked loop Or both clock correction algorithm in composite mode;To also provide about automatically configure, reliability, reduce internet telephone traffic With the new features of Strengthens network safety authentication etc..
NTP final purpose is by the time synchronization of each computer to UTC, and the message of Network Time Protocol is by TCP/IP UDP mode is transmitted, port 123.
Assuming that used time client location is for A, NTP server-side location for B, generates to A the inquiry of standard NTP information It wraps and passes through network with being sent to B, be T at the time of when transmission1, receive to B after packet through network with returning to A, receive to B Moment T2, the return information packet time is T3, T2And T3Moment is all placed in temporal information packet, receives to A the time information packet on the ground B For T4, Fig. 1 is Network Time Protocol schematic diagram provided by the present invention, as shown in Figure 1.
According to Network Time Protocol principle, can calculate NTP message the two places A, B round trip delay time R and A relative to B Time deviation D.
R=(T4-T1)-(T3-T2)=tab+tba (1)
Wherein, T1, T2, T3And T4For time point, tabFor the delay of A to B, tbaFor the delay of B to A, A according to formula (2) Obtained time deviation D, compensates local zone time, to realize the time synchronization with the ground B.
For data during wide area network transmission, round-trip link is i.e. t in symmetrical situationab=tba, then formula (2) can be accurate Time deviation is calculated, but in practical applications, the round-trip link under wan environment is mostly that double-fiber is two-way, and there are communication links Asymmetric situation, tab≠tba, it is only estimated value using the calculated time deviation of calculation method of formula (2) therefore, and easily By tba-tabInfluence, cause network time service precision low, timing tracking accuracy is low.
Summary of the invention
The object of the present invention is to provide a kind of method for synchronizing time and systems, to solve the communication link under wan environment Asymmetry causes network time service precision low, causes the problem that timing tracking accuracy is low.
To achieve the above object, the present invention provides following schemes:
A kind of method for synchronizing time, comprising:
Obtain original communication round-trip delay data;The original communication round-trip delay data include original round trip delay time And original time deviation, the original round trip delay time and the original time deviation correspond;
The original communication round-trip delay data are fitted, the communication after determining fit slope and fitting is prolonged back and forth Slow data;Communication round-trip delay data after the fitting include the round trip delay time after fitting and time after fitting it is inclined Difference;
According to after the fitting communication round-trip delay data and the original communication round-trip delay data synchronize local Time.
Optionally, described that the original communication round-trip delay data are fitted, after determining fit slope and fitting Communication round-trip delay data, specifically include:
The original communication round-trip delay data are fitted using least square method, determine fit slope and fitting Communication round-trip delay data afterwards.
Optionally, the communication round-trip delay data according to after the fitting and the original communication round-trip delay number According to synchronous local zone time, specifically include:
The midrange of the communication round-trip delay data after fitting is determined according to the communication round-trip delay data after the fitting;
Judge whether the absolute value of the fit slope is greater than slope threshold value, obtains the first judging result;
If the absolute value that first judging result is expressed as the fit slope is greater than slope threshold value, original communication is obtained The smallest original round trip delay time in round-trip delay data, and by original corresponding to the smallest original round trip delay time Beginning time deviation determines the time deviation of current standard time and local zone time, synchronous local zone time;
If first judging result is expressed as the absolute value of the fit slope no more than slope threshold value, according to described quasi- The midrange of communication round-trip delay data after conjunction and the original communication round-trip delay data determine current standard time with The time deviation of local zone time, synchronous local zone time.
Optionally, described past according to the midrange of the communication round-trip delay data after the fitting and the original communication The time deviation that delayed data determines current standard time and local zone time is returned, synchronous local zone time specifically includes:
The midrange of time deviation after being fitted in the midrange of communication round-trip delay data after obtaining the fitting;
The midrange of time deviation after calculating the fitting and each described original time offset determination time deviation Difference;
Minimum time deviation difference is determined according to the time deviation difference;
Using original time deviation corresponding to the minimum time deviation difference as current standard time and local zone time Time deviation, synchronous local zone time.
A kind of clock synchronization system, comprising:
Original communication round-trip delay data acquisition module, for obtaining original communication round-trip delay data;It is described original logical Letter round-trip delay data include original round trip delay time and original time deviation, the original round trip delay time with it is described Original time deviation corresponds;
Fitting module determines fit slope and fitting for being fitted to the original communication round-trip delay data Communication round-trip delay data afterwards;Communication round-trip delay data after the fitting include fitting after round trip delay time and Time deviation after fitting;
Synchronization module, for according to the communication round-trip delay data and the original communication round-trip delay after the fitting Data synchronize local zone time.
Optionally, the fitting module specifically includes:
Fitting unit is determined quasi- for being fitted using least square method to the original communication round-trip delay data Communication round-trip delay data after closing slope and fitting.
Optionally, the synchronization module specifically includes:
Midrange determination unit, for determining that the communication after fitting is past according to the communication round-trip delay data after the fitting Return the midrange of delayed data;
First judging unit obtains first and sentences for judging whether the absolute value of the fit slope is greater than slope threshold value Disconnected result;
First synchronization unit, if the absolute value for first judging result to be expressed as the fit slope is greater than slope Threshold value obtains the smallest original round trip delay time in original communication round-trip delay data, and will be described the smallest original round-trip Original time deviation corresponding to delay time determines the time deviation of current standard time and local zone time, when synchronizing local Between;
Second synchronization unit, if being expressed as the absolute value of the fit slope no more than oblique for first judging result Rate threshold value, it is true according to the midrange of the communication round-trip delay data after the fitting and the original communication round-trip delay data Determine the time deviation of current standard time and local zone time, synchronous local zone time.
Optionally, second synchronization unit specifically includes:
The midrange of time deviation obtains subelement, for obtaining the midpoint of the communication round-trip delay data after the fitting The midrange of time deviation after being fitted in value;
Time deviation difference determines subelement, for calculating midrange and each institute of the time deviation after the fitting State original time offset determination time deviation difference;
Minimum time deviation difference determines subelement, for determining that minimum time deviation is poor according to the time deviation difference Value;
Synchronous subelement, for using original time deviation corresponding to the minimum time deviation difference as Current standards The time deviation of time and local zone time, synchronous local zone time.
The specific embodiment provided according to the present invention, the invention discloses following technical effects: the present invention provides one kind Method for synchronizing time and system, by being fitted processing to communication round-trip delay data, the communication after being fitted is prolonged back and forth Slow data, thus according to communication round-trip delay data and original communication round-trip delay data synchronization sheet after the fitting The ground time reduces the influence of delay, and then being capable of accurate synchronization local zone time, raising network time service precision and time synchronization essence Degree.
Detailed description of the invention
It in order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, below will be to institute in embodiment Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is Network Time Protocol schematic diagram provided by the present invention;
Fig. 2 is method for synchronizing time flow chart provided by the present invention;
Fig. 3 is improvement filtering algorithm flow chart provided by the present invention;
Fig. 4 is clock synchronization system structure chart provided by the present invention;
Fig. 5 is the relational graph of time deviation provided by the present invention and round-trip delay;
Fig. 6 is time deviation best estimate distribution map provided by the present invention;
Fig. 7 is method for synchronizing time provided by the present invention and traditional filtering method time synchronization comparative result figure;
Fig. 8 is entity hardware system master-plan block diagram provided by the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The object of the present invention is to provide a kind of method for synchronizing time and systems, can be improved network time service precision and time Synchronization accuracy.
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real Applying mode, the present invention is described in further detail.
Fig. 2 is method for synchronizing time flow chart provided by the present invention, as shown in Fig. 2, a kind of method for synchronizing time, packet It includes:
Step 201: obtaining original communication round-trip delay data;The original communication round-trip delay data include original round-trip Delay time and original time deviation, the original round trip delay time and the original time deviation correspond.
Step 202: the original communication round-trip delay data are fitted, it is logical after determining fit slope and being fitted Believe round-trip delay data;Communication round-trip delay data after the fitting include fitting after round trip delay time and fitting after Time deviation.
The step 202 specifically includes: the original communication round-trip delay data is fitted using least square method, Communication round-trip delay data after determining fit slope and fitting.
Step 203: according to the communication round-trip delay data and the original communication round-trip delay data after the fitting Synchronous local zone time.
The step 203 specifically includes: determining the communication after fitting according to the communication round-trip delay data after the fitting The midrange of round-trip delay data;Judge whether the absolute value of the fit slope is greater than slope threshold value, if so, obtaining original logical Believe the smallest original round trip delay time in round-trip delay data, and will be corresponding to the smallest original round trip delay time Original time deviation determines the time deviation of current standard time and local zone time, synchronous local zone time;If it is not, according to described quasi- The midrange of communication round-trip delay data after conjunction and the original communication round-trip delay data determine current standard time with The time deviation of local zone time, synchronous local zone time.
The midrange according to the communication round-trip delay data after the fitting and the original communication round-trip delay Data determine the time deviation of current standard time and local zone time, and synchronous local zone time specifically includes: after obtaining the fitting Communication round-trip delay data midrange in be fitted after time deviation midrange;Time deviation after calculating the fitting Midrange and each described original time offset determination time deviation difference;It is determined according to the time deviation difference minimum Time deviation difference;Using original time deviation corresponding to the minimum time deviation difference as current standard time and local The time deviation of time, synchronous local zone time.
It is improved for the current filtering algorithm problem, Fig. 3 is improvement filtering algorithm stream provided by the present invention Cheng Tu, as shown in figure 3, steps are as follows:
Subsynchronous (R is obtained according to 8i, Di), i=1,2 ..., 8;Wherein, RiFor round trip delay time, DiFor the time Deviation;
Least square method is fitted, and obtains fit slope K;
If slope threshold value α, by K compared with α;
When | K |≤α takes the midrange (R after being fittedm, Dm), by DmRespectively with Di(i=i | 1≤i≤8, i ∈ N }) ratio Compared with obtaining DminFor DiWith DmDiffer the smallest Di;RmFor the midrange of the round trip delay time after fitting, DmFor fitting after when Between deviation midrange;
When | K | > α takes minimum round-trip delay RminCorresponding time deviation DiAs minimum time deviation Dmin
By DminDeviation data as final synchronous local zone time.
Fig. 4 is clock synchronization system structure chart provided by the present invention, as shown in figure 4, a kind of clock synchronization system, packet It includes:
Original communication round-trip delay data acquisition module 401 is used for original communication round-trip delay data acquisition module, is used for Obtain original communication round-trip delay data;The original communication round-trip delay data include original round trip delay time and original Time deviation, the original round trip delay time and the original time deviation correspond.
Fitting module 402, for being fitted, determining fit slope and intending to the original communication round-trip delay data Communication round-trip delay data after conjunction;Communication round-trip delay data after the fitting include fitting after round trip delay time with And the time deviation after fitting.
The fitting module 402 specifically includes: fitting unit, for round-trip to the original communication using least square method Delayed data is fitted, the communication round-trip delay data after determining fit slope and fitting.
Synchronization module 403, for according to after the fitting communication round-trip delay data and the original communication it is round-trip Delayed data synchronizes local zone time.
The synchronization module 403 specifically includes: midrange determination unit, for being prolonged back and forth according to the communication after the fitting Slow data determine the midrange of the communication round-trip delay data after fitting;First judging unit, for judging the fit slope Absolute value whether be greater than slope threshold value, obtain the first judging result;First synchronization unit, if being used for first judging result The absolute value for being expressed as the fit slope is greater than slope threshold value, obtains the smallest original past in original communication round-trip delay data Delay time is returned, and original time deviation corresponding to the smallest original round trip delay time is determined into current standard time With the time deviation of local zone time, synchronous local zone time;Second synchronization unit, if being expressed as institute for first judging result The absolute value of fit slope is stated no more than slope threshold value, according to the midrange of the communication round-trip delay data after the fitting and The original communication round-trip delay data determine the time deviation of current standard time and local zone time, synchronous local zone time.
Second synchronization unit specifically includes: the midrange of time deviation obtains subelement, for obtaining the fitting The midrange of time deviation after being fitted in the midrange of communication round-trip delay data afterwards;Time deviation difference determines that son is single Member, the midrange and each described original time offset determination time deviation for calculating the time deviation after the fitting are poor Value;Minimum time deviation difference determines subelement, for determining minimum time deviation difference according to the time deviation difference;Together Step unit, for using original time deviation corresponding to the minimum time deviation difference as current standard time and local The time deviation of time, synchronous local zone time.
Round-trip delay and time deviation data in one week are acquired by Network Time Protocol principle, sampling interval 1s generates scatterplot Figure is as shown in figure 5, only acquire data, asynchronous local zone time.
By in Fig. 5 it is found that time deviation is in minimum round-trip delay R after multiple repairing weldminPlace is 10.66ms, and round-trip delay is most The small corresponding time deviation of point can be used as Best Times estimation of deviation value.
But it only acquires 8 times, synchronized result susceptible, take continuous 8 points in Fig. 5 and draws scattered in practical applications Point diagram is as shown in Figure 6.
According to the experiment of Fig. 5, time deviation should level off to 10.66ms, and the time deviation 12.06ms of A point is not most in Fig. 6 8 points are fitted, slope K=0.21 by good estimated value even if the round-trip delay of the point is minimum with least square method, if α= 0.25, then K≤α meets condition, acquire midpoint C time deviation be 10.96ms, compared with other each points after, the time of B point is inclined Poor 10.81ms is best estimate, then in final synchronization, using the time deviation of B point, rather than A point.
Minimum delay method is respectively adopted and improves the time synchronization result of filtering algorithm as shown in fig. 7, using the minimum delay The filtered time deviation average value of method is 19.32ms;Use the time deviation average value for improving filtering algorithm for 16.70ms.
Use the filtered time deviation average value of minimum delay method for 19.32ms;Using the time for improving filtering algorithm Deviation average is 16.70ms, the time synchronization result that improved NTP filtering algorithm obtains 2.62ms preceding better than improvement, Network time service precision can be improved under wan environment, reduce influence of the communication link asymmetry to time synchronized result.
Method for synchronizing time provided by the present invention and system are mainly for following problems:
1) parking lot time counting toll collection system internal clocking stability is poor, and non-real-time synchronization and traces to the source in real time to UTC (NIM), it can not synchronize under no internet environment or in the case that wired connection disconnects, can not be measured if directly acquiring the time of GPS Biography is traced to the source, and there are security risks;And the time for using computer, there is also drift, time integral problems.
2) the problem of parking lot is by real-time monitoring, cannot prevent parking lot operation personnel from modifying chronometric data, and it is produced Raw a large amount of commercially valuable data are idle, cannot be provided for government department and related enterprise and institution data mining with The powerful support of big data analysis.It needs its temporal information and other Fare determined by travel time information being uploaded to cloud big data platform.
3) Network Time Protocol is directed to the asymmetric problem of the round-trip link of data packet at present, using the filtering algorithm of minimum delay method Carry out the time deviation of approximate estimation two places, which carries out 8 Network Time Protocol interactive processes (asynchronous local zone time) first, obtains To the data (Ri, Di) of 8 groups of round-trip delay R and time deviation D, i=i | and 1≤i≤8, i ∈ N }, then take past in 8 groups of data Return the smallest one group of data (Rmin, Di) of delay, data of the corresponding time deviation as final synchronous local zone time;The calculation The data obtained on law theory are more, and final time deviation estimated value is more ideal, but in practical applications, filter through 8 groups of data The time deviation that wave obtains not exclusively is theoretic optimum value, while considering the stability and drift of local clock, should not be adopted Collect more data to be filtered and synchronize again.
Method for synchronizing time provided by the present invention and system can be used for entity hardware system, which uses STM32F103ZET6 transplants μ C/OS real time operating system as micro-control unit (Microcontroller Unit, MCU) With lightweight Internet protocol (Light Weight Internet Protocol, LWIP), by Network Time Protocol by local zone time Zone time standard is synchronized to (to have traced to the source to atomic time scale national measurement benchmark UTC (NIM)), data interaction is wirelessly moved using 4G Dynamic communication mode;After system and standard time synchronously complete, temporal information can be passed by RS232, RS485 and RJ-45 interface Terminal time service software is passed, the time of parking lot time counting toll collection system is changed by terminal time service software, while parking lot being counted When charging system temporal information and deviation return to the system, information is shown on the lcd screen and is uploaded to supervision by system Platform, overall system design block diagram are as shown in Figure 8.
Micro-control unit, using the STM32F103ZET6 single-chip microcontroller of 32 ARM Cortex-M3 kernels, external 8MHz is brilliant Vibration, up to 72MHz working frequency after frequency multiplication;512kB flash memory in piece;Operating voltage is 2.0V~3.6V;Inside branch Real-time clock (Real Time Clock, RTC) function is held, external button cell power supply and 32.768kHz crystal oscillator is cooperated to realize Tally function when electric.Its speed of service is fast, portable operating system, at low cost and have the features such as RTC function.
4G wireless communication module is communicated using 4G wireless communication module with ntp server and supervising platform, feature It is that transmission rate is fast, is delayed low, parking lot can also carry out time synchronization in the case where no linking Internet, while simplify survey Amount and synchronization program, it is more convenient to the switching in measurement place.The module is powered with 5V, by RS232 interface with The serial ports of STM32F103ZET6 interconnects, and realizes the transparent transmission for sending and receiving data.
Power module, system use lithium battery mobile power or external cable power to provide 5V voltage for it, are all the way 4G Wireless communication module provide 5V power supply, another way by AMS-1117 voltage stabilizing chip output 3.3V be supplied to MCU, display screen and its His interface chip.By TP4056 chip and charge protector, the safe charging to lithium battery is realized, while making the system Can not use mains-supplied, it is portable the features such as, with detection and synchronous demand, quickly and easily progress place switching.
Interface circuit, interface circuit include RS232, RS485 and RJ-45 interface, the standard time transmitting after synchronizing Parking lot time counting toll collection system is given, wherein RS232 interface uses SP3232 chip, realizes the Transistor-Transistor Logic level and RS232 level of 3.3V The bi-directional conversion of (negative logic);RS485 interface uses SP3485 chip, realizes the Transistor-Transistor Logic level and RS485 level (difference of 3.3V Signal) bi-directional conversion;RJ-45 interface uses DM9000 chip, the programming of cooperation micro-control unit, RJ-45 interface and periphery electricity Road realize with the communication of parking lot time counting toll collection system Ethernet interface, the chip be equivalent to realize in TCP/IP physical layer and The function of media access control layer.
Display screen, using 4.3 cun of capacitive touch screens, realize electricity show, local zone time, local zone time and standard time The data such as deviation, the deviation of local zone time and parking lot time counting toll collection system time and current time sync interval continuous brush Newly, the setting of time synchronization interval is carried out simultaneously also by touch screen, the synchronous and IP setting uploaded and other function are arranged.
Method for synchronizing time provided by the present invention and system optimization are filtered the time deviation estimated value obtained, when raising Between synchronization accuracy.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part It is bright.
Used herein a specific example illustrates the principle and implementation of the invention, and above embodiments are said It is bright to be merely used to help understand method and its core concept of the invention;At the same time, for those skilled in the art, foundation Thought of the invention, there will be changes in the specific implementation manner and application range.In conclusion the content of the present specification is not It is interpreted as limitation of the present invention.

Claims (8)

1. a kind of method for synchronizing time characterized by comprising
Obtain original communication round-trip delay data;The original communication round-trip delay data include original round trip delay time and Original time deviation, the original round trip delay time and the original time deviation correspond;
The original communication round-trip delay data are fitted, the communication round-trip delay number after determining fit slope and fitting According to;Communication round-trip delay data after the fitting include the round trip delay time after fitting and the time deviation after fitting;
According to the communication round-trip delay data and the synchronous local zone time of the original communication round-trip delay data after the fitting.
2. method for synchronizing time according to claim 1, which is characterized in that described to the original communication round-trip delay number According to being fitted, determine fit slope and fitting after communication round-trip delay data, specifically include:
The original communication round-trip delay data are fitted using least square method, after determining fit slope and fitting Communicate round-trip delay data.
3. method for synchronizing time according to claim 2, which is characterized in that described round-trip according to the communication after the fitting Delayed data and the synchronous local zone time of the original communication round-trip delay data, specifically include:
The midrange of the communication round-trip delay data after fitting is determined according to the communication round-trip delay data after the fitting;
Judge whether the absolute value of the fit slope is greater than slope threshold value, obtains the first judging result;
If the absolute value that first judging result is expressed as the fit slope is greater than slope threshold value, it is round-trip to obtain original communication The smallest original round trip delay time in delayed data, and will be original corresponding to the smallest original round trip delay time when Between deviation determine the time deviation of current standard time and local zone time, synchronous local zone time;
If first judging result is expressed as the absolute value of the fit slope no more than slope threshold value, after the fitting Communication round-trip delay data midrange and the original communication round-trip delay data determine current standard time and local The time deviation of time, synchronous local zone time.
4. method for synchronizing time according to claim 3, which is characterized in that described round-trip according to the communication after the fitting The midrange of delayed data and the original communication round-trip delay data determine the time of current standard time and local zone time Deviation, synchronous local zone time, specifically includes:
The midrange of time deviation after being fitted in the midrange of communication round-trip delay data after obtaining the fitting;
The midrange of time deviation after calculating the fitting and each described original time offset determination time deviation difference;
Minimum time deviation difference is determined according to the time deviation difference;
Using original time deviation corresponding to the minimum time deviation difference as current standard time and local zone time when Between deviation, synchronous local zone time.
5. a kind of clock synchronization system characterized by comprising
Original communication round-trip delay data acquisition module, for obtaining original communication round-trip delay data;The original communication is past Returning delayed data includes original round trip delay time and original time deviation, the original round trip delay time with it is described original Time deviation corresponds;
Fitting module, for being fitted to the original communication round-trip delay data, after determining fit slope and fitting Communicate round-trip delay data;Communication round-trip delay data after the fitting include the round trip delay time and fitting after fitting Time deviation afterwards;
Synchronization module, for according to the communication round-trip delay data and the original communication round-trip delay data after the fitting Synchronous local zone time.
6. clock synchronization system according to claim 5, which is characterized in that the fitting module specifically includes:
Fitting unit determines that fitting is oblique for being fitted using least square method to the original communication round-trip delay data Communication round-trip delay data after rate and fitting.
7. clock synchronization system according to claim 6, which is characterized in that the synchronization module specifically includes:
Midrange determination unit, for determining that the communication after fitting is prolonged back and forth according to the communication round-trip delay data after the fitting The midrange of slow data;
First judging unit obtains the first judgement knot for judging whether the absolute value of the fit slope is greater than slope threshold value Fruit;
First synchronization unit, if the absolute value for first judging result to be expressed as the fit slope is greater than slope threshold Value, obtains the smallest original round trip delay time in original communication round-trip delay data, and the smallest original prolongs described back and forth Original time deviation corresponding to the slow time determines the time deviation of current standard time and local zone time, synchronous local zone time;
Second synchronization unit, if being expressed as the absolute value of the fit slope no more than slope threshold for first judging result Value is worked as according to the midrange of the communication round-trip delay data after the fitting and original communication round-trip delay data determination The time deviation of preceding standard time and local zone time, synchronous local zone time.
8. clock synchronization system according to claim 7, which is characterized in that second synchronization unit specifically includes:
The midrange of time deviation obtains subelement, in the midrange for obtaining the communication round-trip delay data after the fitting The midrange of time deviation after fitting;
Time deviation difference determines subelement, for calculating the midrange and each described original of the time deviation after the fitting Beginning time deviation determines time deviation difference;
Minimum time deviation difference determines subelement, for determining minimum time deviation difference according to the time deviation difference;
Synchronous subelement, for using original time deviation corresponding to the minimum time deviation difference as current standard time With the time deviation of local zone time, synchronous local zone time.
CN201910608165.XA 2019-07-08 2019-07-08 Time synchronization method and system Active CN110278049B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910608165.XA CN110278049B (en) 2019-07-08 2019-07-08 Time synchronization method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910608165.XA CN110278049B (en) 2019-07-08 2019-07-08 Time synchronization method and system

Publications (2)

Publication Number Publication Date
CN110278049A true CN110278049A (en) 2019-09-24
CN110278049B CN110278049B (en) 2021-03-30

Family

ID=67962997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910608165.XA Active CN110278049B (en) 2019-07-08 2019-07-08 Time synchronization method and system

Country Status (1)

Country Link
CN (1) CN110278049B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111698049A (en) * 2020-05-19 2020-09-22 东南大学 High-precision clock synchronization method considering round-trip time delay asymmetry
CN111817793A (en) * 2020-08-27 2020-10-23 北京中创为南京量子通信技术有限公司 Detector delay value acquisition method, bit synchronization method and device
CN114221731A (en) * 2021-12-09 2022-03-22 北京罗克维尔斯科技有限公司 Time synchronization precision determination method and system and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1839573A (en) * 2003-08-22 2006-09-27 艾利森电话股份有限公司 Remote synchronization in packet-switched networks
CN103309229A (en) * 2013-07-10 2013-09-18 中国人民解放军国防科学技术大学 Satellite-to-ground dynamic bidirectional time synchronization and ranging combined algorithm based on fitting method
CN103516508A (en) * 2013-09-17 2014-01-15 中国科学院计算技术研究所 Method and system for correcting clock drift in one-way and two-way delay variation measurement
CN104184571A (en) * 2013-05-20 2014-12-03 中兴通讯股份有限公司 Time correction method of driven clock equipment and device thereof
CN105959079A (en) * 2016-07-14 2016-09-21 深圳市旗众智能自动化有限公司 Clock synchronization method based on distributed control system
CN106992829A (en) * 2017-03-10 2017-07-28 国网上海市电力公司 A kind of formula method for synchronizing time that floods based on SFD catch mechanisms

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1839573A (en) * 2003-08-22 2006-09-27 艾利森电话股份有限公司 Remote synchronization in packet-switched networks
CN104184571A (en) * 2013-05-20 2014-12-03 中兴通讯股份有限公司 Time correction method of driven clock equipment and device thereof
EP3001589A1 (en) * 2013-05-20 2016-03-30 ZTE Corporation Time correction method and apparatus for slave clock device
CN103309229A (en) * 2013-07-10 2013-09-18 中国人民解放军国防科学技术大学 Satellite-to-ground dynamic bidirectional time synchronization and ranging combined algorithm based on fitting method
CN103516508A (en) * 2013-09-17 2014-01-15 中国科学院计算技术研究所 Method and system for correcting clock drift in one-way and two-way delay variation measurement
CN105959079A (en) * 2016-07-14 2016-09-21 深圳市旗众智能自动化有限公司 Clock synchronization method based on distributed control system
CN106992829A (en) * 2017-03-10 2017-07-28 国网上海市电力公司 A kind of formula method for synchronizing time that floods based on SFD catch mechanisms

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111698049A (en) * 2020-05-19 2020-09-22 东南大学 High-precision clock synchronization method considering round-trip time delay asymmetry
CN111817793A (en) * 2020-08-27 2020-10-23 北京中创为南京量子通信技术有限公司 Detector delay value acquisition method, bit synchronization method and device
CN114221731A (en) * 2021-12-09 2022-03-22 北京罗克维尔斯科技有限公司 Time synchronization precision determination method and system and electronic equipment
CN114221731B (en) * 2021-12-09 2024-04-16 北京罗克维尔斯科技有限公司 Time synchronization precision determining method and system and electronic equipment

Also Published As

Publication number Publication date
CN110278049B (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN110278049A (en) A kind of method for synchronizing time and system
CN103605023B (en) A kind of combining unit time response measuring method and measurement apparatus
CN205375018U (en) Can tame rubidium atomic clock synchronized clock equipment based on satellite time service
CN103812592B (en) Time synchronization protocol system and synchronous method based on chain EPA
Ren et al. Self-correcting time synchronization using reference broadcast in wireless sensor network
CN101895385B (en) Time-setting clock system of merging unit for realizing clock switching
WO2012062207A1 (en) Standard frequency and time adjusting method based on rubidium oscillator
CN108768577B (en) Communication network time service method and system based on PTP time synchronization signal
CN110113124A (en) Clock synchronizing method and device for optical fiber vibration sensing system
CN103592843A (en) Timestamp circuit and implement method
CN207650573U (en) A kind of precise synchronization system based on multi-source time service
CN102315985A (en) Time synchronization precision test method for intelligent device adopting IEEE1588 protocols
Jie et al. Research on network timing system based on NTP
CN104316888B (en) SV-sampling-signal-based partial discharge monitoring internal synchronization reference correction method
CN108039933A (en) A kind of local Internet of Things time precise synchronization method
CN103002562A (en) Hardware synchronizing method and system of wireless sensing network
CN115576295A (en) Domain controller time service system, domain controller and engineering machinery
CN207884639U (en) A kind of network node, temporal noise transmission characteristic measuring device and synchronous communication network
CN102625442B (en) Synchronous data acquisition method based on wireless sensor network
CN105450320B (en) A kind of intelligent substation whole process us class precisions wireless ethernet network sychronisation and method
CN104869587B (en) Time Synchronization for Wireless Sensor Networks error assay method
CN205283557U (en) PTP time synchronizer based on synchronous ethernet
WO2021183744A1 (en) Time synchronization using power system synchrophasor measurements
CN115865252B (en) High-precision GNSS time synchronization method capable of setting period
CN115102657B (en) Clock frequency synchronization method and device of metering device and 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
GR01 Patent grant
GR01 Patent grant