CN106559157A - A kind of clock synchronizing method, device and communication equipment - Google Patents

A kind of clock synchronizing method, device and communication equipment Download PDF

Info

Publication number
CN106559157A
CN106559157A CN201510633536.1A CN201510633536A CN106559157A CN 106559157 A CN106559157 A CN 106559157A CN 201510633536 A CN201510633536 A CN 201510633536A CN 106559157 A CN106559157 A CN 106559157A
Authority
CN
China
Prior art keywords
receive
clock
time
data transmit
software
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.)
Pending
Application number
CN201510633536.1A
Other languages
Chinese (zh)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510633536.1A priority Critical patent/CN106559157A/en
Priority to PCT/CN2016/090181 priority patent/WO2017054554A1/en
Publication of CN106559157A publication Critical patent/CN106559157A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter

Landscapes

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

Abstract

The present invention discloses a kind of clock synchronizing method, device and communication equipment, is related to the communications field, to solve the problems, such as in prior art data transmit-receive opposite end clock be synchronously difficult to promote the use of, it is difficult in maintenance.Methods described includes:The software clock initial time of the node for needing to carry out data transmit-receive is determined according to reference clock source;According to the software clock initial time and the rhythm and pace of moving things of data transmit-receive, the software clock current time after data transmit-receive is determined;According to the software clock current time and the time difference of the current time of the reference clock source, the rhythm and pace of moving things of the data transmit-receive is adjusted, so that the absolute value of the time difference is less than predetermined threshold value.

Description

