CN117241366A - Inter-gateway time synchronization method, server, gateway and computer readable medium - Google Patents

Inter-gateway time synchronization method, server, gateway and computer readable medium Download PDF

Info

Publication number
CN117241366A
CN117241366A CN202311118783.9A CN202311118783A CN117241366A CN 117241366 A CN117241366 A CN 117241366A CN 202311118783 A CN202311118783 A CN 202311118783A CN 117241366 A CN117241366 A CN 117241366A
Authority
CN
China
Prior art keywords
gateway
time
server
synchronization
gateways
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
CN202311118783.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.)
Hangzhou Hailian Iot Technology Co ltd
Original Assignee
Hangzhou Hailian Iot Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hailian Iot Technology Co ltd filed Critical Hangzhou Hailian Iot Technology Co ltd
Priority to CN202311118783.9A priority Critical patent/CN117241366A/en
Publication of CN117241366A publication Critical patent/CN117241366A/en
Pending legal-status Critical Current

Links

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The application discloses a time synchronization method between gateways, a server, a gateway and a computer readable medium, which relate to the technical field of wireless communication and are used for the server and comprise the following steps: receiving and processing time synchronization requests sent by the gateways; receiving a data packet carrying a gateway time stamp, and calculating the time difference of gateway local time stamps among gateways covering repeated nodes according to the gateway time stamp, wherein the repeated nodes are nodes overlapped and covered by different gateways; and transmitting a calibration quantity to each gateway covering the repeated node based on the time difference so as to synchronize the time between each gateway. The application has the advantages of low cost, high precision and low power consumption.

Description

