CN103001718A - Method and device for adjusting frequency - Google Patents

Method and device for adjusting frequency Download PDF

Info

Publication number
CN103001718A
CN103001718A CN2011102709165A CN201110270916A CN103001718A CN 103001718 A CN103001718 A CN 103001718A CN 2011102709165 A CN2011102709165 A CN 2011102709165A CN 201110270916 A CN201110270916 A CN 201110270916A CN 103001718 A CN103001718 A CN 103001718A
Authority
CN
China
Prior art keywords
message
phase difference
time
equipment
obtains
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
CN2011102709165A
Other languages
Chinese (zh)
Other versions
CN103001718B (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.)
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 CN201110270916.5A priority Critical patent/CN103001718B/en
Priority claimed from CN201110270916.5A external-priority patent/CN103001718B/en
Publication of CN103001718A publication Critical patent/CN103001718A/en
Application granted granted Critical
Publication of CN103001718B publication Critical patent/CN103001718B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The invention discloses a method and a device for adjusting frequency. The method includes: obtaining a phase difference of a slave unit relative to a master unit at the present time according to a timestamp of protocol message interaction between the master unit and the slave unit; obtaining a frequency adjustment value according to the phase difference obtained at the present time and a phase difference obtained previously; and adjusting the timestamp of protocol message interaction by the aid of the frequency adjustment value. By the technical scheme, the problems of high implementation cost and complexity in implementation due to the fact that frequency synchronization implementation methods in related technologies highly depend on hardware are solved, and further cost saving and simplicity in implementation are achieved.

Description

