CN114390666B - Communication module time synchronization method, equipment and computer readable storage medium - Google Patents

Communication module time synchronization method, equipment and computer readable storage medium Download PDF

Info

Publication number
CN114390666B
CN114390666B CN202210107318.4A CN202210107318A CN114390666B CN 114390666 B CN114390666 B CN 114390666B CN 202210107318 A CN202210107318 A CN 202210107318A CN 114390666 B CN114390666 B CN 114390666B
Authority
CN
China
Prior art keywords
time
clock
slave
master
clocks
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.)
Active
Application number
CN202210107318.4A
Other languages
Chinese (zh)
Other versions
CN114390666A (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.)
Gosuncn Iot Technology Co ltd
Original Assignee
Gosuncn Iot Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gosuncn Iot Technology Co ltd filed Critical Gosuncn Iot Technology Co ltd
Priority to CN202210107318.4A priority Critical patent/CN114390666B/en
Publication of CN114390666A publication Critical patent/CN114390666A/en
Application granted granted Critical
Publication of CN114390666B publication Critical patent/CN114390666B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/003Arrangements to increase tolerance to errors in transmission or reception timing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • 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/001Synchronization between nodes
    • H04W56/002Mutual synchronization
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/004Synchronisation arrangements compensating for timing error of reception due to propagation delay
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention discloses a communication module time synchronization method, equipment and a computer readable storage medium, wherein the method comprises the following steps: taking one communication module among a plurality of communication modules as a master clock and the other communication modules as slave clocks which are in network connection with the master clock; obtaining network delay time between each group of master clock and slave clock through time deviation measurement and delay measurement between each group of master clock and slave clock; carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time; and carrying out time compensation and calibration on the synchronous time of each slave clock through the normalized network delay time. The time synchronization when the multi-wireless communication module is networked is realized, and the application scene requirement of the Internet of things with higher requirement on time precision is met.

Description

