Time synchronization method, device, system and computer storage medium

By directly obtaining and updating local time between routing nodes in a wireless self-organizing network, and using time deviations for synchronization, the efficiency problem of the main routing node sending time information hop by hop is solved, and the efficiency and accuracy of network time synchronization are improved.

CN114205044BActive Publication Date: 2024-10-11BOE TECHNOLOGY GROUP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010911424.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-02
Publication Date
2024-10-11
Estimated Expiration
2040-09-02

AI Technical Summary

Technical Problem

In the existing technology, wireless self-organizing networks require the main routing node to perform time synchronization by sending time information hop by hop, which limits the efficiency of time synchronization in the network.

Method used

In wireless self-organizing networks, routing nodes directly obtain and update local time, and synchronize the time of adjacent routing nodes by calculating time deviations, reducing dependence on the main routing node and improving time synchronization efficiency.

Benefits of technology

By directly obtaining the local time of a one-hop routing node and adjusting it, the dependence on the main routing node is reduced and the efficiency and accuracy of network time synchronization are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114205044B_ABST
    Figure CN114205044B_ABST
Patent Text Reader

Abstract

The present application provides a time synchronization method, device, system and computer storage medium, which relates to the field of communication technology. The method includes: sending a time synchronization request to a second routing node, the time synchronization request includes at least the first local time of the first routing node, and the second routing node is a one-hop routing node of the first routing node in the wireless self-organizing network; receiving the second local time sent by the second routing node according to the time synchronization request; updating the local time of the first routing node according to the second local time and the target time deviation to synchronize time with the second routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node. This solution reduces the dependence of time synchronization on the main routing node and improves the efficiency of network time synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a time synchronization method, device, system and computer storage medium. Background Art

[0002] Wireless ad hoc networks are a technology that is different from traditional wireless communication networks. They do not require the support of fixed network devices such as base stations. Instead, each terminal device in the network acts as a routing node and forwards data to each other to achieve data transmission. They are widely used. However, the local time of the terminal devices that serve as routing nodes is different, so the time of each routing node needs to be synchronized.

[0003] In the prior art, the main routing node in the network, that is, the routing node that manages the network, initiates time synchronization and sends its own base local time to each routing node for time synchronization. However, this method is too dependent on the main routing node, which requires the main routing node to send time information hop by hop for time synchronization, limiting the efficiency of time synchronization in the network. Summary of the invention

[0004] The embodiments of the present application provide a time synchronization method, device, system and computer storage medium to solve the problem in the prior art that a main routing node is required to send time information hop by hop for time synchronization, which limits the efficiency of time synchronization in the network.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, a time synchronization method is provided, which is applied to a first routing node in a wireless ad hoc network, and the method comprises:

[0007] Sending a time synchronization request to a second routing node, the time synchronization request including at least a first local time of the first routing node, the second routing node being a one-hop routing node of the first routing node in the wireless ad hoc network;

[0008] Receiving a second local time sent by the second routing node according to the time synchronization request;

[0009] The local time of the first routing node is updated according to the second local time and the target time deviation to synchronize time with the second routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node.

[0010] In a second aspect, another time synchronization method is provided, which is applied to a second routing node in a wireless ad hoc network, and the method includes:

[0011] receiving a time synchronization request sent by a first routing node, the time synchronization request comprising at least: a first current time of the first routing node, the second routing node being a one-hop routing node of the first routing node in the wireless ad hoc network;

[0012] Sending a second local time of the second routing node to the first routing node;

[0013] The local time of the second routing node is updated according to the first local time and the target time deviation to synchronize time with the first routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node.

[0014] In a third aspect, a time synchronization device is provided, characterized in that it is applied to a first routing node in a wireless self-organizing network, and the device includes:

[0015] A first sending module is configured to send a time synchronization request to a second routing node, wherein the time synchronization request includes at least a first local time of the first routing node, and the second routing node is a one-hop routing node of the first routing node in the wireless ad hoc network;

[0016] A first receiving module is configured to receive a second local time sent by the second routing node according to the time synchronization request;

[0017] The first synchronization module is configured to update the local time of the first routing node according to the second local time and the target time deviation so as to synchronize the time with the second routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node.

[0018] In a fourth aspect, another time synchronization device is provided, which is applied to a second routing node in a wireless ad hoc network, and the device includes:

[0019] A second receiving module is configured to receive a time synchronization request sent by a first routing node, wherein the time synchronization request includes at least: a first current time of the first routing node, wherein the second routing node is a one-hop routing node of the first routing node in the wireless ad hoc network;

[0020] A second sending module, configured to send a second local time of the second routing node to the first routing node;

[0021] The second synchronization module is configured to update the local time of the second routing node according to the first local time and the target time deviation so as to synchronize the time with the first routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node.

[0022] In a fifth aspect, a time synchronization system is provided, the system comprising: a first routing node and a second routing node, the first routing node is used to execute the time synchronization method described in the first aspect, and the second routing node is used to execute the time synchronization method described in the second aspect.

[0023] In a sixth aspect, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it can implement the time synchronization method described in the first aspect or the second aspect above.

[0024] The embodiments of the present application provide a time synchronization method, device, system and computer storage medium. The scheme obtains the local time of its one-hop routing node through the routing node in the wireless self-organizing network, and adjusts the local time of the one-hop routing node according to the time deviation to synchronize the time of the routing node, thereby reducing the dependence of time synchronization on the main routing node and improving the efficiency of network time synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 A flowchart of a time synchronization method provided in an embodiment of the present application;

[0027] Figure 2 One of the network topology diagrams of a time synchronization method provided in an embodiment of the present application;

[0028] Figure 3 A second network topology diagram of a time synchronization method provided in an embodiment of the present application;

[0029] Figure 4 A flowchart of another time synchronization method provided in an embodiment of the present application;

[0030] Figure 5 A linear relationship diagram of local time provided in an embodiment of the present application;

[0031] Figure 6 A schematic diagram of a network formation cycle provided in an embodiment of the present application;

[0032] Figure 7 A schematic diagram of the principle of a time synchronization method provided in an embodiment of the present application;

[0033] Figure 8 A flowchart of another time synchronization method provided in an embodiment of the present application;

[0034] Fig. 9 A flowchart of another time synchronization method provided in an embodiment of the present application;

[0035] Fig.10 A structural block diagram of a time synchronization device provided in an embodiment of the present application;

[0036] Fig.11 A structural block diagram of another time synchronization device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical items or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order.

[0039] Embodiment 1

[0040] Reference Figure 1 , is a flowchart of steps of a time synchronization method provided by an embodiment of the present application, which is applied to a first routing node in a wireless self-organizing network, and the method includes:

[0041] Step 101: Send a time synchronization request to a second routing node, wherein the time synchronization request includes at least a first local time of the first routing node, and the second routing node is a one-hop routing node of the first routing node in the wireless ad hoc network.

[0042] In the embodiment of the present application, the wireless self-organizing network is a communication network that is different from the traditional wireless communication network and does not require the support of fixed network equipment such as base stations. Instead, the terminal devices in the network that serve as various routing nodes form a network by themselves, and the routing nodes forward data to each other. The first routing node refers to any routing node that initiates time synchronization in the wireless self-organizing network, and the second routing node is a routing node that performs time synchronization with the first routing node. The difference is that the second routing node is not the responder of the time synchronization, and the second routing node is a one-hop routing node of the first routing node, that is, when the second routing node sends data, it needs to send it to the second routing node first, and there can be one or more of the second routing nodes.

[0043] In actual applications, the first routing node may automatically send a time synchronization request to the second routing node according to a fixed time period such as one hour, one day, or one week to initiate time synchronization with the second routing node. Of course, it may also be actively initiated according to the user's input operation on the first routing node regarding the synchronization time. The specific requirements may be determined and are not limited here.

[0044] The first local time refers to the local time when the first routing node sends a time synchronization request to the second routing node, so that the second routing node can also correct its own local time at the same time.

[0045] Step 102: Receive a second local time sent by the second routing node according to the time synchronization request.

[0046] In an embodiment of the present application, after receiving the time synchronization request sent by the first routing node, the second routing node sends a time synchronization response to the first routing node and carries therein the sum of the local time of sending the time synchronization response and the transmission duration, i.e., the second local time. In other words, the second routing node will take into account the transmission duration and automatically provide the first routing node with the local time when it receives the time synchronization response.

[0047] Step 103: Update the local time of the first routing node according to the second local time and the target time deviation to synchronize time with the second routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node.

[0048] In the embodiment of the present application, the time deviation refers to the deviation between the synchronization time and the actual time caused by the transmission delay during the data transmission between the routing node and its one-hop routing node. It can be understood that when the routing node transmits data with its one-hop routing node, there is a certain delay in the data transmission process due to factors such as network fluctuations, so the second local time provided by the second routing node may have a deviation, making the second local time inaccurate. Therefore, it is necessary to correct the second local time provided by the second routing node through the time deviation.

[0049] Each routing node stores a time deviation table between it and a one-hop routing node. The time deviation in the time deviation table can be experimentally measured by interacting with each routing node and its one-hop routing node after the wireless ad hoc network is built. The time deviation table contains the node number and the corresponding time deviation of each one-hop routing node. Therefore, by combining the second local time of the second routing node with the target time deviation, it can be used as the local time of the first routing node to update the local time of the first routing node.

[0050] For example, refer to Figure 2 , showing one of the network topology diagrams of a time synchronization method, wherein 1, 2, 3, 4, and 5 represent routing nodes respectively. It can be seen that the time deviation table of routing node 1 contains its time deviation with one-hop routing nodes 2, 3, 4, and 5, and the time deviation table of routing node 2 contains its time deviation with one-hop routing nodes 1, 3, and 5, and the same is true for routing nodes 3, 4, and 5.

[0051] Reference Figure 3 , showing a network topology diagram of a time synchronization method, relative to Figure 1 , the routing nodes of the wireless self-organizing network are more complex, including routing nodes 1 to 10. Similarly, the time deviation table of each routing node contains the time deviation between it and the one-hop routing node. Of course, the one-hop routing node of a routing node is defined by the routing table of the wireless self-organizing network. If routing node A appears at the position of the next-hop routing node of routing node B, routing node A is the one-hop routing node of routing node B. The routing node representation is determined when building a wireless self-organizing network. The specific determination rules can be set by the user according to actual needs, and are not limited here.

[0052] This embodiment obtains the local time of its one-hop routing node through the routing node in the wireless self-organizing network, and adjusts the local time of the one-hop routing node according to the time deviation to synchronize the time of the routing node, thereby reducing the dependence of time synchronization on the main routing node and improving the efficiency of network time synchronization.

[0053] Embodiment 2

[0054] Reference Figure 4 , is a flowchart of another time synchronization method provided by an embodiment of the present application, which is applied to a first routing node in a wireless self-organizing network, and the method includes:

[0055] Step 201: Send a time synchronization request to a second routing node, wherein the time synchronization request includes at least a first local time of the first routing node, and the second routing node is a one-hop routing node of the first routing node in the wireless ad hoc network.

[0056] This step can refer to the detailed description of step 101 and will not be repeated here.

[0057] Step 202: Receive a second local time sent by the second routing node according to the time synchronization request.

[0058] This step can refer to the detailed description of step 102 and will not be repeated here.

[0059] Step 203: when there are multiple second local times, obtain a candidate local time corresponding to each second local time according to a target time deviation, wherein the target time deviation is a time deviation generated by data transmission between the first routing node and the second routing node.

[0060] In an embodiment of the present application, since the data transmission medium between the first routing node and the second routing node may be unstable, for example, a change in the mutual distance or a change in the transmission medium will cause the actual time deviation of the data interaction to change. Therefore, the accuracy of synchronizing the time through a single interaction is poor. The first routing node and the second routing node can obtain multiple second local times of the second routing node through multiple interactions, that is, multiple times of sending time synchronization requests. By combining the multiple second local times with the target time deviation, the local times of multiple first routing nodes can be obtained.

[0061] Step 204: Obtain a linear relationship between the candidate local time corresponding to each of the second local times and the initial local time when the first routing node receives the plurality of the second local times.

[0062] In the embodiment of the present application, the local time when the first routing node receives the second local time is fitted with the candidate local time using the least square method, so as to obtain a linear relationship between the initial local time when the first routing node receives the second local time and the candidate local time. The linear relationship can reflect the linear relationship between the initial local time when the first routing node receives the second local time and the candidate local time.

[0063] For example, refer to Figure 5 , showing a linear relationship diagram of local time provided by an embodiment of the present application, wherein the x-axis is the initial local time when the first routing node receives the second local time, and the y-axis is the candidate local time. It can be seen that the fitting curve obtained by fitting the initial local time of the first routing node and the candidate local time obtained according to the deviation of the second local time and the target time can reflect the linear relationship between the initial local time and the candidate local time, and the local time of the first routing node can be corrected through the linear relationship diagram. It can be understood that the multiple second local times can be sent multiple times by the same second routing node, or can be sent by multiple second routing nodes. Since the local time of each second routing node may have a certain deviation around the standard local time of the main routing node, the candidate local time calculated by the multiple second local times can be fitted with the initial local time. The obtained fitting curve can reflect the linear relationship between the candidate local time and the initial local time more accurately, which can effectively improve the accuracy of time synchronization.

