CN110557826B - Clock synchronization method and device - Google Patents

Clock synchronization method and device Download PDF

Info

Publication number
CN110557826B
CN110557826B CN201910894549.2A CN201910894549A CN110557826B CN 110557826 B CN110557826 B CN 110557826B CN 201910894549 A CN201910894549 A CN 201910894549A CN 110557826 B CN110557826 B CN 110557826B
Authority
CN
China
Prior art keywords
clock device
delay
parameter information
transmission
transmission parameter
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.)
Expired - Fee Related
Application number
CN201910894549.2A
Other languages
Chinese (zh)
Other versions
CN110557826A (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.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
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 Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN201910894549.2A priority Critical patent/CN110557826B/en
Publication of CN110557826A publication Critical patent/CN110557826A/en
Application granted granted Critical
Publication of CN110557826B publication Critical patent/CN110557826B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • H04W56/0015Synchronization between nodes one node acting as a reference for the others
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/004Synchronisation arrangements compensating for timing error of reception due to propagation delay

Landscapes

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

Abstract

The embodiment of the application provides a clock synchronization method and a device, wherein the method comprises the following steps: and receiving a synchronous and following message sent by the master clock equipment. And inputting the first transmission parameter information carried by the following message into a support vector machine model to obtain the first transmission delay of the synchronous message. And recording the second sending moment of the delay request message. And inputting second transmission parameter information carried by the received delay response message into the support vector machine model to obtain a second transmission delay of the delay request message. And calculating the clock offset according to a first sending time carried by the following message, a first receiving time carried by the synchronous message, a second sending time, a second receiving time carried by the delay response message, the first transmission delay, the second transmission delay and a clock offset calculation formula. The clock of the slave clock device is calibrated with the clock offset. Therefore, the clock calibration can be carried out on the slave clock equipment by utilizing the accurate clock offset, and the time synchronization precision of the master clock equipment and the slave clock equipment is improved.

Description

Clock synchronization method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a clock synchronization method and apparatus.
Background
At present, the synchronization accuracy of master and slave clock devices in a cellular network is often improved by IEEE (Institute of Electrical and Electronics Engineers) 1588 protocol.
The method for improving the synchronization accuracy of the master clock device and the slave clock device specifically comprises the following steps: the master clock device and the slave clock device mutually transmit messages and then obtain the transmitting time and the receiving time of the messages. And then, calculating the clock offset of the slave clock equipment relative to the master clock equipment on the basis of the principle that the first transmission delay of the message sent from the slave clock equipment to the master clock equipment is equal to the second transmission delay of the message sent from the master clock equipment to the slave clock equipment.
However, since the first transmission delay and the second transmission delay are not equal in the actual transmission process, the calculated clock offset is not accurate. Therefore, the time synchronization precision of the master clock device and the slave clock device is low.
Disclosure of Invention
An object of the embodiments of the present application is to provide a clock synchronization method and apparatus, so that an accurate clock offset can be obtained through calculation, and thus, the clock offset can be used to perform clock calibration on clock devices, thereby improving the time synchronization precision of a master clock device and a slave clock device.
In a first aspect, a clock synchronization method is provided, and the method includes:
after receiving a synchronous message sent by a master clock device, recording a first receiving moment when the synchronous message is received, and receiving a following message sent by the master clock device; the following message carries a first sending time corresponding to the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent.
Inputting the first transmission parameter information into a pre-constructed support vector machine model, and predicting to obtain a first transmission time delay for transmitting the synchronous message; the support vector machine model is obtained based on a transmission parameter information sample and a transmission delay sample corresponding to the transmission parameter information sample through training.
After the time delay request message is sent to the master clock equipment, recording a second sending moment of sending the time delay request message, and receiving a time delay response message sent by the master clock equipment; the delay response message carries a second receiving time corresponding to the delay request message, and second transmission parameter information between the master clock device and the slave clock device when the delay request message is received.
And inputting the second transmission parameter information into the support vector machine model, and predicting to obtain the second transmission delay of the transmission delay request message.
And calculating the clock offset of the slave clock equipment relative to the master clock equipment according to the first sending time, the first receiving time, the second sending time, the second receiving time, the first transmission delay, the second transmission delay and a preset clock offset calculation formula.
The clock of the slave clock device is calibrated using the clock offset.
Optionally, the preset clock offset calculation formula may be:
t2-t1=offset+delay1;
t4-t3=-offset+delay2;
2offset=[(t2-t1-delay1)-(t4-t3-delay2)];
wherein t1 is a first sending time; t2 is a first receiving time; t3 is a second transmission time; t4 is a second reception time; delay1 is the first transmission delay; delay2 is the second transmission delay; offset is the clock offset.
Optionally, before inputting the first transmission parameter information into a pre-constructed support vector machine model and predicting the first transmission delay for transmitting the synchronization packet, the method further includes:
after receiving a preset synchronous message sent by a master clock device, receiving a preset following message sent by the master clock device; the preset following message carries a transmission parameter information sample which is used as transmission parameter information between the master clock device and the slave clock device when the preset synchronous message is sent.
And obtaining the transmission delay marked by the user and corresponding to the transmission parameter information sample as a transmission delay sample.
And training to obtain the support vector machine model by using the transmission parameter information sample, the transmission delay sample and a preset support vector machine algorithm.
Wherein, the transmission parameter information includes:
one or more of the noise strength of the transmission channel of the master clock device and the slave clock device, the distance between the master clock device and the slave clock device, the encoding rate of the master clock device, the encoding rate of the slave clock device, the decoding rate of the master clock device, the decoding rate of the slave clock device, the device aging degree value of the master clock device, the device aging degree value of the slave clock device, and the transit times of the message.
The transmission parameter information is obtained by screening the master clock equipment based on a time delay influence value; wherein, the delay impact value is the impact value of the transmission parameter information on the transmission delay sample.
In a second aspect, there is provided a clock synchronization apparatus, the apparatus comprising:
the first receiving module is used for recording a first receiving moment when the synchronous message is received after the synchronous message sent by the main clock equipment is received, and receiving a following message sent by the main clock equipment; the following message carries a first sending time corresponding to the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent.
The first prediction module is used for inputting the first transmission parameter information into a pre-constructed support vector machine model and predicting to obtain a first transmission delay for transmitting the synchronous message; the support vector machine model is obtained based on transmission parameter information samples and transmission delay samples corresponding to the transmission parameter information samples through training.
The second receiving module is used for recording a second sending time for sending the delay request message after sending the delay request message to the master clock equipment and receiving a delay response message sent by the master clock equipment; the delay response message carries a second receiving time corresponding to the delay request message, and second transmission parameter information between the master clock device and the slave clock device when the delay request message is received.
And the second prediction module is used for inputting the second transmission parameter information into the support vector machine model and predicting to obtain a second transmission delay for transmitting the delay request message.
And the calculating module is used for calculating the clock offset of the slave clock equipment relative to the master clock equipment according to the first sending time, the first receiving time, the second sending time, the second receiving time, the first transmission time delay, the second transmission time delay and a preset clock offset calculating formula.
And the calibration module is used for calibrating the clock of the slave clock equipment according to the clock offset.
Optionally, the preset clock offset calculation formula may be:
t2-t1=offset+delay1;
t4-t3=-offset+delay2;
2offset=[(t2-t1-delay1)-(t4-t3-delay2)];
wherein t1 is the first sending time; t2 is the first receiving time; t3 is the second sending time; t4 is the second receiving time; the delay1 is the first transmission delay; the delay2 is the second transmission delay; the offset is the clock offset.
Optionally, the clock synchronization apparatus further includes:
a third receiving module, configured to receive a preset follow-up message sent by the master clock device after receiving a preset synchronization message sent by the master clock device before inputting the first transmission parameter information to a pre-constructed support vector machine model and predicting a first transmission delay for transmitting the synchronization message; the preset follow-up message carries a transmission parameter information sample which is used as transmission parameter information between the master clock device and the slave clock device when the preset synchronous message is sent.
And the obtaining module is used for obtaining the transmission delay marked by the user and corresponding to the transmission parameter information sample as a transmission delay sample.
And the training module is used for training to obtain the support vector machine model by utilizing the transmission parameter information sample, the transmission delay sample and a preset support vector machine algorithm.
Wherein, the transmission parameter information includes:
one or more of the noise strength of the transmission channel of the master clock device and the slave clock device, the distance between the master clock device and the slave clock device, the encoding rate of the master clock device, the encoding rate of the slave clock device, the decoding rate of the master clock device, the decoding rate of the slave clock device, the device aging degree value of the master clock device, the device aging degree value of the slave clock device, and the transit times of the message.
The transmission parameter information is obtained by screening the master clock equipment based on a time delay influence value; wherein, the delay impact value is the impact value of the transmission parameter information on the transmission delay sample.
In a third aspect, a data processing device is provided, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the first aspect when executing a program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored therein a computer program which, when executed by a processor, carries out the method steps of any of the first aspects.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method steps of any of the first aspects described above.
In this embodiment of the present application, after receiving a synchronization packet sent by a master clock device, a slave clock device may record a first receiving time at which the synchronization packet is received, and may receive a following packet sent by the master clock device. The following message carries a first sending time of the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent. Then, the slave clock device inputs the first transmission parameter information into a pre-constructed support vector machine model, and a first transmission delay for transmitting the synchronous message is obtained through prediction. The support vector machine model is obtained based on preset transmission parameter information and transmission delay training corresponding to the preset transmission parameter information. After the slave clock device sends the delay request message to the master clock device, the slave clock device may record a second sending time for sending the delay request message, and may receive a delay response message sent by the master clock device. The delay response message carries a second receiving time corresponding to the delay request message, and second transmission parameter information between the master clock device and the slave clock device when the delay request message is received. Then, the slave clock device may input the second transmission parameter information into the support vector machine model, and predict a second transmission time at which the delay request packet is transmitted. Furthermore, the slave clock device may calculate a clock offset of the slave clock device with respect to the master clock device according to the first transmission time, the first reception time, the second transmission time, the second reception time, the first transmission delay, the second transmission delay, and a preset clock offset calculation formula. And, the clock of the slave clock device is calibrated using the clock offset. Therefore, the accurate clock offset can be calculated, the clock of the slave clock equipment can be calibrated by utilizing the clock offset, and the time synchronization precision of the master clock equipment and the slave clock equipment is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a clock synchronization method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a signaling interaction provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a clock synchronization apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a slave clock device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a clock synchronization method which can be applied to slave clock equipment. The slave clock device provided by the embodiment of the present application includes, but is not limited to, a router, a switch, a mobile phone, a computer, and other terminal devices.
A clock synchronization method provided in an embodiment of the present application will be described below with reference to fig. 1 and fig. 2. As shown in fig. 1, the clock synchronization method may include the steps of:
step 101, after receiving a synchronization message sent by a master clock device, recording a first receiving time of the synchronization message, and receiving a following message sent by the master clock device; the following message carries a first sending time corresponding to the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent.
Referring to fig. 2, a master clock device may send a synchronization message to a slave clock device. The synchronization message may be periodically transmitted by the base station. Furthermore, the master clock device may record the transmission time of the synchronization packet as the first transmission time t 1. In addition, the master clock device can also detect the transmission parameter information of the synchronous message during sending, so as to obtain the first transmission parameter information.
It is understood that the master clock device includes, but is not limited to, a base station. In addition, the first transmission parameter information may include: when the synchronous message is sent, one or more of the noise intensity of a transmission channel between the master clock device and the slave clock device, the distance between the master clock device and the slave clock device, the encoding rate of the master clock device, the encoding rate of the slave clock device, the decoding rate of the master clock device, the decoding rate of the slave clock device, the device aging degree value of the master clock device, the device aging degree value of the slave clock device and the transfer times of message transmission. It is to be understood that the first transmission parameter information is of course not limited thereto.
It can be understood that the master clock device may also detect transmission parameter information of the synchronization message when the synchronization message is sent. Then, the transmission parameter information obtained by detection is screened, so that first transmission parameter information is obtained.
In the embodiment of the present application, the detected transmission parameter information may be screened based on a delay influence value of the transmission parameter information on the transmission delay. Specifically, transmission parameter information having a delay impact value smaller than a preset threshold may be filtered. For example, the preset threshold value may be 0.8, but is not limited thereto.
The larger the delay influence value of the transmission parameter information is, the larger the influence of the value of the transmission parameter information on the transmission delay is; the smaller the delay influence value of the transmission parameter information is, the smaller the influence of the value of the parameter information on the transmission delay is. For example, a larger delay influence value of the noise strength of the transmission channel indicates that the noise strength has a larger influence on the transmission delay.
It is understood that the value of the pearson correlation coefficient or the mutual information coefficient may be used as the delay impact value, but is not limited thereto. Wherein the pearson correlation coefficient is a coefficient for measuring a linear correlation between two variables X and Y, and has a value between-1 and 1. The mutual information coefficient is a measure of the interdependence between two variables X and Y.
In addition, before the transmission parameter information obtained by detection is screened, the continuous variable in the transmission parameter information can be discretized, and the discretized transmission parameter information is normalized, so that the value of the discretized transmission parameter information is between 0 and 1. Although not limited thereto.
Then, the master clock device may generate a following packet carrying the first transmission time and the first transmission parameter information. And, the follow message may be sent to the slave clock device.
After receiving the sync message sent by the master clock device, the slave clock device may record a first receiving time t2 when receiving the sync message. And after receiving the synchronization message, the slave clock device may also receive a follow-up message sent by the master clock device.
After receiving the following message sent by the master clock device, the first sending time t1 of the sync message and the corresponding first transmission parameter information when the sync message is sent can be obtained from the following message.
Fig. 2 is a schematic diagram of signaling interaction provided in an embodiment of the present application, where a first sending time is time information of a synchronization packet sent by a master clock device; the first receiving time is the time information of receiving the synchronous message from the clock equipment; the second sending time is the time information of sending the time delay request message from the clock equipment; the second receiving time is the time information of the time delay request message received by the master clock equipment; the following message comprises a first sending time t1, and first transmission parameter information obtained by the master clock device through collecting transmission parameter information when the synchronous message is sent and screening; the time delay request message comprises a first transmission time delay obtained by predicting according to the first transmission parameter information and the support vector machine by the slave clock equipment; the delay response message includes a second receiving time t4, and second transmission parameter information obtained by the master clock device by collecting transmission parameter information when the synchronization message is sent and screening.
Step 102, inputting first transmission parameter information into a pre-constructed support vector machine model, and predicting to obtain a first transmission delay for transmitting the synchronous message; the support vector machine model is obtained based on a transmission parameter information sample and a transmission delay sample corresponding to the transmission parameter information sample through training.
After receiving the follow-up message sent by the master clock device, the slave clock device may obtain a first sending time t1 of the synchronization message and first transmission parameter information corresponding to the sending of the synchronization message from the follow-up message.
The slave clock device may then input the first transmission parameter information into the pre-constructed support vector machine model. Therefore, the first transmission delay for transmitting the synchronous message can be predicted through the support vector machine model. Wherein, the first transmission delay refers to: the time duration that the synchronization message has elapsed from being sent out to being received.
The support vector machine model is obtained based on transmission parameter information samples and transmission delay samples corresponding to the transmission parameter information samples through training. The following describes a method of training the support vector machine model:
in one implementation, the support vector machine model may be trained by a slave clock device. Specifically, the slave clock device may perform the following operations before inputting the first transmission parameter information to the pre-constructed support vector machine model:
the method comprises the steps that firstly, after receiving a preset synchronous message sent by a master clock device, a slave clock device receives a preset following message sent by the master clock device; the preset following message carries a transmission parameter information sample which is used as transmission parameter information between the master clock device and the slave clock device when the preset synchronous message is sent.
The preset synchronous message is used for obtaining a training sample, and the preset following message is used for obtaining a following message of the training sample for a user.
In addition, the transmission parameter information samples may also include, in response to the first transmission parameter information: when the preset synchronous message is sent, one or more items of noise intensity of a transmission channel between the master clock device and the slave clock device, distance between the master clock device and the slave clock device, encoding rate of the master clock device, encoding rate of the slave clock device, decoding rate of the master clock device, decoding rate of the slave clock device, device aging degree value of the master clock device, device aging degree value of the slave clock device and transfer times of the message transmission.
Moreover, it is reasonable that the transmission parameter information sample may also be transmission parameter information obtained by screening based on the delay impact value.
And step two, obtaining the transmission delay marked by the user and corresponding to the transmission parameter information sample as a transmission delay sample.
It can be understood that the transmission delay corresponding to the transmission parameter information sample marked by the user is: the actual time duration from sending to receiving of the preset synchronization message is elapsed. Therefore, the transmission parameter information sample can be marked to obtain accurate transmission delay as a transmission delay sample.
And step three, training to obtain the support vector machine model by using the transmission parameter information sample, the transmission delay sample and a preset support vector machine algorithm.
In the embodiment of the application, the slave clock device can train and obtain the support vector machine model capable of accurately showing the relation between the transmission delay and the transmission parameter information according to the transmission parameter information sample, the transmission delay sample and a preset support vector machine algorithm. For example, the slave clock device may obtain a corresponding objective function according to the transmission parameter information sample and the transmission delay sample, then optimize the objective function according to the kernel function and the loss function, and then train to obtain the support vector machine model according to a preset support vector machine algorithm. Or, a lagrangian multiplier can be introduced into the objective function, and the optimized objective function is obtained according to a lagrangian function optimization method.
In another implementation, it is reasonable that the support vector machine model can also be trained by the master clock device.
In order to ensure the accuracy of the prediction result of the support vector machine, the support vector machine may be calibrated by using the first transmission delay and the first transmission parameter information obtained by the support vector machine. It will be appreciated that in such an implementation, the slave clock device needs to transmit the predicted first transmission delay to the master clock device.
103, after sending the delay request message to the master clock device, recording a second sending time for sending the delay request message, and receiving a delay response message sent by the master clock device; the delay response message carries a second receiving time corresponding to the delay request message, and second transmission parameter information between the master clock device and the slave clock device when the delay request message is received.
In this embodiment of the present application, after receiving the following message, the slave clock device may further send a delay request message to the master clock device. And, the slave clock device may record a second transmission time t3 at which the latency request message is transmitted. When the support vector machine model is trained through the master clock device, the predicted first transmission delay may be carried through the delay request message, which is not limited to this.
The master clock device may monitor second transmission parameter information between the master clock device and the slave clock device when the delay request packet is received. And after receiving the delay request message, the master clock device may further record a second receiving time t4 at which the delay request message is received.
Then, the master clock device may send a delay reply message carrying the second receiving time t4 and the second transmission parameter information to the slave clock device. Furthermore, the slave clock device may analyze the second receiving time t4 carried in the delay response message and the second transmission parameter information.
Wherein, corresponding to the content contained in the first transmission parameter information, the second transmission parameter information may also include: when receiving the delay request message, one or more of the noise intensity of a transmission channel between the master clock device and the slave clock device, the distance between the master clock device and the slave clock device, the encoding rate of the master clock device, the encoding rate of the slave clock device, the decoding rate of the master clock device, the decoding rate of the slave clock device, the device aging degree value of the master clock device, the device aging degree value of the slave clock device, and the transfer times of the message transmission. It is to be understood that the second transmission parameter information is of course not limited thereto.
It can be understood that the master clock device may also detect transmission parameter information of the delay request message when receiving the delay request message. And then, screening the detected transmission parameter information to obtain second transmission parameter information.
And 104, inputting the second transmission parameter information into the support vector machine model, and predicting to obtain the second transmission delay of the transmission delay request message.
After the second transmission parameter information carried in the delay response message is obtained through analysis by the slave clock device, the second transmission parameter information may be input into the support vector machine model. Therefore, the second transmission delay for transmitting the delay request message can be predicted through the support vector machine model. Wherein, the second transmission delay refers to: the time length of the delay request message from sending to receiving.
And 105, calculating the clock offset of the slave clock device relative to the master clock device according to the first sending time, the first receiving time, the second sending time, the second receiving time, the first transmission delay, the second transmission delay and a preset clock offset calculation formula.
In this embodiment of the application, the slave clock device may substitute the obtained first sending time, first receiving time, second sending time, second receiving time, first transmission delay, and second transmission delay into a preset clock offset calculation formula. According to the embodiment of the application, the first transmission delay and the second transmission delay are accurately predicted according to the transmission information parameters, so that the first transmission delay and the second transmission delay are prevented from being set to be equal, and the clock offset of the slave clock equipment relative to the master clock equipment can be accurately calculated.
In addition, the preset clock offset calculation formula may be:
t2-t1=offset+delay1;
t4-t3=-offset+delay2;
2offset=[(t2-t1-delay1)-(t4-t3-delay2)];
wherein t1 is a first sending time; t2 is a first receiving time; t3 is a second transmission time; t4 is a second reception time; delay1 is the first transmission delay; delay2 is the second transmission delay; offset is the clock offset.
And step 106, calibrating the clock of the slave clock device by using the clock offset.
In the embodiment of the application, because the accurate clock offset can be obtained through calculation, the clock calibration can be performed on the slave clock equipment by using the accurate clock offset, and the time synchronization precision of the master clock equipment and the slave clock equipment is improved.
In addition, the clock synchronization method provided by the embodiment of the present application can be applied to the following communication systems: a code division multiple access communication system, a wideband code division multiple access communication system, a long term evolution time division duplex communication system, a 5G New Radio (5GNR, New Radio technology) communication system, and an orthogonal frequency division multiplexing communication system, though not limited thereto.
In this embodiment of the present application, after receiving a synchronization packet sent by a master clock device, a slave clock device may record a first receiving time at which the synchronization packet is received, and may receive a following packet sent by the master clock device. The following message carries a first sending time of the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent. Then, the slave clock device inputs the first transmission parameter information into a pre-constructed support vector machine model, and a first transmission delay for transmitting the synchronous message is obtained through prediction. The support vector machine model is obtained based on preset transmission parameter information and transmission delay training corresponding to the preset transmission parameter information. After the slave clock device sends the delay request message to the master clock device, the slave clock device may record a second sending time for sending the delay request message, and may receive a delay response message sent by the master clock device. And the time delay response message carries a second receiving time corresponding to the time delay request message and second transmission parameter information between the master clock device and the slave clock device when the time delay request message is sent. Then, the slave clock device may input the second transmission parameter information into the support vector machine model, and predict a second transmission time at which the delay request packet is transmitted. Furthermore, the slave clock device may calculate a clock offset of the slave clock device with respect to the master clock device according to the first transmission time, the first reception time, the second transmission time, the second reception time, the first transmission delay, the second transmission delay, and a preset clock offset calculation formula. And, the clock of the slave clock device is calibrated using the clock offset. Therefore, the accurate clock offset can be calculated, the clock of the slave clock equipment can be calibrated by utilizing the clock offset, and the time synchronization precision of the master clock equipment and the slave clock equipment is improved.
Based on the same technical concept, the embodiment of the application also provides a clock synchronization device. As shown in fig. 3, the apparatus may include:
the first receiving module 301 is configured to record a first receiving time when a synchronization message sent by a master clock device is received, and receive a following message sent by the master clock device; the following message carries a first sending time corresponding to the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent.
A first prediction module 302, configured to input the first transmission parameter information into a pre-constructed support vector machine model, and predict a first transmission delay for transmitting the synchronization packet; the support vector machine model is obtained based on a transmission parameter information sample and a transmission delay sample corresponding to the transmission parameter information sample through training.
A second receiving module 303, configured to record a second sending time for sending the delay request message after sending the delay request message to the master clock device, and receive a delay response message sent by the master clock device; the delay response message carries a second receiving time corresponding to the delay request message, and second transmission parameter information between the master clock device and the slave clock device when the delay request message is received.
A second prediction module 304, configured to input the second transmission parameter information into the support vector machine model, and predict a second transmission delay for transmitting the delay request packet.
The calculating module 305 is configured to calculate a clock offset of the slave clock device relative to the master clock device according to the first sending time, the first receiving time, the second sending time, the second receiving time, the first transmission delay, the second transmission delay, and a preset clock offset calculation formula.
A calibration module 306, configured to calibrate the clock of the slave clock device according to the clock offset.
By applying the device provided by the embodiment of the application, after receiving the synchronous message sent by the master clock device, the slave clock device can record the first receiving time of the synchronous message and can receive the following message sent by the master clock device. The following message carries a first sending time of the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent. Then, the slave clock device inputs the first transmission parameter information into a pre-constructed support vector machine model, and a first transmission delay for transmitting the synchronous message is obtained through prediction. The support vector machine model is obtained based on preset transmission parameter information and transmission delay training corresponding to the preset transmission parameter information. After the slave clock device sends the delay request message to the master clock device, the slave clock device may record a second sending time for sending the delay request message, and may receive a delay response message sent by the master clock device. The delay response message carries a second receiving time corresponding to the delay request message, and second transmission parameter information between the master clock device and the slave clock device when the delay request message is received. Then, the slave clock device may input the second transmission parameter information into the support vector machine model, and predict a second transmission time at which the delay request packet is transmitted. Furthermore, the slave clock device may calculate a clock offset of the slave clock device with respect to the master clock device according to the first transmission time, the first reception time, the second transmission time, the second reception time, the first transmission delay, the second transmission delay, and a preset clock offset calculation formula. And, the clock of the slave clock device is calibrated using the clock offset. Therefore, the accurate clock offset can be calculated, the clock of the slave clock equipment can be calibrated by utilizing the clock offset, and the time synchronization precision of the master clock equipment and the slave clock equipment is improved.
Optionally, the preset clock offset calculation formula is as follows:
t2-t1=offset+delay1;
t4-t3=-offset+delay2;
2offset=[(t2-t1-delay1)-(t4-t3-delay2)];
wherein t1 is a first sending time; t2 is a first receiving time; t3 is a second transmission time; t4 is a second reception time; delay1 is the first transmission delay; delay2 is the second transmission delay; offset is the clock offset.
Optionally, the clock synchronization apparatus further includes:
a third receiving module, configured to receive a preset following message sent by the master clock device after receiving a preset synchronization message sent by the master clock device before inputting the first transmission parameter information to a pre-constructed support vector machine model and predicting to obtain a first transmission delay for transmitting the synchronization message; the preset following message carries a transmission parameter information sample which is used as transmission parameter information between the master clock device and the slave clock device when the preset synchronous message is sent.
And the obtaining module is used for obtaining the transmission delay marked by the user and corresponding to the transmission parameter information sample as a transmission delay sample.
And the training module is used for training to obtain the support vector machine model by utilizing the transmission parameter information sample, the transmission delay sample and a preset support vector machine algorithm.
Optionally, the transmission parameter information may include:
one or more of the noise intensity of a transmission channel between the master clock device and the slave clock device, the distance between the master clock device and the slave clock device, the encoding rate of the master clock device, the encoding rate of the slave clock device, the decoding rate of the master clock device, the decoding rate of the slave clock device, the device aging degree value of the master clock device, the device aging degree value of the slave clock device and the transfer times of message transmission.
Optionally, the transmission parameter information is obtained by screening the master clock device based on the delay influence value; and the delay influence value is the influence value of the transmission parameter information on the transmission delay sample.
The embodiment of the present application further provides a slave clock device, as shown in fig. 4, which includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401 is configured to implement the method steps in any of the above embodiments of the clock synchronization method when executing the program stored in the memory 403.
In this embodiment of the present application, after receiving a synchronization packet sent by a master clock device, a slave clock device may record a first receiving time at which the synchronization packet is received, and may receive a following packet sent by the master clock device. The following message carries a first sending time of the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent. Then, the slave clock device inputs the first transmission parameter information into a pre-constructed support vector machine model, and a first transmission delay for transmitting the synchronous message is obtained through prediction. The support vector machine model is obtained based on preset transmission parameter information and transmission delay training corresponding to the preset transmission parameter information. After the slave clock device sends the delay request message to the master clock device, the slave clock device may record a second sending time for sending the delay request message, and may receive a delay response message sent by the master clock device. The delay response message carries a second receiving time corresponding to the delay request message, and second transmission parameter information between the master clock device and the slave clock device when the delay request message is received. Then, the slave clock device may input the second transmission parameter information into the support vector machine model, and predict a second transmission time at which the delay request packet is transmitted. Furthermore, the slave clock device may calculate a clock offset of the slave clock device with respect to the master clock device according to the first transmission time, the first reception time, the second transmission time, the second reception time, the first transmission delay, the second transmission delay, and a preset clock offset calculation formula. And, the clock of the slave clock device is calibrated using the clock offset. Therefore, the accurate clock offset can be calculated, the clock of the slave clock equipment can be calibrated by utilizing the clock offset, and the time synchronization precision of the master clock equipment and the slave clock equipment is improved.
The communication bus mentioned in the network device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the network device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, or discrete hardware components.
Based on the same technical concept, embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method steps in any of the above embodiments of the clock synchronization method are implemented.
Based on the same technical concept, embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the method steps in any of the above-mentioned clock synchronization method embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the device, the slave clock device and the computer-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some parts of the description of the method embodiments.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (8)

1. A clock synchronization method is applied to a slave clock device and comprises the following steps:
after receiving a synchronous message sent by a master clock device, recording a first receiving moment when the synchronous message is received, and receiving a following message sent by the master clock device; the following message carries a first sending time corresponding to the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent;
inputting the first transmission parameter information into a pre-constructed support vector machine model, and predicting to obtain a first transmission delay for transmitting the synchronous message; the support vector machine model is obtained by training based on transmission parameter information samples and transmission delay samples corresponding to the transmission parameter information samples;
after the time delay request message is sent to the master clock equipment, recording a second sending moment of sending the time delay request message, and receiving a time delay response message sent by the master clock equipment; the delay response message carries a second receiving time corresponding to the delay request message, and second transmission parameter information between the master clock device and the slave clock device when the delay request message is received;
inputting the second transmission parameter information into the support vector machine model, and predicting to obtain a second transmission delay for transmitting the delay request message;
calculating the clock offset of the slave clock device relative to the master clock device according to the first sending time, the first receiving time, the second sending time, the second receiving time, the first transmission delay, the second transmission delay and a preset clock offset calculation formula;
calibrating a clock of the slave clock device using the clock offset;
the transmission parameter information includes:
one or more of a noise strength of a transmission channel between the master clock device and the slave clock device, a distance between the master clock device and the slave clock device, an encoding rate of the master clock device, an encoding rate of the slave clock device, a decoding rate of the master clock device, a decoding rate of the slave clock device, a device aging degree value of the master clock device, a device aging degree value of the slave clock device, and a transfer number of messages.
2. The method of claim 1, wherein the predetermined clock offset is calculated by the formula:
t2-t1=offset+delay1;
t4-t3=-offset+delay2;
2offset=[(t2-t1-delay1)-(t4-t3-delay2)];
wherein t1 is the first sending time; the t2 is the first receiving time; the t3 is the second sending time; the t4 is the second receiving time; the delay1 is the first transmission delay; the delay2 is the second transmission delay; the offset is the clock offset.
3. The method according to claim 1, before the inputting the first transmission parameter information into a pre-constructed support vector machine model and predicting a first transmission delay for transmitting the sync message, further comprising:
after receiving a preset synchronous message sent by the master clock equipment, receiving a preset follow-up message sent by the master clock equipment; the preset follow-up message carries a transmission parameter information sample which is used as transmission parameter information between the master clock device and the slave clock device when the preset synchronous message is sent;
acquiring transmission delay marked by a user and corresponding to the transmission parameter information sample as a transmission delay sample;
and training to obtain the support vector machine model by using the transmission parameter information sample, the transmission delay sample and a preset support vector machine algorithm.
4. The method according to claim 3, wherein the transmission parameter information is obtained by screening the master clock device based on a delay impact value; and the delay influence value is the influence value of the transmission parameter information on the transmission delay sample.
5. A clock synchronization apparatus, applied to a slave clock device, the apparatus comprising:
the first receiving module is used for recording a first receiving moment when a synchronous message sent by a master clock device is received and receiving a following message sent by the master clock device; the following message carries a first sending time corresponding to the synchronous message, and first transmission parameter information between the master clock device and the slave clock device when the synchronous message is sent;
the first prediction module is used for inputting the first transmission parameter information into a pre-constructed support vector machine model and predicting to obtain a first transmission delay for transmitting the synchronous message; the support vector machine model is obtained by training based on transmission parameter information samples and transmission delay samples corresponding to the transmission parameter information samples;
the second receiving module is used for recording a second sending time for sending the delay request message after sending the delay request message to the master clock equipment, and receiving a delay response message sent by the master clock equipment; the delay response message carries a second receiving time corresponding to the delay request message, and second transmission parameter information between the master clock device and the slave clock device when the delay request message is received;
the second prediction module is used for inputting the second transmission parameter information into the support vector machine model and predicting to obtain a second transmission delay for transmitting the delay request message;
a calculating module, configured to calculate a clock offset of the slave clock device relative to the master clock device according to the first sending time, the first receiving time, the second sending time, the second receiving time, the first transmission delay, the second transmission delay, and a preset clock offset calculation formula;
the calibration module is used for calibrating the clock of the slave clock equipment according to the clock offset;
the transmission parameter information includes:
one or more of a noise strength of a transmission channel between the master clock device and the slave clock device, a distance between the master clock device and the slave clock device, an encoding rate of the master clock device, an encoding rate of the slave clock device, a decoding rate of the master clock device, a decoding rate of the slave clock device, a device aging degree value of the master clock device, a device aging degree value of the slave clock device, and a transfer number of messages.
6. The apparatus of claim 5, wherein the predetermined clock offset is calculated by the following formula:
t2-t1=offset+delay1;
t4-t3=-offset+delay2;
2offset=[(t2-t1-delay1)-(t4-t3-delay2)];
wherein t1 is the first sending time; the t2 is the first receiving time; the t3 is the second sending time; the t4 is the second receiving time; the delay1 is the first transmission delay; the delay2 is the second transmission delay; the offset is the clock offset.
7. The apparatus of claim 5, further comprising:
a third receiving module, configured to receive a preset follow-up packet sent by the master clock device after receiving a preset synchronization packet sent by the master clock device before inputting the first transmission parameter information to a pre-constructed support vector machine model and predicting a first transmission delay for transmitting the synchronization packet; the preset follow-up message carries a transmission parameter information sample which is used as transmission parameter information between the master clock device and the slave clock device when the preset synchronous message is sent;
an obtaining module, configured to obtain a transmission delay marked by a user and corresponding to the transmission parameter information sample as a transmission delay sample;
and the training module is used for training to obtain the support vector machine model by utilizing the transmission parameter information sample, the transmission delay sample and a preset support vector machine algorithm.
8. The apparatus according to claim 7, wherein the transmission parameter information is obtained by the master clock device based on a delay impact value screening; and the delay influence value is the influence value of the transmission parameter information on the transmission delay sample.
CN201910894549.2A 2019-09-20 2019-09-20 Clock synchronization method and device Expired - Fee Related CN110557826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910894549.2A CN110557826B (en) 2019-09-20 2019-09-20 Clock synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910894549.2A CN110557826B (en) 2019-09-20 2019-09-20 Clock synchronization method and device

Publications (2)

Publication Number Publication Date
CN110557826A CN110557826A (en) 2019-12-10
CN110557826B true CN110557826B (en) 2020-12-04

Family

ID=68741279

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910894549.2A Expired - Fee Related CN110557826B (en) 2019-09-20 2019-09-20 Clock synchronization method and device

Country Status (1)

Country Link
CN (1) CN110557826B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132041B (en) * 2019-12-31 2022-03-04 中移(成都)信息通信科技有限公司 Data transmission delay calculation method and device
CN113325919B (en) * 2021-06-24 2024-01-23 新华三技术有限公司 Clock compensation method and device
CN117394972B (en) * 2023-10-23 2024-05-24 合芯科技有限公司 Transmission delay determining method, system and processing chip
CN117439691B (en) * 2023-10-23 2024-05-28 合芯科技有限公司 Time information synchronization system, processor chip and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364863A (en) * 2008-09-27 2009-02-11 华为技术有限公司 Time synchronizing method, apparatus and system for master, slave time clock side in synchronous network
CN101854240A (en) * 2010-05-11 2010-10-06 上海奇微通讯技术有限公司 Method for improving wireless time service precision
CN102111380A (en) * 2009-12-25 2011-06-29 华为技术有限公司 Time synchronization method, device and system
CN108650050A (en) * 2018-05-09 2018-10-12 西安电子科技大学 A kind of distributed network clock synchronous method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8473638B2 (en) * 2008-05-02 2013-06-25 James Aweya Method and apparatus for time and frequency transfer in communication networks
CN101834712B (en) * 2010-04-19 2012-11-14 浙江大学 Method for realizing accurate time synchronization by utilizing IEEE1588 protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364863A (en) * 2008-09-27 2009-02-11 华为技术有限公司 Time synchronizing method, apparatus and system for master, slave time clock side in synchronous network
CN102111380A (en) * 2009-12-25 2011-06-29 华为技术有限公司 Time synchronization method, device and system
CN101854240A (en) * 2010-05-11 2010-10-06 上海奇微通讯技术有限公司 Method for improving wireless time service precision
CN108650050A (en) * 2018-05-09 2018-10-12 西安电子科技大学 A kind of distributed network clock synchronous method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于改进型时间窗LS-SVM 的网络不确定时延预测;熊南;《工业控制计算机》;20121231;第1-3节 *

Also Published As

Publication number Publication date
CN110557826A (en) 2019-12-10

Similar Documents

Publication Publication Date Title
CN110557826B (en) Clock synchronization method and device
CN110636536A (en) Frequency calibration method and device
CN111194414A (en) Temporal alignment of motion detection signals using buffers
CN112787877B (en) Network delay detection method and related equipment
CN112040526B (en) Communication path selection method, equipment and communication system
CN113572560B (en) Method, electronic device, and storage medium for determining clock synchronization accuracy
US10057155B2 (en) Method and apparatus for determining automatic scanning action
RU2017100594A (en) METHODS OF ADAPTING THE MEASUREMENT FREQUENCY TAKING INTO ACCOUNT THE CARRIER FREQUENCY
JP2018152843A5 (en)
JP4697431B2 (en) Radio wave monitoring apparatus and method, radio wave monitoring program
Oser et al. Identifying devices of the internet of things using machine learning on clock characteristics
CN116866828A (en) Position information determining method, device, server and storage medium
CN113207146B (en) Wireless communication network quality monitoring system and method
CN107438268B (en) Method and device for accelerating wireless network for mobile device
CN114298326A (en) Model training method and device and model training system
CN110677683B (en) Video storage and video access method and distributed storage and video access system
CN111315026B (en) Channel selection method, device, gateway and computer readable storage medium
WO2018164618A1 (en) Prediction of a performance indicator
JP6505223B2 (en) Method and apparatus for transmitting data frames
US20150281014A1 (en) Packet analysis apparatus and packet analysis method
JP2016136714A (en) Radio communication using state measuring method
CN106603613A (en) Request processing method and apparatus
US20230194680A1 (en) Method for Estimating the Time of Flight Between a First Equipment Item and a Second Equipment Item.
CN105337784A (en) Packet loss test method, test device and system
Toma et al. USRP-Based Prototype for Real-Time Estimation of Channel Activity Statistics in Spectrum Sharing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201204

Termination date: 20210920