Communication module time synchronization method, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of mobile communications, and in particular, to a method and apparatus for time synchronization of a communication module, and a computer readable storage medium.
Background
In the prior art, NTP (network time protocol) time of a communication module is obtained from an NTP server through a network application protocol, but the following network transmission delays inevitably exist due to mobile communication: transmission delay: the time for the node to construct a synchronous message and submit the message to the MAC layer; channel access latency: the time for transmitting the synchronous message from the detection of whether the channel is idle to the start of the physical layer is longer, the randomness of the channel access delay is larger, and the influence of the current channel idle degree and the network load condition is larger; transmission delay: the time for the sending node to transmit the synchronous message outwards through the antenna; propagation delay: the time taken for a node to propagate in the medium from a sending node to a receiving node; receiving time delay: the physical layer of the receiving node receives the time used by the synchronous message through the antenna; processing time delay: and the time for the receiving node to process the message.
In summary, considering that the accuracy of the transmission delay of the existing multi-wireless communication module during networking is only tens of milliseconds to one second, the requirement of high-accuracy time synchronization under the application field of the internet of things cannot be met, a technical scheme capable of correcting the transmission delay during networking of the multi-wireless communication module and improving the transmission accuracy is needed.
Disclosure of Invention
In order to solve the technical defects in the prior art, the invention provides a time synchronization method of a communication module, which comprises the following steps:
one communication module of the plurality of communication modules is used as a master clock, and the other communication modules are used as slave clocks which are connected with the master clock in a network.
The network delay time between each group of master clock and slave clock is obtained through time deviation measurement and delay measurement between each group of master clock and slave clock.
And carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time.
And carrying out time compensation and calibration on the synchronous time of each slave clock through the normalized network delay time.
Optionally, the step of using one communication module of the plurality of communication modules as a master clock and using the other communication modules as slave clocks that are in network connection with the master clock includes:
and determining all the communication modules connected with the time synchronization server.
When the synchronous time compensation and calibration requirements are generated, one communication module is selected from all the communication modules to serve as a master clock, the other communication modules serve as slave clocks, and network connection between each group of master clocks and each group of slave clocks is established.
Optionally, the obtaining the network delay time between each group of master and slave clocks through time deviation measurement and delay measurement between each group of master and slave clocks includes:
and calculating the deviation value of the slave clock and the master clock between each group of master clock and slave clock, and correcting the time of the slave clock through the deviation value so as to keep the master clock and the slave clock of each group synchronous.
And acquiring network delay time between each group of master clock and each group of slave clock through delay measurement and the deviation value.
Optionally, the step of performing weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time includes:
obtaining the network delay time T between each group of master clock and slave clock delay [k]Where k is the number of groups of the master and slave clocks.
By passing throughThe network delay time between the master and slave clocks of all groups is weighted averaged, wherein +.>And normalizing the network delay time.
Optionally, the time compensating and calibrating the synchronization time of each slave clock by the normalized network delay time includes:
recording the kth synchronization time acquired from the clock to the time synchronization server as T k-ntp
According toTime compensating and calibrating the synchronous time of each slave clock, wherein T is k And the k-th calibrated synchronization time acquired from the clock to the time synchronization server.
The invention also provides a communication module time synchronization device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the computer program is realized when being executed by the processor:
one communication module of the plurality of communication modules is used as a master clock, and the other communication modules are used as slave clocks which are connected with the master clock in a network.
The network delay time between each group of master clock and slave clock is obtained through time deviation measurement and delay measurement between each group of master clock and slave clock.
And carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time.
And carrying out time compensation and calibration on the synchronous time of each slave clock through the normalized network delay time.
Optionally, the computer program is implemented when executed by the processor:
and determining all the communication modules connected with the time synchronization server.
When the synchronous time compensation and calibration requirements are generated, one communication module is selected from all the communication modules to serve as a master clock, the other communication modules serve as slave clocks, and network connection between each group of master clocks and each group of slave clocks is established.
Optionally, the computer program is implemented when executed by the processor:
and calculating the deviation value of the slave clock and the master clock between each group of master clock and slave clock, and correcting the time of the slave clock through the deviation value so as to keep the master clock and the slave clock of each group synchronous.
And acquiring network delay time between each group of master clock and each group of slave clock through delay measurement and the deviation value.
Optionally, the computer program is implemented when executed by the processor:
obtaining the network delay time T between each group of master clock and slave clock delay [k]Where k is the number of groups of the master and slave clocks.
By passing throughThe network delay time between the master and slave clocks of all groups is weighted averaged, wherein +.>Delay time for the normalized network;
recording the kth synchronization time acquired from the clock to the time synchronization server as T k-ntp
According toTime compensating and calibrating the synchronous time of each slave clock, wherein T is k And the k-th calibrated synchronization time acquired from the clock to the time synchronization server.
The invention also provides a computer readable storage medium, the computer readable storage medium stores a communication module time synchronization program, and the communication module time synchronization program realizes the steps of the communication module time synchronization method according to any one of the above steps when being executed by a processor.
The communication module time synchronization method, the device and the computer readable storage medium are implemented by taking one communication module of a plurality of communication modules as a master clock and taking other communication modules as slave clocks which are connected with the master clock in a network manner; obtaining network delay time between each group of master clock and slave clock through time deviation measurement and delay measurement between each group of master clock and slave clock; carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time; and carrying out time compensation and calibration on the synchronous time of each slave clock through the normalized network delay time. The time synchronization when the multi-wireless communication module is networked is realized, and the application scene requirement of the Internet of things with higher requirement on time precision is met.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart of a communication module time synchronization method according to a first embodiment of the present invention;
FIG. 2 is a connection diagram of a second embodiment of the time synchronization method of the communication module of the present invention;
fig. 3 is a measurement diagram of a second embodiment of the time synchronization method of the communication module of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
Example 1
Fig. 1 is a flowchart of a communication module time synchronization method according to a first embodiment of the present invention. A method for time synchronization of a communication module, the method comprising:
s1, taking one communication module among a plurality of communication modules as a master clock and taking other communication modules as slave clocks which are connected with the master clock in a network.
S2, obtaining network delay time between each group of master clocks and each group of slave clocks through time deviation measurement and delay measurement between each group of master clocks and each group of slave clocks.
And S3, carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time.
And S4, carrying out time compensation and calibration on the synchronous time of each slave clock through the normalized network delay time.
In this embodiment, first, NTP time acquired by one communication module is selected as a master clock, and NTP time acquired by other communication modules is used as a slave clock; then, adopting IEEE1588v2 protocol to carry out deviation measurement and delay measurement, and obtaining network transmission delay time between each master clock group and each slave clock group; and finally, carrying out weighted average on the network delay time of each master clock group and each slave clock group to obtain normalized network delay time.
In this embodiment, it is considered that the IEEE1588v2 single step mode time synchronization algorithm can be divided into two phases of deviation measurement and delay measurement. Based on this, one set of master and slave clocks is selected for explanation.
First, in the first stage, a time deviation T is performed offset And (5) measuring. Specifically, the slave clock obtains T by calculating the deviation value from the master clock to correct the own time start And T end After the two time stamps, the deviation value of the master clock and the slave clock is calculated by using the following formula:
T offse t=T end -T start -T delay
calculating T from clock offset After the value, T is subtracted from the current time offset Synchronizing itself with the master clock.
Then, in the second phase, a delay measurement is performed. Specifically, the delay time of the message in the network transmission is measured, which comprises the following clock at T req When the delay_req message is sent to the master clock, the master clock is at T resp After receiving the message, and T resp Put in Delay Resp message and send back to the slave clock. The following calculation formula can be obtained after receiving the delay_resp message from the clock
T resp -T req =T delay -T offset
The network transmission delay is calculated by the two calculation formulas:
then, after obtaining the network delay time T of each group of master and slave clocks delay [k]Then, the normalized network delay time is obtained by weighted average according to the following formula
The weight is determined according to the number k (k > 1) of the actual master clock group and the actual slave clock group.
Finally, in the third stage, the NTP time of each wireless communication module can be combined with the fused normalized network delay time by the following formulaObtaining:
therefore, time synchronization during networking of the multiple wireless communication modules is realized, and the application scene requirement of the Internet of things with higher requirement on time precision is met.
It can be seen that, in this embodiment, based on the IEEE1588v2 (PTP) precise time protocol, a time synchronization scheme of a wireless communication module is provided, specifically, by selecting NTP time acquired by one communication module as a master clock, NTP time acquired by other communication modules as slave clocks, and using the IEEE1588v2 protocol to perform offset measurement and delay measurement, to acquire delay time between the master clock and the slave clock, so as to achieve time synchronization between each communication module. The embodiment can effectively improve the NTP time service precision of the wireless communication module, realize time synchronization when a plurality of wireless communication modules are networked, and can be applied to the application scene of the Internet of things with higher requirement on time precision.
Example two
Based on the above embodiment, please refer to the connection diagram shown in fig. 2, wherein the step of using one communication module of the plurality of communication modules as a master clock and using the other communication modules as slave clocks that are connected to the master clock through a network includes:
and determining all the communication modules connected with the time synchronization server.
When the synchronous time compensation and calibration requirements are generated, one communication module is selected from all the communication modules to serve as a master clock, the other communication modules serve as slave clocks, and network connection between each group of master clocks and each group of slave clocks is established.
In this embodiment, the master clock and the slave clock may be established by networking through a network protocol, including but not limited to a form of TCP protocol server-client, a form of LWM2M protocol, and the like, where the networking purpose of the master clock device and the slave clock device is to connect the master clock device and the slave clock device.
In this embodiment, the number of slave clock groups is k, and k >1 is required; alternatively, if the k value is larger, the number of samples finally obtained is larger, and the normalized network delay time finally calculated is more accurate.
In this embodiment, the obtaining the network delay time between each group of master and slave clocks through the time deviation measurement and the delay measurement between each group of master and slave clocks includes:
and calculating the deviation value of the slave clock and the master clock between each group of master clock and slave clock, and correcting the time of the slave clock through the deviation value so as to keep the master clock and the slave clock of each group synchronous.
And acquiring network delay time between each group of master clock and each group of slave clock through delay measurement and the deviation value.
In the present embodiment, consider T delay [k]The network delay time of each master clock group and each slave clock group can be determined by the network delay when the master clock group and the slave clock group acquire the NTP time, the acquired NTP time is acquired through a TCP protocol and can be calculated through a time stamp in a network message; there is a certain difference due to factors such as radio frequency parameters of each device, network environment, etc. Therefore, there is a certain error, so the time offset Toffset of the master and slave clocks needs to be subtracted when calculating them.
In this embodiment, please refer to the measurement schematic diagram shown in fig. 3, wherein the step of performing weighted average on the network delay time between the master clocks and the slave clocks of all the groups to obtain normalized network delay time includes:
obtaining the network delay time T between each group of master clock and slave clock delay [k]Where k is the number of groups of the master and slave clocks.
By passing throughThe network delay time between the master and slave clocks of all groups is weighted averaged, wherein +.>And normalizing the network delay time.
In this embodiment, the master clock is unique, e.g., may be denoted as P, the slave clocks have k, e.g., may be denoted as S1, S2, the term "Sk" means that the master and slave clocks may be distributed, and the master and slave clocks may be distributed, respectively, in a single clock cycle; the weight of each group is the reciprocal of the k value.
In this embodiment, because of the uncertainty and unpredictability of the network delay, the network delay time in the same network domain is weighted and averaged by collecting k groups of master devices and slave devices, so as to obtain a normalized network delay time, thereby enabling the NTP time finally obtained by k slave devices to be further refined.
In this embodiment, the performing time compensation and calibration on the synchronization time of each slave clock by using the normalized network delay time includes:
recording the kth synchronization time acquired from the clock to the time synchronization server as T k-ntp
According toTime compensating and calibrating the synchronous time of each slave clock, wherein T is k And the k-th calibrated synchronization time acquired from the clock to the time synchronization server.
In the embodiment, a 1-K distributed mode is adopted, 1 master clock device and K slave clock devices are set, on the premise that the master clocks are consistent, calculation of time deviation and network delay is carried out on the K slave clock devices, and finally the K slave clock devices are synchronized to K slave clock devices, so that the reliability and the accuracy are higher.
In this embodiment, the master clock and the k slave clocks all uniformly acquire the same time from the NTP server as the start time, and then the IEEE1588v2 (PTP) accurate time protocol is adopted to measure the time deviation and network delay between the master clock and the slave clock, so as to perform time compensation and calibration on the k slave clock devices, and finally achieve the purpose of time synchronization of the k devices.
Example III
The invention also provides a communication module time synchronization device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the computer program is realized when being executed by the processor:
one communication module of the plurality of communication modules is used as a master clock, and the other communication modules are used as slave clocks which are connected with the master clock in a network.
The network delay time between each group of master clock and slave clock is obtained through time deviation measurement and delay measurement between each group of master clock and slave clock.
And carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time.
And carrying out time compensation and calibration on the synchronous time of each slave clock through the normalized network delay time.
In this embodiment, first, NTP time acquired by one communication module is selected as a master clock, and NTP time acquired by other communication modules is used as a slave clock; then, adopting IEEE1588v2 protocol to carry out deviation measurement and delay measurement, and obtaining network transmission delay time between each master clock group and each slave clock group; and finally, carrying out weighted average on the network delay time of each master clock group and each slave clock group to obtain normalized network delay time.
In this embodiment, it is considered that the IEEE1588v2 single step mode time synchronization algorithm can be divided into two phases of deviation measurement and delay measurement. Based on this, one set of master and slave clocks is selected for explanation.
First, in the first stage, a time deviation T is performed offset And (5) measuring. In particular, the slave clock calculates the deviation value from the master clock,to correct own time, T is obtained from the clock start And T end After the two time stamps, the deviation value of the master clock and the slave clock is calculated by using the following formula:
T offset =T end -T start -T delay
calculating T from clock offset After the value, T is subtracted from the current time offset Synchronizing itself with the master clock.
Then, in the second phase, a delay measurement is performed. Specifically, the delay time of the message in the network transmission is measured, which comprises the following clock at T req When the delay_req message is sent to the master clock, the master clock is at T resp After receiving the message, and T resp Put in Delay Resp message and send back to the slave clock. The following calculation formula can be obtained after receiving the delay_resp message from the clock
T resp -T req =T delay -T offset
The network transmission delay is calculated by the two calculation formulas:
T delay =[(T end -T start )-(T resp -T req )]/2。
then, after obtaining the network delay time T of each group of master and slave clocks delay [k]Then, the normalized network delay time is obtained by weighted average according to the following formula
The weight is determined according to the number k (k > 1) of the actual master clock group and the actual slave clock group.
Finally, in the third stage, the NTP time of each wireless communication module can be combined with the fused normalized network delay time by the following formulaObtaining:
therefore, time synchronization during networking of the multiple wireless communication modules is realized, and the application scene requirement of the Internet of things with higher requirement on time precision is met.
It can be seen that, in this embodiment, based on the IEEE1588v2 (PTP) precise time protocol, a time synchronization scheme of a wireless communication module is provided, specifically, by selecting NTP time acquired by one communication module as a master clock, NTP time acquired by other communication modules as slave clocks, and using the IEEE1588v2 protocol to perform offset measurement and delay measurement, to acquire delay time between the master clock and the slave clock, so as to achieve time synchronization between each communication module. The embodiment can effectively improve the NTP time service precision of the wireless communication module, realize time synchronization when a plurality of wireless communication modules are networked, and can be applied to the application scene of the Internet of things with higher requirement on time precision.
Example IV
Based on the above embodiments, the computer program when executed by the processor implements:
and determining all the communication modules connected with the time synchronization server.
When the synchronous time compensation and calibration requirements are generated, one communication module is selected from all the communication modules to serve as a master clock, the other communication modules serve as slave clocks, and network connection between each group of master clocks and each group of slave clocks is established.
Optionally, the computer program is implemented when executed by the processor:
and calculating the deviation value of the slave clock and the master clock between each group of master clock and slave clock, and correcting the time of the slave clock through the deviation value so as to keep the master clock and the slave clock of each group synchronous.
And acquiring network delay time between each group of master clock and each group of slave clock through delay measurement and the deviation value.
Optionally, the computer program is implemented when executed by the processor:
obtaining the network delay time T between each group of master clock and slave clock delay [k]Where k is the number of groups of the master and slave clocks.
By passing throughThe network delay time between the master and slave clocks of all groups is weighted averaged, wherein +.>Delay time for the normalized network;
recording the kth synchronization time acquired from the clock to the time synchronization server as T k-ntp
According toTime compensating and calibrating the synchronous time of each slave clock, wherein T is k And the k-th calibrated synchronization time acquired from the clock to the time synchronization server.
Based on the above embodiment, please refer to the connection diagram shown in fig. 2, wherein the step of using one communication module of the plurality of communication modules as a master clock and using the other communication modules as slave clocks that are connected to the master clock through a network includes:
and determining all the communication modules connected with the time synchronization server.
When the synchronous time compensation and calibration requirements are generated, one communication module is selected from all the communication modules to serve as a master clock, the other communication modules serve as slave clocks, and network connection between each group of master clocks and each group of slave clocks is established.
In this embodiment, the master clock and the slave clock may be established by networking through a network protocol, including but not limited to a form of TCP protocol server-client, a form of LWM2M protocol, and the like, where the networking purpose of the master clock device and the slave clock device is to connect the master clock device and the slave clock device.
In this embodiment, the number of slave clock groups is k, and k >1 is required; alternatively, if the k value is larger, the number of samples finally obtained is larger, and the normalized network delay time finally calculated is more accurate.
In this embodiment, the obtaining the network delay time between each group of master and slave clocks through the time deviation measurement and the delay measurement between each group of master and slave clocks includes:
and calculating the deviation value of the slave clock and the master clock between each group of master clock and slave clock, and correcting the time of the slave clock through the deviation value so as to keep the master clock and the slave clock of each group synchronous.
And acquiring network delay time between each group of master clock and each group of slave clock through delay measurement and the deviation value.
In the present embodiment, consider T delay [k]The network delay time of each master clock group and each slave clock group can be determined by the network delay when the master clock group and the slave clock group acquire the NTP time, the acquired NTP time is acquired through a TCP protocol and can be calculated through a time stamp in a network message; there is a certain difference due to factors such as radio frequency parameters of each device, network environment, etc. Therefore, there is a certain error, so the time offset Toffset of the master and slave clocks needs to be subtracted when calculating them.
In this embodiment, please refer to the measurement schematic diagram shown in fig. 3, wherein the step of performing weighted average on the network delay time between the master clocks and the slave clocks of all the groups to obtain normalized network delay time includes:
obtaining the network delay time T between each group of master clock and slave clock delay [k]Where k is the number of groups of the master and slave clocks.
By passing throughThe network delay time between the master and slave clocks of all groups is weighted averaged, wherein +.>And normalizing the network delay time.
In this embodiment, the master clock is unique, e.g., may be denoted as P, the slave clocks have k, e.g., may be denoted as S1, S2, the term "Sk" means that the master and slave clocks may be distributed, and the master and slave clocks may be distributed, respectively, in a single clock cycle; the weight of each group is the reciprocal of the k value.
In this embodiment, because of the uncertainty and unpredictability of the network delay, the network delay time in the same network domain is weighted and averaged by collecting k groups of master devices and slave devices, so as to obtain a normalized network delay time, thereby enabling the NTP time finally obtained by k slave devices to be further refined.
In this embodiment, the performing time compensation and calibration on the synchronization time of each slave clock by using the normalized network delay time includes:
recording the kth synchronization time acquired from the clock to the time synchronization server as T k-ntp
According toTime compensating and calibrating the synchronous time of each slave clock, wherein T is k And the k-th calibrated synchronization time acquired from the clock to the time synchronization server.
In the embodiment, a 1-K distributed mode is adopted, 1 master clock device and K slave clock devices are set, on the premise that the master clocks are consistent, calculation of time deviation and network delay is carried out on the K slave clock devices, and finally the K slave clock devices are synchronized to K slave clock devices, so that the reliability and the accuracy are higher.
In this embodiment, the master clock and the k slave clocks all uniformly acquire the same time from the NTP server as the start time, and then the IEEE1588v2 (PTP) accurate time protocol is adopted to measure the time deviation and network delay between the master clock and the slave clock, so as to perform time compensation and calibration on the k slave clock devices, and finally achieve the purpose of time synchronization of the k devices.
Example five
Based on the above embodiment, the present invention further provides a computer readable storage medium, where a communication module time synchronization program is stored, where the communication module time synchronization program, when executed by a processor, implements the steps of the communication module time synchronization method according to any one of the above embodiments.
It should be noted that the medium embodiment and the method embodiment belong to the same concept, the specific implementation process of the medium embodiment and the method embodiment are detailed, and technical features in the method embodiment are correspondingly applicable in the medium embodiment, which is not repeated herein.
It should be noted that, in this document, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (3)

1. A method for time synchronization of a communication module, the method comprising:
taking one communication module among a plurality of communication modules as a master clock and the other communication modules as slave clocks which are in network connection with the master clock;
obtaining network delay time between each group of master clock and slave clock through time deviation measurement and delay measurement between each group of master clock and slave clock;
carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time;
performing time compensation and calibration on the synchronous time of each slave clock through the normalized network delay time;
the method for setting one communication module as a master clock and setting other communication modules as slave clocks which are connected with the master clock in a network comprises the following steps:
determining all the communication modules connected with a time synchronization server;
when the compensation and calibration requirements of synchronous time are generated, selecting one communication module from all the communication modules as a master clock, using other communication modules as slave clocks, and establishing network connection between each group of master and slave clocks;
the method for obtaining the network delay time between each group of master and slave clocks through the time deviation measurement and the delay measurement between each group of master and slave clocks comprises the following steps:
calculating the deviation value of the slave clock and the master clock between each group of master clocks and each group of slave clocks, and correcting the time of the slave clocks through the deviation value so as to keep the master clocks and the slave clocks of each group synchronous;
acquiring network delay time between each group of master clock and each group of slave clock through delay measurement and the deviation value;
the step of carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time comprises the following steps:
acquiring the network delay time between each group of master clock and slave clockWherein k is the group number of the master clock and the slave clock;
by passing throughThe network delay time between the master and slave clocks of all groups is weighted averaged, wherein +.>Delay time for the normalized network;
wherein, the liquid crystal display device comprises a liquid crystal display device,
the master clock is unique and is denoted as P, the slave clocks are provided with k, and are denoted as S1, S2 and … S k …, by P-S1, P-S2, …, P-S k … form distributed master and slave clock groups, and the weight of each master and slave clock group is the reciprocal of k value;
the time compensation and calibration of the synchronization time of each slave clock by the normalized network delay time comprises the following steps:
recording the kth synchronization time acquired from the clock to the time synchronization server as T k-ntp
According toTime compensating and calibrating the synchronous time of each slave clock, wherein T is k And the k-th calibrated synchronization time acquired from the clock to the time synchronization server.
2. A communication module time synchronization device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being implemented when executed by the processor:
taking one communication module among a plurality of communication modules as a master clock and the other communication modules as slave clocks which are in network connection with the master clock;
obtaining network delay time between each group of master clock and slave clock through time deviation measurement and delay measurement between each group of master clock and slave clock;
carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time;
performing time compensation and calibration on the synchronous time of each slave clock through the normalized network delay time;
the method for setting one communication module as a master clock and setting other communication modules as slave clocks which are connected with the master clock in a network comprises the following steps:
determining all the communication modules connected with a time synchronization server;
when the compensation and calibration requirements of synchronous time are generated, selecting one communication module from all the communication modules as a master clock, using other communication modules as slave clocks, and establishing network connection between each group of master and slave clocks;
the method for obtaining the network delay time between each group of master and slave clocks through the time deviation measurement and the delay measurement between each group of master and slave clocks comprises the following steps:
calculating the deviation value of the slave clock and the master clock between each group of master clocks and each group of slave clocks, and correcting the time of the slave clocks through the deviation value so as to keep the master clocks and the slave clocks of each group synchronous;
acquiring network delay time between each group of master clock and each group of slave clock through delay measurement and the deviation value;
the step of carrying out weighted average on the network delay time between the master clocks and the slave clocks of all groups to obtain normalized network delay time comprises the following steps:
obtaining the network delay time T between each group of master clock and slave clock delay [k]Wherein k is the number of groups of the master clock and the slave clock;
by passing throughThe network delay time between the master and slave clocks of all groups is weighted averaged, wherein +.>Delay time for the normalized network;
wherein, the liquid crystal display device comprises a liquid crystal display device,
the master clock is unique and is denoted as P, the slave clocks are provided with k, and are denoted as S1, S2 and … S k …, by P-S1, P-S2, …, P-S k … form distributed master and slave clock groups, and the weight of each master and slave clock group is the reciprocal of k value;
the time compensation and calibration of the synchronization time of each slave clock by the normalized network delay time comprises the following steps:
recording the kth synchronization time acquired from the clock to the time synchronization server as T k-ntp
According toTime compensating and calibrating the synchronous time of each slave clock, wherein T is k For the kth calibrated synchronization time acquired from the clock to the time synchronization server。
3. A computer readable storage medium, wherein a communication module time synchronization program is stored on the computer readable storage medium, which when executed by a processor, implements the steps of the communication module time synchronization method of claim 1.
CN202210107318.4A 2022-01-28 2022-01-28 Communication module time synchronization method, equipment and computer readable storage medium Active CN114390666B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210107318.4A CN114390666B (en) 2022-01-28 2022-01-28 Communication module time synchronization method, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210107318.4A CN114390666B (en) 2022-01-28 2022-01-28 Communication module time synchronization method, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114390666A CN114390666A (en) 2022-04-22
CN114390666B true CN114390666B (en) 2023-08-15

Family

ID=81203261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210107318.4A Active CN114390666B (en) 2022-01-28 2022-01-28 Communication module time synchronization method, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114390666B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227246A (en) * 2008-01-28 2008-07-23 中兴通讯股份有限公司 Method and apparatus for master-salve clock synchronization
CN101820500A (en) * 2009-02-27 2010-09-01 索尼公司 From the device, from the device time synchronization method, main device and electronic apparatus system
CN101834712A (en) * 2010-04-19 2010-09-15 浙江大学 Method for realizing accurate time synchronization by utilizing IEEE1588 protocol
CN102264011A (en) * 2010-05-27 2011-11-30 大唐移动通信设备有限公司 Method and device for determining time delay and performing clock synchronization based on GPON (gigabit-capable passive optical network)
CN103763055A (en) * 2013-10-18 2014-04-30 杭州联汇数字科技有限公司 Method for precise time synchronization
CN103988453A (en) * 2011-11-30 2014-08-13 大陆汽车有限责任公司 Method for synchronizing clocks in nodes of a vehicle network and node designed to perform the method
CN108418235A (en) * 2018-01-30 2018-08-17 国网电力科学研究院武汉南瑞有限责任公司 The compensation method that signal transmission clock applied to four fracture series trip devices synchronizes
CN108924207A (en) * 2018-06-26 2018-11-30 深圳高新兴物联科技有限公司 Terminal device and its system file update method, system and computer storage medium
CN109104261A (en) * 2018-09-28 2018-12-28 深圳高新兴物联科技有限公司 Local zone time acquisition methods, terminal and storage medium based on LBS
CN110572230A (en) * 2019-09-10 2019-12-13 北京邮电大学 correction method and device for realizing time synchronization
CN112751641A (en) * 2020-12-31 2021-05-04 网络通信与安全紫金山实验室 TSN network time synchronization method, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013066437A2 (en) * 2011-07-20 2013-05-10 Aviat Networks, Inc. Systems and methods of network synchronization

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227246A (en) * 2008-01-28 2008-07-23 中兴通讯股份有限公司 Method and apparatus for master-salve clock synchronization
CN101820500A (en) * 2009-02-27 2010-09-01 索尼公司 From the device, from the device time synchronization method, main device and electronic apparatus system
CN101834712A (en) * 2010-04-19 2010-09-15 浙江大学 Method for realizing accurate time synchronization by utilizing IEEE1588 protocol
CN102264011A (en) * 2010-05-27 2011-11-30 大唐移动通信设备有限公司 Method and device for determining time delay and performing clock synchronization based on GPON (gigabit-capable passive optical network)
CN103988453A (en) * 2011-11-30 2014-08-13 大陆汽车有限责任公司 Method for synchronizing clocks in nodes of a vehicle network and node designed to perform the method
CN103763055A (en) * 2013-10-18 2014-04-30 杭州联汇数字科技有限公司 Method for precise time synchronization
CN108418235A (en) * 2018-01-30 2018-08-17 国网电力科学研究院武汉南瑞有限责任公司 The compensation method that signal transmission clock applied to four fracture series trip devices synchronizes
CN108924207A (en) * 2018-06-26 2018-11-30 深圳高新兴物联科技有限公司 Terminal device and its system file update method, system and computer storage medium
CN109104261A (en) * 2018-09-28 2018-12-28 深圳高新兴物联科技有限公司 Local zone time acquisition methods, terminal and storage medium based on LBS
CN110572230A (en) * 2019-09-10 2019-12-13 北京邮电大学 correction method and device for realizing time synchronization
CN112751641A (en) * 2020-12-31 2021-05-04 网络通信与安全紫金山实验室 TSN network time synchronization method, equipment and storage medium

Also Published As

Publication number Publication date
CN114390666A (en) 2022-04-22

Similar Documents

Publication Publication Date Title
EP2952046B1 (en) Frequency offset compensation for wifi ranging
US11082141B2 (en) Wireless apparatus and wireless apparatus processing method
US8397095B2 (en) Method and apparatus for synchronizing time of day of terminal in convergent network
US11153838B1 (en) Time synchronization enhancements for integrated 5G-TSN networking
WO2017071270A1 (en) Local clock adjustment method, and time service method and device
CN110100408B (en) Method for interacting time synchronization message and network device
KR101685856B1 (en) Correction parameter calculation device and system, correction parameter calculation method, and computer program
CN109687931B (en) Time service method, device and readable storage medium for mobile network
CN102197611B (en) Method and device for packet network synchronization
EP3284217A1 (en) Methods, systems, and computer readable media for synchronizing timing among network interface cards (nics) in a network equipment test device
CN103814338A (en) Systems and methods of network synchronization
KR20050086799A (en) Device, system and method for obtaining timing information and ranging
CN111262755B (en) Network ranging method and device
EP3096570A1 (en) Time distribution in wireless communication systems
CN108235427A (en) A kind of method for measuring Tof and Toda
KR20090071923A (en) Method for synchronization using single timesync frame in bridged local area network and appratus thereof
CN114390666B (en) Communication module time synchronization method, equipment and computer readable storage medium
CN110933096A (en) Software-defined network time service system and time service method
CN114157377B (en) Power distribution terminal real-time clock synchronization method, synchronization system and power distribution terminal
KR20190094499A (en) apparatus for testing load capacity of ptp/ntp server
KR101605316B1 (en) frequency error estimating apparatus using Rx delay in PTP
JP2016152487A (en) Time synchronization method and time synchronization device
CN111464397A (en) Method and system for measuring bidirectional distance and clock error
JPH11223687A (en) Synchronizing system for internal timepieces among plural computers
JP2019035591A (en) Time management device, time reference device, reference time management system, and reference time management method

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 518000 606, block a, sharing building, No. 78, Keyuan North Road, songpingshan community, Xili street, Nanshan District, Shenzhen, Guangdong

Applicant after: Gosuncn IOT Technology Co.,Ltd.

Address before: 518000 606, block a, sharing building, No. 78, Keyuan North Road, songpingshan community, Xili street, Nanshan District, Shenzhen, Guangdong

Applicant before: Gaoxing Wulian Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant