CN115314146A - Time synchronization method and device under multi-hop networking, electronic equipment and storage medium - Google Patents

Time synchronization method and device under multi-hop networking, electronic equipment and storage medium Download PDF

Info

Publication number
CN115314146A
CN115314146A CN202210952069.9A CN202210952069A CN115314146A CN 115314146 A CN115314146 A CN 115314146A CN 202210952069 A CN202210952069 A CN 202210952069A CN 115314146 A CN115314146 A CN 115314146A
Authority
CN
China
Prior art keywords
message
time information
time
packet
node
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
CN202210952069.9A
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.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp 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 China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202210952069.9A priority Critical patent/CN115314146A/en
Publication of CN115314146A publication Critical patent/CN115314146A/en
Priority to PCT/CN2022/140414 priority patent/WO2024031912A1/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
    • 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

Abstract

The disclosure provides a time synchronization method and device under multi-hop networking, electronic equipment and a storage medium, and relates to the technical field of network technology and security. The method comprises the steps that a child node acquires a first message, wherein the first message comprises time information of the root node of the child node sending the first message and time information of each father node of the child node receiving and sending the first message; determining the time for receiving the first message as second time information; sending the second message to a father node of the child node, so that the father node sends the second message to a root node of the child node; acquiring a third message; and determining the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message. In the embodiment of the disclosure, since the child node can acquire the time information of each node on the upstream, the calculation result is directly synchronized with the time source, thereby avoiding the transmission of the calculated synchronization error to the downstream node, and improving the time synchronization precision of the nodes in the network.

Description