Inter-gateway time synchronization method, server, gateway and computer readable medium
Technical Field
The present application relates to the field of wireless communications technologies, and in particular, to a method for time synchronization between gateways, a server, a gateway, and a computer readable medium.
Background
Due to the existence of network delay and the different geographic positions of different gateways in the network, the time between the gateways is not synchronous, and the time between the gateways and the server is not synchronous. Multiple gateways serve the same complex event and must refer to the same clock to ensure proper execution order. If the gateway is required to perform tasks simultaneously or in strict timing, the time error must be within a few milliseconds. The gateway log information analysis processing also needs to use the synchronous time as a reference. Thus, it is important to keep the time between gateways and servers synchronized to overcome the time difference. In the prior art, various gateway time synchronization technologies exist, but the gateway time synchronization technologies have the problems of high cost, poor precision, great difficulty, incapability of using a GPS time service module in part of scenes, and the like.
Disclosure of Invention
The present application aims to solve one of the technical problems in the related art to a certain extent. Therefore, the application provides a time synchronization method between gateways, which has the advantages of low cost, high precision and low power consumption.
In order to achieve the above purpose, the application adopts the following technical scheme:
a time synchronization method between gateways is used for a server and comprises the following steps:
preliminary synchronization: receiving and processing time synchronization requests sent by the gateways;
accurate synchronization: receiving a data packet, wherein the data packet carries a gateway time stamp, calculating time difference among gateways covering repeated nodes according to the gateway time stamp, wherein the time difference is the time difference of the gateway time stamp, and the repeated nodes are nodes overlapped and covered by different gateways;
and (3) adjusting: and transmitting a calibration quantity to each gateway covering the repeated node based on the time difference so as to synchronize the time between each gateway.
Optionally, the server stores information of all gateways and information of all repetition nodes, the information of the gateways includes a synchronization state of the gateway and a time difference between the gateway and other gateways, the synchronization state of the gateway includes a number of preliminary synchronization and a number of accurate synchronization, and the information of the repetition nodes includes a list of gateways covering the repetition nodes.
Optionally, when the newly added gateway accesses the server, responding to the request of the newly added gateway, the server performs primary synchronization on the newly added gateway once, and stores the information of the newly added gateway; when the gateway accessing the server is removed, the server deletes the information of the removed gateway.
Optionally, the server accurately synchronizes the gateway covered by the repeating node sending the data packet every time the server receives the data packet of the repeating node.
Optionally, the server responds to the gateway initiated accurate synchronization, and controls the repeated node under the gateway initiating the accurate synchronization request to request accurate synchronization to the gateway.
Correspondingly, the application also provides a server, which comprises:
one or more processors;
a memory having one or more computer programs stored thereon, which when executed by the one or more processors cause the one or more processors to implement the inter-gateway time synchronization method of any of the preceding claims.
On the other hand, the application also provides a time synchronization method between gateways, which is used for the gateways and comprises the following steps:
preliminary synchronization: sending a time synchronization request to a server, calculating network delay based on the processing of the time synchronization request by the server, and acquiring server time based on the network delay;
accurate synchronization: the repeated node sends data packets to a server through each gateway covering the repeated node, wherein the repeated node is a node overlapped by different gateways, and the data packets carry gateway time stamps of the gateways covering the repeated node;
and (3) adjusting: each gateway covering the repeating node receives the calibration quantity from the server for accurate time synchronization.
Optionally, the network delay includes an upstream network delay and a downstream network delay, the network delay being calculated by the following formula:
Δ t_process =t 3 -t 2
wherein delta is delay Delta for network delay t_process Processing time length of time synchronization request sent by each gateway for server, t 1 Gateway time, t, for gateway to send time synchronization request to server 2 Server time, t, for server to receive time synchronization request from gateway 3 Server time, t, for server processing time synchronization request completion and issuing server time stamp 4 A gateway time of the server timestamp is received for the gateway.
Optionally, the server time obtained by each gateway is the sum of the network delay of the gateway and the server time stamp.
Optionally, the gateway requiring calibration time requests accurate synchronization from the server every calibration period.
Optionally, the gateway records the time of the last accurate synchronization and its time error from the second accurate synchronization, the time error is the difference between local time stamps of the gateway covering the repeated node, when the time difference accumulation exceeds the error threshold and the recorded time is not accurately synchronized, the gateway accurately synchronizes the gateway by the server.
Correspondingly, the application also provides a gateway, which comprises:
one or more processors;
a memory having one or more computer programs stored thereon, which when executed by the one or more processors cause the one or more processors to implement the inter-gateway time synchronization method of any of the preceding claims.
Meanwhile, the application also provides a computer readable medium, on which a computer program is stored, the computer program, when executed by a processor, implementing the inter-gateway time synchronization method according to any one of the above.
These features and advantages of the present application will be disclosed in more detail in the following detailed description and the accompanying drawings. The best mode or means of the present application will be described in detail with reference to the accompanying drawings, but is not limited to the technical scheme of the present application. In addition, these features, elements, and components are shown in plural in each of the following and drawings, and are labeled with different symbols or numerals for convenience of description, but each denote a component of the same or similar construction or function.
Drawings
The application is further described below with reference to the accompanying drawings:
FIG. 1 is a flow chart of a server side in an embodiment of the application;
FIG. 2 is a timing diagram of precise synchronization in an embodiment of the present application;
fig. 3 is a flowchart of a gateway side in an embodiment of the present application;
FIG. 4 is a topology diagram of a repeating node, gateway and server in an embodiment of the application;
FIG. 5 is a schematic diagram of a repeating node in an embodiment of the present application;
FIG. 6 is a schematic diagram of time differences in an embodiment of the present application;
FIG. 7 is a diagram illustrating network delays in an embodiment of the present application;
FIG. 8 is a timing diagram of an additional gateway according to an embodiment of the present application;
FIG. 9 is a schematic diagram of precisely synchronizing gateways covered by nodes to be calibrated according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a server performing accurate synchronization on a gateway in response to an accurate synchronization request initiated by the gateway in an embodiment of the present application;
FIG. 11 is a schematic diagram of a server according to the present application;
fig. 12 is a schematic diagram of a gateway according to the present application;
fig. 13 is a schematic diagram of a computer readable medium according to the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The examples in the embodiments are intended to illustrate the present application and are not to be construed as limiting the present application.
Reference in the specification to "one embodiment" or "an example" means that a particular feature, structure, or characteristic described in connection with the embodiment itself can be included in at least one embodiment of the present patent disclosure. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment.
As a first aspect of the present application, there is provided an inter-gateway time synchronization method for a server, as shown in fig. 1 and 2, the method comprising:
preliminary synchronization: receiving and processing time synchronization requests sent by the gateways;
in the system constructed by the nodes, the gateways and the servers, all the gateways have no server time in the initial stage of construction, and each gateway operates under the timing time of the gateway. When the gateway connects to the server, the gateway cannot synchronize time directly with the NTP server, and thus time service occurs through a communication protocol with the IoT platform. The node equipment in the system supports real-time control by the server. The node can be a low-power consumption node, and receives a control instruction after awakening; and the device can also be a non-low-power-consumption device and is always in a monitoring state. The whole system does not need to synchronize universal time, only needs to ensure time synchronization in the system, and the operation of the whole network is based on the system time. The system time can be standard world time or a self-defined time system.
Accurate synchronization: the node data uplink, the server receives the data packet, and the received data packet carries the gateway time stampThe server analyzes the gateway time stamp of the data packet, and calculates the time difference between the gateways covering the repeated nodes according to the gateway time stamp. The repetition Node is Node, as shown in fig. 4 and 5, and is overlapped and covered by different gateways, namely Gateway1 and Gateway 2. The data packets received by the server are multipath data packets, i.e. the same data packets sent by each gateway covering the duplicate nodes. The time difference is the time difference of the gateway local time stamp, and in this embodiment, as shown in fig. 6, after preliminary synchronization, T gw1 Server time, T, for Gateway1 gw2 Server time for Gateway 2. Assuming that two gateways are respectively 1km away from a node, the electromagnetic wave propagation time is:
this error is negligible in the millisecond time synchronization.
Then repeating Node data uplink, T gw1 ' is the server time, T, recorded by Gateway1 when Gateway1 receives packet { gw1: tgw1, nodePacket:xxxxx } gw2 ' is the server time recorded by Gateway2 when Gateway2 receives packet { gw2: tgw2, nodepacket:xxxxx }. Gateway1 and Gateway2 send data packets { gw1: tgw1, nodePacket:xxxxx } and data packets { gw2: tgw2, nodePacket:xxxxx } to the server, respectively, upstream of the data. From this, the time difference of the running Gateway local time stamp between Gateway1 and Gateway2 can be calculated as delta t_err =T gw1 ′-T gw2 ′。
And (3) adjusting: and transmitting a calibration quantity to each gateway covering the repeated node based on the time difference so as to synchronize the time between each gateway. Since the calibration quantity is issued to each gateway, the accuracy of calibration is not affected no matter how much network delay is issued. For example, if the calibration error is +50ms, the Gateway1 receives the calibration command and then transmits the Gateway time to +50ms. The calibrated gateway time, which is theoretically less than 1ms accurate, is only produced in electromagnetic wave propagation time and system processing time.
In this embodiment, because a GPS module with a timing function is not required, the technical solution provided in this embodiment may be used for time synchronization in a scenario where the GPS timing module cannot be used. Meanwhile, the GPS module with timing function is not needed, so that the cost is saved, and the cost of an enterprise is reduced. In this embodiment, the gateways perform time synchronization through the technical scheme provided in this embodiment, the error is only in ms level, so that the accuracy of time synchronization is greatly improved, when a large number of node devices use TDFD uplink data, the protection period of the uplink time window of the node devices can be shortened, the data transmission efficiency is greatly improved, the power consumption of the devices is reduced, and the service time of the devices is prolonged.
In some networks where the gateways have overlapping coverage, such as a lorewan network, or a self-developed cellular-like network, the task of scheduling the gateways may be accurate to the order of milliseconds, thereby reducing interference from node devices within the overlapping coverage of the gateways to receive instructions. Some nodes can uplink data from a plurality of gateways and form multipath data packets at the server side. At this time, the gateway time synchronization can enable a plurality of gateways in overlapping coverage to work cooperatively, and uplink by TD-FD, so as to furthest improve the communication efficiency and reduce the channel occupation of the half-duplex gateway for receiving and transmitting data.
In the present disclosure, there is no particular limitation on how to perform the precise synchronization step. As an alternative embodiment, the server stores information of all gateways and information of all repeating nodes. The stored information of the gateway includes a synchronization status of the gateway and a time difference between the gateway and other gateways, and the information of the repeating node includes a list of gateways covering the repeating node. In this embodiment, the synchronization state of the gateway includes the number of preliminary synchronization and the number of accurate synchronization. When primary synchronization is generated, the gateway marks L1 level synchronization, and the server time difference is 0; when one accurate synchronization is generated, the gateway marks the L2 level synchronization, and the server time difference is calculated according to the multipath data packet, so as to obtain the following storage:
the server stores the relevant information, one is used for marking whether the gateway needs to continue synchronization or active calibration, and the other is used for finding out optional nodes during active calibration.
In the present disclosure, there is no particular limitation on how the preliminary synchronization step is performed. As an alternative embodiment, as shown in fig. 8, when the newly added gateway accesses to the server, in response to a request of the newly added gateway, the server performs primary synchronization on the newly added gateway, and stores information of the newly added gateway, for example [ L1 level synchronization, 0 system time error ], and waits for subsequent multipath node data that can be uplink through the gateway and at least one other gateway to perform accurate synchronization. When the gateway is deleted or offline for a long time, the access server needs to be removed by the gateway, and the server deletes the information of the removed gateway when the gateway is removed.
In the present disclosure, there is no particular limitation on how the adjusting step is performed. As an alternative embodiment, accurate synchronization may be required actively when the node does not send data for a long time or the heartbeat packet interval is relatively long, and the gateway needs to synchronize due to its own timing error. As shown in fig. 9, each time the server receives a data packet of a repeating node, the gateway covered by the repeating node sending the data packet is accurately synchronized, the repeating node in the server storage under the coverage of the gateway is selected, the server issues a command to enable the repeating node to generate an uplink data packet, and the multipath data packet can be adopted for accurate synchronization after the data packet is uplink.
In the present disclosure, there is no particular limitation on how the adjusting step is performed. As an alternative embodiment, as shown in fig. 10, the server responds to the gateway-initiated accurate synchronization request, and controls the repetition node under the gateway which initiates the accurate synchronization request to accurately synchronize the gateway. Because the crystal has the problems of oscillation error, temperature drift, year drift and the like, if the system is synchronized only once, the time error among multiple gateways can be larger and larger along with the time, and therefore, the accumulated error is compared with an error threshold value so as to reduce the operation error.
Meanwhile, the present embodiment further provides a server, as shown in fig. 11, including: one or more processors 101;
a memory 102 having one or more computer programs stored thereon, which when executed by the one or more processors 101, cause the one or more processors 101 to implement an inter-gateway time synchronization method according to the first aspect of the present application.
The electronic device may further comprise one or more I/O interfaces 103 coupled between the processor 101 and the memory 102 and configured to enable information interaction of the processor 101 with the memory 102.
Wherein the processor 101 is a device having data processing capabilities, including but not limited to a central processing unit 101 (CPU) or the like; the first memory 102 is a device with data storage capability including, but not limited to, random access memory 102 (RAM, more specifically SDRAM, DDR, etc.), read-only memory 102 (ROM), electrically charged erasable programmable read-only memory 102 (EEPROM), FLASH memory (FLASH); an I/O interface 103 (read/write interface) is coupled between the processor 101 and the memory 102 to enable information interaction between the processor 101 and the memory 102, including but not limited to a data Bus 104 (Bus), etc.
In some embodiments, processor 101, memory 102, and I/O interface 103 are connected to each other via bus 104, and thus to other components of the computing device.
As a second aspect of the present application, there is provided an inter-gateway time synchronization method for a gateway, as shown in fig. 2 and 3, the method comprising:
preliminary synchronization: sending a time synchronization request to a server, calculating network delay based on the processing of the time synchronization request by the server, and acquiring server time based on the network delay;
in the system constructed by the nodes, the gateways and the servers, all the gateways have no server time in the initial stage of construction, and each gateway operates under the timing time of the gateway. When the gateway connects to the server, the gateway cannot synchronize time directly with the NTP server, and thus time service occurs through a communication protocol with the IoT platform. The node equipment in the system supports real-time control by the server. The node can be a low-power consumption node, and receives a control instruction after awakening; and the device can also be a non-low-power-consumption device and is always in a monitoring state. The whole system does not need to synchronize universal time, only needs to ensure time synchronization in the system, and the operation of the whole network is based on the system time. The system time can be standard world time or a self-defined time system.
Accurate synchronization: the repeating node sends data packets to the server via each gateway covering the repeating node. In this embodiment, as shown in fig. 4 and fig. 5, the duplicate nodes are nodes overlapped by different gateways, and the data packet carries a gateway timestamp of each gateway overlapping the duplicate nodes.
And (3) adjusting: each gateway covering the repeating node receives the calibration quantity from the server for accurate time synchronization. Since the calibration amount is received by each gateway, the accuracy of the calibration is not affected by how much network delay is received. For example, if the calibration error received by Gateway1 is +50ms, gateway1 will receive the calibration command and then add the Gateway time to +50ms. The calibrated gateway time, which is theoretically less than 1ms accurate, is only produced in electromagnetic wave propagation time and system processing time.
In this embodiment, because a GPS module with a timing function is not required, the technical solution provided in this embodiment may be used for time synchronization in a scenario where the GPS timing module cannot be used. Meanwhile, the GPS module with timing function is not needed, so that the cost is saved, and the cost of an enterprise is reduced. In this embodiment, the gateways perform time synchronization through the technical scheme provided in this embodiment, the error is only in ms level, so that the accuracy of time synchronization is greatly improved, when a large number of node devices use TDFD uplink data, the protection period of the uplink time window of the node devices can be shortened, the data transmission efficiency is greatly improved, the power consumption of the devices is reduced, and the service time of the devices is prolonged.
In some networks where the gateways have overlapping coverage, such as a lorewan network, or a self-developed cellular-like network, the task of scheduling the gateways may be accurate to the order of milliseconds, thereby reducing interference from node devices within the overlapping coverage of the gateways to receive instructions. Some nodes can uplink data from a plurality of gateways and form multipath data packets at the server side. At this time, the gateway time synchronization can enable a plurality of gateways in overlapping coverage to work cooperatively, and uplink by TD-FD, so as to furthest improve the communication efficiency and reduce the channel occupation of the half-duplex gateway for receiving and transmitting data.
In the present disclosure, there is no particular limitation on how the preliminary synchronization step is performed. As an alternative embodiment, as shown in fig. 7, the network delay includes an upstream network delay and a downstream network delay, and the network delay is calculated by the following formula:
Δ t_process =t 3 -t 2
wherein delta is delay Delta for network delay t_process Processing time length of time synchronization request sent by each gateway for server, t 1 Gateway time, t, for gateway to send time synchronization request to server 2 Server time, t, for server to receive time synchronization request from gateway 3 Server time, t, for server processing time synchronization request completion and issuing server time stamp 4 A gateway time of the server timestamp is received for the gateway. When the gateway is connected to the server through LTE, the unidirectional network delay is typically tens to 200ms, so the network uplink delay is considered to be approximately equal to the downlink delay, i.e. t, when calculated 2 -t 1 ≈t 4 -t 3
Because the server issue time is different from the gateway receiving time by one network downlink delay time, when the gateway sets time, the network delay needs to be compensated, so the server time acquired by each gateway is the sum of the network delay of the gateway and the server time stamp: t (T) gw =T tmstdelay T gw For server time, T tmst Is a server timestamp.
There are several gateways under one LoRa network, each gateway is synchronized with the server separately, i.e. the server time operated by different gateway ends is different, the network delay of the network up and down is assumed to be equal during calculation, and there may be a deviation in practice, the deviation is only delta at the maximum delay I.e. up delay 0, down delay full or down delay 0, up delay full. Therefore, it is assumed that the network delays of the upstream and downstream are equal and do not affect the synchronization accuracy.
In the present disclosure, there is no particular limitation on how the adjusting step is performed. As an alternative implementation, as shown in fig. 9, a gateway requiring calibration time requests a server to perform accurate synchronization every calibration period, selects a repeated node in a server storage under the coverage of the gateway, and issues a command to make the repeated node generate an uplink data packet once, and the data packet can be accurately synchronized by adopting a multipath data packet after uplink.
In the present disclosure, there is no particular limitation on how the adjusting step is performed. As an alternative implementation, since the crystal has problems of oscillation error, temperature drift, year drift, etc., if the system is synchronized only once, the time error between multiple gateways will become larger and larger over time, so the accumulated error is compared with the error threshold to reduce the operation error. As shown in fig. 10, the gateway records the time of the last accurate synchronization and its time difference from the second accurate synchronization, such as:
[
G1:[t1:-20,t2:0,t3:10,...],
......
]
in this embodiment, the time error is the difference between local time stamps of the gateways covering the repeating node, and when the time difference is accumulated to exceed the error threshold and the recorded time is not accurately synchronized, the gateway is accurately synchronized by the server.
Meanwhile, the present embodiment further provides a gateway, as shown in fig. 12, including: one or more processors 105;
a memory 106 having one or more computer programs stored thereon, which when executed by the one or more processors 105, cause the one or more processors 105 to implement the inter-gateway time synchronization method according to the first aspect of the present application.
The electronic device may further comprise one or more I/O interfaces 107 connected between the processor 105 and the memory 106 configured to enable information interaction of the processor 105 with the memory 106.
Wherein the processor 105 is a device having data processing capabilities, including but not limited to a central processing unit 105 (CPU) or the like; the first memory 106 is a device with data storage capability including, but not limited to, random access memory 106 (RAM, more specifically SDRAM, DDR, etc.), read-only memory 106 (ROM), electrically charged erasable programmable read-only memory 106 (EEPROM), FLASH memory (FLASH); an I/O interface 107 (read/write interface) is connected between the processor 105 and the memory 106 to enable information interaction between the processor 105 and the memory 106, including but not limited to a data Bus 108 (Bus) or the like.
In some embodiments, processor 105, memory 106, and I/O interface 107 are connected to each other and, in turn, to other components of the computing device via bus 108.
As a third aspect of the present application, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the inter-gateway time synchronization method provided in the first or second aspect of the present disclosure.
Those skilled in the art will appreciate that implementing all or part of the processes in the methods of the embodiments described above may be accomplished by computer programs to instruct related hardware. Accordingly, the computer program may be stored in a non-volatile computer readable storage medium, which when executed, performs the method of any of the above embodiments. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The above is only a specific embodiment of the present application, but the scope of the present application is not limited thereto, and it should be understood by those skilled in the art that the present application includes but is not limited to the accompanying drawings and the description of the above specific embodiment. Any modifications which do not depart from the functional and structural principles of the present application are intended to be included within the scope of the appended claims.

