CN112600641A - Network equipment time synchronization method, device, equipment and storage medium - Google Patents

Network equipment time synchronization method, device, equipment and storage medium Download PDF

Info

Publication number
CN112600641A
CN112600641A CN202011627016.7A CN202011627016A CN112600641A CN 112600641 A CN112600641 A CN 112600641A CN 202011627016 A CN202011627016 A CN 202011627016A CN 112600641 A CN112600641 A CN 112600641A
Authority
CN
China
Prior art keywords
time
node
message
deviation
time deviation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011627016.7A
Other languages
Chinese (zh)
Inventor
宋晓琴
邱文才
黄钧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yingterui Semiconductor Technology Co ltd
Original Assignee
Shenzhen Yingterui Semiconductor 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 Shenzhen Yingterui Semiconductor Technology Co ltd filed Critical Shenzhen Yingterui Semiconductor Technology Co ltd
Priority to CN202011627016.7A priority Critical patent/CN112600641A/en
Publication of CN112600641A publication Critical patent/CN112600641A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0682Clock or time synchronisation in a network by delay compensation, e.g. by compensation of propagation delay or variations thereof, by ranging

Landscapes

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

Abstract

The embodiment of the invention discloses a time synchronization method of network equipment, wherein the network equipment is a network node and receives a first message sent by a previous node; the first message carries the network protocol time of the last node; the method comprises the following steps: analyzing a first time deviation carried in the first message; the first time deviation is used for representing the time deviation between the previous node and the previous node; calculating a second time deviation between the current node and the previous node; and determining the network protocol time of the current node according to the first time deviation and the second time deviation. The time synchronization method for the network equipment provided by the embodiment of the invention can realize time deviation compensation in the time synchronization process, improve the performance of the network equipment and finally reduce the phase difference value between the end node and the head node.

Description