A kind of clock synchronizing method, device and communication equipment
Technical field
The present invention relates to communication technique field, more particularly to a kind of clock synchronizing method, device and communication set It is standby.
Background technology
It is mobile in GSM/WCDMA/CDMA/TD-SCDMA/WiMax/FDD-LTE/TDD-LTE etc. In communication network, either base station, base station controller, BBU (Building Baseband Unit, it is indoor Baseband processing unit) and RRU (Remote Radio Unit, Remote Radio Unit), although have certain Reception and send caching capabilities, but in order to meet the use feeling of mobile communication network user, or will Ask Frame there be reasonable promptness.It is therefore desirable to the tick interrupt for being used for transceiving data can moved Keep synchronously with opposite equip. in dynamic communication network, it is impossible to have big error and cumulative error.
In order to realize clock synchronization, it is common practice to a clock module is realized in each equipment, this when Clock module and upper level clock enter row clock synchronization, while the clock signal that the clock module is produced is incorporated into Need and opposite equip. synchronizes the node for sending and receiving Frame, these nodes are in order to processing this A little clock signals, it is necessary to special hardware designs, and can not using general server, PC or Virtual machine is realizing.
This design result in the needs such as current base station controller, BBU, RRU and to enter row clock same for opposite end Each node in the equipment of step is all the specially designed hardware of equipment supplier so that base station controller, BBU Manufacture, operation and maintenance with the communication apparatus such as RRU is all more difficult.
The content of the invention
The technical problem to be solved in the present invention is to provide a kind of clock synchronizing method, device and communication equipment, uses With solve the problems, such as in prior art data transmit-receive opposite end clock be synchronously difficult to promote the use of, it is difficult in maintenance.
On the one hand, the present invention provides a kind of clock synchronizing method, including:Needs are determined according to reference clock source Carry out the software clock initial time of the node of data transmit-receive;According to the software clock initial time and number According to the rhythm and pace of moving things of transmitting-receiving, the software clock current time after data transmit-receive is determined;It is current according to the software clock Time and the time difference of the current time of the reference clock source, adjust the rhythm and pace of moving things of the data transmit-receive, so that The absolute value of the time difference is less than predetermined threshold value.
Optionally, it is described according to the software clock initial time and the rhythm and pace of moving things of data transmit-receive, determine data Software clock current time after transmitting-receiving includes:On the node, the tick interrupt produced by intervalometer Data transmit-receive is carried out, and is had no progeny in every time, when the timing cycle of the intervalometer is accumulated in the software On clock initial time, the accumulation result of gained is defined as the software clock after each data transmit-receive it is current when Between.
Optionally, it is described according to the software clock current time and the current time of the reference clock source Time difference, adjusts the rhythm and pace of moving things of the data transmit-receive, so that the absolute value of the time difference is less than predetermined threshold value bag Include:If the software clock current time is less than with the time difference of the current time of the reference clock source Zero, determine that the software clock is partially slow, increase the number of times of the data transmit-receive;If the software clock is worked as The front time is more than zero with the time difference of the current time of the reference clock source, determines that the software clock is inclined Hurry up, reduce the number of times of the data transmit-receive.
Optionally, the data transmit-receive number of times for increasing or decreasing be equal to the time difference absolute value with it is adjacent twice The ratio of the time interval of data transmit-receive.
Optionally, when determining that the software clock of the node for needing to carry out data transmit-receive is initial according to reference clock source Between include:If the reference clock source is located at the node for needing to carry out data transmit-receive, determine described soft Part clock initial time is equal to the time of the reference clock source;If the reference clock source is not in the need The local clock of the node for needing and carrying out data transmit-receive is synchronized to institute by the node carried out by data transmit-receive Reference clock source is stated, determines the software clock initial time equal to the local clock after synchronization.
Optionally, the reference clock source includes following at least one:1588 agreements Zhong Yuan;NTP(network Time protocol, NTP) clock;GPS (Global Positioning System, the whole world Alignment system) clock source;Higher level's line clock.
On the other hand, the present invention also provides a kind of clock synchronization apparatus, including:Initial time determining unit, For the software clock initial time for needing the node for carrying out data transmit-receive is determined according to reference clock source;Currently Time determining unit, for the rhythm and pace of moving things according to the software clock initial time and data transmit-receive, determines number According to the software clock current time after transmitting-receiving;Adjustment unit, for according to the software clock current time with The time difference of the current time of the reference clock source, adjusts the rhythm and pace of moving things of the data transmit-receive, so that when described Between difference absolute value be less than predetermined threshold value.
Optionally, the current time determining unit, specifically for:On the node, by intervalometer The tick interrupt of generation carries out data transmit-receive, and has no progeny in every time, and the timing cycle of the intervalometer is tired out It is added on the software clock initial time, the accumulation result of gained is defined as after each data transmit-receive Software clock current time.
Optionally, the adjustment unit, specifically for:If the software clock current time and the ginseng The time difference of current time of clock source is examined less than zero, is determined that the software clock is partially slow, is increased the data The number of times of transmitting-receiving;If the time of the software clock current time and the current time of the reference clock source More than zero, difference determines that the software clock is fast, reduce the number of times of the data transmit-receive.
Optionally, the data transmit-receive number of times for increasing or decreasing be equal to the time difference absolute value with it is adjacent twice The ratio of the time interval of data transmit-receive.
Optionally, the initial time determining unit, specifically for:If the reference clock source is located at institute The node for needing to carry out data transmit-receive is stated, determines that the software clock initial time is equal to the reference clock source Time;If the reference clock source is not in the node for needing to carry out data transmit-receive, by the needs The local clock for carrying out the node of data transmit-receive is synchronized to the reference clock source, determines at the beginning of the software clock Time beginning is equal to the local clock after synchronization.
On the other hand, the present invention also provides a kind of communication equipment, including any one clock that the present invention is provided is same Step device.
Clock synchronizing method provided in an embodiment of the present invention, device and communication equipment, can be according to reference clock Source determines the software clock initial time of the node for needing to carry out data transmit-receive, and according at the beginning of the software clock Time beginning and the rhythm and pace of moving things of data transmit-receive, determine the software clock current time after data transmit-receive;Then basis The software clock current time and the time difference of the current time of the reference clock source, adjust the data The rhythm and pace of moving things of transmitting-receiving, so that the absolute value of the time difference is less than predetermined threshold value.So, carrying out data transmit-receive When, can be according to the rhythm and pace of moving things Dose times of data transmit-receive, as the data transmit-receive rhythm and pace of moving things is by local clock control , through the accumulation of multiple data transmit-receive, between local clock and reference clock, small error is also gradually accumulated Tired, the error of accumulation is the time between software clock current time and the current time of reference clock source Difference.Due to the time measurement of software clock it is relevant with the data transmit-receive rhythm and pace of moving things, by the tune to the data transmit-receive rhythm and pace of moving things It is whole that software clock current time can be made also accordingly to adjust, so as to above-mentioned time difference is limited in very little all the time In the range of, make this node and peer node reach the clock synchronization of data transmit-receive.
Description of the drawings
Fig. 1 is a kind of flow chart of clock synchronizing method provided in an embodiment of the present invention;
Fig. 2 is the embodiment of the present invention showing in generic server, PC or virtual on-board maintenance precise time It is intended to;
Fig. 3 is the schematic diagram that the embodiment of the present invention safeguards precise time on clock module with GPS;
Fig. 4 is embodiment of the present invention schematic diagram with line clock maintenance time on clock module;
Fig. 5 be embodiment of the present invention TimeA and TimeB on same node when TimeB maintenance show It is intended to;
Fig. 6 be embodiment of the present invention TimeA and TimeB not on same node when TimeB maintenance Schematic diagram;
Fig. 7 is embodiment of the present invention TimeB and TimeA time synchronized schematic flow sheets;
Fig. 8 is that the embodiment of the present invention adopts 1588 (or NTP), and TimeA and TimeB is not same Clock synchronization implementation figure when on node;
Fig. 9 is that the embodiment of the present invention adopts 1588 (or NTP), and TimeA and TimeB is same Clock synchronization implementation figure when on node;
Figure 10 is that the embodiment of the present invention is modified flow chart to the expired times that high-resolution timer is produced;
Figure 11 is when the embodiment of the present invention adopts GPS, TimeA and TimeB not on same node Clock synchronization implementation figure;
Figure 12 is that the embodiment of the present invention adopts line clock, TimeA and TimeB not on same node When clock synchronization implementation figure;
Figure 13 is a kind of structural representation of clock synchronization apparatus provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with accompanying drawing, the present invention is described in detail.It should be appreciated that described herein be embodied as Example limits the present invention only to explain the present invention, not.
As shown in figure 1, the embodiment of the present invention provides a kind of clock synchronizing method, including:
S11, determines the software clock initial time of the node for needing to carry out data transmit-receive according to reference clock source;
S12, according to the software clock initial time and the rhythm and pace of moving things of data transmit-receive, after determining data transmit-receive Software clock current time;
S13, according to the time difference of the software clock current time and the current time of the reference clock source, The rhythm and pace of moving things of the data transmit-receive is adjusted, so that the absolute value of the time difference is less than predetermined threshold value.
Clock synchronizing method provided in an embodiment of the present invention, can be determined according to reference clock source needs into line number According to the software clock initial time of the node of transmitting-receiving, and received according to the software clock initial time and data The rhythm and pace of moving things sent out, determines the software clock current time after data transmit-receive;Then it is current according to the software clock Time and the time difference of the current time of the reference clock source, adjust the rhythm and pace of moving things of the data transmit-receive, so that The absolute value of the time difference is less than predetermined threshold value.So, when data transmit-receive is carried out, can be according to data The rhythm and pace of moving things Dose times of transmitting-receiving, as the data transmit-receive rhythm and pace of moving things is controlled by local clock, through many secondary datas The accumulation of transmitting-receiving, between local clock and reference clock, small error is also gradually accumulated, and the error of accumulation is For the time difference between software clock current time and the current time of reference clock source.Due to software clock Time measurement is relevant with the data transmit-receive rhythm and pace of moving things, works as can software clock by the adjustment to the data transmit-receive rhythm and pace of moving things The front time also accordingly adjusts, so as to above-mentioned time difference is limited in the range of very little all the time, make this node and Peer node has reached the clock synchronization of data transmit-receive.
In the present embodiment, reference clock source refers to the ratio safeguarded on certain or some node of communication apparatus More accurate clock, the time of reference clock source is TimeA.For example, as shown in Fig. 2 the present invention's In one embodiment, can use on generic server, PC or virtual machine 1588slave (or NTP Client) to outside 1588master (or ntp server) carry out time synchronized mode come Safeguard precise time TimeA.
As shown in figure 3, in another embodiment of the present invention, in the case where currently clock module is had, In order to play maximum value by which using used equipment, GPS module can be used on original clock module Receive the mode of gps time to safeguard precise time TimeA, or by it is as shown in Figure 4 when Using the synchronous mode of line clock superior clock module safeguarding precise time TimeA in clock module.
Specifically, as an equipment has one or more node, reference clock source may be located at wherein On one or several nodes, in step s 11, the position of reference clock source is different, during the software of node Between determination method it is also different.Optionally, in one embodiment of the invention, according to reference clock Source determines needs the software clock initial time of the node for carrying out data transmit-receive to include:
If the reference clock source is located at the node for needing to carry out data transmit-receive, when determining the software Clock initial time is equal to the time of the reference clock source;
If the reference clock source in the node for needing to carry out data transmit-receive, the needs is not carried out The local clock of the node of data transmit-receive is synchronized to the reference clock source, when determining that the software clock is initial Between be equal to synchronization after the local clock.
As shown in figure 5, the time of reference clock source is designated as TimeA, the time of software clock is TimeB. When TimeB and TimeA not on same node when, the synchronous method of TimeB and TimeA is as follows:
1. time synchronized client sends time synchronized request to time synchronized service end, contains in request Current time T1 of TimeB;
2. time synchronized service end receives time synchronized request, records the time T2 of current TimeA;
3. time synchronized service end reads the time T3 of TimeA, and to time synchronized client response, should T1, T2, T3 are contained in answering;
4. time synchronized client receives the response of time synchronized service end, records the time of current TimeB T4, and T1, T2, T3 are taken out from response message;
5. the time of chain-circuit time delay delay and TimeB and TimeA is calculated according to T1, T2, T3, T4 Deviation offset, and TimeB is corrected according to result of calculation, the time synchronized with TimeA is reached with this.Meter Calculation method follows the algorithm in 1588V2 specifications:
A=T2-T1;
B=T4-T3;
After determining software clock initial time, in step s 12, need initial according to the software clock Time and the rhythm and pace of moving things of data transmit-receive, determine the software clock current time after data transmit-receive.The present invention's In one embodiment, the determination method of software clock current time may include:
On the node, the tick interrupt produced by intervalometer carries out data transmit-receive, and is interrupting every time Afterwards, the timing cycle of the intervalometer is accumulated on the software clock initial time, by the tired of gained Plus result is defined as the software clock current time after each data transmit-receive.
For example, in one embodiment of the invention, synchronize in needs and opposite equip. and send and receive On the node of Frame, a software clock TimeB is safeguarded by cycle high-resolution timer.According to difference Standard and needs, the cycle t1 of the high-resolution timer of setting is also different.It is super in high-resolution timer TimeB is accumulated once t1 by Shi Hou, so as to have updated history maximum of T imeBmax of TimeB.
Software clock is carried out after timing by the rhythm and pace of moving things of the transceiving data in step S12, it is possible to periodically Time of the ground by the time of software clock with reference clock source is compared, and draws the time difference of the two, and The data transmit-receive rhythm and pace of moving things is adjusted according to the time difference in step S13, to improve the time difference.
Specifically, in step s 13, according to the software clock current time and the reference clock source The time difference of current time, adjusts the rhythm and pace of moving things of the data transmit-receive, so that the absolute value of the time difference is less than Predetermined threshold value may include:
If the software clock current time is less than with the time difference of the current time of the reference clock source Zero, determine that the software clock is partially slow, increase the number of times of the data transmit-receive;
If the software clock current time is more than with the time difference of the current time of the reference clock source Zero, determine that the software clock is fast, reduce the number of times of the data transmit-receive.
Optionally, the data transmit-receive number of times for increasing or decreasing be equal to the time difference absolute value with it is adjacent twice The ratio of the time interval of data transmit-receive.
Illustrate, in one embodiment of the invention, if arrange what is safeguarded on the node of transceiving data Cycle T=0.1 millisecond of intervalometer, then produce a tick interrupt per 0.1 millisecond, and the node utilizes this Tick interrupt is synchronized with opposite end, so as to carry out data transmit-receive.But, as the crystal oscillator on the node is deposited In slight error, after a period of time, slight error gradually can be accumulated, so as to cause the cycle T of intervalometer Not actually exactly equal to 0.1 millisecond.For example, if the crystal oscillator on node is fast, T possible 0.09 Millisecond, if the crystal oscillator on node is partially slow, T is possible 0.11 millisecond.But during software for calculation clock current time, It is every time cumulative still according to T=0.1 milliseconds, so caused by as a result, the node fast for crystal oscillator, counts The software clock current time for calculating will be bigger than normal than reference time, that is, software clock current time and institute The time difference for stating the current time of reference clock source is more than zero;The node partially slow for crystal oscillator, what is calculated is soft Part clock current time will be less than normal than reference time, that is, software clock current time with during the reference The time difference of the current time of Zhong Yuan is less than zero.The node fast for crystal oscillator, in the same time, data Transmitting-receiving number of times can be on the high side, accordingly, it would be desirable to data transmit-receive number of times is reduced, conversely, the node partially slow for crystal oscillator, In the same time, data transmit-receive number of times can be on the low side, accordingly, it would be desirable to reduce data transmit-receive number of times.By right The adjustment of data transmit-receive number of times, the current time of software clock are also just adjusted therewith, so that software clock is worked as The front time is less than predetermined threshold value with the time difference of the current time of reference clock source.Optionally, the predetermined threshold value Size can be according to arrange to the different of clock synchronization accuracy demand, predetermined threshold value is less, and synchronization is more smart Really, but need adjustment number of times it is also more, embodiments of the invention are not limited to this.For example, in the present invention One embodiment in, in 1 second in the adjustment number of times of data transmit-receive number of times be about 2 to 8 times.
Optionally, according to residing for software clock node difference, software clock TimeB has two kinds of different dimensions Shield mode, concrete difference is as shown in Figure 6 and Figure 7.
As shown in fig. 6, when TimeA and TimeB is on same node, the maintenance of TimeB can be wrapped Include following steps:
1. TimeA is read in this node, as the initial value of TimeB;
2. high-resolution timer is set, and timer period is t1, intervalometer then, by TimeB cumulative t1.
As shown in fig. 7, when TimeA and TimeB not on same node when, the maintenance of TimeB can Comprise the steps:
1., by network communication, the time synchronized client on the node of TimeB places is located to TimeA and saves Time synchronized service end on point sends the request of acquisition time;
2., after time synchronized service end receives request, the time of TimeA is read;
3. the time for reading is sent to time synchronized client by time synchronized service end;
4. time synchronized client using the time as TimeB initial time;
5. high-resolution timer is set, and timer period is t1, intervalometer then, by TimeB cumulative t1.
That is, reference clock source Time A are relatively accurate, the software clock TimeB of node can Can be it is relatively inaccurate, accordingly, it would be desirable to periodically (such as 2 seconds once) with TimeA correct TimeB, Value after correction is designated as TimeB1, will TimeB be set to TimeB1.If TimeB and TimeA On same node, then directly TimeB is corrected using TimeA;If TimeB and TimeA do not exist On same node, then TimeA is synchronized on the node at TimeB places, using it is synchronous obtain when Between correcting TimeB, synchronous flow process is as shown in Figure 5.
According to different conditions and networking, there are following several typical embodiments.
Exemplary embodiment 1:
All nodes of whole communication apparatus all by the realization of generic server, PC or virtual machine, often Individual needs and opposite equip. are synchronized (or NTP Client).If Fig. 8 is enforcement figure under this kind of situation, its implementation is as follows:
1.1588slave (or NTP Client) is by 1588 agreements (or Network Time Protocol) to setting Standby outside 1588master (or ntp server) carries out time synchronized;
2. the TimeA and local crystal oscillator on generic server/PC/virtual machine is corrected according to synchronized result;
3. local crystal oscillator safeguards TimeA by the vibration of itself;
4. TimeB is corrected using TimeA directly periodically;
5. TimeB is safeguarded using high-resolution timer;
6. the expired times that high-resolution timer is produced are modified using method as shown in Figure 10.
Specifically, as shown in Figure 10, the expired times that high-resolution timer is produced are modified may include Following steps:
1. high-resolution timer is waited then;
2. high-resolution timer is then;
3. the cycle of the high-resolution timer is accumulated once on the basis of TimeB currencys, becomes newest TimeB, and TimeB is synchronous with TimeA;
4. newest TimeB is compared with TimeBmax;Wherein, TimeBmax is equal to upper a cycle TimeB,
5., if TimeB is more than TimeBmax, illustrate that TimeB is slower or equal than TimeA (when (TimeB-TimeBmax) is equal to 1 high-resolution timer cycle, representing equal), then trigger ((TimeB-TimeBmax)/high-resolution timer cycle) secondary send and receive packets flow process, and TimeBmax is arranged For the value of TimeB, 1 is jumped to;
6. if TimeB is less than TimeBmax, illustrate that TimeB is faster than TimeA, then this does not trigger Send and receive packets flow process, TimeBmax keep constant, jump to 1.
Exemplary embodiment 2:
All nodes of whole communication apparatus all by the realization of generic server, PC or virtual machine, together When only one of which node start 1588slave (or NTP Client).If Fig. 9 is under this kind of situation Enforcement figure, its implementation is as follows:
1.1588slave (or NTP Client) is by 1588 agreements (or Network Time Protocol) to setting Standby outside 1588master (or ntp server) carries out time synchronized;
2. the TimeA and local crystal oscillator on generic server/PC/virtual machine is corrected according to synchronized result;
3. local crystal oscillator safeguards TimeA by the vibration of itself;
4. using the synchronous method in TimeB the and TimeA time synchronized schematic diagrams shown in Fig. 5, will TimeB and TimeA carries out time synchronized;
5. TimeB is corrected using the result after synchronization;
6. TimeB is safeguarded using high-resolution timer;
7. the expired times that high-resolution timer is produced are modified using method as shown in Figure 10.
Exemplary embodiment 3:
Clock module is provided in communication apparatus, clock synchronization is realized by line clock or GPS, but Other nodes be generic server, PC or virtual machine, need and opposite equip. synchronize transmission and The node of receiving data frames is also generic server, PC or virtual machine.Under this scene typically it is Existing clock module this equipment in using current device, the maximum value for playing existing device.Only There is line clock, during no GPS, be only suitable only for those and only requiring enter row clock synchronization with opposite equip., It is not required that the communication apparatus of time synchronized is carried out with opposite equip..If Figure 11 and Figure 12 is this kind of situation Under enforcement figure, its implementation is as follows:
1.GPS modules (or line clock synchronization module) are received from GPS (or upper level clock module) Time (or clock) it is synchronous;
2. correcting clock crystal oscillator and TimeA according to synchronized result (needs to correct TimeA when having GPS, only TimeA need not be corrected when having line clock);
3. clock crystal oscillator safeguards TimeA by the vibration of itself;
4. using the synchronous method in TimeB the and TimeA time synchronized schematic diagrams shown in Fig. 5, will TimeB and TimeA carries out time synchronized;
5. TimeB is corrected using the result after synchronization;
6. TimeB is safeguarded using high-resolution timer;
7. the expired times that high-resolution timer is produced are modified using method as shown in Figure 10.
Accordingly, as shown in figure 13, the present invention also provides a kind of clock synchronization apparatus, including:
Initial time determining unit 901, needs to carry out the section of data transmit-receive for being determined according to reference clock source The software clock initial time of point;
Current time determining unit 902, for according to the software clock initial time and data transmit-receive The rhythm and pace of moving things, determines the software clock current time after data transmit-receive;
Adjustment unit 903, for current with the reference clock source according to the software clock current time The time difference of time, adjusts the rhythm and pace of moving things of the data transmit-receive, so that the absolute value of the time difference is less than default Threshold value.
Clock synchronizing method provided in an embodiment of the present invention, initial time determining unit 901 can be according to references Clock source determines the software clock initial time of the node for needing to carry out data transmit-receive, current time determining unit 902 can be according to the software clock initial time and the rhythm and pace of moving things of data transmit-receive, after determining data transmit-receive Software clock current time;Adjustment unit 903 can be according to the software clock current time and the reference The time difference of the current time of clock source, adjusts the rhythm and pace of moving things of the data transmit-receive, so that the time difference is exhausted To value less than predetermined threshold value.So, when data transmit-receive is carried out, can measure according to the rhythm and pace of moving things of data transmit-receive Time, as the data transmit-receive rhythm and pace of moving things is controlled by local clock, through the accumulation of multiple data transmit-receive, this Between ground clock and reference clock, small error is also gradually accumulated, and the error as software clock of accumulation is current Time difference between time and the current time of reference clock source.Due to the time measurement and data of software clock The transmitting-receiving rhythm and pace of moving things is relevant, software clock current time can be made also accordingly to adjust by the adjustment to the data transmit-receive rhythm and pace of moving things It is whole, so as to above-mentioned time difference is limited in the range of very little all the time, reach this node and peer node The clock synchronization of data transmit-receive.
Optionally, current time determining unit 902, specifically for:
On the node, the tick interrupt produced by intervalometer carries out data transmit-receive, and is interrupting every time Afterwards, the timing cycle of the intervalometer is accumulated on the software clock initial time, by the tired of gained Plus result is defined as the software clock current time after each data transmit-receive.
Optionally, adjustment unit 903, specifically for:
If the software clock current time is less than with the time difference of the current time of the reference clock source Zero, determine that the software clock is partially slow, increase the number of times of the data transmit-receive;
If the software clock current time is more than with the time difference of the current time of the reference clock source Zero, determine that the software clock is fast, reduce the number of times of the data transmit-receive.
Optionally, the data transmit-receive number of times for increasing or decreasing be equal to the time difference absolute value with it is adjacent twice The ratio of the time interval of data transmit-receive.
Optionally, initial time determining unit 901, can be specifically for:
If the reference clock source is located at the node for needing to carry out data transmit-receive, when determining the software Clock initial time is equal to the time of the reference clock source;
If the reference clock source in the node for needing to carry out data transmit-receive, the needs is not carried out The local clock of the node of data transmit-receive is synchronized to the reference clock source, when determining that the software clock is initial Between be equal to synchronization after the local clock.
Accordingly, the present invention also provides a kind of communication equipment, including any one clock that previous embodiment is provided Synchronizer, therefore corresponding beneficial effect can be also realized, have been carried out above describing in detail, herein not Repeat again.
Although being example purpose, the preferred embodiments of the present invention are had been disclosed for, those skilled in the art will Recognize various improvement, increase and replacement be also it is possible, therefore, the scope of the present invention should be not limited to State embodiment.

Claims (12)

1. a kind of clock synchronizing method, it is characterised in that include:
The software clock initial time of the node for needing to carry out data transmit-receive is determined according to reference clock source;
According to the software clock initial time and the rhythm and pace of moving things of data transmit-receive, the software after data transmit-receive is determined Clock current time;
According to the software clock current time and the time difference of the current time of the reference clock source, adjust The rhythm and pace of moving things of the data transmit-receive, so that the absolute value of the time difference is less than predetermined threshold value.
2. method according to claim 1, it is characterised in that described according at the beginning of the software clock Time beginning and the rhythm and pace of moving things of data transmit-receive, determine that the software clock current time after data transmit-receive includes:
On the node, the tick interrupt produced by intervalometer carries out data transmit-receive, and is interrupting every time Afterwards, the timing cycle of the intervalometer is accumulated on the software clock initial time, by the tired of gained Plus result is defined as the software clock current time after each data transmit-receive.
3. method according to claim 1 and 2, it is characterised in that it is described according to the software when Clock current time and the time difference of the current time of the reference clock source, adjust the section of the data transmit-receive Rule, so that the absolute value of the time difference includes less than predetermined threshold value:
If the software clock current time is less than with the time difference of the current time of the reference clock source Zero, determine that the software clock is partially slow, increase the number of times of the data transmit-receive;
If the software clock current time is more than with the time difference of the current time of the reference clock source Zero, determine that the software clock is fast, reduce the number of times of the data transmit-receive.
4. method according to claim 3, it is characterised in that the data transmit-receive for increasing or decreasing Number is equal to the absolute value of the time difference and the ratio of the time interval of adjacent data transmit-receive twice.
5. method according to claim 1, it is characterised in that needs are determined according to reference clock source The software clock initial time for carrying out the node of data transmit-receive includes:
If the reference clock source is located at the node for needing to carry out data transmit-receive, when determining the software Clock initial time is equal to the time of the reference clock source;
If the reference clock source in the node for needing to carry out data transmit-receive, the needs is not carried out The local clock of the node of data transmit-receive is synchronized to the reference clock source, when determining that the software clock is initial Between be equal to synchronization after the local clock.
6. method according to claim 1, it is characterised in that the reference clock source includes following It is at least one:
1588 agreements Zhong Yuan;
NTP NTP clocks;
Global position system GPS clock source;
Higher level's line clock.
7. a kind of clock synchronization apparatus, it is characterised in that include:
Initial time determining unit, needs the node for carrying out data transmit-receive for determining according to reference clock source Software clock initial time;
Current time determining unit, for the section according to the software clock initial time and data transmit-receive Rule, determines the software clock current time after data transmit-receive;
Adjustment unit, for the current time according to the software clock current time and the reference clock source Time difference, adjust the rhythm and pace of moving things of the data transmit-receive, so that the absolute value of the time difference is less than predetermined threshold value.
8. device according to claim 7, it is characterised in that the current time determining unit, Specifically for:
On the node, the tick interrupt produced by intervalometer carries out data transmit-receive, and is interrupting every time Afterwards, the timing cycle of the intervalometer is accumulated on the software clock initial time, by the tired of gained Plus result is defined as the software clock current time after each data transmit-receive.
9. the device according to claim 7 or 8, it is characterised in that the adjustment unit, specifically For:
If the software clock current time is less than with the time difference of the current time of the reference clock source Zero, determine that the software clock is partially slow, increase the number of times of the data transmit-receive;
If the software clock current time is more than with the time difference of the current time of the reference clock source Zero, determine that the software clock is fast, reduce the number of times of the data transmit-receive.
10. device according to claim 9, it is characterised in that the data transmit-receive for increasing or decreasing Number is equal to the absolute value of the time difference and the ratio of the time interval of adjacent data transmit-receive twice.
11. devices according to claim 7, it is characterised in that the initial time determining unit, Specifically for:
If the reference clock source is located at the node for needing to carry out data transmit-receive, when determining the software Clock initial time is equal to the time of the reference clock source;
If the reference clock source in the node for needing to carry out data transmit-receive, the needs is not carried out The local clock of the node of data transmit-receive is synchronized to the reference clock source, when determining that the software clock is initial Between be equal to synchronization after the local clock.
12. a kind of communication equipments, it is characterised in that be provided with claim 7 to 11 on the communication equipment Any one of clock synchronization apparatus.
CN201510633536.1A 2015-09-29 2015-09-29 A kind of clock synchronizing method, device and communication equipment Pending CN106559157A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510633536.1A CN106559157A (en) 2015-09-29 2015-09-29 A kind of clock synchronizing method, device and communication equipment
PCT/CN2016/090181 WO2017054554A1 (en) 2015-09-29 2016-07-15 Clock synchronization method, device, and communication apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510633536.1A CN106559157A (en) 2015-09-29 2015-09-29 A kind of clock synchronizing method, device and communication equipment