Claims (13)

1. The inter-gateway time synchronization method is used for a server and is characterized by comprising the following steps:
preliminary synchronization: receiving and processing time synchronization requests sent by the gateways;
accurate synchronization: receiving a data packet, wherein the data packet carries a gateway time stamp, calculating time difference among gateways covering repeated nodes according to the gateway time stamp, wherein the time difference is the time difference of the gateway time stamp, and the repeated nodes are nodes overlapped and covered by different gateways;
and (3) adjusting: and transmitting a calibration quantity to each gateway covering the repeated node based on the time difference so as to synchronize the time between each gateway.
2. The inter-gateway time synchronization method according to claim 1, wherein the server stores information of all gateways and information of all repetition nodes, the information of the gateway includes a synchronization state of the gateway including the number of preliminary synchronization and the number of accurate synchronization and a time difference between the gateway and other gateways, and the information of the repetition nodes includes a list of the gateways covering the repetition nodes.
3. The method for time synchronization between gateways according to claim 2, wherein when a newly added gateway is accessed to a server, the server performs primary synchronization on the newly added gateway once in response to a request of the newly added gateway, and stores information of the newly added gateway; when the gateway accessing the server is removed, the server deletes the information of the removed gateway.
4. A method of time synchronization between gateways according to any of claims 1 to 3, characterized in that the server accurately synchronizes the gateways covered by the repeating nodes from which the data packets are sent each time the data packets of the repeating nodes are received by the server.
5. A method of inter-gateway time synchronization according to any one of claims 1 to 3, wherein the server, in response to a gateway initiated accurate synchronization request, controls duplicate nodes under the gateway initiating the accurate synchronization request to accurately synchronize the gateway.
6. An inter-gateway time synchronization method for a gateway is characterized by comprising the following steps:
preliminary synchronization: sending a time synchronization request to a server, calculating network delay based on the processing of the time synchronization request by the server, and acquiring server time based on the network delay;
accurate synchronization: the repeated node sends data packets to a server through each gateway covering the repeated node, wherein the repeated node is a node overlapped by different gateways, and the data packets carry gateway time stamps of the gateways covering the repeated node;
and (3) adjusting: each gateway covering the repeating node receives the calibration quantity from the server for accurate time synchronization.
7. The inter-gateway time synchronization method of claim 6, wherein the network delay comprises an upstream network delay and a downstream network delay, the network delay being calculated by the following formula:
Δ t_process =t 3 -t 2
wherein delta is delay Delta for network delay t_process Processing time length of time synchronization request sent by each gateway for server, t 1 Gateway time, t, for gateway to send time synchronization request to server 2 Server time, t, for server to receive time synchronization request from gateway 3 Server time, t, for server processing time synchronization request completion and issuing server time stamp 4 A gateway time of the server timestamp is received for the gateway.
8. The method of inter-gateway time synchronization according to claim 7, wherein the server time obtained by each gateway is a sum of a network delay of the gateway and a server time stamp.
9. The method according to any one of claims 6 to 8, wherein the gateway requiring the calibration time requests accurate synchronization to the server every calibration period.
10. The method according to any one of claims 6 to 8, wherein the gateway records the time of the last exact synchronization and its time error from the second exact synchronization, said time error being the difference between the gateway local time stamps of the gateways covering the duplicate nodes, and the gateway is exactly synchronized by the server when the time difference accumulation exceeds the error threshold and the recorded time is not exactly synchronized.
11. A server, comprising:
one or more processors;
memory having one or more computer programs stored thereon, which when executed by the one or more processors cause the one or more processors to implement the inter-gateway time synchronization method of any of claims 1 to 5.
12. A gateway, comprising:
one or more processors;
memory having stored thereon one or more computer programs which, when executed by the one or more processors, cause the one or more processors to implement the inter-gateway time synchronization method of any of claims 6 to 10.
13. A computer readable medium on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the inter-gateway time synchronization method of any of claims 1 to 10.
CN202311118783.9A 2023-08-31 2023-08-31 Inter-gateway time synchronization method, server, gateway and computer readable medium Pending CN117241366A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311118783.9A CN117241366A (en) 2023-08-31 2023-08-31 Inter-gateway time synchronization method, server, gateway and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311118783.9A CN117241366A (en) 2023-08-31 2023-08-31 Inter-gateway time synchronization method, server, gateway and computer readable medium

Publications (1)

Publication Number Publication Date
CN117241366A true CN117241366A (en) 2023-12-15

Family

ID=89097671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311118783.9A Pending CN117241366A (en) 2023-08-31 2023-08-31 Inter-gateway time synchronization method, server, gateway and computer readable medium

Country Status (1)

Country Link
CN (1) CN117241366A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117979412A (en) * 2024-03-29 2024-05-03 江铃汽车股份有限公司 Internal time synchronization method and system for vehicle-mounted communication remote terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117979412A (en) * 2024-03-29 2024-05-03 江铃汽车股份有限公司 Internal time synchronization method and system for vehicle-mounted communication remote terminal

Similar Documents

Publication Publication Date Title
KR101749202B1 (en) Method, apparatus, and system for generating timestamp
US10284359B2 (en) Clock synchronization frequency offset estimation method adapted to WIA-PA network
US10334545B2 (en) Synchronizing time among two or more devices
TW506199B (en) Synchronization of time advance and deviation
WO2019205498A1 (en) Clock synchronization method and device for electric energy meter, computer device and storage medium
US7630383B2 (en) Synchronization of time stamps of peer devices in a communication node
CN117241366A (en) Inter-gateway time synchronization method, server, gateway and computer readable medium
CN109392074B (en) Clock calibration method and device
US20080031283A1 (en) Time synchronization for network aware devices
WO2015054123A1 (en) Transport and error compensation of a globally synchronized time-base
WO2021136149A1 (en) Clock synchronization method and apparatus, computer device, and storage medium
WO2020001367A1 (en) Time information correction method and device
US10484163B2 (en) Measure and improve clock synchronization using combination of transparent and boundary clocks
WO2015196685A1 (en) Clock synchronization method and apparatus
CN103905135A (en) Method, device and system for realizing time synchronization
WO2017054554A1 (en) Clock synchronization method, device, and communication apparatus
WO2016177090A1 (en) Clock synchronization method and device
CN111884745A (en) Time synchronization method, device, terminal, system and storage medium
CN113141648B (en) Timing information reporting method, terminal and network side equipment
US20230232347A1 (en) Data processing method and apparatus therefor
Leva et al. High-precision low-power wireless nodes’ synchronization via decentralized control
CN111884751A (en) Smart grid time synchronization method and device based on PTP
CN113037418B (en) Error correction method and related device for network time service
KR20210093789A (en) Method and apparatus for synchronization in wireless communication system
Wang et al. Slot time synchronization for TDMA-based ad hoc networks

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