Network equipment time synchronization method, device, equipment and storage medium
Technical Field
The present invention relates to the field of communication networks, and in particular, to a method, an apparatus, a device, and a storage medium for time synchronization of network devices.
Background
In a typical networking of a 1588 protocol, a Grand Master (GM) is connected with a GPS (global positioning system) and used as a first node, and time information is transmitted downstream through a PTP (precision time protocol) message; the intermediate node BC1 equipment receives a PTP message sent by a GM, extracts time from the PTP message, calculates the time difference offset with the GM, then synchronizes with the GM, and meanwhile, BC1 equipment also sends the PTP message downstream to transmit PTP time; the BC2 device of the next node of the BC1 receives the PTP message of the BC1 device, synchronizes with the BC1, and at the same time, the BC2 device also sends the PTP message downstream, and so on. Each BC device synchronizes the upstream device and sends PTP messages to the downstream, which is convenient for downstream synchronization, so that the synchronization is completed hop by hop, and finally the synchronization of the whole link is completed. However, each hop cannot be absolutely synchronized to 0ns when completing synchronization with the upstream, which causes a certain performance loss. The performance of the synchronization degrades hop-by-hop as the number of hops increases.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for time synchronization of a network device, which can implement time offset compensation in a time synchronization process, improve performance of the network device, and finally reduce a phase difference between a terminal node and a head node.
In a first aspect, an embodiment of the present invention provides a method for time synchronization of a network device, where the network device is a network node and receives a first packet sent by a previous node; the first message carries the network protocol time of the last node; the method comprises the following steps:
analyzing the first time deviation carried in the first message; the first time deviation is used for representing the time deviation between the previous node and the previous node;
calculating a second time offset between the current node and the previous node;
and determining the network protocol time of the current node according to the first time deviation and the second time deviation.
Further, calculating a second time offset between the current node and the previous node comprises:
acquiring a message sending time stamp T1 of a previous node, a message receiving time T2 of a current node, a message sending time T3 of the current node and a message receiving time T4 of the previous node;
calculating a second time offset between the current node and the previous node according to the following formula:
the second time offset is (T2-T1-T3+ T4)/2.
Further, if the current node is an intermediate node, after determining the network protocol time of the current node according to the first time offset and the second time offset, the method further includes:
generating a second message, and adding the second time deviation and the network protocol time to the second message;
and sending the second message to a next node.
Further, analyzing the first time offset carried in the first packet includes:
judging whether the time synchronization flag bit in the first message is TRUE or not;
and if so, analyzing the first time deviation carried in the first message.
In a second aspect, an embodiment of the present invention further provides a device for time synchronization of network devices, including:
the first time deviation analysis module is used for analyzing the first time deviation carried in the first message; the first time deviation is used for representing the time deviation between the previous node and the previous node;
the second time deviation calculation module is used for calculating a second time deviation between the current node and the previous node;
and the network protocol time determining module is used for determining the network protocol time of the current node according to the first time deviation and the second time deviation.
Optionally, the second time offset calculation module is further configured to:
acquiring a message sending time stamp T1 of a previous node, a message receiving time T2 of a current node, a message sending time T3 of the current node and a message receiving time T4 of the previous node;
calculating a second time offset between the current node and the previous node according to the following formula:
the second time offset is (T2-T1-T3+ T4)/2.
Optionally, the apparatus further comprises:
a second message generating module, configured to generate a second message, and add the second time offset and the network protocol time to the second message;
and the second message sending module is used for sending the second message to the next node.
Optionally, the first time offset analysis module is further configured to:
judging whether the time synchronization flag bit in the first message is TRUE or not;
and if so, analyzing the first time deviation carried in the first message.
In a third aspect, an embodiment of the present invention further provides a network device time synchronization device, where the device includes:
comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the method for time synchronization of network devices according to any of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a network device time synchronization storage medium, on which a computer program is stored, where the computer program, when executed by a processing apparatus, implements the network device time synchronization method according to any one of the embodiments of the present invention.
The embodiment of the invention firstly analyzes the first time deviation carried in the first message; the first time deviation is used for representing the time deviation between the previous node and the previous node; then calculating a second time deviation between the current node and the previous node; and finally, determining the network protocol time of the current node according to the first time deviation and the second time deviation. According to the time synchronization method for the network equipment, disclosed by the embodiment of the invention, the time deviation compensation in the time synchronization process can be realized by analyzing the time deviation of the previous node in the received message, so that the performance of the network equipment is improved, and the phase difference value between the end node and the head node is finally reduced.
Drawings
FIG. 1 is a prior art network protocol topology;
fig. 2 is a flowchart of a method for time synchronization of network devices according to a first embodiment of the present invention;
fig. 3 is a network protocol topology diagram after performance enhancement according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a network device time synchronization process in a first embodiment of the present invention;
fig. 5 is a schematic structural diagram of a network device time synchronization apparatus according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device in a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a network protocol topology diagram in the prior art, and as shown in the figure, if the synchronization accuracy of the intermediate node device BC1 and the head node (Grand Master, GM) is 30ns, the synchronization accuracy of the next node device BC2 and BC1 of BC1 is 40ns, the synchronization accuracy of the next node device BC3 and BC2 of BC2 is 40ns, and the synchronization accuracy of the end node Slave and BC3 is 30 ns. The synchronization accuracy of BC1 with GM is 30ns, the synchronization accuracy of BC2 with GM is 30+40+ 70ns, the synchronization accuracy of BC3 with GM is 30+40+40+ 110ns, and the synchronization accuracy of Slave with GM is 30+40+40+30 + 140 ns. Obviously, each hop has a certain performance loss when synchronizing with the upstream, and the performance of synchronization is degraded hop by hop as the number of hops increases.
Example one
Fig. 2 is a flowchart of a method for time synchronization of a network device according to an embodiment of the present invention, where the network device is a network node, and receives a first packet sent by a previous node, and the first packet carries a network protocol time of the previous node. The present embodiment is applicable to the case of time synchronization of network devices, and the method may be performed by a network device time synchronization apparatus, which may be composed of hardware and/or software, and may be generally integrated in a device having a network device time synchronization function, where the device may be an electronic device such as a server or a server cluster. As shown in fig. 1, the method specifically comprises the following steps:
and 110, analyzing the first time deviation carried in the first message.
The first message is a network protocol message sent by a previous node and received by the node, and the first time deviation is used for representing the time deviation between the previous node and the previous node.
In this embodiment, the manner of analyzing the first time offset carried in the first packet may be: judging whether the time synchronization flag bit in the first message is TRUE or not; and if so, analyzing the first time deviation carried in the first message.
Specifically, a configuration item enabling the function of the enhanced intermediate node may be added to the local attribute of the network device, and the command is enableneenhanced dbc, so as to start the function of the enhanced intermediate node. The reserved field of the first packet may be used to transmit a first time offset to be compensated by the current node, and a time synchronization flag enhanceddcflag may be configured in a FlagField of the first packet. The format of the header of the first packet is shown in table 1, the definition of the flag field in the first packet is shown in table 2, the first time offset of the reserved field transmission is shown in table 3, and the data format of the time synchronization flag enhanceddcflag is shown in table 4.
Table 1 header format
Figure BDA0002879415220000061
Figure BDA0002879415220000071
TABLE 2FlagField definitions
Figure BDA0002879415220000072
TABLE 3 first time offset of reserved field transmission
octets offset
Reserved (BC-offset value) 4 16
Table 4 enhanceddcflag data format
Figure BDA0002879415220000081
When the enablenenhandbC of the node equipment is TRUE, that is, the equipment has a time deviation compensation function, after receiving the first message, the node firstly judges whether a flag enhancedbCFlag in flag field of the message is TRUE, if so, the node indicates that the received message carries the first time deviation, and the message is analyzed to obtain the first time deviation to be compensated. By analyzing the first time deviation, the time deviation generated by the previous node can be obtained, and therefore compensation is carried out on the current node.
Step 120, calculating a second time offset between the current node and the previous node.
Wherein, the current node can be called as a slave node, and the last node can be called as a master node.
In this embodiment, the manner of calculating the second time offset between the current node and the previous node may be: acquiring a message sending time stamp T1 of a previous node, a message receiving time T2 of a current node, a message sending time T3 of the current node and a message receiving time T4 of the previous node; calculating a second time offset between the current node and the previous node according to the following formula:
the second time offset is (T2-T1-T3+ T4)/2.
Specifically, the basic principle of the network protocol time synchronization in the embodiment of the present invention is as follows: the master node and the slave node interact with each other to synchronize the message and record the receiving and sending time of the message, the round-trip total delay between the master node and the slave node is calculated by calculating the round-trip time difference of the message, if the network is symmetrical (namely the transmission delays in two directions are the same), half of the round-trip total delay is one-way delay, the one-way delay is the time deviation between the master node and the slave node, and the slave node adjusts the local time according to the deviation, so that the synchronization between the slave node and the master node can be realized.
Taking the request-response mechanism as an example, the implementation process is as follows:
(1) the master node sends a Sync message to the slave nodes and records the sending time T1; after receiving the message from the node, the receiving time T2 is recorded.
(2) After the master node sends the Sync message, it sends a Follow _ Up message carrying T1.
(3) The slave node sends a Delay _ Req message to the master node, is used for initiating the calculation of reverse transmission Delay and records the sending time T3; after receiving the message, the master node records the receiving time T4.
(4) After receiving the Delay _ Req message, the master node replies a Delay _ Resp message carrying T4.
At this time, the slave nodes have four time stamps T1-T4, so that the total round-trip delay between the master node and the slave node is calculated to be [ (T2-T1) + (T4-T3) ], and therefore, the one-way delay between the master node and the slave node is [ (T2-T1) + (T4-T3) ]/2. Thus, the time offset of the slave node relative to the master node is:
Offset=(T2–T1)-[(T2–T1)+(T4–T3)]/2=[(T2–T1)-(T4–T3)]/2。
and step 130, determining the network protocol time of the current node according to the first time deviation and the second time deviation.
Specifically, according to the analyzed first time deviation and a second time deviation generated by the current node, the first time deviation can be compensated to a synchronization algorithm, and the network protocol time of the current node is determined.
In this embodiment, if the current node is an intermediate node, after determining the network protocol time of the current node according to the first time offset and the second time offset, the method may further include: generating a second message, and adding a second time deviation and network protocol time to the second message; and sending the second message to the next node.
And the second message is a message sent by the current node to the next node.
Specifically, if the current node is an intermediate node, that is, the current node needs to send a packet to the next node, at this time, the second time offset between the current node and the previous node may be added to a reserved field of the packet, and the enhanced dbcflag is set to TRUE, and then sent to the outside. In this way, the time deviation generated by the node can be informed to the next node to compensate.
Fig. 3 is a network protocol topology diagram after performance improvement in the first embodiment of the present invention, as shown in the figure, the synchronization precision of the intermediate node device BC1 and the head node GM is 30ns, the synchronization precision of the next node device BC2 and BC1 of BC1 is 40ns, the synchronization precision of the next node device BC3 and BC2 of BC2 is 40ns, and the synchronization precision of the Slave and BC3 of the end node is 30ns, the time offset between each node and the previous node is notified to the next node, and after the time offset of the previous node is compensated by each hop, the synchronization precision of the Slave and the GM of the end node is finally 30ns, which effectively reduces performance cumulative degradation caused by increase of hop count of the synchronization link.
Fig. 4 is a schematic diagram of a time synchronization process of network equipment in the first embodiment of the present invention, as shown in the figure, when the enablenendbc of the node equipment is TRUE and the node equipment is a middle node or an end node, after receiving a message, first determining whether the enablenedbcflag in the message is TRUE, and if the enablenedbcflag is TRUE, analyzing a first time offset in the message and compensating; if the device is an intermediate device and needs to send a message to a next node, a second time offset between the current node and the previous node needs to be added into the message, and the enhanced dbcflag is set to TRUE.
The embodiment of the invention firstly analyzes the first time deviation carried in the first message; the first time deviation is used for representing the time deviation between the previous node and the previous node; then calculating a second time deviation between the current node and the previous node; and finally, determining the network protocol time of the current node according to the first time deviation and the second time deviation. According to the time synchronization method for the network equipment, disclosed by the embodiment of the invention, the time deviation compensation in the time synchronization process can be realized by analyzing the time deviation of the previous node in the received message, so that the performance of the network equipment is improved, and the phase difference value between the end node and the head node is finally reduced.
Example two
Fig. 5 is a schematic structural diagram of a network device time synchronization apparatus according to a second embodiment of the present invention. As shown in fig. 5, the apparatus includes: a first time deviation analyzing module 210, a second time deviation calculating module 220, and a network protocol time determining module 230.
The first time offset analyzing module 210 is configured to analyze a first time offset carried in the first packet.
And the first time deviation is used for representing the time deviation of the last node and the last node.
Optionally, the first time offset analysis module 210 is further configured to:
judging whether the time synchronization flag bit in the first message is TRUE or not; and if so, analyzing the first time deviation carried in the first message.
The second time offset calculating module 220 is configured to calculate a second time offset between the current node and the previous node.
Optionally, the second time deviation calculating module 220 is further configured to:
acquiring a message sending time stamp T1 of a previous node, a message receiving time T2 of a current node, a message sending time T3 of the current node and a message receiving time T4 of the previous node; calculating a second time offset between the current node and the previous node according to the following formula:
the second time offset is (T2-T1-T3+ T4)/2.
And a network protocol time determining module 230, configured to determine a network protocol time of the current node according to the first time offset and the second time offset.
Optionally, the apparatus further comprises:
the second message generation module is used for generating a second message and adding the second time deviation and the network protocol time into the second message;
and the second message sending module is used for sending the second message to the next node.
The device can execute the methods provided by all the embodiments of the invention, and has corresponding functional modules and beneficial effects for executing the methods. For details not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the present invention.
EXAMPLE III
Fig. 6 is a schematic structural diagram of a computer device according to a third embodiment of the present invention. FIG. 6 illustrates a block diagram of a computer device 312 suitable for use in implementing embodiments of the present invention. The computer device 312 shown in FIG. 6 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention. Device 312 is a typical network device time synchronization computing device.
As shown in FIG. 6, computer device 312 is in the form of a general purpose computing device. The components of computer device 312 may include, but are not limited to: one or more processors 316, a storage device 328, and a bus 318 that couples the various system components including the storage device 328 and the processors 316.
Bus 318 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Computer device 312 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 312 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 328 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 330 and/or cache Memory 332. The computer device 312 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 334 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 318 by one or more data media interfaces. Storage 328 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program 336 having a set (at least one) of program modules 326 may be stored, for example, in storage 328, such program modules 326 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which may comprise an implementation of a network environment, or some combination thereof. Program modules 326 generally carry out the functions and/or methodologies of embodiments of the invention as described herein.
The computer device 312 may also communicate with one or more external devices 314 (e.g., keyboard, pointing device, camera, display 324, etc.), with one or more devices that enable a user to interact with the computer device 312, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 312 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 322. Also, computer device 312 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), etc.) and/or a public Network, such as the internet, via Network adapter 320. As shown, network adapter 320 communicates with the other modules of computer device 312 via bus 318. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device 312, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 316 executes various functional applications and data processing by executing programs stored in the storage 328, for example, to implement the network device time synchronization method provided by the above-described embodiment of the present invention.
Example four
Embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processing apparatus, implements a network device time synchronization method as in the embodiments of the present invention. The computer readable medium of the present invention described above may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: analyzing a first time deviation carried in the first message; the first time deviation is used for representing the time deviation between the previous node and the previous node; calculating a second time deviation between the current node and the previous node; and determining the network protocol time of the current node according to the first time deviation and the second time deviation.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A network device time synchronization method, the said network device is a network node, receive the first message that the last node sends; the first message carries the network protocol time of the last node; it is characterized by comprising:
analyzing the first time deviation carried in the first message; the first time deviation is used for representing the time deviation between the previous node and the previous node;
calculating a second time offset between the current node and the previous node;
and determining the network protocol time of the current node according to the first time deviation and the second time deviation.
2. The method of claim 1, wherein calculating a second time offset between a current node and the previous node comprises:
acquiring a message sending time stamp T1 of a previous node, a message receiving time T2 of a current node, a message sending time T3 of the current node and a message receiving time T4 of the previous node;
calculating a second time offset between the current node and the previous node according to the following formula:
the second time offset is (T2-T1-T3+ T4)/2.
3. The method of claim 1, wherein if the current node is an intermediate node, after determining the network protocol time of the current node according to the first time offset and the second time offset, further comprising:
generating a second message, and adding the second time deviation and the network protocol time to the second message;
and sending the second message to a next node.
4. The method of claim 1, wherein analyzing the first time offset carried in the first packet comprises:
judging whether the time synchronization flag bit in the first message is TRUE or not;
and if so, analyzing the first time deviation carried in the first message.
5. A network device time synchronizer, comprising:
the first time deviation analysis module is used for analyzing the first time deviation carried in the first message; the first time deviation is used for representing the time deviation between the previous node and the previous node;
the second time deviation calculation module is used for calculating a second time deviation between the current node and the previous node;
and the network protocol time determining module is used for determining the network protocol time of the current node according to the first time deviation and the second time deviation.
6. The apparatus of claim 5, wherein the second time offset calculation module is further configured to:
acquiring a message sending time stamp T1 of a previous node, a message receiving time T2 of a current node, a message sending time T3 of the current node and a message receiving time T4 of the previous node;
calculating a second time offset between the current node and the previous node according to the following formula:
the second time offset is (T2-T1-T3+ T4)/2.
7. The apparatus of claim 5, further comprising:
a second message generating module, configured to generate a second message, and add the second time offset and the network protocol time to the second message;
and the second message sending module is used for sending the second message to the next node.
8. The apparatus of claim 5, wherein the first time offset resolution module is further configured to:
judging whether the time synchronization flag bit in the first message is TRUE or not;
and if so, analyzing the first time deviation carried in the first message.
9. A computer device, the device comprising: comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the network device time synchronization method according to any of claims 1-4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by processing means, carries out the network device time synchronization method according to any one of claims 1 to 4.
CN202011627016.7A 2020-12-31 2020-12-31 Network equipment time synchronization method, device, equipment and storage medium Pending CN112600641A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011627016.7A CN112600641A (en) 2020-12-31 2020-12-31 Network equipment time synchronization method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011627016.7A CN112600641A (en) 2020-12-31 2020-12-31 Network equipment time synchronization method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112600641A true CN112600641A (en) 2021-04-02

Family

ID=75206868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011627016.7A Pending CN112600641A (en) 2020-12-31 2020-12-31 Network equipment time synchronization method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112600641A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024066311A1 (en) * 2022-09-27 2024-04-04 中兴通讯股份有限公司 Method and device for determining phase difference, storage medium, and electronic device

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020064185A1 (en) * 2000-11-27 2002-05-30 Satoru Nakai Synchronizing system using IEEE1394 serial bus standard
CN101510834A (en) * 2008-02-15 2009-08-19 中国移动通信集团公司 Method, device and system for measuring end-to-end network time delay
CN102332973A (en) * 2011-09-07 2012-01-25 上海交通大学 Real-time communication and clock synchronization method of chain network
CN104883235A (en) * 2015-06-26 2015-09-02 上海远景数字信息技术有限公司 Clock time synchronization precision improving method based on PTP protocol
CN105027489A (en) * 2013-12-20 2015-11-04 华为技术有限公司 Precision time protocol synchronization method and node
CN106921456A (en) * 2015-12-24 2017-07-04 中国科学院沈阳自动化研究所 Multi-hop wireless backhaul network time synchronization error compensation method based on PTP protocol
CN106953706A (en) * 2017-02-17 2017-07-14 北京汽车集团有限公司 Audio-visual system synchronous method based on Ethernet, device and system
CN110113127A (en) * 2019-06-05 2019-08-09 深圳市英特瑞半导体科技有限公司 A kind of method and its system based on 1588 agreement passing times
CN110176973A (en) * 2019-05-17 2019-08-27 固高科技(深圳)有限公司 Clock synchronous method, system, computer equipment and storage medium
CN111385051A (en) * 2018-12-29 2020-07-07 华为技术有限公司 Clock synchronization method, device and storage medium
CN111835449A (en) * 2020-07-30 2020-10-27 山东超越数控电子股份有限公司 Local area network high-precision clock synchronization method and device based on PTP (precision time protocol)
CN111884751A (en) * 2020-07-30 2020-11-03 国家电网有限公司大数据中心 Smart grid time synchronization method and device based on PTP

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020064185A1 (en) * 2000-11-27 2002-05-30 Satoru Nakai Synchronizing system using IEEE1394 serial bus standard
CN101510834A (en) * 2008-02-15 2009-08-19 中国移动通信集团公司 Method, device and system for measuring end-to-end network time delay
CN102332973A (en) * 2011-09-07 2012-01-25 上海交通大学 Real-time communication and clock synchronization method of chain network
CN105027489A (en) * 2013-12-20 2015-11-04 华为技术有限公司 Precision time protocol synchronization method and node
CN104883235A (en) * 2015-06-26 2015-09-02 上海远景数字信息技术有限公司 Clock time synchronization precision improving method based on PTP protocol
CN106921456A (en) * 2015-12-24 2017-07-04 中国科学院沈阳自动化研究所 Multi-hop wireless backhaul network time synchronization error compensation method based on PTP protocol
CN106953706A (en) * 2017-02-17 2017-07-14 北京汽车集团有限公司 Audio-visual system synchronous method based on Ethernet, device and system
CN111385051A (en) * 2018-12-29 2020-07-07 华为技术有限公司 Clock synchronization method, device and storage medium
CN110176973A (en) * 2019-05-17 2019-08-27 固高科技(深圳)有限公司 Clock synchronous method, system, computer equipment and storage medium
CN110113127A (en) * 2019-06-05 2019-08-09 深圳市英特瑞半导体科技有限公司 A kind of method and its system based on 1588 agreement passing times
CN111835449A (en) * 2020-07-30 2020-10-27 山东超越数控电子股份有限公司 Local area network high-precision clock synchronization method and device based on PTP (precision time protocol)
CN111884751A (en) * 2020-07-30 2020-11-03 国家电网有限公司大数据中心 Smart grid time synchronization method and device based on PTP

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024066311A1 (en) * 2022-09-27 2024-04-04 中兴通讯股份有限公司 Method and device for determining phase difference, storage medium, and electronic device

Similar Documents

Publication Publication Date Title
US11516101B2 (en) Method, a computer program product, and a carrier for indicating one-way latency in a data network
KR101749202B1 (en) Method, apparatus, and system for generating timestamp
US7372846B2 (en) Method for transmitting time information via a data packet network
US7865760B2 (en) Use of T4 timestamps to calculate clock offset and skew
US7577169B1 (en) Time stamping
US10216220B1 (en) Accurate time capture and transfer between clock domains
EP2448168A1 (en) Method and system for bearing time synchronization protocol in optical transport network
CN103299575B (en) Transmitting device and transmission method
CN112600641A (en) Network equipment time synchronization method, device, equipment and storage medium
CN112039621B (en) Time synchronization method and system
Diarra et al. Improved clock synchronization start-up time for Ethernet AVB-based in-vehicle networks
CN114071487A (en) Interface time delay measuring method, related network equipment and storage medium
CN111884751A (en) Smart grid time synchronization method and device based on PTP
CN114448547A (en) Time synchronization method and device, electronic equipment and storage medium
WO2021208868A1 (en) Method for determining clock and related apparatus
KR20190072745A (en) Stable Network-based Time Synchronization Method
Woo Analysis of proximity-1 space link interleaved time synchronization (PITS) protocol
WO2021103806A1 (en) Time synchronization method, device, and system, and storage medium
CN112713956B (en) Frequency selection method, device, equipment and storage medium of synchronous Ethernet
WO2020132834A1 (en) Method and device for stamping processing
CN118353566A (en) GPTP protocol-based time synchronization method and device, medium and equipment
Vinogradov et al. Measurement of one-way delays in IP networks
CN118523864A (en) Method and device for synchronizing clocks
KR102538217B1 (en) Method for performing synchronization according to Precision Time Protocol (PTP) in ring topology network, and apparatus therefor
CN117015024A (en) Time synchronization method, network equipment and communication system

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