Publications (1)

Publication Number Publication Date
CN106559157A true CN106559157A (en) 2017-04-05

Family

ID=58417143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510633536.1A Pending CN106559157A (en) 2015-09-29 2015-09-29 A kind of clock synchronizing method, device and communication equipment

Country Status (2)

Country Link
CN (1) CN106559157A (en)
WO (1) WO2017054554A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107040327A (en) * 2017-06-14 2017-08-11 深圳市华信天线技术有限公司 Slave TDMA slot synchronous calibration method and device
CN110098884A (en) * 2018-01-31 2019-08-06 慧与发展有限责任合伙企业 Determine exception clock
CN110502310A (en) * 2018-05-18 2019-11-26 北京东土科技股份有限公司 A kind of method for synchronizing time and device of virtual machine
WO2020063420A1 (en) * 2018-09-26 2020-04-02 华为技术有限公司 Synchronization cycle determination method, device, and system
CN113009899A (en) * 2019-12-20 2021-06-22 金卡智能集团股份有限公司 RTC (real time clock) calibration method for high-precision timing of metering instrument
CN113687686A (en) * 2021-08-10 2021-11-23 北京小米移动软件有限公司 Clock synchronization method and device, electronic equipment and storage medium
CN113687916A (en) * 2021-08-17 2021-11-23 锐捷网络股份有限公司 Data processing method and device, time updating method and device and electronic equipment
CN113687686B (en) * 2021-08-10 2024-05-14 北京小米移动软件有限公司 Clock synchronization method, clock synchronization device, electronic equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111208866B (en) * 2019-12-27 2022-10-28 视联动力信息技术股份有限公司 System time adjusting method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1780488B (en) * 2004-11-23 2010-05-05 中兴通讯股份有限公司 Clock calibrater for program control switchboard system
CN1933414A (en) * 2005-09-13 2007-03-21 上海欣泰通信技术有限公司 Time regulation algorithm for network time synchronizing in telecommunication field
CN100371851C (en) * 2006-11-27 2008-02-27 杭州华三通信技术有限公司 Time synchronizing method and device
JP2012128552A (en) * 2010-12-14 2012-07-05 Hitachi Ltd Information processing apparatus and time synchronizing method of information processing apparatus

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107040327A (en) * 2017-06-14 2017-08-11 深圳市华信天线技术有限公司 Slave TDMA slot synchronous calibration method and device
CN107040327B (en) * 2017-06-14 2019-04-02 深圳市华信天线技术有限公司 Slave TDMA slot synchronous calibration method and device
CN110098884A (en) * 2018-01-31 2019-08-06 慧与发展有限责任合伙企业 Determine exception clock
US11582706B2 (en) 2018-01-31 2023-02-14 Hewlett Packard Enterprise Development Lp Determine abnormal clock
CN110502310A (en) * 2018-05-18 2019-11-26 北京东土科技股份有限公司 A kind of method for synchronizing time and device of virtual machine
CN110502310B (en) * 2018-05-18 2021-12-14 北京东土科技股份有限公司 Time synchronization method and device of virtual machine
WO2020063420A1 (en) * 2018-09-26 2020-04-02 华为技术有限公司 Synchronization cycle determination method, device, and system
CN113009899A (en) * 2019-12-20 2021-06-22 金卡智能集团股份有限公司 RTC (real time clock) calibration method for high-precision timing of metering instrument
CN113687686A (en) * 2021-08-10 2021-11-23 北京小米移动软件有限公司 Clock synchronization method and device, electronic equipment and storage medium
CN113687686B (en) * 2021-08-10 2024-05-14 北京小米移动软件有限公司 Clock synchronization method, clock synchronization device, electronic equipment and storage medium
CN113687916A (en) * 2021-08-17 2021-11-23 锐捷网络股份有限公司 Data processing method and device, time updating method and device and electronic equipment

Also Published As

Publication number Publication date
WO2017054554A1 (en) 2017-04-06

Similar Documents

Publication Publication Date Title
CN106559157A (en) A kind of clock synchronizing method, device and communication equipment
CN100581164C (en) Accurate time synchronization method and system facing measurement and control
CN102546071B (en) Clock synchronization method and system
CN102098194B (en) Method and system for realizing time synchronization in local area network
CN100359956C (en) Method for implementing synchronization and distance finding in wireless communication system and implementing apparatus thereof
CN104836630B (en) IEEE1588 clock synchronization system and implementation method therefor
CN101252429B (en) Method for enhancing clock synchronization accuracy in distributed network system
CN105743598B (en) A kind of Industrial Ethernet clock synchronizing method and system
CN106603183B (en) A kind of timestamp filter method and device
CN104243129B (en) Receiver, the method and computer readable storage medium for calculating the time difference
CN102263629B (en) Method for time synchronization among boards, clock board and NE (network element) device
CN106656397B (en) Clock synchronizing method and device
CN110493744A (en) A kind of synchronous data sampling method and system of master-slave radio sensor
CN108650051A (en) The clock synchronization apparatus and method of general devices at full hardware single step 1588
CN106452650A (en) Clock synchronizing frequency deviation estimation method applicable to multi-hop wireless sensor network
CN107295627B (en) Time synchronization method and time synchronization device of baseband pool server
CN103532693B (en) Time synchronizing device and method
JP6036179B2 (en) Communication device and synchronization method
CN102301639A (en) Method and device for correcting clock jitter
CN109921871A (en) A kind of method for synchronizing time, device and network system
CN108134644B (en) Synchronous method, device, synchronizer and system
CN103686982A (en) Method for time synchronization based on clock information and node equipment
CN100461652C (en) Method and device for air frame synchronization between TDD-SCDMA base stations
CN106162856A (en) A kind of node synchronization method in wireless Ad Hoc network
CN102571253B (en) Method and equipment for implementing precise time synchronization

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170405

WD01 Invention patent application deemed withdrawn after publication