Time synchronization method and device under multi-hop networking, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of network technologies and security technologies, and in particular, to a method and an apparatus for time synchronization under multi-hop networking, an electronic device, and a storage medium.
Background
Data transmission in an information transmission system needs time synchronization to realize a time metering function with the same time from a time source to a downstream time system. In the time synchronization system, a time source issues standard time to a lower-level time system, a downstream time system synchronizes the time of an upstream time system, and the time synchronization from the time source to a downstream end time system is maintained.
In the prior art, the time information of the packet encapsulation only contains the time information of a local time system and a previous-stage time system, and a time synchronization calculation algorithm is not considered, so that errors exist between the receiving and sending time of the packet by the time system and the actual calculation time, the accuracy of a downstream time system is reduced relative to that of an upstream time system, and under the multi-hop synchronization scene, the time information errors generated by the multi-hop time from a time source to the current time system are larger and larger.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure provides a time synchronization method, apparatus, electronic device and storage medium under a multi-hop networking, which at least to some extent overcome the problem of system error of calculating time amplification downstream time in an upstream time system in the related art.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to an aspect of the present disclosure, a time synchronization method under a multi-hop networking is provided, which is applied to a child node side, and includes: acquiring a first message, wherein the first message comprises time information of the first message sent by a root node of the child node and time information of the first message received and sent by each father node of the child node; determining the time for receiving the first message as second time information; sending a second message to a father node of the child node, so that the father node sends the second message to a root node of the child node, wherein the second message comprises time information of sending the second message by the child node and time information of receiving and sending the second message by each father node; acquiring a third message, wherein the third message is generated by the root node according to the feedback of a second message and comprises time information of the second message; and determining the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message.
In an embodiment of the present disclosure, a time synchronization algorithm is used to determine the synchronization time of the child node according to the time information in the first message, the second time information, and the time information in the third message.
In an embodiment of the present disclosure, a hop count record field is preset in the first packet, and the hop count record field is used for recording the hop count of the current child node where the first packet is located relative to the root node.
According to another aspect of the present disclosure, there is provided a time synchronization method under a multi-hop networking, applied to a root node side, including: sending a first message, so that child nodes of the root node acquire the first message and determine the time for receiving the first message as second time information, wherein the first message comprises the time information for sending the first message by the root node and the time information for receiving and sending the first message by each child node of the root node; acquiring a second message, wherein the second message is sent by the child node and comprises time information of sending the second message by the child node and time information of receiving and sending the second message by each child node of the root node; and sending a third message to a child node according to the second message, so that the child node determines the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message, wherein the third message comprises the time information of the second message.
In an embodiment of the present disclosure, a hop count record field is preset in the first packet, and the hop count record field is used for recording the hop count of the current child node where the first packet is located relative to the root node.
According to another aspect of the present disclosure, there is provided a time synchronization system under multi-hop networking, including: the system comprises a child node side and a root node side, wherein the root node side sends a first message; a child node side acquires a first message, determines the time for receiving the first message as second time information, and sends a second message to a parent node of the child node, so that the parent node sends the second message to a root node of the child node; the root node acquires a second message, sends a third message according to the second message, and the child node determines the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message; the first message comprises time information of sending the first message by a root node of the child node and time information of receiving and sending the first message by each father node of the child node; the second message comprises time information of sending the second message by the child node and time information of receiving and sending the second message by each father node; the third packet includes time information of the second packet.
According to another aspect of the present disclosure, there is provided a time synchronization apparatus under multi-hop networking, applied to a child node side, including: a first packet obtaining module, configured to obtain a first packet, where the first packet includes time information for a root node of the child node to send the first packet and time information for each parent node of the child node to receive and send the first packet; a second time information determining module, configured to determine a time for receiving the first packet as second time information; a second packet sending module, configured to send a second packet to a parent node of the child node, so that the parent node sends the second packet to a root node of the child node, where the second packet includes time information for the child node to send the second packet and time information for each parent node to receive and send the second packet; a third packet obtaining module, configured to obtain a third packet, where the third packet is generated by the root node according to a second packet feedback and includes time information of the second packet; and the synchronization time determining module is used for determining the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message.
According to another aspect of the present disclosure, there is provided a time synchronization apparatus under multi-hop networking, applied to a root node side, including: a first packet sending module, configured to send a first packet, so that a child node of the root node obtains the first packet and determines a time for receiving the first packet as second time information, where the first packet includes time information for the root node to send the first packet and time information for each child node of the root node to receive and send the first packet; a second packet obtaining module, configured to obtain a second packet, where the second packet is sent by the child node and includes time information for the child node to send the second packet and time information for each child node of the root node to receive and send the second packet; and the third message sending module is used for sending a third message to a child node according to the second message, so that the child node determines the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message, wherein the third message comprises the time information of the second message.
According to still another aspect of the present disclosure, there is provided an electronic device including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the time synchronization method under the multi-hop networking via executing the executable instructions.
According to yet another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the time synchronization method under multi-hop networking described above.
According to another aspect of the present disclosure, there is provided a computer program product, which includes computer instructions stored in a computer-readable storage medium, and when the computer instructions are executed by a processor, the computer instructions implement the operation instructions of the time synchronization method under the multi-hop networking according to any one of the above-mentioned embodiments.
According to the time synchronization method under the multi-hop networking provided by the embodiment of the disclosure, a child node acquires a first message, wherein the first message comprises time information of the first message sent by a root node of the child node and time information of the first message received and sent by each father node of the child node; determining the time for receiving the first message as second time information; sending a second message to a father node of the child node, so that the father node sends the second message to a root node of the child node, wherein the second message comprises time information for the child node to send the second message and time information for each father node to receive and send the second message; acquiring a third message, wherein the third message is generated by the root node according to the feedback of the second message and comprises time information of the second message; and determining the synchronization time of the child nodes according to the time information in the first message, the second time information and the time information in the third message. In the embodiment of the disclosure, under the multi-hop synchronization scenario, since the child node can acquire the time information of each node on the upstream, the calculation result is directly synchronized with the time source, thereby avoiding the transmission of the calculated synchronization error to the downstream node, and improving the time synchronization precision of the nodes in the network.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It should be apparent that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived by those of ordinary skill in the art without inventive effort.
Fig. 1 is a schematic diagram illustrating a time synchronization system structure under multi-hop networking in an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a time synchronization method in a multi-hop networking according to an embodiment of the present disclosure;
fig. 3 is a flowchart illustrating another method for time synchronization under multi-hop networking in an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a multi-hop time packet work flow in a multi-hop networking according to an embodiment of the present disclosure;
fig. 5 shows a flowchart of an implementation of a time synchronization algorithm under multi-hop networking in an embodiment of the present disclosure;
fig. 6 is a schematic diagram illustrating a specific example of a time synchronization system under multi-hop networking in an embodiment of the present disclosure;
fig. 7 is a schematic diagram illustrating a time synchronization apparatus under multi-hop networking in an embodiment of the present disclosure;
fig. 8 is a schematic diagram illustrating a time synchronization apparatus under a multi-hop networking in an embodiment of the present disclosure;
FIG. 9 is a block diagram of an electronic device in an embodiment of the present disclosure;
fig. 10 shows a block diagram of a computer-readable storage medium in an embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
To facilitate understanding, the following first explains several terms referred to in the present disclosure:
PTP: precision time protocol, a time synchronization protocol that can achieve sub-microsecond level time synchronization precision.
Fig. 1 is a schematic diagram illustrating an exemplary system architecture of a time synchronization method under a multi-hop networking or a time synchronization apparatus under the multi-hop networking, which may be applied to an embodiment of the present disclosure.
As shown in fig. 1, system architecture 100 may include time systems 101, 102, 103, 104, 105, a network 106, and a clock source 107.
The network 104 is a medium used to provide a communication link between the time systems 101, 102, 103, 104, 105 and the clock source 107, and may be a wired network or a wireless network.
Optionally, the wireless or wired networks described above use standard communication techniques and/or protocols. The Network is typically the Internet, but may be any Network including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, wireline or wireless Network, a private Network, or any combination of virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including Hypertext Mark-up Language (HTML), extensible markup Language (XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as Secure Socket Layer (SSL), transport Layer Security (TLS), virtual Private Network (VPN), internet protocol Security (IPsec), and so on. In other embodiments, custom and/or dedicated data communication techniques may also be used in place of, or in addition to, the data communication techniques described above.
The time systems 101, 102, 103, 104, 105 may be child nodes of slave node clocks, downstream time synchronization devices, etc.
Clock source 107 may be a root node such as a time source, a master node clock, an upstream time synchronization device, etc., and is a source clock unique to a plurality of child nodes.
When the system runs, a root node side (equivalent to a clock source) sends a first message; a child node (equivalent to a time system) side acquires a first message, determines the time for receiving the first message as second time information, and sends the second message to a parent node of the child node, so that the parent node sends the second message to a root node of the child node; the root node acquires a second message and sends a third message according to the second message, and the child node determines the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message; the first message comprises time information of a root node of a child node for sending the first message and time information of each father node of the child node for receiving and sending the first message; the second message comprises time information of sending the second message by the child node and time information of receiving and sending the second message by each father node; the third message is generated by the root node according to the second message feedback and comprises the time information of the second message; the root node is the only clock source.
The child nodes and the root node may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
Those skilled in the art will appreciate that the number of clock sources, networks, and time systems in fig. 1 is merely illustrative and that there may be any number of time systems, networks, and so on, as desired. The embodiments of the present disclosure do not limit this.
The present exemplary embodiment will be described in detail below with reference to the drawings and examples.
The embodiment of the disclosure provides a time synchronization method under a multi-hop networking, which can be executed by any electronic device with computing processing capability.
Fig. 2 shows a flowchart of a time synchronization method applied to a multi-hop networking at a child node side in the embodiment of the present disclosure, and as shown in fig. 2, the time synchronization method in the multi-hop networking provided in the embodiment of the present disclosure includes the following steps:
s202, acquiring a first message, wherein the first message comprises time information of a root node of a child node sending the first message and time information of each father node of the child node receiving and sending the first message.
It should be noted that the message may be a data unit exchanged and transmitted in the network, and includes complete data information to be sent. The first packet may be a packet whose packet sending time is carried by a root node (corresponding to a source clock), and when the first packet passes through a child node, the time for the child node to receive the packet and the time for the child node to send the packet are written into the packet. The root node is the only clock source.
S204, the time for receiving the first message is determined as second time information.
It should be noted that the time for receiving the first packet may be a time when the first packet arrives at the child node.
And S206, sending the second message to the father node of the child node, so that the father node sends the second message to the root node of the child node, wherein the second message comprises the time information of sending the second message by the child node and the time information of receiving and sending the second message by each father node.
It should be noted that the child node may have multiple parent nodes, but only one root node. The second packet may be a packet fed back to the root node after the child node receives the first packet sent by the root node.
For example, in one example, the previous hop of the child node a is the parent node B, the previous hop of the parent node B is the parent node C, and the previous hop of the parent node C is the root node D.
S208, a third message is obtained, wherein the third message is generated by the root node according to the feedback of the second message and comprises the time information of the second message.
It should be noted that the third packet may be a packet fed back by the root node after receiving the second packet.
For example, in one embodiment, the conventional time packet (such as a PTP packet) only contains Record Data to Record the packet sending time of the upper time system and the packet receiving time of the current time system, the multi-hop time packet (corresponding to the first packet, the second packet, and the third packet) of the disclosure records the packet receiving and sending time from the time source to each hop of the current time system through the Record Data List, and the format of the Record Data List may be determined according to the Record Data List. Specifically, the format of the multi-hop time packet under the multi-hop networking is shown in table 1 below.
TABLE 1
Packet Type Hop Number Record Class Record Data List
The Packet Type is used for representing the message Type; the Hop Number is used for recording the Hop count of the message, for example, 0 indicates that the current network element is a clock source, and the Hop Number value is increased by one every time one Hop passes; record Class is used for representing the current message recording Data, namely the concrete format of Record Data; record Data List is used to represent the information recorded in the message from the time source (corresponding to the clock source) to each hop of the local time system (corresponding to the child node), including the packet sending time and the packet receiving time. The traditional time message does not sense the position of the current time system in networking, and the multi-Hop time message records the Hop count of the current time system relative to a time source through the Hop Number.
For example, in one example, the first packet is preset with a hop count record field, and the hop count record field is used for recording the hop count of the current child node where the first packet is located relative to the root node.
S210, determining the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message.
In one example, the synchronization time of the child node is determined by using a time synchronization algorithm according to the time information in the first message, the second time information and the time information in the third message.
In the embodiment of the disclosure, under the multi-hop synchronization scenario, since the child node can acquire the time information of each node on the upstream, the calculation result is directly synchronized with the time source, thereby avoiding the transmission of the calculated synchronization error to the downstream node, and improving the time synchronization precision of the nodes in the network.
Fig. 3 is a flowchart illustrating a time synchronization method applied to a multi-hop networking at a root node side in an embodiment of the present disclosure, and as shown in fig. 3, the time synchronization method in the multi-hop networking provided in the embodiment of the present disclosure includes the following steps:
s302, sending a first message, so that the child nodes of the root node acquire the first message and determine the time for receiving the first message as second time information, wherein the first message comprises the time information for sending the first message by the root node and the time information for receiving and sending the first message by each child node of the root node.
It should be noted that the first packet includes information recorded in the packet, which is recorded in each hop from the root node to the child node, and includes a packet sending time and/or a packet receiving time. The root node is the only clock source.
S304, a second message is obtained, wherein the second message is sent by the child node and comprises time information of the child node sending the second message and time information of each child node of the root node receiving and sending the second message.
It should be noted that the second packet includes information of each hop from the child node to the root node recorded in the packet, including packet sending time and/or packet receiving time.
S306, according to the second message, sending a third message to the child node, so that the child node determines the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message, wherein the third message comprises the time information of the second message.
In one example, a hop count record field is preset in the first message, and the hop count record field is used for recording the hop count of the current child node where the first message is located relative to the root node.
In the embodiment of the disclosure, under the scene of multi-hop synchronization, because the packet sending time and/or the packet receiving time of each hop from the child node to the root node are recorded in the message, the calculation result is directly synchronized to the time source, thereby avoiding the transmission of the calculated synchronization error to the downstream node and improving the time synchronization precision of the nodes in the network.
In one embodiment, the multi-hop time packet workflow in the multi-hop networking is shown in fig. 4.
S401, the clock source sends a multi-hop time message.
S402, when the time system of the clock source downstream time synchronization system receives the packet, the hardware writes the current packet receiving time into the message and sends the message to the computing unit. The time deviation of the current network element relative to the time source is calculated and time synchronization is carried out by using all time information (Record Data List) from the time source to the current time system.
And S403, when the downstream time synchronization system of the clock source has a downstream time system, sending the message received by the computing unit to the downstream time system, and writing the packet sending time in the packet sending process through hardware.
For example, in one example, in the first step, a direct upstream time system (equivalent to the clock source) sends a message to a downstream time system, where the message carries packet sending time t1_ k; secondly, directly receiving a packet by a downstream time system A (equivalent to the downstream time synchronization system) to obtain packet receiving time t2_ k, and sending a response packet to the upstream time system, wherein the response packet carries packet sending time t3_ k; thirdly, directly receiving the message (response packet) in the second step by the upstream time system, acquiring the packet receiving time t4_ k, responding to the message in the second step, and transmitting the packet to the system in the second step, wherein the packet carries t3_ k and t4_ k; and fourthly, after the downstream time system obtains t1_ (1, 2,3.., k), t2_ (1, 2,3.., k), t3_ (1, 2,3.., k), and t4_ (1, 2,3.., k), calculating the time deviation relative to the clock source (upstream time system), and adjusting the local (downstream time system) time. If the current time system k has a downstream time system, sending the received messages carrying t1_ (1, 2,3.. K) and t2_ (1, 2,3.. K), which are respectively t3_ (1, 2,3.., k, k + 1) and t4_ (1, 2,3.. K, k + 1), downstream; if the current time system k has a more upstream time system, the message carrying t3_ (1, 2,3.., k) in the received message is sent to the more upstream time system, and the carrying time is t3_ (1, 2,3.., k, k + 1). The time synchronization method disclosed by the invention records the hardware writing time when the multi-hop time system receives and transmits the packet, synchronizes the time of the time source, avoids the transmission of the calculation error of the middle time system to the downstream time system, and improves the time synchronization precision of each time system in the networking.
It should be noted that, the time of the current time system is adjusted only by the conventional message according to the deviation of the current time system with respect to the previous time system, so that the previous time system is the clock source of the current time system. The message disclosed by the invention has only one clock source concept in the time system set.
In an embodiment of the present disclosure, an implementation flow of a time synchronization algorithm under multi-hop networking is provided as shown in fig. 5, where the time synchronization algorithm under multi-hop networking has the following flow:
s501, a current time system receives a Packet and judges whether a time synchronization message in the patent exists or not according to a Packet Type, if so, the S502 is entered, otherwise, the process is ended;
s502, obtaining the Hop count of the message transmitted in a local time system relative to a time source according to the Hop Number, and acquiring multi-Hop time Data recorded by Record Data List according to Record Class;
s503, judging whether the bidirectional time is acquired, if so, skipping S505, and if not, skipping S504;
s504, the packet receiving and sending operation is reversely executed from the current system, the reverse message recording time is sent to the current time system through the multi-hop time message, the bidirectional time is obtained, and S502 is skipped;
s505, calculating and synchronizing time sources;
s506, judging whether a downstream time system exists, if so, skipping to S507, otherwise, ending;
s507, hop Number +1, writing the packet sending time by hardware;
and S508, the message is sent to a downstream time system.
In an embodiment of the present disclosure, a specific example of a time synchronization system under multi-hop networking is provided by integrating a multi-hop time packet and a time synchronization algorithm, as shown in fig. 6.
The time synchronization system under the multi-hop networking comprises a clock source 107, a first time system 61, an Nth time system 62 and a calculation unit 603.
Each time system can obtain clock information from a clock source (time source) to each hop of the current time system according to the multi-hop time message provided by the disclosure, and the time source is synchronized after calculation through the calculation unit.
The multi-hop time packet transmission direction is shown as a solid line 601 in fig. 6, the time synchronization direction is shown as a dashed line 602 in fig. 6, the calculation error is shown as a dotted line 604 in fig. 6, and the calculation error is transmitted as a dotted line 605 in fig. 6.
Compared with the traditional time synchronization technology, the time error obtained by the calculating unit of the time system of each hop in the method can not be transmitted to the downstream time system, and the time synchronization precision is higher.
In a specific example, t1, t2, t3, t4 are obtained through the message of fig. 4, and after the time system k obtains the time t1_ (1, 2,3.., k), t2_ (1, 2,3.., k), t3_ (1, 2,3.., k), t4_ (1, 2,3.., k), the relative time offset with respect to the time source is calculated and the local time is adjusted to synchronize the time source.
In time synchronization, each time is raw data that is not calculated/processed, so no error is introduced in the calculation of the upstream time system.
Based on the same inventive concept, the embodiment of the present disclosure further provides a time synchronization apparatus under multi-hop networking, as described in the following embodiments. Because the principle of the embodiment of the apparatus for solving the problem is similar to that of the embodiment of the method, the embodiment of the apparatus can be implemented by referring to the implementation of the embodiment of the method, and repeated details are not described again.
Fig. 7 is a schematic diagram illustrating a time synchronization apparatus applied in multi-hop networking at a child node side in an embodiment of the present disclosure, as shown in fig. 7, the apparatus includes: a first message obtaining module 71, a second time information determining module 72, a second message sending module 73, a third message obtaining module 74 and a synchronization time determining module 75.
The first packet obtaining module 71 is configured to obtain a first packet, where the first packet includes time information of a root node of a child node sending the first packet and time information of each father node of the child node receiving and sending the first packet, and the root node is a unique clock source; a second time information determining module 72, configured to determine a time for receiving the first packet as second time information; a second packet sending module 73, configured to send a second packet to a parent node of a child node, so that the parent node sends the second packet to a root node of the child node, where the second packet includes time information for the child node to send the second packet and time information for each parent node to receive and send the second packet; a third packet obtaining module 74, configured to obtain a third packet, where the third packet is generated by the root node according to the second packet and includes time information of the second packet; and a synchronization time determining module 75, configured to determine synchronization time of the child node according to the time information in the first message, the second time information, and the time information in the third message.
In an embodiment of the present disclosure, the synchronization time determining module 75 is further configured to: and determining the synchronization time of the child node by adopting a time synchronization algorithm according to the time information in the first message, the second time information and the time information in the third message.
In an embodiment of the present disclosure, the first packet is preset with a hop count recording field, where the hop count recording field is used to record the hop count of the current child node where the first packet is located relative to the root node.
Fig. 8 is a schematic diagram illustrating a time synchronization apparatus applied in multi-hop networking at a root node side in an embodiment of the present disclosure, as shown in fig. 8, the apparatus includes: a first message sending module 81, a second message obtaining module 82 and a third message sending module 83.
The first packet sending module 81 is configured to send a first packet, so that a child node of a root node obtains the first packet and determines time for receiving the first packet as second time information, where the first packet includes time information for sending the first packet by the root node and time information for receiving and sending the first packet by each child node of the root node, and the root node is a unique clock source; a second packet obtaining module 82, configured to obtain a second packet, where the second packet is sent by a child node and includes time information for the child node to send the second packet and time information for each child node of the root node to receive and send the second packet; and a third packet sending module 83, configured to send a third packet to the child node according to the second packet, so that the child node determines the synchronization time of the child node according to the time information in the first packet, the second time information, and the time information in the third packet, where the third packet includes the time information of the second packet.
In an embodiment of the present disclosure, the first packet is preset with a hop count record field, and the hop count record field is used for recording the hop count of the current child node where the first packet is located relative to the root node.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 900 according to this embodiment of the disclosure is described below with reference to fig. 9. The electronic device 900 shown in fig. 9 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present disclosure.
As shown in fig. 9, the electronic device 900 is embodied in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 910, the at least one memory unit 920, and a bus 930 that couples various system components including the memory unit 920 and the processing unit 910.
Wherein the storage unit stores program code that is executable by the processing unit 910 to cause the processing unit 910 to perform steps according to various exemplary embodiments of the present disclosure described in the above section "exemplary method" of the present specification.
For example, the processing unit 910 may perform the following steps of the above method embodiments: acquiring a first message, wherein the first message comprises time information of a root node of a child node sending the first message and time information of each father node of the child node receiving and sending the first message, and the root node is a unique clock source; determining the time for receiving the first message as second time information; sending a second message to a father node of the child node, so that the father node sends the second message to a root node of the child node, wherein the second message comprises time information for the child node to send the second message and time information for each father node to receive and send the second message; acquiring a third message, wherein the third message is generated by the root node according to the feedback of the second message and comprises time information of the second message; and determining the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message.
Further, the processing unit 910 may perform the following steps of the above method embodiment: and determining the synchronization time of the child node by adopting a time synchronization algorithm according to the time information in the first message, the second time information and the time information in the third message.
In one example, the processing unit 910 may perform the following steps of the above method embodiment: sending a first message, so that child nodes of a root node acquire the first message and determine the time for receiving the first message as second time information, wherein the first message comprises the time information for sending the first message by the root node and the time information for receiving and sending the first message by each child node of the root node, and the root node is a unique clock source; acquiring a second message, wherein the second message is sent by a child node and comprises time information of sending the second message by the child node and time information of receiving and sending the second message by each child node of the root node; and sending a third message to the child node according to the second message, so that the child node determines the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message, wherein the third message comprises the time information of the second message.
The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and/or a cache storage unit 9202, and may further include a read only storage unit (ROM) 9203.
Storage unit 920 may also include a program/utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 930 can be any type representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 900, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 900 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interface 950. Also, the electronic device 900 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via the network adapter 960. As shown, the network adapter 960 communicates with the other modules of the electronic device 900 via the bus 930. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium, which may be a readable signal medium or a readable storage medium. Fig. 10 is a schematic diagram of a computer-readable storage medium in an embodiment of the disclosure, and as shown in fig. 10, the computer-readable storage medium 1000 has a program product stored thereon, which is capable of implementing the above-mentioned method of the disclosure. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the "exemplary methods" section above of this specification, when the program product is run on the terminal device.
For example, the program product in the embodiments of the present disclosure, when executed by a processor, implements a method comprising: acquiring a first message, wherein the first message comprises time information of a root node of a child node for sending the first message and time information of each father node of the child node for receiving and sending the first message, and the root node is a unique clock source; determining the time for receiving the first message as second time information; sending a second message to a father node of the child node, so that the father node sends the second message to a root node of the child node, wherein the second message comprises time information for the child node to send the second message and time information for each father node to receive and send the second message; acquiring a third message, wherein the third message is generated by the root node according to the second message feedback and comprises time information of the second message; and determining the synchronization time of the child nodes according to the time information in the first message, the second time information and the time information in the third message.
In some embodiments, the program product in the embodiments of the present disclosure, when executed by a processor, implements a method comprising: and determining the synchronization time of the child nodes by adopting a time synchronization algorithm according to the time information in the first message, the second time information and the time information in the third message.
In some embodiments, the program product in the embodiments of the present disclosure, when executed by a processor, implements a method comprising: sending a first message, so that child nodes of a root node acquire the first message and determine the time for receiving the first message as second time information, wherein the first message comprises the time information for sending the first message by the root node and the time information for receiving and sending the first message by each child node of the root node, and the root node is a unique clock source; acquiring a second message, wherein the second message is sent by a child node and comprises time information of sending the second message by the child node and time information of receiving and sending the second message by each child node of the root node; and sending a third message to the child node according to the second message, so that the child node determines the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message, wherein the third message comprises the time information of the second message.
More specific examples of the computer-readable storage medium in the present disclosure 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 include a propagated data signal with 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 readable signal medium may be any readable medium that is not a 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.
Alternatively, program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In particular implementations, program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the description of the above embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A time synchronization method under multi-hop networking is characterized in that the method is applied to a child node side, and comprises the following steps:
acquiring a first message, wherein the first message comprises time information of the root node of the child node sending the first message and time information of each father node of the child node receiving and sending the first message;
determining the time for receiving the first message as second time information;
sending a second message to a father node of the child node, so that the father node sends the second message to a root node of the child node, wherein the second message comprises time information of sending the second message by the child node and time information of receiving and sending the second message by each father node;
acquiring a third message, wherein the third message is generated by the root node according to the feedback of a second message and comprises time information of the second message;
and determining the synchronization time of the child nodes according to the time information in the first message, the second time information and the time information in the third message.
2. The method according to claim 1, wherein the step of determining the synchronization time of the child node according to the time information in the first message, the second time information, and the time information in the third message includes:
and determining the synchronization time of the child node by adopting a time synchronization algorithm according to the time information in the first message, the second time information and the time information in the third message.
3. The time synchronization method according to claim 1, wherein a hop count record field is preset in the first packet, and the hop count record field is used to record the hop count of the current child node where the first packet is located relative to the root node.
4. A time synchronization method under multi-hop networking is characterized in that the method is applied to a root node side and comprises the following steps:
sending a first message, so that child nodes of the root node acquire the first message and determine the time for receiving the first message as second time information, wherein the first message comprises the time information for sending the first message by the root node and the time information for receiving and sending the first message by each child node of the root node;
acquiring a second message, wherein the second message is sent by the child node and comprises time information of sending the second message by the child node and time information of receiving and sending the second message by each child node of the root node;
and sending a third message to a child node according to the second message, so that the child node determines the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message, wherein the third message comprises the time information of the second message.
5. The method according to claim 4, wherein a hop count record field is preset in the first packet, and the hop count record field is used for recording the hop count of the current child node where the first packet is located relative to the root node.
6. A time synchronization system under multi-hop networking is characterized by comprising: a child node side and a root node side,
the root node side sends a first message; a child node side acquires a first message, determines the time for receiving the first message as second time information, and sends a second message to a parent node of the child node, so that the parent node sends the second message to a root node of the child node; the root node acquires a second message, sends a third message according to the second message, and the child node determines the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message;
the first message comprises time information of sending the first message by a root node of the child node and time information of receiving and sending the first message by each father node of the child node; the second message comprises time information of sending the second message by the child node and time information of receiving and sending the second message by each father node; the third packet includes time information of the second packet.
7. A time synchronization device under multi-hop networking is characterized in that the time synchronization device is applied to a child node side, and comprises:
a first packet obtaining module, configured to obtain a first packet, where the first packet includes time information for a root node of the child node to send the first packet and time information for each parent node of the child node to receive and send the first packet;
a second time information determining module, configured to determine a time for receiving the first packet as second time information;
a second packet sending module, configured to send a second packet to a parent node of the child node, so that the parent node sends the second packet to a root node of the child node, where the second packet includes time information for the child node to send the second packet and time information for each parent node to receive and send the second packet;
a third packet obtaining module, configured to obtain a third packet, where the third packet is generated by the root node according to a second packet feedback and includes time information of the second packet;
and the synchronization time determining module is used for determining the synchronization time of the child node according to the time information in the first message, the second time information and the time information in the third message.
8. A time synchronization device under multi-hop networking is characterized in that the time synchronization device is applied to a root node side and comprises:
a first packet sending module, configured to send a first packet, so that a child node of the root node obtains the first packet and determines time for receiving the first packet as second time information, where the first packet includes time information for sending the first packet by the root node and time information for receiving and sending the first packet by each child node of the root node;
a second packet obtaining module, configured to obtain a second packet, where the second packet is sent by the child node, and includes time information for the child node to send the second packet and time information for each child node of the root node to receive and send the second packet;
and a third message sending module, configured to send a third message to a child node according to the second message, so that the child node determines the synchronization time of the child node according to the time information in the first message, the second time information, and the time information in the third message, where the third message includes the time information of the second message.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to execute the time synchronization method under the multi-hop networking according to any one of claims 1 to 7 through executing the executable instructions.
10. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the time synchronization method under a multi-hop networking according to any one of claims 1 to 7.
CN202210952069.9A 2022-08-09 2022-08-09 Time synchronization method and device under multi-hop networking, electronic equipment and storage medium Pending CN115314146A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210952069.9A CN115314146A (en) 2022-08-09 2022-08-09 Time synchronization method and device under multi-hop networking, electronic equipment and storage medium
PCT/CN2022/140414 WO2024031912A1 (en) 2022-08-09 2022-12-20 Time synchronization method and apparatus under multi-hop network, and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210952069.9A CN115314146A (en) 2022-08-09 2022-08-09 Time synchronization method and device under multi-hop networking, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115314146A true CN115314146A (en) 2022-11-08

Family

ID=83860312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210952069.9A Pending CN115314146A (en) 2022-08-09 2022-08-09 Time synchronization method and device under multi-hop networking, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN115314146A (en)
WO (1) WO2024031912A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024031912A1 (en) * 2022-08-09 2024-02-15 中国电信股份有限公司 Time synchronization method and apparatus under multi-hop network, and related device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016131481A1 (en) * 2015-02-18 2016-08-25 Telefonaktiebolaget Lm Ericsson (Publ) An intermediate network node for providing a service to end user devices in a wireless communications network
CN106921456B (en) * 2015-12-24 2018-06-19 中国科学院沈阳自动化研究所 Multi-hop wireless backhaul network time synchronization error compensation method based on PTP protocol
CN108039933A (en) * 2017-12-05 2018-05-15 南京沃旭通讯科技有限公司 A kind of local Internet of Things time precise synchronization method
CN110392395B (en) * 2018-04-23 2022-03-29 华为技术有限公司 Method and device for sending message
CN114553358B (en) * 2022-02-25 2023-09-01 深圳市兴海物联科技有限公司 Distributed accurate time synchronization method for Internet of things
CN115314146A (en) * 2022-08-09 2022-11-08 中国电信股份有限公司 Time synchronization method and device under multi-hop networking, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024031912A1 (en) * 2022-08-09 2024-02-15 中国电信股份有限公司 Time synchronization method and apparatus under multi-hop network, and related device

Also Published As

Publication number Publication date
WO2024031912A1 (en) 2024-02-15

Similar Documents

Publication Publication Date Title
US10924949B2 (en) Abnormality detecting method and abnormality detecting device
CN110780979B (en) Control method and device for configuration under micro-service framework, medium and electronic equipment
CN109818962B (en) Service data processing method and device, electronic equipment and storage medium
US20220261797A1 (en) Method and apparatus for executing smart contract
CN115314146A (en) Time synchronization method and device under multi-hop networking, electronic equipment and storage medium
CN113032412B (en) Data synchronization method, device, electronic equipment and computer readable medium
CN111369237B (en) Data processing method and device and computer storage medium
CN113572560B (en) Method, electronic device, and storage medium for determining clock synchronization accuracy
CN113065953B (en) Futures relay trading system based on distribution type
JP2007101457A (en) Transmitter, receiver, time notification method, and time setting method
US20190386762A1 (en) Date processing system and method
US20150186326A1 (en) System, Apparatus and Method for Centralized Management of Security Inspection Devices
KR20120088996A (en) Lossless method of sequence of event for plant
CN114327563A (en) Data synchronization method, device, system, storage medium and computer system
CN114500651A (en) Block chain data transmission method, device and equipment and readable storage medium
CN112199094A (en) Information display method and device, electronic equipment and computer readable medium
CN114040485A (en) Method for remote unit open station, base band unit, communication system and medium
CN111859041A (en) Data transmission method and device
CN113133107B (en) Method and device for synchronizing information
CN116849724B (en) Communication method, device, equipment and storage medium based on surgical robot
JP6668820B2 (en) Information processing apparatus, information processing method, and information processing program
CN114374812B (en) Communication information monitoring equipment, method and system of DP (data processing) interface auxiliary channel
WO2024077937A1 (en) Data generation method and apparatus, electronic device, and storage medium
CN117997775A (en) Service monitoring method, device, electronic equipment and storage medium
CN118036765A (en) Federal learning method, federal learning device, electronic apparatus, and computer-readable storage medium

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