The method of adjusting frequency and device
Technical field
The present invention relates to the communications field, in particular to a kind of method of adjusting frequency and device.
Background technology
The purpose of clock synchronous is that the clock frequency of all switching nodes in the net and phase place all are controlled in the predetermined range of tolerable variance, avoids causing the data sliding injury and makeing mistakes owing to clock is inconsistent, also can save the cost of building network.Clock synchronous comprises two aspect synchronizing informations, on the one hand be the time (phase place) synchronously, namely correction time deviation, be Frequency Synchronization, i.e. correcting clock frequency speed on the other hand.
At present, the technology that Phase synchronization adopts is: send mutually by 1588 protocol massages between Master equipment and the Slave equipment, Slave equipment calculates the phase difference of itself and Master equipment, thereby adjusts the time of oneself.Basically realize (synchronous ethernet) by hardware at present for Frequency Synchronization, by the Clock Design technology on the hardware, pass through PHASE-LOCKED LOOP PLL TECHNIQUE between Master equipment and the Slave equipment, allow Slave equipment lock the frequency of Master equipment, thereby realize two Frequency Synchronization between the network equipment.
But problem is that these implementation methods are higher to the dependence of hardware, causes and realizes that cost compare is high, implements also more loaded down with trivial details.And when not supporting the equipment interconnection of synchronous ethernet with other, cause the Frequency Synchronization function unavailable, thereby brought great inconvenience to network construction.
Summary of the invention
The implementation method synchronous for the correlation technique medium frequency is higher to the dependence of hardware, causes and realizes that cost compare is high, implements also more loaded down with trivial details problem.The invention provides a kind of method of adjusting frequency and device, to address the above problem at least.
According to an aspect of the present invention, provide a kind of method of adjusting frequency.
Method of adjusting frequency of the present invention comprises: according to main equipment with obtain this from the phase difference of equipment with respect to main equipment from the timestamp of equipment interaction protocol message; Obtain the frequency adjusted value according to this phase difference that obtains and the front phase difference that once obtains; The proportion adjusted value is adjusted the timestamp of interaction protocol message.
In said method, obtain from the phase difference of equipment with respect to main equipment and comprise: record is to the time T 1 that sends synchronous sync message from equipment; Record receives the time T 2 of sync message from equipment; Record is to the time T 3 of main equipment transmission lag request delay-req message; The record main equipment receives the time T 4 of delay-req message; Adopt T1, T2, T3, T4 to calculate this phase difference that obtains.
In said method, calculate the phase difference that this obtains by following formula: the phase difference offset2=(T2-T4-T1+T3)/2 that this obtains.
In said method, obtain the frequency adjusted value according to this phase difference that obtains and the front phase difference that once obtains and comprise: the difference DELTA offset that calculates this phase difference offset2 that obtains and the last phase difference offset1 that obtains; The time difference Δ t that adopts Δ offset and obtain phase difference for twice obtains frequency deviation value rate; The frequency adjusted value is obtained in calculating according to frequency deviation value rate.
In said method, calculate according to frequency deviation value and to obtain the frequency adjusted value and comprise: calculate the adjusted value Rate:Rate=k1*rate+k2*offset2 of frequency deviation value rate by following formula, wherein, k1 and k2 are the constant greater than 0; Rate is carried out accumulation calculating according to following formula obtain frequency adjusted value RateSum:RateSum+=Rate.
In said method, the timestamp that the proportion adjusted value is adjusted the interaction protocol message comprises: according to transmission direction and the type of message of message, adjust the timestamp of interaction protocol message as benchmark take the time T 3 that sends the delay-req message from equipment to main equipment.
In said method, transmission direction and type of message according to message, timestamp from equipment to main equipment that adjust the interaction protocol message as benchmark take the time T 3 that sends the delay-req message from comprises: if receive the sync message next time, then to the time T 2 that receives the sync message ' adjust next time, and the more next time calculating of phase difference of the T2 ' participation after will adjusting, wherein, by following formula T2 ' is adjusted: T2 '=T2 '+RateSum* (T2 '-T3); If receive delay resp message next time, then to the time T 3 that receives delay resp message ' adjust next time, and the more next time calculating of phase difference of the T3 ' participation after will adjusting, wherein, by following formula T3 ' is adjusted: T3 '=T3 '+RateSum* (T3 '-T3); If the message that sends is the sync message next time, then to the time T 1 that sends the sync message ' adjust next time, and the T1 ' after will adjusting sends to upstream device, wherein, by following formula T1 ' adjusted: T1 '=T1 '+RateSum* (T1 '-T3); If the message that sends is delay req message next time, then to the time T 4 that sends delay req message ' adjust next time, and the more next time calculating of phase difference of the T4 ' participation after will adjusting, wherein, by following formula T4 ' is adjusted: T4 '=T4 '+RateSum* (T4 '-T3).
According to a further aspect in the invention, provide a kind of device of adjusting frequency.
Device of adjusting frequency of the present invention comprises: the phase difference calculating module, frequency shift (FS) adjusting module and timestamp adjusting module, wherein, the phase difference calculating module is used for obtaining this from the phase difference of equipment with respect to main equipment according to main equipment and timestamp from equipment interaction protocol message; The frequency shift (FS) adjusting module is used for obtaining the frequency adjusted value according to this phase difference that obtains and the front phase difference that once obtains; The timestamp adjusting module is used for the timestamp that the proportion adjusted value is adjusted the interaction protocol message.
In said apparatus, the phase difference calculating module comprises: the first record cell is used for record to the time T 1 that sends the sync message from equipment; The second record cell is used for record receives the sync message from equipment time T 2; The 3rd record cell is used for record sends time T 3 from the delay-req message to main equipment; The 4th record cell is used for the time T 4 that the record main equipment receives the delay-req message; The first computing unit is used for calculating the phase difference that this obtains according to T1, T2, T3, T4.
In said apparatus, the frequency shift (FS) adjusting module, comprise: the second computing unit, be used for to calculate the difference DELTA offset of this phase difference offset2 that obtains and the last phase difference offset1 that obtains, and the time difference Δ t that adopts Δ offset and obtain phase difference for twice obtains frequency deviation value rate; Acquiring unit obtains the frequency adjusted value for calculating according to frequency deviation value rate.
In said apparatus, the timestamp adjusting module comprises: judging unit, for transmission direction and the type of message of judging the interaction protocol message; The timestamp adjustment unit is used for the judged result according to judging unit, adjusts the timestamp of interaction protocol message as benchmark take the time T 3 that sends the delay-req message from equipment to main equipment.
By the present invention, by means of 1588 protocol algorithm and Digit filter theory, calculate phase difference (offset) between itself and the Master equipment by software algorithm in the Slave equipment end, and the phase difference of the equipment of adjustment, it is to the dependence of hardware higher to have solved the synchronous implementation method of correlation technique medium frequency, cause and realize that cost compare is high, implement also more loaded down with trivial details problem, and then reached the saving cost and implemented fairly simple effect.
Description of drawings
Accompanying drawing described herein is used to provide a further understanding of the present invention, consists of the application's a part, and illustrative examples of the present invention and explanation thereof are used for explaining the present invention, do not consist of improper restriction of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart according to the method for adjusting frequency of the embodiment of the invention;
Fig. 2 is the schematic diagram of 1588 time synchronized E2E time-delay process according to the preferred embodiment of the invention;
Fig. 3 is the flow chart of phase difference calculating method according to the preferred embodiment of the invention;
Fig. 4 is the flow chart of frequency offset computations method according to the preferred embodiment of the invention;
Fig. 5 is the flow chart of timestamp method of adjustment according to the preferred embodiment of the invention;
Fig. 6 is the structured flowchart according to the device of adjusting frequency of the embodiment of the invention;
Fig. 7 is the structured flowchart of the device of adjusting frequency according to the preferred embodiment of the invention;
Fig. 8 is the schematic diagram that comprises according to the preferred embodiment of the invention the system of the device of adjusting frequency.
Embodiment
Hereinafter also describe in conjunction with the embodiments the present invention in detail with reference to accompanying drawing.Need to prove that in the situation of not conflicting, embodiment and the feature among the embodiment among the application can make up mutually.
Fig. 1 is the flow chart according to the method for adjusting frequency of the embodiment of the invention.As shown in Figure 1, this method of adjusting frequency mainly comprises following processing:
Step S102: according to main equipment with obtain this from the phase difference of equipment with respect to main equipment from the timestamp of equipment interaction protocol message;
Step S104: obtain the frequency adjusted value according to this phase difference that obtains and the front phase difference that once obtains;
Step S106: the proportion adjusted value is adjusted the timestamp of interaction protocol message.
In the correlation technique, higher to the dependence of hardware when realizing between Master equipment (main equipment) and the Slave equipment (from equipment) Phase synchronization, cause and realize the cost compare height, implement also more loaded down with trivial details.Adopt the method for adjusting frequency shown in Figure 1, can effectively realize main equipment and from the Phase synchronization between the equipment, and realize that cost compare is low, implement also fairly simple.
Preferably, among the above-mentioned steps S102, can adopt above-mentioned 1588 protocol algorithm to obtain from the phase difference of equipment with respect to main equipment, further comprise following processing:
(1) record is to the time T 1 that sends synchronous sync message from equipment;
(2) record receives the time T 2 of sync message from equipment;
(3) record is to the time T 3 of main equipment transmission lag request delay-req message;
(4) the record main equipment receives the time T 4 of delay-req message;
(5) adopt T1, T2, T3, T4 to calculate this phase difference that obtains.
Be described below in conjunction with Fig. 2 and Fig. 3.Fig. 2 is the schematic diagram of 1588 time synchronized E2E time-delay process according to the preferred embodiment of the invention; Fig. 3 is the flow chart of phase difference calculating method according to the preferred embodiment of the invention; As shown in Figure 3, adopt above-mentioned 1588 protocol algorithm to obtain from equipment and can comprise following processing with respect to the phase difference of main equipment:
Step S302: can downstream equipment (namely from equipment) dispose a Slave port, be used for supporting 1588 functions;
Step S304:Master equipment sends the sync message and holds to Slave, and transmitting time is T1;
Step S306:Slave equipment receives the sync message that Master sends, and time of reception is T2;
Step S308:Master equipment sends follow up message to Slave equipment;
Step S310:Slave equipment sends the delay-req message to Master equipment, and record transmitting time T3;
Step S312:Master sends the delay_resp message to Slave equipment, and the Slave equipment records receives the time T 4 of this message;
Step S314:Slave goes out the phase difference offset of itself and Master equipment according to T1, T2, T3, T4 Time Calculation, and the offset value is carried out record;
As shown in Figure 2, according to packet sending and receiving timestamp relation, can take out equation (1) and equation (2):
T2=T1+Dalay+offset; (1)
T4=T3+Dalay-offset; (2)
Subtract each other with equation (1) and equation (2), can obtain this phase difference offset=(T2-T4-T1+T3)/2.
Step S316: judge whether it is for the first time to calculate phase difference offset, if so, execution in step S304 then;
Step S318: if not, then trigger and carry out the frequency offset computations flow process.
It should be noted that among the step S308 that Master equipment sends follow up message to Slave equipment, is in order to notify the equipment to Slave by follow up message with T1.In specific implementation process, if Master equipment is notified the equipment to Slave by the sync message with T1, then can omit and carry out this step.
Preferably, above-mentioned steps S104 may further include following processing:
(1) calculates the difference DELTA offset of this phase difference offset2 that obtains and the last phase difference offset1 that obtains;
(2) the time difference Δ t that adopts Δ offset and obtain phase difference for twice obtains frequency deviation value rate;
(3) the said frequencies adjusted value is obtained in calculating according to frequency deviation value rate.
In preferred implementation process, can obtain the said frequencies adjusted value according to following mode:
(1) calculate the adjusted value Rate:Rate=k1*rate+k2*offset2 of frequency deviation value rate by following formula, wherein, k1 and k2 are the constant greater than 0;
(2) Rate is carried out accumulation calculating according to following formula and obtain frequency adjusted value RateSum:RateSum+=Rate.
Further describe above-mentioned preferred implementation below in conjunction with Fig. 4.
Fig. 4 is the flow chart of frequency offset computations method according to the preferred embodiment of the invention.As shown in Figure 4, this frequency offset computations method mainly comprises following processing:
Step S402: take out the last phase value offset;
Step S404: calculate the difference that links to each other recently between two phase differences, be denoted as Δ offset;
Step S406: carry out the legitimacy verification; If legal, execution in step S408, otherwise, trigger the execute exception handling process;
Step S408: recording the time that adjacent two offset calculate is Δ t, then within the time of Δ t, and frequency deviation value rate=Δ offset/ Δ t;
Step S410: calculate Rate=k1*rate+k2*offset2, wherein, above-mentioned k1 and k2 be according to actual conditions debug obtain greater than a constant of 0;
Step S412: obtain frequency adjusted value RateSum+=Rate, wherein RateSum is an accumulated value;
Step S414: the value of RateSum and T3 is passed to the device that the time of implementation stamp is adjusted.
It should be noted that in the algorithm adjustment process, only need T3 timestamp of record to get final product, thereby reduced the complexity of software maintenance.
Preferably, above-mentioned steps S106 may further include following processing: according to transmission direction and the type of message of message, adjust the timestamp of interaction protocol message as benchmark take the time T 3 that sends the delay-req message from equipment to main equipment.
For example, if receive the sync message next time, then to the time T 2 that receives the sync message ' adjust next time, and the more next time calculating of phase difference of the T2 ' participation after will adjusting, wherein, by following formula T2 ' is adjusted: T2 '=T2 '+RateSum* (T2 '-T3);
For example, if receive the delay_resp message next time, then to the time T 3 that receives the delay_resp message ' adjust next time, and the more next time calculating of phase difference of the T3 ' participation after will adjusting, wherein, by following formula T3 ' is adjusted: T3 '=T3 '+RateSum* (T3 '-T3);
For example, if the message that sends is the sync message next time, then to the time T 1 that sends the sync message ' adjust next time, and the T1 ' after will adjusting sends to upstream device, wherein, by following formula T1 ' is adjusted: T1 '=T1 '+RateSum* (T1 '-T3);
For example, if the message that sends is the delay_req message next time, then to the time T 4 that sends the delay_req message ' adjust next time, and the more next time calculating of phase difference of the T4 ' participation after will adjusting, wherein, by following formula T4 ' is adjusted: T4 '=T4 '+RateSum* (T4 '-T3).
Further describe above-mentioned preferred implementation below in conjunction with Fig. 5.
Fig. 5 is the flow chart of timestamp method of adjustment according to the preferred embodiment of the invention.As shown in Figure 5, this timestamp method of adjustment mainly comprises following processing:
Step S502: the direction to message is judged (judgement be the message that receives or the message of transmission);
Step S504: judge type of message, if need to beat timestamp, then trigger unusual execution flow process, otherwise execution in step S506;
Step S506: if receive message, and be the sync message, then to the time T 2 that receives the sync message ' adjust next time, and the more next time calculating of phase difference of the T2 ' participation after will adjusting.Adjustment formula is: T2 '=T2 '+RateSum* (T2 '-T3);
If the reception message, and be the delay_resp message, then to the time T 3 that receives the delay_resp message ' adjust next time, and the more next time calculating of phase difference of the T3 ' participation after will adjusting.Adjustment formula is: T3 '=T3 '+RateSum* (T3 '-T3);
If the transmission message, and be the sync message, then to the time T 1 that sends the sync message ' adjust next time, and the T1 ' after will adjusting sends to upstream device.Adjustment formula is: T1 '=T1 '+RateSum* (T1 '-T3);
If the transmission message, and be the delay_req message, then to the time T 4 that sends the delay_req message ' adjust next time, and the more next time calculating of phase difference of the T4 ' participation after will adjusting, wherein, by following formula T4 ' is adjusted.Adjustment formula is: T4 '=T4 '+RateSum* (T4 '-T3).
Fig. 6 is the structured flowchart according to the device of adjusting frequency of the embodiment of the invention.As shown in Figure 6, this device of adjusting frequency comprises: phase difference calculating module 10 is used for obtaining this from the phase difference of equipment with respect to main equipment according to main equipment and timestamp from equipment interaction protocol message; Frequency shift (FS) adjusting module 20 is used for obtaining the frequency adjusted value according to this phase difference that obtains and the front phase difference that once obtains; Timestamp adjusting module 30 is used for the timestamp that the proportion adjusted value is adjusted the interaction protocol message.
Adopt the device of adjusting frequency shown in Figure 6, can effectively realize main equipment and from the Phase synchronization between the equipment, and realize that cost compare is low, implement also fairly simple.
Preferably, as shown in Figure 7, above-mentioned phase difference calculating module 10 comprises: the first record cell 100 is used for record to the time T 1 that sends the sync message from equipment; The second record cell 102 is used for record receives the sync message from equipment time T 2; The 3rd record cell 104 is used for record sends time T 3 from the delay-req message to main equipment; The 4th record cell 106 is used for the time T 4 that the record main equipment receives the delay-req message; The first computing unit 108 is used for calculating the phase difference that this obtains according to T1, T2, T3, T4.
Wherein, the first computing unit 108 can calculate the phase difference that this obtains by following formula: the phase difference offset2=(T2-T4-T1+T3)/2 that this obtains.
Preferably, as shown in Figure 7, frequency shift (FS) adjusting module 20, comprise: the second computing unit 200, be used for to calculate the difference DELTA offset of this phase difference offset2 that obtains and the last phase difference offset1 that obtains, and the time difference Δ t that adopts Δ offset and obtain phase difference for twice obtains frequency deviation value rate; Acquiring unit 202 obtains the frequency adjusted value for calculating according to frequency deviation value rate.
Wherein, acquiring unit 202 can calculate by following formula the adjusted value Rate:Rate=k1*rate+k2*offset2 of frequency deviation value rate, and wherein, k1 and k2 are the constant greater than 0; Rate is carried out accumulation calculating according to following formula obtain frequency adjusted value RateSum:RateSum+=Rate.
Preferably, as shown in Figure 7, timestamp adjusting module 30 comprises: judging unit 300, for transmission direction and the type of message of judging the interaction protocol message; Timestamp adjustment unit 302 is used for the judged result according to judging unit, adjusts the timestamp of interaction protocol message as benchmark take the time T 3 that sends the delay-req message from equipment to main equipment.
If receive the sync message next time, then to the time T 2 that receives the sync message ' adjust next time, and the more next time calculating of phase difference of the T2 ' participation after will adjusting, wherein, by following formula T2 ' is adjusted: T2 '=T2 '+RateSum* (T2 '-T3);
If receive the delay_resp message next time, then to the time T 3 that receives the delay_resp message ' adjust next time, and the more next time calculating of phase difference of the T3 ' participation after will adjusting, wherein, by following formula T3 ' is adjusted: T3 '=T3 '+RateSum* (T3 '-T3);
If the message that sends is the sync message next time, then to the time T 1 that sends the sync message ' adjust next time, and the T1 ' after will adjusting sends to upstream device, wherein, by following formula T1 ' adjusted: T1 '=T1 '+RateSum* (T1 '-T3);
If the message that sends is the delay_req message next time, then to the time T 4 that sends the delay_req message ' adjust next time, and the more next time calculating of phase difference of the T4 ' participation after will adjusting, wherein, by following formula T4 ' is adjusted: T4 '=T4 '+RateSum* (T4 '-T3).
This shows, feed back in the timestamp of next time receiving and dispatching message by the frequency adjusted value RateSum that frequency shift (FS) adjusting module 20 is calculated, T1, T2, these four timestamps of T3, T4 are carried out frequency compensation.The like, thereby realization comes the function of compensating frequency by software algorithm.
Fig. 8 is the schematic diagram that comprises according to the preferred embodiment of the invention the system of the device of adjusting frequency.As shown in Figure 8, this system comprises: upstream equipment, intermediate equipment and upstream device.Intermediate equipment comprises: phase difference offset computing module (being equivalent to above-mentioned phase difference calculating module 10), frequency offset computations module (being equivalent to said frequencies skew adjusting module 20) and timestamp adjusting module (being equivalent to above-mentioned timestamp adjusting module 30).By the cooperation of these three modules, realize the Phase synchronization of intermediate equipment and upstream equipment, intermediate equipment can be used as again the synchronous upstream device of master clock simultaneously.
The preferred cooperative work mode of above-mentioned three modules is as follows:
Step 1: phase difference offset module, the transmitting-receiving of carrying out the 1588v2 protocol massages by the Master equipment with the upstream is mutual, according to the timestamp value of transmitting-receiving message, calculates the phase difference value offset of this equipment and upstream Master.
Step 2: the frequency offset computations module, according to the phase difference value offset that calculates in the step 1, calculate and whether calculate for the first time offset, if calculate for the first time, then only the offset value is carried out record, directly enter next time offset calculation process; If not calculating for the first time, then take out the time stamp T 3 of offset and this offset that calculates and this transmission delay_req message of last registration, calculate a frequency offseting value, then enter 1588 timestamp adjusting modules.
Step 3: the timestamp adjusting module, according to the parameter of importing in the step 2, carry out the adjustment of 1588 transmitting-receiving message time stamp T 1, T2, T3, T4, thereby difference on the frequency fed back in the timestamp of message.
In sum, by technical scheme provided by the invention, in the situation of not using synchronous ethernet, under the BC pattern, adopt the hardware system of not supporting DPLL, adjust the frequency of Slave equipment and phase place by software algorithm and realize that the precision clock between itself and the Master equipment is synchronous, effectively reduce cost.And the method for adjustment rate provided by the invention can reach very high time precision in actual applications.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on the single calculation element, perhaps be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in the storage device and be carried out by calculation element, and in some cases, can carry out step shown or that describe with the order that is different from herein, perhaps they are made into respectively each integrated circuit modules, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (11)

1. method of adjusting frequency is characterized in that comprising:
According to main equipment with obtain this from the timestamp of equipment interaction protocol message described from the phase difference of equipment with respect to described main equipment;
Obtain the frequency adjusted value according to this phase difference that obtains and the front phase difference that once obtains;
Adopt described frequency adjusted value to adjust the timestamp of described interaction protocol message.
2. method according to claim 1 is characterized in that, obtains describedly to comprise from the phase difference of equipment with respect to described main equipment:
Record is to the described time T 1 that sends synchronous sync message from equipment;
Record the described time T 2 that receives described sync message from equipment;
Record is to the time T 3 of described main equipment transmission lag request delay-req message;
Record the time T 4 that described main equipment receives described delay-req message;
Adopt described T1, described T2, described T3, described T4 to calculate the described phase difference that this obtains.
3. method according to claim 2 is characterized in that, calculates the described phase difference that this obtains by following formula: the described phase difference offset2=(T2-T4-T1+T3)/2 that this obtains.
4. method according to claim 2 is characterized in that, obtains the frequency adjusted value according to this phase difference that obtains and the front phase difference that once obtains and comprises:
Calculate the difference DELTA offset of the phase difference offset1 that the described phase difference offset2 that this obtains and described last time obtain;
The time difference Δ t that adopts described Δ offset and obtain phase difference for twice obtains frequency deviation value rate;
Obtain described frequency adjusted value according to described frequency deviation value rate calculating.
5. method according to claim 4 is characterized in that, obtains described frequency adjusted value according to described frequency deviation value calculating and comprises:
Calculate the adjusted value Rate:Rate=k1*rate+k2*offset2 of described frequency deviation value rate by following formula, wherein, k1 and k2 are the constant greater than 0;
Described Rate is carried out accumulation calculating according to following formula obtain described frequency adjusted value RateSum:RateSum+=Rate.
6. method according to claim 2 is characterized in that, the timestamp that the described frequency adjusted value of described employing is adjusted described interaction protocol message comprises:
According to transmission direction and the type of message of message, adjust the timestamp of described interaction protocol message as benchmark take the described time T 3 that sends described delay-req message from equipment to described main equipment.
7. method according to claim 6 is characterized in that, according to transmission direction and the type of message of message, timestamp from equipment to described main equipment that adjust described interaction protocol message as benchmark take the described time T 3 that sends the delay-req message from comprises:
If receive the sync message next time, then to the time T 2 that receives the sync message ' adjust next time, and the more next time calculating of phase difference of the T2 ' participation after will adjusting, wherein, by following formula described T2 ' is adjusted: T2 '=T2 '+RateSum* (T2 '-T3);
If receive the delay_resp message next time, then to the time T 3 that receives the delay_resp message ' adjust next time, and the more next time calculating of phase difference of the T3 ' participation after will adjusting, wherein, by following formula described T3 ' is adjusted: T3 '=T3 '+RateSum* (T3 '-T3);
If the message that sends is the sync message next time, then to the time T 1 that sends the sync message ' adjust next time, and the T1 ' after will adjusting sends to upstream device, wherein, by following formula described T1 ' adjusted: T1 '=T1 '+RateSum* (T1 '-T3):
If the message that sends is the delay_req message next time, then to the time T 4 that sends the delay_req message ' adjust next time, and the more next time calculating of phase difference of the T4 ' participation after will adjusting, wherein, by following formula described T4 ' is adjusted: T4 '=T4 '+RateSum* (T4 '-T3).
8. device of adjusting frequency is characterized in that comprising:
The phase difference calculating module is used for obtaining according to main equipment and timestamp from equipment interaction protocol message that this is described from the phase difference of equipment with respect to described main equipment;
The frequency shift (FS) adjusting module is used for obtaining the frequency adjusted value according to this phase difference that obtains and the front phase difference that once obtains;
The timestamp adjusting module is used for adopting described frequency adjusted value to adjust the timestamp of described interaction protocol message.
9. device according to claim 8 is characterized in that, described phase difference calculating module comprises:
The first record cell is used for record to the described described time T 1 that sends described sync message from equipment;
The second record cell is used for recording the described described time T 2 that receives described sync message from equipment;
The 3rd record cell is used for record sends described time T 3 from described delay-req message to described main equipment;
The 4th record cell is used for recording the described time T 4 that described main equipment receives described delay-req message;
The first computing unit is used for calculating the described phase difference that this obtains according to described T1, described T2, described T3, described T4.
10. device according to claim 9 is characterized in that, described frequency shift (FS) adjusting module comprises:
The second computing unit is used for calculating the difference DELTA offset of the phase difference offset1 that the described phase difference offset2 that this obtains and described last time obtain, and the time difference Δ t that adopts described Δ offset and obtain phase difference for twice obtains frequency deviation value rate;
Acquiring unit is used for obtaining described frequency adjusted value according to described frequency deviation value rate calculating.
11. device according to claim 9 is characterized in that, described timestamp adjusting module comprises:
Judging unit is for transmission direction and the type of message of judging described interaction protocol message;
The timestamp adjustment unit is used for the judged result according to described judging unit, adjusts the timestamp of described interaction protocol message as benchmark take the described time T 3 that sends described delay-req message from equipment to described main equipment.
CN201110270916.5A 2011-09-14 Adjust the method and device of frequency Active CN103001718B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110270916.5A CN103001718B (en) 2011-09-14 Adjust the method and device of frequency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110270916.5A CN103001718B (en) 2011-09-14 Adjust the method and device of frequency

Publications (2)

Publication Number Publication Date
CN103001718A true CN103001718A (en) 2013-03-27
CN103001718B CN103001718B (en) 2016-12-14

Family

ID=

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253665A (en) * 2013-06-28 2014-12-31 上海贝尔股份有限公司 Synchronizing equipment and synchronizing system with same
WO2018214606A1 (en) * 2017-05-24 2018-11-29 中兴通讯股份有限公司 Clock process method and apparatus, and ptp device
CN110536405A (en) * 2018-05-25 2019-12-03 华为技术有限公司 A kind of synchronous method and access point
WO2021195901A1 (en) * 2020-03-30 2021-10-07 华为技术有限公司 Data processing method and apparatus
CN115038162A (en) * 2022-08-12 2022-09-09 广州安凯微电子股份有限公司 Method and device for rapid same-frequency and same-phase adjustment of Bluetooth clock
CN118400795A (en) * 2024-06-27 2024-07-26 成都爱瑞无线科技有限公司 Communication equipment synchronization method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007011130A1 (en) * 2005-07-15 2007-01-25 Samsung Electronics Co., Ltd. Time synchronizing method and apparatus based on time stamp
CN101729180A (en) * 2008-10-21 2010-06-09 华为技术有限公司 Method and system for synchronizing precision clocks, and precision clock frequency/time synchronizing device
CN101834712A (en) * 2010-04-19 2010-09-15 浙江大学 Method for realizing accurate time synchronization by utilizing IEEE1588 protocol
CN101888292A (en) * 2009-05-13 2010-11-17 中兴通讯股份有限公司 Clock synchronization method and device based on packet switching
CN102088397A (en) * 2009-12-03 2011-06-08 中兴通讯股份有限公司 Communication network element and clock frequency correction system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007011130A1 (en) * 2005-07-15 2007-01-25 Samsung Electronics Co., Ltd. Time synchronizing method and apparatus based on time stamp
CN101729180A (en) * 2008-10-21 2010-06-09 华为技术有限公司 Method and system for synchronizing precision clocks, and precision clock frequency/time synchronizing device
CN101888292A (en) * 2009-05-13 2010-11-17 中兴通讯股份有限公司 Clock synchronization method and device based on packet switching
CN102088397A (en) * 2009-12-03 2011-06-08 中兴通讯股份有限公司 Communication network element and clock frequency correction system and method
CN101834712A (en) * 2010-04-19 2010-09-15 浙江大学 Method for realizing accurate time synchronization by utilizing IEEE1588 protocol

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253665B (en) * 2013-06-28 2017-06-13 上海贝尔股份有限公司 Synchronizer and the synchronization system comprising the equipment
CN104253665A (en) * 2013-06-28 2014-12-31 上海贝尔股份有限公司 Synchronizing equipment and synchronizing system with same
CN108964820B (en) * 2017-05-24 2021-02-12 中兴通讯股份有限公司 Clock processing method and device and PTP (precision time protocol) equipment
WO2018214606A1 (en) * 2017-05-24 2018-11-29 中兴通讯股份有限公司 Clock process method and apparatus, and ptp device
CN108964820A (en) * 2017-05-24 2018-12-07 中兴通讯股份有限公司 A kind of clock processing method, device and PTP equipment
CN110536405B (en) * 2018-05-25 2021-08-03 华为技术有限公司 Synchronization method and access point
CN110536405A (en) * 2018-05-25 2019-12-03 华为技术有限公司 A kind of synchronous method and access point
WO2021195901A1 (en) * 2020-03-30 2021-10-07 华为技术有限公司 Data processing method and apparatus
US12052339B2 (en) 2020-03-30 2024-07-30 Huawei Technologies Co., Ltd. Data processing method and apparatus
CN115038162A (en) * 2022-08-12 2022-09-09 广州安凯微电子股份有限公司 Method and device for rapid same-frequency and same-phase adjustment of Bluetooth clock
CN115038162B (en) * 2022-08-12 2022-11-18 广州安凯微电子股份有限公司 Method and device for rapid same-frequency and same-phase adjustment of Bluetooth clock
CN118400795A (en) * 2024-06-27 2024-07-26 成都爱瑞无线科技有限公司 Communication equipment synchronization method and device
CN118400795B (en) * 2024-06-27 2024-08-27 成都爱瑞无线科技有限公司 Communication equipment synchronization method and device