[0064] Step 205: Taking the current local time of the first routing node as the target initial local time, determining the corresponding candidate local time in the linear relationship, and updating the local time of the first routing node.

[0065] In the embodiment of the present application, the first routing node uses the current local time as the initial local time, and determines the corresponding y-axis value in the linear relationship graph, which can be used as the local time of the first router.

[0066] Optionally, the target time deviation is obtained by following the steps:

[0067] Step S1, sending a time deviation update request to the second routing node;

[0068] Step S2, receiving a time deviation construction response sent by the second routing node according to the time deviation construction request, wherein the time deviation construction response at least includes: a first receiving time when the second routing node receives the time deviation construction request and a first sending time when the second routing node sends the time deviation construction response;

[0069] Step S3, obtaining the target time deviation between the first routing node and the second routing node according to the second sending time of the first routing node sending the time deviation construction request, the second receiving time of the first routing node receiving the time deviation construction response, the first receiving time and the second sending time.

[0070] Step S4: sending a time deviation update request to the second routing node according to a preset period to update the target time deviation.

[0071] In the embodiments of this application, refer to Figure 6 After the main routing node is established in the wireless self-organizing network (No. 1 is the node number of the main routing node that initiates the network establishment), the remaining routing nodes (No. 2, 3, 4, and 5) are connected according to Figure 6 As shown in the time slot allocation, the network joining request, routing table establishment (the routing table constructed here includes the network address of the routing node and the network address of the next-hop routing node), and the time deviation table are completed in sequence within their respective time slots.

[0072] Reference Figure 7 The time deviation is calculated by exchanging the local time between routing nodes A and B using the following formula 1:

[0073] (1)

[0075] in, is a second sending time at which the first routing node sends the time deviation construction request, is the first reception time of the second routing node receiving the time deviation construction request, is the first sending time of the second routing node sending the time deviation construction response, is the second receiving time of the first routing node receiving the time deviation constructing response, is the target time deviation.

[0076] The time deviation table establishment cycle is a cyclic process. Since the location distribution and number of routing nodes may change, the established time deviation table can be updated according to a preset time period.

[0077] Among them, the number of each routing node is obtained through the time slot competition mechanism, that is, after the node competes for a time slot in the network joining request period, it will be assigned a corresponding number to complete all subsequent processes. The specific time slot competition mechanism can be referred to the existing technology and will not be repeated here.

[0078] After the network joining request of the routing node is accepted by the main routing node, it will establish a network connection with other routing nodes within the communication range and establish a local routing table. After that, each routing node initiates interaction with the one-hop routing node in its own routing table to calculate the local time deviation between the two.

[0079] Optional, see Figure 8 , before step 201, further comprising;

[0080] Step 206: Receive the standard local time sent by the second routing node, and the standard local time is broadcasted outward through the main routing node in the wireless ad hoc network.

[0081] In an embodiment of the present application, after the wireless self-organizing network is established, the main routing node will broadcast its own standard local time to the outside, and each routing node will send it to each other to synchronize with the standard local time. The responding second routing node, as a one-hop routing node of the first routing node, will also send the standard time to the first routing node.

[0082] Step 207: Update the local time of the first routing node according to the standard local time and the target time deviation to synchronize the time with the main routing node.

[0083] In the embodiment of the present application, after receiving the standard local time, the first routing node combines the standard local time with the target time deviation between it and the second routing node to obtain its own standard local time.

[0084] This embodiment obtains the local time of its one-hop routing node through the routing node in the wireless self-organizing network, and adjusts the local time of the one-hop routing node according to the time deviation to synchronize the time of the routing node, which reduces the dependence of time synchronization on the main routing node and improves the efficiency of network time synchronization. In addition, the accuracy of time synchronization is guaranteed by periodically updating the time deviation. In addition, by establishing a linear relationship between the local time and the local time of multiple one-hop routing nodes, the local time of the routing node is obtained according to the linear relationship, which reduces the impact of time deviation changes on time synchronization and improves the accuracy of time synchronization.

[0085] Embodiment 3

[0086] Reference Fig. 9 , is a flowchart of the steps of another time synchronization method provided by an embodiment of the present application, which is applied to a second routing node in a wireless self-organizing network, and the method includes:

[0087] Step 301, receiving a time synchronization request sent by a first routing node, the time synchronization request at least including: a first current time of the first routing node, the second routing node is a one-hop routing node of the first routing node in the wireless ad hoc network.

[0088] In the embodiment of the present application, the first routing node will send its own first current time to the first routing node while performing time synchronization with the second routing node, so that the second routing node can also correct its own local time at the same time.

[0089] Step 302: Send the second local time of the second routing node to the first routing node.

[0090] In the embodiment of the present application, the second routing node sends a time synchronization response to the first routing node according to the time synchronization request, and carries therein the second local time at which the time synchronization response is sent.

[0091] Step 303: Update the local time of the second routing node according to the first local time and the target time deviation to synchronize time with the first routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node.

[0092] In the embodiment of the present application, the second routing node performs time synchronization according to the target time deviation in a manner similar to that of the first routing node, and will not be described again here to avoid repetition.

[0093] In this embodiment, the routing node in the wireless self-organizing network obtains the local time of its one-hop routing node, and adjusts the local time of the one-hop routing node according to the time deviation to synchronize the time of the routing node, which reduces the dependence of time synchronization on the main routing node and improves the efficiency of network time synchronization. In addition, the accuracy of time synchronization is guaranteed by periodically updating the time deviation.

[0094] Embodiment 4

[0095] Reference Fig.10 , an embodiment of the present application provides a structural block diagram 40 of a time synchronization device, which is applied to a first routing node in a wireless ad hoc network, and the device includes:

[0096] A first sending module 401 is configured to send a time synchronization request to a second routing node, wherein the time synchronization request includes at least a first local time of the first routing node, and the second routing node is a one-hop routing node of the first routing node in the wireless ad hoc network;

[0097] A first receiving module 402 is configured to receive a second local time sent by the second routing node according to the time synchronization request;

[0098] The first synchronization module 403 is configured to update the local time of the first routing node according to the second local time and the target time deviation so as to synchronize the time with the second routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node.

[0099] Optionally, the first synchronization module 403 is further configured to:

[0100] When there are multiple second local times, obtaining a candidate local time corresponding to each second local time according to the target time deviation;

[0101] Acquire a linear relationship between a candidate local time corresponding to each of the second local times and an initial local time when the first routing node receives the plurality of the second local times;

[0102] The current local time of the first routing node is used as the target initial local time, a corresponding candidate local time is determined in the linear relationship, and the local time of the first routing node is updated.

[0103] Optionally, the device further comprises: a pre-built module configured to:

[0104] After the wireless self-organizing network is constructed, sending a time deviation construction request to the second routing node;

[0105] Receiving a time deviation construction response sent by the second routing node according to the time deviation construction request, the time deviation construction response at least comprising: a first receiving time when the second routing node receives the time deviation construction request and a first sending time when the second routing node sends the time deviation construction response;

[0106] The target time deviation between the first routing node and the second routing node is obtained according to the second sending time when the first routing node sends the time deviation construction request, the second receiving time when the first routing node receives the time deviation construction response, the first receiving time, and the second sending time.

[0107] Optionally, the device further includes: an updating module configured to:

[0108] A time deviation update request is sent to the second routing node according to a preset period to update the target time deviation.

[0109] Optionally, the device further includes: a third synchronization module, configured to:

[0110] Receiving a standard local time sent by a second routing node, wherein the standard local time is broadcasted externally through a main routing node in the wireless ad hoc network;

[0111] The local time of the first routing node is updated according to the standard local time and the target time deviation to synchronize the time with the master routing node.

[0112] In this embodiment, the routing node in the wireless self-organizing network obtains the local time of its one-hop routing node, and adjusts the local time of the one-hop routing node according to the time deviation to synchronize the time of the routing node, which reduces the dependence of time synchronization on the main routing node and improves the efficiency of network time synchronization. In addition, the accuracy of time synchronization is guaranteed by periodically updating the time deviation.

[0113] Embodiment 5

[0114] Reference Fig.11 , the embodiment of the present application provides a structural block diagram 50 of another time synchronization device, which is applied to a second routing node in a wireless self-organizing network, and the device includes:

[0115] The second receiving module 501 is configured to receive a time synchronization request sent by a first routing node, wherein the time synchronization request includes at least: a first current time of the first routing node, the second routing node being a one-hop routing node of the first routing node in the wireless ad hoc network;

[0116] A second sending module 502 is configured to send a second local time of the second routing node to the first routing node;

[0117] The second synchronization module 503 is configured to update the local time of the second routing node according to the first local time and the target time deviation so as to synchronize the time with the first routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node.

[0118] In this embodiment, the routing node in the wireless self-organizing network obtains the local time of its one-hop routing node, and adjusts the local time of the one-hop routing node according to the time deviation to synchronize the time of the routing node, which reduces the dependence of time synchronization on the main routing node and improves the efficiency of network time synchronization. In addition, the accuracy of time synchronization is guaranteed by periodically updating the time deviation.

[0119] An embodiment of the present application provides a time synchronization system, which includes: a first routing node and a second routing node, the first routing node is used to execute the time synchronization method described in any one of Embodiment 1 or Embodiment 2, and the second routing node is used to execute the time synchronization method described in Embodiment 3.

[0120] In this embodiment, the routing node in the wireless self-organizing network obtains the local time of its one-hop routing node, and adjusts the local time of the one-hop routing node according to the time deviation to synchronize the time of the routing node, which reduces the dependence of time synchronization on the main routing node and improves the efficiency of network time synchronization. In addition, the accuracy of time synchronization is guaranteed by periodically updating the time deviation.

[0121] Embodiment 6

[0122] An embodiment of the present application provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned time synchronization method can be implemented.

[0123] The embodiment of the present application provides a computer storage medium, which obtains the local time of its one-hop routing node through the routing node in the wireless self-organizing network, and adjusts the local time of the one-hop routing node according to the time deviation to synchronize the time of the routing node, which reduces the dependence of time synchronization on the main routing node and improves the efficiency of network time synchronization. In addition, the accuracy of time synchronization is guaranteed by periodically updating the time deviation.

[0124] It will be appreciated by those skilled in the art that the present application includes devices for performing one or more of the operations described in the present application. These devices may be specially designed and manufactured for the desired purpose, or may also include known devices in general-purpose computers. These devices have computer programs stored therein, which are selectively activated or reconstructed. Such computer programs may be stored in a storage medium of a device (e.g., a computer) or in any type of medium suitable for storing electronic instructions and coupled to a bus, respectively, the computer storage medium including but not limited to any type of disk (including floppy disk, hard disk, optical disk, CD-ROM and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the storage medium includes any medium that stores or transmits information in a readable form by a device (e.g., a computer).

[0125] Those skilled in the art will appreciate that each frame in these structure diagrams and / or block diagrams and / or flow charts and combinations of frames in these structure diagrams and / or block diagrams and / or flow charts can be implemented using computer program instructions. Those skilled in the art will appreciate that these computer program instructions can be provided to a general-purpose computer, a professional computer, or a processor of other programmable data processing methods to implement, thereby executing the scheme specified in the frame or frames of the structure diagrams and / or block diagrams and / or flow charts disclosed in this application through the processor of the computer or other programmable data processing methods.

[0126] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A time synchronization method, characterized in that: Applied to a first routing node in a wireless ad hoc network, the method comprises: Sending a time synchronization request to a second routing node, the time synchronization request including at least a first local time of the first routing node, the second routing node being a one-hop routing node of the first routing node in the wireless ad hoc network; Receiving a second local time sent by the second routing node according to the time synchronization request; updating the local time of the first routing node according to the second local time and the target time deviation to synchronize the time with the second routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node; Among them, the updating of the local time of the first routing node according to the second local time and the target time deviation includes: when there are multiple second local times, obtaining the candidate local time corresponding to each second local time according to the target time deviation; obtaining the linear relationship between the candidate local time corresponding to each second local time and the initial local time when the first routing node receives multiple second local times; taking the current local time of the first routing node as the target initial local time, determining the corresponding candidate local time in the linear relationship, and updating the local time of the first routing node.

2. The method according to claim 1, characterized in that The target time deviation is obtained by the following steps: After the wireless self-organizing network is constructed, sending a time deviation construction request to the second routing node; Receiving a time deviation construction response sent by the second routing node according to the time deviation construction request, the time deviation construction response at least comprising: a first receiving time when the second routing node receives the time deviation construction request and a first sending time when the second routing node sends the time deviation construction response; The target time deviation between the first routing node and the second routing node is obtained according to the second sending time when the first routing node sends the time deviation construction request, the second receiving time when the first routing node receives the time deviation construction response, the first receiving time, and the second sending time.

3. The method according to claim 2, characterized in that After acquiring the target time deviation between the first routing node and the second routing node according to the second sending time of the first routing node sending the time deviation construction request, the second receiving time of the first routing node receiving the time deviation construction response, the first receiving time, and the second sending time, the method further includes: A time deviation update request is sent to the second routing node according to a preset period to update the target time deviation.

4. The method according to claim 1, characterized in that: Before sending the time synchronization request to the second routing node, the method further includes: Receiving a standard local time sent by a second routing node, wherein the standard local time is broadcasted externally through a main routing node in the wireless ad hoc network; The local time of the first routing node is updated according to the standard local time and the target time deviation to synchronize the time with the master routing node.

5. A time synchronization method, characterized in that: Applied to a second routing node in a wireless ad hoc network, the method comprises: receiving a time synchronization request sent by a first routing node, the time synchronization request comprising at least: a first local time of the first routing node, the second routing node being a one-hop routing node of the first routing node in the wireless ad hoc network; Sending a second local time of the second routing node to the first routing node; updating the local time of the second routing node according to the first local time and the target time deviation to synchronize the time with the first routing node, wherein the target time deviation is the time deviation generated by data transmission between the first routing node and the second routing node; In the case where there are multiple second local times, the first routing node obtains a candidate local time corresponding to each second local time according to the target time deviation; obtains a linear relationship between the candidate local time corresponding to each second local time and the initial local time when the first routing node receives multiple second local times; takes the current local time of the first routing node as the target initial local time, determines the corresponding candidate local time in the linear relationship, and updates the local time of the first routing node.

6. A time synchronization device, characterized in that: Applied to a first routing node in a wireless ad hoc network, the device comprises: A first sending module is configured to send a time synchronization request to a second routing node, wherein the time synchronization request includes at least a first local time of the first routing node, and the second routing node is a one-hop routing node of the first routing node in the wireless ad hoc network; A first receiving module is configured to receive a second local time sent by the second routing node according to the time synchronization request; a first synchronization module, configured to update the local time of the first routing node according to the second local time and a target time deviation, so as to synchronize the time with the second routing node, wherein the target time deviation is a time deviation generated by data transmission between the first routing node and the second routing node; Among them, the updating of the local time of the first routing node according to the second local time and the target time deviation includes: when there are multiple second local times, obtaining the candidate local time corresponding to each second local time according to the target time deviation; obtaining the linear relationship between the candidate local time corresponding to each second local time and the initial local time when the first routing node receives multiple second local times; taking the current local time of the first routing node as the target initial local time, determining the corresponding candidate local time in the linear relationship, and updating the local time of the first routing node.

7. A time synchronization device, characterized in that: Applied to a second routing node in a wireless self-organizing network, the device comprises: A second receiving module is configured to receive a time synchronization request sent by a first routing node, wherein the time synchronization request includes at least: a first local time of the first routing node, wherein the second routing node is a one-hop routing node of the first routing node in the wireless ad hoc network; A second sending module, configured to send a second local time of the second routing node to the first routing node; a second synchronization module, configured to update the local time of the second routing node according to the first local time and a target time deviation, so as to synchronize the time with the first routing node, wherein the target time deviation is a time deviation generated by data transmission between the first routing node and the second routing node; In the case where there are multiple second local times, the first routing node obtains a candidate local time corresponding to each second local time according to the target time deviation; obtains a linear relationship between the candidate local time corresponding to each second local time and the initial local time when the first routing node receives multiple second local times; takes the current local time of the first routing node as the target initial local time, determines the corresponding candidate local time in the linear relationship, and updates the local time of the first routing node.

8. A time synchronization system, characterized in that: The system comprises: a first routing node and a second routing node, wherein the first routing node is used to execute the time synchronization method described in any one of claims 1 to 4, and the second routing node is used to execute the time synchronization method described in claim 5.

9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it can implement the time synchronization method described in any one of claims 1 to 4 or the time synchronization method described in claim 5.

Citation Information

Patent Citations

  • Methods and system for synchronizing nodes in a wireless network

    CN107567689A

  • Cross-layer approach to virtualized overlay on ad hoc networks

    US20090003353A1

  • Recursive time synchronization protocol method for wireless sensor networks

    US20140355628A1