Similar Documents

Publication Publication Date Title
CN102394715B (en) Clock synchronizing method and device
US8819161B1 (en) Auto-syntonization and time-of-day synchronization for master-slave physical layer devices
JP6820851B2 (en) How to synchronize the clocks of network devices
EP1256197B1 (en) Reference time distribution over a network
CN102104475B (en) IEEE 1588-based synchronization system and synchronization method thereof
US9860004B2 (en) Network distributed packet-based synchronization
US8576883B2 (en) Measurement and adjustment of real-time values according to residence time in networking equipment without access to real time
CN102546071B (en) Clock synchronization method and system
CN107294634A (en) The centralized approach of 1588 time synchronizeds is realized in a kind of distributed system
CN106603183B (en) A kind of timestamp filter method and device
CN101729180A (en) Method and system for synchronizing precision clocks, and precision clock frequency/time synchronizing device
CN103166792B (en) Line asymmetrical compensation method, equipment and system
CN103001720A (en) Time synchronization method and device
WO2011085585A1 (en) Method and device for time synchronization
WO2017107519A1 (en) Clock synchronization method and device
CN106357362A (en) Time synchronization method and device and PTP system
CN101247169A (en) Method, system and equipment for implementing time synchronization in communication network
CN102739386A (en) System and method to overcome wander accumulation to achieve precision clock distribution over large networks
JP5650072B2 (en) Frequency / time synchronization method and frequency / time synchronization apparatus
JP2018088646A (en) Time synchronization device and time synchronization method
CN102201910A (en) Method for adjusting frequency based on IEEE1588 (institute of electrical and electronic engineers) protocol and network device
US9442511B2 (en) Method and a device for maintaining a synchronized local timer using a periodic signal
CN103001718A (en) Method and device for adjusting frequency
EP3080933A1 (en) Method and devices for synchronization using linear programming
CN103001718B (en) Adjust the method and device of frequency

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant